diff --git a/gas-relayer/config/config.json b/gas-relayer/config/config.json index 1c9bca9..1f02f5a 100644 --- a/gas-relayer/config/config.json +++ b/gas-relayer/config/config.json @@ -24,15 +24,12 @@ "tokens": { "0x0000000000000000000000000000000000000000": { - "minRelayFactor": 1, "name": "Ethereum", "symbol": "ETH" }, "0xD10e6dAe987Dcc0B3ADaA375C9f59690a4C97a27": { - "minRelayFactor": 10000, - "name": "Random Test Token", - "symbol": "RDN", - "pricePlugin": "../plugins/token-utils.js" + "name": "Status Network Token", + "symbol": "SNT" } }, diff --git a/gas-relayer/src/contract-settings.js b/gas-relayer/src/contract-settings.js index 16a4a8c..e9222d8 100644 --- a/gas-relayer/src/contract-settings.js +++ b/gas-relayer/src/contract-settings.js @@ -12,7 +12,6 @@ class ContractSettings { } process(){ - this._setTokenPricePlugin(); this._processContracts(); } @@ -28,15 +27,6 @@ class ContractSettings { return this.web3.utils.toHex(contractName).slice(0, 10); } - _setTokenPricePlugin(){ - for(let token in this.tokens){ - if(this.tokens[token].pricePlugin !== undefined){ - let PricePlugin = require(this.tokens[token].pricePlugin); - this.tokens[token].pricePlugin = new PricePlugin(this.tokens[token]); - } - } - } - _obtainContractBytecode(topicName){ if(this.contracts[topicName].isIdentity) return; diff --git a/gas-relayer/src/message-processor.js b/gas-relayer/src/message-processor.js index 50225b9..5f80f4a 100644 --- a/gas-relayer/src/message-processor.js +++ b/gas-relayer/src/message-processor.js @@ -96,14 +96,6 @@ class MessageProcessor { } } - _getFactor(input, contract, gasToken){ - if(contract.allowedFunctions[input.functionName].isToken){ - return this.web3.utils.toBN(this.settings.getToken(gasToken).pricePlugin.getFactor()); - } else { - return this.web3.utils.toBN(1); - } - } - async getBalance(token, input, gasToken){ // Determining balances of token used if(token.symbol == "ETH"){ @@ -186,11 +178,6 @@ class MessageProcessor { } const latestBlock = await web3.eth.getBlock("latest"); - - const factor = this._getFactor(input, contract, gasToken); - const balanceInETH = balance.div(factor); - const gasPriceInETH = gasPrice.div(factor); - let estimatedGas = 0; try { estimatedGas = await this._estimateGas(input, latestBlock.gasLimit); @@ -202,11 +189,6 @@ class MessageProcessor { return this._reply("Transaction will revert", message); } - const estimatedGasInTokens = estimatedGas.mul(gasPrice).mul(factor); - if(estimatedGasInToken < token.minRelayFactor){ - return this._reply("estimatedGasInTokens below accepted minimum", message); - } - let p = { from: this.config.node.blockchain.account, to: input.address,