Skip to content

Commit cbe8ee5

Browse files
committed
feat: update to use new proxy
1 parent 809dd8a commit cbe8ee5

File tree

9 files changed

+18
-63
lines changed

9 files changed

+18
-63
lines changed

src/contracts/extensions/stata-token/StataTokenFactory.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.10;
33

44
import {IERC20Metadata} from 'solidity-utils/contracts/oz-common/interfaces/IERC20Metadata.sol';
5-
import {ITransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol';
5+
import {ITransparentProxyFactory, ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol';
66
import {Initializable} from 'solidity-utils/contracts/transparent-proxy/Initializable.sol';
77
import {IPool, DataTypes} from '../../../contracts/interfaces/IPool.sol';
88
import {StataTokenV2} from './StataTokenV2.sol';
@@ -56,12 +56,12 @@ contract StataTokenFactory is Initializable, IStataTokenFactory {
5656
);
5757
address stataToken = TRANSPARENT_PROXY_FACTORY.createDeterministic(
5858
STATA_TOKEN_IMPL,
59-
PROXY_ADMIN,
59+
ProxyAdmin(PROXY_ADMIN),
6060
abi.encodeWithSelector(
6161
StataTokenV2.initialize.selector,
6262
reserveData.aTokenAddress,
6363
string(
64-
abi.encodePacked('Static ', IERC20Metadata(reserveData.aTokenAddress).name(), ' v2')
64+
abi.encodePacked('Stata ', IERC20Metadata(reserveData.aTokenAddress).name(), ' v2')
6565
),
6666
string(symbol)
6767
),

src/deployments/contracts/procedures/AaveV3HelpersProcedureTwo.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.0;
33

44
import '../../interfaces/IMarketReportTypes.sol';
5-
import {ITransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol';
5+
import {ITransparentProxyFactory, ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/interfaces/ITransparentProxyFactory.sol';
66
import {TransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/TransparentProxyFactory.sol';
77
import {StataTokenV2} from '../../../contracts/extensions/stata-token/StataTokenV2.sol';
88
import {StataTokenFactory} from '../../../contracts/extensions/stata-token/StataTokenFactory.sol';
@@ -33,7 +33,7 @@ contract AaveV3HelpersProcedureTwo is IErrors {
3333
staticATokenReport.transparentProxyFactory
3434
).create(
3535
staticATokenReport.staticATokenFactoryImplementation,
36-
proxyAdmin,
36+
ProxyAdmin(proxyAdmin),
3737
abi.encodeWithSelector(StataTokenFactory.initialize.selector)
3838
);
3939

src/deployments/contracts/procedures/AaveV3SetupProcedure.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.0;
33

44
import '../../interfaces/IMarketReportTypes.sol';
5-
import {IOwnable} from 'solidity-utils/contracts/transparent-proxy/interfaces/IOwnable.sol';
5+
import {Ownable} from '../../../contracts/dependencies/openzeppelin/contracts/Ownable.sol';
66
import {ACLManager} from '../../../contracts/protocol/configuration/ACLManager.sol';
77
import {IPoolConfigurator} from '../../../contracts/interfaces/IPoolConfigurator.sol';
88
import {IPoolAddressesProvider} from '../../../contracts/interfaces/IPoolAddressesProvider.sol';
@@ -99,7 +99,7 @@ contract AaveV3SetupProcedure {
9999
poolAddressesProvider,
100100
providerId
101101
);
102-
IOwnable(poolAddressesProviderRegistry).transferOwnership(marketOwner);
102+
Ownable(poolAddressesProviderRegistry).transferOwnership(marketOwner);
103103
} else {
104104
poolAddressesProviderRegistry = providerRegistry;
105105
}
@@ -137,7 +137,7 @@ contract AaveV3SetupProcedure {
137137
IRewardsController(report.rewardsControllerProxy).EMISSION_MANAGER()
138138
);
139139
emissionManager.setRewardsController(report.rewardsControllerProxy);
140-
IOwnable(address(emissionManager)).transferOwnership(input.poolAdmin);
140+
Ownable(address(emissionManager)).transferOwnership(input.poolAdmin);
141141
} else {
142142
provider.setAddress(controllerId, input.rewardsControllerProxy);
143143
report.rewardsControllerProxy = provider.getAddress(controllerId);
@@ -199,15 +199,15 @@ contract AaveV3SetupProcedure {
199199
}
200200

201201
function _transferMarketOwnership(Roles memory roles, InitialReport memory report) internal {
202-
address addressesProviderOwner = IOwnable(report.poolAddressesProvider).owner();
203-
address marketOwner = IOwnable(report.poolAddressesProviderRegistry).owner();
202+
address addressesProviderOwner = Ownable(report.poolAddressesProvider).owner();
203+
address marketOwner = Ownable(report.poolAddressesProviderRegistry).owner();
204204

205205
if (addressesProviderOwner == address(this)) {
206-
IOwnable(report.poolAddressesProvider).transferOwnership(roles.marketOwner);
206+
Ownable(report.poolAddressesProvider).transferOwnership(roles.marketOwner);
207207
}
208208

209209
if (marketOwner == address(this)) {
210-
IOwnable(report.poolAddressesProviderRegistry).transferOwnership(roles.marketOwner);
210+
Ownable(report.poolAddressesProviderRegistry).transferOwnership(roles.marketOwner);
211211
}
212212
}
213213

src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pragma solidity ^0.8.0;
33

44
import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol';
55
import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol';
6-
import {IOwnable} from 'solidity-utils/contracts/transparent-proxy/interfaces/IOwnable.sol';
76
import {Collector} from '../../../contracts/treasury/Collector.sol';
87
import '../../interfaces/IMarketReportTypes.sol';
98

@@ -30,7 +29,7 @@ contract AaveV3TreasuryProcedure {
3029
treasuryReport.treasury = address(
3130
new TransparentUpgradeableProxy{salt: salt}(
3231
treasuryReport.treasuryImplementation,
33-
deployedProxyAdmin,
32+
ProxyAdmin(deployedProxyAdmin),
3433
abi.encodeWithSelector(
3534
treasuryImplementation.initialize.selector,
3635
address(treasuryOwner),
@@ -46,7 +45,7 @@ contract AaveV3TreasuryProcedure {
4645
treasuryReport.treasury = address(
4746
new TransparentUpgradeableProxy(
4847
treasuryReport.treasuryImplementation,
49-
deployedProxyAdmin,
48+
ProxyAdmin(deployedProxyAdmin),
5049
abi.encodeWithSelector(
5150
treasuryImplementation.initialize.selector,
5251
address(treasuryOwner),

src/deployments/interfaces/IProxyAdmin.sol

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import {AaveV3TreasuryProcedure} from '../../../contracts/procedures/AaveV3Treas
55
import {AaveV3OracleProcedure} from '../../../contracts/procedures/AaveV3OracleProcedure.sol';
66
import {AaveV3IncentiveProcedure} from '../../../contracts/procedures/AaveV3IncentiveProcedure.sol';
77
import {AaveV3DefaultRateStrategyProcedure} from '../../../contracts/procedures/AaveV3DefaultRateStrategyProcedure.sol';
8-
import {IOwnable} from 'solidity-utils/contracts/transparent-proxy/interfaces/IOwnable.sol';
8+
import {Ownable} from '../../../../contracts/dependencies/openzeppelin/contracts/Ownable.sol';
99
import '../../../interfaces/IMarketReportTypes.sol';
1010
import {IRewardsController} from '../../../../contracts/rewards/interfaces/IRewardsController.sol';
11-
import {IOwnable} from 'solidity-utils/contracts/transparent-proxy/interfaces/IOwnable.sol';
1211
import {RevenueSplitter} from '../../../../contracts/treasury/RevenueSplitter.sol';
1312

1413
contract AaveV3PeripheryBatch is
@@ -25,8 +24,7 @@ contract AaveV3PeripheryBatch is
2524
address setupBatch
2625
) {
2726
if (config.proxyAdmin == address(0)) {
28-
_report.proxyAdmin = address(new ProxyAdmin{salt: config.salt}());
29-
IOwnable(_report.proxyAdmin).transferOwnership(poolAdmin);
27+
_report.proxyAdmin = address(new ProxyAdmin{salt: config.salt}(poolAdmin));
3028
} else {
3129
_report.proxyAdmin = config.proxyAdmin;
3230
}

tests/extensions/stata-token/StataTokenV2Getters.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ contract StataTokenV2GettersTest is BaseTest {
1616
}
1717

1818
function test_getters() public view {
19-
assertEq(stataTokenV2.name(), 'Static Aave Local WETH v2');
19+
assertEq(stataTokenV2.name(), 'Stata Aave Local WETH v2');
2020
assertEq(stataTokenV2.symbol(), 'stataLocWETHv2');
2121

2222
address referenceAsset = stataTokenV2.getReferenceAsset();

tests/extensions/stata-token/TestBase.sol

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ abstract contract BaseTest is TestnetProcedures {
6464
vm.warp(block.timestamp + blocks * 12); // assuming a block is around 12seconds
6565
}
6666

67-
function testAdmin() public {
68-
vm.stopPrank();
69-
vm.startPrank(proxyAdmin);
70-
assertEq(TransparentUpgradeableProxy(payable(address(stataTokenV2))).admin(), proxyAdmin);
71-
assertEq(TransparentUpgradeableProxy(payable(address(factory))).admin(), proxyAdmin);
72-
vm.stopPrank();
73-
}
74-
7567
function _fundUnderlying(uint256 assets, address receiver) internal {
7668
deal(underlying, receiver, assets);
7769
}

0 commit comments

Comments
 (0)