diff --git a/src/contracts/factories/NFTFactory.ts b/src/contracts/factories/NFTFactory.ts index 4a69f7a1..bd603d3d 100644 --- a/src/contracts/factories/NFTFactory.ts +++ b/src/contracts/factories/NFTFactory.ts @@ -4,7 +4,6 @@ import { AbiItem } from 'web3-utils' import ERC721Factory from '@oceanprotocol/contracts/artifacts/contracts/ERC721Factory.sol/ERC721Factory.json' import { LoggerInstance, - getFairGasPrice, generateDtName, getFreCreationParams, getErcCreationParams, @@ -104,7 +103,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) let tokenAddress = null @@ -245,7 +244,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -300,7 +299,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -356,7 +355,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -404,7 +403,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -458,7 +457,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -517,7 +516,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -565,7 +564,7 @@ export class NftFactory extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.startMultipleTokenOrder(orders).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -622,7 +621,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -686,7 +685,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -749,7 +748,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -813,7 +812,7 @@ export class NftFactory extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt diff --git a/src/contracts/pools/Dispenser.ts b/src/contracts/pools/Dispenser.ts index 8b184f5f..c78d4b63 100644 --- a/src/contracts/pools/Dispenser.ts +++ b/src/contracts/pools/Dispenser.ts @@ -2,7 +2,7 @@ import { AbiItem } from 'web3-utils' import { TransactionReceipt } from 'web3-eth' import Decimal from 'decimal.js' import DispenserAbi from '@oceanprotocol/contracts/artifacts/contracts/pools/dispenser/Dispenser.sol/Dispenser.json' -import { LoggerInstance, getFairGasPrice, estimateGas } from '../../utils/' +import { LoggerInstance, estimateGas } from '../../utils/' import { Datatoken, SmartContractWithAddress } from '..' import { DispenserToken } from '../../@types' @@ -94,7 +94,7 @@ export class Dispenser extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -154,7 +154,7 @@ export class Dispenser extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -193,7 +193,7 @@ export class Dispenser extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.deactivate(dtAddress).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -247,7 +247,7 @@ export class Dispenser extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -308,7 +308,7 @@ export class Dispenser extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -348,7 +348,7 @@ export class Dispenser extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.ownerWithdraw(dtAddress).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { diff --git a/src/contracts/pools/FixedRateExchange.ts b/src/contracts/pools/FixedRateExchange.ts index 5e298831..f390cc3d 100644 --- a/src/contracts/pools/FixedRateExchange.ts +++ b/src/contracts/pools/FixedRateExchange.ts @@ -2,7 +2,7 @@ import FixedRateExchangeAbi from '@oceanprotocol/contracts/artifacts/contracts/p import { TransactionReceipt } from 'web3-core' import { Contract } from 'web3-eth-contract' import { AbiItem } from 'web3-utils/types' -import { LoggerInstance, getFairGasPrice, estimateGas, ZERO_ADDRESS } from '../../utils' +import { LoggerInstance, estimateGas, ZERO_ADDRESS } from '../../utils' import { PriceAndFees, FeesInfo, FixedPriceExchange } from '../../@types' import { SmartContractWithAddress } from '..' @@ -108,7 +108,7 @@ export class FixedRateExchange extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -200,7 +200,7 @@ export class FixedRateExchange extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -267,7 +267,7 @@ export class FixedRateExchange extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -319,7 +319,7 @@ export class FixedRateExchange extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -362,7 +362,7 @@ export class FixedRateExchange extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.toggleExchangeState(exchangeId).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -407,7 +407,7 @@ export class FixedRateExchange extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.toggleExchangeState(exchangeId).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -656,7 +656,7 @@ export class FixedRateExchange extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -709,7 +709,7 @@ export class FixedRateExchange extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -775,7 +775,7 @@ export class FixedRateExchange extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.collectBT(exchangeId, amountWei).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -841,7 +841,7 @@ export class FixedRateExchange extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.collectDT(exchangeId, amountWei).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -884,7 +884,7 @@ export class FixedRateExchange extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.collectMarketFee(exchangeId).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -927,7 +927,7 @@ export class FixedRateExchange extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.collectOceanFee(exchangeId).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -1022,7 +1022,7 @@ export class FixedRateExchange extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -1074,7 +1074,7 @@ export class FixedRateExchange extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } diff --git a/src/contracts/pools/Pool.ts b/src/contracts/pools/Pool.ts index c87b5ff0..adee05ed 100644 --- a/src/contracts/pools/Pool.ts +++ b/src/contracts/pools/Pool.ts @@ -5,7 +5,6 @@ import Decimal from 'decimal.js' import BigNumber from 'bignumber.js' import Bpool from '@oceanprotocol/contracts/artifacts/contracts/pools/balancer/BPool.sol/BPool.json' import { - getFairGasPrice, setContractDefaults, LoggerInstance, estimateGas, @@ -104,7 +103,7 @@ export class Pool extends SmartContract { result = await pool.methods.setSwapFee(this.web3.utils.toWei(fee)).send({ from: account, gas: estGas, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error(`ERROR: Failed to set pool swap fee: ${e.message}`) @@ -589,7 +588,7 @@ export class Pool extends SmartContract { result = await pool.methods.collectOPC().send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error(`ERROR: Failed to swap exact amount in : ${e.message}`) @@ -645,7 +644,7 @@ export class Pool extends SmartContract { result = await pool.methods.collectMarketFee().send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error(`ERROR: Failed to swap exact amount in : ${e.message}`) @@ -722,7 +721,7 @@ export class Pool extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error(`ERROR: Failed to updatePublishMarketFee : ${e.message}`) @@ -872,7 +871,7 @@ export class Pool extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error(`ERROR: Failed to swap exact amount in : ${e.message}`) @@ -1018,7 +1017,7 @@ export class Pool extends SmartContract { .send({ from: account, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error(`ERROR: Failed to swap exact amount out: ${e.message}`) @@ -1108,7 +1107,7 @@ export class Pool extends SmartContract { .send({ from: account, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error(`ERROR: Failed to pay tokens in order to \ @@ -1202,7 +1201,7 @@ export class Pool extends SmartContract { .send({ from: account, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error(`ERROR: Failed to pay pool shares into the pool: ${e.message}`) diff --git a/src/contracts/pools/Router.ts b/src/contracts/pools/Router.ts index d6ddaa9b..71f65313 100644 --- a/src/contracts/pools/Router.ts +++ b/src/contracts/pools/Router.ts @@ -2,7 +2,7 @@ import { Contract } from 'web3-eth-contract' import { TransactionReceipt } from 'web3-core' import { AbiItem } from 'web3-utils' import FactoryRouter from '@oceanprotocol/contracts/artifacts/contracts/pools/FactoryRouter.sol/FactoryRouter.json' -import { getFairGasPrice, estimateGas } from '../../utils' +import { estimateGas } from '../../utils' import { Operation } from '../../@types' import { SmartContractWithAddress } from '..' @@ -44,7 +44,7 @@ export class Router extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.buyDTBatch(operations).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -131,7 +131,7 @@ export class Router extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.addApprovedToken(tokenAddress).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -178,7 +178,7 @@ export class Router extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -218,7 +218,7 @@ export class Router extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.addSSContract(tokenAddress).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -261,7 +261,7 @@ export class Router extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.removeSSContract(tokenAddress).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -306,7 +306,7 @@ export class Router extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -355,7 +355,7 @@ export class Router extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -400,7 +400,7 @@ export class Router extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -449,7 +449,7 @@ export class Router extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -527,7 +527,7 @@ export class Router extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -570,7 +570,7 @@ export class Router extends SmartContractWithAddress { const trxReceipt = await this.contract.methods.addPoolTemplate(templateAddress).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -615,7 +615,7 @@ export class Router extends SmartContractWithAddress { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt diff --git a/src/contracts/pools/SideStaking.ts b/src/contracts/pools/SideStaking.ts index 4917b5c1..55bcf96d 100644 --- a/src/contracts/pools/SideStaking.ts +++ b/src/contracts/pools/SideStaking.ts @@ -2,7 +2,7 @@ import { AbiItem } from 'web3-utils/types' import { TransactionReceipt } from 'web3-core' import { Contract } from 'web3-eth-contract' import SideStakingAbi from '@oceanprotocol/contracts/artifacts/contracts/pools/ssContracts/SideStaking.sol/SideStaking.json' -import { LoggerInstance, getFairGasPrice, estimateGas } from '../../utils' +import { LoggerInstance, estimateGas } from '../../utils' import { SmartContract } from '..' export class SideStaking extends SmartContract { @@ -280,7 +280,7 @@ export class SideStaking extends SmartContract { result = await sideStaking.methods.getVesting(datatokenAddress).send({ from: account, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error('ERROR: Failed to join swap pool amount out') @@ -347,7 +347,7 @@ export class SideStaking extends SmartContract { .send({ from: account, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } catch (e) { LoggerInstance.error('ERROR: Failed to join swap pool amount out') diff --git a/src/contracts/tokens/Datatoken.ts b/src/contracts/tokens/Datatoken.ts index e8baad78..4fd9bf7f 100644 --- a/src/contracts/tokens/Datatoken.ts +++ b/src/contracts/tokens/Datatoken.ts @@ -7,7 +7,6 @@ import ERC20Template from '@oceanprotocol/contracts/artifacts/contracts/template import ERC20TemplateEnterprise from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC20TemplateEnterprise.sol/ERC20TemplateEnterprise.json' import { LoggerInstance, - getFairGasPrice, setContractDefaults, getFreOrderParams, estimateGas, @@ -112,7 +111,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -253,7 +252,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -344,7 +343,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } @@ -387,7 +386,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } else { @@ -444,7 +443,7 @@ export class Datatoken extends SmartContract { const trxReceipt = await dtContract.methods.addMinter(minter).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -502,7 +501,7 @@ export class Datatoken extends SmartContract { const trxReceipt = await dtContract.methods.removeMinter(minter).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -561,7 +560,7 @@ export class Datatoken extends SmartContract { const trxReceipt = await dtContract.methods.addPaymentManager(paymentManager).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -622,7 +621,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -690,7 +689,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -779,7 +778,7 @@ export class Datatoken extends SmartContract { const trxReceipt = await dtContract.methods.transfer(toAddress, amount).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -864,7 +863,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -927,7 +926,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -991,7 +990,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -1053,7 +1052,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt } catch (e) { @@ -1110,7 +1109,7 @@ export class Datatoken extends SmartContract { const trxReceipt = await dtContract.methods.setData(value).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -1159,7 +1158,7 @@ export class Datatoken extends SmartContract { const trxReceipt = await dtContract.methods.cleanPermissions().send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -1318,7 +1317,7 @@ export class Datatoken extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) } diff --git a/src/contracts/tokens/NFT.ts b/src/contracts/tokens/NFT.ts index e047bc99..710bd7d7 100644 --- a/src/contracts/tokens/NFT.ts +++ b/src/contracts/tokens/NFT.ts @@ -3,7 +3,6 @@ import { TransactionReceipt } from 'web3-eth' import ERC721Template from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC721Template.sol/ERC721Template.json' import { LoggerInstance, - getFairGasPrice, generateDtName, setContractDefaults, estimateGas @@ -127,7 +126,7 @@ export class Nft extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) let tokenAddress = null @@ -183,7 +182,7 @@ export class Nft extends SmartContract { const trxReceipt = await nftContract.methods.addManager(manager).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -232,7 +231,7 @@ export class Nft extends SmartContract { const trxReceipt = await nftContract.methods.removeManager(manager).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -292,7 +291,7 @@ export class Nft extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -359,7 +358,7 @@ export class Nft extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -417,7 +416,7 @@ export class Nft extends SmartContract { const trxReceipt = await nftContract.methods.addToMetadataList(metadataUpdater).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -486,7 +485,7 @@ export class Nft extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -544,7 +543,7 @@ export class Nft extends SmartContract { const trxReceipt = await nftContract.methods.addTo725StoreList(storeUpdater).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -608,7 +607,7 @@ export class Nft extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -662,7 +661,7 @@ export class Nft extends SmartContract { const trxReceipt = await nftContract.methods.cleanPermissions().send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -737,7 +736,7 @@ export class Nft extends SmartContract { .send({ from: nftOwner, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -812,7 +811,7 @@ export class Nft extends SmartContract { .send({ from: nftOwner, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -908,7 +907,7 @@ export class Nft extends SmartContract { .send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -975,7 +974,7 @@ export class Nft extends SmartContract { .send({ from: metadataUpdater, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -1037,7 +1036,7 @@ export class Nft extends SmartContract { const trxReceipt = await nftContract.methods.setMetaDataState(metadataState).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt @@ -1082,7 +1081,7 @@ export class Nft extends SmartContract { const trxReceipt = await nftContract.methods.setTokenURI('1', data).send({ from: address, gas: estGas + 1, - gasPrice: await getFairGasPrice(this.web3, this.config) + gasPrice: await this.getFairGasPrice() }) return trxReceipt }