From aaa2a92ecf3b1d7f88e32eff93350615fa848816 Mon Sep 17 00:00:00 2001 From: Alex Kit Date: Wed, 3 Jan 2024 14:37:04 +0100 Subject: [PATCH] 'bump' --- lib/0xweb.js | 18 ++++++++++++++++-- lib/cli.js | 18 ++++++++++++++++-- package.json | 2 +- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/lib/0xweb.js b/lib/0xweb.js index 7834f40..e4ef607 100644 --- a/lib/0xweb.js +++ b/lib/0xweb.js @@ -21533,7 +21533,7 @@ var $rpc; async function waitForReceipt(rpc, hash) { let knownTx = false; let startedAt = Date.now(); - let MEM_POOL_TIMEOUT = 10000; + let MEM_POOL_TIMEOUT = 30000; let TX_TIMEOUT = Infinity; let receipt = await _promise_1.$promise.waitForObject(async () => { if (knownTx === false) { @@ -40295,6 +40295,9 @@ const Web3ClientFactory_1 = _dequanto_src_clients_Web3ClientFactory; const ContractDeployer_1 = _dequanto_src_contracts_deploy_ContractDeployer; const _sig_1 = _dequanto_src_utils__sig; const _address_1 = _dequanto_src_utils__address; +const _promise_1 = _dequanto_src_utils__promise; +const _date_1 = _dequanto_src_utils__date; +const _hex_1 = _dequanto_src_utils__hex; class HardhatProvider { constructor() { /* lazy load */ @@ -40386,6 +40389,17 @@ class HardhatProvider { } let address = _address_1.$address.toChecksum(receipt.contractAddress); _logger_1.$logger.log(`${receipt.status ? '✅' : '⛔'} Contract bold<${Ctor.name}> deployed to bold<${address}> in tx:${receipt.transactionHash}`); + await _promise_1.$promise.waitForTrue(async () => { + let code = await client.getCode(address); + if (_hex_1.$hex.isEmpty(code)) { + _logger_1.$logger.log(`⏳ Waiting for the contract data to be indexed...`); + return false; + } + return true; + }, { + timeoutMessage: `${receipt.transactionHash} did not deploy in 30s`, + timeoutMs: _date_1.$date.parseTimespan('30s') + }); let contract = new Ctor(address, client); return { contract, @@ -52527,7 +52541,7 @@ class GnosisSafeFactory { null); let tx = await safeFactoryContract.createProxyWithNonce(owner, safeContract.address, // _singleton, setupData.data, // initializer, - BigInt(params.saltNonce ?? exports.PREDETERMINED_SALT_NONCE)); + BigInt(params.saltNonce ?? (BigInt(exports.PREDETERMINED_SALT_NONCE) + BigInt(Date.now())))); let receipt = await tx.wait(); let logs = safeFactoryContract.extractLogsProxyCreation(receipt); _require_1.$require.eq(logs.length, 1, `Unexpected ProxyCreation Log count: ${logs.length}. In transaction ${receipt.transactionHash} `); diff --git a/lib/cli.js b/lib/cli.js index c8046df..8b559b0 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -21543,7 +21543,7 @@ var $rpc; async function waitForReceipt(rpc, hash) { let knownTx = false; let startedAt = Date.now(); - let MEM_POOL_TIMEOUT = 10000; + let MEM_POOL_TIMEOUT = 30000; let TX_TIMEOUT = Infinity; let receipt = await _promise_1.$promise.waitForObject(async () => { if (knownTx === false) { @@ -40305,6 +40305,9 @@ const Web3ClientFactory_1 = _dequanto_src_clients_Web3ClientFactory; const ContractDeployer_1 = _dequanto_src_contracts_deploy_ContractDeployer; const _sig_1 = _dequanto_src_utils__sig; const _address_1 = _dequanto_src_utils__address; +const _promise_1 = _dequanto_src_utils__promise; +const _date_1 = _dequanto_src_utils__date; +const _hex_1 = _dequanto_src_utils__hex; class HardhatProvider { constructor() { /* lazy load */ @@ -40396,6 +40399,17 @@ class HardhatProvider { } let address = _address_1.$address.toChecksum(receipt.contractAddress); _logger_1.$logger.log(`${receipt.status ? '✅' : '⛔'} Contract bold<${Ctor.name}> deployed to bold<${address}> in tx:${receipt.transactionHash}`); + await _promise_1.$promise.waitForTrue(async () => { + let code = await client.getCode(address); + if (_hex_1.$hex.isEmpty(code)) { + _logger_1.$logger.log(`⏳ Waiting for the contract data to be indexed...`); + return false; + } + return true; + }, { + timeoutMessage: `${receipt.transactionHash} did not deploy in 30s`, + timeoutMs: _date_1.$date.parseTimespan('30s') + }); let contract = new Ctor(address, client); return { contract, @@ -52537,7 +52551,7 @@ class GnosisSafeFactory { null); let tx = await safeFactoryContract.createProxyWithNonce(owner, safeContract.address, // _singleton, setupData.data, // initializer, - BigInt(params.saltNonce ?? exports.PREDETERMINED_SALT_NONCE)); + BigInt(params.saltNonce ?? (BigInt(exports.PREDETERMINED_SALT_NONCE) + BigInt(Date.now())))); let receipt = await tx.wait(); let logs = safeFactoryContract.extractLogsProxyCreation(receipt); _require_1.$require.eq(logs.length, 1, `Unexpected ProxyCreation Log count: ${logs.length}. In transaction ${receipt.transactionHash} `); diff --git a/package.json b/package.json index fd8e67e..1d266dc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "0xweb", "description": "Contract package manager and other web3 tools", - "version": "0.10.33", + "version": "0.10.34", "main": "./lib/0xweb.js", "types": "./lib/0xweb.d.ts", "bin": {