2.1 KiB
2.1 KiB
How to deploy
- Install dependencies
npm install cd foundry
Deploy on a Tenderly fork
- Make a new fork in tenderly dashboard for the chain that you wish to deploy on.
- Set the following environment variables:
export RPC_URL=<fork-rpc-from-tenderly>
export DEPLOY_WALLET=<wallet-address>
export PRIVATE_KEY=<private-key>
- Fund wallet:
npx hardhat run scripts/fund-wallet-tenderly-fork.js --network tenderly
Deploy on Ethereum Mainnet or Base
- Set the following environment variables:
export RPC_URL=<chain-rpc-url>
export DEPLOY_WALLET=<wallet-address>
export PRIVATE_KEY=<private-key>
export BLOCKCHAIN_EXPLORER_API_KEY=<blockchain-explorer-api-key>
Make sure to run unset HISTFILE in your terminal before setting the private key. This will prevent the private key
from being stored in the shell history.
Deploy Tycho Router
For each of the following, you must select one of tenderly_ethereum, tenderly_base,
ethereum, base, or unichain as the network.
- Deploy router:
npx hardhat run scripts/deploy-router.js --network NETWORK - Define the accounts to grant roles to in
scripts/roles.json - Export the router address to the environment variable
export ROUTER_ADDRESS=<router-address> - Grant roles:
npx hardhat run scripts/set-roles.js --network NETWORK - Set executors:
npx hardhat run scripts/set-executors.js --network NETWORK. Make sure you change the DEPLOY_WALLET to the executor deployer wallet. If you need to deploy executors, follow the instructions below.
Deploy executors
- In
scripts/deploy-executors.jsdefine the executors to be deployed - Deploy executors:
npx hardhat run scripts/deploy-executors.js --network NETWORK - Fill in the executor addresses in
config/executor_addresses.json
Remove executors
- If you set a new executor for the same protocol, you need to remove the old one.
- Run:
npx hardhat run scripts/remove-executor.js --network NETWORK - There will be a prompt for you to insert the executor address you want to remove.