-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated post deployment to Devnet, and Testnet
- Loading branch information
Showing
23 changed files
with
206 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,87 @@ | ||
# Steps for deploying to hardhat | ||
|
||
1. Startup a Hardhat node. | ||
2. Transfer funds to the ledger. | ||
3. Deploy the `OwnableCreate2Deployer` contract using the ledger. The Ledger is now the owner of the contract, and the | ||
only entity allowed to call the deploy function on the contract; | ||
1. forge create --rpc-url <http://127.0.0.1:8545> --constructor-args "<ADDRESS_OF_LEDGER_ACCOUNT>" --legacy --hd-path "m/44'/60'/0'/0/0" src/OwnableCreate2Deployer.sol:OwnableCreate2Deployer. | ||
4. Set the value of DEPLOYER_CONTRACT_ADDRESS in the environment to equal the address of the OwnableCreate2Deployer contract deployed of step 3 above. | ||
5. Set the deployer key to be a unique value for the run. | ||
6. Copy the relevant `.env.X` file to `.env`. For example in the case of Devnet `cp .env.devnet .env` | ||
7. Execute the command `npx hardhat run scripts/step1.ts --network <ENV>` | ||
8. Execute the command `npx hardhat run scripts/step2.ts --network <ENV>` | ||
9. Execute the command `npx hardhat run scripts/step3.ts --network <ENV>` | ||
1. WARNING: COPY the `LatestWalletImplLocator` address into the `step3.ts` script from step2. | ||
10. Execute the command `npx hardhat run scripts/step4.ts --network <ENV>` | ||
1. WARNING: COPY the `FactoryAddress` address into the `step4.ts` script from step1. | ||
2. WARNING: COPY the `StartupWalletImpl` address into the `step4.ts` script from step3. | ||
11. Execute the command `npx hardhat run scripts/step5.ts --network <ENV>` | ||
12. Execute the command `npx hardhat run scripts/step6.ts --network <ENV>` | ||
1. WARNING: COPY the `MainModuleDynamicAuth` address into the `step6.ts` script from step4. | ||
1. WARNING: COPY the `LatestWalletImplLocator` address into the `step6.ts` script from step2. | ||
13. Edit the following environment variables in the Relayer in the `.env.local` and `local-deployment.yaml` files | ||
1. DEPLOY_AND_EXECUTE_ADDRESS to equal the address of the `MultiCallDeploy` | ||
2. FACTORY_ADDRESS to equal the address of the `Factory` | ||
3. MAIN_MODULE_ADDRESS to equal the address of the `StartupWalletImpl` | ||
4. IMMUTABLE_SIGNER_CONTRACT_ADDRESS to equal the address of the `ImmutableSigner` | ||
|
||
# Steps for deploying to Devnet | ||
|
||
1. If the `OwnableCreate2Deployer` contract has not been deployed, deploy it using the ledger. The Ledger is now the owner of the contract, and the | ||
only entity allowed to call the deploy function on the contract; | ||
1. forge create --rpc-url <https://rpc.dev.immutable.com> --constructor-args "<ADDRESS_OF_LEDGER_ACCOUNT>" --legacy --hd-path "m/44'/60'/0'/0/0" src/OwnableCreate2Deployer.sol:OwnableCreate2Deployer. | ||
2. Set the value of DEPLOYER_CONTRACT_ADDRESS in the environment to equal the address of the OwnableCreate2Deployer contract deployed of step 1 above. | ||
3. Set the deployer key to be a unique value for the run. | ||
4. Execute the command `npx npm run deployToDevnet`. | ||
1. IMPORTANT: Remember to copy the correct `.env.X` file into `.env` before execution. | ||
5. Edit the following environment variables in the Relayer in the `.env.local` and `local-deployment.yaml` files | ||
1. DEPLOY_AND_EXECUTE_ADDRESS to equal the address of the `MultiCallDeploy` | ||
2. FACTORY_ADDRESS to equal the address of the `Factory` | ||
3. MAIN_MODULE_ADDRESS to equal the address of the `StartupWalletImpl` | ||
4. IMMUTABLE_SIGNER_CONTRACT_ADDRESS to equal the address of the `ImmutableSigner` | ||
# Steps for deploying | ||
|
||
The smart contract wallets require 3 ledgers for deployment. The first ledger uses the Passport nonce reserver. The second ledger is a deployment ledger, and the third ledger is the priviledged ledger. Some of the steps below need to signed using the Passport nonce reserver, whilst use the standard deployment ledger, and finally the priviledged ledger. The corresponding ledgers are labelled in each step. | ||
|
||
The ledgers used in the deployment have the following public keys; | ||
|
||
* Passport Nonce Reserver - `0x5780B22CCd5830595C9EC79a8E273ee83Be79d17` | ||
* Deployment Key - `0xdDA0d9448Ebe3eA43aFecE5Fa6401F5795c19333` | ||
* Priviledged Key - `0x0E2D55943f4EF07c336C12A85d083c20FF189182` | ||
|
||
## Step 1 | ||
|
||
Startup a Hardhat node if testing locally. | ||
|
||
## Step 2 | ||
|
||
Transfer funds to the 3 ledgers used for the procedure. ~10 IMX will suffice for the operation. | ||
|
||
## Step 3 | ||
|
||
Deploy the `OwnableCreate2Deployer` contract using the deployment ledger. Remember to set the correct owner of the contract during the deployment. For example the contract can be deployed using the command below; | ||
|
||
`forge create --rpc-url <http://127.0.0.1:8545> --constructor-args "<ADDRESS_OF_LEDGER_ACCOUNT>" --legacy --hd-path "m/44'/60'/0'/0/0" src/OwnableCreate2Deployer.sol:OwnableCreate2Deployer` | ||
|
||
The contract factory repo is located [here](https://github.com/immutable/contract-deployer). Please note that you shouldn't deploy the contract factory for Testnet, or Mainnet. Instead use the pre-existing deployments, the addresses for which are located [here]().:whilst | ||
|
||
Set the value of DEPLOYER_CONTRACT_ADDRESS in the environment to equal the address of the OwnableCreate2Deployer contract deployed above. | ||
|
||
## Step 4 | ||
|
||
Set the deployer key to be a unique value for the run. | ||
|
||
## Step 5 | ||
|
||
Copy the relevant `.env.X` file to `.env`. For example in the case of Devnet `cp .env.devnet .env` | ||
|
||
## Execution steps | ||
|
||
### `step1.ts` | ||
|
||
Use the Passport Nonce Reserver Key | ||
|
||
* Execute the command `npx hardhat run scripts/step1.ts --network <ENV>` | ||
|
||
### `step2.ts` | ||
|
||
Use a deployer key. This key will have privileges to change the implementation address. | ||
|
||
* Execute the command `npx hardhat run scripts/step2.ts --network <ENV>` | ||
|
||
### `step3.ts` | ||
|
||
Use the Passport Nonce Reserver Key | ||
|
||
* Execute the command `npx hardhat run scripts/step3.ts --network <ENV>` | ||
* WARNING: COPY the `LatestWalletImplLocator` address into the `step3.ts` script from step2. | ||
|
||
### `step4.ts` | ||
|
||
Use a deployer key | ||
|
||
* Execute the command `npx hardhat run scripts/step4.ts --network <ENV>` | ||
* WARNING: COPY the `FactoryAddress` address into the `step4.ts` script from step1. | ||
* WARNING: COPY the `StartupWalletImpl` address into the `step4.ts` script from step3. | ||
|
||
### `step5.ts` | ||
|
||
Use the Passport Nonce Reserver Key | ||
|
||
* Execute the command `npx hardhat run scripts/step5.ts --network <ENV>` | ||
|
||
### `step6.ts` | ||
|
||
Use the priviledged key for this step. | ||
|
||
* Execute the command `npx hardhat run scripts/step6.ts --network <ENV>` | ||
* WARNING: COPY the `MainModuleDynamicAuth` address into the `step6.ts` script from step4. | ||
* WARNING: COPY the `LatestWalletImplLocator` address into the `step6.ts` script from step2. | ||
|
||
## Update Relayer and Passport Environment | ||
|
||
Edit the following environment variables in the Relayer in the `.env.local` and `local-deployment.yaml` files | ||
|
||
* DEPLOY_AND_EXECUTE_ADDRESS to equal the address of the `MultiCallDeploy` | ||
* FACTORY_ADDRESS to equal the address of the `Factory` | ||
* MAIN_MODULE_ADDRESS to equal the address of the `StartupWalletImpl` | ||
* IMMUTABLE_SIGNER_CONTRACT_ADDRESS to equal the address of the `ImmutableSigner` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"multiCallAdminPubKey": "0x575be326c482a487add43974e0eaf232e3366e13", | ||
"factoryAdminPubKey": "0xddb70ddcd14dbd57ae18ec591f47454e4fc818bb", | ||
"multiCallDeploy": "0x307d214799D3B1625D1eC70F83d170d5fd0ee5A1", | ||
"factory": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"walletImplLocatorAdmin": "0xb49c99a17776c10350c2be790e13d4d8dfb1c578", | ||
"latestWalletImplLocator": "0x1E1bB567c106B7D52710b3cD9553F84061355904" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"walletImplLocatorAddress": "0x1E1bB567c106B7D52710b3cD9553F84061355904", | ||
"startupWalletImpl": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"factoryAddress": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d", | ||
"startupWalletImplAddress": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926", | ||
"mainModuleDynamicAuth": "0x9e9Ee944fEB02F4D05B02950ca118027D2Db3cF2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"signerRootAdminPubKey": "0x65af83f71a05d7f6d06ef9a57c9294b4128ccc2c", | ||
"signerAdminPubKey": "0x69d09644159e7327dbfd0af9a66f8e332c593e79", | ||
"immutableSigner": "0xcff469E561D9dCe5B1185CD2AC1Fa961F8fbDe61" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"multiCallAdminPubKey": "0x575be326c482a487add43974e0eaf232e3366e13", | ||
"factoryAdminPubKey": "0xddb70ddcd14dbd57ae18ec591f47454e4fc818bb", | ||
"multiCallDeploy": "0x307d214799D3B1625D1eC70F83d170d5fd0ee5A1", | ||
"factory": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"walletImplLocatorAdmin": "0xb49c99a17776c10350c2be790e13d4d8dfb1c578", | ||
"latestWalletImplLocator": "0x36d1c7aB8856aB2E8262fb9789c673EFBCE33f57" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"walletImplLocatorAddress": "0x36d1c7aB8856aB2E8262fb9789c673EFBCE33f57", | ||
"startupWalletImpl": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"factoryAddress": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d", | ||
"startupWalletImplAddress": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926", | ||
"mainModuleDynamicAuth": "0x1Af03254dc160616F7bFFBDe55Bb26799eF2b51C" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"signerRootAdminPubKey": "0x65af83f71a05d7f6d06ef9a57c9294b4128ccc2c", | ||
"signerAdminPubKey": "0x69d09644159e7327dbfd0af9a66f8e332c593e79", | ||
"immutableSigner": "0xcff469E561D9dCe5B1185CD2AC1Fa961F8fbDe61" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"multiCallAdminPubKey": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", | ||
"factoryAdminPubKey": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", | ||
"multiCallDeploy": "0x307d214799D3B1625D1eC70F83d170d5fd0ee5A1", | ||
"factory": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"walletImplLocatorAdmin": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", | ||
"walletImplChangerAdmin": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", | ||
"latestWalletImplLocator": "0xDF3d36188b561F621B0aA993eA89FB95d3761356" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"walletImplLocatorAddress": "0xDF3d36188b561F621B0aA993eA89FB95d3761356", | ||
"startupWalletImpl": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"factoryAddress": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d", | ||
"startupWalletImplAddress": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926", | ||
"mainModuleDynamicAuth": "0x0649E0E24d498B0DF987c4AAa18E95D9879e9fcF" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"signerRootAdminPubKey": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", | ||
"signerAdminPubKey": "0x3aF5DE2846aB3195BCD7b8880483E63D21261c49", | ||
"signerAddress": "0x1cE50560686b1297B6311F36B47dbe5d6E04D0f8", | ||
"immutableSigner": "0xcff469E561D9dCe5B1185CD2AC1Fa961F8fbDe61" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.