Skip to content

Commit

Permalink
fix: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Jan 6, 2025
1 parent a85a2c2 commit 68bd2c0
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 62 deletions.
75 changes: 31 additions & 44 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
@@ -1,53 +1,40 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {MiscEthereum} from "aave-address-book/MiscEthereum.sol";
import {AaveV3Ethereum} from "aave-address-book/AaveV3Ethereum.sol";
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol';
import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';

import {MiscPolygon} from "aave-address-book/MiscPolygon.sol";
import {AaveV3Polygon} from "aave-address-book/AaveV3Polygon.sol";
import {MiscPolygon} from 'aave-address-book/MiscPolygon.sol';
import {AaveV3Polygon} from 'aave-address-book/AaveV3Polygon.sol';

import {MiscZkSync} from "aave-address-book/MiscZkSync.sol";
import {AaveV3ZkSync} from "aave-address-book/AaveV3ZkSync.sol";
import {MiscZkSync} from 'aave-address-book/MiscZkSync.sol';
import {AaveV3ZkSync} from 'aave-address-book/AaveV3ZkSync.sol';

import {GovV3Helpers} from "aave-helpers/src/GovV3Helpers.sol";
import {CollectorWithCustomImpl} from "../src/CollectorWithCustomImpl.sol";
import {CollectorWithCustomImplZkSync} from "../src/CollectorWithCustomImplZkSync.sol";
import {UpgradePayload} from "../src/UpgradePayload.sol";
import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol';
import {CollectorWithCustomImpl} from '../src/CollectorWithCustomImpl.sol';
import {CollectorWithCustomImplZkSync} from '../src/CollectorWithCustomImplZkSync.sol';
import {UpgradePayload} from '../src/UpgradePayload.sol';

library DeploymentLibrary {
function _deploy(
address collector,
address proxyAdmin
) private returns (address) {
address impl = GovV3Helpers.deployDeterministic(
type(CollectorWithCustomImpl).creationCode
);
return address(new UpgradePayload(collector, impl, proxyAdmin));
}

function _deployZk(
address collector,
address proxyAdmin
) private returns (address) {
address impl = address(new CollectorWithCustomImplZkSync{salt: "v1"}());
return address(new UpgradePayload(collector, impl, proxyAdmin));
}

function deployMainnet() internal returns (address) {
return
_deploy(
address(AaveV3Ethereum.COLLECTOR),
MiscEthereum.PROXY_ADMIN
);
}

function deployPolygon() internal returns (address) {
return
_deploy(address(AaveV3Polygon.COLLECTOR), MiscPolygon.PROXY_ADMIN);
}

function deployZkSync() internal returns (address) {
return _deploy(address(AaveV3ZkSync.COLLECTOR), MiscZkSync.PROXY_ADMIN);
}
function _deploy(address collector, address proxyAdmin) private returns (address) {
address impl = GovV3Helpers.deployDeterministic(type(CollectorWithCustomImpl).creationCode);
return address(new UpgradePayload(collector, impl, proxyAdmin));
}

function _deployZk(address collector, address proxyAdmin) private returns (address) {
address impl = address(new CollectorWithCustomImplZkSync{salt: 'v1'}());
return address(new UpgradePayload(collector, impl, proxyAdmin));
}

function deployMainnet() internal returns (address) {
return _deploy(address(AaveV3Ethereum.COLLECTOR), MiscEthereum.PROXY_ADMIN);
}

function deployPolygon() internal returns (address) {
return _deploy(address(AaveV3Polygon.COLLECTOR), MiscPolygon.PROXY_ADMIN);
}

function deployZkSync() internal returns (address) {
return _deploy(address(AaveV3ZkSync.COLLECTOR), MiscZkSync.PROXY_ADMIN);
}
}
2 changes: 1 addition & 1 deletion src/CollectorWithCustomImpl.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Collector, ICollector} from "aave-v3-origin/contracts/treasury/Collector.sol";
import {Collector, ICollector} from 'aave-v3-origin/contracts/treasury/Collector.sol';

/**
* @title Collector
Expand Down
2 changes: 1 addition & 1 deletion src/CollectorWithCustomImplZkSync.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Collector, ICollector} from "aave-v3-origin/contracts/treasury/Collector.sol";
import {Collector, ICollector} from 'aave-v3-origin/contracts/treasury/Collector.sol';

/**
* @title Collector
Expand Down
6 changes: 3 additions & 3 deletions src/UpgradePayload.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pragma solidity ^0.8.0;
import {
ITransparentUpgradeableProxy,
ProxyAdmin
} from "solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol";
import {IAccessControl} from "aave-v3-origin/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol";
import {Collector} from "aave-v3-origin/contracts/treasury/Collector.sol";
} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol';
import {IAccessControl} from 'aave-v3-origin/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol';
import {Collector} from 'aave-v3-origin/contracts/treasury/Collector.sol';

contract UpgradePayload {
address public immutable PROXY_ADMIN;
Expand Down
8 changes: 4 additions & 4 deletions test/Mainnet.t.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV3Ethereum, IPool} from "aave-address-book/AaveV3Ethereum.sol";
import {UpgradeTest} from "./UpgradeTest.sol";
import {DeploymentLibrary} from "../script/Deploy.s.sol";
import {AaveV3Ethereum, IPool} from 'aave-address-book/AaveV3Ethereum.sol';
import {UpgradeTest} from './UpgradeTest.sol';
import {DeploymentLibrary} from '../script/Deploy.s.sol';

contract MainnetTest is UpgradeTest {
constructor() UpgradeTest("mainnet", 21336615) {}
constructor() UpgradeTest('mainnet', 21336615) {}

function _getPayload() internal virtual override returns (address) {
return DeploymentLibrary.deployMainnet();
Expand Down
8 changes: 4 additions & 4 deletions test/Polygon.t.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV3Polygon, IPool} from "aave-address-book/AaveV3Polygon.sol";
import {UpgradeTest} from "./UpgradeTest.sol";
import {DeploymentLibrary} from "../script/Deploy.s.sol";
import {AaveV3Polygon, IPool} from 'aave-address-book/AaveV3Polygon.sol';
import {UpgradeTest} from './UpgradeTest.sol';
import {DeploymentLibrary} from '../script/Deploy.s.sol';

contract PolygonTest is UpgradeTest {
constructor() UpgradeTest("polygon", 65118236) {}
constructor() UpgradeTest('polygon', 65118236) {}

function _getPayload() internal virtual override returns (address) {
return DeploymentLibrary.deployPolygon();
Expand Down
10 changes: 5 additions & 5 deletions test/UpgradeTest.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "forge-std/Test.sol";
import {ProtocolV3TestBase, IPool, IPoolAddressesProvider} from "aave-helpers/src/ProtocolV3TestBase.sol";
import {Collector, ICollector, IERC20} from "aave-v3-origin/contracts/treasury/Collector.sol";
import {IAccessControl} from "aave-v3-origin/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol";
import {UpgradePayload} from "../src/UpgradePayload.sol";
import 'forge-std/Test.sol';
import {ProtocolV3TestBase, IPool, IPoolAddressesProvider} from 'aave-helpers/src/ProtocolV3TestBase.sol';
import {Collector, ICollector, IERC20} from 'aave-v3-origin/contracts/treasury/Collector.sol';
import {IAccessControl} from 'aave-v3-origin/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol';
import {UpgradePayload} from '../src/UpgradePayload.sol';

/**
* @dev Test for AaveV3EthereumLido_GHOListingOnLidoPool_20241119
Expand Down

0 comments on commit 68bd2c0

Please sign in to comment.