Skip to content

Commit 0cd02d2

Browse files
Merge pull request #212 from BitGo/WIN-5017-world
chore(eth-multisig-v4): add world config for contract deployment
2 parents 4d47b4f + 475f31a commit 0cd02d2

File tree

5 files changed

+77
-9
lines changed

5 files changed

+77
-9
lines changed

.github/workflows/deploy_and_release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
MONAD_EXPLORER_API_KEY: ${{ secrets.MONAD_EXPLORER_API_KEY }}
5151
SOMNIA_EXPLORER_API_KEY: ${{ secrets.SOMNIA_EXPLORER_API_KEY }}
5252
SONEIUM_EXPLORER_API_KEY: ${{ secrets.SONEIUM_EXPLORER_API_KEY }}
53+
WORLD_EXPLORER_API_KEY: ${{ secrets.WORLD_EXPLORER_API_KEY }}
54+
5355
get-network:
5456
runs-on: ubuntu-latest
5557
needs: [lint-and-test]
@@ -64,13 +66,13 @@ jobs:
6466
result-encoding: string
6567
script: |
6668
const tag = process.env.GITHUB_REF_NAME;
67-
const regex = /v.*\-(eth|hteth|matic|tmatic|bsc|tbsc|arbeth|tarbeth|opeth|topeth|zketh|tzketh|baseeth|tbaseeth|bera|tbera|tavaxc|avaxc|toas|oas|tcoredao|coredao|tflr|flr|tsgb|sgb|txdc|xdc|twemix|wemix|tmon|mon|tstt|stt|tsoneium|soneium)$/;
69+
const regex = /v.*\-(eth|hteth|matic|tmatic|bsc|tbsc|arbeth|tarbeth|opeth|topeth|zketh|tzketh|baseeth|tbaseeth|bera|tbera|tavaxc|avaxc|toas|oas|tcoredao|coredao|tflr|flr|tsgb|sgb|txdc|xdc|twemix|wemix|tmon|mon|tstt|stt|tsoneium|soneium|world|tworld)$/;
6870
const network = tag.match(regex);
6971
return network ? network[1] : "hteth";
7072
deploy-to-test:
7173
runs-on: ubuntu-latest
7274
needs: [lint-and-test, get-network]
73-
if: ${{ (needs.get-network.outputs.network == 'hteth' ) || (needs.get-network.outputs.network == 'tmatic' ) || (needs.get-network.outputs.network == 'tbsc' ) || (needs.get-network.outputs.network == 'tarbeth' ) || (needs.get-network.outputs.network == 'topeth' ) || (needs.get-network.outputs.network == 'tzketh' ) || (needs.get-network.outputs.network == 'tbaseeth' ) || (needs.get-network.outputs.network == 'tbera' ) || (needs.get-network.outputs.network == 'tavaxc' ) || (needs.get-network.outputs.network == 'toas' ) || (needs.get-network.outputs.network == 'tcoredao' ) || (needs.get-network.outputs.network == 'tflr' ) || (needs.get-network.outputs.network == 'tsgb' ) || (needs.get-network.outputs.network == 'txdc' ) || (needs.get-network.outputs.network == 'twemix' ) || (needs.get-network.outputs.network == 'tmon' ) || (needs.get-network.outputs.network == 'tstt' ) || (needs.get-network.outputs.network == 'tsoneium' ) }}
75+
if: ${{ (needs.get-network.outputs.network == 'hteth' ) || (needs.get-network.outputs.network == 'tmatic' ) || (needs.get-network.outputs.network == 'tbsc' ) || (needs.get-network.outputs.network == 'tarbeth' ) || (needs.get-network.outputs.network == 'topeth' ) || (needs.get-network.outputs.network == 'tzketh' ) || (needs.get-network.outputs.network == 'tbaseeth' ) || (needs.get-network.outputs.network == 'tbera' ) || (needs.get-network.outputs.network == 'tavaxc' ) || (needs.get-network.outputs.network == 'toas' ) || (needs.get-network.outputs.network == 'tcoredao' ) || (needs.get-network.outputs.network == 'tflr' ) || (needs.get-network.outputs.network == 'tsgb' ) || (needs.get-network.outputs.network == 'txdc' ) || (needs.get-network.outputs.network == 'twemix' ) || (needs.get-network.outputs.network == 'tmon' ) || (needs.get-network.outputs.network == 'tstt' ) || (needs.get-network.outputs.network == 'tsoneium' ) || (needs.get-network.outputs.network == 'tworld' ) }}
7476
environment: testnet
7577
steps:
7678
- uses: actions/checkout@v2
@@ -116,6 +118,7 @@ jobs:
116118
MONAD_EXPLORER_API_KEY: ${{ secrets.MONAD_EXPLORER_API_KEY }}
117119
SOMNIA_EXPLORER_API_KEY: ${{ secrets.SOMNIA_EXPLORER_API_KEY }}
118120
SONEIUM_EXPLORER_API_KEY: ${{ secrets.SONEIUM_EXPLORER_API_KEY }}
121+
WORLD_EXPLORER_API_KEY: ${{ secrets.WORLD_EXPLORER_API_KEY }}
119122
- name: Update release notes
120123
uses: actions/github-script@v6
121124
with:
@@ -147,7 +150,7 @@ jobs:
147150
deploy-to-prod:
148151
runs-on: ubuntu-latest
149152
needs: [lint-and-test, get-network]
150-
if: ${{ (needs.get-network.outputs.network == 'eth' ) || (needs.get-network.outputs.network == 'matic' ) || (needs.get-network.outputs.network == 'bsc' ) || (needs.get-network.outputs.network == 'arbeth' ) || (needs.get-network.outputs.network == 'opeth' ) || (needs.get-network.outputs.network == 'zketh' ) || (needs.get-network.outputs.network == 'baseeth' ) || (needs.get-network.outputs.network == 'bera' ) || (needs.get-network.outputs.network == 'avaxc' ) || (needs.get-network.outputs.network == 'coredao' ) || (needs.get-network.outputs.network == 'oas' ) || (needs.get-network.outputs.network == 'flr' ) || (needs.get-network.outputs.network == 'sgb' ) || (needs.get-network.outputs.network == 'xdc' ) || (needs.get-network.outputs.network == 'wemix' ) || (needs.get-network.outputs.network == 'mon' ) || (needs.get-network.outputs.network == 'stt' ) || (needs.get-network.outputs.network == 'soneium' ) }}
153+
if: ${{ (needs.get-network.outputs.network == 'eth' ) || (needs.get-network.outputs.network == 'matic' ) || (needs.get-network.outputs.network == 'bsc' ) || (needs.get-network.outputs.network == 'arbeth' ) || (needs.get-network.outputs.network == 'opeth' ) || (needs.get-network.outputs.network == 'zketh' ) || (needs.get-network.outputs.network == 'baseeth' ) || (needs.get-network.outputs.network == 'bera' ) || (needs.get-network.outputs.network == 'avaxc' ) || (needs.get-network.outputs.network == 'coredao' ) || (needs.get-network.outputs.network == 'oas' ) || (needs.get-network.outputs.network == 'flr' ) || (needs.get-network.outputs.network == 'sgb' ) || (needs.get-network.outputs.network == 'xdc' ) || (needs.get-network.outputs.network == 'wemix' ) || (needs.get-network.outputs.network == 'mon' ) || (needs.get-network.outputs.network == 'stt' ) || (needs.get-network.outputs.network == 'soneium' ) || (needs.get-network.outputs.network == 'world' ) }}
151154
environment: mainnet
152155
steps:
153156
- uses: actions/checkout@v2
@@ -193,6 +196,7 @@ jobs:
193196
MONAD_EXPLORER_API_KEY: ${{ secrets.MONAD_EXPLORER_API_KEY }}
194197
SOMNIA_EXPLORER_API_KEY: ${{ secrets.SOMNIA_EXPLORER_API_KEY }}
195198
SONEIUM_EXPLORER_API_KEY: ${{ secrets.SONEIUM_EXPLORER_API_KEY }}
199+
WORLD_EXPLORER_API_KEY: ${{ secrets.WORLD_EXPLORER_API_KEY }}
196200
- name: Update release notes
197201
uses: actions/github-script@v6
198202
with:

.github/workflows/deploy_batcher_contract.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
MONAD_EXPLORER_API_KEY: ${{ secrets.MONAD_EXPLORER_API_KEY }}
5151
SOMNIA_EXPLORER_API_KEY: ${{ secrets.SOMNIA_EXPLORER_API_KEY }}
5252
SONEIUM_EXPLORER_API_KEY: ${{ secrets.SONEIUM_EXPLORER_API_KEY }}
53+
WORLD_EXPLORER_API_KEY: ${{ secrets.WORLD_EXPLORER_API_KEY }}
5354
get-network:
5455
runs-on: ubuntu-latest
5556
needs: [lint-and-test]
@@ -64,7 +65,7 @@ jobs:
6465
result-encoding: string
6566
script: |
6667
const tag = process.env.GITHUB_REF_NAME;
67-
const regex = /v.*\-(eth|hteth|matic|tmatic|bsc|tbsc|arbeth|tarbeth|opeth|topeth|zketh|tzketh|baseeth|tbaseeth|bera|tbera|tavaxc|avaxc|toas|oas|tcoredao|coredao|flr|tflr|sgb|tsgb|txdc|xdc|twemix|wemix|tmon|mon|tstt|stt)$/;
68+
const regex = /v.*\-(eth|hteth|matic|tmatic|bsc|tbsc|arbeth|tarbeth|opeth|topeth|zketh|tzketh|baseeth|tbaseeth|bera|tbera|tavaxc|avaxc|toas|oas|tcoredao|coredao|flr|tflr|sgb|tsgb|txdc|xdc|twemix|wemix|tmon|mon|tstt|stt|tsoneium|soneium|tworld|world)$/;
6869
const matchedNetwork = tag.match(regex);
6970
if (!matchedNetwork) {
7071
console.log("No match found for the network name, defaulting to 'hteth'.");
@@ -74,7 +75,7 @@ jobs:
7475
deploy-batcher-contract-to-test:
7576
runs-on: ubuntu-latest
7677
needs: [lint-and-test, get-network]
77-
if: ${{ (needs.get-network.outputs.network == 'hteth' ) || (needs.get-network.outputs.network == 'tmatic' ) || (needs.get-network.outputs.network == 'tbsc' ) || (needs.get-network.outputs.network == 'tarbeth' ) || (needs.get-network.outputs.network == 'topeth' ) || (needs.get-network.outputs.network == 'tzketh' ) || (needs.get-network.outputs.network == 'tbaseeth' ) || (needs.get-network.outputs.network == 'tbera' ) || (needs.get-network.outputs.network == 'tavaxc' ) || (needs.get-network.outputs.network == 'tcoredao' ) || (needs.get-network.outputs.network == 'toas' ) || (needs.get-network.outputs.network == 'tflr' ) || (needs.get-network.outputs.network == 'tsgb' ) || (needs.get-network.outputs.network == 'txdc' ) || (needs.get-network.outputs.network == 'twemix' ) || (needs.get-network.outputs.network == 'tmon' ) || (needs.get-network.outputs.network == 'tstt' ) || (needs.get-network.outputs.network == 'tsoneium' )}}
78+
if: ${{ (needs.get-network.outputs.network == 'hteth' ) || (needs.get-network.outputs.network == 'tmatic' ) || (needs.get-network.outputs.network == 'tbsc' ) || (needs.get-network.outputs.network == 'tarbeth' ) || (needs.get-network.outputs.network == 'topeth' ) || (needs.get-network.outputs.network == 'tzketh' ) || (needs.get-network.outputs.network == 'tbaseeth' ) || (needs.get-network.outputs.network == 'tbera' ) || (needs.get-network.outputs.network == 'tavaxc' ) || (needs.get-network.outputs.network == 'tcoredao' ) || (needs.get-network.outputs.network == 'toas' ) || (needs.get-network.outputs.network == 'tflr' ) || (needs.get-network.outputs.network == 'tsgb' ) || (needs.get-network.outputs.network == 'txdc' ) || (needs.get-network.outputs.network == 'twemix' ) || (needs.get-network.outputs.network == 'tmon' ) || (needs.get-network.outputs.network == 'tstt' ) || (needs.get-network.outputs.network == 'tsoneium' ) || (needs.get-network.outputs.network == 'tworld' )}}
7879
environment: testnet
7980
steps:
8081
- uses: actions/checkout@v4
@@ -118,6 +119,7 @@ jobs:
118119
MONAD_EXPLORER_API_KEY: ${{ secrets.MONAD_EXPLORER_API_KEY }}
119120
SOMNIA_EXPLORER_API_KEY: ${{ secrets.SOMNIA_EXPLORER_API_KEY }}
120121
SONEIUM_EXPLORER_API_KEY: ${{ secrets.SONEIUM_EXPLORER_API_KEY }}
122+
WORLD_EXPLORER_API_KEY: ${{ secrets.WORLD_EXPLORER_API_KEY }}
121123
- name: Update release notes
122124
uses: actions/github-script@v7
123125
with:
@@ -129,7 +131,7 @@ jobs:
129131
deploy-batcher-contract-to-prod:
130132
runs-on: ubuntu-latest
131133
needs: [lint-and-test, get-network]
132-
if: ${{ (needs.get-network.outputs.network == 'eth' ) || (needs.get-network.outputs.network == 'matic' ) || (needs.get-network.outputs.network == 'bsc' ) || (needs.get-network.outputs.network == 'arbeth' ) || (needs.get-network.outputs.network == 'opeth' ) || (needs.get-network.outputs.network == 'zketh' ) || (needs.get-network.outputs.network == 'baseeth' ) || (needs.get-network.outputs.network == 'bera' ) || (needs.get-network.outputs.network == 'avaxc' ) || (needs.get-network.outputs.network == 'coredao' ) || (needs.get-network.outputs.network == 'oas' ) || (needs.get-network.outputs.network == 'sgb' ) || (needs.get-network.outputs.network == 'flr' ) || (needs.get-network.outputs.network == 'xdc' ) || (needs.get-network.outputs.network == 'wemix' ) || (needs.get-network.outputs.network == 'mon' ) || (needs.get-network.outputs.network == 'stt' ) || (needs.get-network.outputs.network == 'soneium' )}}
134+
if: ${{ (needs.get-network.outputs.network == 'eth' ) || (needs.get-network.outputs.network == 'matic' ) || (needs.get-network.outputs.network == 'bsc' ) || (needs.get-network.outputs.network == 'arbeth' ) || (needs.get-network.outputs.network == 'opeth' ) || (needs.get-network.outputs.network == 'zketh' ) || (needs.get-network.outputs.network == 'baseeth' ) || (needs.get-network.outputs.network == 'bera' ) || (needs.get-network.outputs.network == 'avaxc' ) || (needs.get-network.outputs.network == 'coredao' ) || (needs.get-network.outputs.network == 'oas' ) || (needs.get-network.outputs.network == 'sgb' ) || (needs.get-network.outputs.network == 'flr' ) || (needs.get-network.outputs.network == 'xdc' ) || (needs.get-network.outputs.network == 'wemix' ) || (needs.get-network.outputs.network == 'mon' ) || (needs.get-network.outputs.network == 'stt' ) || (needs.get-network.outputs.network == 'soneium' ) || (needs.get-network.outputs.network == 'world' )}}
133135
environment: mainnet
134136
steps:
135137
- uses: actions/checkout@v4
@@ -173,6 +175,7 @@ jobs:
173175
MONAD_EXPLORER_API_KEY: ${{ secrets.MONAD_EXPLORER_API_KEY }}
174176
SOMNIA_EXPLORER_API_KEY: ${{ secrets.SOMNIA_EXPLORER_API_KEY }}
175177
SONEIUM_EXPLORER_API_KEY: ${{ secrets.SONEIUM_EXPLORER_API_KEY }}
178+
WORLD_EXPLORER_API_KEY: ${{ secrets.WORLD_EXPLORER_API_KEY }}
176179
- name: Update release notes
177180
uses: actions/github-script@v7
178181
with:

.github/workflows/push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ jobs:
5858
MONAD_EXPLORER_API_KEY: ${{ secrets.MONAD_EXPLORER_API_KEY }}
5959
SOMNIA_EXPLORER_API_KEY: ${{ secrets.SOMNIA_EXPLORER_API_KEY }}
6060
SONEIUM_EXPLORER_API_KEY: ${{ secrets.SONEIUM_EXPLORER_API_KEY }}
61+
WORLD_EXPLORER_API_KEY: ${{ secrets.WORLD_EXPLORER_API_KEY }}
6162
- run: npm run lint

hardhat.config.ts

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ const {
4242
BERA_RPC_URL,
4343
MONAD_EXPLORER_API_KEY,
4444
SOMNIA_EXPLORER_API_KEY,
45-
SONEIUM_EXPLORER_API_KEY
45+
SONEIUM_EXPLORER_API_KEY,
46+
WORLD_EXPLORER_API_KEY
4647
} = process.env;
4748

4849
const PLACEHOLDER_KEY: string =
@@ -224,6 +225,22 @@ const config: HardhatUserConfig = {
224225
`${PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT}`
225226
]
226227
},
228+
tworld: {
229+
url: `https://worldchain-sepolia.gateway.tenderly.co`,
230+
accounts: [
231+
`${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`,
232+
`${PLACEHOLDER_KEY}`,
233+
`${PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT}`
234+
]
235+
},
236+
world: {
237+
url: `https://worldchain-mainnet.g.alchemy.com/public`,
238+
accounts: [
239+
`${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`,
240+
`${PLACEHOLDER_KEY}`,
241+
`${PRIVATE_KEY_FOR_BATCHER_CONTRACT_DEPLOYMENT}`
242+
]
243+
},
227244
tsoneium: {
228245
url: `https://rpc.minato.soneium.org/`,
229246
accounts: [
@@ -444,7 +461,10 @@ const config: HardhatUserConfig = {
444461
somniaMainnet: `${SOMNIA_EXPLORER_API_KEY}`,
445462
//Soneium
446463
soneiumTestnet: `${SONEIUM_EXPLORER_API_KEY}`,
447-
soneiumMainnet: `${SONEIUM_EXPLORER_API_KEY}`
464+
soneiumMainnet: `${SONEIUM_EXPLORER_API_KEY}`,
465+
//World
466+
worldTestnet: `${WORLD_EXPLORER_API_KEY}`,
467+
worldMainnet: `${WORLD_EXPLORER_API_KEY}`
448468
},
449469
customChains: [
450470
{
@@ -579,6 +599,22 @@ const config: HardhatUserConfig = {
579599
browserURL: 'https://testnet.snowtrace.io/'
580600
}
581601
},
602+
{
603+
network: 'worldTestnet',
604+
chainId: 4801,
605+
urls: {
606+
apiURL: 'https://worldchain-sepolia.gateway.tenderly.co',
607+
browserURL: 'https://sepolia.worldscan.org/'
608+
}
609+
},
610+
{
611+
network: 'worldMainnet',
612+
chainId: 480,
613+
urls: {
614+
apiURL: 'https://api.worldscan.org/',
615+
browserURL: 'https://worldscan.org/'
616+
}
617+
},
582618
{
583619
network: 'soneiumTestnet',
584620
chainId: 1946,

scripts/deploy.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async function main() {
4242
if (txCount === 1 || txCount === 3) {
4343
throw Error('Cannot deploy contracts, please update the script');
4444
}
45-
45+
console.log('txCount: ' + txCount);
4646
if (txCount === 0) {
4747
deployWalletContracts = true;
4848
deployForwarderContracts = true;
@@ -56,6 +56,7 @@ async function main() {
5656
let forwarderFactoryContractName = 'ForwarderFactory';
5757
let contractPath = `contracts/WalletSimple.sol:WalletSimple`;
5858
const chainId = await deployer.getChainId();
59+
console.log('chainId: ', chainId);
5960
switch (chainId) {
6061
// https://chainlist.org/
6162
//eth
@@ -138,6 +139,21 @@ async function main() {
138139
forwarderFactoryContractName = 'ForwarderFactoryV4';
139140
contractPath = `contracts/${walletImplementationContractName}.sol:${walletImplementationContractName}`;
140141
break;
142+
// world
143+
case 480:
144+
case 4801:
145+
console.log(
146+
'Setting World gasLimit,maxFeePerGas, maxPriorityFeePerGas...'
147+
);
148+
const GWEI = BigNumber.from('1000000000'); // 1
149+
eip1559GasParams.gasLimit = 3000000;
150+
eip1559GasParams.maxFeePerGas = GWEI.mul(5);
151+
eip1559GasParams.maxPriorityFeePerGas = GWEI.mul(2);
152+
walletImplementationContractName = 'WalletSimple';
153+
forwarderContractName = 'ForwarderV4';
154+
forwarderFactoryContractName = 'ForwarderFactoryV4';
155+
contractPath = `contracts/${walletImplementationContractName}.sol:${walletImplementationContractName}`;
156+
break;
141157
//Monad
142158
case 10143: // TODO: WIN-5225: add chain id once mainnet is release
143159
//Flare
@@ -203,17 +219,25 @@ async function main() {
203219
console.log(
204220
'Deploying wallet contract called: ' + walletImplementationContractName
205221
);
222+
console.log('📦 Getting contract factory...');
206223
const WalletSimple = await ethers.getContractFactory(
207224
walletImplementationContractName
208225
);
226+
console.log('⛽ Gas params:', gasParams);
227+
const balance = await deployer.getBalance();
228+
console.log('💰 Balance:', ethers.utils.formatEther(balance), 'ETH');
209229
const walletSimple = await WalletSimple.deploy(gasParams);
230+
console.log('📤 TX hash:', walletSimple.deployTransaction.hash);
231+
console.log('⏳ Waiting for confirmation...');
232+
await walletSimple.deployTransaction.wait(1);
210233
await walletSimple.deployed();
211234
output.walletImplementation = walletSimple.address;
212235
console.log('WalletSimple deployed at ' + walletSimple.address);
213236

214237
const WalletFactory = await ethers.getContractFactory(
215238
walletFactoryContractName
216239
);
240+
console.log('🚀 Sending deployment TX...');
217241
const walletFactory = await WalletFactory.deploy(
218242
walletSimple.address,
219243
gasParams

0 commit comments

Comments
 (0)