Skip to content

Commit

Permalink
Deploy wrappers to Polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrasecreth committed Oct 13, 2023
1 parent 8721435 commit 3208919
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions script/PolygonDeploy.s.sol
Original file line number Diff line number Diff line change
@@ -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));
}
}

0 comments on commit 3208919

Please sign in to comment.