Skip to content

Commit cdae5bb

Browse files
authored
Merge pull request #49 from immutable/feat/SMR-2019-1
[SMR-2019] Upgrade the deployment scripts to use a hardware ledger
2 parents 2107273 + 84db35a commit cdae5bb

46 files changed

Lines changed: 23826 additions & 17851 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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
5+
6+
# Change this to match the address of the CREATE2 contract factory
7+
DEPLOYER_CONTRACT_ADDRESS=<CHANGE_ME>
8+
9+
# Change the following values to match the values set in the following
10+
# document https://immutable.atlassian.net/wiki/spaces/PRIM/pages/2349203716/PROD+Relayer+Admin+Roles
11+
# for the corresponding environment
12+
MULTICALL_ADMIN_PUB_KEY=<CHANGE_ME_TO_A_PRIVILEGED_TRANSACTION_MULTISIG>
13+
FACTORY_ADMIN_PUB_KEY=<CHANGE_ME_TO_A_PRIVILEGED_TRANSACTION_MULTISIG>
14+
WALLET_IMPL_LOCATOR_ADMIN=<CHANGE_ME_TO_A_PRIVILEGED_TRANSACTION_MULTISIG>
15+
WALLET_IMPL_CHANGER_ADMIN=<CHANGE_ME_TO_A_PRIVILEGED_TRANSACTION_MULTISIG>
16+
SIGNER_ROOT_ADMIN_PUB_KEY=<CHANGE_ME_TO_A_PRIVILEGED_TRANSACTION_MULTISIG>
17+
SIGNER_ADMIN_PUB_KEY=<CHANGE_ME_TO_A_BREAK_GLASS_TRANSACTION_MULTISIG>

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ config/*.env
1515

1616
src/gen
1717
src/artifacts
18+
scripts/*_output*.json
1819

1920
# MAC OS custom directory attributes file.
2021
.DS_Store
@@ -23,4 +24,9 @@ src/artifacts
2324
.idea
2425
*.iml
2526

26-
.env
27+
# Ignore any environmental files with sensitive data
28+
.env
29+
.env.localhost
30+
.env.devnet
31+
.env.testnet
32+
.env.mainnet

.prettierrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"tabWidth": 2,
33
"useTabs": false,
4-
"semi": false,
4+
"semi": true,
55
"singleQuote": true,
66
"trailingComma": "none",
77
"arrowParens": "avoid",
8-
"printWidth": 130
8+
"printWidth": 120
99
}

hardhat.config.ts

Lines changed: 35 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
import { HardhatUserConfig } from 'hardhat/config'
2-
import { networkConfig } from './utils/config-loader'
1+
import { HardhatUserConfig } from 'hardhat/config';
2+
import { networkConfig } from './utils/config-loader';
3+
import * as dotenv from 'dotenv';
34

4-
import '@nomiclabs/hardhat-truffle5'
5-
import '@nomiclabs/hardhat-ethers'
6-
import '@nomiclabs/hardhat-web3'
7-
import '@nomiclabs/hardhat-etherscan'
8-
import '@nomicfoundation/hardhat-chai-matchers'
5+
import '@nomiclabs/hardhat-truffle5';
6+
import '@nomiclabs/hardhat-ethers';
7+
import '@nomiclabs/hardhat-web3';
8+
import '@nomiclabs/hardhat-etherscan';
9+
import '@nomicfoundation/hardhat-chai-matchers';
910

10-
import 'hardhat-gas-reporter'
11-
import 'solidity-coverage'
12-
import { HardhatConfig } from 'hardhat/types'
11+
import 'hardhat-gas-reporter';
12+
import 'solidity-coverage';
1313

14-
require('dotenv').config()
15-
16-
const ganacheNetwork = {
17-
url: 'http://127.0.0.1:8545',
18-
blockGasLimit: 6000000000
19-
}
14+
dotenv.config();
15+
loadAndValidateEnvironment();
2016

2117
const config: HardhatUserConfig = {
2218
solidity: {
@@ -33,66 +29,36 @@ const config: HardhatUserConfig = {
3329
},
3430
paths: {
3531
root: 'src',
36-
tests: '../tests'
32+
tests: 'tests'
3733
},
3834
networks: {
3935
// Define here to easily specify private keys
40-
devnet: validateEnvironment()
41-
? {
42-
url: 'https://rpc.dev.immutable.com',
43-
accounts: [process.env.DEPLOYER_PRIV_KEY!, process.env.WALLET_IMPL_CHANGER_PRIV_KEY!]
44-
}
45-
: {
46-
url: 'SET ENVIRONMENT VARIABLES',
47-
accounts: []
48-
},
49-
testnet: validateEnvironment()
50-
? {
51-
url: 'https://rpc.testnet.immutable.com',
52-
accounts: [process.env.DEPLOYER_PRIV_KEY!, process.env.WALLET_IMPL_CHANGER_PRIV_KEY!]
53-
}
54-
: {
55-
url: 'SET ENVIRONMENT VARIABLES',
56-
accounts: []
57-
},
58-
sepolia: networkConfig('sepolia'),
59-
mainnet: networkConfig('mainnet'),
60-
ropsten: networkConfig('ropsten'),
61-
rinkeby: networkConfig('rinkeby'),
62-
kovan: networkConfig('kovan'),
63-
goerli: networkConfig('goerli'),
64-
matic: networkConfig('matic'),
65-
mumbai: networkConfig('mumbai'),
66-
arbitrum: networkConfig('arbitrum'),
67-
arbitrumTestnet: networkConfig('arbitrum-testnet'),
68-
optimism: networkConfig('optimism'),
69-
metis: networkConfig('metis'),
70-
nova: networkConfig('nova'),
71-
avalanche: networkConfig('avalanche'),
72-
avalancheTestnet: networkConfig('avalanche-testnet'),
73-
ganache: ganacheNetwork,
74-
coverage: {
75-
url: 'http://localhost:8555'
76-
}
77-
},
78-
etherscan: {
79-
// Your API key for Etherscan
80-
// Obtain one at https://etherscan.io/
81-
apiKey: networkConfig('mainnet').etherscan
36+
localhost: {
37+
url: 'http://127.0.0.1:8545',
38+
accounts: [process.env.DEPLOYER_PRIV_KEY!, process.env.WALLET_IMPL_CHANGER_PRIV_KEY!]
39+
},
40+
devnet: {
41+
url: 'https://rpc.dev.immutable.com',
42+
accounts: [process.env.DEPLOYER_PRIV_KEY!, process.env.WALLET_IMPL_CHANGER_PRIV_KEY!]
43+
},
44+
testnet: {
45+
url: 'https://rpc.testnet.immutable.com',
46+
accounts: [process.env.DEPLOYER_PRIV_KEY!, process.env.WALLET_IMPL_CHANGER_PRIV_KEY!]
47+
},
48+
mainnet: {
49+
url: 'https://rpc.immutable.com',
50+
accounts: [process.env.DEPLOYER_PRIV_KEY!, process.env.WALLET_IMPL_CHANGER_PRIV_KEY!]
51+
},
8252
},
8353
mocha: {
8454
timeout: process.env.COVERAGE ? 15 * 60 * 1000 : 30 * 1000
8555
},
86-
gasReporter: {
87-
enabled: !!process.env.REPORT_GAS === true,
88-
currency: 'USD',
89-
gasPrice: 21,
90-
showTimeSpent: true
91-
}
92-
}
56+
};
9357

94-
export default config
58+
export default config;
9559

96-
function validateEnvironment(): boolean {
97-
return !!process.env.DEPLOYER_PRIV_KEY && !!process.env.WALLET_IMPL_CHANGER_PRIV_KEY
60+
function loadAndValidateEnvironment(): boolean {
61+
return !!process.env.DEPLOYER_PRIV_KEY &&
62+
!!process.env.WALLET_IMPL_CHANGER_PRIV_KEY &&
63+
!!process.env.DEPLOYER_CONTRACT_ADDRESS;
9864
}

0 commit comments

Comments
 (0)