Skip to content

Commit

Permalink
feat: add tenderly virtual testnet deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
0xblu committed Sep 4, 2024
1 parent 15aca03 commit 9d56630
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ SEPOLIA_DEPLOYER_PK=
OPTIMISM_SEPOLIA_RPC=https://opt-sepolia.g.alchemy.com/v2/YNob1yS6fZux6Fs44VAybG3JXP4k8QgN
OPTIMISM_SEPOLIA_DEPLOYER_PK=<deployer-pk>

VIRTUAL_OPTIMISM_RPC=
TENDERLY_ACCESS_KEY=
TENDERLY_VERIFIER_URL=

ETHERSCAN_API_KEY=ZIGN5Y8QXYQ5SH17D4RA2YQWNM2DP62S89
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ optimism-sepolia = "${OPTIMISM_SEPOLIA_RPC}"
mainnet = { key = "${ETHERSCAN_API_KEY}", chain = "mainnet" }
sepolia = { key = "${ETHERSCAN_API_KEY}", chain = "sepolia" }
optimism-sepolia = { key = "${ETHERSCAN_API_KEY}", chain = "optimism-sepolia" }
unknown_chain = { key = "${TENDERLY_ACCESS_KEY}", chain = 4924, url = "${VIRTUAL_OPTIMISM_RPC}/verify/etherscan" }
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"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'",
"deploy:v-optimism": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $VIRTUAL_OPTIMISM_RPC --broadcast --private-key $OPTIMISM_DEPLOYER_PK --verify'",
"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",
"lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js",
Expand Down
7 changes: 7 additions & 0 deletions script/Deploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@ contract Deploy is Script {
address[] memory _tokens = new address[](1);
_tokens[0] = address(0x5fd84259d66Cd46123540766Be93DFE6D43130D7);

address[] memory _tokensOptimism = new address[](2);
_tokensOptimism[0] = address(0x7F5c764cBc14f9669B88837ca1490cCa17c31607);
_tokensOptimism[1] = address(0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1);

// Mainnet
_deploymentParams[1] = DeploymentParams(_tokens, IPool(0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2));

// Optimism Sepolia
_deploymentParams[11_155_420] = DeploymentParams(_tokens, IPool(0xb50201558B00496A145fE76f7424749556E326D8));

// V-Optimism
_deploymentParams[4924] = DeploymentParams(_tokensOptimism, IPool(0x794a61358D6845594F94dc1DB02A252b5b4814aD));
}

function run() public {
Expand Down

0 comments on commit 9d56630

Please sign in to comment.