diff --git a/foundry.toml b/foundry.toml index a2c225e2..03394283 100644 --- a/foundry.toml +++ b/foundry.toml @@ -4,7 +4,7 @@ test = 'tests' script = 'scripts' optimizer = true optimizer_runs = 200 -solc = '0.8.20' +solc = '0.8.21' evm_version = 'shanghai' bytecode_hash = 'none' ignored_warnings_from = ["src/periphery/contracts/treasury/RevenueSplitter.sol"] @@ -12,9 +12,9 @@ out = 'out' libs = ['lib'] remappings = [] fs_permissions = [ - { access = "write", path = "./reports" }, - { access = "read", path = "./out" }, - { access = "read", path = "./config" }, + { access = "write", path = "./reports" }, + { access = "read", path = "./out" }, + { access = "read", path = "./config" }, ] ffi = true diff --git a/lib/solidity-utils b/lib/solidity-utils index 6f72233c..a4402881 160000 --- a/lib/solidity-utils +++ b/lib/solidity-utils @@ -1 +1 @@ -Subproject commit 6f72233c112ed0df5b6c3e02a2a3d04a56e3b2bc +Subproject commit a4402881fbb5ef452253dcf4c35599896461bee5 diff --git a/src/contracts/extensions/stata-token/StataTokenFactory.sol b/src/contracts/extensions/stata-token/StataTokenFactory.sol index 3de7890a..e47d6751 100644 --- a/src/contracts/extensions/stata-token/StataTokenFactory.sol +++ b/src/contracts/extensions/stata-token/StataTokenFactory.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.10; import {IERC20Metadata} from 'solidity-utils/contracts/oz-common/interfaces/IERC20Metadata.sol'; -import {ITransparentProxyFactory, ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol'; +import {ITransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol'; import {Initializable} from 'solidity-utils/contracts/transparent-proxy/Initializable.sol'; import {IPool, DataTypes} from '../../../contracts/interfaces/IPool.sol'; import {StataTokenV2} from './StataTokenV2.sol'; @@ -20,7 +20,7 @@ contract StataTokenFactory is Initializable, IStataTokenFactory { IPool public immutable POOL; ///@inheritdoc IStataTokenFactory - address public immutable PROXY_ADMIN; + address public immutable INITIAL_OWNER; ///@inheritdoc IStataTokenFactory ITransparentProxyFactory public immutable TRANSPARENT_PROXY_FACTORY; @@ -35,12 +35,12 @@ contract StataTokenFactory is Initializable, IStataTokenFactory { constructor( IPool pool, - address proxyAdmin, + address initialOwner, ITransparentProxyFactory transparentProxyFactory, address stataTokenImpl ) { POOL = pool; - PROXY_ADMIN = proxyAdmin; + INITIAL_OWNER = initialOwner; TRANSPARENT_PROXY_FACTORY = transparentProxyFactory; STATA_TOKEN_IMPL = stataTokenImpl; } @@ -62,7 +62,7 @@ contract StataTokenFactory is Initializable, IStataTokenFactory { ); address stataToken = TRANSPARENT_PROXY_FACTORY.createDeterministic( STATA_TOKEN_IMPL, - ProxyAdmin(PROXY_ADMIN), + INITIAL_OWNER, abi.encodeWithSelector( StataTokenV2.initialize.selector, reserveData.aTokenAddress, diff --git a/src/contracts/extensions/stata-token/interfaces/IStataTokenFactory.sol b/src/contracts/extensions/stata-token/interfaces/IStataTokenFactory.sol index 5566d023..ee22809e 100644 --- a/src/contracts/extensions/stata-token/interfaces/IStataTokenFactory.sol +++ b/src/contracts/extensions/stata-token/interfaces/IStataTokenFactory.sol @@ -14,10 +14,10 @@ interface IStataTokenFactory { function POOL() external view returns (IPool); /** - * @notice The proxy admin used for all tokens created via the factory. - * @return The proxy admin address. + * @notice The initial owner used for all tokens created via the factory. + * @return The address of the initial owner. */ - function PROXY_ADMIN() external view returns (address); + function INITIAL_OWNER() external view returns (address); /** * @notice The proxy factory used for all tokens created via the stata factory. diff --git a/src/deployments/contracts/procedures/AaveV3HelpersProcedureTwo.sol b/src/deployments/contracts/procedures/AaveV3HelpersProcedureTwo.sol index 12890f5d..4a1981d9 100644 --- a/src/deployments/contracts/procedures/AaveV3HelpersProcedureTwo.sol +++ b/src/deployments/contracts/procedures/AaveV3HelpersProcedureTwo.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import '../../interfaces/IMarketReportTypes.sol'; -import {ITransparentProxyFactory, ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol'; +import {ITransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol'; import {TransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/TransparentProxyFactory.sol'; import {StataTokenV2} from '../../../contracts/extensions/stata-token/StataTokenV2.sol'; import {StataTokenFactory} from '../../../contracts/extensions/stata-token/StataTokenFactory.sol'; @@ -12,9 +12,9 @@ contract AaveV3HelpersProcedureTwo is IErrors { function _deployStaticAToken( address pool, address rewardsController, - address proxyAdmin + address poolAdmin ) internal returns (StaticATokenReport memory staticATokenReport) { - if (proxyAdmin == address(0)) revert ProxyAdminNotFound(); + if (poolAdmin == address(0)) revert PoolAdminNotFound(); staticATokenReport.transparentProxyFactory = address(new TransparentProxyFactory()); staticATokenReport.staticATokenImplementation = address( @@ -23,7 +23,7 @@ contract AaveV3HelpersProcedureTwo is IErrors { staticATokenReport.staticATokenFactoryImplementation = address( new StataTokenFactory( IPool(pool), - proxyAdmin, + poolAdmin, ITransparentProxyFactory(staticATokenReport.transparentProxyFactory), staticATokenReport.staticATokenImplementation ) @@ -33,7 +33,7 @@ contract AaveV3HelpersProcedureTwo is IErrors { staticATokenReport.transparentProxyFactory ).create( staticATokenReport.staticATokenFactoryImplementation, - ProxyAdmin(proxyAdmin), + poolAdmin, abi.encodeWithSelector(StataTokenFactory.initialize.selector) ); diff --git a/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol b/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol index 76f6650b..580097d3 100644 --- a/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol @@ -1,8 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; -import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; +import {TransparentUpgradeableProxy} from 'openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol'; import {Collector} from '../../../contracts/treasury/Collector.sol'; import '../../interfaces/IMarketReportTypes.sol'; @@ -29,7 +28,7 @@ contract AaveV3TreasuryProcedure { treasuryReport.treasury = address( new TransparentUpgradeableProxy{salt: salt}( treasuryReport.treasuryImplementation, - ProxyAdmin(deployedProxyAdmin), + poolAdmin, abi.encodeWithSelector( treasuryImplementation.initialize.selector, address(treasuryOwner), @@ -45,7 +44,7 @@ contract AaveV3TreasuryProcedure { treasuryReport.treasury = address( new TransparentUpgradeableProxy( treasuryReport.treasuryImplementation, - ProxyAdmin(deployedProxyAdmin), + poolAdmin, abi.encodeWithSelector( treasuryImplementation.initialize.selector, address(treasuryOwner), diff --git a/src/deployments/interfaces/IErrors.sol b/src/deployments/interfaces/IErrors.sol index 7d0df80a..e865485b 100644 --- a/src/deployments/interfaces/IErrors.sol +++ b/src/deployments/interfaces/IErrors.sol @@ -5,5 +5,5 @@ interface IErrors { error L2MustBeEnabled(); error L2MustBeDisabled(); error ProviderNotFound(); - error ProxyAdminNotFound(); + error PoolAdminNotFound(); } diff --git a/src/deployments/interfaces/IMarketReportTypes.sol b/src/deployments/interfaces/IMarketReportTypes.sol index afa6a2e2..e6be3d11 100644 --- a/src/deployments/interfaces/IMarketReportTypes.sol +++ b/src/deployments/interfaces/IMarketReportTypes.sol @@ -22,7 +22,7 @@ import '../../contracts/extensions/paraswap-adapters/ParaSwapWithdrawSwapAdapter import '../../contracts/helpers/interfaces/IWrappedTokenGatewayV3.sol'; import '../../contracts/helpers/L2Encoder.sol'; import {ICollector} from '../../contracts/treasury/ICollector.sol'; -import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; +import {ProxyAdmin} from 'openzeppelin-contracts/contracts/proxy/transparent/ProxyAdmin.sol'; struct ContractsReport { IPoolAddressesProviderRegistry poolAddressesProviderRegistry; diff --git a/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol b/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol index 1ef2ee87..87a76cc1 100644 --- a/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol +++ b/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol @@ -98,7 +98,7 @@ library AaveV3BatchOrchestration { StaticATokenReport memory staticATokenReport = _deployHelpersBatch2( setupReport.poolProxy, setupReport.rewardsControllerProxy, - peripheryReport.proxyAdmin + roles.poolAdmin ); // Save final report at AaveV3SetupBatch contract @@ -191,12 +191,12 @@ library AaveV3BatchOrchestration { function _deployHelpersBatch2( address pool, address rewardsController, - address proxyAdmin + address poolAdmin ) internal returns (StaticATokenReport memory) { AaveV3HelpersBatchTwo helpersBatchTwo = new AaveV3HelpersBatchTwo( pool, rewardsController, - proxyAdmin + poolAdmin ); return helpersBatchTwo.staticATokenReport(); diff --git a/src/deployments/projects/aave-v3-batched/batches/AaveV3HelpersBatchTwo.sol b/src/deployments/projects/aave-v3-batched/batches/AaveV3HelpersBatchTwo.sol index 1db9f7b9..eb52c646 100644 --- a/src/deployments/projects/aave-v3-batched/batches/AaveV3HelpersBatchTwo.sol +++ b/src/deployments/projects/aave-v3-batched/batches/AaveV3HelpersBatchTwo.sol @@ -7,8 +7,8 @@ import '../../../interfaces/IMarketReportTypes.sol'; contract AaveV3HelpersBatchTwo is AaveV3HelpersProcedureTwo { StaticATokenReport internal _report; - constructor(address pool, address rewardsController, address proxyAdmin) { - _report = _deployStaticAToken(pool, rewardsController, proxyAdmin); + constructor(address pool, address rewardsController, address poolAdmin) { + _report = _deployStaticAToken(pool, rewardsController, poolAdmin); } function staticATokenReport() external view returns (StaticATokenReport memory) { diff --git a/tests/deployments/AaveV3BatchTests.t.sol b/tests/deployments/AaveV3BatchTests.t.sol index 2252b7ce..2849fd40 100644 --- a/tests/deployments/AaveV3BatchTests.t.sol +++ b/tests/deployments/AaveV3BatchTests.t.sol @@ -200,7 +200,7 @@ contract AaveV3BatchTests is BatchTestProcedures { new AaveV3HelpersBatchTwo( setupReportTwo.poolProxy, setupReportTwo.rewardsControllerProxy, - peripheryReportOne.proxyAdmin + roles.poolAdmin ); } } diff --git a/tests/deployments/DeploymentsGasLimits.t.sol b/tests/deployments/DeploymentsGasLimits.t.sol index 98e2da92..e1fb5138 100644 --- a/tests/deployments/DeploymentsGasLimits.t.sol +++ b/tests/deployments/DeploymentsGasLimits.t.sol @@ -185,7 +185,7 @@ contract DeploymentsGasLimits is BatchTestProcedures { new AaveV3HelpersBatchTwo( setupReportTwo.poolProxy, setupReportTwo.rewardsControllerProxy, - peripheryReportOne.proxyAdmin + roles.poolAdmin ); } diff --git a/tests/extensions/stata-token/TestBase.sol b/tests/extensions/stata-token/TestBase.sol index e7cfab41..55080744 100644 --- a/tests/extensions/stata-token/TestBase.sol +++ b/tests/extensions/stata-token/TestBase.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.10; import {IERC20Metadata, IERC20} from 'openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol'; -import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; +import {TransparentUpgradeableProxy} from 'openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol'; import {ITransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol'; import {StataTokenFactory} from '../../../src/contracts/extensions/stata-token/StataTokenFactory.sol'; import {StataTokenV2} from '../../../src/contracts/extensions/stata-token/StataTokenV2.sol';