diff --git a/abis/ERC677BridgeToken.abi.json b/abis/ERC677BridgeToken.abi.json new file mode 100644 index 0000000..8ba51f9 --- /dev/null +++ b/abis/ERC677BridgeToken.abi.json @@ -0,0 +1,597 @@ +[ + { + "constant": true, + "inputs": [], + "name": "mintingFinished", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "bridgeContract", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_addedValue", + "type": "uint256" + } + ], + "name": "increaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "name": "_name", + "type": "string" + }, + { + "name": "_symbol", + "type": "string" + }, + { + "name": "_decimals", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "from", + "type": "address" + }, + { + "indexed": false, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "ContractFallbackCallFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "MintFinished", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "previousOwner", + "type": "address" + } + ], + "name": "OwnershipRenounced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "burner", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "name": "data", + "type": "bytes" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "_bridgeContract", + "type": "address" + } + ], + "name": "setBridgeContract", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_data", + "type": "bytes" + } + ], + "name": "transferAndCall", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTokenInterfacesVersion", + "outputs": [ + { + "name": "major", + "type": "uint64" + }, + { + "name": "minor", + "type": "uint64" + }, + { + "name": "patch", + "type": "uint64" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "finishMinting", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_token", + "type": "address" + }, + { + "name": "_to", + "type": "address" + } + ], + "name": "claimTokens", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/abis/ForeignBridgeErc677ToErc677.abi.json b/abis/ForeignBridgeErc677ToErc677.abi.json new file mode 100644 index 0000000..43735ae --- /dev/null +++ b/abis/ForeignBridgeErc677ToErc677.abi.json @@ -0,0 +1,699 @@ +[ + { + "constant": true, + "inputs": [], + "name": "erc677token", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_txHash", + "type": "bytes32" + } + ], + "name": "relayedMessages", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "vs", + "type": "uint8[]" + }, + { + "name": "rs", + "type": "bytes32[]" + }, + { + "name": "ss", + "type": "bytes32[]" + }, + { + "name": "message", + "type": "bytes" + } + ], + "name": "executeSignatures", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_day", + "type": "uint256" + } + ], + "name": "totalSpentPerDay", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_dailyLimit", + "type": "uint256" + } + ], + "name": "setExecutionDailyLimit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getCurrentDay", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "requiredBlockConfirmations", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBridgeMode", + "outputs": [ + { + "name": "_data", + "type": "bytes4" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "executionDailyLimit", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_day", + "type": "uint256" + } + ], + "name": "totalExecutedPerDay", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "dailyLimit", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_token", + "type": "address" + }, + { + "name": "_to", + "type": "address" + } + ], + "name": "claimTokens", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "withinExecutionLimit", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "executionMaxPerTx", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "requiredSignatures", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "validatorContract", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "deployedAtBlock", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBridgeInterfacesVersion", + "outputs": [ + { + "name": "major", + "type": "uint64" + }, + { + "name": "minor", + "type": "uint64" + }, + { + "name": "patch", + "type": "uint64" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_minPerTx", + "type": "uint256" + } + ], + "name": "setMinPerTx", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + }, + { + "name": "", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_blockConfirmations", + "type": "uint256" + } + ], + "name": "setRequiredBlockConfirmations", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_dailyLimit", + "type": "uint256" + } + ], + "name": "setDailyLimit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_gasPrice", + "type": "uint256" + } + ], + "name": "setGasPrice", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_maxPerTx", + "type": "uint256" + } + ], + "name": "setMaxPerTx", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "upgradeabilityAdmin", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "minPerTx", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "withinLimit", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_maxPerTx", + "type": "uint256" + } + ], + "name": "setExecutionMaxPerTx", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "maxPerTx", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "gasPrice", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "UserRequestForAffirmation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "name": "transactionHash", + "type": "bytes32" + } + ], + "name": "RelayedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "gasPrice", + "type": "uint256" + } + ], + "name": "GasPriceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "requiredBlockConfirmations", + "type": "uint256" + } + ], + "name": "RequiredBlockConfirmationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "newLimit", + "type": "uint256" + } + ], + "name": "DailyLimitChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "newLimit", + "type": "uint256" + } + ], + "name": "ExecutionDailyLimitChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "previousOwner", + "type": "address" + }, + { + "indexed": false, + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "_validatorContract", + "type": "address" + }, + { + "name": "_erc20token", + "type": "address" + }, + { + "name": "_requiredBlockConfirmations", + "type": "uint256" + }, + { + "name": "_gasPrice", + "type": "uint256" + }, + { + "name": "_dailyLimit", + "type": "uint256" + }, + { + "name": "_maxPerTx", + "type": "uint256" + }, + { + "name": "_minPerTx", + "type": "uint256" + }, + { + "name": "_homeDailyLimit", + "type": "uint256" + }, + { + "name": "_homeMaxPerTx", + "type": "uint256" + }, + { + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "erc20token", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/config/affirmation-request-watcher.config.js b/config/affirmation-request-watcher.config.js index 24e770d..967ba53 100644 --- a/config/affirmation-request-watcher.config.js +++ b/config/affirmation-request-watcher.config.js @@ -1,11 +1,30 @@ require('dotenv').config() const baseConfig = require('./base.config') const erc20Abi = require('../abis/ERC20.abi') +const { ERC_TYPES } = require('../src/utils/constants') + +const initialChecksJson = process.argv[3] + +if (!initialChecksJson) { + throw new Error('initial check parameter was not provided.') +} + +let initialChecks +try { + initialChecks = JSON.parse(initialChecksJson) +} catch (e) { + throw new Error('Error on decoding values from initial checks.') +} + +if (baseConfig.id === 'erc-erc' && initialChecks.foreignERC === ERC_TYPES.ERC677) { + baseConfig.id = 'erc677-erc677' +} const id = `${baseConfig.id}-affirmation-request` module.exports = - baseConfig.id === 'erc-erc' || baseConfig.id === 'erc-native' + (baseConfig.id === 'erc-erc' && initialChecks.foreignERC === ERC_TYPES.ERC20) || + baseConfig.id === 'erc-native' ? { ...baseConfig.bridgeConfig, ...baseConfig.foreignConfig, diff --git a/config/base.config.js b/config/base.config.js index ed3799d..27b0537 100644 --- a/config/base.config.js +++ b/config/base.config.js @@ -8,7 +8,7 @@ const homeNativeErcAbi = require('../abis/HomeBridgeNativeToErc.abi') const foreignNativeErcAbi = require('../abis/ForeignBridgeNativeToErc.abi') const homeErcErcAbi = require('../abis/HomeBridgeErcToErc.abi') -const foreignErcErcAbi = require('../abis/ForeignBridgeErcToErc.abi') +const foreignErc677Erc677Abi = require('../abis/ForeignBridgeErc677ToErc677.abi') const homeErcNativeAbi = require('../abis/HomeBridgeErcToNative.abi') const foreignErcNativeAbi = require('../abis/ForeignBridgeErcToNative.abi') @@ -27,7 +27,7 @@ switch (process.env.BRIDGE_MODE) { break case 'ERC_TO_ERC': homeAbi = homeErcErcAbi - foreignAbi = foreignErcErcAbi + foreignAbi = foreignErc677Erc677Abi id = 'erc-erc' break case 'ERC_TO_NATIVE': diff --git a/e2e/parity/Dockerfile b/e2e/parity/Dockerfile index c8589f8..2a61df9 100644 --- a/e2e/parity/Dockerfile +++ b/e2e/parity/Dockerfile @@ -1,4 +1,4 @@ -FROM parity/parity:v2.2.11 +FROM parity/parity:v2.3.3 WORKDIR /stuff diff --git a/scripts/initialChecks.js b/scripts/initialChecks.js new file mode 100644 index 0000000..0f9940d --- /dev/null +++ b/scripts/initialChecks.js @@ -0,0 +1,33 @@ +const path = require('path') +require('dotenv').config({ + path: path.join(__dirname, '../.env') +}) +const Web3 = require('web3') +const ERC677BridgeTokenABI = require('../abis/ERC677BridgeToken.abi') +const { ERC_TYPES } = require('../src/utils/constants') + +async function initialChecks() { + const { ERC20_TOKEN_ADDRESS, BRIDGE_MODE, FOREIGN_RPC_URL, FOREIGN_BRIDGE_ADDRESS } = process.env + const result = {} + + if (BRIDGE_MODE === 'ERC_TO_ERC') { + const foreignWeb3 = new Web3(new Web3.providers.HttpProvider(FOREIGN_RPC_URL)) + const tokenContract = new foreignWeb3.eth.Contract(ERC677BridgeTokenABI, ERC20_TOKEN_ADDRESS) + try { + const bridgeContract = await tokenContract.methods.bridgeContract().call() + if (bridgeContract === FOREIGN_BRIDGE_ADDRESS) { + result.foreignERC = ERC_TYPES.ERC677 + } else { + result.foreignERC = ERC_TYPES.ERC20 + } + } catch (e) { + result.foreignERC = ERC_TYPES.ERC20 + } + } + console.log(JSON.stringify(result)) + return result +} + +initialChecks() + +module.exports = initialChecks diff --git a/scripts/start-worker.sh b/scripts/start-worker.sh index d0c7dec..374e040 100755 --- a/scripts/start-worker.sh +++ b/scripts/start-worker.sh @@ -9,8 +9,10 @@ WORKER="${WORKERS_DIR}${1}.js" CONFIG="${2}.config.js" LOG="${LOGS_DIR}${2}.txt" +CHECKS=$(node scripts/initialChecks.js) + if [ "${NODE_ENV}" = "production" ]; then - exec node "${WORKER}" "${CONFIG}" + exec node "${WORKER}" "${CONFIG}" "$CHECKS" else - node "${WORKER}" "${CONFIG}" | tee -a "${LOG}" | pino-pretty + node "${WORKER}" "${CONFIG}" "$CHECKS" | tee -a "${LOG}" | pino-pretty fi diff --git a/src/utils/constants.js b/src/utils/constants.js index 5351781..55a2861 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -16,5 +16,9 @@ module.exports = { GAS_PRICE_BOUNDARIES: { MIN: 1, MAX: 250 + }, + ERC_TYPES: { + ERC20: 'ERC20', + ERC677: 'ERC677' } } diff --git a/src/watcher.js b/src/watcher.js index dbdfb17..e566c5b 100644 --- a/src/watcher.js +++ b/src/watcher.js @@ -95,6 +95,7 @@ function processEvents(events) { case 'erc-native-collected-signatures': return processCollectedSignatures(events) case 'native-erc-affirmation-request': + case 'erc677-erc677-affirmation-request': return processAffirmationRequests(events) case 'erc-erc-affirmation-request': case 'erc-native-affirmation-request':