From 7d4a0c6d2566891d97cde0508d7bd8ecfe5dc52f Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 16 Aug 2021 22:16:00 +0300 Subject: [PATCH 1/7] Stricter preconditions for payInterest (#623) --- .../InterestReceiverStakeBuyback.sol | 10 +--------- .../InterestReceiverSwapToETH.sol | 10 +--------- .../erc20_to_native/CompoundConnector.sol | 2 +- .../erc20_to_native/InterestConnector.sol | 13 ++++++++++++- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/contracts/upgradeable_contracts/InterestReceiverStakeBuyback.sol b/contracts/upgradeable_contracts/InterestReceiverStakeBuyback.sol index ff978923e..ea826ca67 100644 --- a/contracts/upgradeable_contracts/InterestReceiverStakeBuyback.sol +++ b/contracts/upgradeable_contracts/InterestReceiverStakeBuyback.sol @@ -26,14 +26,6 @@ contract InterestReceiverStakeBuyback is InterestReceiverBase { // (min received %) * (amount / 1 DAI) * (STAKE per 1 DAI) uint256 minAmount = (minReceivedFraction * amount * uniswapRouterV2.getAmountsOut(1 ether, path)[2]) / 10**36; - bytes memory data = abi.encodeWithSelector( - uniswapRouterV2.swapExactTokensForTokens.selector, - amount, - minAmount, - path, - burnAddress, - now - ); - address(uniswapRouterV2).call(data); + uniswapRouterV2.swapExactTokensForTokens(amount, minAmount, path, burnAddress, now); } } diff --git a/contracts/upgradeable_contracts/InterestReceiverSwapToETH.sol b/contracts/upgradeable_contracts/InterestReceiverSwapToETH.sol index e3f3a936c..5bb0aee5d 100644 --- a/contracts/upgradeable_contracts/InterestReceiverSwapToETH.sol +++ b/contracts/upgradeable_contracts/InterestReceiverSwapToETH.sol @@ -22,15 +22,7 @@ contract InterestReceiverSwapToETH is InterestReceiverBase { // (min received %) * (amount / 1 DAI) * (ETH per 1 DAI) uint256 minAmount = (minReceivedFraction * amount * uniswapRouterV2.getAmountsOut(1 ether, path)[1]) / 10**36; - bytes memory data = abi.encodeWithSelector( - uniswapRouterV2.swapExactTokensForETH.selector, - amount, - minAmount, - path, - address(this), - now - ); - address(uniswapRouterV2).call(data); + uniswapRouterV2.swapExactTokensForETH(amount, minAmount, path, address(this), now); } /** diff --git a/contracts/upgradeable_contracts/erc20_to_native/CompoundConnector.sol b/contracts/upgradeable_contracts/erc20_to_native/CompoundConnector.sol index 7143d5513..0c6816f35 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/CompoundConnector.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/CompoundConnector.sol @@ -86,7 +86,7 @@ contract CompoundConnector is InterestConnector { /** * @dev Claims Comp token and transfers it to the associated interest receiver. */ - function claimCompAndPay() external { + function claimCompAndPay() external onlyEOA { address[] memory holders = new address[](1); holders[0] = address(this); address[] memory markets = new address[](1); diff --git a/contracts/upgradeable_contracts/erc20_to_native/InterestConnector.sol b/contracts/upgradeable_contracts/erc20_to_native/InterestConnector.sol index 6f8c1e9f7..a79dbb4ca 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/InterestConnector.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/InterestConnector.sol @@ -21,6 +21,17 @@ contract InterestConnector is Ownable, ERC20Bridge { _; } + /** + * @dev Ensures that caller is an EOA. + * Functions with such modifier cannot be called from other contract (as well as from GSN-like approaches) + */ + modifier onlyEOA { + // solhint-disable-next-line avoid-tx-origin + require(msg.sender == tx.origin); + /* solcov ignore next */ + _; + } + /** * @dev Tells if interest earning was enabled for particular token. * @return true, if interest bearing is enabled. @@ -123,7 +134,7 @@ contract InterestConnector is Ownable, ERC20Bridge { * Requires interest for the given token to be enabled. * @param _token address of the token contract. */ - function payInterest(address _token) external interestEnabled(_token) { + function payInterest(address _token) external onlyEOA interestEnabled(_token) { uint256 interest = interestAmount(_token); require(interest >= minInterestPaid(_token)); From f1deecde4a76dc7cd57ae466be884e6e145a95c2 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 16 Aug 2021 22:16:55 +0300 Subject: [PATCH 2/7] Fix offset in comments (#624) --- contracts/libraries/Message.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/libraries/Message.sol b/contracts/libraries/Message.sol index 4e43e36a4..31337169d 100644 --- a/contracts/libraries/Message.sol +++ b/contracts/libraries/Message.sol @@ -15,7 +15,7 @@ library Message { // offset 32: 20 bytes :: address - recipient address // offset 52: 32 bytes :: uint256 - value // offset 84: 32 bytes :: bytes32 - transaction hash - // offset 104: 20 bytes :: address - contract address to prevent double spending + // offset 116: 20 bytes :: address - contract address to prevent double spending // mload always reads 32 bytes. // so we can and have to start reading recipient at offset 20 instead of 32. From 4b0eb1e2fc8a709dd08770f62199452ebf8ba617 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 18 Aug 2021 13:49:24 +0300 Subject: [PATCH 3/7] Use fixed lower call gas limit (#627) --- .../arbitrary_message/MessageDelivery.sol | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/contracts/upgradeable_contracts/arbitrary_message/MessageDelivery.sol b/contracts/upgradeable_contracts/arbitrary_message/MessageDelivery.sol index c26a0b867..78d859c90 100644 --- a/contracts/upgradeable_contracts/arbitrary_message/MessageDelivery.sol +++ b/contracts/upgradeable_contracts/arbitrary_message/MessageDelivery.sol @@ -10,6 +10,8 @@ contract MessageDelivery is BasicAMB, MessageProcessor { using SafeMath for uint256; uint256 internal constant SEND_TO_ORACLE_DRIVEN_LANE = 0x00; + // after EIP2929, call to warmed contract address costs 100 instead of 2600 + uint256 internal constant MIN_GAS_PER_CALL = 100; /** * @dev Requests message relay to the opposite network @@ -32,7 +34,7 @@ contract MessageDelivery is BasicAMB, MessageProcessor { // it is not allowed to pass messages while other messages are processed // if other is not explicitly configured require(messageId() == bytes32(0) || allowReentrantRequests()); - require(_gas >= getMinimumGasUsage(_data) && _gas <= maxGasPerTx()); + require(_gas >= MIN_GAS_PER_CALL && _gas <= maxGasPerTx()); (bytes32 _messageId, bytes memory header) = _packHeader(_contract, _gas, _dataType); @@ -42,17 +44,6 @@ contract MessageDelivery is BasicAMB, MessageProcessor { return _messageId; } - /** - * @dev Returns a lower limit on gas limit for the particular message data - * @param _data calldata passed to the executor on the other side - */ - function getMinimumGasUsage(bytes _data) public pure returns (uint256 gas) { - // From Ethereum Yellow Paper - // 68 gas is paid for every non-zero byte of data or code for a transaction - // Starting from Istanbul hardfork, 16 gas is paid (EIP-2028) - return _data.length.mul(16); - } - /** * @dev Packs message header into a single bytes blob * @param _contract executor address on the other side From 7579b5249e074f3db26de08b2ab7dc7840b39353 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Wed, 18 Aug 2021 13:51:51 +0300 Subject: [PATCH 4/7] Separate XDaiForeignBridge contract with compound and GSN support (#626) --- ...tiveMock.sol => XDaiForeignBridgeMock.sol} | 4 +- .../GSNForeignERC20Bridge.sol | 9 +- .../ForeignBridgeErcToNative.sol | 69 +----------- .../erc20_to_native/XDaiForeignBridge.sol | 102 ++++++++++++++++++ deploy/src/erc_to_native/foreign.js | 2 +- deploy/src/loadContracts.js | 2 +- test/erc_to_native/foreign_bridge.test.js | 16 +-- test/erc_to_native/foreign_bridge_gsn.test.js | 26 ++--- 8 files changed, 134 insertions(+), 96 deletions(-) rename contracts/mocks/{ForeignBridgeErcToNativeMock.sol => XDaiForeignBridgeMock.sol} (86%) create mode 100644 contracts/upgradeable_contracts/erc20_to_native/XDaiForeignBridge.sol diff --git a/contracts/mocks/ForeignBridgeErcToNativeMock.sol b/contracts/mocks/XDaiForeignBridgeMock.sol similarity index 86% rename from contracts/mocks/ForeignBridgeErcToNativeMock.sol rename to contracts/mocks/XDaiForeignBridgeMock.sol index cf540965f..7246127e5 100644 --- a/contracts/mocks/ForeignBridgeErcToNativeMock.sol +++ b/contracts/mocks/XDaiForeignBridgeMock.sol @@ -1,8 +1,8 @@ pragma solidity 0.4.24; -import "../upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol"; +import "../upgradeable_contracts/erc20_to_native/XDaiForeignBridge.sol"; -contract ForeignBridgeErcToNativeMock is ForeignBridgeErcToNative { +contract XDaiForeignBridgeMock is XDaiForeignBridge { /** * @dev Tells the address of the DAI token in the Ganache Testchain. */ diff --git a/contracts/upgradeable_contracts/GSNForeignERC20Bridge.sol b/contracts/upgradeable_contracts/GSNForeignERC20Bridge.sol index 0948b3b13..b1d23e337 100644 --- a/contracts/upgradeable_contracts/GSNForeignERC20Bridge.sol +++ b/contracts/upgradeable_contracts/GSNForeignERC20Bridge.sol @@ -59,12 +59,9 @@ contract GSNForeignERC20Bridge is BasicForeignBridge, ERC20Bridge, BaseRelayReci function onExecuteMessageGSN(address recipient, uint256 amount, uint256 fee) internal returns (bool) { addTotalExecutedPerDay(getCurrentDay(), amount); // Send maxTokensFee to paymaster - uint256 unshiftMaxFee = _unshiftValue(fee); - bool first = erc20token().transfer(addressStorage[PAYMASTER], unshiftMaxFee); - - // Send rest of tokens to user - uint256 unshiftLeft = _unshiftValue(amount - fee); - bool second = erc20token().transfer(recipient, unshiftLeft); + ERC20 token = erc20token(); + bool first = token.transfer(addressStorage[PAYMASTER], fee); + bool second = token.transfer(recipient, amount - fee); return first && second; } diff --git a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol index 5714dc586..228dfa0b3 100644 --- a/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol +++ b/contracts/upgradeable_contracts/erc20_to_native/ForeignBridgeErcToNative.sol @@ -1,18 +1,9 @@ pragma solidity 0.4.24; -import "../BasicForeignBridge.sol"; import "../ERC20Bridge.sol"; import "../OtherSideBridgeStorage.sol"; -import "./CompoundConnector.sol"; -import "../GSNForeignERC20Bridge.sol"; -contract ForeignBridgeErcToNative is - BasicForeignBridge, - ERC20Bridge, - OtherSideBridgeStorage, - CompoundConnector, - GSNForeignERC20Bridge -{ +contract ForeignBridgeErcToNative is ERC20Bridge, OtherSideBridgeStorage { function initialize( address _validatorContract, address _erc20token, @@ -46,26 +37,6 @@ contract ForeignBridgeErcToNative is return 0x18762d46; // bytes4(keccak256(abi.encodePacked("erc-to-native-core"))) } - function upgradeTo530(address _interestReceiver) external { - require(msg.sender == address(this)); - - address dai = address(daiToken()); - address comp = address(compToken()); - _setInterestEnabled(dai, true); - _setMinCashThreshold(dai, 1000000 ether); - _setMinInterestPaid(dai, 1000 ether); - _setInterestReceiver(dai, _interestReceiver); - - _setMinInterestPaid(comp, 1 ether); - _setInterestReceiver(comp, _interestReceiver); - - invest(dai); - } - - function investDai() external { - invest(address(daiToken())); - } - /** * @dev Withdraws the erc20 tokens or native coins from this contract. * @param _token address of the claimed token or address(0) for native coins. @@ -73,51 +44,17 @@ contract ForeignBridgeErcToNative is */ function claimTokens(address _token, address _to) external onlyIfUpgradeabilityOwner { // Since bridged tokens are locked at this contract, it is not allowed to claim them with the use of claimTokens function - address bridgedToken = address(erc20token()); - require(_token != address(bridgedToken)); - require(_token != address(cDaiToken()) || !isInterestEnabled(bridgedToken)); - require(_token != address(compToken()) || !isInterestEnabled(bridgedToken)); + require(_token != address(erc20token())); claimValues(_token, _to); } - function onExecuteMessageGSN(address recipient, uint256 amount, uint256 fee) internal returns (bool) { - addTotalExecutedPerDay(getCurrentDay(), amount); - uint256 unshiftMaxFee = _unshiftValue(fee); - uint256 unshiftLeft = _unshiftValue(amount - fee); - - ERC20 token = erc20token(); - ensureEnoughTokens(token, unshiftMaxFee + unshiftLeft); - - // Send maxTokensFee to paymaster - bool first = token.transfer(addressStorage[PAYMASTER], unshiftMaxFee); - - // Send rest of tokens to user - bool second = token.transfer(recipient, unshiftLeft); - - return first && second; - } - function onExecuteMessage( address _recipient, uint256 _amount, bytes32 /*_txHash*/ ) internal returns (bool) { addTotalExecutedPerDay(getCurrentDay(), _amount); - uint256 amount = _unshiftValue(_amount); - - ERC20 token = erc20token(); - ensureEnoughTokens(token, amount); - - return token.transfer(_recipient, amount); - } - - function ensureEnoughTokens(ERC20 token, uint256 amount) internal { - uint256 currentBalance = token.balanceOf(address(this)); - - if (currentBalance < amount) { - uint256 withdrawAmount = (amount - currentBalance).add(minCashThreshold(address(token))); - _withdraw(address(token), withdrawAmount); - } + return erc20token().transfer(_recipient, _unshiftValue(_amount)); } function onFailedMessage(address, uint256, bytes32) internal { diff --git a/contracts/upgradeable_contracts/erc20_to_native/XDaiForeignBridge.sol b/contracts/upgradeable_contracts/erc20_to_native/XDaiForeignBridge.sol new file mode 100644 index 000000000..23394d87b --- /dev/null +++ b/contracts/upgradeable_contracts/erc20_to_native/XDaiForeignBridge.sol @@ -0,0 +1,102 @@ +pragma solidity 0.4.24; + +import "./ForeignBridgeErcToNative.sol"; +import "./CompoundConnector.sol"; +import "../GSNForeignERC20Bridge.sol"; + +contract XDaiForeignBridge is ForeignBridgeErcToNative, CompoundConnector, GSNForeignERC20Bridge { + function initialize( + address _validatorContract, + address _erc20token, + uint256 _requiredBlockConfirmations, + uint256 _gasPrice, + uint256[3] _dailyLimitMaxPerTxMinPerTxArray, // [ 0 = _dailyLimit, 1 = _maxPerTx, 2 = _minPerTx ] + uint256[2] _homeDailyLimitHomeMaxPerTxArray, //[ 0 = _homeDailyLimit, 1 = _homeMaxPerTx ] + address _owner, + int256 _decimalShift, + address _bridgeOnOtherSide + ) external onlyRelevantSender returns (bool) { + require(!isInitialized()); + require(AddressUtils.isContract(_validatorContract)); + require(_erc20token == address(daiToken())); + require(_decimalShift == 0); + + addressStorage[VALIDATOR_CONTRACT] = _validatorContract; + uintStorage[DEPLOYED_AT_BLOCK] = block.number; + _setRequiredBlockConfirmations(_requiredBlockConfirmations); + _setGasPrice(_gasPrice); + _setLimits(_dailyLimitMaxPerTxMinPerTxArray); + _setExecutionLimits(_homeDailyLimitHomeMaxPerTxArray); + _setOwner(_owner); + _setBridgeContractOnOtherSide(_bridgeOnOtherSide); + setInitialize(); + + return isInitialized(); + } + + function erc20token() public view returns (ERC20) { + return daiToken(); + } + + function upgradeTo530(address _interestReceiver) external { + require(msg.sender == address(this)); + + address dai = address(daiToken()); + address comp = address(compToken()); + _setInterestEnabled(dai, true); + _setMinCashThreshold(dai, 1000000 ether); + _setMinInterestPaid(dai, 1000 ether); + _setInterestReceiver(dai, _interestReceiver); + + _setMinInterestPaid(comp, 1 ether); + _setInterestReceiver(comp, _interestReceiver); + + invest(dai); + } + + function investDai() external { + invest(address(daiToken())); + } + + /** + * @dev Withdraws the erc20 tokens or native coins from this contract. + * @param _token address of the claimed token or address(0) for native coins. + * @param _to address of the tokens/coins receiver. + */ + function claimTokens(address _token, address _to) external onlyIfUpgradeabilityOwner { + // Since bridged tokens are locked at this contract, it is not allowed to claim them with the use of claimTokens function + address bridgedToken = address(daiToken()); + require(_token != address(bridgedToken)); + require(_token != address(cDaiToken()) || !isInterestEnabled(bridgedToken)); + require(_token != address(compToken()) || !isInterestEnabled(bridgedToken)); + claimValues(_token, _to); + } + + function onExecuteMessage( + address _recipient, + uint256 _amount, + bytes32 /*_txHash*/ + ) internal returns (bool) { + addTotalExecutedPerDay(getCurrentDay(), _amount); + + ERC20 token = daiToken(); + ensureEnoughTokens(token, _amount); + + return token.transfer(_recipient, _amount); + } + + function onExecuteMessageGSN(address recipient, uint256 amount, uint256 fee) internal returns (bool) { + ensureEnoughTokens(daiToken(), amount); + + return super.onExecuteMessageGSN(recipient, amount, fee); + } + + function ensureEnoughTokens(ERC20 token, uint256 amount) internal { + uint256 currentBalance = token.balanceOf(address(this)); + + if (currentBalance < amount) { + uint256 withdrawAmount = (amount - currentBalance).add(minCashThreshold(address(token))); + _withdraw(address(token), withdrawAmount); + } + } +} diff --git a/deploy/src/erc_to_native/foreign.js b/deploy/src/erc_to_native/foreign.js index 940896b5f..b9ffb22d6 100644 --- a/deploy/src/erc_to_native/foreign.js +++ b/deploy/src/erc_to_native/foreign.js @@ -13,7 +13,7 @@ const { } = require('../deploymentUtils') const { web3Foreign, deploymentPrivateKey, FOREIGN_RPC_URL } = require('../web3') const { - foreignContracts: { EternalStorageProxy, BridgeValidators, ForeignBridgeErcToNative: ForeignBridge } + foreignContracts: { EternalStorageProxy, BridgeValidators, XDaiForeignBridge: ForeignBridge } } = require('../loadContracts') const VALIDATORS = env.VALIDATORS.split(' ') diff --git a/deploy/src/loadContracts.js b/deploy/src/loadContracts.js index bb5346524..509d556d6 100644 --- a/deploy/src/loadContracts.js +++ b/deploy/src/loadContracts.js @@ -11,7 +11,7 @@ function getContracts() { ERC677BridgeToken: require(`../../build/${buildPath}/ERC677BridgeToken.json`), ERC677BridgeTokenRewardable: require(`../../build/${buildPath}/ERC677BridgeTokenRewardable.json`), ERC677BridgeTokenPermittable: require(`../../build/${buildPath}/PermittableToken.json`), - ForeignBridgeErcToNative: require(`../../build/${buildPath}/ForeignBridgeErcToNative.json`), + XDaiForeignBridge: require(`../../build/${buildPath}/XDaiForeignBridge.json`), FeeManagerErcToNative: require(`../../build/${buildPath}/FeeManagerErcToNative.json`), FeeManagerErcToNativePOSDAO: require(`../../build/${buildPath}/FeeManagerErcToNativePOSDAO.json`), HomeBridgeErcToNative: require(`../../build/${buildPath}/HomeBridgeErcToNative.json`), diff --git a/test/erc_to_native/foreign_bridge.test.js b/test/erc_to_native/foreign_bridge.test.js index a3f6f8ad8..b9e25ea9c 100644 --- a/test/erc_to_native/foreign_bridge.test.js +++ b/test/erc_to_native/foreign_bridge.test.js @@ -3,7 +3,7 @@ const BridgeValidators = artifacts.require('BridgeValidators.sol') const EternalStorageProxy = artifacts.require('EternalStorageProxy.sol') const ERC677BridgeToken = artifacts.require('ERC677BridgeToken.sol') const ERC20Mock = artifacts.require('ERC20Mock.sol') -const ForeignBridgeErcToNativeMock = artifacts.require('ForeignBridgeErcToNativeMock.sol') +const XDaiForeignBridgeMock = artifacts.require('XDaiForeignBridgeMock.sol') const { expect } = require('chai') const { ERROR_MSG, ZERO_ADDRESS, toBN } = require('../setup') @@ -212,7 +212,7 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { const value = ether('0.25') let foreignBridge beforeEach(async () => { - foreignBridge = await ForeignBridgeErcToNativeMock.new() + foreignBridge = await ForeignBridge.new() token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) await foreignBridge.initialize( validatorContract.address, @@ -367,7 +367,7 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { await multisigValidatorContract.initialize(2, twoAuthorities, ownerOfValidatorContract, { from: ownerOfValidatorContract }) - foreignBridgeWithMultiSignatures = await ForeignBridgeErcToNativeMock.new() + foreignBridgeWithMultiSignatures = await ForeignBridge.new() await foreignBridgeWithMultiSignatures.initialize( multisigValidatorContract.address, token.address, @@ -429,7 +429,7 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { await validatorContractWith3Signatures.initialize(3, authoritiesFiveAccs, ownerOfValidators) const erc20Token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) const value = halfEther - const foreignBridgeWithThreeSigs = await ForeignBridgeErcToNativeMock.new() + const foreignBridgeWithThreeSigs = await ForeignBridge.new() await foreignBridgeWithThreeSigs.initialize( validatorContractWith3Signatures.address, @@ -477,7 +477,7 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { await validatorContract.initialize(MAX_SIGNATURES, addresses, ownerOfValidators) const erc20Token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) - const foreignBridgeWithMaxSigs = await ForeignBridgeErcToNativeMock.new() + const foreignBridgeWithMaxSigs = await ForeignBridge.new() await foreignBridgeWithMaxSigs.initialize( validatorContract.address, @@ -622,7 +622,7 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { const valueOnHome = toBN(valueOnForeign * 10 ** decimalShift) const owner = accounts[0] - const foreignBridgeImpl = await ForeignBridgeErcToNativeMock.new() + const foreignBridgeImpl = await ForeignBridge.new() const storageProxy = await EternalStorageProxy.new().should.be.fulfilled await storageProxy.upgradeTo('1', foreignBridgeImpl.address).should.be.fulfilled const foreignBridge = await ForeignBridge.at(storageProxy.address) @@ -673,7 +673,7 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { await multisigValidatorContract.initialize(2, twoAuthorities, ownerOfValidatorContract, { from: ownerOfValidatorContract }) - const foreignBridgeWithMultiSignatures = await ForeignBridgeErcToNativeMock.new() + const foreignBridgeWithMultiSignatures = await ForeignBridge.new() await foreignBridgeWithMultiSignatures.initialize( multisigValidatorContract.address, token.address, @@ -862,7 +862,7 @@ contract('ForeignBridge_ERC20_to_Native', async accounts => { }) beforeEach(async () => { - foreignBridge = await ForeignBridgeErcToNativeMock.new() + foreignBridge = await XDaiForeignBridgeMock.new() await foreignBridge.initialize( validatorContract.address, dai.address, diff --git a/test/erc_to_native/foreign_bridge_gsn.test.js b/test/erc_to_native/foreign_bridge_gsn.test.js index 0f177c92f..48d2a5643 100644 --- a/test/erc_to_native/foreign_bridge_gsn.test.js +++ b/test/erc_to_native/foreign_bridge_gsn.test.js @@ -1,10 +1,8 @@ // Required for opengsn proper work require('array-flat-polyfill') -const ForeignBridge = artifacts.require('ForeignBridgeErcToNative.sol') -const ForeignBridgeErcToNativeMock = artifacts.require('ForeignBridgeErcToNativeMock.sol') +const XDaiForeignBridgeMock = artifacts.require('XDaiForeignBridgeMock.sol') const BridgeValidators = artifacts.require('BridgeValidators.sol') -const ERC677BridgeToken = artifacts.require('ERC677BridgeToken.sol') const UniswapRouterMock = artifacts.require('UniswapRouterMock.sol') const TokenPaymaster = artifacts.require('TokenPaymaster.sol') @@ -23,6 +21,7 @@ const { evalMetrics, paymasterError } = require('../helpers/helpers') +const getCompoundContracts = require('../compound/contracts') const requireBlockConfirmations = 8 const gasPrice = web3.utils.toWei('1', 'gwei') @@ -43,6 +42,8 @@ function createEmptyAccount(relayer) { } contract('ForeignBridge_ERC20_to_Native_GSN', async accounts => { + const faucet = accounts[6] // account where all Compound-related DAIs where minted + let validatorContract let authorities let owner @@ -65,16 +66,18 @@ contract('ForeignBridge_ERC20_to_Native_GSN', async accounts => { authorities = [accounts[1], accounts[2]] owner = accounts[0] await validatorContract.initialize(1, authorities, owner) - otherSideBridge = await ForeignBridge.new() + otherSideBridge = await XDaiForeignBridgeMock.new() + + const contracts = await getCompoundContracts() + token = contracts.dai }) after(async () => { await GsnTestEnvironment.stopGsn() }) describe('#initialize', async () => { it('should initialize', async () => { - token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) router = await UniswapRouterMock.new() - foreignBridge = await ForeignBridgeErcToNativeMock.new() + foreignBridge = await XDaiForeignBridgeMock.new() paymaster = await TokenPaymaster.new( RelayHubAddress, @@ -100,9 +103,8 @@ contract('ForeignBridge_ERC20_to_Native_GSN', async accounts => { let GSNRelayer let GSNSigner beforeEach(async () => { - token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) - ForeignBridgeErcToNativeMock.web3.setProvider(web3.currentProvider) - foreignBridge = await ForeignBridgeErcToNativeMock.new() + XDaiForeignBridgeMock.web3.setProvider(web3.currentProvider) + foreignBridge = await XDaiForeignBridgeMock.new() await foreignBridge.initialize( validatorContract.address, token.address, @@ -128,7 +130,7 @@ contract('ForeignBridge_ERC20_to_Native_GSN', async accounts => { await foreignBridge.setTrustedForwarder(ForwarderAddress) await foreignBridge.setPayMaster(paymaster.address) - await token.mint(foreignBridge.address, BRIDGE_TOKENS) + await token.transfer(foreignBridge.address, BRIDGE_TOKENS, { from: faucet }) // Give Router 1 ether await web3.eth.sendTransaction({ @@ -158,7 +160,7 @@ contract('ForeignBridge_ERC20_to_Native_GSN', async accounts => { // From now on all calls will be relayed through GSN. // If you want to omit GSN specify // { useGSN: false } in transaction details - ForeignBridgeErcToNativeMock.web3.setProvider(GSNRelayer) + XDaiForeignBridgeMock.web3.setProvider(GSNRelayer) }) it('should allow to executeSignaturesGSN', async () => { const recipientAccount = GSNSigner @@ -243,7 +245,7 @@ contract('ForeignBridge_ERC20_to_Native_GSN', async accounts => { .fulfilled // tx 2 - await token.mint(foreignBridge.address, BRIDGE_TOKENS) + await token.transfer(foreignBridge.address, BRIDGE_TOKENS, { from: faucet }) const from2 = createEmptyAccount(GSNRelayer) const message2 = createMessage(from2, REQUESTED_TOKENS, transactionHash, foreignBridge.address) const signature2 = await sign(authorities[0], message2) From 93b1afbe67c1ae67ddd35305c6a7c25d557256c0 Mon Sep 17 00:00:00 2001 From: Leonid Tyurin Date: Fri, 20 Aug 2021 12:48:10 +0300 Subject: [PATCH 5/7] Update GSN interface (#628) --- contracts/gsn/BasePaymaster.sol | 41 +- contracts/gsn/forwarder/IForwarder.sol | 10 +- contracts/gsn/interfaces/GsnTypes.sol | 3 +- contracts/gsn/interfaces/IPaymaster.sol | 13 +- .../gsn/token_paymaster/TokenPaymaster.sol | 55 +- .../GSNForeignERC20Bridge.sol | 3 +- package-lock.json | 1566 ++++++++++++----- package.json | 7 +- test/erc_to_native/foreign_bridge_gsn.test.js | 33 +- 9 files changed, 1242 insertions(+), 489 deletions(-) diff --git a/contracts/gsn/BasePaymaster.sol b/contracts/gsn/BasePaymaster.sol index 2f6ff0826..548075c1e 100644 --- a/contracts/gsn/BasePaymaster.sol +++ b/contracts/gsn/BasePaymaster.sol @@ -4,7 +4,6 @@ pragma experimental ABIEncoderV2; import "../upgradeable_contracts/Ownable.sol"; -import "./interfaces/GsnTypes.sol"; import "./interfaces/IPaymaster.sol"; import "./interfaces/IRelayHub.sol"; import "./utils/GsnEip712Library.sol"; @@ -18,7 +17,7 @@ import "./forwarder/IForwarder.sol"; */ contract BasePaymaster is IPaymaster, Ownable { IRelayHub internal relayHub; - IForwarder public trustedForwarder; + address private _trustedForwarder; function getHubAddr() public view returns (address) { return address(relayHub); @@ -27,20 +26,26 @@ contract BasePaymaster is IPaymaster, Ownable { //overhead of forwarder verify+signature, plus hub overhead. uint256 public constant FORWARDER_HUB_OVERHEAD = 50000; - //These parameters are documented in IPaymaster.GasLimits + //These parameters are documented in IPaymaster.GasAndDataLimits uint256 public constant PRE_RELAYED_CALL_GAS_LIMIT = 100000; uint256 public constant POST_RELAYED_CALL_GAS_LIMIT = 110000; uint256 public constant PAYMASTER_ACCEPTANCE_BUDGET = PRE_RELAYED_CALL_GAS_LIMIT + FORWARDER_HUB_OVERHEAD; + uint256 public constant CALLDATA_SIZE_LIMIT = 10500; - function getGasLimits() external view returns (IPaymaster.GasLimits) { + function getGasAndDataLimits() external view returns (IPaymaster.GasAndDataLimits limits) { return - IPaymaster.GasLimits(PAYMASTER_ACCEPTANCE_BUDGET, PRE_RELAYED_CALL_GAS_LIMIT, POST_RELAYED_CALL_GAS_LIMIT); + IPaymaster.GasAndDataLimits( + PAYMASTER_ACCEPTANCE_BUDGET, + PRE_RELAYED_CALL_GAS_LIMIT, + POST_RELAYED_CALL_GAS_LIMIT, + CALLDATA_SIZE_LIMIT + ); } // this method must be called from preRelayedCall to validate that the forwarder // is approved by the paymaster as well as by the recipient contract. function _verifyForwarder(GsnTypes.RelayRequest relayRequest) public view { - require(address(trustedForwarder) == relayRequest.relayData.forwarder, "Forwarder is not trusted"); + require(address(_trustedForwarder) == relayRequest.relayData.forwarder, "Forwarder is not trusted"); GsnEip712Library.verifyForwarderTrusted(relayRequest); } @@ -48,7 +53,7 @@ contract BasePaymaster is IPaymaster, Ownable { * modifier to be used by recipients as access control protection for preRelayedCall & postRelayedCall */ modifier relayHubOnly() { - require(msg.sender == getHubAddr(), "Function can only be called by RelayHub"); + require(msg.sender == getHubAddr(), "can only be called by RelayHub"); _; } @@ -56,16 +61,28 @@ contract BasePaymaster is IPaymaster, Ownable { relayHub = hub; } - function setTrustedForwarder(IForwarder forwarder) public onlyOwner { - trustedForwarder = forwarder; + function setTrustedForwarder(address forwarder) public onlyOwner { + _trustedForwarder = forwarder; } - // check current deposit on relay hub. - function getRelayHubDeposit() public view returns (uint256) { + function trustedForwarder() external view returns (address) { + return _trustedForwarder; + } + + /// check current deposit on relay hub. + function getRelayHubDeposit() external view returns (uint256) { return relayHub.balanceOf(address(this)); } - // withdraw deposit from relayHub + // any eth moved into the paymaster is transferred as a deposit. + // This way, we don't need to understand the RelayHub API in order to replenish + // the paymaster. + function() external payable { + require(address(relayHub) != address(0), "relay hub address not set"); + relayHub.depositFor.value(msg.value)(address(this)); + } + + /// withdraw deposit from relayHub function withdrawRelayHubDepositTo(uint256 amount, address target) public onlyOwner { relayHub.withdraw(amount, target); } diff --git a/contracts/gsn/forwarder/IForwarder.sol b/contracts/gsn/forwarder/IForwarder.sol index d5dc32a34..989598e3e 100644 --- a/contracts/gsn/forwarder/IForwarder.sol +++ b/contracts/gsn/forwarder/IForwarder.sol @@ -10,14 +10,20 @@ contract IForwarder { uint256 gas; uint256 nonce; bytes data; + uint256 validUntil; } + event DomainRegistered(bytes32 indexed domainSeparator, bytes domainValue); + + event RequestTypeRegistered(bytes32 indexed typeHash, string typeStr); + function getNonce(address from) external view returns (uint256); /** * verify the transaction would execute. * validate the signature and the nonce of the request. * revert if either signature or nonce are incorrect. + * also revert if domainSeparator or requestTypeHash are not registered. */ function verify( ForwardRequest forwardRequest, @@ -51,8 +57,8 @@ contract IForwarder { /** * Register a new Request typehash. * @param typeName - the name of the request type. - * @param typeSuffix - anything after the generic params can be empty string (if no extra fields are needed) - * if it does contain a value, then a comma is added first. + * @param typeSuffix - any extra data after the generic params. + * (must add at least one param. The generic ForwardRequest type is always registered by the constructor) */ function registerRequestType(string typeName, string typeSuffix) external; diff --git a/contracts/gsn/interfaces/GsnTypes.sol b/contracts/gsn/interfaces/GsnTypes.sol index 423e162b6..095012366 100644 --- a/contracts/gsn/interfaces/GsnTypes.sol +++ b/contracts/gsn/interfaces/GsnTypes.sol @@ -4,15 +4,16 @@ pragma solidity 0.4.24; import "../forwarder/IForwarder.sol"; contract GsnTypes { + /// @notice gasPrice, pctRelayFee and baseRelayFee must be validated inside of the paymaster's preRelayedCall in order not to overpay struct RelayData { uint256 gasPrice; uint256 pctRelayFee; uint256 baseRelayFee; address relayWorker; address paymaster; + address forwarder; bytes paymasterData; uint256 clientId; - address forwarder; } //note: must start with the ForwardRequest to be an extension of the generic forwarder diff --git a/contracts/gsn/interfaces/IPaymaster.sol b/contracts/gsn/interfaces/IPaymaster.sol index e146697b8..885d0f225 100644 --- a/contracts/gsn/interfaces/IPaymaster.sol +++ b/contracts/gsn/interfaces/IPaymaster.sol @@ -29,16 +29,19 @@ contract IPaymaster { * note that an OOG will revert the transaction, but the paymaster already committed to pay, * so the relay will get compensated, at the expense of the paymaster */ - struct GasLimits { + struct GasAndDataLimits { uint256 acceptanceBudget; uint256 preRelayedCallGasLimit; uint256 postRelayedCallGasLimit; + uint256 calldataSizeLimit; } /** - * Return the GasLimits constants used by the Paymaster. + * Return the Gas Limits and msg.data max size constants used by the Paymaster. */ - function getGasLimits() external view returns (GasLimits memory limits); + function getGasAndDataLimits() external view returns (GasAndDataLimits memory limits); + + function trustedForwarder() external view returns (address); /** * return the relayHub of this contract. @@ -49,7 +52,7 @@ contract IPaymaster { * Can be used to determine if the contract can pay for incoming calls before making any. * @return the paymaster's deposit in the RelayHub. */ - function getRelayHubDeposit() public view returns (uint256); + function getRelayHubDeposit() external view returns (uint256); /** * Called by Relay (and RelayHub), to validate if the paymaster agrees to pay for this call. @@ -74,7 +77,7 @@ contract IPaymaster { * Note that in most cases the paymaster shouldn't try use it at all. It is always checked * by the forwarder immediately after preRelayedCall returns. * @param approvalData - extra dapp-specific data (e.g. signature from trusted party) - * @param maxPossibleGas - based on values returned from {@link getGasLimits}, + * @param maxPossibleGas - based on values returned from {@link getGasAndDataLimits}, * the RelayHub will calculate the maximum possible amount of gas the user may be charged for. * In order to convert this value to wei, the Paymaster has to call "relayHub.calculateCharge()" * return: diff --git a/contracts/gsn/token_paymaster/TokenPaymaster.sol b/contracts/gsn/token_paymaster/TokenPaymaster.sol index 587448dbb..23420632d 100644 --- a/contracts/gsn/token_paymaster/TokenPaymaster.sol +++ b/contracts/gsn/token_paymaster/TokenPaymaster.sol @@ -6,21 +6,25 @@ import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "../BasePaymaster.sol"; import "./IUniswapV2Router02.sol"; import "../../upgradeable_contracts/GSNForeignERC20Bridge.sol"; +import "../../upgradeable_contracts/Claimable.sol"; -contract TokenPaymaster is BasePaymaster { - address private token; +contract TokenPaymaster is BasePaymaster, Claimable { + ERC20 private token; IUniswapV2Router02 private router; address private bridge; address[] private tokenWethPair = new address[](2); uint256 public postGasUsage = 300000; + // Default value from BasePaymaster, may be changed later + // if we need to increase number of signatures for bridge contract + uint256 public calldataSizeLimit = 10500; constructor(address _relayHub, address _forwarder, address _token, address _router, address _bridge) public { _setOwner(msg.sender); - relayHub = IRelayHub(_relayHub); - trustedForwarder = IForwarder(_forwarder); + setRelayHub(IRelayHub(_relayHub)); + setTrustedForwarder(_forwarder); - token = _token; + token = ERC20(_token); router = IUniswapV2Router02(_router); bridge = _bridge; @@ -29,7 +33,7 @@ contract TokenPaymaster is BasePaymaster { } function setToken(address t) external onlyOwner { - token = t; + token = ERC20(t); } function setRouter(IUniswapV2Router02 r) external onlyOwner { @@ -40,13 +44,16 @@ contract TokenPaymaster is BasePaymaster { bridge = b; } - function versionPaymaster() external view returns (string memory) { - return "2.0.0+opengsn.tokengsn.ipaymaster"; + function setPostGasUsage(uint256 gasUsage) external onlyOwner { + postGasUsage = gasUsage; } - function() external payable { - require(address(relayHub) != address(0), "relay hub address not set"); - relayHub.depositFor.value(msg.value)(address(this)); + function setCalldataSizeLimit(uint256 sizeLimit) external onlyOwner { + calldataSizeLimit = sizeLimit; + } + + function versionPaymaster() external view returns (string memory) { + return "2.2.0+opengsn.bridgetokengsn.ipaymaster"; } function deposit() external payable { @@ -54,19 +61,16 @@ contract TokenPaymaster is BasePaymaster { relayHub.depositFor.value(msg.value)(address(this)); } - function getGasLimits() external view returns (IPaymaster.GasLimits memory limits) { + function getGasAndDataLimits() external view returns (IPaymaster.GasAndDataLimits memory limits) { return - IPaymaster.GasLimits( + IPaymaster.GasAndDataLimits( PAYMASTER_ACCEPTANCE_BUDGET, PRE_RELAYED_CALL_GAS_LIMIT, - postGasUsage // maximum postRelayedCall gasLimit + postGasUsage, // maximum postRelayedCall gasLimit + calldataSizeLimit ); } - function erc20() internal view returns (ERC20) { - return ERC20(token); - } - function readBytes32(bytes memory b, uint256 index) internal pure returns (bytes32 res) { require(b.length >= index + 32, "data too short"); assembly { @@ -79,7 +83,7 @@ contract TokenPaymaster is BasePaymaster { bytes signature, bytes approvalData, uint256 maxPossibleGas - ) public returns (bytes memory context, bool revertOnRecipientRevert) { + ) public relayHubOnly returns (bytes memory context, bool revertOnRecipientRevert) { (signature, approvalData); _verifyForwarder(relayRequest); bytes memory reqData = relayRequest.request.data; @@ -108,12 +112,9 @@ contract TokenPaymaster is BasePaymaster { return a < b ? a : b; } - function setPostGasUsage(uint256 gasUsage) external onlyOwner { - postGasUsage = gasUsage; - } - function postRelayedCall(bytes context, bool success, uint256 gasUseWithoutPost, GsnTypes.RelayData relayData) public + relayHubOnly { (success); // Extract data from context @@ -137,7 +138,7 @@ contract TokenPaymaster is BasePaymaster { uint256 chargeWei = relayHub.calculateCharge(min(gasUseWithoutPost + postGasUsage, maxPossibleGas), relayData); // Uniswap - require(erc20().approve(address(router), maxTokensFee), "approve failed"); + require(token.approve(address(router), maxTokensFee), "approve failed"); // NOTE: Received eth automatically converts to relayhub deposit uint256 spentTokens = router.swapTokensForExactETH( chargeWei, @@ -149,7 +150,11 @@ contract TokenPaymaster is BasePaymaster { // Send rest of tokens to user if (spentTokens < maxTokensFee) { - require(erc20().transfer(to, maxTokensFee - spentTokens)); + require(token.transfer(to, maxTokensFee - spentTokens)); } } + + function claimTokens(address _token, address _to) external onlyOwner { + claimValues(_token, _to); + } } diff --git a/contracts/upgradeable_contracts/GSNForeignERC20Bridge.sol b/contracts/upgradeable_contracts/GSNForeignERC20Bridge.sol index b1d23e337..ba3b56a71 100644 --- a/contracts/upgradeable_contracts/GSNForeignERC20Bridge.sol +++ b/contracts/upgradeable_contracts/GSNForeignERC20Bridge.sol @@ -36,7 +36,8 @@ contract GSNForeignERC20Bridge is BasicForeignBridge, ERC20Bridge, BaseRelayReci * as a commission */ function executeSignaturesGSN(bytes message, bytes signatures, uint256 maxTokensFee) external { - require(msg.sender == addressStorage[TRUSTED_FORWARDER], "invalid forwarder"); + // Allow only forwarder calls + require(isTrustedForwarder(msg.sender), "invalid forwarder"); Message.hasEnoughValidSignatures(message, signatures, validatorContract(), false); address recipient; diff --git a/package-lock.json b/package-lock.json index 3bb2c4721..f20a406f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3063,87 +3063,39 @@ "fastq": "^1.6.0" } }, - "@openeth/truffle-typings": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@openeth/truffle-typings/-/truffle-typings-0.0.6.tgz", - "integrity": "sha512-GWFDMVmisKDLTqIg0dZO3Wkri/EW8KNsETqoQB6iyAf/ULPxcAdMy5fCt02GlarL32s87M+B9kNbJ6znmDIWsw==", - "requires": { - "@types/chai": "^4.1.4", - "@types/mocha": "^5.2.5", - "@types/web3": "^1.2.2", - "web3": "1.2.6" - } - }, - "@opengsn/gsn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@opengsn/gsn/-/gsn-2.1.0.tgz", - "integrity": "sha512-QEHLc8ckiQA9Aa1iJH0+rN8aZSncaUzgonH5wX8YILmmYJCG+4IsdhhamkWotK2gINVY3z6jaEQKc/SYwizs1g==", + "@opengsn/cli": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@opengsn/cli/-/cli-2.2.2.tgz", + "integrity": "sha512-kfGvGUCz06cbUXsqIqbOvhjtyOVKcMrFZAz4N24stE4X5CNYATG1XA0qmUsAgUu67Gj/gBuEMunZ84KeXzu9Aw==", "requires": { - "@openeth/truffle-typings": "0.0.6", - "@openzeppelin/contracts": "^3.2.0", + "@opengsn/common": "^2.2.2", + "@opengsn/provider": "^2.2.2", + "@opengsn/relay": "^2.2.2", "@truffle/hdwallet-provider": "1.0.34", - "@types/chai": "^4.2.12", - "@types/chai-as-promised": "^7.1.3", - "@types/cors": "^2.8.7", - "@types/eth-sig-util": "2.1.0", - "@types/express": "^4.17.8", - "@types/lodash": "^4.14.161", - "@types/minimist": "^1.2.0", - "@types/nedb": "^1.8.11", + "@types/asciichart": "^1.5.4", + "@types/clear": "^0.1.1", + "@types/cli-table": "^0.3.0", "@types/node": "^13.0.0", - "@types/semver": "^7.3.4", - "@types/sinon": "^9.0.0", - "@types/sinon-chai": "^3.2.5", - "@types/web3": "1.2.2", "@types/web3-provider-engine": "^14.0.0", - "abi-decoder": "^2.3.0", - "async-mutex": "^0.2.4", - "axios": "^0.20.0", - "bn.js": "5.1.2", - "body-parser": "^1.19.0", - "chai": "^4.2.0", + "asciichart": "^1.5.25", "chalk": "^4.1.0", + "clear": "^0.1.0", + "cli-table": "^0.3.4", + "colors": "^1.4.0", "commander": "^6.1.0", "console-read-write": "^0.1.1", "date-format": "^3.0.0", - "eth-sig-util": "2.5.2", - "ethereumjs-common": "^1.5.2", "ethereumjs-tx": "^2.1.2", - "ethereumjs-util": "^6.2.1", - "ethereumjs-wallet": "0.6.3", - "ethval": "^2.1.1", - "express": "^4.17.1", - "jsonrpc-lite": "^2.2.0", - "lodash": "^4.17.20", - "loglevel": "^1.7.0", - "minimist": "^1.2.5", - "nedb-async": "^0.1.3", - "ow": "^0.17.0", - "patch-package": "^6.2.2", - "semver": "^7.3.2", - "web3": "1.2.6", - "web3-core": "1.2.6", - "web3-core-helpers": "1.2.6", - "web3-eth": "1.2.6", - "web3-eth-abi": "1.2.6", - "web3-eth-contract": "1.2.6", - "web3-utils": "1.2.6", + "moment": "^2.29.1", + "terminal-link": "^2.1.1", + "web3-provider-engine": "14.1.0", "winston": "^3.3.3" }, "dependencies": { "@types/node": { - "version": "13.13.51", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.51.tgz", - "integrity": "sha512-66/xg5I5Te4oGi5Jws11PtNmKkZbOPZWyBZZ/l5AOrWj1Dyw+6Ge/JhYTq/2/Yvdqyhrue8RL+DGI298OJ0xcg==" - }, - "abi-decoder": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/abi-decoder/-/abi-decoder-2.4.0.tgz", - "integrity": "sha512-TOLU2q1HgYOjs1GKGtVzaqrYkar6I2fT9a80rzx6/9EJ/5crb4nCGuro0grZayixem93T7omrajYmLiMkYDLDA==", - "requires": { - "web3-eth-abi": "^1.2.1", - "web3-utils": "^1.2.1" - } + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" }, "ansi-styles": { "version": "4.3.0", @@ -3153,20 +3105,38 @@ "color-convert": "^2.0.1" } }, - "bn.js": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", - "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==" + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, + "cli-table": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.6.tgz", + "integrity": "sha512-ZkNZbnZjKERTY5NwC2SeMeLeifSPq/pubeRoTpdr3WchLlnZg6hEgvHkK5zL7KNFdd9PmHN8lxrENUwI3cE8vQ==", + "requires": { + "colors": "1.0.3" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" + } + } + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -3180,20 +3150,28 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" + }, "commander": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==" }, "elliptic": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", - "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", + "bn.js": "^4.11.9", + "brorand": "^1.1.0", "hash.js": "^1.0.0", - "inherits": "^2.0.1" + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" }, "dependencies": { "bn.js": { @@ -3203,6 +3181,180 @@ } } }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "web3-provider-engine": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-14.1.0.tgz", + "integrity": "sha512-vGZtqhSUzGTiMGhJXNnB/aRDlrPZLhLnBZ2NPArkZtr8XSrwg9m08tw4+PuWg5za0TJuoE/vuPQc501HddZZWw==", + "requires": { + "async": "^2.5.0", + "backoff": "^2.5.0", + "clone": "^2.0.0", + "cross-fetch": "^2.1.0", + "eth-block-tracker": "^3.0.0", + "eth-json-rpc-infura": "^3.1.0", + "eth-sig-util": "^1.4.2", + "ethereumjs-block": "^1.2.2", + "ethereumjs-tx": "^1.2.0", + "ethereumjs-util": "^5.1.5", + "ethereumjs-vm": "^2.3.4", + "json-rpc-error": "^2.0.0", + "json-stable-stringify": "^1.0.1", + "promise-to-callback": "^1.0.0", + "readable-stream": "^2.2.9", + "request": "^2.85.0", + "semaphore": "^1.0.3", + "ws": "^5.1.1", + "xhr": "^2.2.0", + "xtend": "^4.0.1" + }, + "dependencies": { + "ethereumjs-tx": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", + "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", + "requires": { + "ethereum-common": "^0.0.18", + "ethereumjs-util": "^5.0.0" + } + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + } + } + }, + "@opengsn/common": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@opengsn/common/-/common-2.2.2.tgz", + "integrity": "sha512-eofc4jkwGWNjS70LZyWs3c1nM4TKCyBIy/crTXv4zRUoGUEN4QlVYbd13p+RWYtF8nNZ6hHJFs3Iel3nRasYFA==", + "requires": { + "@opengsn/contracts": "^2.2.2", + "@types/bn.js": "^5.1.0", + "@types/eth-sig-util": "^2.1.0", + "@types/semver": "^7.3.4", + "@types/web3": "1.2.2", + "axios": "^0.21.1", + "bn.js": "^5.2.0", + "chalk": "^4.1.0", + "eth-sig-util": "2.5.2", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^7.0.10", + "ethval": "^2.1.1", + "ow": "^0.17.0", + "rlp": "^2.2.6", + "semver": "^7.3.2", + "web3-core": "1.2.6", + "web3-core-helpers": "1.2.6", + "web3-eth": "1.2.6", + "web3-eth-abi": "1.2.6", + "web3-eth-contract": "1.2.6", + "web3-utils": "1.2.6" + }, + "dependencies": { + "@types/bn.js": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", + "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", + "requires": { + "@types/node": "*" + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "requires": { + "follow-redirects": "^1.10.0" + } + }, + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, "eth-sig-util": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.5.2.tgz", @@ -3221,20 +3373,6 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "ethereumjs-util": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", @@ -3247,24 +3385,43 @@ "ethjs-util": "^0.1.3", "rlp": "^2.0.0", "safe-buffer": "^5.1.1" + }, + "dependencies": { + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + } } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" } } }, - "ethereumjs-abi": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz", - "integrity": "sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE=", + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^4.3.0" + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" }, "dependencies": { + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "requires": { + "@types/node": "*" + } + }, "bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", @@ -3285,76 +3442,32 @@ } }, "ethereumjs-util": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz", - "integrity": "sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", "requires": { - "bn.js": "^4.8.0", + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", "create-hash": "^1.1.2", "elliptic": "^6.5.2", "ethereum-cryptography": "^0.1.3", - "rlp": "^2.0.0" + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" } } }, - "ethereumjs-common": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", - "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==" - }, - "ethereumjs-tx": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", - "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, "ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.0.tgz", + "integrity": "sha512-kR+vhu++mUDARrsMMhsjjzPduRVAeundLGXucGRHF3B4oEltOUspfgCVco4kckucj3FMlLaZHUl9n7/kdmr6Tw==", "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", + "@types/bn.js": "^5.1.0", + "bn.js": "^5.1.2", "create-hash": "^1.1.2", - "elliptic": "^6.5.2", "ethereum-cryptography": "^0.1.3", "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - } + "rlp": "^2.2.4" } }, "ethers": { @@ -3374,15 +3487,30 @@ "xmlhttprequest": "1.8.0" }, "dependencies": { - "@types/node": { - "version": "10.17.59", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.59.tgz", - "integrity": "sha512-7Uc8IRrL8yZz5ti45RaFxpbU8TxlzdC3HvxV+hOWo1EyLsuKv/w7y0n+TwZzwL3vdx3oZ2k3ubxPq131hNtXyg==" - }, "bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } } } }, @@ -3391,29 +3519,10 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, - "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" - } - }, - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "loglevel": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.7.1.tgz", - "integrity": "sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==" + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "lru-cache": { "version": "6.0.0", @@ -3423,10 +3532,20 @@ "yallist": "^4.0.0" } }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "requires": { + "bn.js": "^4.11.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } }, "scrypt-js": { "version": "2.0.3", @@ -3498,6 +3617,253 @@ } } }, + "@opengsn/contracts": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@opengsn/contracts/-/contracts-2.2.2.tgz", + "integrity": "sha512-GnV6Z5ZoWkVhd+rWbC30SpoX45fPndp1bcLV3t5QE2lRBFOjNk0guD/2i2k/RzbJiiFj9RvScufecC8N+0Rhvg==", + "requires": { + "@openzeppelin/contracts": "^3.4.0-solc-0.7" + } + }, + "@opengsn/provider": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@opengsn/provider/-/provider-2.2.2.tgz", + "integrity": "sha512-oqevZOC1+uNnfh17XSB7u3Xn0TLSgLAE1IA3LDrzLW6VA5GyhshKgMArqzL2qTZN5m7W9mwot2pihIcqn/Ad+w==", + "requires": { + "@opengsn/common": "^2.2.2", + "@types/body-parser": "^1.19.0", + "@types/eth-sig-util": "^2.1.0", + "@types/express-serve-static-core": "^4.17.18", + "abi-decoder": "^2.4.0", + "body-parser": "^1.19.0", + "eth-sig-util": "2.5.2", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^6.2.1", + "ethereumjs-wallet": "^0.6.5", + "loglevel": "^1.7.1", + "winston": "^3.3.3" + }, + "dependencies": { + "abi-decoder": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/abi-decoder/-/abi-decoder-2.4.0.tgz", + "integrity": "sha512-TOLU2q1HgYOjs1GKGtVzaqrYkar6I2fT9a80rzx6/9EJ/5crb4nCGuro0grZayixem93T7omrajYmLiMkYDLDA==", + "requires": { + "web3-eth-abi": "^1.2.1", + "web3-utils": "^1.2.1" + } + }, + "aes-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", + "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" + }, + "eth-sig-util": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.5.2.tgz", + "integrity": "sha512-xvDojS/4reXsw8Pz/+p/qcM5rVB61FOdPbEtMZ8FQ0YHnPEzPy5F8zAAaZ+zj5ud0SwRLWPfor2Cacjm7EzMIw==", + "requires": { + "buffer": "^5.2.1", + "elliptic": "^6.4.0", + "ethereumjs-abi": "0.6.5", + "ethereumjs-util": "^5.1.1", + "tweetnacl": "^1.0.0", + "tweetnacl-util": "^0.15.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + } + } + } + } + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + }, + "dependencies": { + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + } + } + }, + "ethereumjs-wallet": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/ethereumjs-wallet/-/ethereumjs-wallet-0.6.5.tgz", + "integrity": "sha512-MDwjwB9VQVnpp/Dc1XzA6J1a3wgHQ4hSvA1uWNatdpOrtCbPVuQSKSyRnjLvS0a+KKMw2pvQ9Ybqpb3+eW8oNA==", + "requires": { + "aes-js": "^3.1.1", + "bs58check": "^2.1.2", + "ethereum-cryptography": "^0.1.3", + "ethereumjs-util": "^6.0.0", + "randombytes": "^2.0.6", + "safe-buffer": "^5.1.2", + "scryptsy": "^1.2.1", + "utf8": "^3.0.0", + "uuid": "^3.3.2" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "loglevel": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.7.1.tgz", + "integrity": "sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==" + }, + "scryptsy": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", + "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", + "requires": { + "pbkdf2": "^3.0.3" + } + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + } + } + }, + "@opengsn/relay": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@opengsn/relay/-/relay-2.2.2.tgz", + "integrity": "sha512-RuNeEUrrniZrxnrb3fohxHjKr1kRsQT3CuN30pq8jH26XRWgEdjtRxg0YxeiQ4eudRJ4EkWdEXoCfEP5G9rmog==", + "requires": { + "@opengsn/common": "^2.2.2", + "@types/cors": "^2.8.7", + "@types/express": "^4.17.8", + "@types/minimist": "^1.2.0", + "@types/nedb": "^1.8.11", + "async-mutex": "^0.2.4", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^6.2.1", + "nedb-async": "^0.1.3" + }, + "dependencies": { + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + } + } + }, "@openzeppelin/contracts": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-3.4.1.tgz", @@ -5314,6 +5680,22 @@ "web3-net": "1.2.1", "web3-shh": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-bzz": { @@ -5335,6 +5717,22 @@ "web3-core-method": "1.2.1", "web3-core-requestmanager": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-core-helpers": { @@ -5345,6 +5743,22 @@ "underscore": "1.9.1", "web3-eth-iban": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-core-method": { @@ -5357,6 +5771,22 @@ "web3-core-promievent": "1.2.1", "web3-core-subscriptions": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-core-promievent": { @@ -5408,6 +5838,22 @@ "web3-eth-personal": "1.2.1", "web3-net": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-eth-accounts": { @@ -5426,6 +5872,22 @@ "web3-core-helpers": "1.2.1", "web3-core-method": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-eth-contract": { @@ -5441,6 +5903,22 @@ "web3-core-subscriptions": "1.2.1", "web3-eth-abi": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-eth-ens": { @@ -5456,6 +5934,22 @@ "web3-eth-abi": "1.2.1", "web3-eth-contract": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-eth-iban": { @@ -5465,6 +5959,22 @@ "requires": { "bn.js": "4.11.8", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-eth-personal": { @@ -5477,6 +5987,22 @@ "web3-core-method": "1.2.1", "web3-net": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-net": { @@ -5487,6 +6013,22 @@ "web3-core": "1.2.1", "web3-core-method": "1.2.1", "web3-utils": "1.2.1" + }, + "dependencies": { + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, "web3-provider-engine": { @@ -7058,6 +7600,11 @@ "@types/node": "*" } }, + "@types/asciichart": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/@types/asciichart/-/asciichart-1.5.6.tgz", + "integrity": "sha512-GXq4BojlHJHRlizP9zXQfhgMbAy+kmyMyfV9P6vyYxUE302Km8GU0ebToQ1YVlGlFypVOYWNxqEWWLQW0HzFgA==" + }, "@types/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", @@ -7075,18 +7622,15 @@ "@types/node": "*" } }, - "@types/chai": { - "version": "4.2.17", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.17.tgz", - "integrity": "sha512-LaiwWNnYuL8xJlQcE91QB2JoswWZckq9A4b+nMPq8dt8AP96727Nb3X4e74u+E3tm4NLTILNI9MYFsyVc30wSA==" + "@types/clear": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@types/clear/-/clear-0.1.2.tgz", + "integrity": "sha512-h3GHp9BuPgY3X+WKWwJgTIl/h38KkcdU6JG28i1xdrlS8YXVi3V1YrhaZkjuvur97qZo8TMQjVXJorTf87LvfA==" }, - "@types/chai-as-promised": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.3.tgz", - "integrity": "sha512-FQnh1ohPXJELpKhzjuDkPLR2BZCAqed+a6xV4MI/T3XzHfd2FlarfUGUdZYgqYe8oxkYn0fchHEeHfHqdZ96sg==", - "requires": { - "@types/chai": "*" - } + "@types/cli-table": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@types/cli-table/-/cli-table-0.3.0.tgz", + "integrity": "sha512-QnZUISJJXyhyD6L1e5QwXDV/A5i2W1/gl6D6YMc8u0ncPepbv/B4w3S+izVvtAg60m6h+JP09+Y/0zF2mojlFQ==" }, "@types/concat-stream": { "version": "1.6.0", @@ -7265,11 +7809,6 @@ "@types/koa": "*" } }, - "@types/lodash": { - "version": "4.14.168", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", - "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==" - }, "@types/long": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", @@ -7292,11 +7831,6 @@ "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==" }, - "@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==" - }, "@types/nedb": { "version": "1.8.11", "resolved": "https://registry.npmjs.org/@types/nedb/-/nedb-1.8.11.tgz", @@ -7382,28 +7916,6 @@ "@types/node": "*" } }, - "@types/sinon": { - "version": "9.0.11", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.11.tgz", - "integrity": "sha512-PwP4UY33SeeVKodNE37ZlOsR9cReypbMJOhZ7BVE0lB+Hix3efCOxiJWiE5Ia+yL9Cn2Ch72EjFTRze8RZsNtg==", - "requires": { - "@types/sinonjs__fake-timers": "*" - } - }, - "@types/sinon-chai": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.5.tgz", - "integrity": "sha512-bKQqIpew7mmIGNRlxW6Zli/QVyc3zikpGzCa797B/tRnD9OtHvZ/ts8sYXV+Ilj9u3QRaUEM8xrjgd1gwm1BpQ==", - "requires": { - "@types/chai": "*", - "@types/sinon": "*" - } - }, - "@types/sinonjs__fake-timers": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz", - "integrity": "sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg==" - }, "@types/to-json-schema": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@types/to-json-schema/-/to-json-schema-0.2.0.tgz", @@ -7539,11 +8051,6 @@ } } }, - "@yarnpkg/lockfile": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", - "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==" - }, "@zondax/filecoin-signing-tools": { "version": "github:Digital-MOB-Filecoin/filecoin-signing-tools-js#8f8e92157cac2556d35cab866779e9a8ea8a4e25", "from": "github:Digital-MOB-Filecoin/filecoin-signing-tools-js", @@ -8445,6 +8952,11 @@ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" }, + "asciichart": { + "version": "1.5.25", + "resolved": "https://registry.npmjs.org/asciichart/-/asciichart-1.5.25.tgz", + "integrity": "sha512-PNxzXIPPOtWq8T7bgzBtk9cI2lgS4SJZthUHEiQ1aoIc3lNzGfUvIvo9LiAnq26TACo9t1/4qP6KTGAUbzX9Xg==" + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -8497,7 +9009,8 @@ "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true }, "assign-symbols": { "version": "1.0.0", @@ -8620,6 +9133,7 @@ "version": "0.20.0", "resolved": "https://registry.npmjs.org/axios/-/axios-0.20.0.tgz", "integrity": "sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==", + "optional": true, "requires": { "follow-redirects": "^1.10.0" } @@ -10338,6 +10852,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, "requires": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", @@ -10427,7 +10942,8 @@ "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true }, "checkpoint-store": { "version": "1.1.0", @@ -11110,6 +11626,11 @@ } } }, + "clear": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/clear/-/clear-0.1.0.tgz", + "integrity": "sha512-qMjRnoL+JDPJHeLePZJuao6+8orzHMGP04A8CdwCNsKhRbOnKRjefxONR7bwILT3MHecxKBjHkKL/tkZ8r4Uzw==" + }, "cli-boxes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", @@ -11942,6 +12463,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, "requires": { "type-detect": "^4.0.0" } @@ -13522,6 +14044,55 @@ "resolved": "https://registry.npmjs.org/ethereum-protocol/-/ethereum-protocol-1.0.1.tgz", "integrity": "sha512-3KLX1mHuEsBW0dKG+c6EOJS1NBNqdCICvZW9sInmZTt5aY0oxmHVggYRE0lJu1tcnMD1K+AKHdLi6U43Awm1Vg==" }, + "ethereumjs-abi": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz", + "integrity": "sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE=", + "requires": { + "bn.js": "^4.10.0", + "ethereumjs-util": "^4.3.0" + }, + "dependencies": { + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "ethereumjs-util": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz", + "integrity": "sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w==", + "requires": { + "bn.js": "^4.8.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.0.0" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + } + } + }, "ethereumjs-account": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", @@ -14606,59 +15177,6 @@ } } }, - "find-yarn-workspace-root": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", - "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", - "requires": { - "micromatch": "^4.0.2" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==" - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - } - } - }, "first-chunk-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", @@ -15652,7 +16170,8 @@ "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true }, "get-intrinsic": { "version": "1.1.1", @@ -17770,11 +18289,6 @@ "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", "dev": true }, - "is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==" - }, "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", @@ -18144,14 +18658,6 @@ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "requires": { - "is-docker": "^2.0.0" - } - }, "is-yarn-global": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", @@ -18405,6 +18911,11 @@ "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", "dev": true }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -18607,11 +19118,6 @@ "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, - "jsonrpc-lite": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/jsonrpc-lite/-/jsonrpc-lite-2.2.0.tgz", - "integrity": "sha512-/cbbSxtZWs1O7R4tWqabrCM/t3N8qKUZMAg9IUqpPvUs6UyRvm6pCNYkskyKN/XU0UgffW+NY2ZRr8t0AknX7g==" - }, "jsonschema": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.6.tgz", @@ -18667,14 +19173,6 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" }, - "klaw-sync": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", - "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", - "requires": { - "graceful-fs": "^4.1.11" - } - }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -20158,6 +20656,11 @@ } } }, + "moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -20566,7 +21069,8 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true }, "no-case": { "version": "2.3.2", @@ -21500,15 +22004,6 @@ "mimic-fn": "^1.0.0" } }, - "open": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", - "requires": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" - } - }, "opencollective-postinstall": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", @@ -21934,81 +22429,6 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, - "patch-package": { - "version": "6.4.7", - "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.4.7.tgz", - "integrity": "sha512-S0vh/ZEafZ17hbhgqdnpunKDfzHQibQizx9g8yEf5dcVk3KOflOfdufRXQX8CSEkyOQwuM/bNz1GwKvFj54kaQ==", - "requires": { - "@yarnpkg/lockfile": "^1.1.0", - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "find-yarn-workspace-root": "^2.0.0", - "fs-extra": "^7.0.1", - "is-ci": "^2.0.0", - "klaw-sync": "^6.0.0", - "minimist": "^1.2.0", - "open": "^7.4.2", - "rimraf": "^2.6.3", - "semver": "^5.6.0", - "slash": "^2.0.0", - "tmp": "^0.0.33" - }, - "dependencies": { - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "requires": { - "ci-info": "^2.0.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==" - } - } - }, "path-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/path-case/-/path-case-2.1.1.tgz", @@ -22041,7 +22461,8 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true }, "path-parse": { "version": "1.0.6", @@ -22065,7 +22486,8 @@ "pathval": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=" + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true }, "pbkdf2": { "version": "3.1.1", @@ -24780,6 +25202,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -24787,7 +25210,8 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true }, "shelljs": { "version": "0.8.4", @@ -26463,15 +26887,61 @@ } } }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "dev": true, - "requires": { - "execa": "^0.7.0" - } - }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "dev": true, + "requires": { + "execa": "^0.7.0" + } + }, + "terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "requires": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "requires": { + "type-fest": "^0.21.3" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-hyperlinks": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", + "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", + "requires": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + } + }, + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" + } + } + }, "text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", @@ -26598,6 +27068,7 @@ "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, "requires": { "os-tmpdir": "~1.0.2" } @@ -27293,7 +27764,8 @@ "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true }, "type-fest": { "version": "0.3.1", @@ -27953,6 +28425,18 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } } } } @@ -28049,6 +28533,18 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } } } } @@ -28076,6 +28572,18 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } } } } @@ -28105,6 +28613,18 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } } } } @@ -28235,6 +28755,44 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + } } } } @@ -28305,6 +28863,20 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } } } }, @@ -28508,6 +29080,44 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + } } } } @@ -28602,6 +29212,44 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + } } } } @@ -28628,6 +29276,18 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } } } } @@ -28663,6 +29323,18 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } } } } @@ -28690,6 +29362,18 @@ "randombytes": "^2.1.0", "underscore": "1.9.1", "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } } } } @@ -28773,28 +29457,33 @@ } }, "web3-utils": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", - "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.5.2.tgz", + "integrity": "sha512-quTtTeQJHYSxAwIBOCGEcQtqdVcFWX6mCFNoqnp+mRbq+Hxbs8CGgO/6oqfBx4OvxIOfCpgJWYVHswRXnbEu9Q==", "requires": { - "bn.js": "4.11.8", - "eth-lib": "0.2.7", + "bn.js": "^4.11.9", + "eth-lib": "0.2.8", + "ethereum-bloom-filters": "^1.0.6", "ethjs-unit": "0.1.6", "number-to-bn": "1.7.0", - "randomhex": "0.1.5", - "underscore": "1.9.1", + "randombytes": "^2.1.0", "utf8": "3.0.0" }, "dependencies": { - "underscore": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", - "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, - "utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", - "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" + "eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } } } }, @@ -28856,6 +29545,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, "requires": { "isexe": "^2.0.0" } diff --git a/package.json b/package.json index b1129dffc..42a604d08 100644 --- a/package.json +++ b/package.json @@ -20,12 +20,15 @@ "author": "POA network", "license": "GPLv3", "dependencies": { - "@opengsn/gsn": "^2.1.0", + "@opengsn/cli": "^2.2.2", + "@opengsn/contracts": "^2.2.2", + "@opengsn/provider": "^2.2.2", "array-flat-polyfill": "^1.0.1", "openzeppelin-solidity": "1.12.0", "truffle": "^5.3.2", "truffle-flattener": "^1.4.2", - "web3-provider-engine": "^14.0.6" + "web3-provider-engine": "^14.0.6", + "web3-utils": "^1.2.6" }, "devDependencies": { "@codechecks/client": "^0.1.9", diff --git a/test/erc_to_native/foreign_bridge_gsn.test.js b/test/erc_to_native/foreign_bridge_gsn.test.js index 48d2a5643..a0cb9d940 100644 --- a/test/erc_to_native/foreign_bridge_gsn.test.js +++ b/test/erc_to_native/foreign_bridge_gsn.test.js @@ -3,13 +3,14 @@ require('array-flat-polyfill') const XDaiForeignBridgeMock = artifacts.require('XDaiForeignBridgeMock.sol') const BridgeValidators = artifacts.require('BridgeValidators.sol') +const ERC677BridgeToken = artifacts.require('ERC677BridgeToken.sol') const UniswapRouterMock = artifacts.require('UniswapRouterMock.sol') const TokenPaymaster = artifacts.require('TokenPaymaster.sol') // GSN -const { RelayProvider } = require('@opengsn/gsn') -const { GsnTestEnvironment } = require('@opengsn/gsn/dist/GsnTestEnvironment') +const { RelayProvider } = require('@opengsn/provider') +const { GsnTestEnvironment } = require('@opengsn/cli/dist/GsnTestEnvironment') const { toBN, ERROR_MSG, ZERO_ADDRESS } = require('../setup') const { @@ -32,6 +33,7 @@ const minPerTx = ether('0.01') const dailyLimit = homeDailyLimit const ZERO = toBN(0) const decimalShiftZero = 0 +const HALF_ETHER = ether('0.5') const FIVE_ETHER = ether('5') const GSNGasLimit = 500000 @@ -75,7 +77,7 @@ contract('ForeignBridge_ERC20_to_Native_GSN', async accounts => { await GsnTestEnvironment.stopGsn() }) describe('#initialize', async () => { - it('should initialize', async () => { + it('should initialize paymaster', async () => { router = await UniswapRouterMock.new() foreignBridge = await XDaiForeignBridgeMock.new() @@ -284,4 +286,29 @@ contract('ForeignBridge_ERC20_to_Native_GSN', async accounts => { .should.be.rejectedWith(`${ERROR_MSG} invalid forwarder`) }) }) + + describe('#claimTokens', async () => { + it('can send erc20', async () => { + router = await UniswapRouterMock.new() + paymaster = await TokenPaymaster.new( + RelayHubAddress, + ForwarderAddress, + ZERO_ADDRESS, + router.address, + ZERO_ADDRESS, + { from: owner } + ) + + const token = await ERC677BridgeToken.new('Some ERC20', 'RSZT', 18) + await token.mint(accounts[1], HALF_ETHER).should.be.fulfilled + await token.transfer(paymaster.address, HALF_ETHER, { from: accounts[1] }) + + await paymaster.claimTokens(token.address, accounts[3], { from: accounts[3] }).should.be.rejectedWith(ERROR_MSG) + await paymaster.claimTokens(token.address, accounts[3], { from: owner }) + const pmBalance = await token.balanceOf(paymaster.address) + const accBalance = await token.balanceOf(accounts[3]) + pmBalance.should.be.bignumber.equal(ZERO) + accBalance.should.be.bignumber.equal(HALF_ETHER) + }) + }) }) From 39f5835198f3d1728659de9dd959e7a2ae53f7ca Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 20 Aug 2021 14:14:21 +0300 Subject: [PATCH 6/7] Bump package and contracts interfaces version prior to 6.0.0 (#629) --- contracts/upgradeable_contracts/VersionableBridge.sol | 2 +- .../upgradeable_contracts/arbitrary_message/VersionableAMB.sol | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/upgradeable_contracts/VersionableBridge.sol b/contracts/upgradeable_contracts/VersionableBridge.sol index bee2c10d5..028b6ddee 100644 --- a/contracts/upgradeable_contracts/VersionableBridge.sol +++ b/contracts/upgradeable_contracts/VersionableBridge.sol @@ -2,7 +2,7 @@ pragma solidity 0.4.24; contract VersionableBridge { function getBridgeInterfacesVersion() external pure returns (uint64 major, uint64 minor, uint64 patch) { - return (6, 0, 0); + return (6, 1, 0); } /* solcov ignore next */ diff --git a/contracts/upgradeable_contracts/arbitrary_message/VersionableAMB.sol b/contracts/upgradeable_contracts/arbitrary_message/VersionableAMB.sol index e6f985f20..86f61ed20 100644 --- a/contracts/upgradeable_contracts/arbitrary_message/VersionableAMB.sol +++ b/contracts/upgradeable_contracts/arbitrary_message/VersionableAMB.sol @@ -17,6 +17,6 @@ contract VersionableAMB is VersionableBridge { * @return (major, minor, patch) version triple */ function getBridgeInterfacesVersion() external pure returns (uint64 major, uint64 minor, uint64 patch) { - return (6, 1, 0); + return (6, 2, 0); } } diff --git a/package-lock.json b/package-lock.json index f20a406f4..a47003853 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tokenbridge-contracts", - "version": "6.0.0-rc1", + "version": "6.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 42a604d08..72aec5238 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tokenbridge-contracts", - "version": "6.0.0-rc1", + "version": "6.0.0", "description": "Bridge", "main": "index.js", "scripts": { From e44f4d8bf4fe665c784c7071a77ce635f41b9558 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Sat, 21 Aug 2021 00:09:57 +0300 Subject: [PATCH 7/7] Block ERC20 selectors in AMB requests (#630) --- .../arbitrary_message/BasicAMB.sol | 9 ++++ .../arbitrary_message/BasicHomeAMB.sol | 2 +- .../arbitrary_message/MessageDelivery.sol | 26 ++++++++++- test/arbitrary_message/foreign_bridge.test.js | 44 +++++++++++++++++++ 4 files changed, 78 insertions(+), 3 deletions(-) diff --git a/contracts/upgradeable_contracts/arbitrary_message/BasicAMB.sol b/contracts/upgradeable_contracts/arbitrary_message/BasicAMB.sol index 1629567d2..6a8b11d05 100644 --- a/contracts/upgradeable_contracts/arbitrary_message/BasicAMB.sol +++ b/contracts/upgradeable_contracts/arbitrary_message/BasicAMB.sol @@ -101,6 +101,15 @@ contract BasicAMB is BasicBridge, VersionableAMB { return boolStorage[ALLOW_REENTRANT_REQUESTS]; } + /** + * @dev Withdraws the erc20 tokens or native coins from this contract. + * @param _token address of the claimed token or address(0) for native coins. + * @param _to address of the tokens/coins receiver. + */ + function claimTokens(address _token, address _to) external onlyIfUpgradeabilityOwner { + claimValues(_token, _to); + } + /** * Internal function for retrieving current nonce value * @return nonce value diff --git a/contracts/upgradeable_contracts/arbitrary_message/BasicHomeAMB.sol b/contracts/upgradeable_contracts/arbitrary_message/BasicHomeAMB.sol index fde2cbae3..e8badae71 100644 --- a/contracts/upgradeable_contracts/arbitrary_message/BasicHomeAMB.sol +++ b/contracts/upgradeable_contracts/arbitrary_message/BasicHomeAMB.sol @@ -45,7 +45,7 @@ contract BasicHomeAMB is BasicAMB, MessageDelivery { * @param _data calldata passed to the executor on the other side. * @param _gas gas limit used on the other network for executing a message. */ - function requireToConfirmMessage(address _contract, bytes _data, uint256 _gas) external returns (bytes32) { + function requireToConfirmMessage(address _contract, bytes memory _data, uint256 _gas) public returns (bytes32) { return _sendMessage(_contract, _data, _gas, SEND_TO_MANUAL_LANE); } diff --git a/contracts/upgradeable_contracts/arbitrary_message/MessageDelivery.sol b/contracts/upgradeable_contracts/arbitrary_message/MessageDelivery.sol index 78d859c90..1bff1d607 100644 --- a/contracts/upgradeable_contracts/arbitrary_message/MessageDelivery.sol +++ b/contracts/upgradeable_contracts/arbitrary_message/MessageDelivery.sol @@ -19,7 +19,7 @@ contract MessageDelivery is BasicAMB, MessageProcessor { * @param _data calldata passed to the executor on the other side * @param _gas gas limit used on the other network for executing a message */ - function requireToPassMessage(address _contract, bytes _data, uint256 _gas) public returns (bytes32) { + function requireToPassMessage(address _contract, bytes memory _data, uint256 _gas) public returns (bytes32) { return _sendMessage(_contract, _data, _gas, SEND_TO_ORACLE_DRIVEN_LANE); } @@ -30,12 +30,34 @@ contract MessageDelivery is BasicAMB, MessageProcessor { * @param _gas gas limit used on the other network for executing a message * @param _dataType AMB message dataType to be included as a part of the header */ - function _sendMessage(address _contract, bytes _data, uint256 _gas, uint256 _dataType) internal returns (bytes32) { + function _sendMessage(address _contract, bytes memory _data, uint256 _gas, uint256 _dataType) + internal + returns (bytes32) + { // it is not allowed to pass messages while other messages are processed // if other is not explicitly configured require(messageId() == bytes32(0) || allowReentrantRequests()); require(_gas >= MIN_GAS_PER_CALL && _gas <= maxGasPerTx()); + uint256 selector; + assembly { + selector := and(mload(add(_data, 4)), 0xffffffff) + } + // In order to prevent possible unauthorized ERC20 withdrawals, the following function signatures are prohibited: + // * transfer(address,uint256) + // * approve(address,uint256) + // * transferFrom(address,address,uint256) + // * approveAndCall(address,uint256,bytes) + // * transferAndCall(address,uint256,bytes) + // See https://medium.com/immunefi/xdai-stake-arbitrary-call-method-bug-postmortem-f80a90ac56e3 for more details + require( + selector != 0xa9059cbb && + selector != 0x095ea7b3 && + selector != 0x23b872dd && + selector != 0x4000aea0 && + selector != 0xcae9ca51 + ); + (bytes32 _messageId, bytes memory header) = _packHeader(_contract, _gas, _dataType); bytes memory eventData = abi.encodePacked(header, _data); diff --git a/test/arbitrary_message/foreign_bridge.test.js b/test/arbitrary_message/foreign_bridge.test.js index e12723e69..e37507890 100644 --- a/test/arbitrary_message/foreign_bridge.test.js +++ b/test/arbitrary_message/foreign_bridge.test.js @@ -3,6 +3,7 @@ const HomeBridge = artifacts.require('HomeAMB.sol') const GasToken = artifacts.require('GasTokenMock.sol') const BridgeValidators = artifacts.require('BridgeValidators.sol') const Box = artifacts.require('Box.sol') +const ERC20Mock = artifacts.require('ERC20Mock.sol') const ERC677ReceiverTest = artifacts.require('ERC677ReceiverTest.sol') const EternalStorageProxy = artifacts.require('EternalStorageProxy.sol') @@ -334,6 +335,49 @@ contract('ForeignAMB', async accounts => { expect(messageId2).to.include(`${bridgeId}0000000000000001`) expect(messageId3).to.include(`${bridgeId}0000000000000002`) }) + it('should fail to send message with blocked signatures', async () => { + const blockedFunctions = [ + 'transfer(address,uint256)', + 'approve(address,uint256)', + 'transferFrom(address,address,uint256)', + 'approveAndCall(address,uint256,bytes)', + 'transferAndCall(address,uint256,bytes)' + ].map(web3.eth.abi.encodeFunctionSignature) + for (const signature of blockedFunctions) { + await foreignBridge.requireToPassMessage(accounts[7], signature, 10000).should.be.rejected + } + await foreignBridge.requireToPassMessage(accounts[7], '0x11223344', 10000).should.be.fulfilled + }) + }) + describe('claimTokens', () => { + let foreignBridge + let token + beforeEach(async () => { + const foreignBridgeV1 = await ForeignBridge.new() + token = await ERC20Mock.new('Test', 'TST', 18) + + // create proxy + const proxy = await EternalStorageProxy.new() + await proxy.upgradeTo('1', foreignBridgeV1.address).should.be.fulfilled + + foreignBridge = await ForeignBridge.at(proxy.address) + await foreignBridge.initialize( + FOREIGN_CHAIN_ID_HEX, + HOME_CHAIN_ID_HEX, + validatorContract.address, + oneEther, + gasPrice, + requiredBlockConfirmations, + owner + ) + }) + it('should claim mistakenly locked tokens', async () => { + await token.mint(foreignBridge.address, oneEther) + await foreignBridge.claimTokens(token.address, owner, { from: accounts[2] }).should.be.rejected + await foreignBridge.claimTokens(token.address, owner, { from: owner }).should.be.fulfilled + + expect(await token.balanceOf(owner)).to.be.bignumber.equal(oneEther) + }) }) describe('executeSignatures', () => { let foreignBridge