From 32089199ece21fcdc8ec39a0c1f536617efbc070 Mon Sep 17 00:00:00 2001 From: "ultrasecr.eth" <241804+ultrasecreth@users.noreply.github.com> Date: Fri, 13 Oct 2023 19:51:02 +0100 Subject: [PATCH] Deploy wrappers to Polygon --- script/PolygonDeploy.s.sol | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 script/PolygonDeploy.s.sol diff --git a/script/PolygonDeploy.s.sol b/script/PolygonDeploy.s.sol new file mode 100644 index 0000000..05e2e09 --- /dev/null +++ b/script/PolygonDeploy.s.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity >=0.8.19 <=0.9.0; + +import { BaseScript } from "./Base.s.sol"; +import { console2 } from "forge-std/console2.sol"; + +import { Registry } from "lib/registry/src/Registry.sol"; + +import { UniswapV3Wrapper } from "../src/uniswapV3/UniswapV3Wrapper.sol"; +import { AaveWrapper, IPoolAddressesProvider } from "../src/aave/AaveWrapper.sol"; +import { BalancerWrapper, IFlashLoaner } from "../src/balancer/BalancerWrapper.sol"; + +/// @dev See the Solidity Scripting tutorial: https://book.getfoundry.sh/tutorials/solidity-scripting +contract MainnetDeploy is BaseScript { + bytes32 public constant SALT = keccak256("ERC7399-wrappers"); + + address internal factory = 0x1F98431c8aD98523631AE4a59f267346ea31F984; + address internal usdc = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174; + address internal usdt = 0xc2132D05D31c914a87C6611C10748AEb04B58e8F; + address internal weth = 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619; + + IFlashLoaner internal balancer = IFlashLoaner(0xBA12222222228d8Ba445958a75a0704d566BF2C8); + + IPoolAddressesProvider internal provider = IPoolAddressesProvider(0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb); + + function run() public broadcast("https://polygon.llamarpc.com") { + console2.log("Deploying as %s", msg.sender); + + Registry registry = new Registry{salt: SALT}(msg.sender); + + console2.log("Registry deployed at: %s", address(registry)); + + registry.set("UniswapV3Wrapper", abi.encode(factory, weth, usdc, usdt)); + UniswapV3Wrapper uniswapV3Wrapper = new UniswapV3Wrapper{salt: SALT}(registry); + console2.log("UniswapV3Wrapper deployed at: %s", address(uniswapV3Wrapper)); + + BalancerWrapper balancerWrapper = new BalancerWrapper{salt: SALT}(balancer); + console2.log("BalancerWrapper deployed at: %s", address(balancerWrapper)); + + AaveWrapper aaveWrapper = new AaveWrapper{salt: SALT}(provider); + console2.log("AaveWrapper deployed at: %s", address(aaveWrapper)); + } +}