Skip to content

Commit 7853de5

Browse files
committed
chore(contract-manager)-deploy-monad-testnet-again
1 parent eed1973 commit 7853de5

File tree

6 files changed

+45
-26
lines changed

6 files changed

+45
-26
lines changed

contract_manager/scripts/common.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const COMMON_DEPLOY_OPTIONS = {
109109
"std-output-dir": {
110110
type: "string",
111111
demandOption: true,
112-
desc: "Path to the Foundry output directory (contains Contract.sol/Contract.json structure)",
112+
desc: "Path to the Foundry output directory (typically 'out/' directory, contains Contract.sol/Contract.json structure)",
113113
},
114114
"private-key": {
115115
type: "string",
@@ -413,6 +413,20 @@ export async function topupAccountsIfNecessary(
413413
deploymentConfig.privateKey,
414414
);
415415
web3.eth.accounts.wallet.add(signer);
416+
417+
// Get the current nonce to avoid conflicts with pending transactions
418+
const nonce = await web3.eth.getTransactionCount(
419+
signer.address,
420+
"pending",
421+
);
422+
console.log(`Using nonce: ${nonce}`);
423+
424+
// Get gas price and apply multiplier
425+
const baseGasPrice = await chain.getGasPrice();
426+
const gasPrice = Math.trunc(
427+
Number(baseGasPrice) * deploymentConfig.gasPriceMultiplier,
428+
);
429+
416430
const estimatedGas = await web3.eth.estimateGas({
417431
from: signer.address,
418432
to: accountAddress,
@@ -423,7 +437,12 @@ export async function topupAccountsIfNecessary(
423437
from: signer.address,
424438
to: accountAddress,
425439
gas: estimatedGas * deploymentConfig.gasMultiplier,
440+
gasPrice: gasPrice.toString(),
441+
nonce: nonce,
426442
value: web3.utils.toWei(`${minBalance}`, "ether"),
443+
// // Uncomment this if your tx are getting stuck in the mempool. Or if you get this error:
444+
// // "An existing transaction had higher priority"
445+
// maxPriorityFeePerGas: gasPrice.toString(),
427446
});
428447

429448
console.log(

contract_manager/src/store/chains/EvmChains.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@
11571157
{
11581158
"id": "monad_testnet",
11591159
"mainnet": false,
1160-
"rpcUrl": "https://monad-testnet.drpc.org",
1160+
"rpcUrl": "https://rpc-testnet.monadinfra.com",
11611161
"networkId": 10143,
11621162
"type": "EvmChain"
11631163
},

contract_manager/src/store/contracts/EvmEntropyContracts.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,6 @@
149149
"address": "0xEbe57e8045F2F230872523bbff7374986E45C486",
150150
"type": "EvmEntropyContract"
151151
},
152-
{
153-
"chain": "monad_testnet",
154-
"address": "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
155-
"type": "EvmEntropyContract"
156-
},
157152
{
158153
"chain": "berachain_mainnet",
159154
"address": "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
@@ -203,5 +198,10 @@
203198
"chain": "sonic_evm_testnet",
204199
"address": "0x8D254a21b3C86D32F7179855531CE99164721933",
205200
"type": "EvmEntropyContract"
201+
},
202+
{
203+
"chain": "monad_testnet",
204+
"address": "0x825c0390f379C631f3Cf11A82a37D20BddF93c07",
205+
"type": "EvmEntropyContract"
206206
}
207-
]
207+
]

contract_manager/src/store/contracts/EvmExecutorContracts.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@
7979
"address": "0x8D254a21b3C86D32F7179855531CE99164721933",
8080
"type": "EvmExecutorContract"
8181
},
82-
{
83-
"chain": "monad_testnet",
84-
"address": "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
85-
"type": "EvmExecutorContract"
86-
},
8782
{
8883
"chain": "story_testnet",
8984
"address": "0x87047526937246727E4869C5f76A347160e08672",
@@ -238,5 +233,10 @@
238233
"chain": "sonic_evm_testnet",
239234
"address": "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
240235
"type": "EvmExecutorContract"
236+
},
237+
{
238+
"chain": "monad_testnet",
239+
"address": "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",
240+
"type": "EvmExecutorContract"
241241
}
242-
]
242+
]

contract_manager/src/store/contracts/EvmPriceFeedContracts.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,6 @@
759759
"address": "0x2880aB155794e7179c9eE2e38200202908C17B43",
760760
"type": "EvmPriceFeedContract"
761761
},
762-
{
763-
"chain": "monad_testnet",
764-
"address": "0x2880aB155794e7179c9eE2e38200202908C17B43",
765-
"type": "EvmPriceFeedContract"
766-
},
767762
{
768763
"chain": "berachain_mainnet",
769764
"address": "0x2880aB155794e7179c9eE2e38200202908C17B43",
@@ -918,5 +913,10 @@
918913
"chain": "celo_sepolia_testnet",
919914
"address": "0x2880aB155794e7179c9eE2e38200202908C17B43",
920915
"type": "EvmPriceFeedContract"
916+
},
917+
{
918+
"chain": "monad_testnet",
919+
"address": "0x2880aB155794e7179c9eE2e38200202908C17B43",
920+
"type": "EvmPriceFeedContract"
921921
}
922-
]
922+
]

contract_manager/src/store/contracts/EvmWormholeContracts.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -749,11 +749,6 @@
749749
"address": "0xb27e5ca259702f209a29225d0eDdC131039C9933",
750750
"type": "EvmWormholeContract"
751751
},
752-
{
753-
"chain": "monad_testnet",
754-
"address": "0xb27e5ca259702f209a29225d0eDdC131039C9933",
755-
"type": "EvmWormholeContract"
756-
},
757752
{
758753
"chain": "berachain_mainnet",
759754
"address": "0xb27e5ca259702f209a29225d0eDdC131039C9933",
@@ -928,5 +923,10 @@
928923
"chain": "celo_sepolia_testnet",
929924
"address": "0xb27e5ca259702f209a29225d0eDdC131039C9933",
930925
"type": "EvmWormholeContract"
926+
},
927+
{
928+
"chain": "monad_testnet",
929+
"address": "0xb27e5ca259702f209a29225d0eDdC131039C9933",
930+
"type": "EvmWormholeContract"
931931
}
932-
]
932+
]

0 commit comments

Comments
 (0)