diff --git a/foundry.toml b/foundry.toml index e0b9146..e7a0924 100644 --- a/foundry.toml +++ b/foundry.toml @@ -30,7 +30,9 @@ runs = 1000 [rpc_endpoints] mainnet = "${MAINNET_RPC}" sepolia = "${SEPOLIA_RPC}" +optimism-sepolia = "${OPTIMISM_SEPOLIA_RPC}" [etherscan] mainnet = { key = "${ETHERSCAN_API_KEY}", chain = "mainnet" } sepolia = { key = "${ETHERSCAN_API_KEY}", chain = "sepolia" } +optimism-sepolia = { key = "${ETHERSCAN_API_KEY}", chain = "optimism-sepolia" } diff --git a/package.json b/package.json index 583126e..96b3659 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "build:optimized": "FOUNDRY_PROFILE=optimized forge build", "coverage": "forge coverage --report summary --report lcov --match-path 'test/unit/*'", "deploy:mainnet": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK'", + "deploy:optimism-sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $OPTIMISM_SEPOLIA_RPC --broadcast --chain optimism-sepolia --private-key $OPTIMISM_SEPOLIA_DEPLOYER_PK --verify --verifier blockscout --verifier-url https://optimism-sepolia.blockscout.com/api/'", "deploy:sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK'", "lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check", "lint:fix": "sort-package-json && forge fmt && yarn lint:sol-tests --fix && yarn lint:sol-logic --fix", diff --git a/script/Deploy.sol b/script/Deploy.sol index 39c7e2f..9a6cab8 100644 --- a/script/Deploy.sol +++ b/script/Deploy.sol @@ -2,9 +2,10 @@ pragma solidity 0.8.26; import {Grateful} from "contracts/Grateful.sol"; +import {AaveV3Vault} from "contracts/vaults/AaveV3Vault.sol"; import {Script} from "forge-std/Script.sol"; -import {IERC20} from "forge-std/interfaces/IERC20.sol"; -import {IPool} from "yield-daddy/aave-v3/AaveV3ERC4626.sol"; +import {ERC20} from "solmate/tokens/ERC20.sol"; +import {IPool, IRewardsController} from "yield-daddy/aave-v3/AaveV3ERC4626.sol"; contract Deploy is Script { struct DeploymentParams { @@ -17,20 +18,29 @@ contract Deploy is Script { function setUp() public { address[] memory _tokens = new address[](1); - _tokens[0] = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); + _tokens[0] = address(0x5fd84259d66Cd46123540766Be93DFE6D43130D7); // Mainnet _deploymentParams[1] = DeploymentParams(_tokens, IPool(0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2)); - // Sepolia - _deploymentParams[11_155_111] = DeploymentParams(_tokens, IPool(0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951)); + // Optimism Sepolia + _deploymentParams[11_155_420] = DeploymentParams(_tokens, IPool(0xb50201558B00496A145fE76f7424749556E326D8)); } function run() public { DeploymentParams memory _params = _deploymentParams[block.chainid]; vm.startBroadcast(); - new Grateful(_params.tokens, _params.aavePool); + Grateful _grateful = new Grateful(_params.tokens, _params.aavePool); + AaveV3Vault _vault = new AaveV3Vault( + ERC20(_params.tokens[0]), + ERC20(0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97), + _params.aavePool, + address(0), + IRewardsController(0x8164Cc65827dcFe994AB23944CBC90e0aa80bFcb), + address(_grateful) + ); + _grateful.addVault(_params.tokens[0], address(_vault)); vm.stopBroadcast(); } }