Skip to content

Commit

Permalink
chore: add arbitrum and bnb deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
0xChin committed Nov 20, 2024
1 parent 4a763a7 commit 036d26d
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 5 deletions.
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
"build": "forge build",
"build:optimized": "FOUNDRY_PROFILE=optimized forge build",
"coverage": "forge coverage --report summary --report lcov --match-path 'test/unit/*'",
"deploy:arbitrum": "bash -c 'source .env && TESTING=false forge script Deploy -vvvvv --rpc-url $ARBITRUM_RPC --broadcast --chain arbitrum --account dev --verify'",
"deploy:arbitrum-sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $ARBITRUM_SEPOLIA_RPC --broadcast --chain arbitrum-sepolia --account dev --verify --verifier blockscout --verifier-url https://arbitrum-sepolia.blockscout.com/api/'",
"deploy:base": "bash -c 'source .env && TESTING=false forge script Deploy -vvvvv --rpc-url $BASE_RPC --broadcast --chain base --account dev --verify'",
"deploy:bnb": "bash -c 'source .env && TESTING=false forge script Deploy -vvvvv --rpc-url $BNB_RPC --broadcast --chain 56 --account dev --verify'",
"deploy:mainnet": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --account dev'",
"deploy:optimism": "bash -c 'source .env && TESTING=false forge script Deploy -vvvvv --rpc-url $OPTIMISM_RPC --broadcast --chain optimism --account dev --verify'",
"deploy:optimism-sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $OPTIMISM_SEPOLIA_RPC --broadcast --chain optimism-sepolia --account dev --verify --verifier blockscout --verifier-url https://optimism-sepolia.blockscout.com/api/'",
"deploy:polygon": "bash -c 'source .env && TESTING=false forge script Deploy -vvvvv --rpc-url $POLYGON_RPC --broadcast --chain polygon --account dev --verify'",
"deploy:sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --account dev'",
"deploy:v-optimism": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $VIRTUAL_OPTIMISM_RPC --broadcast --account dev --verify'",
"lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check",
Expand All @@ -26,12 +30,14 @@
"lint:sol-tests": "solhint -c .solhint.tests.json 'test/**/*.sol'",
"prepare": "husky install",
"test": "TESTING=true FORKED_NETWORK=mainnet FORK_BLOCK=18920905 forge test -vvv ",
"test:arbitrum": "TESTING=true FORKED_NETWORK=arbitrum FORK_BLOCK=236334831 forge test -vvv ",
"test:arbitrum-sepolia": "TESTING=true FORKED_NETWORK=arbitrum-sepolia FORK_BLOCK=98684306 forge test -vvv ",
"test:bnb": "TESTING=true FORKED_NETWORK=bnb FORK_BLOCK=44138162 forge test -vvv ",
"test:fuzz": "echidna test/invariants/fuzz/Greeter.t.sol --contract InvariantGreeter --corpus-dir test/invariants/fuzz/echidna_coverage/ --test-mode assertion",
"test:integration": "TESTING=true FORKED_NETWORK=mainnet FORK_BLOCK=18920905 forge test --match-contract Integration -vvv",
"test:optimism": "TESTING=true FORKED_NETWORK=optimism FORK_BLOCK=121238511 forge test -vvv ",
"test:optimism-sepolia": "TESTING=true FORKED_NETWORK=optimism-sepolia FORK_BLOCK=20113040 forge test -vvv ",
"test:polygon": "TESTING=true FORKED_NETWORK=polygon FORK_BLOCK=53501016 forge test -vvv ",
"test:polygon": "TESTING=true FORKED_NETWORK=polygon FORK_BLOCK=62103393 forge test -vvv ",
"test:symbolic": "halmos",
"test:unit": "forge test --match-contract Unit -vvv",
"test:unit:deep": "FOUNDRY_FUZZ_RUNS=5000 yarn test:unit"
Expand Down
68 changes: 64 additions & 4 deletions script/Deploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,66 @@ contract Deploy is Script {
initialPerformanceFee: 0.05 ether, // 5%
vaults: _vaults
});
} else if (chainId == CHAIN_ARBITRUM) {
address[] memory _tokens = new address[](3);
_tokens[0] = address(0xaf88d065e77c8cC2239327C5EDb3A432268e5831); // USDC
_tokens[1] = address(0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9); // USDT
_tokens[2] = address(0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1); // DAI

VaultDeploymentParams[] memory _vaults = new VaultDeploymentParams[](3);

_vaults[0] = VaultDeploymentParams({
token: address(0xaf88d065e77c8cC2239327C5EDb3A432268e5831), // USDC
aToken: address(0x724dc807b04555b71ed48a6896b6F41593b8C637), // aUSDC
rewardsController: address(0x929EC64c34a17401F460460D4B9390518E5B473e) // Rewards Controller
});

_vaults[1] = VaultDeploymentParams({
token: address(0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9), // USDT
aToken: address(0x6ab707Aca953eDAeFBc4fD23bA73294241490620), // aUSDT
rewardsController: address(0x929EC64c34a17401F460460D4B9390518E5B473e) // Rewards Controller
});

_vaults[2] = VaultDeploymentParams({
token: address(0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1), // DAI
aToken: address(0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE), // aDAI
rewardsController: address(0x929EC64c34a17401F460460D4B9390518E5B473e) // Rewards Controller
});

params = DeploymentParams({
tokens: _tokens,
aavePool: IPool(0x794a61358D6845594F94dc1DB02A252b5b4814aD),
initialFee: 0.01 ether, // 1%
initialPerformanceFee: 0.05 ether, // 5%
vaults: _vaults
});
} else if (chainId == CHAIN_BNB) {
address[] memory _tokens = new address[](3);
_tokens[0] = address(0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d); // USDC
_tokens[1] = address(0x55d398326f99059fF775485246999027B3197955); // USDT
_tokens[2] = address(0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1); // DAI

VaultDeploymentParams[] memory _vaults = new VaultDeploymentParams[](2);

_vaults[0] = VaultDeploymentParams({
token: address(0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d), // USDC
aToken: address(0x00901a076785e0906d1028c7d6372d247bec7d61), // aUSDC
rewardsController: address(0xC206C2764A9dBF27d599613b8F9A63ACd1160ab4) // Rewards Controller
});

_vaults[1] = VaultDeploymentParams({
token: address(0x55d398326f99059fF775485246999027B3197955), // USDT
aToken: address(0xa9251ca9DE909CB71783723713B21E4233fbf1B1), // aUSDT
rewardsController: address(0xC206C2764A9dBF27d599613b8F9A63ACd1160ab4) // Rewards Controller
});

params = DeploymentParams({
tokens: _tokens,
aavePool: IPool(0x6807dc923806fE8Fd134338EABCA509979a7e0cB),
initialFee: 0.01 ether, // 1%
initialPerformanceFee: 0.05 ether, // 5%
vaults: _vaults
});
} else if (chainId == CHAIN_OPTIMISM_SEPOLIA) {
address[] memory _tokens = new address[](1);
_tokens[0] = address(0x5fd84259d66Cd46123540766Be93DFE6D43130D7);
Expand Down Expand Up @@ -199,9 +259,9 @@ contract Deploy is Script {
function run() public {
DeploymentParams memory _params = getDeploymentParams(block.chainid);

if (!vm.envBool("TESTING")) {
/* if (!vm.envBool("TESTING")) {
vm.startBroadcast();
}
} */

grateful = new Grateful(_params.tokens, _params.aavePool, _params.initialFee, _params.initialPerformanceFee);
grateful.transferOwnership(GRATEFUL_MULTISIG);
Expand All @@ -227,8 +287,8 @@ contract Deploy is Script {
vaults[vaultParams.token] = vault;
}

if (!vm.envBool("TESTING")) {
/* if (!vm.envBool("TESTING")) {
vm.stopBroadcast();
}
} */
}
}

0 comments on commit 036d26d

Please sign in to comment.