From 498db2c607478cab0986c532daf45576b99b0fb7 Mon Sep 17 00:00:00 2001 From: shendel Date: Mon, 11 Dec 2023 07:04:17 +0300 Subject: [PATCH 1/3] phi - wrap token --- src/common/helpers/constants/ADDRESSES.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/helpers/constants/ADDRESSES.ts b/src/common/helpers/constants/ADDRESSES.ts index 674df4512e..02aaea9a45 100644 --- a/src/common/helpers/constants/ADDRESSES.ts +++ b/src/common/helpers/constants/ADDRESSES.ts @@ -15,7 +15,7 @@ export const WrapperCurrency = { 1313161554: '0xc9bdeed33cd01541e1eed10f90519d2c06fe3feb', 4181: '0xb61d26717dbd2ea6ebf4fadae02a28782f86864c', 180: '0xCc9bD40124EfedF6F198B8b5b50697dC635FaaC4', - 144: '0x587fe3Fdb7EcD6b134E1556A3Cd083ccF6e7f1B8', // phi-v2 + 144: '0x1278e0AdBc93291A54384594A9c27Da9f5890a9F', // phi-v2 40821: '0x325A2531D28e22D37935B65bd718D1244968dAae', // Fokawa (FKW) // testnet 4: '0xc778417e063141139fce010982780140aa0cd5ab', From 23ebe2aa56701be4a769f9afd6e213ac4cf17f47 Mon Sep 17 00:00:00 2001 From: shendel Date: Mon, 11 Dec 2023 07:26:28 +0300 Subject: [PATCH 2/3] isContract - some evms can throw error if not contract --- src/front/shared/redux/actions/ethLikeAction.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/front/shared/redux/actions/ethLikeAction.ts b/src/front/shared/redux/actions/ethLikeAction.ts index de75046c90..3e1977c3f0 100644 --- a/src/front/shared/redux/actions/ethLikeAction.ts +++ b/src/front/shared/redux/actions/ethLikeAction.ts @@ -584,12 +584,17 @@ class EthLikeAction { const Web3 = this.getCurrentWeb3() - const codeAtAddress = await Web3.eth.getCode(address) - const codeIsEmpty = !codeAtAddress || codeAtAddress === '0x' || codeAtAddress === '0x0' + try { + const codeAtAddress = await Web3.eth.getCode(address) + + const codeIsEmpty = !codeAtAddress || codeAtAddress === '0x' || codeAtAddress === '0x0' - contractsList[lowerAddress] = !codeIsEmpty + contractsList[lowerAddress] = !codeIsEmpty - return !codeIsEmpty + return !codeIsEmpty + } catch (err) { + return false + } } } From 35e531a00d09f2b91c5ca6ecd9ad1b71f2dfc00b Mon Sep 17 00:00:00 2001 From: shendel Date: Mon, 11 Dec 2023 07:37:35 +0300 Subject: [PATCH 3/3] evm config - allow set fixed gas price for tx --- src/common/helpers/constants/DEFAULT_CURRENCY_PARAMETERS.ts | 1 + src/common/helpers/ethLikeHelper.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/common/helpers/constants/DEFAULT_CURRENCY_PARAMETERS.ts b/src/common/helpers/constants/DEFAULT_CURRENCY_PARAMETERS.ts index 36cb6071c0..1ab746e386 100644 --- a/src/common/helpers/constants/DEFAULT_CURRENCY_PARAMETERS.ts +++ b/src/common/helpers/constants/DEFAULT_CURRENCY_PARAMETERS.ts @@ -56,6 +56,7 @@ export default { contractInteract: 200 * 1e3, swap: 70 * 1e3, }, + price_fixed: 2, price: { slow: 2, //100, normal: 2, //1000, diff --git a/src/common/helpers/ethLikeHelper.ts b/src/common/helpers/ethLikeHelper.ts index ba6effc3ce..4d0cf3f863 100644 --- a/src/common/helpers/ethLikeHelper.ts +++ b/src/common/helpers/ethLikeHelper.ts @@ -46,6 +46,8 @@ class ethLikeHelper { } estimateGasPrice = async (): Promise => { + if (this.defaultParams.price_fixed) return this.defaultParams.price_fixed + let response try {