Skip to content

Commit fd89a04

Browse files
Merge pull request #219 from BitGo/WIN-5558-eth-change
chore: add verify contract script
2 parents 0507e88 + eade09f commit fd89a04

File tree

5 files changed

+3086
-2999
lines changed

5 files changed

+3086
-2999
lines changed

hardhat.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,16 +651,18 @@ const config: HardhatUserConfig = {
651651
network: 'monadTestnet',
652652
chainId: 10143,
653653
urls: {
654-
apiURL: 'https://testnet.monadexplorer.com/api',
655-
browserURL: 'https://testnet.monadexplorer.com/'
654+
apiURL:
655+
'https://api.socialscan.io/monad-testnet/v1/explorer/command_api/contract',
656+
browserURL: 'https://monad-testnet.socialscan.io/'
656657
}
657658
},
658659
{
659660
network: 'monadMainnet',
660661
chainId: 10143, //TODO: WIN-5225: change it with mainnet explorer, when its available
661662
urls: {
662-
apiURL: 'https://testnet.monadexplorer.com/api', //TODO: WIN-5225: change it with mainnet explorer, when its available
663-
browserURL: 'https://testnet.monadexplorer.com/' //TODO: WIN-5225: change it with mainnet explorer, when its available
663+
apiURL:
664+
'https://api.socialscan.io/monad-testnet/v1/explorer/command_api/contract', //TODO: WIN-5225: change it with mainnet explorer, when its available
665+
browserURL: 'https://monad-testnet.socialscan.io/' //TODO: WIN-5225: change it with mainnet explorer, when its available
664666
}
665667
},
666668
{

hardhat.monad.config.ts

Whitespace-only changes.

scripts/deploy.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ async function main() {
3939
deployForwarderContracts = false;
4040
const [deployer] = await ethers.getSigners();
4141
const txCount = await deployer.getTransactionCount();
42+
4243
if (txCount === 1 || txCount === 3) {
4344
throw Error('Cannot deploy contracts, please update the script');
4445
}
4546
console.log('txCount: ' + txCount);
47+
const GWEI = BigNumber.from('1000000000'); // 1
4648
if (txCount === 0) {
4749
deployWalletContracts = true;
4850
deployForwarderContracts = true;
@@ -145,7 +147,6 @@ async function main() {
145147
console.log(
146148
'Setting World gasLimit,maxFeePerGas, maxPriorityFeePerGas...'
147149
);
148-
const GWEI = BigNumber.from('1000000000'); // 1
149150
eip1559GasParams.gasLimit = 3000000;
150151
eip1559GasParams.maxFeePerGas = GWEI.mul(5);
151152
eip1559GasParams.maxPriorityFeePerGas = GWEI.mul(2);
@@ -156,6 +157,24 @@ async function main() {
156157
break;
157158
//Monad
158159
case 10143: // TODO: WIN-5225: add chain id once mainnet is release
160+
const feeData = await ethers.provider.getFeeData(); // dynamically gets suggested fees
161+
const baseFee =
162+
feeData.lastBaseFeePerGas || BigNumber.from('30000000000'); // fallback if null
163+
164+
eip1559GasParams.gasLimit = 3000000;
165+
eip1559GasParams.maxPriorityFeePerGas = GWEI.mul(1);
166+
eip1559GasParams.maxFeePerGas = baseFee.add(
167+
eip1559GasParams.maxPriorityFeePerGas
168+
);
169+
walletImplementationContractName = 'WalletSimple';
170+
forwarderContractName = 'ForwarderV4';
171+
forwarderFactoryContractName = 'ForwarderFactoryV4';
172+
contractPath = `contracts/${walletImplementationContractName}.sol:${walletImplementationContractName}`;
173+
const estimatedTxCost = ethers.utils.formatEther(
174+
eip1559GasParams.maxFeePerGas.mul(eip1559GasParams.gasLimit)
175+
); // wei
176+
console.log('💸 Estimated Max Deployment Cost:', estimatedTxCost, 'ETH');
177+
break;
159178
//Flare
160179
case 14:
161180
case 114:
@@ -334,7 +353,13 @@ async function verifyContract(
334353
if (contract) {
335354
verifyContractArgs.contract = contract;
336355
}
337-
356+
console.log('\n=== Verifying Contract ===');
357+
console.log('Contract Name: ', contractName);
358+
console.log('Contract Address: ', contractAddress);
359+
console.log('Constructor Arguments:', constructorArguments);
360+
if (contract) {
361+
console.log('Full Contract Path: ', contract);
362+
}
338363
await hre.run('verify:verify', verifyContractArgs);
339364
} catch (e) {
340365
// @ts-ignore

scripts/deployBatcherContract.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ async function main() {
2929

3030
const chainId = await signers[0].getChainId();
3131
switch (chainId) {
32+
//Soneium
33+
case 1946:
34+
case 1868:
3235
//Coredao testnet
3336
case 1114:
3437
//WEMIX

0 commit comments

Comments
 (0)