Skip to content

Commit 131e617

Browse files
committed
Update post L1 devnet deploy
Removed .env file from git Added hardhat config for L1 testnet and mainnet Alchemy as a provider Fixing a mistake Quick undo Latest changes for L1 mainnet deploy L1testnet run details Added a dummy transfer script A minor tidy up of step 0 and step 1 Further fixes to the deployment README Added a step0.ts Removed some hard coded values in .env.example
1 parent 123beae commit 131e617

32 files changed

+270
-42
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# /prod/imx-evm-relayer/EOA_SUBMITTER
2-
RELAYER_SUBMITTER_EOA_PUB_KEY=0x4bb20797f395Fa9a5eF02A5CB92256B4327F63Ce
3-
# /prod/imx-evm-relayer/IMMUTABLE_SIGNER_CONTRACT
4-
IMMUTABLE_SIGNER_PUB_KEY=0x71639470D21D69456D6e98e7Cc877ABA671ab7fA
1+
# Public key of primary Relayer submitter
2+
RELAYER_SUBMITTER_EOA_PUB_KEY=<CHANGE_ME>
3+
# Public key of the Immutable signer loaded from SM
4+
IMMUTABLE_SIGNER_PUB_KEY=<CHANGE_ME>
55

66
# Change this to match the address of the CREATE2 contract factory
77
DEPLOYER_CONTRACT_ADDRESS=<CHANGE_ME>

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ scripts/*_output*.json
2626

2727
# Ignore any environmental files with sensitive data
2828
.env
29+
.env.l1dev
2930
.env.localhost
3031
.env.devnet
3132
.env.testnet

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.17.0

hardhat.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,26 @@ const config: HardhatUserConfig = {
4141
url: 'https://rpc.dev.immutable.com',
4242
accounts: []
4343
},
44+
l1devnet: {
45+
url: 'https://rpc.ankr.com/eth_holesky',
46+
accounts: []
47+
},
4448
testnet: {
4549
url: 'https://rpc.testnet.immutable.com',
4650
accounts: []
4751
},
52+
l1testnet: {
53+
url: 'https://eth-sepolia.g.alchemy.com/v2/<CHANGE_ME>',
54+
accounts: []
55+
},
4856
mainnet: {
4957
url: 'https://rpc.immutable.com',
5058
accounts: []
5159
},
60+
l1mainnet: {
61+
url: 'https://eth-mainnet.g.alchemy.com/v2/<CHANGE_ME>',
62+
accounts: []
63+
},
5264
},
5365
mocha: {
5466
timeout: process.env.COVERAGE ? 15 * 60 * 1000 : 30 * 1000

scripts/README.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,64 +41,84 @@ in the `contract.ts` file.
4141

4242
## Step 5
4343

44-
Create a `.env` file. Use the `env.example` as a template.
44+
Create a `.env` file. Use the `env.example` as a template. Set the following values in the `.env`
45+
46+
* Set the DEPLOYER_CONTRACT_ADDRESS to match the address of the OwnableCreate2Deployer factory.
47+
* Set the MULTICALL_ADMIN_PUB_KEY and FACTORY_ADMIN_PUB_KEY to match the address of the address of the privileged transaction multisig. This address for reference should be `0x0E2D55943f4EF07c336C12A85d083c20FF189182`.
4548

4649
## Execution steps
4750

51+
### `step0.ts`
52+
53+
In this step we deploy the `MultiCallDeploy` only. We use the standard deployment key (Orange key) for this deployment, as the address of the MultiCallDeploy strictly does
54+
not need to be the same across all the environments.
55+
56+
* Set the value of RELAYER_SUBMITTER_EOA_PUB_KEY to match the EOA of the primary Relayer submitter. The Submitter EOA is granted execute permission on the MultiCallDeploy.
57+
* Set the value of MULTICALL_ADMIN_PUB_KEY
58+
* Set the `accountIndex` to 0 in `wallet-options.ts`.
59+
* Execute the command `npx hardhat run scripts/step0.ts --network <ENV>`
60+
4861
### `step1.ts`
4962

50-
In this step we deploy the `MultiCallDeploy`, and the `Factory` contracts. We use the Passport Nonce reserver
63+
In this step we deploy the `Factory` contract. We use the Passport Nonce reserver
5164
in this step because we want the `Factory` contract to have the same address across all our chains, as
5265
this address is used to produce a deterministic counter factual address for the smart contract wallets across
5366
all the chains.
5467

55-
* Set the `accountIndex` to 10.
68+
* Set the value of RELAYER_SUBMITTER_EOA_PUB_KEY to match the EOA of the primary Relayer submitter.
69+
* Set the value of the FACTORY_ADMIN_PUB_KEY to the privileged mulstisig pub key (Purple ledger)
70+
* Set the value of `multiCallDeployAddress` to match the address of the contract deployed in Step0.
71+
* Set the `accountIndex` to 10 in `wallet-options.ts`.
5672
* Execute the command `npx hardhat run scripts/step1.ts --network <ENV>`
5773

5874
### `step2.ts`
5975

6076
In this step we deploy the contract that tracks the location of the latest wallet implementation. As this step
61-
just uses the CREATE2 contract factory we use the standard deployment key.
77+
just uses the CREATE2 contract factory we use the standard deployment key (Orange Key!!!).
6278

79+
* Set the value of DEPLOYER_CONTRACT_ADDRESS to the address of the CREATE2 factory contract.
80+
* Set the value of WALLET_IMPL_LOCATOR_ADMIN, and WALLET_IMPL_CHANGER_ADMIN environment variables to the public key of the Privileged key.
6381
* Set the `accountIndex` to 0.
6482
* Execute the command `npx hardhat run scripts/step2.ts --network <ENV>`
6583

6684
### `step3.ts`
6785

68-
In this step we deploy the startup wallet. This wallet address is used to generate the CFA, and hence like the Factory
69-
uses a Passport nonce reserver key.
86+
In this step we deploy the startup wallet. This wallet address is used to generate the CFA, and hence like the Factory uses a Passport nonce reserver key.
7087

7188
* Set the `accountIndex` to 10.
89+
* WARNING: COPY the `LatestWalletImplLocator` address into the `step3.ts` script from step2.
7290
* Execute the command `npx hardhat run scripts/step3.ts --network <ENV>`
73-
* WARNING: COPY the `LatestWalletImplLocator` address into the `step3.ts` script from step2.
7491

7592
### `step4.ts`
7693

77-
In this step we deploy the `MainModuleDynamicAuth` module, and it can simply use the standard deployment key.
94+
In this step we deploy the `MainModuleDynamicAuth` module, and it should use the standard deployment key (Orange Key!!!)
7895

7996
* Set the `accountIndex` to 0.
97+
* WARNING: COPY the `FactoryAddress` address into the `step4.ts` script from step1.
98+
* WARNING: COPY the `StartupWalletImpl` address into the `step4.ts` script from step3.
8099
* Execute the command `npx hardhat run scripts/step4.ts --network <ENV>`
81-
* WARNING: COPY the `FactoryAddress` address into the `step4.ts` script from step1.
82-
* WARNING: COPY the `StartupWalletImpl` address into the `step4.ts` script from step3.
83100

84101
### `step5.ts`
85102

86103
In this step we deploy the Signer contract, which is also used to generate the CFA, and hence like the Factory, and
87-
Startup wallet implementation, we use the Passport nonce reserver key in this step.
104+
Startup wallet implementation, we use the Passport nonce reserver key (Black Key!!!) in this step.
88105

89106
* Set the `accountIndex` to 10.
107+
* Set the SIGNER_ROOT_ADMIN_PUB_KEY to the Privileged public key.
108+
* Set the SIGNER_ADMIN_PUB_KEY to the relevant Breakglass public key.
109+
* Set the IMMUTABLE_SIGNER_PUB_KEY
90110
* Execute the command `npx hardhat run scripts/step5.ts --network <ENV>`
91111

92112
### `step6.ts`
93113

94114
In this step we point the `LatestWalletImplLocator` to the `MainModuleDynamicAuth` module address. In this step
95-
we use the privileged deployment key, as we gave this key authority to alter the implementation address in `step2.ts`
115+
we use the privileged deployment key (Purple Key!!!), as we gave this key authority to alter the implementation address in `step2.ts`.
96116
above.
97117

98118
* Set the `accountIndex` to 10.
119+
* WARNING: COPY the `MainModuleDynamicAuth` address into the `step6.ts` script from step4.
120+
* WARNING: COPY the `LatestWalletImplLocator` address into the `step6.ts` script from step2.
99121
* Execute the command `npx hardhat run scripts/step6.ts --network <ENV>`
100-
* WARNING: COPY the `MainModuleDynamicAuth` address into the `step6.ts` script from step4.
101-
* WARNING: COPY the `LatestWalletImplLocator` address into the `step6.ts` script from step2.
102122

103123
## Update Relayer and Passport Environment
104124

scripts/contract.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const getSaltFromKey = (): string => {
1717
};
1818

1919
/**
20-
* Load the OwnableCreate2Deployer
20+
* Load the OwnableCreate2Deployer
2121
*/
2222
const loadDeployerContract = async (env: EnvironmentInfo, walletOptions: WalletOptions): Promise<Contract> => {
2323
return new Contract(env.deployerContractAddress, ContractDeployerInterface.abi, walletOptions.getWallet());
@@ -39,8 +39,8 @@ export async function deployContractViaCREATE2(
3939

4040
// Deploy the contract
4141
let tx = await deployer.deploy(bytecode, salt, {
42-
gasLimit: 30000000,
43-
maxFeePerGas: 10000000000,
42+
gasLimit: 10_000_000,
43+
maxFeePerGas: 40000000000,
4444
maxPriorityFeePerGas: 10000000000,
4545
});
4646
await tx.wait();
@@ -62,9 +62,9 @@ export async function deployContract(
6262
constructorArgs: Array<string | undefined>): Promise<Contract> {
6363
const contractFactory: ContractFactory = await newContractFactory(walletsOptions.getWallet(), contractName);
6464
const contract: Contract = await contractFactory.connect(walletsOptions.getWallet()).deploy(...constructorArgs, {
65-
gasLimit: 30000000,
66-
maxFeePerGas: 10000000000,
67-
maxPriorityFeePerGas: 10000000000,
65+
gasLimit: 100000,
66+
maxFeePerGas: 30000000000,
67+
maxPriorityFeePerGas: 1000000000,
6868
});
6969
console.log(`[${env.network}] Deployed ${contractName} to ${contract.address}`);
7070
return contract;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"multiCallAdminPubKey": "0x0E2D55943f4EF07c336C12A85d083c20FF189182",
3+
"factoryAdminPubKey": "0x0E2D55943f4EF07c336C12A85d083c20FF189182",
4+
"multiCallDeploy": "0x307d214799D3B1625D1eC70F83d170d5fd0ee5A1",
5+
"factory": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d"
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"walletImplLocatorAdmin": "0x0E2D55943f4EF07c336C12A85d083c20FF189182",
3+
"walletImplChangerAdmin": "0x0E2D55943f4EF07c336C12A85d083c20FF189182",
4+
"latestWalletImplLocator": "0x889b5e1B25351AB543bf6D81bFD0777EA02EC879"
5+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"walletImplLocatorAddress": "0x889b5e1B25351AB543bf6D81bFD0777EA02EC879",
3+
"startupWalletImpl": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926"
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"factoryAddress": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d",
3+
"startupWalletImplAddress": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926",
4+
"mainModuleDynamicAuth": "0x9e9Ee944fEB02F4D05B02950ca118027D2Db3cF2"
5+
}

0 commit comments

Comments
 (0)