From 2b1ad2a897c8cba4a2472205560ef1d3159a350d Mon Sep 17 00:00:00 2001 From: Leo Sollier Date: Thu, 22 Dec 2022 14:46:32 +0100 Subject: [PATCH 1/4] tombchain config --- packages/currency/src/native.ts | 6 ++++++ packages/smart-contracts/hardhat.config.ts | 5 +++++ packages/utils/src/providers.ts | 1 + 3 files changed, 12 insertions(+) diff --git a/packages/currency/src/native.ts b/packages/currency/src/native.ts index 407d903d8..be240b306 100644 --- a/packages/currency/src/native.ts +++ b/packages/currency/src/native.ts @@ -111,6 +111,12 @@ export const nativeCurrencies: Record = { avalanche: 'https://api.avax.network/ext/bc/C/rpc', optimism: 'https://mainnet.optimism.io', moonbeam: 'https://moonbeam.public.blastapi.io', + tombchain: 'https://rpc.tombchain.com/', }; /** From da136bef29ad5f8e0f9ff2f12a1896dc2ce4b8aa Mon Sep 17 00:00:00 2001 From: Leo Sollier Date: Thu, 22 Dec 2022 14:48:29 +0100 Subject: [PATCH 2/4] tombchin deployment --- .../smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts | 4 ++++ .../src/lib/artifacts/EthereumFeeProxy/index.ts | 4 ++++ .../src/lib/artifacts/RequestDeployer/index.ts | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/packages/smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts b/packages/smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts index 29b7f5ed6..8ad42c2cc 100644 --- a/packages/smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts +++ b/packages/smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts @@ -131,6 +131,10 @@ export const erc20FeeProxyArtifact = new ContractArtifact( address: '0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE', creationBlockNumber: 2415492, }, + tombchain: { + address: '0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE', + creationBlockNumber: 2951048, + }, }, }, // Additional deployments of same versions, not worth upgrading the version number but worth using within next versions diff --git a/packages/smart-contracts/src/lib/artifacts/EthereumFeeProxy/index.ts b/packages/smart-contracts/src/lib/artifacts/EthereumFeeProxy/index.ts index 71e97cd5e..7dedc8ed9 100644 --- a/packages/smart-contracts/src/lib/artifacts/EthereumFeeProxy/index.ts +++ b/packages/smart-contracts/src/lib/artifacts/EthereumFeeProxy/index.ts @@ -118,6 +118,10 @@ export const ethereumFeeProxyArtifact = new ContractArtifact( address: '0xe11BF2fDA23bF0A98365e1A4c04A87C9339e8687', creationBlockNumber: 2415490, }, + tombchain: { + address: '0xe11BF2fDA23bF0A98365e1A4c04A87C9339e8687', + creationBlockNumber: 2951047, + }, }, }, }, diff --git a/packages/smart-contracts/src/lib/artifacts/RequestDeployer/index.ts b/packages/smart-contracts/src/lib/artifacts/RequestDeployer/index.ts index 07ee300a7..1269c6abe 100644 --- a/packages/smart-contracts/src/lib/artifacts/RequestDeployer/index.ts +++ b/packages/smart-contracts/src/lib/artifacts/RequestDeployer/index.ts @@ -69,6 +69,10 @@ export const requestDeployer = new ContractArtifact( address: '0xE99Ab70a5FAE59551544FA326fA048f7B95A24B2', creationBlockNumber: 2415122, }, + tombchain: { + address: '0xE99Ab70a5FAE59551544FA326fA048f7B95A24B2', + creationBlockNumber: 2950756, + }, }, }, }, From aaf5eabb011fc81b3bd52e5bcdc707c63a6e4a58 Mon Sep 17 00:00:00 2001 From: Leo Sollier Date: Thu, 22 Dec 2022 14:49:59 +0100 Subject: [PATCH 3/4] fix: do not block if eip1559 is not supported --- .../scripts-create2/contract-setup/adminTasks.ts | 8 +++++++- packages/smart-contracts/scripts-create2/xdeployer.ts | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/smart-contracts/scripts-create2/contract-setup/adminTasks.ts b/packages/smart-contracts/scripts-create2/contract-setup/adminTasks.ts index 9cd54929f..f6445261e 100644 --- a/packages/smart-contracts/scripts-create2/contract-setup/adminTasks.ts +++ b/packages/smart-contracts/scripts-create2/contract-setup/adminTasks.ts @@ -248,7 +248,13 @@ export const getSignerAndGasFees = async ( provider = utils.getDefaultProvider(network); } const signer = new hre.ethers.Wallet(hre.config.xdeploy.signer).connect(provider); - const txOverrides = await utils.estimateGasFees({ provider }); + + let txOverrides; + try { + txOverrides = await utils.estimateGasFees({ provider }); + } catch (err) { + txOverrides = {}; + } return { signer, diff --git a/packages/smart-contracts/scripts-create2/xdeployer.ts b/packages/smart-contracts/scripts-create2/xdeployer.ts index 26a0392af..c8e8e0088 100644 --- a/packages/smart-contracts/scripts-create2/xdeployer.ts +++ b/packages/smart-contracts/scripts-create2/xdeployer.ts @@ -71,12 +71,15 @@ export const xdeploy = async ( let receipt = undefined; let deployed = false; let error = undefined; + let txOverrides: Overrides; - const txOverrides: Overrides = await utils.estimateGasFees({ provider }); try { + txOverrides = await utils.estimateGasFees({ provider }); const gasLimit = hre.config.xdeploy.gasLimit; txOverrides.gasLimit = gasLimit; } catch (e) { + // NOTE: On some networks utils.estimateGasFees do not work + txOverrides = {}; console.log('Cannot estimate gasLimit'); } From 29980de8e5505c8630d7a8eb995cf5cfa5f606ee Mon Sep 17 00:00:00 2001 From: Leo Sollier Date: Thu, 22 Dec 2022 14:58:50 +0100 Subject: [PATCH 4/4] update config --- .../payment-detection/src/eth/multichainExplorerApiProvider.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/payment-detection/src/eth/multichainExplorerApiProvider.ts b/packages/payment-detection/src/eth/multichainExplorerApiProvider.ts index 87cf78f6c..acafc53b3 100644 --- a/packages/payment-detection/src/eth/multichainExplorerApiProvider.ts +++ b/packages/payment-detection/src/eth/multichainExplorerApiProvider.ts @@ -11,6 +11,7 @@ const networks: Record = { bsc: { chainId: 56, name: 'bsc' }, optimism: { chainId: 10, name: 'optimism' }, moonbeam: { chainId: 1284, name: 'moonbeam' }, + tombchain: { chainId: 6969, name: 'tombchain' }, }; /**