diff --git a/src/swaps/AaveSwapper.sol b/src/swaps/AaveSwapper.sol index d6f14ad8..c337b4cd 100644 --- a/src/swaps/AaveSwapper.sol +++ b/src/swaps/AaveSwapper.sol @@ -8,6 +8,7 @@ import {Rescuable} from 'solidity-utils/contracts/utils/Rescuable.sol'; import {OwnableWithGuardian} from 'solidity-utils/contracts/access-control/OwnableWithGuardian.sol'; import {Initializable} from 'solidity-utils/contracts/transparent-proxy/Initializable.sol'; import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; import {IPriceChecker} from './interfaces/IExpectedOutCalculator.sol'; import {IMilkman} from './interfaces/IMilkman.sol'; @@ -35,8 +36,8 @@ contract AaveSwapper is Initializable, OwnableWithGuardian, Rescuable { address public constant BAL80WETH20 = 0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56; function initialize() external initializer { - _transferOwnership(_msgSender()); - _updateGuardian(_msgSender()); + _transferOwnership(AaveGovernanceV2.SHORT_EXECUTOR); + _updateGuardian(0xA519a7cE7B24333055781133B13532AEabfAC81b); } function swap( diff --git a/src/swaps/AaveSwapperDeployment.s.sol b/src/swaps/AaveSwapperDeployment.s.sol new file mode 100644 index 00000000..e86c2e22 --- /dev/null +++ b/src/swaps/AaveSwapperDeployment.s.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT + +pragma solidity 0.8.19; + +import {Script} from 'forge-std/Script.sol'; +import {AaveMisc} from 'aave-address-book/AaveMisc.sol'; +import {TransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/TransparentProxyFactory.sol'; + +import {AaveSwapper} from './AaveSwapper.sol'; + +contract DeplyAaveSwapper is Script { + function run() external { + vm.startBroadcast(); + + address aaveSwapper = address(new AaveSwapper()); + TransparentProxyFactory(AaveMisc.TRANSPARENT_PROXY_FACTORY_ETHEREUM).create( + aaveSwapper, + AaveMisc.PROXY_ADMIN_ETHEREUM, + abi.encodeWithSelector(AaveSwapper.initialize.selector) + ); + + vm.stopBroadcast(); + } +}