diff --git a/scripts/README.md b/scripts/README.md index b3c25b3..a43dfe0 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -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 --constructor-args "" --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 ` -8. Execute the command `npx hardhat run scripts/step2.ts --network ` -9. Execute the command `npx hardhat run scripts/step3.ts --network ` - 1. WARNING: COPY the `LatestWalletImplLocator` address into the `step3.ts` script from step2. -10. Execute the command `npx hardhat run scripts/step4.ts --network ` - 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 ` -12. Execute the command `npx hardhat run scripts/step6.ts --network ` - 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 --constructor-args "" --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 --constructor-args "" --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 ` + +### `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 ` + +### `step3.ts` + +Use the Passport Nonce Reserver Key + +* Execute the command `npx hardhat run scripts/step3.ts --network ` + * 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 ` + * 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 ` + +### `step6.ts` + +Use the priviledged key for this step. + +* Execute the command `npx hardhat run scripts/step6.ts --network ` + * 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` diff --git a/scripts/contract.ts b/scripts/contract.ts index b86ec61..71157bd 100644 --- a/scripts/contract.ts +++ b/scripts/contract.ts @@ -60,9 +60,12 @@ export async function deployContract( walletsOptions: WalletOptions, contractName: string, constructorArgs: Array): Promise { - const contractFactory: ContractFactory = await newContractFactory(walletsOptions.getWallet(), contractName); - const contract: Contract = await contractFactory.connect(walletsOptions.getWallet()).deploy(...constructorArgs); + const contract: Contract = await contractFactory.connect(walletsOptions.getWallet()).deploy(...constructorArgs, { + gasLimit: 30000000, + maxFeePerGas: 10000000000, + maxPriorityFeePerGas: 10000000000, + }); console.log(`[${env.network}] Deployed ${contractName} to ${contract.address}`); return contract; } \ No newline at end of file diff --git a/scripts/deployment_artefacts/devnet_deploy/step1.json b/scripts/deployment_artefacts/devnet_deploy/step1.json new file mode 100644 index 0000000..0a50c2f --- /dev/null +++ b/scripts/deployment_artefacts/devnet_deploy/step1.json @@ -0,0 +1,6 @@ +{ + "multiCallAdminPubKey": "0x575be326c482a487add43974e0eaf232e3366e13", + "factoryAdminPubKey": "0xddb70ddcd14dbd57ae18ec591f47454e4fc818bb", + "multiCallDeploy": "0x307d214799D3B1625D1eC70F83d170d5fd0ee5A1", + "factory": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/devnet_deploy/step2.json b/scripts/deployment_artefacts/devnet_deploy/step2.json new file mode 100644 index 0000000..5ca69c2 --- /dev/null +++ b/scripts/deployment_artefacts/devnet_deploy/step2.json @@ -0,0 +1,4 @@ +{ + "walletImplLocatorAdmin": "0xb49c99a17776c10350c2be790e13d4d8dfb1c578", + "latestWalletImplLocator": "0x1E1bB567c106B7D52710b3cD9553F84061355904" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/devnet_deploy/step3.json b/scripts/deployment_artefacts/devnet_deploy/step3.json new file mode 100644 index 0000000..6c59e6b --- /dev/null +++ b/scripts/deployment_artefacts/devnet_deploy/step3.json @@ -0,0 +1,4 @@ +{ + "walletImplLocatorAddress": "0x1E1bB567c106B7D52710b3cD9553F84061355904", + "startupWalletImpl": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/devnet_deploy/step4.json b/scripts/deployment_artefacts/devnet_deploy/step4.json new file mode 100644 index 0000000..8c6b8bc --- /dev/null +++ b/scripts/deployment_artefacts/devnet_deploy/step4.json @@ -0,0 +1,5 @@ +{ + "factoryAddress": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d", + "startupWalletImplAddress": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926", + "mainModuleDynamicAuth": "0x9e9Ee944fEB02F4D05B02950ca118027D2Db3cF2" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/devnet_deploy/step5.json b/scripts/deployment_artefacts/devnet_deploy/step5.json new file mode 100644 index 0000000..78962e2 --- /dev/null +++ b/scripts/deployment_artefacts/devnet_deploy/step5.json @@ -0,0 +1,5 @@ +{ + "signerRootAdminPubKey": "0x65af83f71a05d7f6d06ef9a57c9294b4128ccc2c", + "signerAdminPubKey": "0x69d09644159e7327dbfd0af9a66f8e332c593e79", + "immutableSigner": "0xcff469E561D9dCe5B1185CD2AC1Fa961F8fbDe61" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/hardhdat_deploy/step1.json b/scripts/deployment_artefacts/hardhdat_deploy/step1.json new file mode 100644 index 0000000..0a50c2f --- /dev/null +++ b/scripts/deployment_artefacts/hardhdat_deploy/step1.json @@ -0,0 +1,6 @@ +{ + "multiCallAdminPubKey": "0x575be326c482a487add43974e0eaf232e3366e13", + "factoryAdminPubKey": "0xddb70ddcd14dbd57ae18ec591f47454e4fc818bb", + "multiCallDeploy": "0x307d214799D3B1625D1eC70F83d170d5fd0ee5A1", + "factory": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/hardhdat_deploy/step2.json b/scripts/deployment_artefacts/hardhdat_deploy/step2.json new file mode 100644 index 0000000..4fbb70f --- /dev/null +++ b/scripts/deployment_artefacts/hardhdat_deploy/step2.json @@ -0,0 +1,4 @@ +{ + "walletImplLocatorAdmin": "0xb49c99a17776c10350c2be790e13d4d8dfb1c578", + "latestWalletImplLocator": "0x36d1c7aB8856aB2E8262fb9789c673EFBCE33f57" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/hardhdat_deploy/step3.json b/scripts/deployment_artefacts/hardhdat_deploy/step3.json new file mode 100644 index 0000000..721abbc --- /dev/null +++ b/scripts/deployment_artefacts/hardhdat_deploy/step3.json @@ -0,0 +1,4 @@ +{ + "walletImplLocatorAddress": "0x36d1c7aB8856aB2E8262fb9789c673EFBCE33f57", + "startupWalletImpl": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/hardhdat_deploy/step4.json b/scripts/deployment_artefacts/hardhdat_deploy/step4.json new file mode 100644 index 0000000..e325190 --- /dev/null +++ b/scripts/deployment_artefacts/hardhdat_deploy/step4.json @@ -0,0 +1,5 @@ +{ + "factoryAddress": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d", + "startupWalletImplAddress": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926", + "mainModuleDynamicAuth": "0x1Af03254dc160616F7bFFBDe55Bb26799eF2b51C" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/hardhdat_deploy/step5.json b/scripts/deployment_artefacts/hardhdat_deploy/step5.json new file mode 100644 index 0000000..78962e2 --- /dev/null +++ b/scripts/deployment_artefacts/hardhdat_deploy/step5.json @@ -0,0 +1,5 @@ +{ + "signerRootAdminPubKey": "0x65af83f71a05d7f6d06ef9a57c9294b4128ccc2c", + "signerAdminPubKey": "0x69d09644159e7327dbfd0af9a66f8e332c593e79", + "immutableSigner": "0xcff469E561D9dCe5B1185CD2AC1Fa961F8fbDe61" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/testnet_deploy/step1.json b/scripts/deployment_artefacts/testnet_deploy/step1.json new file mode 100644 index 0000000..a6c1afa --- /dev/null +++ b/scripts/deployment_artefacts/testnet_deploy/step1.json @@ -0,0 +1,6 @@ +{ + "multiCallAdminPubKey": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", + "factoryAdminPubKey": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", + "multiCallDeploy": "0x307d214799D3B1625D1eC70F83d170d5fd0ee5A1", + "factory": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/testnet_deploy/step2.json b/scripts/deployment_artefacts/testnet_deploy/step2.json new file mode 100644 index 0000000..ef40b6d --- /dev/null +++ b/scripts/deployment_artefacts/testnet_deploy/step2.json @@ -0,0 +1,5 @@ +{ + "walletImplLocatorAdmin": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", + "walletImplChangerAdmin": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", + "latestWalletImplLocator": "0xDF3d36188b561F621B0aA993eA89FB95d3761356" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/testnet_deploy/step3.json b/scripts/deployment_artefacts/testnet_deploy/step3.json new file mode 100644 index 0000000..0b20e2f --- /dev/null +++ b/scripts/deployment_artefacts/testnet_deploy/step3.json @@ -0,0 +1,4 @@ +{ + "walletImplLocatorAddress": "0xDF3d36188b561F621B0aA993eA89FB95d3761356", + "startupWalletImpl": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/testnet_deploy/step4.json b/scripts/deployment_artefacts/testnet_deploy/step4.json new file mode 100644 index 0000000..94af187 --- /dev/null +++ b/scripts/deployment_artefacts/testnet_deploy/step4.json @@ -0,0 +1,5 @@ +{ + "factoryAddress": "0x8Fa5088dF65855E0DaF87FA6591659893b24871d", + "startupWalletImplAddress": "0x8FD900677aabcbB368e0a27566cCd0C7435F1926", + "mainModuleDynamicAuth": "0x0649E0E24d498B0DF987c4AAa18E95D9879e9fcF" +} \ No newline at end of file diff --git a/scripts/deployment_artefacts/testnet_deploy/step5.json b/scripts/deployment_artefacts/testnet_deploy/step5.json new file mode 100644 index 0000000..944c9a1 --- /dev/null +++ b/scripts/deployment_artefacts/testnet_deploy/step5.json @@ -0,0 +1,6 @@ +{ + "signerRootAdminPubKey": "0x0E2D55943f4EF07c336C12A85d083c20FF189182", + "signerAdminPubKey": "0x3aF5DE2846aB3195BCD7b8880483E63D21261c49", + "signerAddress": "0x1cE50560686b1297B6311F36B47dbe5d6E04D0f8", + "immutableSigner": "0xcff469E561D9dCe5B1185CD2AC1Fa961F8fbDe61" +} \ No newline at end of file diff --git a/scripts/step1.ts b/scripts/step1.ts index 3b6fa17..f5b49c2 100644 --- a/scripts/step1.ts +++ b/scripts/step1.ts @@ -16,8 +16,10 @@ import { waitForInput } from './helper-functions'; async function step1(): Promise { const env = loadEnvironmentInfo(hre.network.name); const { network, submitterAddress, signerAddress, } = env; - const multiCallAdminPubKey = '0x575be326c482a487add43974e0eaf232e3366e13'; - const factoryAdminPubKey = '0xddb70ddcd14dbd57ae18ec591f47454e4fc818bb'; + // const multiCallAdminPubKey = '0x575be326c482a487add43974e0eaf232e3366e13'; + // const factoryAdminPubKey = '0xddb70ddcd14dbd57ae18ec591f47454e4fc818bb'; + const multiCallAdminPubKey = process.env.MULTICALL_ADMIN_PUB_KEY; + const factoryAdminPubKey = process.env.FACTORY_ADMIN_PUB_KEY; console.log(`[${network}] Starting deployment...`); console.log(`[${network}] Submitter address ${submitterAddress}`); @@ -38,6 +40,8 @@ async function step1(): Promise { const factory = await deployContract(env, wallets, 'Factory', [factoryAdminPubKey, multiCallDeploy.address]); fs.writeFileSync('step1.json', JSON.stringify({ + multiCallAdminPubKey: multiCallAdminPubKey, + factoryAdminPubKey: factoryAdminPubKey, multiCallDeploy: multiCallDeploy.address, factory: factory.address, }, null, 1)); diff --git a/scripts/step2.ts b/scripts/step2.ts index df0748a..6acb7da 100644 --- a/scripts/step2.ts +++ b/scripts/step2.ts @@ -11,28 +11,30 @@ import { waitForInput } from './helper-functions'; async function step2(): Promise { const env = loadEnvironmentInfo(hre.network.name); const { network, deployerContractAddress } = env; + // Administration accounts + // Is this correct for Mainnet? + // const walletImplLocatorAdmin = '0xb49c99a17776c10350c2be790e13d4d8dfb1c578'; + const walletImplLocatorAdmin = process.env.WALLET_IMPL_LOCATOR_ADMIN; + const walletImplChangerAdmin = process.env.WALLET_IMPL_CHANGER_ADMIN; console.log(`[${network}] Starting deployment...`); console.log(`[${network}] CREATE2 Factory address ${deployerContractAddress}`); + console.log(`[${network}] Wallet ImplLocator Admin address ${walletImplLocatorAdmin}`); + console.log(`[${network}] Wallet ImplLocator Changer address ${walletImplChangerAdmin}`); await waitForInput(); - // Administration accounts - // Is this correct for Mainnet? - let walletImplLocatorAdmin = '0xb49c99a17776c10350c2be790e13d4d8dfb1c578'; - // Setup wallet const wallets: WalletOptions = await newWalletOptions(env); - console.log( - `[${network}] Wallet Impl Locator Changer Address: ${await wallets.getWalletImplLocatorChanger().getAddress()}` - ); // --- Step 2: Deployed using CREATE2 Factory const latestWalletImplLocator = await deployContractViaCREATE2(env, wallets, 'LatestWalletImplLocator', [ - walletImplLocatorAdmin, await wallets.getWalletImplLocatorChanger().getAddress() + walletImplLocatorAdmin, walletImplChangerAdmin ]); fs.writeFileSync('step2.json', JSON.stringify({ + walletImplLocatorAdmin: walletImplLocatorAdmin, + walletImplChangerAdmin: walletImplChangerAdmin, latestWalletImplLocator: latestWalletImplLocator.address, }, null, 1)); diff --git a/scripts/step3.ts b/scripts/step3.ts index 88221f1..139712b 100644 --- a/scripts/step3.ts +++ b/scripts/step3.ts @@ -11,7 +11,7 @@ import { waitForInput } from './helper-functions'; async function step3(): Promise { const env = loadEnvironmentInfo(hre.network.name); const { network } = env; - const walletImplLocatorAddress = ''; + const walletImplLocatorAddress = '0xDF3d36188b561F621B0aA993eA89FB95d3761356'; console.log(`[${network}] Starting deployment...`); console.log(`[${network}] WalletImplLocator address ${walletImplLocatorAddress}`); @@ -26,6 +26,7 @@ async function step3(): Promise { const startupWalletImpl = await deployContract(env, wallets, 'StartupWalletImpl', [walletImplLocatorAddress]); fs.writeFileSync('step3.json', JSON.stringify({ + walletImplLocatorAddress: walletImplLocatorAddress, startupWalletImpl: startupWalletImpl.address, }, null, 1)); diff --git a/scripts/step4.ts b/scripts/step4.ts index 668424f..b7d3f03 100644 --- a/scripts/step4.ts +++ b/scripts/step4.ts @@ -11,8 +11,8 @@ import { deployContractViaCREATE2 } from './contract'; async function step4(): Promise { const env = loadEnvironmentInfo(hre.network.name); const { network } = env; - const factoryAddress = ''; - const startupWalletImplAddress = ''; + const factoryAddress = '0x8Fa5088dF65855E0DaF87FA6591659893b24871d'; + const startupWalletImplAddress = '0x8FD900677aabcbB368e0a27566cCd0C7435F1926'; console.log(`[${network}] Starting deployment...`); console.log(`[${network}] Factory address ${factoryAddress}`); @@ -23,16 +23,13 @@ async function step4(): Promise { // Setup wallet const wallets: WalletOptions = await newWalletOptions(env); - // Addresses that need to be pre-determined - // 1. Factory - // 2. StartupWalletImpl - // 3. SignerContract - // --- Step 4: Deployed using CREATE2 Factory. // Deploy main module dynamic auth (CFC) const mainModuleDynamicAuth = await deployContractViaCREATE2(env, wallets, 'MainModuleDynamicAuth', [factoryAddress, startupWalletImplAddress]); fs.writeFileSync('step4.json', JSON.stringify({ + factoryAddress: factoryAddress, + startupWalletImplAddress: startupWalletImplAddress, mainModuleDynamicAuth: mainModuleDynamicAuth.address, }, null, 1)); diff --git a/scripts/step5.ts b/scripts/step5.ts index 5e94438..921e975 100644 --- a/scripts/step5.ts +++ b/scripts/step5.ts @@ -10,9 +10,11 @@ import { waitForInput } from './helper-functions'; **/ async function step5(): Promise { const env = loadEnvironmentInfo(hre.network.name); - const { network, submitterAddress, signerAddress, } = env; - const signerRootAdminPubKey = '0x65af83f71a05d7f6d06ef9a57c9294b4128ccc2c'; - const signerAdminPubKey = '0x69d09644159e7327dbfd0af9a66f8e332c593e79'; + const { network, signerAddress, } = env; + // const signerRootAdminPubKey = '0x65af83f71a05d7f6d06ef9a57c9294b4128ccc2c'; + // const signerAdminPubKey = '0x69d09644159e7327dbfd0af9a66f8e332c593e79'; + const signerRootAdminPubKey = process.env.SIGNER_ROOT_ADMIN_PUB_KEY; + const signerAdminPubKey = process.env.SIGNER_ADMIN_PUB_KEY; console.log(`[${network}] Starting deployment...`); console.log(`[${network}] SignerRootAdmin address ${signerRootAdminPubKey}`); @@ -29,6 +31,9 @@ async function step5(): Promise { const immutableSigner = await deployContract(env, wallets, 'ImmutableSigner', [signerRootAdminPubKey, signerAdminPubKey, signerAddress]); fs.writeFileSync('step5.json', JSON.stringify({ + signerRootAdminPubKey: signerRootAdminPubKey, + signerAdminPubKey: signerAdminPubKey, + signerAddress: signerAddress, immutableSigner: immutableSigner.address, }, null, 1)); diff --git a/scripts/step6.ts b/scripts/step6.ts index ab562bb..f056e03 100644 --- a/scripts/step6.ts +++ b/scripts/step6.ts @@ -9,9 +9,9 @@ import { newWalletOptions, WalletOptions } from './wallet-options'; **/ async function step6(): Promise { const env = loadEnvironmentInfo(hre.network.name); - const { network, submitterAddress, signerAddress, } = env; - const mainModuleDynamicAuthAddress = ''; - const walletImplLocatorContractAddress = ''; + const { network, signerAddress, } = env; + const mainModuleDynamicAuthAddress = '0x0649E0E24d498B0DF987c4AAa18E95D9879e9fcF'; + const walletImplLocatorContractAddress = '0xDF3d36188b561F621B0aA993eA89FB95d3761356'; console.log(`[${network}] Starting deployment...`); console.log(`[${network}] mainModuleDynamicAuth address ${mainModuleDynamicAuthAddress}`); @@ -23,28 +23,20 @@ async function step6(): Promise { // Setup wallet const wallets: WalletOptions = await newWalletOptions(env); console.log( - `[${network}] Wallet Impl Locator Changer Address: ${await wallets.getWalletImplLocatorChanger().getAddress()}` + `[${network}] Wallet Impl Locator Changer Address: ${await wallets.getWallet().getAddress()}` ); // --- Step 6: Deployed using alternate wallet - // Fund the implementation changer - // WARNING: If the deployment fails at this step, DO NOT RERUN without commenting out the code a prior which deploys the contracts. - const fundingTx = await wallets.getWallet().sendTransaction({ - to: await wallets.getWalletImplLocatorChanger().getAddress(), - value: utils.parseEther('10'), - gasLimit: 30000000, - maxFeePerGas: 10000000000, - maxPriorityFeePerGas: 10000000000, - }); - await fundingTx.wait(); - console.log(`[${network}] Transfered funds to the wallet locator implementer changer with hash ${fundingTx.hash}`); - // Set implementation address on impl locator to dynamic module auth addr const contractFactory: ContractFactory = await newContractFactory(wallets.getWallet(), 'LatestWalletImplLocator'); const walletImplLocator: Contract = contractFactory.attach(walletImplLocatorContractAddress); const tx = await walletImplLocator - .connect(wallets.getWalletImplLocatorChanger()) - .changeWalletImplementation(mainModuleDynamicAuthAddress); + .connect(wallets.getWallet()) + .changeWalletImplementation(mainModuleDynamicAuthAddress, { + gasLimit: 30000000, + maxFeePerGas: 10000000000, + maxPriorityFeePerGas: 10000000000, + }); await tx.wait(); console.log(`[${network}] Wallet Impl Locator implementation changed to: ${mainModuleDynamicAuthAddress}`);