feat: Deploy on mainnet
Also update executors.json with uniswap v2 address on mainnet --- don't change below this line --- ENG-4101 Took 22 minutes Took 7 seconds
This commit is contained in:
@@ -14,7 +14,11 @@ module.exports = {
|
|||||||
|
|
||||||
networks: {
|
networks: {
|
||||||
tenderly: {
|
tenderly: {
|
||||||
url: process.env.TENDERLY_RPC_URL,
|
url: process.env.RPC_URL,
|
||||||
|
accounts: [process.env.PRIVATE_KEY]
|
||||||
|
},
|
||||||
|
mainnet: {
|
||||||
|
url: process.env.RPC_URL,
|
||||||
accounts: [process.env.PRIVATE_KEY]
|
accounts: [process.env.PRIVATE_KEY]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# How to deploy
|
# How to deploy
|
||||||
|
|
||||||
- Install dependencies `npm install`
|
- Install dependencies `npm install`
|
||||||
|
- `cd foundry`
|
||||||
|
|
||||||
## Deploy on a Tenderly fork
|
## Deploy on a Tenderly fork
|
||||||
|
|
||||||
@@ -8,24 +9,38 @@
|
|||||||
2. Set the following environment variables:
|
2. Set the following environment variables:
|
||||||
|
|
||||||
```
|
```
|
||||||
export TENDERLY_RPC_URL=<fork-rpc-from-tenderly>
|
export RPC_URL=<fork-rpc-from-tenderly>
|
||||||
export DEPLOY_WALLET=<wallet-address>
|
export DEPLOY_WALLET=<wallet-address>
|
||||||
export PRIVATE_KEY=<private-key>
|
export PRIVATE_KEY=<private-key>
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Fund wallet: `npx hardhat run scripts/fund-wallet-tenderly-fork.js --network tenderly`
|
3. Fund wallet: `npx hardhat run scripts/fund-wallet-tenderly-fork.js --network tenderly`
|
||||||
|
|
||||||
### Deploy Tycho Router
|
## Deploy on mainnet
|
||||||
|
|
||||||
1. Deploy router: `npx hardhat run scripts/deploy-router.js --network tenderly`
|
1. Set the following environment variables:
|
||||||
|
|
||||||
|
```
|
||||||
|
export RPC_URL=<mainnet-rpc-url>
|
||||||
|
export DEPLOY_WALLET=<wallet-address>
|
||||||
|
export PRIVATE_KEY=<private-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
|
||||||
|
|
||||||
|
1. Deploy router: `npx hardhat run scripts/deploy-router.js --network tenderly/mainnet`
|
||||||
2. Define the accounts to grant roles to in `scripts/roles.json`
|
2. Define the accounts to grant roles to in `scripts/roles.json`
|
||||||
3. Export the router address to the environment variable `export ROUTER=<router-address>`
|
3. Export the router address to the environment variable `export ROUTER=<router-address>`
|
||||||
4. Grant roles: `npx hardhat run scripts/set-roles.js --network tenderly`
|
4. Grant roles: `npx hardhat run scripts/set-roles.js --network tenderly/mainnet`
|
||||||
5. Set executors: `npx hardhat run scripts/set-executors.js --network tenderly`. Make sure you change the DEPLOY_WALLET
|
5. Set executors: `npx hardhat run scripts/set-executors.js --network tenderly/mainnet`. Make sure you change the
|
||||||
|
DEPLOY_WALLET
|
||||||
to the executor deployer wallet. If you need to deploy executors, follow the instructions below.
|
to the executor deployer wallet. If you need to deploy executors, follow the instructions below.
|
||||||
|
|
||||||
### Deploy executors
|
### Deploy executors
|
||||||
|
|
||||||
1. In `scripts/deploy-executors.js` define the executors to be deployed
|
1. In `scripts/deploy-executors.js` define the executors to be deployed
|
||||||
2. Deploy executors: `npx hardhat run scripts/deploy-executors.js --network tenderly`
|
2. Deploy executors: `npx hardhat run scripts/deploy-executors.js --network tenderly/mainnet`
|
||||||
3. Fill in the executor addresses in `scripts/executors.json`
|
3. Fill in the executor addresses in `scripts/executors.json`
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ const hre = require("hardhat");
|
|||||||
// Comment out the executors you don't want to deploy
|
// Comment out the executors you don't want to deploy
|
||||||
const executors_to_deploy = [
|
const executors_to_deploy = [
|
||||||
{exchange: "UniswapV2Executor", args: []},
|
{exchange: "UniswapV2Executor", args: []},
|
||||||
{exchange: "UniswapV3Executor", args: ["0x1F98431c8aD98523631AE4a59f267346ea31F984"]},
|
// {exchange: "UniswapV3Executor", args: ["0x1F98431c8aD98523631AE4a59f267346ea31F984"]},
|
||||||
{exchange: "UniswapV4Executor", args: ["0x000000000004444c5dc75cB358380D2e3dE08A90"]},
|
// {exchange: "UniswapV4Executor", args: ["0x000000000004444c5dc75cB358380D2e3dE08A90"]},
|
||||||
{exchange: "BalancerV2Executor", args: []},
|
// {exchange: "BalancerV2Executor", args: []},
|
||||||
]
|
]
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|||||||
@@ -1,18 +1,6 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "UniswapV2Executor",
|
"name": "UniswapV2Executor",
|
||||||
"executor": "0xFF804342b632bd2C210643c005Ef139c0AaeBa0c"
|
"executor": "0x00C1b81e3C8f6347E69e2DDb90454798A6Be975E"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "UniswapV3Executor",
|
|
||||||
"executor": "0xb45f428357174C8d9DfB56E7ccf87EDdB8fDa5C6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "UniswapV4Executor",
|
|
||||||
"executor": "0x0E759000F3C1FFEe31ecc56D125EB796151F556E"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "BalancerV2Executor",
|
|
||||||
"executor": "0x14702382b81e6d8677321ed904edd6ec3ea7e3dc"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
{
|
{
|
||||||
"EXECUTOR_SETTER_ROLE": [
|
"EXECUTOR_SETTER_ROLE": [
|
||||||
"0xcd09f75E2BF2A4d11F3AB23f1389FcC1621c0cc2"
|
"0x58Dc7Bf9eD1f4890A7505D5bE4E4252978eAF655"
|
||||||
],
|
|
||||||
"FEE_SETTER_ROLE": [
|
|
||||||
"0xcd09f75E2BF2A4d11F3AB23f1389FcC1621c0cc2"
|
|
||||||
],
|
],
|
||||||
|
"FEE_SETTER_ROLE": [],
|
||||||
"PAUSER_ROLE": [
|
"PAUSER_ROLE": [
|
||||||
"0xcd09f75E2BF2A4d11F3AB23f1389FcC1621c0cc2"
|
"0x58Dc7Bf9eD1f4890A7505D5bE4E4252978eAF655"
|
||||||
],
|
],
|
||||||
"UNPAUSER_ROLE": [
|
"UNPAUSER_ROLE": [
|
||||||
"0xcd09f75E2BF2A4d11F3AB23f1389FcC1621c0cc2"
|
"0x58Dc7Bf9eD1f4890A7505D5bE4E4252978eAF655"
|
||||||
],
|
],
|
||||||
"FUND_RESCUER_ROLE": [
|
"FUND_RESCUER_ROLE": [
|
||||||
"0xcd09f75E2BF2A4d11F3AB23f1389FcC1621c0cc2"
|
"0x58Dc7Bf9eD1f4890A7505D5bE4E4252978eAF655"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ethereum": {
|
"ethereum": {
|
||||||
"uniswap_v2": "0x5C2F5a71f67c01775180ADc06909288B4C329308",
|
"uniswap_v2": "0x00C1b81e3C8f6347E69e2DDb90454798A6Be975E",
|
||||||
"uniswap_v3": "0x5C2F5a71f67c01775180ADc06909288B4C329308",
|
"uniswap_v3": "0x5C2F5a71f67c01775180ADc06909288B4C329308",
|
||||||
"uniswap_v4": "0xF62849F9A0B5Bf2913b396098F7c7019b51A820a",
|
"uniswap_v4": "0xF62849F9A0B5Bf2913b396098F7c7019b51A820a",
|
||||||
"vm:balancer_v2": "0x543778987b293C7E8Cf0722BB2e935ba6f4068D4"
|
"vm:balancer_v2": "0x543778987b293C7E8Cf0722BB2e935ba6f4068D4"
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ mod tests {
|
|||||||
let hex_protocol_data = encode(&protocol_data);
|
let hex_protocol_data = encode(&protocol_data);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
executor_address,
|
executor_address,
|
||||||
Bytes::from_str("0x5c2f5a71f67c01775180adc06909288b4c329308").unwrap()
|
Bytes::from_str("0x00C1b81e3C8f6347E69e2DDb90454798A6Be975E").unwrap()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
hex_protocol_data,
|
hex_protocol_data,
|
||||||
@@ -669,7 +669,7 @@ mod tests {
|
|||||||
"01", // token out index
|
"01", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
// Swap data
|
// Swap data
|
||||||
"5c2f5a71f67c01775180adc06909288b4c329308", // executor address
|
"00c1b81e3c8f6347e69e2ddb90454798a6be975e", // executor address
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||||
"a478c2975ab1ea89e8196811f51a7b7ade33eb11", // component id
|
"a478c2975ab1ea89e8196811f51a7b7ade33eb11", // component id
|
||||||
"3ede3eca2a72b3aecc820e955b36f38437d01395", // receiver
|
"3ede3eca2a72b3aecc820e955b36f38437d01395", // receiver
|
||||||
@@ -1076,7 +1076,7 @@ mod tests {
|
|||||||
"01", // token out index
|
"01", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
// Swap data
|
// Swap data
|
||||||
"5c2f5a71f67c01775180adc06909288b4c329308", // executor address
|
"00c1b81e3c8f6347e69e2ddb90454798a6be975e", // executor address
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||||
"a478c2975ab1ea89e8196811f51a7b7ade33eb11", // component id
|
"a478c2975ab1ea89e8196811f51a7b7ade33eb11", // component id
|
||||||
"3ede3eca2a72b3aecc820e955b36f38437d01395", // receiver
|
"3ede3eca2a72b3aecc820e955b36f38437d01395", // receiver
|
||||||
|
|||||||
Reference in New Issue
Block a user