diff --git a/.gitignore b/.gitignore
index 2d2b47d..0771856 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,6 @@
-.idea
-node_modules
\ No newline at end of file
+.idea/*
+node_modules
+build
+contracts/flattened/*.sol
+coverage
+coverage.json
\ No newline at end of file
diff --git a/.idea/eth-bsc-swap-contracts.iml b/.idea/eth-bsc-swap-contracts.iml
deleted file mode 100644
index c956989..0000000
--- a/.idea/eth-bsc-swap-contracts.iml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index d2f5058..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100644
index 4cf0d95..0000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f33eca1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,55 @@
+# ETH BSC Swap Contracts
+
+## Overview
+ETH BSC Swap Contracts are responsible for registering swap pairs and swapping assets between ETH and BSC.
+
+![](./assets/eth-bsc-swap.png)
+
+### Register swap pair
+
+1. Users register swap pair for erc20 token on ETH via ETHSwapAgent(`createSwapPair`) if token is not registered.
+2. Swap service will monitor the `SwapPairRegister` event and create swap pair on BSC:
+
+ 1. create an BEP20 token on BSC
+ 2. record the relation between erc20 token and bep20 token.
+
+### Swap from ETH to BSC
+
+Once swap pair is registered, users can swap tokens from ETH to BSC.
+
+1. Users call `swapBSC2ETH` via ETHSwapAgent and specify erc20 token address, amount and swap fee.
+2. Swap service will monitor the `SwapStarted` event and call `fillETH2BSCSwap` via BSCSwapAgent to mint corresponding bep20
+tokens to the same address that initiate the swap.
+
+### Swap from BSC to ETH
+
+Once swap pair is registered, users can swap tokens from BSC to ETH.
+
+1. Users call `swapBSC2ETH` via BSCSwapAgent and specify bep20 token address, amount and swap fee. Bep20 tokens will be burned.
+2. Swap service will monitor the `SwapStarted` event and call `fillBSC2ETHSwap` via BSCSwapAgent to transfer corresponding erc20
+ tokens to the same address that initiate the swap.
+
+## Generate contracts from templates
+
+```javascript
+npm run generate
+```
+
+## Test
+
+Generate test contracts from templates:
+```javascript
+npm run generate-test
+```
+
+Run tests:
+
+```javascript
+npm run truffle:test
+```
+
+Run coverage:
+
+```javascript
+npm run coverage
+```
diff --git a/assets/eth-bsc-swap.png b/assets/eth-bsc-swap.png
new file mode 100644
index 0000000..57c1458
Binary files /dev/null and b/assets/eth-bsc-swap.png differ
diff --git a/contracts/BSCSwapAgentImpl.sol b/contracts/BSCSwapAgentImpl.sol
new file mode 100644
index 0000000..a709c96
--- /dev/null
+++ b/contracts/BSCSwapAgentImpl.sol
@@ -0,0 +1,137 @@
+pragma solidity 0.6.4;
+
+import "./interfaces/ISwap.sol";
+import "./bep20/BEP20UpgradeableProxy.sol";
+import './interfaces/IProxyInitialize.sol';
+import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
+import "openzeppelin-solidity/contracts/proxy/Initializable.sol";
+import "openzeppelin-solidity/contracts/GSN/Context.sol";
+
+contract BSCSwapAgentImpl is Context, Initializable {
+
+
+ using SafeERC20 for IERC20;
+
+ mapping(address => address) public swapMappingETH2BSC;
+ mapping(address => address) public swapMappingBSC2ETH;
+ mapping(bytes32 => bool) public filledETHTx;
+
+ address payable public owner;
+ address public bep20ProxyAdmin;
+ address public bep20Implementation;
+ uint256 public swapFee;
+
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
+ event SwapPairCreated(bytes32 indexed ethRegisterTxHash, address indexed bep20Addr, address indexed erc20Addr, string symbol, string name, uint8 decimals);
+ event SwapStarted(address indexed bep20Addr, address indexed erc20Addr, address indexed fromAddr, uint256 amount, uint256 feeAmount);
+ event SwapFilled(address indexed bep20Addr, bytes32 indexed ethTxHash, address indexed toAddress, uint256 amount);
+
+ constructor() public {
+ }
+
+ /**
+ * @dev Throws if called by any account other than the owner.
+ */
+ modifier onlyOwner() {
+ require(owner == _msgSender(), "Ownable: caller is not the owner");
+ _;
+ }
+
+ modifier notContract() {
+ require(!isContract(msg.sender), "contract is not allowed to swap");
+ require(msg.sender == tx.origin, "no proxy contract is allowed");
+ _;
+ }
+
+
+
+ function initialize(address bep20Impl, uint256 fee, address payable ownerAddr, address bep20ProxyAdminAddr) public initializer {
+ bep20Implementation = bep20Impl;
+ swapFee = fee;
+ owner = ownerAddr;
+ bep20ProxyAdmin = bep20ProxyAdminAddr;
+ }
+
+ function isContract(address addr) internal view returns (bool) {
+ uint size;
+ assembly { size := extcodesize(addr) }
+ return size > 0;
+ }
+
+ /**
+ * @dev Leaves the contract without owner. It will not be possible to call
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
+ *
+ * NOTE: Renouncing ownership will leave the contract without an owner,
+ * thereby removing any functionality that is only available to the owner.
+ */
+ function renounceOwnership() public onlyOwner {
+ emit OwnershipTransferred(owner, address(0));
+ owner = address(0);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ * Can only be called by the current owner.
+ */
+ function transferOwnership(address payable newOwner) public onlyOwner {
+ require(newOwner != address(0), "Ownable: new owner is the zero address");
+ emit OwnershipTransferred(owner, newOwner);
+ owner = newOwner;
+ }
+
+ /**
+ * @dev Returns set minimum swap fee from BEP20 to ERC20
+ */
+ function setSwapFee(uint256 fee) onlyOwner external {
+ swapFee = fee;
+ }
+
+ /**
+ * @dev createSwapPair
+ */
+ function createSwapPair(bytes32 ethTxHash, address erc20Addr, string calldata name, string calldata symbol, uint8 decimals) onlyOwner external returns (address) {
+ require(swapMappingETH2BSC[erc20Addr] == address(0x0), "duplicated swap pair");
+
+ BEP20UpgradeableProxy proxyToken = new BEP20UpgradeableProxy(bep20Implementation, bep20ProxyAdmin, "");
+ IProxyInitialize token = IProxyInitialize(address(proxyToken));
+ token.initialize(name, symbol, decimals, 0, true, address(this));
+
+ swapMappingETH2BSC[erc20Addr] = address(token);
+ swapMappingBSC2ETH[address(token)] = erc20Addr;
+
+ emit SwapPairCreated(ethTxHash, address(token), erc20Addr, symbol, name, decimals);
+ return address(token);
+ }
+
+ /**
+ * @dev fillETH2BSCSwap
+ */
+ function fillETH2BSCSwap(bytes32 ethTxHash, address erc20Addr, address toAddress, uint256 amount) onlyOwner external returns (bool) {
+ require(!filledETHTx[ethTxHash], "eth tx filled already");
+ address bscTokenAddr = swapMappingETH2BSC[erc20Addr];
+ require(bscTokenAddr != address(0x0), "no swap pair for this token");
+ filledETHTx[ethTxHash] = true;
+ ISwap(bscTokenAddr).mintTo(amount, toAddress);
+ emit SwapFilled(bscTokenAddr, ethTxHash, toAddress, amount);
+
+ return true;
+ }
+ /**
+ * @dev swapBSC2ETH
+ */
+ function swapBSC2ETH(address bep20Addr, uint256 amount) payable external notContract returns (bool) {
+ address erc20Addr = swapMappingBSC2ETH[bep20Addr];
+ require(erc20Addr != address(0x0), "no swap pair for this token");
+ require(msg.value == swapFee, "swap fee not equal");
+
+ IERC20(bep20Addr).safeTransferFrom(msg.sender, address(this), amount);
+ ISwap(bep20Addr).burn(amount);
+ if (msg.value != 0) {
+ owner.transfer(msg.value);
+ }
+
+ emit SwapStarted(bep20Addr, erc20Addr, msg.sender, amount, msg.value);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/contracts/BSCSwapAgentImpl.template b/contracts/BSCSwapAgentImpl.template
new file mode 100644
index 0000000..7892165
--- /dev/null
+++ b/contracts/BSCSwapAgentImpl.template
@@ -0,0 +1,147 @@
+pragma solidity 0.6.4;
+
+import "./interfaces/ISwap.sol";
+import "./bep20/BEP20UpgradeableProxy.sol";
+import './interfaces/IProxyInitialize.sol';
+import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
+{% if mock %}{% else %}import "openzeppelin-solidity/contracts/proxy/Initializable.sol";{% endif %}
+import "openzeppelin-solidity/contracts/GSN/Context.sol";
+{% if mock %}
+contract BSCSwapAgentImpl is Context {
+{% else %}
+contract BSCSwapAgentImpl is Context, Initializable {
+{% endif %}
+
+ using SafeERC20 for IERC20;
+
+ mapping(address => address) public swapMappingETH2BSC;
+ mapping(address => address) public swapMappingBSC2ETH;
+ mapping(bytes32 => bool) public filledETHTx;
+
+ address payable public owner;
+ address public bep20ProxyAdmin;
+ address public bep20Implementation;
+ uint256 public swapFee;
+
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
+ event SwapPairCreated(bytes32 indexed ethRegisterTxHash, address indexed bep20Addr, address indexed erc20Addr, string symbol, string name, uint8 decimals);
+ event SwapStarted(address indexed bep20Addr, address indexed erc20Addr, address indexed fromAddr, uint256 amount, uint256 feeAmount);
+ event SwapFilled(address indexed bep20Addr, bytes32 indexed ethTxHash, address indexed toAddress, uint256 amount);
+{% if mock %}
+ constructor(address bep20Impl, uint256 fee, address bep20ProxyAdminAddr) public {
+ bep20Implementation = bep20Impl;
+ swapFee = fee;
+ owner = _msgSender();
+ bep20ProxyAdmin = bep20ProxyAdminAddr;
+ }
+{% else %}
+ constructor() public {
+ }
+{% endif %}
+ /**
+ * @dev Throws if called by any account other than the owner.
+ */
+ modifier onlyOwner() {
+ require(owner == _msgSender(), "Ownable: caller is not the owner");
+ _;
+ }
+
+ modifier notContract() {
+ require(!isContract(msg.sender), "contract is not allowed to swap");
+ require(msg.sender == tx.origin, "no proxy contract is allowed");
+ _;
+ }
+
+
+{% if mock %}
+{% else %}
+ function initialize(address bep20Impl, uint256 fee, address payable ownerAddr, address bep20ProxyAdminAddr) public initializer {
+ bep20Implementation = bep20Impl;
+ swapFee = fee;
+ owner = ownerAddr;
+ bep20ProxyAdmin = bep20ProxyAdminAddr;
+ }
+{% endif %}
+ function isContract(address addr) internal view returns (bool) {
+ uint size;
+ assembly { size := extcodesize(addr) }
+ return size > 0;
+ }
+
+ /**
+ * @dev Leaves the contract without owner. It will not be possible to call
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
+ *
+ * NOTE: Renouncing ownership will leave the contract without an owner,
+ * thereby removing any functionality that is only available to the owner.
+ */
+ function renounceOwnership() public onlyOwner {
+ emit OwnershipTransferred(owner, address(0));
+ owner = address(0);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ * Can only be called by the current owner.
+ */
+ function transferOwnership(address payable newOwner) public onlyOwner {
+ require(newOwner != address(0), "Ownable: new owner is the zero address");
+ emit OwnershipTransferred(owner, newOwner);
+ owner = newOwner;
+ }
+
+ /**
+ * @dev Returns set minimum swap fee from BEP20 to ERC20
+ */
+ function setSwapFee(uint256 fee) onlyOwner external {
+ swapFee = fee;
+ }
+
+ /**
+ * @dev createSwapPair
+ */
+ function createSwapPair(bytes32 ethTxHash, address erc20Addr, string calldata name, string calldata symbol, uint8 decimals) onlyOwner external returns (address) {
+ require(swapMappingETH2BSC[erc20Addr] == address(0x0), "duplicated swap pair");
+
+ BEP20UpgradeableProxy proxyToken = new BEP20UpgradeableProxy(bep20Implementation, bep20ProxyAdmin, "");
+ IProxyInitialize token = IProxyInitialize(address(proxyToken));
+ token.initialize(name, symbol, decimals, 0, true, address(this));
+
+ swapMappingETH2BSC[erc20Addr] = address(token);
+ swapMappingBSC2ETH[address(token)] = erc20Addr;
+
+ emit SwapPairCreated(ethTxHash, address(token), erc20Addr, symbol, name, decimals);
+ return address(token);
+ }
+
+ /**
+ * @dev fillETH2BSCSwap
+ */
+ function fillETH2BSCSwap(bytes32 ethTxHash, address erc20Addr, address toAddress, uint256 amount) onlyOwner external returns (bool) {
+ require(!filledETHTx[ethTxHash], "eth tx filled already");
+ address bscTokenAddr = swapMappingETH2BSC[erc20Addr];
+ require(bscTokenAddr != address(0x0), "no swap pair for this token");
+ filledETHTx[ethTxHash] = true;
+ ISwap(bscTokenAddr).mintTo(amount, toAddress);
+ emit SwapFilled(bscTokenAddr, ethTxHash, toAddress, amount);
+
+ return true;
+ }
+ /**
+ * @dev swapBSC2ETH
+ */
+ function swapBSC2ETH(address bep20Addr, uint256 amount) payable external notContract returns (bool) {
+ address erc20Addr = swapMappingBSC2ETH[bep20Addr];
+ require(erc20Addr != address(0x0), "no swap pair for this token");
+ require(msg.value == swapFee, "swap fee not equal");
+
+ IERC20(bep20Addr).safeTransferFrom(msg.sender, address(this), amount);
+ ISwap(bep20Addr).burn(amount);
+ if (msg.value != 0) {
+ owner.transfer(msg.value);
+ }
+
+ emit SwapStarted(bep20Addr, erc20Addr, msg.sender, amount, msg.value);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/contracts/BSCSwapAgentUpgradeableProxy.sol b/contracts/BSCSwapAgentUpgradeableProxy.sol
new file mode 100644
index 0000000..31b7364
--- /dev/null
+++ b/contracts/BSCSwapAgentUpgradeableProxy.sol
@@ -0,0 +1,11 @@
+pragma solidity ^0.6.0;
+
+import "openzeppelin-solidity/contracts/proxy/TransparentUpgradeableProxy.sol";
+
+contract BSCSwapAgentUpgradeableProxy is TransparentUpgradeableProxy {
+
+ constructor(address logic, address admin, bytes memory data) TransparentUpgradeableProxy(logic, admin, data) public {
+
+ }
+
+}
\ No newline at end of file
diff --git a/contracts/ETHSwapAgentImpl.sol b/contracts/ETHSwapAgentImpl.sol
new file mode 100644
index 0000000..af02c9d
--- /dev/null
+++ b/contracts/ETHSwapAgentImpl.sol
@@ -0,0 +1,118 @@
+pragma solidity 0.6.4;
+
+import "./interfaces/IERC20Query.sol";
+import "openzeppelin-solidity/contracts/proxy/Initializable.sol";
+import "openzeppelin-solidity/contracts/GSN/Context.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
+
+contract ETHSwapAgentImpl is Context, Initializable {
+
+ using SafeERC20 for IERC20;
+
+ mapping(address => bool) public registeredERC20;
+ mapping(bytes32 => bool) public filledBSCTx;
+ address payable public owner;
+ uint256 public swapFee;
+
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
+ event SwapPairRegister(address indexed sponsor,address indexed erc20Addr, string name, string symbol, uint8 decimals);
+ event SwapStarted(address indexed erc20Addr, address indexed fromAddr, uint256 amount, uint256 feeAmount);
+ event SwapFilled(address indexed erc20Addr, bytes32 indexed bscTxHash, address indexed toAddress, uint256 amount);
+
+ constructor() public {
+ }
+
+ /**
+ * @dev Throws if called by any account other than the owner.
+ */
+ modifier onlyOwner() {
+ require(owner == _msgSender(), "Ownable: caller is not the owner");
+ _;
+ }
+
+ function initialize(uint256 fee, address payable ownerAddr) public initializer {
+ swapFee = fee;
+ owner = ownerAddr;
+ }
+
+ modifier notContract() {
+ require(!isContract(msg.sender), "contract is not allowed to swap");
+ require(msg.sender == tx.origin, "no proxy contract is allowed");
+ _;
+ }
+
+ function isContract(address addr) internal view returns (bool) {
+ uint size;
+ assembly { size := extcodesize(addr) }
+ return size > 0;
+ }
+
+ /**
+ * @dev Leaves the contract without owner. It will not be possible to call
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
+ *
+ * NOTE: Renouncing ownership will leave the contract without an owner,
+ * thereby removing any functionality that is only available to the owner.
+ */
+ function renounceOwnership() public onlyOwner {
+ emit OwnershipTransferred(owner, address(0));
+ owner = address(0);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ * Can only be called by the current owner.
+ */
+ function transferOwnership(address payable newOwner) public onlyOwner {
+ require(newOwner != address(0), "Ownable: new owner is the zero address");
+ emit OwnershipTransferred(owner, newOwner);
+ owner = newOwner;
+ }
+
+ /**
+ * @dev Returns set minimum swap fee from ERC20 to BEP20
+ */
+ function setSwapFee(uint256 fee) onlyOwner external {
+ swapFee = fee;
+ }
+
+ function registerSwapPairToBSC(address erc20Addr) external returns (bool) {
+ require(!registeredERC20[erc20Addr], "already registered");
+
+ string memory name = IERC20Query(erc20Addr).name();
+ string memory symbol = IERC20Query(erc20Addr).symbol();
+ uint8 decimals = IERC20Query(erc20Addr).decimals();
+
+ require(bytes(name).length>0, "empty name");
+ require(bytes(symbol).length>0, "empty symbol");
+
+ registeredERC20[erc20Addr] = true;
+
+ emit SwapPairRegister(msg.sender, erc20Addr, name, symbol, decimals);
+ return true;
+ }
+
+ function fillBSC2ETHSwap(bytes32 bscTxHash, address erc20Addr, address toAddress, uint256 amount) onlyOwner external returns (bool) {
+ require(!filledBSCTx[bscTxHash], "bsc tx filled already");
+ require(registeredERC20[erc20Addr], "not registered token");
+
+ filledBSCTx[bscTxHash] = true;
+ IERC20(erc20Addr).safeTransfer(toAddress, amount);
+
+ emit SwapFilled(erc20Addr, bscTxHash, toAddress, amount);
+ return true;
+ }
+
+ function swapETH2BSC(address erc20Addr, uint256 amount) payable external notContract returns (bool) {
+ require(registeredERC20[erc20Addr], "not registered token");
+ require(msg.value == swapFee, "swap fee not equal");
+
+ IERC20(erc20Addr).safeTransferFrom(msg.sender, address(this), amount);
+ if (msg.value != 0) {
+ owner.transfer(msg.value);
+ }
+
+ emit SwapStarted(erc20Addr, msg.sender, amount, msg.value);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/contracts/ETHSwapAgentImpl.template b/contracts/ETHSwapAgentImpl.template
new file mode 100644
index 0000000..cd9ea61
--- /dev/null
+++ b/contracts/ETHSwapAgentImpl.template
@@ -0,0 +1,125 @@
+pragma solidity 0.6.4;
+
+import "./interfaces/IERC20Query.sol";
+{% if mock %}{% else %}import "openzeppelin-solidity/contracts/proxy/Initializable.sol";{% endif %}
+import "openzeppelin-solidity/contracts/GSN/Context.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
+{% if mock %}
+contract ETHSwapAgentImpl is Context {
+{% else %}
+contract ETHSwapAgentImpl is Context, Initializable {
+{% endif %}
+ using SafeERC20 for IERC20;
+
+ mapping(address => bool) public registeredERC20;
+ mapping(bytes32 => bool) public filledBSCTx;
+ address payable public owner;
+ uint256 public swapFee;
+
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
+ event SwapPairRegister(address indexed sponsor,address indexed erc20Addr, string name, string symbol, uint8 decimals);
+ event SwapStarted(address indexed erc20Addr, address indexed fromAddr, uint256 amount, uint256 feeAmount);
+ event SwapFilled(address indexed erc20Addr, bytes32 indexed bscTxHash, address indexed toAddress, uint256 amount);
+{% if mock %}
+ constructor(uint256 fee) public {
+ swapFee = fee;
+ owner = _msgSender();
+ }
+{% else %}
+ constructor() public {
+ }
+{% endif %}
+ /**
+ * @dev Throws if called by any account other than the owner.
+ */
+ modifier onlyOwner() {
+ require(owner == _msgSender(), "Ownable: caller is not the owner");
+ _;
+ }
+{% if mock %}{% else %}
+ function initialize(uint256 fee, address payable ownerAddr) public initializer {
+ swapFee = fee;
+ owner = ownerAddr;
+ }
+{% endif %}
+ modifier notContract() {
+ require(!isContract(msg.sender), "contract is not allowed to swap");
+ require(msg.sender == tx.origin, "no proxy contract is allowed");
+ _;
+ }
+
+ function isContract(address addr) internal view returns (bool) {
+ uint size;
+ assembly { size := extcodesize(addr) }
+ return size > 0;
+ }
+
+ /**
+ * @dev Leaves the contract without owner. It will not be possible to call
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
+ *
+ * NOTE: Renouncing ownership will leave the contract without an owner,
+ * thereby removing any functionality that is only available to the owner.
+ */
+ function renounceOwnership() public onlyOwner {
+ emit OwnershipTransferred(owner, address(0));
+ owner = address(0);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ * Can only be called by the current owner.
+ */
+ function transferOwnership(address payable newOwner) public onlyOwner {
+ require(newOwner != address(0), "Ownable: new owner is the zero address");
+ emit OwnershipTransferred(owner, newOwner);
+ owner = newOwner;
+ }
+
+ /**
+ * @dev Returns set minimum swap fee from ERC20 to BEP20
+ */
+ function setSwapFee(uint256 fee) onlyOwner external {
+ swapFee = fee;
+ }
+
+ function registerSwapPairToBSC(address erc20Addr) external returns (bool) {
+ require(!registeredERC20[erc20Addr], "already registered");
+
+ string memory name = IERC20Query(erc20Addr).name();
+ string memory symbol = IERC20Query(erc20Addr).symbol();
+ uint8 decimals = IERC20Query(erc20Addr).decimals();
+
+ require(bytes(name).length>0, "empty name");
+ require(bytes(symbol).length>0, "empty symbol");
+
+ registeredERC20[erc20Addr] = true;
+
+ emit SwapPairRegister(msg.sender, erc20Addr, name, symbol, decimals);
+ return true;
+ }
+
+ function fillBSC2ETHSwap(bytes32 bscTxHash, address erc20Addr, address toAddress, uint256 amount) onlyOwner external returns (bool) {
+ require(!filledBSCTx[bscTxHash], "bsc tx filled already");
+ require(registeredERC20[erc20Addr], "not registered token");
+
+ filledBSCTx[bscTxHash] = true;
+ IERC20(erc20Addr).safeTransfer(toAddress, amount);
+
+ emit SwapFilled(erc20Addr, bscTxHash, toAddress, amount);
+ return true;
+ }
+
+ function swapETH2BSC(address erc20Addr, uint256 amount) payable external notContract returns (bool) {
+ require(registeredERC20[erc20Addr], "not registered token");
+ require(msg.value == swapFee, "swap fee not equal");
+
+ IERC20(erc20Addr).safeTransferFrom(msg.sender, address(this), amount);
+ if (msg.value != 0) {
+ owner.transfer(msg.value);
+ }
+
+ emit SwapStarted(erc20Addr, msg.sender, amount, msg.value);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/contracts/ETHSwapAgentUpgradeableProxy.sol b/contracts/ETHSwapAgentUpgradeableProxy.sol
new file mode 100644
index 0000000..f4b00af
--- /dev/null
+++ b/contracts/ETHSwapAgentUpgradeableProxy.sol
@@ -0,0 +1,11 @@
+pragma solidity ^0.6.0;
+
+import "openzeppelin-solidity/contracts/proxy/TransparentUpgradeableProxy.sol";
+
+contract ETHSwapAgentUpgradeableProxy is TransparentUpgradeableProxy {
+
+ constructor(address logic, address admin, bytes memory data) TransparentUpgradeableProxy(logic, admin, data) public {
+
+ }
+
+}
\ No newline at end of file
diff --git a/contracts/SwapProxy.sol b/contracts/SwapProxy.sol
deleted file mode 100644
index d9fdca8..0000000
--- a/contracts/SwapProxy.sol
+++ /dev/null
@@ -1,34 +0,0 @@
-pragma solidity 0.6.4;
-
-import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
-import "@openzeppelin/contracts/access/Ownable.sol";
-
-contract SwapProxy is Ownable {
- uint256 public swapFee;
- address payable public relayer;
-
- event tokenTransfer(address indexed contractAddr, address indexed fromAddr, address indexed toAddr, uint256 amount, uint256 feeAmount);
-
- constructor (address payable relayerAddr, uint256 fee) public {
- relayer = relayerAddr;
- swapFee = fee;
- }
-
- function close() public onlyOwner {
- address payable ownerAddr = payable(owner());
- selfdestruct(ownerAddr);
- }
-
- function swap(address contractAddr, uint256 amount) payable external returns (bool) {
- require(msg.value >= swapFee, "fee amount should not be less than the amount of swapFee");
- require(amount > 0, "amount should be larger than 0");
-
- relayer.transfer(msg.value);
-
- bool success = IERC20(contractAddr).transferFrom(msg.sender, relayer, amount);
- require(success, "transfer token failed");
-
- emit tokenTransfer(contractAddr, msg.sender, relayer, amount, msg.value);
- return true;
- }
-}
diff --git a/contracts/bep20/BEP20TokenImplementation.sol b/contracts/bep20/BEP20TokenImplementation.sol
new file mode 100644
index 0000000..64a1132
--- /dev/null
+++ b/contracts/bep20/BEP20TokenImplementation.sol
@@ -0,0 +1,333 @@
+pragma solidity 0.6.4;
+
+import "../interfaces/IBEP20.sol";
+import "../interfaces/ISwap.sol";
+import "openzeppelin-solidity/contracts/GSN/Context.sol";
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "openzeppelin-solidity/contracts/proxy/Initializable.sol";
+
+contract BEP20TokenImplementation is Context, IBEP20, ISwap, Initializable {
+ using SafeMath for uint256;
+
+ mapping (address => uint256) private _balances;
+ mapping (address => mapping (address => uint256)) private _allowances;
+ uint256 private _totalSupply;
+ string private _name;
+ string private _symbol;
+ uint8 private _decimals;
+
+ address private _owner;
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
+
+ bool private _mintable;
+
+ constructor() public {
+ }
+
+ /**
+ * @dev Throws if called by any account other than the owner.
+ */
+ modifier onlyOwner() {
+ require(_owner == _msgSender(), "Ownable: caller is not the owner");
+ _;
+ }
+
+ /**
+ * @dev sets initials supply and the owner
+ */
+ function initialize(string memory name, string memory symbol, uint8 decimals, uint256 amount, bool mintable, address owner) public initializer {
+ _owner = owner;
+ _name = name;
+ _symbol = symbol;
+ _decimals = decimals;
+ _mintable = mintable;
+ _mint(owner, amount);
+ }
+
+ /**
+ * @dev Leaves the contract without owner. It will not be possible to call
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
+ *
+ * NOTE: Renouncing ownership will leave the contract without an owner,
+ * thereby removing any functionality that is only available to the owner.
+ */
+ function renounceOwnership() public onlyOwner {
+ emit OwnershipTransferred(_owner, address(0));
+ _owner = address(0);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ * Can only be called by the current owner.
+ */
+ function transferOwnership(address newOwner) public onlyOwner {
+ require(newOwner != address(0), "Ownable: new owner is the zero address");
+ emit OwnershipTransferred(_owner, newOwner);
+ _owner = newOwner;
+ }
+
+ /**
+ * @dev Returns if the token is mintable or not
+ */
+ function mintable() external view returns (bool) {
+ return _mintable;
+ }
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external override view returns (address) {
+ return _owner;
+ }
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external override view returns (uint8) {
+ return _decimals;
+ }
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external override view returns (string memory) {
+ return _symbol;
+ }
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external override view returns (string memory) {
+ return _name;
+ }
+
+ /**
+ * @dev See {BEP20-totalSupply}.
+ */
+ function totalSupply() external override view returns (uint256) {
+ return _totalSupply;
+ }
+
+ /**
+ * @dev See {BEP20-balanceOf}.
+ */
+ function balanceOf(address account) external override view returns (uint256) {
+ return _balances[account];
+ }
+
+ /**
+ * @dev See {BEP20-transfer}.
+ *
+ * Requirements:
+ *
+ * - `recipient` cannot be the zero address.
+ * - the caller must have a balance of at least `amount`.
+ */
+ function transfer(address recipient, uint256 amount) external override returns (bool) {
+ _transfer(_msgSender(), recipient, amount);
+ return true;
+ }
+
+ /**
+ * @dev See {BEP20-allowance}.
+ */
+ function allowance(address owner, address spender) external override view returns (uint256) {
+ return _allowances[owner][spender];
+ }
+
+ /**
+ * @dev See {BEP20-approve}.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function approve(address spender, uint256 amount) external override returns (bool) {
+ _approve(_msgSender(), spender, amount);
+ return true;
+ }
+
+ /**
+ * @dev See {BEP20-transferFrom}.
+ *
+ * Emits an {Approval} event indicating the updated allowance. This is not
+ * required by the EIP. See the note at the beginning of {BEP20};
+ *
+ * Requirements:
+ * - `sender` and `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ * - the caller must have allowance for `sender`'s tokens of at least
+ * `amount`.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
+ _transfer(sender, recipient, amount);
+ _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance"));
+ return true;
+ }
+
+ /**
+ * @dev Atomically increases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
+ return true;
+ }
+
+ /**
+ * @dev Atomically decreases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ * - `spender` must have allowance for the caller of at least
+ * `subtractedValue`.
+ */
+ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero"));
+ return true;
+ }
+
+ /**
+ * @dev Creates `amount` tokens and assigns them to `msg.sender`, increasing
+ * the total supply.
+ *
+ * Requirements
+ *
+ * - `msg.sender` must be the token owner
+ * - `_mintable` must be true
+ */
+ function mint(uint256 amount) public onlyOwner returns (bool) {
+ require(_mintable, "this token is not mintable");
+ _mint(_msgSender(), amount);
+ return true;
+ }
+
+ /**
+ * @dev Creates `amount` tokens and assigns them to `recipient`, increasing
+ * the total supply.
+ *
+ * Requirements
+ *
+ * - `msg.sender` must be the token owner
+ * - `_mintable` must be true
+ */
+ function mintTo(uint256 amount, address recipient) override external onlyOwner returns (bool) {
+ require(_mintable, "this token is not mintable");
+ _mint(recipient, amount);
+ return true;
+ }
+
+
+ /**
+ * @dev Burn `amount` tokens and decreasing the total supply.
+ */
+ function burn(uint256 amount) override external returns (bool) {
+ _burn(_msgSender(), amount);
+ return true;
+ }
+
+ /**
+ * @dev Moves tokens `amount` from `sender` to `recipient`.
+ *
+ * This is internal function is equivalent to {transfer}, and can be used to
+ * e.g. implement automatic token fees, slashing mechanisms, etc.
+ *
+ * Emits a {Transfer} event.
+ *
+ * Requirements:
+ *
+ * - `sender` cannot be the zero address.
+ * - `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ */
+ function _transfer(address sender, address recipient, uint256 amount) internal {
+ require(sender != address(0), "BEP20: transfer from the zero address");
+ require(recipient != address(0), "BEP20: transfer to the zero address");
+
+ _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
+ _balances[recipient] = _balances[recipient].add(amount);
+ emit Transfer(sender, recipient, amount);
+ }
+
+ /** @dev Creates `amount` tokens and assigns them to `account`, increasing
+ * the total supply.
+ *
+ * Emits a {Transfer} event with `from` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `to` cannot be the zero address.
+ */
+ function _mint(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: mint to the zero address");
+
+ _totalSupply = _totalSupply.add(amount);
+ _balances[account] = _balances[account].add(amount);
+ emit Transfer(address(0), account, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`, reducing the
+ * total supply.
+ *
+ * Emits a {Transfer} event with `to` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `account` cannot be the zero address.
+ * - `account` must have at least `amount` tokens.
+ */
+ function _burn(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: burn from the zero address");
+
+ _balances[account] = _balances[account].sub(amount, "BEP20: burn amount exceeds balance");
+ _totalSupply = _totalSupply.sub(amount);
+ emit Transfer(account, address(0), amount);
+ }
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
+ *
+ * This is internal function is equivalent to `approve`, and can be used to
+ * e.g. set automatic allowances for certain subsystems, etc.
+ *
+ * Emits an {Approval} event.
+ *
+ * Requirements:
+ *
+ * - `owner` cannot be the zero address.
+ * - `spender` cannot be the zero address.
+ */
+ function _approve(address owner, address spender, uint256 amount) internal {
+ require(owner != address(0), "BEP20: approve from the zero address");
+ require(spender != address(0), "BEP20: approve to the zero address");
+
+ _allowances[owner][spender] = amount;
+ emit Approval(owner, spender, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`.`amount` is then deducted
+ * from the caller's allowance.
+ *
+ * See {_burn} and {_approve}.
+ */
+ function _burnFrom(address account, uint256 amount) internal {
+ _burn(account, amount);
+ _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance"));
+ }
+}
\ No newline at end of file
diff --git a/contracts/bep20/BEP20UpgradeableProxy.sol b/contracts/bep20/BEP20UpgradeableProxy.sol
new file mode 100644
index 0000000..a67ccb1
--- /dev/null
+++ b/contracts/bep20/BEP20UpgradeableProxy.sol
@@ -0,0 +1,11 @@
+pragma solidity 0.6.4;
+
+import "openzeppelin-solidity/contracts/proxy/TransparentUpgradeableProxy.sol";
+
+contract BEP20UpgradeableProxy is TransparentUpgradeableProxy {
+
+ constructor(address logic, address admin, bytes memory data) TransparentUpgradeableProxy(logic, admin, data) public {
+
+ }
+
+}
\ No newline at end of file
diff --git a/contracts/flattened/.gitkeep b/contracts/flattened/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/contracts/flattened/SwapProxy.sol b/contracts/flattened/SwapProxy.sol
deleted file mode 100644
index c5890d6..0000000
--- a/contracts/flattened/SwapProxy.sol
+++ /dev/null
@@ -1,213 +0,0 @@
-
-// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
-
-// SPDX-License-Identifier: MIT
-
-pragma solidity ^0.6.0;
-
-/**
- * @dev Interface of the ERC20 standard as defined in the EIP.
- */
-interface IERC20 {
- /**
- * @dev Returns the amount of tokens in existence.
- */
- function totalSupply() external view returns (uint256);
-
- /**
- * @dev Returns the amount of tokens owned by `account`.
- */
- function balanceOf(address account) external view returns (uint256);
-
- /**
- * @dev Moves `amount` tokens from the caller's account to `recipient`.
- *
- * Returns a boolean value indicating whether the operation succeeded.
- *
- * Emits a {Transfer} event.
- */
- function transfer(address recipient, uint256 amount) external returns (bool);
-
- /**
- * @dev Returns the remaining number of tokens that `spender` will be
- * allowed to spend on behalf of `owner` through {transferFrom}. This is
- * zero by default.
- *
- * This value changes when {approve} or {transferFrom} are called.
- */
- function allowance(address owner, address spender) external view returns (uint256);
-
- /**
- * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
- *
- * Returns a boolean value indicating whether the operation succeeded.
- *
- * IMPORTANT: Beware that changing an allowance with this method brings the risk
- * that someone may use both the old and the new allowance by unfortunate
- * transaction ordering. One possible solution to mitigate this race
- * condition is to first reduce the spender's allowance to 0 and set the
- * desired value afterwards:
- * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
- *
- * Emits an {Approval} event.
- */
- function approve(address spender, uint256 amount) external returns (bool);
-
- /**
- * @dev Moves `amount` tokens from `sender` to `recipient` using the
- * allowance mechanism. `amount` is then deducted from the caller's
- * allowance.
- *
- * Returns a boolean value indicating whether the operation succeeded.
- *
- * Emits a {Transfer} event.
- */
- function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
-
- /**
- * @dev Emitted when `value` tokens are moved from one account (`from`) to
- * another (`to`).
- *
- * Note that `value` may be zero.
- */
- event Transfer(address indexed from, address indexed to, uint256 value);
-
- /**
- * @dev Emitted when the allowance of a `spender` for an `owner` is set by
- * a call to {approve}. `value` is the new allowance.
- */
- event Approval(address indexed owner, address indexed spender, uint256 value);
-}
-
-// File: @openzeppelin/contracts/GSN/Context.sol
-
-// SPDX-License-Identifier: MIT
-
-pragma solidity ^0.6.0;
-
-/*
- * @dev Provides information about the current execution context, including the
- * sender of the transaction and its data. While these are generally available
- * via msg.sender and msg.data, they should not be accessed in such a direct
- * manner, since when dealing with GSN meta-transactions the account sending and
- * paying for execution may not be the actual sender (as far as an application
- * is concerned).
- *
- * This contract is only required for intermediate, library-like contracts.
- */
-abstract contract Context {
- function _msgSender() internal view virtual returns (address payable) {
- return msg.sender;
- }
-
- function _msgData() internal view virtual returns (bytes memory) {
- this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
- return msg.data;
- }
-}
-
-// File: @openzeppelin/contracts/access/Ownable.sol
-
-// SPDX-License-Identifier: MIT
-
-pragma solidity ^0.6.0;
-
-/**
- * @dev Contract module which provides a basic access control mechanism, where
- * there is an account (an owner) that can be granted exclusive access to
- * specific functions.
- *
- * By default, the owner account will be the one that deploys the contract. This
- * can later be changed with {transferOwnership}.
- *
- * This module is used through inheritance. It will make available the modifier
- * `onlyOwner`, which can be applied to your functions to restrict their use to
- * the owner.
- */
-contract Ownable is Context {
- address private _owner;
-
- event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
-
- /**
- * @dev Initializes the contract setting the deployer as the initial owner.
- */
- constructor () internal {
- address msgSender = _msgSender();
- _owner = msgSender;
- emit OwnershipTransferred(address(0), msgSender);
- }
-
- /**
- * @dev Returns the address of the current owner.
- */
- function owner() public view returns (address) {
- return _owner;
- }
-
- /**
- * @dev Throws if called by any account other than the owner.
- */
- modifier onlyOwner() {
- require(_owner == _msgSender(), "Ownable: caller is not the owner");
- _;
- }
-
- /**
- * @dev Leaves the contract without owner. It will not be possible to call
- * `onlyOwner` functions anymore. Can only be called by the current owner.
- *
- * NOTE: Renouncing ownership will leave the contract without an owner,
- * thereby removing any functionality that is only available to the owner.
- */
- function renounceOwnership() public virtual onlyOwner {
- emit OwnershipTransferred(_owner, address(0));
- _owner = address(0);
- }
-
- /**
- * @dev Transfers ownership of the contract to a new account (`newOwner`).
- * Can only be called by the current owner.
- */
- function transferOwnership(address newOwner) public virtual onlyOwner {
- require(newOwner != address(0), "Ownable: new owner is the zero address");
- emit OwnershipTransferred(_owner, newOwner);
- _owner = newOwner;
- }
-}
-
-// File: contracts/SwapProxy.sol
-
-pragma solidity 0.6.4;
-
-
-
-contract SwapProxy is Ownable {
- uint256 public swapFee;
- address payable public relayer;
-
- event tokenTransfer(address indexed contractAddr, address indexed fromAddr, address indexed toAddr, uint256 amount, uint256 feeAmount);
-
- constructor (address payable relayerAddr, uint256 fee) public {
- relayer = relayerAddr;
- swapFee = fee;
- }
-
- function close() public onlyOwner {
- address payable ownerAddr = payable(owner());
- selfdestruct(ownerAddr);
- }
-
- function swap(address contractAddr, uint256 amount) payable external returns (bool) {
- require(msg.value >= swapFee, "fee amount should not be less than the amount of swapFee");
- require(amount > 0, "amount should be larger than 0");
-
- relayer.transfer(msg.value);
-
- bool success = IERC20(contractAddr).transferFrom(msg.sender, relayer, amount);
- require(success, "transfer token failed");
-
- emit tokenTransfer(contractAddr, msg.sender, relayer, amount, msg.value);
- return true;
- }
-}
diff --git a/contracts/interfaces/IBEP20.sol b/contracts/interfaces/IBEP20.sol
new file mode 100644
index 0000000..d9c6605
--- /dev/null
+++ b/contracts/interfaces/IBEP20.sol
@@ -0,0 +1,92 @@
+pragma solidity 0.6.4;
+
+interface IBEP20 {
+ /**
+ * @dev Returns the amount of tokens in existence.
+ */
+ function totalSupply() external view returns (uint256);
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external view returns (uint8);
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external view returns (string memory);
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external view returns (string memory);
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external view returns (address);
+
+ /**
+ * @dev Returns the amount of tokens owned by `account`.
+ */
+ function balanceOf(address account) external view returns (uint256);
+
+ /**
+ * @dev Moves `amount` tokens from the caller's account to `recipient`.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transfer(address recipient, uint256 amount) external returns (bool);
+
+ /**
+ * @dev Returns the remaining number of tokens that `spender` will be
+ * allowed to spend on behalf of `owner` through {transferFrom}. This is
+ * zero by default.
+ *
+ * This value changes when {approve} or {transferFrom} are called.
+ */
+ function allowance(address _owner, address spender) external view returns (uint256);
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * IMPORTANT: Beware that changing an allowance with this method brings the risk
+ * that someone may use both the old and the new allowance by unfortunate
+ * transaction ordering. One possible solution to mitigate this race
+ * condition is to first reduce the spender's allowance to 0 and set the
+ * desired value afterwards:
+ * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+ *
+ * Emits an {Approval} event.
+ */
+ function approve(address spender, uint256 amount) external returns (bool);
+
+ /**
+ * @dev Moves `amount` tokens from `sender` to `recipient` using the
+ * allowance mechanism. `amount` is then deducted from the caller's
+ * allowance.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
+
+ /**
+ * @dev Emitted when `value` tokens are moved from one account (`from`) to
+ * another (`to`).
+ *
+ * Note that `value` may be zero.
+ */
+ event Transfer(address indexed from, address indexed to, uint256 value);
+
+ /**
+ * @dev Emitted when the allowance of a `spender` for an `owner` is set by
+ * a call to {approve}. `value` is the new allowance.
+ */
+ event Approval(address indexed owner, address indexed spender, uint256 value);
+}
diff --git a/contracts/interfaces/IERC20Query.sol b/contracts/interfaces/IERC20Query.sol
new file mode 100644
index 0000000..a53ba25
--- /dev/null
+++ b/contracts/interfaces/IERC20Query.sol
@@ -0,0 +1,28 @@
+pragma solidity 0.6.4;
+
+interface IERC20Query {
+ /**
+ * @dev Returns the amount of tokens in existence.
+ */
+ function totalSupply() external view returns (uint256);
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external view returns (uint8);
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external view returns (string memory);
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external view returns (string memory);
+
+ /**
+ * @dev Returns the amount of tokens owned by `account`.
+ */
+ function balanceOf(address account) external view returns (uint256);
+}
diff --git a/contracts/interfaces/IProxyInitialize.sol b/contracts/interfaces/IProxyInitialize.sol
new file mode 100644
index 0000000..b303ea0
--- /dev/null
+++ b/contracts/interfaces/IProxyInitialize.sol
@@ -0,0 +1,5 @@
+pragma solidity 0.6.4;
+
+interface IProxyInitialize {
+ function initialize(string calldata name, string calldata symbol, uint8 decimals, uint256 amount, bool mintable, address owner) external;
+}
\ No newline at end of file
diff --git a/contracts/interfaces/ISwap.sol b/contracts/interfaces/ISwap.sol
new file mode 100644
index 0000000..f5a6db3
--- /dev/null
+++ b/contracts/interfaces/ISwap.sol
@@ -0,0 +1,19 @@
+pragma solidity 0.6.4;
+
+interface ISwap {
+ /**
+ * @dev Creates `amount` tokens and assigns them to `recipient`, increasing
+ * the total supply.
+ *
+ * Requirements
+ *
+ * - `msg.sender` must be the token owner
+ * - `_mintable` must be true
+ */
+ function mintTo(uint256 amount, address recipient) external returns (bool);
+
+ /**
+ * @dev Burn `amount` tokens and decreasing the total supply.
+ */
+ function burn(uint256 amount) external returns (bool);
+}
diff --git a/contracts/test/ERC20ABC.sol b/contracts/test/ERC20ABC.sol
new file mode 100644
index 0000000..68967d6
--- /dev/null
+++ b/contracts/test/ERC20ABC.sol
@@ -0,0 +1,602 @@
+
+// File: contracts/interface/IBEP20.sol
+
+pragma solidity 0.6.4;
+
+interface IBEP20 {
+ /**
+ * @dev Returns the amount of tokens in existence.
+ */
+ function totalSupply() external view returns (uint256);
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external view returns (uint8);
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external view returns (string memory);
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external view returns (string memory);
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external view returns (address);
+
+ /**
+ * @dev Returns the amount of tokens owned by `account`.
+ */
+ function balanceOf(address account) external view returns (uint256);
+
+ /**
+ * @dev Moves `amount` tokens from the caller's account to `recipient`.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transfer(address recipient, uint256 amount) external returns (bool);
+
+ /**
+ * @dev Returns the remaining number of tokens that `spender` will be
+ * allowed to spend on behalf of `owner` through {transferFrom}. This is
+ * zero by default.
+ *
+ * This value changes when {approve} or {transferFrom} are called.
+ */
+ function allowance(address _owner, address spender) external view returns (uint256);
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * IMPORTANT: Beware that changing an allowance with this method brings the risk
+ * that someone may use both the old and the new allowance by unfortunate
+ * transaction ordering. One possible solution to mitigate this race
+ * condition is to first reduce the spender's allowance to 0 and set the
+ * desired value afterwards:
+ * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+ *
+ * Emits an {Approval} event.
+ */
+ function approve(address spender, uint256 amount) external returns (bool);
+
+ /**
+ * @dev Moves `amount` tokens from `sender` to `recipient` using the
+ * allowance mechanism. `amount` is then deducted from the caller's
+ * allowance.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
+
+ /**
+ * @dev Emitted when `value` tokens are moved from one account (`from`) to
+ * another (`to`).
+ *
+ * Note that `value` may be zero.
+ */
+ event Transfer(address indexed from, address indexed to, uint256 value);
+
+ /**
+ * @dev Emitted when the allowance of a `spender` for an `owner` is set by
+ * a call to {approve}. `value` is the new allowance.
+ */
+ event Approval(address indexed owner, address indexed spender, uint256 value);
+}
+
+// File: openzeppelin-solidity/contracts/GSN/Context.sol
+
+pragma solidity ^0.6.0;
+
+/*
+ * @dev Provides information about the current execution context, including the
+ * sender of the transaction and its data. While these are generally available
+ * via msg.sender and msg.data, they should not be accessed in such a direct
+ * manner, since when dealing with GSN meta-transactions the account sending and
+ * paying for execution may not be the actual sender (as far as an application
+ * is concerned).
+ *
+ * This contract is only required for intermediate, library-like contracts.
+ */
+contract Context {
+ // Empty internal constructor, to prevent people from mistakenly deploying
+ // an instance of this contract, which should be used via inheritance.
+ constructor () internal { }
+
+ function _msgSender() internal view virtual returns (address payable) {
+ return msg.sender;
+ }
+
+ function _msgData() internal view virtual returns (bytes memory) {
+ this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
+ return msg.data;
+ }
+}
+
+// File: openzeppelin-solidity/contracts/math/SafeMath.sol
+
+pragma solidity ^0.6.0;
+
+/**
+ * @dev Wrappers over Solidity's arithmetic operations with added overflow
+ * checks.
+ *
+ * Arithmetic operations in Solidity wrap on overflow. This can easily result
+ * in bugs, because programmers usually assume that an overflow raises an
+ * error, which is the standard behavior in high level programming languages.
+ * `SafeMath` restores this intuition by reverting the transaction when an
+ * operation overflows.
+ *
+ * Using this library instead of the unchecked operations eliminates an entire
+ * class of bugs, so it's recommended to use it always.
+ */
+library SafeMath {
+ /**
+ * @dev Returns the addition of two unsigned integers, reverting on
+ * overflow.
+ *
+ * Counterpart to Solidity's `+` operator.
+ *
+ * Requirements:
+ * - Addition cannot overflow.
+ */
+ function add(uint256 a, uint256 b) internal pure returns (uint256) {
+ uint256 c = a + b;
+ require(c >= a, "SafeMath: addition overflow");
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the subtraction of two unsigned integers, reverting on
+ * overflow (when the result is negative).
+ *
+ * Counterpart to Solidity's `-` operator.
+ *
+ * Requirements:
+ * - Subtraction cannot overflow.
+ */
+ function sub(uint256 a, uint256 b) internal pure returns (uint256) {
+ return sub(a, b, "SafeMath: subtraction overflow");
+ }
+
+ /**
+ * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
+ * overflow (when the result is negative).
+ *
+ * Counterpart to Solidity's `-` operator.
+ *
+ * Requirements:
+ * - Subtraction cannot overflow.
+ */
+ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ require(b <= a, errorMessage);
+ uint256 c = a - b;
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the multiplication of two unsigned integers, reverting on
+ * overflow.
+ *
+ * Counterpart to Solidity's `*` operator.
+ *
+ * Requirements:
+ * - Multiplication cannot overflow.
+ */
+ function mul(uint256 a, uint256 b) internal pure returns (uint256) {
+ // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
+ // benefit is lost if 'b' is also tested.
+ // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
+ if (a == 0) {
+ return 0;
+ }
+
+ uint256 c = a * b;
+ require(c / a == b, "SafeMath: multiplication overflow");
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the integer division of two unsigned integers. Reverts on
+ * division by zero. The result is rounded towards zero.
+ *
+ * Counterpart to Solidity's `/` operator. Note: this function uses a
+ * `revert` opcode (which leaves remaining gas untouched) while Solidity
+ * uses an invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function div(uint256 a, uint256 b) internal pure returns (uint256) {
+ return div(a, b, "SafeMath: division by zero");
+ }
+
+ /**
+ * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
+ * division by zero. The result is rounded towards zero.
+ *
+ * Counterpart to Solidity's `/` operator. Note: this function uses a
+ * `revert` opcode (which leaves remaining gas untouched) while Solidity
+ * uses an invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ // Solidity only automatically asserts when dividing by 0
+ require(b > 0, errorMessage);
+ uint256 c = a / b;
+ // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+ * Reverts when dividing by zero.
+ *
+ * Counterpart to Solidity's `%` operator. This function uses a `revert`
+ * opcode (which leaves remaining gas untouched) while Solidity uses an
+ * invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function mod(uint256 a, uint256 b) internal pure returns (uint256) {
+ return mod(a, b, "SafeMath: modulo by zero");
+ }
+
+ /**
+ * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+ * Reverts with custom message when dividing by zero.
+ *
+ * Counterpart to Solidity's `%` operator. This function uses a `revert`
+ * opcode (which leaves remaining gas untouched) while Solidity uses an
+ * invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ require(b != 0, errorMessage);
+ return a % b;
+ }
+}
+
+// File: openzeppelin-solidity/contracts/access/Ownable.sol
+
+pragma solidity ^0.6.0;
+
+/**
+ * @dev Contract module which provides a basic access control mechanism, where
+ * there is an account (an owner) that can be granted exclusive access to
+ * specific functions.
+ *
+ * By default, the owner account will be the one that deploys the contract. This
+ * can later be changed with {transferOwnership}.
+ *
+ * This module is used through inheritance. It will make available the modifier
+ * `onlyOwner`, which can be applied to your functions to restrict their use to
+ * the owner.
+ */
+contract Ownable is Context {
+ address private _owner;
+
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
+
+ /**
+ * @dev Initializes the contract setting the deployer as the initial owner.
+ */
+ constructor () internal {
+ address msgSender = _msgSender();
+ _owner = msgSender;
+ emit OwnershipTransferred(address(0), msgSender);
+ }
+
+ /**
+ * @dev Returns the address of the current owner.
+ */
+ function owner() public view returns (address) {
+ return _owner;
+ }
+
+ /**
+ * @dev Throws if called by any account other than the owner.
+ */
+ modifier onlyOwner() {
+ require(_owner == _msgSender(), "Ownable: caller is not the owner");
+ _;
+ }
+
+ /**
+ * @dev Leaves the contract without owner. It will not be possible to call
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
+ *
+ * NOTE: Renouncing ownership will leave the contract without an owner,
+ * thereby removing any functionality that is only available to the owner.
+ */
+ function renounceOwnership() public virtual onlyOwner {
+ emit OwnershipTransferred(_owner, address(0));
+ _owner = address(0);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ * Can only be called by the current owner.
+ */
+ function transferOwnership(address newOwner) public virtual onlyOwner {
+ _transferOwnership(newOwner);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ */
+ function _transferOwnership(address newOwner) internal virtual {
+ require(newOwner != address(0), "Ownable: new owner is the zero address");
+ emit OwnershipTransferred(_owner, newOwner);
+ _owner = newOwner;
+ }
+}
+
+// File: contracts/test/ABCToken.sol
+
+pragma solidity 0.6.4;
+
+
+
+
+
+contract ERC20ABC is Context, IBEP20, Ownable {
+ using SafeMath for uint256;
+
+ mapping (address => uint256) private _balances;
+
+ mapping (address => mapping (address => uint256)) private _allowances;
+
+ uint256 private _totalSupply;
+ uint8 public _decimals;
+ string public _symbol;
+ string public _name;
+
+ constructor() public {
+ _name = "ABC token";
+ _symbol = "ABC";
+ _decimals = 18;
+ _totalSupply = 100000000000000000000000000;
+ _balances[msg.sender] = _totalSupply;
+
+ emit Transfer(address(0), msg.sender, _totalSupply);
+ }
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external override view returns (address) {
+ return owner();
+ }
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external override view returns (uint8) {
+ return _decimals;
+ }
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external override view returns (string memory) {
+ return _symbol;
+ }
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external override view returns (string memory) {
+ return _name;
+ }
+
+ /**
+ * @dev See {BEP20-totalSupply}.
+ */
+ function totalSupply() external override view returns (uint256) {
+ return _totalSupply;
+ }
+
+ /**
+ * @dev See {BEP20-balanceOf}.
+ */
+ function balanceOf(address account) external override view returns (uint256) {
+ return _balances[account];
+ }
+
+ /**
+ * @dev See {BEP20-transfer}.
+ *
+ * Requirements:
+ *
+ * - `recipient` cannot be the zero address.
+ * - the caller must have a balance of at least `amount`.
+ */
+ function transfer(address recipient, uint256 amount) external override returns (bool) {
+ _transfer(_msgSender(), recipient, amount);
+ return true;
+ }
+
+ /**
+ * @dev See {BEP20-allowance}.
+ */
+ function allowance(address owner, address spender) external override view returns (uint256) {
+ return _allowances[owner][spender];
+ }
+
+ /**
+ * @dev See {BEP20-approve}.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function approve(address spender, uint256 amount) external override returns (bool) {
+ _approve(_msgSender(), spender, amount);
+ return true;
+ }
+
+ /**
+ * @dev See {BEP20-transferFrom}.
+ *
+ * Emits an {Approval} event indicating the updated allowance. This is not
+ * required by the EIP. See the note at the beginning of {BEP20};
+ *
+ * Requirements:
+ * - `sender` and `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ * - the caller must have allowance for `sender`'s tokens of at least
+ * `amount`.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
+ _transfer(sender, recipient, amount);
+ _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance"));
+ return true;
+ }
+
+ /**
+ * @dev Atomically increases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
+ return true;
+ }
+
+ /**
+ * @dev Atomically decreases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ * - `spender` must have allowance for the caller of at least
+ * `subtractedValue`.
+ */
+ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero"));
+ return true;
+ }
+
+ /**
+ * @dev Moves tokens `amount` from `sender` to `recipient`.
+ *
+ * This is internal function is equivalent to {transfer}, and can be used to
+ * e.g. implement automatic token fees, slashing mechanisms, etc.
+ *
+ * Emits a {Transfer} event.
+ *
+ * Requirements:
+ *
+ * - `sender` cannot be the zero address.
+ * - `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ */
+ function _transfer(address sender, address recipient, uint256 amount) internal {
+ require(sender != address(0), "BEP20: transfer from the zero address");
+ require(recipient != address(0), "BEP20: transfer to the zero address");
+
+ _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
+ _balances[recipient] = _balances[recipient].add(amount);
+ emit Transfer(sender, recipient, amount);
+ }
+
+ /** @dev Creates `amount` tokens and assigns them to `account`, increasing
+ * the total supply.
+ *
+ * Emits a {Transfer} event with `from` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `to` cannot be the zero address.
+ */
+ function _mint(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: mint to the zero address");
+
+ _totalSupply = _totalSupply.add(amount);
+ _balances[account] = _balances[account].add(amount);
+ emit Transfer(address(0), account, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`, reducing the
+ * total supply.
+ *
+ * Emits a {Transfer} event with `to` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `account` cannot be the zero address.
+ * - `account` must have at least `amount` tokens.
+ */
+ function _burn(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: burn from the zero address");
+
+ _balances[account] = _balances[account].sub(amount, "BEP20: burn amount exceeds balance");
+ _totalSupply = _totalSupply.sub(amount);
+ emit Transfer(account, address(0), amount);
+ }
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
+ *
+ * This is internal function is equivalent to `approve`, and can be used to
+ * e.g. set automatic allowances for certain subsystems, etc.
+ *
+ * Emits an {Approval} event.
+ *
+ * Requirements:
+ *
+ * - `owner` cannot be the zero address.
+ * - `spender` cannot be the zero address.
+ */
+ function _approve(address owner, address spender, uint256 amount) internal {
+ require(owner != address(0), "BEP20: approve from the zero address");
+ require(spender != address(0), "BEP20: approve to the zero address");
+
+ _allowances[owner][spender] = amount;
+ emit Approval(owner, spender, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`.`amount` is then deducted
+ * from the caller's allowance.
+ *
+ * See {_burn} and {_approve}.
+ */
+ function _burnFrom(address account, uint256 amount) internal {
+ _burn(account, amount);
+ _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance"));
+ }
+}
diff --git a/contracts/test/ERC20DEF.sol b/contracts/test/ERC20DEF.sol
new file mode 100644
index 0000000..66e63be
--- /dev/null
+++ b/contracts/test/ERC20DEF.sol
@@ -0,0 +1,598 @@
+
+// File: contracts/interface/IBEP20.sol
+
+pragma solidity 0.6.4;
+
+interface IBEP20 {
+ /**
+ * @dev Returns the amount of tokens in existence.
+ */
+ function totalSupply() external view returns (uint256);
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external view returns (uint8);
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external view returns (string memory);
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external view returns (string memory);
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external view returns (address);
+
+ /**
+ * @dev Returns the amount of tokens owned by `account`.
+ */
+ function balanceOf(address account) external view returns (uint256);
+
+ /**
+ * @dev Moves `amount` tokens from the caller's account to `recipient`.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transfer(address recipient, uint256 amount) external ;
+
+ /**
+ * @dev Returns the remaining number of tokens that `spender` will be
+ * allowed to spend on behalf of `owner` through {transferFrom}. This is
+ * zero by default.
+ *
+ * This value changes when {approve} or {transferFrom} are called.
+ */
+ function allowance(address _owner, address spender) external view returns (uint256);
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * IMPORTANT: Beware that changing an allowance with this method brings the risk
+ * that someone may use both the old and the new allowance by unfortunate
+ * transaction ordering. One possible solution to mitigate this race
+ * condition is to first reduce the spender's allowance to 0 and set the
+ * desired value afterwards:
+ * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+ *
+ * Emits an {Approval} event.
+ */
+ function approve(address spender, uint256 amount) external returns (bool);
+
+ /**
+ * @dev Moves `amount` tokens from `sender` to `recipient` using the
+ * allowance mechanism. `amount` is then deducted from the caller's
+ * allowance.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external;
+
+ /**
+ * @dev Emitted when `value` tokens are moved from one account (`from`) to
+ * another (`to`).
+ *
+ * Note that `value` may be zero.
+ */
+ event Transfer(address indexed from, address indexed to, uint256 value);
+
+ /**
+ * @dev Emitted when the allowance of a `spender` for an `owner` is set by
+ * a call to {approve}. `value` is the new allowance.
+ */
+ event Approval(address indexed owner, address indexed spender, uint256 value);
+}
+
+// File: openzeppelin-solidity/contracts/GSN/Context.sol
+
+pragma solidity ^0.6.0;
+
+/*
+ * @dev Provides information about the current execution context, including the
+ * sender of the transaction and its data. While these are generally available
+ * via msg.sender and msg.data, they should not be accessed in such a direct
+ * manner, since when dealing with GSN meta-transactions the account sending and
+ * paying for execution may not be the actual sender (as far as an application
+ * is concerned).
+ *
+ * This contract is only required for intermediate, library-like contracts.
+ */
+contract Context {
+ // Empty internal constructor, to prevent people from mistakenly deploying
+ // an instance of this contract, which should be used via inheritance.
+ constructor () internal { }
+
+ function _msgSender() internal view virtual returns (address payable) {
+ return msg.sender;
+ }
+
+ function _msgData() internal view virtual returns (bytes memory) {
+ this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
+ return msg.data;
+ }
+}
+
+// File: openzeppelin-solidity/contracts/math/SafeMath.sol
+
+pragma solidity ^0.6.0;
+
+/**
+ * @dev Wrappers over Solidity's arithmetic operations with added overflow
+ * checks.
+ *
+ * Arithmetic operations in Solidity wrap on overflow. This can easily result
+ * in bugs, because programmers usually assume that an overflow raises an
+ * error, which is the standard behavior in high level programming languages.
+ * `SafeMath` restores this intuition by reverting the transaction when an
+ * operation overflows.
+ *
+ * Using this library instead of the unchecked operations eliminates an entire
+ * class of bugs, so it's recommended to use it always.
+ */
+library SafeMath {
+ /**
+ * @dev Returns the addition of two unsigned integers, reverting on
+ * overflow.
+ *
+ * Counterpart to Solidity's `+` operator.
+ *
+ * Requirements:
+ * - Addition cannot overflow.
+ */
+ function add(uint256 a, uint256 b) internal pure returns (uint256) {
+ uint256 c = a + b;
+ require(c >= a, "SafeMath: addition overflow");
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the subtraction of two unsigned integers, reverting on
+ * overflow (when the result is negative).
+ *
+ * Counterpart to Solidity's `-` operator.
+ *
+ * Requirements:
+ * - Subtraction cannot overflow.
+ */
+ function sub(uint256 a, uint256 b) internal pure returns (uint256) {
+ return sub(a, b, "SafeMath: subtraction overflow");
+ }
+
+ /**
+ * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
+ * overflow (when the result is negative).
+ *
+ * Counterpart to Solidity's `-` operator.
+ *
+ * Requirements:
+ * - Subtraction cannot overflow.
+ */
+ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ require(b <= a, errorMessage);
+ uint256 c = a - b;
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the multiplication of two unsigned integers, reverting on
+ * overflow.
+ *
+ * Counterpart to Solidity's `*` operator.
+ *
+ * Requirements:
+ * - Multiplication cannot overflow.
+ */
+ function mul(uint256 a, uint256 b) internal pure returns (uint256) {
+ // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
+ // benefit is lost if 'b' is also tested.
+ // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
+ if (a == 0) {
+ return 0;
+ }
+
+ uint256 c = a * b;
+ require(c / a == b, "SafeMath: multiplication overflow");
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the integer division of two unsigned integers. Reverts on
+ * division by zero. The result is rounded towards zero.
+ *
+ * Counterpart to Solidity's `/` operator. Note: this function uses a
+ * `revert` opcode (which leaves remaining gas untouched) while Solidity
+ * uses an invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function div(uint256 a, uint256 b) internal pure returns (uint256) {
+ return div(a, b, "SafeMath: division by zero");
+ }
+
+ /**
+ * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
+ * division by zero. The result is rounded towards zero.
+ *
+ * Counterpart to Solidity's `/` operator. Note: this function uses a
+ * `revert` opcode (which leaves remaining gas untouched) while Solidity
+ * uses an invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ // Solidity only automatically asserts when dividing by 0
+ require(b > 0, errorMessage);
+ uint256 c = a / b;
+ // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+ * Reverts when dividing by zero.
+ *
+ * Counterpart to Solidity's `%` operator. This function uses a `revert`
+ * opcode (which leaves remaining gas untouched) while Solidity uses an
+ * invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function mod(uint256 a, uint256 b) internal pure returns (uint256) {
+ return mod(a, b, "SafeMath: modulo by zero");
+ }
+
+ /**
+ * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+ * Reverts with custom message when dividing by zero.
+ *
+ * Counterpart to Solidity's `%` operator. This function uses a `revert`
+ * opcode (which leaves remaining gas untouched) while Solidity uses an
+ * invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ require(b != 0, errorMessage);
+ return a % b;
+ }
+}
+
+// File: openzeppelin-solidity/contracts/access/Ownable.sol
+
+pragma solidity ^0.6.0;
+
+/**
+ * @dev Contract module which provides a basic access control mechanism, where
+ * there is an account (an owner) that can be granted exclusive access to
+ * specific functions.
+ *
+ * By default, the owner account will be the one that deploys the contract. This
+ * can later be changed with {transferOwnership}.
+ *
+ * This module is used through inheritance. It will make available the modifier
+ * `onlyOwner`, which can be applied to your functions to restrict their use to
+ * the owner.
+ */
+contract Ownable is Context {
+ address private _owner;
+
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
+
+ /**
+ * @dev Initializes the contract setting the deployer as the initial owner.
+ */
+ constructor () internal {
+ address msgSender = _msgSender();
+ _owner = msgSender;
+ emit OwnershipTransferred(address(0), msgSender);
+ }
+
+ /**
+ * @dev Returns the address of the current owner.
+ */
+ function owner() public view returns (address) {
+ return _owner;
+ }
+
+ /**
+ * @dev Throws if called by any account other than the owner.
+ */
+ modifier onlyOwner() {
+ require(_owner == _msgSender(), "Ownable: caller is not the owner");
+ _;
+ }
+
+ /**
+ * @dev Leaves the contract without owner. It will not be possible to call
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
+ *
+ * NOTE: Renouncing ownership will leave the contract without an owner,
+ * thereby removing any functionality that is only available to the owner.
+ */
+ function renounceOwnership() public virtual onlyOwner {
+ emit OwnershipTransferred(_owner, address(0));
+ _owner = address(0);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ * Can only be called by the current owner.
+ */
+ function transferOwnership(address newOwner) public virtual onlyOwner {
+ _transferOwnership(newOwner);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ */
+ function _transferOwnership(address newOwner) internal virtual {
+ require(newOwner != address(0), "Ownable: new owner is the zero address");
+ emit OwnershipTransferred(_owner, newOwner);
+ _owner = newOwner;
+ }
+}
+
+// File: contracts/test/ABCToken.sol
+
+pragma solidity 0.6.4;
+
+
+
+contract ERC20DEF is Context, IBEP20, Ownable {
+ using SafeMath for uint256;
+
+ mapping (address => uint256) private _balances;
+
+ mapping (address => mapping (address => uint256)) private _allowances;
+
+ uint256 private _totalSupply;
+ uint8 public _decimals;
+ string public _symbol;
+ string public _name;
+
+ constructor() public {
+ _name = "ABC token";
+ _symbol = "ABC";
+ _decimals = 18;
+ _totalSupply = 100000000000000000000000000;
+ _balances[msg.sender] = _totalSupply;
+
+ emit Transfer(address(0), msg.sender, _totalSupply);
+ }
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external override view returns (address) {
+ return owner();
+ }
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external override view returns (uint8) {
+ return _decimals;
+ }
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external override view returns (string memory) {
+ return _symbol;
+ }
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external override view returns (string memory) {
+ return _name;
+ }
+
+ /**
+ * @dev See {BEP20-totalSupply}.
+ */
+ function totalSupply() external override view returns (uint256) {
+ return _totalSupply;
+ }
+
+ /**
+ * @dev See {BEP20-balanceOf}.
+ */
+ function balanceOf(address account) external override view returns (uint256) {
+ return _balances[account];
+ }
+
+ /**
+ * @dev See {BEP20-transfer}.
+ *
+ * Requirements:
+ *
+ * - `recipient` cannot be the zero address.
+ * - the caller must have a balance of at least `amount`.
+ */
+ function transfer(address recipient, uint256 amount) external override {
+ _transfer(_msgSender(), recipient, amount);
+ }
+
+ /**
+ * @dev See {BEP20-allowance}.
+ */
+ function allowance(address owner, address spender) external override view returns (uint256) {
+ return _allowances[owner][spender];
+ }
+
+ /**
+ * @dev See {BEP20-approve}.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function approve(address spender, uint256 amount) external override returns (bool) {
+ _approve(_msgSender(), spender, amount);
+ return true;
+ }
+
+ /**
+ * @dev See {BEP20-transferFrom}.
+ *
+ * Emits an {Approval} event indicating the updated allowance. This is not
+ * required by the EIP. See the note at the beginning of {BEP20};
+ *
+ * Requirements:
+ * - `sender` and `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ * - the caller must have allowance for `sender`'s tokens of at least
+ * `amount`.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external override {
+ _transfer(sender, recipient, amount);
+ _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance"));
+ }
+
+ /**
+ * @dev Atomically increases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
+ return true;
+ }
+
+ /**
+ * @dev Atomically decreases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ * - `spender` must have allowance for the caller of at least
+ * `subtractedValue`.
+ */
+ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero"));
+ return true;
+ }
+
+ /**
+ * @dev Moves tokens `amount` from `sender` to `recipient`.
+ *
+ * This is internal function is equivalent to {transfer}, and can be used to
+ * e.g. implement automatic token fees, slashing mechanisms, etc.
+ *
+ * Emits a {Transfer} event.
+ *
+ * Requirements:
+ *
+ * - `sender` cannot be the zero address.
+ * - `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ */
+ function _transfer(address sender, address recipient, uint256 amount) internal {
+ require(sender != address(0), "BEP20: transfer from the zero address");
+ require(recipient != address(0), "BEP20: transfer to the zero address");
+
+ _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
+ _balances[recipient] = _balances[recipient].add(amount);
+ emit Transfer(sender, recipient, amount);
+ }
+
+ /** @dev Creates `amount` tokens and assigns them to `account`, increasing
+ * the total supply.
+ *
+ * Emits a {Transfer} event with `from` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `to` cannot be the zero address.
+ */
+ function _mint(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: mint to the zero address");
+
+ _totalSupply = _totalSupply.add(amount);
+ _balances[account] = _balances[account].add(amount);
+ emit Transfer(address(0), account, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`, reducing the
+ * total supply.
+ *
+ * Emits a {Transfer} event with `to` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `account` cannot be the zero address.
+ * - `account` must have at least `amount` tokens.
+ */
+ function _burn(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: burn from the zero address");
+
+ _balances[account] = _balances[account].sub(amount, "BEP20: burn amount exceeds balance");
+ _totalSupply = _totalSupply.sub(amount);
+ emit Transfer(account, address(0), amount);
+ }
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
+ *
+ * This is internal function is equivalent to `approve`, and can be used to
+ * e.g. set automatic allowances for certain subsystems, etc.
+ *
+ * Emits an {Approval} event.
+ *
+ * Requirements:
+ *
+ * - `owner` cannot be the zero address.
+ * - `spender` cannot be the zero address.
+ */
+ function _approve(address owner, address spender, uint256 amount) internal {
+ require(owner != address(0), "BEP20: approve from the zero address");
+ require(spender != address(0), "BEP20: approve to the zero address");
+
+ _allowances[owner][spender] = amount;
+ emit Approval(owner, spender, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`.`amount` is then deducted
+ * from the caller's allowance.
+ *
+ * See {_burn} and {_approve}.
+ */
+ function _burnFrom(address account, uint256 amount) internal {
+ _burn(account, amount);
+ _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance"));
+ }
+}
diff --git a/contracts/test/ERC20EMPTYNAME.sol b/contracts/test/ERC20EMPTYNAME.sol
new file mode 100644
index 0000000..09fd850
--- /dev/null
+++ b/contracts/test/ERC20EMPTYNAME.sol
@@ -0,0 +1,598 @@
+
+// File: contracts/interface/IBEP20.sol
+
+pragma solidity 0.6.4;
+
+interface IBEP20 {
+ /**
+ * @dev Returns the amount of tokens in existence.
+ */
+ function totalSupply() external view returns (uint256);
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external view returns (uint8);
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external view returns (string memory);
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external view returns (string memory);
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external view returns (address);
+
+ /**
+ * @dev Returns the amount of tokens owned by `account`.
+ */
+ function balanceOf(address account) external view returns (uint256);
+
+ /**
+ * @dev Moves `amount` tokens from the caller's account to `recipient`.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transfer(address recipient, uint256 amount) external ;
+
+ /**
+ * @dev Returns the remaining number of tokens that `spender` will be
+ * allowed to spend on behalf of `owner` through {transferFrom}. This is
+ * zero by default.
+ *
+ * This value changes when {approve} or {transferFrom} are called.
+ */
+ function allowance(address _owner, address spender) external view returns (uint256);
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * IMPORTANT: Beware that changing an allowance with this method brings the risk
+ * that someone may use both the old and the new allowance by unfortunate
+ * transaction ordering. One possible solution to mitigate this race
+ * condition is to first reduce the spender's allowance to 0 and set the
+ * desired value afterwards:
+ * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+ *
+ * Emits an {Approval} event.
+ */
+ function approve(address spender, uint256 amount) external returns (bool);
+
+ /**
+ * @dev Moves `amount` tokens from `sender` to `recipient` using the
+ * allowance mechanism. `amount` is then deducted from the caller's
+ * allowance.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external;
+
+ /**
+ * @dev Emitted when `value` tokens are moved from one account (`from`) to
+ * another (`to`).
+ *
+ * Note that `value` may be zero.
+ */
+ event Transfer(address indexed from, address indexed to, uint256 value);
+
+ /**
+ * @dev Emitted when the allowance of a `spender` for an `owner` is set by
+ * a call to {approve}. `value` is the new allowance.
+ */
+ event Approval(address indexed owner, address indexed spender, uint256 value);
+}
+
+// File: openzeppelin-solidity/contracts/GSN/Context.sol
+
+pragma solidity ^0.6.0;
+
+/*
+ * @dev Provides information about the current execution context, including the
+ * sender of the transaction and its data. While these are generally available
+ * via msg.sender and msg.data, they should not be accessed in such a direct
+ * manner, since when dealing with GSN meta-transactions the account sending and
+ * paying for execution may not be the actual sender (as far as an application
+ * is concerned).
+ *
+ * This contract is only required for intermediate, library-like contracts.
+ */
+contract Context {
+ // Empty internal constructor, to prevent people from mistakenly deploying
+ // an instance of this contract, which should be used via inheritance.
+ constructor () internal { }
+
+ function _msgSender() internal view virtual returns (address payable) {
+ return msg.sender;
+ }
+
+ function _msgData() internal view virtual returns (bytes memory) {
+ this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
+ return msg.data;
+ }
+}
+
+// File: openzeppelin-solidity/contracts/math/SafeMath.sol
+
+pragma solidity ^0.6.0;
+
+/**
+ * @dev Wrappers over Solidity's arithmetic operations with added overflow
+ * checks.
+ *
+ * Arithmetic operations in Solidity wrap on overflow. This can easily result
+ * in bugs, because programmers usually assume that an overflow raises an
+ * error, which is the standard behavior in high level programming languages.
+ * `SafeMath` restores this intuition by reverting the transaction when an
+ * operation overflows.
+ *
+ * Using this library instead of the unchecked operations eliminates an entire
+ * class of bugs, so it's recommended to use it always.
+ */
+library SafeMath {
+ /**
+ * @dev Returns the addition of two unsigned integers, reverting on
+ * overflow.
+ *
+ * Counterpart to Solidity's `+` operator.
+ *
+ * Requirements:
+ * - Addition cannot overflow.
+ */
+ function add(uint256 a, uint256 b) internal pure returns (uint256) {
+ uint256 c = a + b;
+ require(c >= a, "SafeMath: addition overflow");
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the subtraction of two unsigned integers, reverting on
+ * overflow (when the result is negative).
+ *
+ * Counterpart to Solidity's `-` operator.
+ *
+ * Requirements:
+ * - Subtraction cannot overflow.
+ */
+ function sub(uint256 a, uint256 b) internal pure returns (uint256) {
+ return sub(a, b, "SafeMath: subtraction overflow");
+ }
+
+ /**
+ * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
+ * overflow (when the result is negative).
+ *
+ * Counterpart to Solidity's `-` operator.
+ *
+ * Requirements:
+ * - Subtraction cannot overflow.
+ */
+ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ require(b <= a, errorMessage);
+ uint256 c = a - b;
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the multiplication of two unsigned integers, reverting on
+ * overflow.
+ *
+ * Counterpart to Solidity's `*` operator.
+ *
+ * Requirements:
+ * - Multiplication cannot overflow.
+ */
+ function mul(uint256 a, uint256 b) internal pure returns (uint256) {
+ // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
+ // benefit is lost if 'b' is also tested.
+ // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
+ if (a == 0) {
+ return 0;
+ }
+
+ uint256 c = a * b;
+ require(c / a == b, "SafeMath: multiplication overflow");
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the integer division of two unsigned integers. Reverts on
+ * division by zero. The result is rounded towards zero.
+ *
+ * Counterpart to Solidity's `/` operator. Note: this function uses a
+ * `revert` opcode (which leaves remaining gas untouched) while Solidity
+ * uses an invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function div(uint256 a, uint256 b) internal pure returns (uint256) {
+ return div(a, b, "SafeMath: division by zero");
+ }
+
+ /**
+ * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
+ * division by zero. The result is rounded towards zero.
+ *
+ * Counterpart to Solidity's `/` operator. Note: this function uses a
+ * `revert` opcode (which leaves remaining gas untouched) while Solidity
+ * uses an invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ // Solidity only automatically asserts when dividing by 0
+ require(b > 0, errorMessage);
+ uint256 c = a / b;
+ // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+ * Reverts when dividing by zero.
+ *
+ * Counterpart to Solidity's `%` operator. This function uses a `revert`
+ * opcode (which leaves remaining gas untouched) while Solidity uses an
+ * invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function mod(uint256 a, uint256 b) internal pure returns (uint256) {
+ return mod(a, b, "SafeMath: modulo by zero");
+ }
+
+ /**
+ * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+ * Reverts with custom message when dividing by zero.
+ *
+ * Counterpart to Solidity's `%` operator. This function uses a `revert`
+ * opcode (which leaves remaining gas untouched) while Solidity uses an
+ * invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ require(b != 0, errorMessage);
+ return a % b;
+ }
+}
+
+// File: openzeppelin-solidity/contracts/access/Ownable.sol
+
+pragma solidity ^0.6.0;
+
+/**
+ * @dev Contract module which provides a basic access control mechanism, where
+ * there is an account (an owner) that can be granted exclusive access to
+ * specific functions.
+ *
+ * By default, the owner account will be the one that deploys the contract. This
+ * can later be changed with {transferOwnership}.
+ *
+ * This module is used through inheritance. It will make available the modifier
+ * `onlyOwner`, which can be applied to your functions to restrict their use to
+ * the owner.
+ */
+contract Ownable is Context {
+ address private _owner;
+
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
+
+ /**
+ * @dev Initializes the contract setting the deployer as the initial owner.
+ */
+ constructor () internal {
+ address msgSender = _msgSender();
+ _owner = msgSender;
+ emit OwnershipTransferred(address(0), msgSender);
+ }
+
+ /**
+ * @dev Returns the address of the current owner.
+ */
+ function owner() public view returns (address) {
+ return _owner;
+ }
+
+ /**
+ * @dev Throws if called by any account other than the owner.
+ */
+ modifier onlyOwner() {
+ require(_owner == _msgSender(), "Ownable: caller is not the owner");
+ _;
+ }
+
+ /**
+ * @dev Leaves the contract without owner. It will not be possible to call
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
+ *
+ * NOTE: Renouncing ownership will leave the contract without an owner,
+ * thereby removing any functionality that is only available to the owner.
+ */
+ function renounceOwnership() public virtual onlyOwner {
+ emit OwnershipTransferred(_owner, address(0));
+ _owner = address(0);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ * Can only be called by the current owner.
+ */
+ function transferOwnership(address newOwner) public virtual onlyOwner {
+ _transferOwnership(newOwner);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ */
+ function _transferOwnership(address newOwner) internal virtual {
+ require(newOwner != address(0), "Ownable: new owner is the zero address");
+ emit OwnershipTransferred(_owner, newOwner);
+ _owner = newOwner;
+ }
+}
+
+// File: contracts/test/ABCToken.sol
+
+pragma solidity 0.6.4;
+
+
+
+contract ERC20EMPTYNAME is Context, IBEP20, Ownable {
+ using SafeMath for uint256;
+
+ mapping (address => uint256) private _balances;
+
+ mapping (address => mapping (address => uint256)) private _allowances;
+
+ uint256 private _totalSupply;
+ uint8 public _decimals;
+ string public _symbol;
+ string public _name;
+
+ constructor() public {
+ _name = "";
+ _symbol = "";
+ _decimals = 18;
+ _totalSupply = 100000000000000000000000000;
+ _balances[msg.sender] = _totalSupply;
+
+ emit Transfer(address(0), msg.sender, _totalSupply);
+ }
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external override view returns (address) {
+ return owner();
+ }
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external override view returns (uint8) {
+ return _decimals;
+ }
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external override view returns (string memory) {
+ return _symbol;
+ }
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external override view returns (string memory) {
+ return _name;
+ }
+
+ /**
+ * @dev See {BEP20-totalSupply}.
+ */
+ function totalSupply() external override view returns (uint256) {
+ return _totalSupply;
+ }
+
+ /**
+ * @dev See {BEP20-balanceOf}.
+ */
+ function balanceOf(address account) external override view returns (uint256) {
+ return _balances[account];
+ }
+
+ /**
+ * @dev See {BEP20-transfer}.
+ *
+ * Requirements:
+ *
+ * - `recipient` cannot be the zero address.
+ * - the caller must have a balance of at least `amount`.
+ */
+ function transfer(address recipient, uint256 amount) external override {
+ _transfer(_msgSender(), recipient, amount);
+ }
+
+ /**
+ * @dev See {BEP20-allowance}.
+ */
+ function allowance(address owner, address spender) external override view returns (uint256) {
+ return _allowances[owner][spender];
+ }
+
+ /**
+ * @dev See {BEP20-approve}.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function approve(address spender, uint256 amount) external override returns (bool) {
+ _approve(_msgSender(), spender, amount);
+ return true;
+ }
+
+ /**
+ * @dev See {BEP20-transferFrom}.
+ *
+ * Emits an {Approval} event indicating the updated allowance. This is not
+ * required by the EIP. See the note at the beginning of {BEP20};
+ *
+ * Requirements:
+ * - `sender` and `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ * - the caller must have allowance for `sender`'s tokens of at least
+ * `amount`.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external override {
+ _transfer(sender, recipient, amount);
+ _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance"));
+ }
+
+ /**
+ * @dev Atomically increases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
+ return true;
+ }
+
+ /**
+ * @dev Atomically decreases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ * - `spender` must have allowance for the caller of at least
+ * `subtractedValue`.
+ */
+ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero"));
+ return true;
+ }
+
+ /**
+ * @dev Moves tokens `amount` from `sender` to `recipient`.
+ *
+ * This is internal function is equivalent to {transfer}, and can be used to
+ * e.g. implement automatic token fees, slashing mechanisms, etc.
+ *
+ * Emits a {Transfer} event.
+ *
+ * Requirements:
+ *
+ * - `sender` cannot be the zero address.
+ * - `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ */
+ function _transfer(address sender, address recipient, uint256 amount) internal {
+ require(sender != address(0), "BEP20: transfer from the zero address");
+ require(recipient != address(0), "BEP20: transfer to the zero address");
+
+ _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
+ _balances[recipient] = _balances[recipient].add(amount);
+ emit Transfer(sender, recipient, amount);
+ }
+
+ /** @dev Creates `amount` tokens and assigns them to `account`, increasing
+ * the total supply.
+ *
+ * Emits a {Transfer} event with `from` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `to` cannot be the zero address.
+ */
+ function _mint(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: mint to the zero address");
+
+ _totalSupply = _totalSupply.add(amount);
+ _balances[account] = _balances[account].add(amount);
+ emit Transfer(address(0), account, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`, reducing the
+ * total supply.
+ *
+ * Emits a {Transfer} event with `to` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `account` cannot be the zero address.
+ * - `account` must have at least `amount` tokens.
+ */
+ function _burn(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: burn from the zero address");
+
+ _balances[account] = _balances[account].sub(amount, "BEP20: burn amount exceeds balance");
+ _totalSupply = _totalSupply.sub(amount);
+ emit Transfer(account, address(0), amount);
+ }
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
+ *
+ * This is internal function is equivalent to `approve`, and can be used to
+ * e.g. set automatic allowances for certain subsystems, etc.
+ *
+ * Emits an {Approval} event.
+ *
+ * Requirements:
+ *
+ * - `owner` cannot be the zero address.
+ * - `spender` cannot be the zero address.
+ */
+ function _approve(address owner, address spender, uint256 amount) internal {
+ require(owner != address(0), "BEP20: approve from the zero address");
+ require(spender != address(0), "BEP20: approve to the zero address");
+
+ _allowances[owner][spender] = amount;
+ emit Approval(owner, spender, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`.`amount` is then deducted
+ * from the caller's allowance.
+ *
+ * See {_burn} and {_approve}.
+ */
+ function _burnFrom(address account, uint256 amount) internal {
+ _burn(account, amount);
+ _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance"));
+ }
+}
diff --git a/contracts/test/ERC20EMPTYSYMBOL.sol b/contracts/test/ERC20EMPTYSYMBOL.sol
new file mode 100644
index 0000000..620228f
--- /dev/null
+++ b/contracts/test/ERC20EMPTYSYMBOL.sol
@@ -0,0 +1,598 @@
+
+// File: contracts/interface/IBEP20.sol
+
+pragma solidity 0.6.4;
+
+interface IBEP20 {
+ /**
+ * @dev Returns the amount of tokens in existence.
+ */
+ function totalSupply() external view returns (uint256);
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external view returns (uint8);
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external view returns (string memory);
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external view returns (string memory);
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external view returns (address);
+
+ /**
+ * @dev Returns the amount of tokens owned by `account`.
+ */
+ function balanceOf(address account) external view returns (uint256);
+
+ /**
+ * @dev Moves `amount` tokens from the caller's account to `recipient`.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transfer(address recipient, uint256 amount) external ;
+
+ /**
+ * @dev Returns the remaining number of tokens that `spender` will be
+ * allowed to spend on behalf of `owner` through {transferFrom}. This is
+ * zero by default.
+ *
+ * This value changes when {approve} or {transferFrom} are called.
+ */
+ function allowance(address _owner, address spender) external view returns (uint256);
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * IMPORTANT: Beware that changing an allowance with this method brings the risk
+ * that someone may use both the old and the new allowance by unfortunate
+ * transaction ordering. One possible solution to mitigate this race
+ * condition is to first reduce the spender's allowance to 0 and set the
+ * desired value afterwards:
+ * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+ *
+ * Emits an {Approval} event.
+ */
+ function approve(address spender, uint256 amount) external returns (bool);
+
+ /**
+ * @dev Moves `amount` tokens from `sender` to `recipient` using the
+ * allowance mechanism. `amount` is then deducted from the caller's
+ * allowance.
+ *
+ * Returns a boolean value indicating whether the operation succeeded.
+ *
+ * Emits a {Transfer} event.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external;
+
+ /**
+ * @dev Emitted when `value` tokens are moved from one account (`from`) to
+ * another (`to`).
+ *
+ * Note that `value` may be zero.
+ */
+ event Transfer(address indexed from, address indexed to, uint256 value);
+
+ /**
+ * @dev Emitted when the allowance of a `spender` for an `owner` is set by
+ * a call to {approve}. `value` is the new allowance.
+ */
+ event Approval(address indexed owner, address indexed spender, uint256 value);
+}
+
+// File: openzeppelin-solidity/contracts/GSN/Context.sol
+
+pragma solidity ^0.6.0;
+
+/*
+ * @dev Provides information about the current execution context, including the
+ * sender of the transaction and its data. While these are generally available
+ * via msg.sender and msg.data, they should not be accessed in such a direct
+ * manner, since when dealing with GSN meta-transactions the account sending and
+ * paying for execution may not be the actual sender (as far as an application
+ * is concerned).
+ *
+ * This contract is only required for intermediate, library-like contracts.
+ */
+contract Context {
+ // Empty internal constructor, to prevent people from mistakenly deploying
+ // an instance of this contract, which should be used via inheritance.
+ constructor () internal { }
+
+ function _msgSender() internal view virtual returns (address payable) {
+ return msg.sender;
+ }
+
+ function _msgData() internal view virtual returns (bytes memory) {
+ this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
+ return msg.data;
+ }
+}
+
+// File: openzeppelin-solidity/contracts/math/SafeMath.sol
+
+pragma solidity ^0.6.0;
+
+/**
+ * @dev Wrappers over Solidity's arithmetic operations with added overflow
+ * checks.
+ *
+ * Arithmetic operations in Solidity wrap on overflow. This can easily result
+ * in bugs, because programmers usually assume that an overflow raises an
+ * error, which is the standard behavior in high level programming languages.
+ * `SafeMath` restores this intuition by reverting the transaction when an
+ * operation overflows.
+ *
+ * Using this library instead of the unchecked operations eliminates an entire
+ * class of bugs, so it's recommended to use it always.
+ */
+library SafeMath {
+ /**
+ * @dev Returns the addition of two unsigned integers, reverting on
+ * overflow.
+ *
+ * Counterpart to Solidity's `+` operator.
+ *
+ * Requirements:
+ * - Addition cannot overflow.
+ */
+ function add(uint256 a, uint256 b) internal pure returns (uint256) {
+ uint256 c = a + b;
+ require(c >= a, "SafeMath: addition overflow");
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the subtraction of two unsigned integers, reverting on
+ * overflow (when the result is negative).
+ *
+ * Counterpart to Solidity's `-` operator.
+ *
+ * Requirements:
+ * - Subtraction cannot overflow.
+ */
+ function sub(uint256 a, uint256 b) internal pure returns (uint256) {
+ return sub(a, b, "SafeMath: subtraction overflow");
+ }
+
+ /**
+ * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
+ * overflow (when the result is negative).
+ *
+ * Counterpart to Solidity's `-` operator.
+ *
+ * Requirements:
+ * - Subtraction cannot overflow.
+ */
+ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ require(b <= a, errorMessage);
+ uint256 c = a - b;
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the multiplication of two unsigned integers, reverting on
+ * overflow.
+ *
+ * Counterpart to Solidity's `*` operator.
+ *
+ * Requirements:
+ * - Multiplication cannot overflow.
+ */
+ function mul(uint256 a, uint256 b) internal pure returns (uint256) {
+ // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
+ // benefit is lost if 'b' is also tested.
+ // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
+ if (a == 0) {
+ return 0;
+ }
+
+ uint256 c = a * b;
+ require(c / a == b, "SafeMath: multiplication overflow");
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the integer division of two unsigned integers. Reverts on
+ * division by zero. The result is rounded towards zero.
+ *
+ * Counterpart to Solidity's `/` operator. Note: this function uses a
+ * `revert` opcode (which leaves remaining gas untouched) while Solidity
+ * uses an invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function div(uint256 a, uint256 b) internal pure returns (uint256) {
+ return div(a, b, "SafeMath: division by zero");
+ }
+
+ /**
+ * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
+ * division by zero. The result is rounded towards zero.
+ *
+ * Counterpart to Solidity's `/` operator. Note: this function uses a
+ * `revert` opcode (which leaves remaining gas untouched) while Solidity
+ * uses an invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ // Solidity only automatically asserts when dividing by 0
+ require(b > 0, errorMessage);
+ uint256 c = a / b;
+ // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+
+ return c;
+ }
+
+ /**
+ * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+ * Reverts when dividing by zero.
+ *
+ * Counterpart to Solidity's `%` operator. This function uses a `revert`
+ * opcode (which leaves remaining gas untouched) while Solidity uses an
+ * invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function mod(uint256 a, uint256 b) internal pure returns (uint256) {
+ return mod(a, b, "SafeMath: modulo by zero");
+ }
+
+ /**
+ * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+ * Reverts with custom message when dividing by zero.
+ *
+ * Counterpart to Solidity's `%` operator. This function uses a `revert`
+ * opcode (which leaves remaining gas untouched) while Solidity uses an
+ * invalid opcode to revert (consuming all remaining gas).
+ *
+ * Requirements:
+ * - The divisor cannot be zero.
+ */
+ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
+ require(b != 0, errorMessage);
+ return a % b;
+ }
+}
+
+// File: openzeppelin-solidity/contracts/access/Ownable.sol
+
+pragma solidity ^0.6.0;
+
+/**
+ * @dev Contract module which provides a basic access control mechanism, where
+ * there is an account (an owner) that can be granted exclusive access to
+ * specific functions.
+ *
+ * By default, the owner account will be the one that deploys the contract. This
+ * can later be changed with {transferOwnership}.
+ *
+ * This module is used through inheritance. It will make available the modifier
+ * `onlyOwner`, which can be applied to your functions to restrict their use to
+ * the owner.
+ */
+contract Ownable is Context {
+ address private _owner;
+
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
+
+ /**
+ * @dev Initializes the contract setting the deployer as the initial owner.
+ */
+ constructor () internal {
+ address msgSender = _msgSender();
+ _owner = msgSender;
+ emit OwnershipTransferred(address(0), msgSender);
+ }
+
+ /**
+ * @dev Returns the address of the current owner.
+ */
+ function owner() public view returns (address) {
+ return _owner;
+ }
+
+ /**
+ * @dev Throws if called by any account other than the owner.
+ */
+ modifier onlyOwner() {
+ require(_owner == _msgSender(), "Ownable: caller is not the owner");
+ _;
+ }
+
+ /**
+ * @dev Leaves the contract without owner. It will not be possible to call
+ * `onlyOwner` functions anymore. Can only be called by the current owner.
+ *
+ * NOTE: Renouncing ownership will leave the contract without an owner,
+ * thereby removing any functionality that is only available to the owner.
+ */
+ function renounceOwnership() public virtual onlyOwner {
+ emit OwnershipTransferred(_owner, address(0));
+ _owner = address(0);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ * Can only be called by the current owner.
+ */
+ function transferOwnership(address newOwner) public virtual onlyOwner {
+ _transferOwnership(newOwner);
+ }
+
+ /**
+ * @dev Transfers ownership of the contract to a new account (`newOwner`).
+ */
+ function _transferOwnership(address newOwner) internal virtual {
+ require(newOwner != address(0), "Ownable: new owner is the zero address");
+ emit OwnershipTransferred(_owner, newOwner);
+ _owner = newOwner;
+ }
+}
+
+// File: contracts/test/ABCToken.sol
+
+pragma solidity 0.6.4;
+
+
+
+contract ERC20EMPTYSYMBOL is Context, IBEP20, Ownable {
+ using SafeMath for uint256;
+
+ mapping (address => uint256) private _balances;
+
+ mapping (address => mapping (address => uint256)) private _allowances;
+
+ uint256 private _totalSupply;
+ uint8 public _decimals;
+ string public _symbol;
+ string public _name;
+
+ constructor() public {
+ _name = "ACD";
+ _symbol = "";
+ _decimals = 18;
+ _totalSupply = 100000000000000000000000000;
+ _balances[msg.sender] = _totalSupply;
+
+ emit Transfer(address(0), msg.sender, _totalSupply);
+ }
+
+ /**
+ * @dev Returns the bep token owner.
+ */
+ function getOwner() external override view returns (address) {
+ return owner();
+ }
+
+ /**
+ * @dev Returns the token decimals.
+ */
+ function decimals() external override view returns (uint8) {
+ return _decimals;
+ }
+
+ /**
+ * @dev Returns the token symbol.
+ */
+ function symbol() external override view returns (string memory) {
+ return _symbol;
+ }
+
+ /**
+ * @dev Returns the token name.
+ */
+ function name() external override view returns (string memory) {
+ return _name;
+ }
+
+ /**
+ * @dev See {BEP20-totalSupply}.
+ */
+ function totalSupply() external override view returns (uint256) {
+ return _totalSupply;
+ }
+
+ /**
+ * @dev See {BEP20-balanceOf}.
+ */
+ function balanceOf(address account) external override view returns (uint256) {
+ return _balances[account];
+ }
+
+ /**
+ * @dev See {BEP20-transfer}.
+ *
+ * Requirements:
+ *
+ * - `recipient` cannot be the zero address.
+ * - the caller must have a balance of at least `amount`.
+ */
+ function transfer(address recipient, uint256 amount) external override {
+ _transfer(_msgSender(), recipient, amount);
+ }
+
+ /**
+ * @dev See {BEP20-allowance}.
+ */
+ function allowance(address owner, address spender) external override view returns (uint256) {
+ return _allowances[owner][spender];
+ }
+
+ /**
+ * @dev See {BEP20-approve}.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function approve(address spender, uint256 amount) external override returns (bool) {
+ _approve(_msgSender(), spender, amount);
+ return true;
+ }
+
+ /**
+ * @dev See {BEP20-transferFrom}.
+ *
+ * Emits an {Approval} event indicating the updated allowance. This is not
+ * required by the EIP. See the note at the beginning of {BEP20};
+ *
+ * Requirements:
+ * - `sender` and `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ * - the caller must have allowance for `sender`'s tokens of at least
+ * `amount`.
+ */
+ function transferFrom(address sender, address recipient, uint256 amount) external override {
+ _transfer(sender, recipient, amount);
+ _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance"));
+ }
+
+ /**
+ * @dev Atomically increases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ */
+ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
+ return true;
+ }
+
+ /**
+ * @dev Atomically decreases the allowance granted to `spender` by the caller.
+ *
+ * This is an alternative to {approve} that can be used as a mitigation for
+ * problems described in {BEP20-approve}.
+ *
+ * Emits an {Approval} event indicating the updated allowance.
+ *
+ * Requirements:
+ *
+ * - `spender` cannot be the zero address.
+ * - `spender` must have allowance for the caller of at least
+ * `subtractedValue`.
+ */
+ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
+ _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero"));
+ return true;
+ }
+
+ /**
+ * @dev Moves tokens `amount` from `sender` to `recipient`.
+ *
+ * This is internal function is equivalent to {transfer}, and can be used to
+ * e.g. implement automatic token fees, slashing mechanisms, etc.
+ *
+ * Emits a {Transfer} event.
+ *
+ * Requirements:
+ *
+ * - `sender` cannot be the zero address.
+ * - `recipient` cannot be the zero address.
+ * - `sender` must have a balance of at least `amount`.
+ */
+ function _transfer(address sender, address recipient, uint256 amount) internal {
+ require(sender != address(0), "BEP20: transfer from the zero address");
+ require(recipient != address(0), "BEP20: transfer to the zero address");
+
+ _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
+ _balances[recipient] = _balances[recipient].add(amount);
+ emit Transfer(sender, recipient, amount);
+ }
+
+ /** @dev Creates `amount` tokens and assigns them to `account`, increasing
+ * the total supply.
+ *
+ * Emits a {Transfer} event with `from` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `to` cannot be the zero address.
+ */
+ function _mint(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: mint to the zero address");
+
+ _totalSupply = _totalSupply.add(amount);
+ _balances[account] = _balances[account].add(amount);
+ emit Transfer(address(0), account, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`, reducing the
+ * total supply.
+ *
+ * Emits a {Transfer} event with `to` set to the zero address.
+ *
+ * Requirements
+ *
+ * - `account` cannot be the zero address.
+ * - `account` must have at least `amount` tokens.
+ */
+ function _burn(address account, uint256 amount) internal {
+ require(account != address(0), "BEP20: burn from the zero address");
+
+ _balances[account] = _balances[account].sub(amount, "BEP20: burn amount exceeds balance");
+ _totalSupply = _totalSupply.sub(amount);
+ emit Transfer(account, address(0), amount);
+ }
+
+ /**
+ * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
+ *
+ * This is internal function is equivalent to `approve`, and can be used to
+ * e.g. set automatic allowances for certain subsystems, etc.
+ *
+ * Emits an {Approval} event.
+ *
+ * Requirements:
+ *
+ * - `owner` cannot be the zero address.
+ * - `spender` cannot be the zero address.
+ */
+ function _approve(address owner, address spender, uint256 amount) internal {
+ require(owner != address(0), "BEP20: approve from the zero address");
+ require(spender != address(0), "BEP20: approve to the zero address");
+
+ _allowances[owner][spender] = amount;
+ emit Approval(owner, spender, amount);
+ }
+
+ /**
+ * @dev Destroys `amount` tokens from `account`.`amount` is then deducted
+ * from the caller's allowance.
+ *
+ * See {_burn} and {_approve}.
+ */
+ function _burnFrom(address account, uint256 amount) internal {
+ _burn(account, amount);
+ _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance"));
+ }
+}
diff --git a/generate-bsc-swap-agent.js b/generate-bsc-swap-agent.js
new file mode 100644
index 0000000..948e7f8
--- /dev/null
+++ b/generate-bsc-swap-agent.js
@@ -0,0 +1,39 @@
+const program = require("commander");
+const fs = require("fs");
+const nunjucks = require("nunjucks");
+
+program.version("0.0.1");
+program.option(
+ "-t, --template ",
+ "bsc swap agent template file",
+ "./contracts/BSCSwapAgentImpl.template"
+);
+
+program.option(
+ "-o, --output ",
+ "BSCSwapAgentImpl.sol",
+ "./contracts/BSCSwapAgentImpl.sol"
+)
+
+program.option("--mock ",
+ "if use mock",
+ false
+);
+
+program.parse(process.argv);
+
+let data = {
+ mock: program.mock,
+};
+
+if (program.mock === "true") {
+ data = {
+ mock: program.mock,
+ };
+}
+
+
+const templateString = fs.readFileSync(program.template).toString();
+const resultString = nunjucks.renderString(templateString, data);
+fs.writeFileSync(program.output, resultString);
+console.log("BSCSwapAgent file updated.");
diff --git a/generate-eth-swap-agent.js b/generate-eth-swap-agent.js
new file mode 100644
index 0000000..c1781c7
--- /dev/null
+++ b/generate-eth-swap-agent.js
@@ -0,0 +1,38 @@
+const program = require("commander");
+const fs = require("fs");
+const nunjucks = require("nunjucks");
+
+program.version("0.0.1");
+program.option(
+ "-t, --template ",
+ "eth swap agent template file",
+ "./contracts/ETHSwapAgentImpl.template"
+);
+
+program.option(
+ "-o, --output ",
+ "ETHSwapAgentImpl.sol",
+ "./contracts/ETHSwapAgentImpl.sol"
+)
+
+program.option("--mock ",
+ "if use mock",
+ false
+);
+
+program.parse(process.argv);
+
+let data = {
+ // mock: program.mock,
+};
+
+if (program.mock === "true") {
+ data = {
+ mock: program.mock,
+ };
+}
+
+const templateString = fs.readFileSync(program.template).toString();
+const resultString = nunjucks.renderString(templateString, data);
+fs.writeFileSync(program.output, resultString);
+console.log("ETHSwapAgent file updated.");
diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js
new file mode 100644
index 0000000..3d77784
--- /dev/null
+++ b/migrations/2_deploy_contracts.js
@@ -0,0 +1,27 @@
+const BEP20TokenImplementation = artifacts.require("BEP20TokenImplementation");
+const BSCSwapAgentImpl = artifacts.require("BSCSwapAgentImpl");
+const ETHSwapAgentImpl = artifacts.require("ETHSwapAgentImpl");
+
+const ERC20ABC = artifacts.require("ERC20ABC");
+const ERC20DEF = artifacts.require("ERC20DEF");
+const ERC20EMPTYSYMBOL = artifacts.require("ERC20EMPTYSYMBOL");
+const ERC20EMPTYNAME = artifacts.require("ERC20EMPTYNAME");
+
+const Web3 = require('web3');
+const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
+
+module.exports = function(deployer, network, accounts) {
+ owner = accounts[0];
+ proxyAdmin = accounts[1];
+ bep20ProxyAdmin = accounts[2];
+ deployer.then(async () => {
+ await deployer.deploy(ERC20ABC);
+ await deployer.deploy(ERC20DEF);
+ await deployer.deploy(ERC20EMPTYSYMBOL);
+ await deployer.deploy(ERC20EMPTYNAME);
+
+ await deployer.deploy(BEP20TokenImplementation);
+ await deployer.deploy(BSCSwapAgentImpl, BEP20TokenImplementation.address, "10000000000000000", bep20ProxyAdmin);
+ await deployer.deploy(ETHSwapAgentImpl, "10000000");
+ });
+};
diff --git a/package-lock.json b/package-lock.json
index aac6b8c..c86b1e3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4,10 +4,219 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
- "@openzeppelin/contracts": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-3.1.0.tgz",
- "integrity": "sha512-dVXDnUKxrAKLzPdCRkz+N8qsVkK1XxJ6kk3zuI6zaQmcKxN7CkizoDP7lXxcs/Mi2I0mxceTRjJBqlzFffLJrQ=="
+ "@ethersproject/abi": {
+ "version": "5.0.0-beta.153",
+ "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz",
+ "integrity": "sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg==",
+ "requires": {
+ "@ethersproject/address": ">=5.0.0-beta.128",
+ "@ethersproject/bignumber": ">=5.0.0-beta.130",
+ "@ethersproject/bytes": ">=5.0.0-beta.129",
+ "@ethersproject/constants": ">=5.0.0-beta.128",
+ "@ethersproject/hash": ">=5.0.0-beta.128",
+ "@ethersproject/keccak256": ">=5.0.0-beta.127",
+ "@ethersproject/logger": ">=5.0.0-beta.129",
+ "@ethersproject/properties": ">=5.0.0-beta.131",
+ "@ethersproject/strings": ">=5.0.0-beta.130"
+ }
+ },
+ "@ethersproject/abstract-provider": {
+ "version": "5.0.9",
+ "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.0.9.tgz",
+ "integrity": "sha512-X9fMkqpeu9ayC3JyBkeeZhn35P4xQkpGX/l+FrxDtEW9tybf/UWXSMi8bGThpPtfJ6q6U2LDetXSpSwK4TfYQQ==",
+ "requires": {
+ "@ethersproject/bignumber": "^5.0.13",
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/logger": "^5.0.8",
+ "@ethersproject/networks": "^5.0.7",
+ "@ethersproject/properties": "^5.0.7",
+ "@ethersproject/transactions": "^5.0.9",
+ "@ethersproject/web": "^5.0.12"
+ }
+ },
+ "@ethersproject/abstract-signer": {
+ "version": "5.0.12",
+ "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.0.12.tgz",
+ "integrity": "sha512-qt4jAEzQGPZ31My1gFGPzzJHJveYhVycW7RHkuX0W8fvMdg7wr0uvP7mQEptMVrb+jYwsVktCf6gBGwWDpFiTA==",
+ "requires": {
+ "@ethersproject/abstract-provider": "^5.0.8",
+ "@ethersproject/bignumber": "^5.0.13",
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/logger": "^5.0.8",
+ "@ethersproject/properties": "^5.0.7"
+ }
+ },
+ "@ethersproject/address": {
+ "version": "5.0.10",
+ "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.0.10.tgz",
+ "integrity": "sha512-70vqESmW5Srua1kMDIN6uVfdneZMaMyRYH4qPvkAXGkbicrCOsA9m01vIloA4wYiiF+HLEfL1ENKdn5jb9xiAw==",
+ "requires": {
+ "@ethersproject/bignumber": "^5.0.13",
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/keccak256": "^5.0.7",
+ "@ethersproject/logger": "^5.0.8",
+ "@ethersproject/rlp": "^5.0.7"
+ }
+ },
+ "@ethersproject/base64": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.0.8.tgz",
+ "integrity": "sha512-PNbpHOMgZpZ1skvQl119pV2YkCPXmZTxw+T92qX0z7zaMFPypXWTZBzim+hUceb//zx4DFjeGT4aSjZRTOYThg==",
+ "requires": {
+ "@ethersproject/bytes": "^5.0.9"
+ }
+ },
+ "@ethersproject/bignumber": {
+ "version": "5.0.14",
+ "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.0.14.tgz",
+ "integrity": "sha512-Q4TjMq9Gg3Xzj0aeJWqJgI3tdEiPiET7Y5OtNtjTAODZ2kp4y9jMNg97zVcvPedFvGROdpGDyCI77JDFodUzOw==",
+ "requires": {
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/logger": "^5.0.8",
+ "bn.js": "^4.4.0"
+ }
+ },
+ "@ethersproject/bytes": {
+ "version": "5.0.10",
+ "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.0.10.tgz",
+ "integrity": "sha512-vpu0v1LZ1j1s9kERQIMnVU69MyHEzUff7nqK9XuCU4vx+AM8n9lU2gj7jtJIvGSt9HzatK/6I6bWusI5nyuaTA==",
+ "requires": {
+ "@ethersproject/logger": "^5.0.8"
+ }
+ },
+ "@ethersproject/constants": {
+ "version": "5.0.9",
+ "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.0.9.tgz",
+ "integrity": "sha512-2uAKH89UcaJP/Sc+54u92BtJtZ4cPgcS1p0YbB1L3tlkavwNvth+kNCUplIB1Becqs7BOZr0B/3dMNjhJDy4Dg==",
+ "requires": {
+ "@ethersproject/bignumber": "^5.0.13"
+ }
+ },
+ "@ethersproject/hash": {
+ "version": "5.0.11",
+ "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.0.11.tgz",
+ "integrity": "sha512-H3KJ9fk33XWJ2djAW03IL7fg3DsDMYjO1XijiUb1hJ85vYfhvxu0OmsU7d3tg2Uv1H1kFSo8ghr3WFQ8c+NL3g==",
+ "requires": {
+ "@ethersproject/abstract-signer": "^5.0.10",
+ "@ethersproject/address": "^5.0.9",
+ "@ethersproject/bignumber": "^5.0.13",
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/keccak256": "^5.0.7",
+ "@ethersproject/logger": "^5.0.8",
+ "@ethersproject/properties": "^5.0.7",
+ "@ethersproject/strings": "^5.0.8"
+ }
+ },
+ "@ethersproject/keccak256": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.0.8.tgz",
+ "integrity": "sha512-zoGbwXcWWs9MX4NOAZ7N0hhgIRl4Q/IO/u9c/RHRY4WqDy3Ywm0OLamEV53QDwhjwn3YiiVwU1Ve5j7yJ0a/KQ==",
+ "requires": {
+ "@ethersproject/bytes": "^5.0.9",
+ "js-sha3": "0.5.7"
+ }
+ },
+ "@ethersproject/logger": {
+ "version": "5.0.9",
+ "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.0.9.tgz",
+ "integrity": "sha512-kV3Uamv3XOH99Xf3kpIG3ZkS7mBNYcLDM00JSDtNgNB4BihuyxpQzIZPRIDmRi+95Z/R1Bb0X2kUNHa/kJoVrw=="
+ },
+ "@ethersproject/networks": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.0.8.tgz",
+ "integrity": "sha512-PYpptlO2Tu5f/JEBI5hdlMds5k1DY1QwVbh3LKPb3un9dQA2bC51vd2/gRWAgSBpF3kkmZOj4FhD7ATLX4H+DA==",
+ "requires": {
+ "@ethersproject/logger": "^5.0.8"
+ }
+ },
+ "@ethersproject/properties": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.0.8.tgz",
+ "integrity": "sha512-zEnLMze2Eu2VDPj/05QwCwMKHh506gpT9PP9KPVd4dDB+5d6AcROUYVLoIIQgBYK7X/Gw0UJmG3oVtnxOQafAw==",
+ "requires": {
+ "@ethersproject/logger": "^5.0.8"
+ }
+ },
+ "@ethersproject/rlp": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.0.8.tgz",
+ "integrity": "sha512-E4wdFs8xRNJfzNHmnkC8w5fPeT4Wd1U2cust3YeT16/46iSkLT8nn8ilidC6KhR7hfuSZE4UqSPzyk76p7cdZg==",
+ "requires": {
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/logger": "^5.0.8"
+ }
+ },
+ "@ethersproject/signing-key": {
+ "version": "5.0.9",
+ "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.0.9.tgz",
+ "integrity": "sha512-AobnsEiLv+Z4a/NbbelwB/Lsnc+qxeNejXDlEwbo/nwjijvxLpwiNN+rjx/lQGel1QnQ/d+lEv7xezyUaXdKFQ==",
+ "requires": {
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/logger": "^5.0.8",
+ "@ethersproject/properties": "^5.0.7",
+ "elliptic": "6.5.3"
+ }
+ },
+ "@ethersproject/strings": {
+ "version": "5.0.9",
+ "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.0.9.tgz",
+ "integrity": "sha512-ogxBpcUpdO524CYs841MoJHgHxEPUy0bJFDS4Ezg8My+WYVMfVAOlZSLss0Rurbeeam8CpUVDzM4zUn09SU66Q==",
+ "requires": {
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/constants": "^5.0.8",
+ "@ethersproject/logger": "^5.0.8"
+ }
+ },
+ "@ethersproject/transactions": {
+ "version": "5.0.10",
+ "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.0.10.tgz",
+ "integrity": "sha512-Tqpp+vKYQyQdJQQk4M73tDzO7ODf2D42/sJOcKlDAAbdSni13v6a+31hUdo02qYXhVYwIs+ZjHnO4zKv5BNk8w==",
+ "requires": {
+ "@ethersproject/address": "^5.0.9",
+ "@ethersproject/bignumber": "^5.0.13",
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/constants": "^5.0.8",
+ "@ethersproject/keccak256": "^5.0.7",
+ "@ethersproject/logger": "^5.0.8",
+ "@ethersproject/properties": "^5.0.7",
+ "@ethersproject/rlp": "^5.0.7",
+ "@ethersproject/signing-key": "^5.0.8"
+ }
+ },
+ "@ethersproject/web": {
+ "version": "5.0.13",
+ "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.0.13.tgz",
+ "integrity": "sha512-G3x/Ns7pQm21ALnWLbdBI5XkW/jrsbXXffI9hKNPHqf59mTxHYtlNiSwxdoTSwCef3Hn7uvGZpaSgTyxs7IufQ==",
+ "requires": {
+ "@ethersproject/base64": "^5.0.7",
+ "@ethersproject/bytes": "^5.0.9",
+ "@ethersproject/logger": "^5.0.8",
+ "@ethersproject/properties": "^5.0.7",
+ "@ethersproject/strings": "^5.0.8"
+ }
+ },
+ "@nodelib/fs.scandir": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz",
+ "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==",
+ "requires": {
+ "@nodelib/fs.stat": "2.0.4",
+ "run-parallel": "^1.1.9"
+ }
+ },
+ "@nodelib/fs.stat": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz",
+ "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q=="
+ },
+ "@nodelib/fs.walk": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz",
+ "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==",
+ "requires": {
+ "@nodelib/fs.scandir": "2.1.4",
+ "fastq": "^1.6.0"
+ }
},
"@resolver-engine/core": {
"version": "0.2.1",
@@ -125,59 +334,932 @@
"defer-to-connect": "^1.0.1"
}
},
- "@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": "*"
- }
- },
- "@types/node": {
- "version": "14.6.4",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.4.tgz",
- "integrity": "sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ=="
- },
- "@types/pbkdf2": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz",
- "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==",
- "requires": {
- "@types/node": "*"
- }
- },
- "@types/secp256k1": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz",
- "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==",
- "requires": {
- "@types/node": "*"
- }
+ "@truffle/error": {
+ "version": "0.0.11",
+ "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.11.tgz",
+ "integrity": "sha512-ju6TucjlJkfYMmdraYY/IBJaFb+Sa+huhYtOoyOJ+G29KcgytUVnDzKGwC7Kgk6IsxQMm62Mc1E0GZzFbGGipw=="
},
- "@web3-js/scrypt-shim": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/@web3-js/scrypt-shim/-/scrypt-shim-0.1.0.tgz",
- "integrity": "sha512-ZtZeWCc/s0nMcdx/+rZwY1EcuRdemOK9ag21ty9UsHkFxsNb/AaoucUz0iPuyGe0Ku+PFuRmWZG7Z7462p9xPw==",
+ "@truffle/interface-adapter": {
+ "version": "0.4.18",
+ "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.18.tgz",
+ "integrity": "sha512-P9JVSYD/CX3V+NgTWu+Bf71sLh8pMwrCpbiYRB93pRw/1H3ZTvt5iDC2MVvVxCs8FkSiy4OZzQK/DJ8+hXAmYw==",
"requires": {
- "scryptsy": "^2.1.0",
- "semver": "^6.3.0"
+ "bn.js": "^4.11.8",
+ "ethers": "^4.0.32",
+ "source-map-support": "^0.5.19",
+ "web3": "1.2.9"
},
"dependencies": {
- "scryptsy": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz",
- "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w=="
+ "@types/node": {
+ "version": "10.17.51",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.51.tgz",
+ "integrity": "sha512-KANw+MkL626tq90l++hGelbl67irOJzGhUJk6a1Bt8QHOeh9tztJx+L0AqttraWKinmZn7Qi5lJZJzx45Gq0dg=="
},
- "semver": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
- "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
+ "bignumber.js": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz",
+ "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA=="
+ },
+ "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"
+ }
+ },
+ "fs-extra": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
+ "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "jsonfile": "^4.0.0",
+ "universalify": "^0.1.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"
+ }
+ },
+ "p-cancelable": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz",
+ "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw=="
+ },
+ "prepend-http": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
+ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw="
+ },
+ "swarm-js": {
+ "version": "0.1.40",
+ "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.40.tgz",
+ "integrity": "sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA==",
+ "requires": {
+ "bluebird": "^3.5.0",
+ "buffer": "^5.0.5",
+ "eth-lib": "^0.1.26",
+ "fs-extra": "^4.0.2",
+ "got": "^7.1.0",
+ "mime-types": "^2.1.16",
+ "mkdirp-promise": "^5.0.1",
+ "mock-fs": "^4.1.0",
+ "setimmediate": "^1.0.5",
+ "tar": "^4.0.2",
+ "xhr-request": "^1.0.1"
+ },
+ "dependencies": {
+ "got": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz",
+ "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==",
+ "requires": {
+ "decompress-response": "^3.2.0",
+ "duplexer3": "^0.1.4",
+ "get-stream": "^3.0.0",
+ "is-plain-obj": "^1.1.0",
+ "is-retry-allowed": "^1.0.0",
+ "is-stream": "^1.0.0",
+ "isurl": "^1.0.0-alpha5",
+ "lowercase-keys": "^1.0.0",
+ "p-cancelable": "^0.3.0",
+ "p-timeout": "^1.1.1",
+ "safe-buffer": "^5.0.1",
+ "timed-out": "^4.0.0",
+ "url-parse-lax": "^1.0.0",
+ "url-to-options": "^1.0.1"
+ }
+ }
+ }
+ },
+ "url-parse-lax": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz",
+ "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=",
+ "requires": {
+ "prepend-http": "^1.0.1"
+ }
+ },
+ "uuid": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
+ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
+ },
+ "web3": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.9.tgz",
+ "integrity": "sha512-Mo5aBRm0JrcNpN/g4VOrDzudymfOnHRC3s2VarhYxRA8aWgF5rnhQ0ziySaugpic1gksbXPe105pUWyRqw8HUA==",
+ "requires": {
+ "web3-bzz": "1.2.9",
+ "web3-core": "1.2.9",
+ "web3-eth": "1.2.9",
+ "web3-eth-personal": "1.2.9",
+ "web3-net": "1.2.9",
+ "web3-shh": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-bzz": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.9.tgz",
+ "integrity": "sha512-ogVQr9jHodu9HobARtvUSmWG22cv2EUQzlPeejGWZ7j5h20HX40EDuWyomGY5VclIj5DdLY76Tmq88RTf/6nxA==",
+ "requires": {
+ "@types/node": "^10.12.18",
+ "got": "9.6.0",
+ "swarm-js": "^0.1.40",
+ "underscore": "1.9.1"
+ }
+ },
+ "web3-core": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.9.tgz",
+ "integrity": "sha512-fSYv21IP658Ty2wAuU9iqmW7V+75DOYMVZsDH/c14jcF/1VXnedOcxzxSj3vArsCvXZNe6XC5/wAuGZyQwR9RA==",
+ "requires": {
+ "@types/bn.js": "^4.11.4",
+ "@types/node": "^12.6.1",
+ "bignumber.js": "^9.0.0",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-core-requestmanager": "1.2.9",
+ "web3-utils": "1.2.9"
+ },
+ "dependencies": {
+ "@types/node": {
+ "version": "12.19.16",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.16.tgz",
+ "integrity": "sha512-7xHmXm/QJ7cbK2laF+YYD7gb5MggHIIQwqyjin3bpEGiSuvScMQ5JZZXPvRipi1MwckTQbJZROMns/JxdnIL1Q=="
+ }
+ }
+ },
+ "web3-core-helpers": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.9.tgz",
+ "integrity": "sha512-t0WAG3orLCE3lqi77ZoSRNFok3VQWZXTniZigDQjyOJYMAX7BU3F3js8HKbjVnAxlX3tiKoDxI0KBk9F3AxYuw==",
+ "requires": {
+ "underscore": "1.9.1",
+ "web3-eth-iban": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-core-method": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.9.tgz",
+ "integrity": "sha512-bjsIoqP3gs7A/gP8+QeLUCyOKJ8bopteCSNbCX36Pxk6TYfYWNuC6hP+2GzUuqdP3xaZNe+XEElQFUNpR3oyAg==",
+ "requires": {
+ "@ethersproject/transactions": "^5.0.0-beta.135",
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-promievent": "1.2.9",
+ "web3-core-subscriptions": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-core-promievent": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.9.tgz",
+ "integrity": "sha512-0eAUA2zjgXTleSrnc1wdoKQPPIHU6KHf4fAscu4W9kKrR+mqP1KsjYrxY9wUyjNnXxfQ+5M29ipvbiaK8OqdOw==",
+ "requires": {
+ "eventemitter3": "3.1.2"
+ }
+ },
+ "web3-core-requestmanager": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.9.tgz",
+ "integrity": "sha512-1PwKV2m46ALUnIN5VPPgjOj8yMLJhhqZYvYJE34hTN5SErOkwhzx5zScvo5MN7v7KyQGFnpVCZKKGCiEnDmtFA==",
+ "requires": {
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9",
+ "web3-providers-http": "1.2.9",
+ "web3-providers-ipc": "1.2.9",
+ "web3-providers-ws": "1.2.9"
+ }
+ },
+ "web3-core-subscriptions": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.9.tgz",
+ "integrity": "sha512-Y48TvXPSPxEM33OmXjGVDMzTd0j8X0t2+sDw66haeBS8eYnrEzasWuBZZXDq0zNUsqyxItgBGDn+cszkgEnFqg==",
+ "requires": {
+ "eventemitter3": "3.1.2",
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9"
+ }
+ },
+ "web3-eth": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.9.tgz",
+ "integrity": "sha512-sIKO4iE9FEBa/CYUd6GdPd7GXt/wISqxUd8PlIld6+hvMJj02lgO7Z7p5T9mZIJcIZJGvZX81ogx8oJ9yif+Ag==",
+ "requires": {
+ "underscore": "1.9.1",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-core-subscriptions": "1.2.9",
+ "web3-eth-abi": "1.2.9",
+ "web3-eth-accounts": "1.2.9",
+ "web3-eth-contract": "1.2.9",
+ "web3-eth-ens": "1.2.9",
+ "web3-eth-iban": "1.2.9",
+ "web3-eth-personal": "1.2.9",
+ "web3-net": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-eth-abi": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.9.tgz",
+ "integrity": "sha512-3YwUYbh/DMfDbhMWEebAdjSd5bj3ZQieOjLzWFHU23CaLEqT34sUix1lba+hgUH/EN6A7bKAuKOhR3p0OvTn7Q==",
+ "requires": {
+ "@ethersproject/abi": "5.0.0-beta.153",
+ "underscore": "1.9.1",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-eth-accounts": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.9.tgz",
+ "integrity": "sha512-jkbDCZoA1qv53mFcRHCinoCsgg8WH+M0YUO1awxmqWXRmCRws1wW0TsuSQ14UThih5Dxolgl+e+aGWxG58LMwg==",
+ "requires": {
+ "crypto-browserify": "3.12.0",
+ "eth-lib": "^0.2.8",
+ "ethereumjs-common": "^1.3.2",
+ "ethereumjs-tx": "^2.1.1",
+ "scrypt-js": "^3.0.1",
+ "underscore": "1.9.1",
+ "uuid": "3.3.2",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-utils": "1.2.9"
+ },
+ "dependencies": {
+ "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"
+ }
+ }
+ }
+ },
+ "web3-eth-contract": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.9.tgz",
+ "integrity": "sha512-PYMvJf7EG/HyssUZa+pXrc8IB06K/YFfWYyW4R7ed3sab+9wWUys1TlWxBCBuiBXOokSAyM6H6P6/cKEx8FT8Q==",
+ "requires": {
+ "@types/bn.js": "^4.11.4",
+ "underscore": "1.9.1",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-core-promievent": "1.2.9",
+ "web3-core-subscriptions": "1.2.9",
+ "web3-eth-abi": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-eth-ens": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.9.tgz",
+ "integrity": "sha512-kG4+ZRgZ8I1WYyOBGI8QVRHfUSbbJjvJAGA1AF/NOW7JXQ+x7gBGeJw6taDWJhSshMoEKWcsgvsiuoG4870YxQ==",
+ "requires": {
+ "content-hash": "^2.5.2",
+ "eth-ens-namehash": "2.0.8",
+ "underscore": "1.9.1",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-promievent": "1.2.9",
+ "web3-eth-abi": "1.2.9",
+ "web3-eth-contract": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-eth-iban": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.9.tgz",
+ "integrity": "sha512-RtdVvJE0pyg9dHLy0GzDiqgnLnssSzfz/JYguhC1wsj9+Gnq1M6Diy3NixACWUAp6ty/zafyOaZnNQ+JuH9TjQ==",
+ "requires": {
+ "bn.js": "4.11.8",
+ "web3-utils": "1.2.9"
+ },
+ "dependencies": {
+ "bn.js": {
+ "version": "4.11.8",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
+ "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA=="
+ }
+ }
+ },
+ "web3-eth-personal": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.9.tgz",
+ "integrity": "sha512-cFiNrktxZ1C/rIdJFzQTvFn3/0zcsR3a+Jf8Y3KxeQDHszQtosjLWptP7bsUmDwEh4hzh0Cy3KpOxlYBWB8bJQ==",
+ "requires": {
+ "@types/node": "^12.6.1",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-net": "1.2.9",
+ "web3-utils": "1.2.9"
+ },
+ "dependencies": {
+ "@types/node": {
+ "version": "12.19.16",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.16.tgz",
+ "integrity": "sha512-7xHmXm/QJ7cbK2laF+YYD7gb5MggHIIQwqyjin3bpEGiSuvScMQ5JZZXPvRipi1MwckTQbJZROMns/JxdnIL1Q=="
+ }
+ }
+ },
+ "web3-net": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.9.tgz",
+ "integrity": "sha512-d2mTn8jPlg+SI2hTj2b32Qan6DmtU9ap/IUlJTeQbZQSkTLf0u9suW8Vjwyr4poJYXTurdSshE7OZsPNn30/ZA==",
+ "requires": {
+ "web3-core": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-providers-http": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.9.tgz",
+ "integrity": "sha512-F956tCIj60Ttr0UvEHWFIhx+be3He8msoPzyA44/kfzzYoMAsCFRn5cf0zQG6al0znE75g6HlWVSN6s3yAh51A==",
+ "requires": {
+ "web3-core-helpers": "1.2.9",
+ "xhr2-cookies": "1.1.0"
+ }
+ },
+ "web3-providers-ipc": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.9.tgz",
+ "integrity": "sha512-NQ8QnBleoHA2qTJlqoWu7EJAD/FR5uimf7Ielzk4Z2z+m+6UAuJdJMSuQNj+Umhz9L/Ys6vpS1vHx9NizFl+aQ==",
+ "requires": {
+ "oboe": "2.1.4",
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9"
+ }
+ },
+ "web3-providers-ws": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.9.tgz",
+ "integrity": "sha512-6+UpvINeI//dglZoAKStUXqxDOXJy6Iitv2z3dbgInG4zb8tkYl/VBDL80UjUg3ZvzWG0g7EKY2nRPEpON2TFA==",
+ "requires": {
+ "eventemitter3": "^4.0.0",
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9",
+ "websocket": "^1.0.31"
+ },
+ "dependencies": {
+ "eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
+ }
+ }
+ },
+ "web3-shh": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.9.tgz",
+ "integrity": "sha512-PWa8b/EaxaMinFaxy6cV0i0EOi2M7a/ST+9k9nhyhCjVa2vzXuNoBNo2IUOmeZ0WP2UQB8ByJ2+p4htlJaDOjA==",
+ "requires": {
+ "web3-core": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-core-subscriptions": "1.2.9",
+ "web3-net": "1.2.9"
+ }
+ },
+ "web3-utils": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz",
+ "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==",
+ "requires": {
+ "bn.js": "4.11.8",
+ "eth-lib": "0.2.7",
+ "ethereum-bloom-filters": "^1.0.6",
+ "ethjs-unit": "0.1.6",
+ "number-to-bn": "1.7.0",
+ "randombytes": "^2.1.0",
+ "underscore": "1.9.1",
+ "utf8": "3.0.0"
+ },
+ "dependencies": {
+ "bn.js": {
+ "version": "4.11.8",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
+ "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA=="
+ },
+ "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"
+ }
+ }
+ }
}
}
},
- "@web3-js/websocket": {
- "version": "1.0.30",
- "resolved": "https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz",
+ "@truffle/provider": {
+ "version": "0.2.25",
+ "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.25.tgz",
+ "integrity": "sha512-BohKgT2357c2dYCH2IQwldQ4EJkfsWUClpb3j+kR8ng02vbsyAPe0HMH463I+h+tiDKvL757dBltXpe0DBJusg==",
+ "requires": {
+ "@truffle/error": "^0.0.11",
+ "@truffle/interface-adapter": "^0.4.18",
+ "web3": "1.2.9"
+ },
+ "dependencies": {
+ "@types/node": {
+ "version": "10.17.51",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.51.tgz",
+ "integrity": "sha512-KANw+MkL626tq90l++hGelbl67irOJzGhUJk6a1Bt8QHOeh9tztJx+L0AqttraWKinmZn7Qi5lJZJzx45Gq0dg=="
+ },
+ "bignumber.js": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz",
+ "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA=="
+ },
+ "bn.js": {
+ "version": "4.11.8",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
+ "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA=="
+ },
+ "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"
+ }
+ },
+ "fs-extra": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
+ "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "jsonfile": "^4.0.0",
+ "universalify": "^0.1.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"
+ }
+ },
+ "p-cancelable": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz",
+ "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw=="
+ },
+ "prepend-http": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
+ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw="
+ },
+ "swarm-js": {
+ "version": "0.1.40",
+ "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.40.tgz",
+ "integrity": "sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA==",
+ "requires": {
+ "bluebird": "^3.5.0",
+ "buffer": "^5.0.5",
+ "eth-lib": "^0.1.26",
+ "fs-extra": "^4.0.2",
+ "got": "^7.1.0",
+ "mime-types": "^2.1.16",
+ "mkdirp-promise": "^5.0.1",
+ "mock-fs": "^4.1.0",
+ "setimmediate": "^1.0.5",
+ "tar": "^4.0.2",
+ "xhr-request": "^1.0.1"
+ },
+ "dependencies": {
+ "got": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz",
+ "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==",
+ "requires": {
+ "decompress-response": "^3.2.0",
+ "duplexer3": "^0.1.4",
+ "get-stream": "^3.0.0",
+ "is-plain-obj": "^1.1.0",
+ "is-retry-allowed": "^1.0.0",
+ "is-stream": "^1.0.0",
+ "isurl": "^1.0.0-alpha5",
+ "lowercase-keys": "^1.0.0",
+ "p-cancelable": "^0.3.0",
+ "p-timeout": "^1.1.1",
+ "safe-buffer": "^5.0.1",
+ "timed-out": "^4.0.0",
+ "url-parse-lax": "^1.0.0",
+ "url-to-options": "^1.0.1"
+ }
+ }
+ }
+ },
+ "url-parse-lax": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz",
+ "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=",
+ "requires": {
+ "prepend-http": "^1.0.1"
+ }
+ },
+ "uuid": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
+ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
+ },
+ "web3": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.9.tgz",
+ "integrity": "sha512-Mo5aBRm0JrcNpN/g4VOrDzudymfOnHRC3s2VarhYxRA8aWgF5rnhQ0ziySaugpic1gksbXPe105pUWyRqw8HUA==",
+ "requires": {
+ "web3-bzz": "1.2.9",
+ "web3-core": "1.2.9",
+ "web3-eth": "1.2.9",
+ "web3-eth-personal": "1.2.9",
+ "web3-net": "1.2.9",
+ "web3-shh": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-bzz": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.9.tgz",
+ "integrity": "sha512-ogVQr9jHodu9HobARtvUSmWG22cv2EUQzlPeejGWZ7j5h20HX40EDuWyomGY5VclIj5DdLY76Tmq88RTf/6nxA==",
+ "requires": {
+ "@types/node": "^10.12.18",
+ "got": "9.6.0",
+ "swarm-js": "^0.1.40",
+ "underscore": "1.9.1"
+ }
+ },
+ "web3-core": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.9.tgz",
+ "integrity": "sha512-fSYv21IP658Ty2wAuU9iqmW7V+75DOYMVZsDH/c14jcF/1VXnedOcxzxSj3vArsCvXZNe6XC5/wAuGZyQwR9RA==",
+ "requires": {
+ "@types/bn.js": "^4.11.4",
+ "@types/node": "^12.6.1",
+ "bignumber.js": "^9.0.0",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-core-requestmanager": "1.2.9",
+ "web3-utils": "1.2.9"
+ },
+ "dependencies": {
+ "@types/node": {
+ "version": "12.19.16",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.16.tgz",
+ "integrity": "sha512-7xHmXm/QJ7cbK2laF+YYD7gb5MggHIIQwqyjin3bpEGiSuvScMQ5JZZXPvRipi1MwckTQbJZROMns/JxdnIL1Q=="
+ }
+ }
+ },
+ "web3-core-helpers": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.9.tgz",
+ "integrity": "sha512-t0WAG3orLCE3lqi77ZoSRNFok3VQWZXTniZigDQjyOJYMAX7BU3F3js8HKbjVnAxlX3tiKoDxI0KBk9F3AxYuw==",
+ "requires": {
+ "underscore": "1.9.1",
+ "web3-eth-iban": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-core-method": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.9.tgz",
+ "integrity": "sha512-bjsIoqP3gs7A/gP8+QeLUCyOKJ8bopteCSNbCX36Pxk6TYfYWNuC6hP+2GzUuqdP3xaZNe+XEElQFUNpR3oyAg==",
+ "requires": {
+ "@ethersproject/transactions": "^5.0.0-beta.135",
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-promievent": "1.2.9",
+ "web3-core-subscriptions": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-core-promievent": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.9.tgz",
+ "integrity": "sha512-0eAUA2zjgXTleSrnc1wdoKQPPIHU6KHf4fAscu4W9kKrR+mqP1KsjYrxY9wUyjNnXxfQ+5M29ipvbiaK8OqdOw==",
+ "requires": {
+ "eventemitter3": "3.1.2"
+ }
+ },
+ "web3-core-requestmanager": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.9.tgz",
+ "integrity": "sha512-1PwKV2m46ALUnIN5VPPgjOj8yMLJhhqZYvYJE34hTN5SErOkwhzx5zScvo5MN7v7KyQGFnpVCZKKGCiEnDmtFA==",
+ "requires": {
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9",
+ "web3-providers-http": "1.2.9",
+ "web3-providers-ipc": "1.2.9",
+ "web3-providers-ws": "1.2.9"
+ }
+ },
+ "web3-core-subscriptions": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.9.tgz",
+ "integrity": "sha512-Y48TvXPSPxEM33OmXjGVDMzTd0j8X0t2+sDw66haeBS8eYnrEzasWuBZZXDq0zNUsqyxItgBGDn+cszkgEnFqg==",
+ "requires": {
+ "eventemitter3": "3.1.2",
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9"
+ }
+ },
+ "web3-eth": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.9.tgz",
+ "integrity": "sha512-sIKO4iE9FEBa/CYUd6GdPd7GXt/wISqxUd8PlIld6+hvMJj02lgO7Z7p5T9mZIJcIZJGvZX81ogx8oJ9yif+Ag==",
+ "requires": {
+ "underscore": "1.9.1",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-core-subscriptions": "1.2.9",
+ "web3-eth-abi": "1.2.9",
+ "web3-eth-accounts": "1.2.9",
+ "web3-eth-contract": "1.2.9",
+ "web3-eth-ens": "1.2.9",
+ "web3-eth-iban": "1.2.9",
+ "web3-eth-personal": "1.2.9",
+ "web3-net": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-eth-abi": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.9.tgz",
+ "integrity": "sha512-3YwUYbh/DMfDbhMWEebAdjSd5bj3ZQieOjLzWFHU23CaLEqT34sUix1lba+hgUH/EN6A7bKAuKOhR3p0OvTn7Q==",
+ "requires": {
+ "@ethersproject/abi": "5.0.0-beta.153",
+ "underscore": "1.9.1",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-eth-accounts": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.9.tgz",
+ "integrity": "sha512-jkbDCZoA1qv53mFcRHCinoCsgg8WH+M0YUO1awxmqWXRmCRws1wW0TsuSQ14UThih5Dxolgl+e+aGWxG58LMwg==",
+ "requires": {
+ "crypto-browserify": "3.12.0",
+ "eth-lib": "^0.2.8",
+ "ethereumjs-common": "^1.3.2",
+ "ethereumjs-tx": "^2.1.1",
+ "scrypt-js": "^3.0.1",
+ "underscore": "1.9.1",
+ "uuid": "3.3.2",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-utils": "1.2.9"
+ },
+ "dependencies": {
+ "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"
+ }
+ }
+ }
+ },
+ "web3-eth-contract": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.9.tgz",
+ "integrity": "sha512-PYMvJf7EG/HyssUZa+pXrc8IB06K/YFfWYyW4R7ed3sab+9wWUys1TlWxBCBuiBXOokSAyM6H6P6/cKEx8FT8Q==",
+ "requires": {
+ "@types/bn.js": "^4.11.4",
+ "underscore": "1.9.1",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-core-promievent": "1.2.9",
+ "web3-core-subscriptions": "1.2.9",
+ "web3-eth-abi": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-eth-ens": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.9.tgz",
+ "integrity": "sha512-kG4+ZRgZ8I1WYyOBGI8QVRHfUSbbJjvJAGA1AF/NOW7JXQ+x7gBGeJw6taDWJhSshMoEKWcsgvsiuoG4870YxQ==",
+ "requires": {
+ "content-hash": "^2.5.2",
+ "eth-ens-namehash": "2.0.8",
+ "underscore": "1.9.1",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-promievent": "1.2.9",
+ "web3-eth-abi": "1.2.9",
+ "web3-eth-contract": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-eth-iban": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.9.tgz",
+ "integrity": "sha512-RtdVvJE0pyg9dHLy0GzDiqgnLnssSzfz/JYguhC1wsj9+Gnq1M6Diy3NixACWUAp6ty/zafyOaZnNQ+JuH9TjQ==",
+ "requires": {
+ "bn.js": "4.11.8",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-eth-personal": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.9.tgz",
+ "integrity": "sha512-cFiNrktxZ1C/rIdJFzQTvFn3/0zcsR3a+Jf8Y3KxeQDHszQtosjLWptP7bsUmDwEh4hzh0Cy3KpOxlYBWB8bJQ==",
+ "requires": {
+ "@types/node": "^12.6.1",
+ "web3-core": "1.2.9",
+ "web3-core-helpers": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-net": "1.2.9",
+ "web3-utils": "1.2.9"
+ },
+ "dependencies": {
+ "@types/node": {
+ "version": "12.19.16",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.16.tgz",
+ "integrity": "sha512-7xHmXm/QJ7cbK2laF+YYD7gb5MggHIIQwqyjin3bpEGiSuvScMQ5JZZXPvRipi1MwckTQbJZROMns/JxdnIL1Q=="
+ }
+ }
+ },
+ "web3-net": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.9.tgz",
+ "integrity": "sha512-d2mTn8jPlg+SI2hTj2b32Qan6DmtU9ap/IUlJTeQbZQSkTLf0u9suW8Vjwyr4poJYXTurdSshE7OZsPNn30/ZA==",
+ "requires": {
+ "web3-core": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-utils": "1.2.9"
+ }
+ },
+ "web3-providers-http": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.9.tgz",
+ "integrity": "sha512-F956tCIj60Ttr0UvEHWFIhx+be3He8msoPzyA44/kfzzYoMAsCFRn5cf0zQG6al0znE75g6HlWVSN6s3yAh51A==",
+ "requires": {
+ "web3-core-helpers": "1.2.9",
+ "xhr2-cookies": "1.1.0"
+ }
+ },
+ "web3-providers-ipc": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.9.tgz",
+ "integrity": "sha512-NQ8QnBleoHA2qTJlqoWu7EJAD/FR5uimf7Ielzk4Z2z+m+6UAuJdJMSuQNj+Umhz9L/Ys6vpS1vHx9NizFl+aQ==",
+ "requires": {
+ "oboe": "2.1.4",
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9"
+ }
+ },
+ "web3-providers-ws": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.9.tgz",
+ "integrity": "sha512-6+UpvINeI//dglZoAKStUXqxDOXJy6Iitv2z3dbgInG4zb8tkYl/VBDL80UjUg3ZvzWG0g7EKY2nRPEpON2TFA==",
+ "requires": {
+ "eventemitter3": "^4.0.0",
+ "underscore": "1.9.1",
+ "web3-core-helpers": "1.2.9",
+ "websocket": "^1.0.31"
+ },
+ "dependencies": {
+ "eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
+ }
+ }
+ },
+ "web3-shh": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.9.tgz",
+ "integrity": "sha512-PWa8b/EaxaMinFaxy6cV0i0EOi2M7a/ST+9k9nhyhCjVa2vzXuNoBNo2IUOmeZ0WP2UQB8ByJ2+p4htlJaDOjA==",
+ "requires": {
+ "web3-core": "1.2.9",
+ "web3-core-method": "1.2.9",
+ "web3-core-subscriptions": "1.2.9",
+ "web3-net": "1.2.9"
+ }
+ },
+ "web3-utils": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz",
+ "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==",
+ "requires": {
+ "bn.js": "4.11.8",
+ "eth-lib": "0.2.7",
+ "ethereum-bloom-filters": "^1.0.6",
+ "ethjs-unit": "0.1.6",
+ "number-to-bn": "1.7.0",
+ "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"
+ }
+ }
+ }
+ }
+ }
+ },
+ "@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": "*"
+ }
+ },
+ "@types/glob": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz",
+ "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==",
+ "requires": {
+ "@types/minimatch": "*",
+ "@types/node": "*"
+ }
+ },
+ "@types/minimatch": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
+ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
+ },
+ "@types/node": {
+ "version": "14.6.4",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.4.tgz",
+ "integrity": "sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ=="
+ },
+ "@types/pbkdf2": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz",
+ "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==",
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "@types/secp256k1": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz",
+ "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==",
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "@web3-js/scrypt-shim": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/@web3-js/scrypt-shim/-/scrypt-shim-0.1.0.tgz",
+ "integrity": "sha512-ZtZeWCc/s0nMcdx/+rZwY1EcuRdemOK9ag21ty9UsHkFxsNb/AaoucUz0iPuyGe0Ku+PFuRmWZG7Z7462p9xPw==",
+ "requires": {
+ "scryptsy": "^2.1.0",
+ "semver": "^6.3.0"
+ },
+ "dependencies": {
+ "scryptsy": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz",
+ "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w=="
+ },
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
+ }
+ }
+ },
+ "@web3-js/websocket": {
+ "version": "1.0.30",
+ "resolved": "https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz",
"integrity": "sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==",
"requires": {
"debug": "^2.2.0",
@@ -192,6 +1274,11 @@
"resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz",
"integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA=="
},
+ "abbrev": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz",
+ "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU="
+ },
"abstract-leveldown": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz",
@@ -209,6 +1296,11 @@
"negotiator": "0.6.2"
}
},
+ "address": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/address/-/address-1.1.2.tgz",
+ "integrity": "sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA=="
+ },
"aes-js": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz",
@@ -225,11 +1317,25 @@
"uri-js": "^4.2.2"
}
},
+ "amdefine": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
+ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
+ "optional": true
+ },
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
"any-promise": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
@@ -245,6 +1351,14 @@
"picomatch": "^2.0.4"
}
},
+ "argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "requires": {
+ "sprintf-js": "~1.0.2"
+ }
+ },
"arr-diff": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
@@ -273,6 +1387,11 @@
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
+ "array-union": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
+ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw=="
+ },
"array-unique": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
@@ -602,7 +1721,6 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
- "optional": true,
"requires": {
"fill-range": "^7.0.1"
}
@@ -734,6 +1852,11 @@
"resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
"integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw="
},
+ "buffer-from": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
+ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
+ },
"buffer-to-arraybuffer": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz",
@@ -744,6 +1867,14 @@
"resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
"integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk="
},
+ "bufferutil": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz",
+ "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==",
+ "requires": {
+ "node-gyp-build": "^4.2.0"
+ }
+ },
"bytes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
@@ -821,6 +1952,31 @@
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
+ "chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "dependencies": {
+ "has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
+ },
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
"checkpoint-store": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz",
@@ -850,15 +2006,43 @@
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
},
- "cipher-base": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
- "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
+ "cids": {
+ "version": "0.7.5",
+ "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz",
+ "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==",
"requires": {
- "inherits": "^2.0.1",
- "safe-buffer": "^5.0.1"
- }
- },
+ "buffer": "^5.5.0",
+ "class-is": "^1.1.0",
+ "multibase": "~0.6.0",
+ "multicodec": "^1.0.0",
+ "multihashes": "~0.4.15"
+ },
+ "dependencies": {
+ "multicodec": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-1.0.4.tgz",
+ "integrity": "sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==",
+ "requires": {
+ "buffer": "^5.6.0",
+ "varint": "^5.0.0"
+ }
+ }
+ }
+ },
+ "cipher-base": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
+ "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
+ "requires": {
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "class-is": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz",
+ "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw=="
+ },
"class-utils": {
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
@@ -927,6 +2111,19 @@
"object-visit": "^1.0.0"
}
},
+ "color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "requires": {
+ "color-name": "1.1.3"
+ }
+ },
+ "color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
+ },
"colors": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
@@ -970,6 +2167,16 @@
}
}
},
+ "content-hash": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/content-hash/-/content-hash-2.5.2.tgz",
+ "integrity": "sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==",
+ "requires": {
+ "cids": "^0.7.1",
+ "multicodec": "^0.5.5",
+ "multihashes": "^0.4.15"
+ }
+ },
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
@@ -1101,6 +2308,11 @@
"assert-plus": "^1.0.0"
}
},
+ "death": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz",
+ "integrity": "sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg="
+ },
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@@ -1256,6 +2468,11 @@
}
}
},
+ "deep-is": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
+ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
+ },
"defer-to-connect": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz",
@@ -1360,6 +2577,15 @@
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
+ "detect-port": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.3.0.tgz",
+ "integrity": "sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ==",
+ "requires": {
+ "address": "^1.0.1",
+ "debug": "^2.6.0"
+ }
+ },
"diff": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
@@ -1375,6 +2601,21 @@
"randombytes": "^2.0.0"
}
},
+ "dir-glob": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
+ "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
+ "requires": {
+ "path-type": "^4.0.0"
+ },
+ "dependencies": {
+ "path-type": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
+ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
+ }
+ }
+ },
"dom-walk": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz",
@@ -1545,6 +2786,44 @@
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
+ "escodegen": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz",
+ "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=",
+ "requires": {
+ "esprima": "^2.7.1",
+ "estraverse": "^1.9.1",
+ "esutils": "^2.0.2",
+ "optionator": "^0.8.1",
+ "source-map": "~0.2.0"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz",
+ "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=",
+ "optional": true,
+ "requires": {
+ "amdefine": ">=0.0.4"
+ }
+ }
+ }
+ },
+ "esprima": {
+ "version": "2.7.3",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz",
+ "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE="
+ },
+ "estraverse": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz",
+ "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q="
+ },
+ "esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="
+ },
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
@@ -2073,11 +3352,48 @@
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
+ "fast-glob": {
+ "version": "3.2.5",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
+ "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==",
+ "requires": {
+ "@nodelib/fs.stat": "^2.0.2",
+ "@nodelib/fs.walk": "^1.2.3",
+ "glob-parent": "^5.1.0",
+ "merge2": "^1.3.0",
+ "micromatch": "^4.0.2",
+ "picomatch": "^2.2.1"
+ },
+ "dependencies": {
+ "micromatch": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
+ "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
+ "requires": {
+ "braces": "^3.0.1",
+ "picomatch": "^2.0.5"
+ }
+ }
+ }
+ },
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
},
+ "fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
+ },
+ "fastq": {
+ "version": "1.10.1",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.1.tgz",
+ "integrity": "sha512-AWuv6Ery3pM+dY7LYS8YIaCiQvUaos9OB1RyNgaOWnaX+Tik7Onvcsf8x8c+YtDeT0maYLniBip2hox5KtEXXA==",
+ "requires": {
+ "reusify": "^1.0.4"
+ }
+ },
"fd-slicer": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
@@ -2106,7 +3422,6 @@
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
- "optional": true,
"requires": {
"to-regex-range": "^5.0.1"
}
@@ -2212,27 +3527,701 @@
"minipass": "^2.6.0"
}
},
- "fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
- },
- "fsevents": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
- "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
- "optional": true
- },
- "function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
- },
- "functional-red-black-tree": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
- "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc="
- },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
+ },
+ "fsevents": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
+ "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
+ "optional": true
+ },
+ "function-bind": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ },
+ "functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc="
+ },
+ "ganache-cli": {
+ "version": "6.12.2",
+ "resolved": "https://registry.npmjs.org/ganache-cli/-/ganache-cli-6.12.2.tgz",
+ "integrity": "sha512-bnmwnJDBDsOWBUP8E/BExWf85TsdDEFelQSzihSJm9VChVO1SHp94YXLP5BlA4j/OTxp0wR4R1Tje9OHOuAJVw==",
+ "requires": {
+ "ethereumjs-util": "6.2.1",
+ "source-map-support": "0.5.12",
+ "yargs": "13.2.4"
+ },
+ "dependencies": {
+ "@types/bn.js": {
+ "version": "4.11.6",
+ "bundled": true,
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "@types/node": {
+ "version": "14.11.2",
+ "bundled": true
+ },
+ "@types/pbkdf2": {
+ "version": "3.1.0",
+ "bundled": true,
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "@types/secp256k1": {
+ "version": "4.0.1",
+ "bundled": true,
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "ansi-regex": {
+ "version": "4.1.0",
+ "bundled": true
+ },
+ "ansi-styles": {
+ "version": "3.2.1",
+ "bundled": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "base-x": {
+ "version": "3.0.8",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "blakejs": {
+ "version": "1.1.0",
+ "bundled": true
+ },
+ "bn.js": {
+ "version": "4.11.9",
+ "bundled": true
+ },
+ "brorand": {
+ "version": "1.1.0",
+ "bundled": true
+ },
+ "browserify-aes": {
+ "version": "1.2.0",
+ "bundled": true,
+ "requires": {
+ "buffer-xor": "^1.0.3",
+ "cipher-base": "^1.0.0",
+ "create-hash": "^1.1.0",
+ "evp_bytestokey": "^1.0.3",
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "bs58": {
+ "version": "4.0.1",
+ "bundled": true,
+ "requires": {
+ "base-x": "^3.0.2"
+ }
+ },
+ "bs58check": {
+ "version": "2.1.2",
+ "bundled": true,
+ "requires": {
+ "bs58": "^4.0.0",
+ "create-hash": "^1.1.0",
+ "safe-buffer": "^5.1.2"
+ }
+ },
+ "buffer-from": {
+ "version": "1.1.1",
+ "bundled": true
+ },
+ "buffer-xor": {
+ "version": "1.0.3",
+ "bundled": true
+ },
+ "camelcase": {
+ "version": "5.3.1",
+ "bundled": true
+ },
+ "cipher-base": {
+ "version": "1.0.4",
+ "bundled": true,
+ "requires": {
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "cliui": {
+ "version": "5.0.0",
+ "bundled": true,
+ "requires": {
+ "string-width": "^3.1.0",
+ "strip-ansi": "^5.2.0",
+ "wrap-ansi": "^5.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "1.9.3",
+ "bundled": true,
+ "requires": {
+ "color-name": "1.1.3"
+ }
+ },
+ "color-name": {
+ "version": "1.1.3",
+ "bundled": true
+ },
+ "create-hash": {
+ "version": "1.2.0",
+ "bundled": true,
+ "requires": {
+ "cipher-base": "^1.0.1",
+ "inherits": "^2.0.1",
+ "md5.js": "^1.3.4",
+ "ripemd160": "^2.0.1",
+ "sha.js": "^2.4.0"
+ }
+ },
+ "create-hmac": {
+ "version": "1.1.7",
+ "bundled": true,
+ "requires": {
+ "cipher-base": "^1.0.3",
+ "create-hash": "^1.1.0",
+ "inherits": "^2.0.1",
+ "ripemd160": "^2.0.0",
+ "safe-buffer": "^5.0.1",
+ "sha.js": "^2.4.8"
+ }
+ },
+ "cross-spawn": {
+ "version": "6.0.5",
+ "bundled": true,
+ "requires": {
+ "nice-try": "^1.0.4",
+ "path-key": "^2.0.1",
+ "semver": "^5.5.0",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
+ }
+ },
+ "decamelize": {
+ "version": "1.2.0",
+ "bundled": true
+ },
+ "elliptic": {
+ "version": "6.5.3",
+ "bundled": true,
+ "requires": {
+ "bn.js": "^4.4.0",
+ "brorand": "^1.0.1",
+ "hash.js": "^1.0.0",
+ "hmac-drbg": "^1.0.0",
+ "inherits": "^2.0.1",
+ "minimalistic-assert": "^1.0.0",
+ "minimalistic-crypto-utils": "^1.0.0"
+ }
+ },
+ "emoji-regex": {
+ "version": "7.0.3",
+ "bundled": true
+ },
+ "end-of-stream": {
+ "version": "1.4.4",
+ "bundled": true,
+ "requires": {
+ "once": "^1.4.0"
+ }
+ },
+ "ethereum-cryptography": {
+ "version": "0.1.3",
+ "bundled": true,
+ "requires": {
+ "@types/pbkdf2": "^3.0.0",
+ "@types/secp256k1": "^4.0.1",
+ "blakejs": "^1.1.0",
+ "browserify-aes": "^1.2.0",
+ "bs58check": "^2.1.2",
+ "create-hash": "^1.2.0",
+ "create-hmac": "^1.1.7",
+ "hash.js": "^1.1.7",
+ "keccak": "^3.0.0",
+ "pbkdf2": "^3.0.17",
+ "randombytes": "^2.1.0",
+ "safe-buffer": "^5.1.2",
+ "scrypt-js": "^3.0.0",
+ "secp256k1": "^4.0.1",
+ "setimmediate": "^1.0.5"
+ }
+ },
+ "ethereumjs-util": {
+ "version": "6.2.1",
+ "bundled": true,
+ "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"
+ }
+ },
+ "ethjs-util": {
+ "version": "0.1.6",
+ "bundled": true,
+ "requires": {
+ "is-hex-prefixed": "1.0.0",
+ "strip-hex-prefix": "1.0.0"
+ }
+ },
+ "evp_bytestokey": {
+ "version": "1.0.3",
+ "bundled": true,
+ "requires": {
+ "md5.js": "^1.3.4",
+ "safe-buffer": "^5.1.1"
+ }
+ },
+ "execa": {
+ "version": "1.0.0",
+ "bundled": true,
+ "requires": {
+ "cross-spawn": "^6.0.0",
+ "get-stream": "^4.0.0",
+ "is-stream": "^1.1.0",
+ "npm-run-path": "^2.0.0",
+ "p-finally": "^1.0.0",
+ "signal-exit": "^3.0.0",
+ "strip-eof": "^1.0.0"
+ }
+ },
+ "find-up": {
+ "version": "3.0.0",
+ "bundled": true,
+ "requires": {
+ "locate-path": "^3.0.0"
+ }
+ },
+ "get-caller-file": {
+ "version": "2.0.5",
+ "bundled": true
+ },
+ "get-stream": {
+ "version": "4.1.0",
+ "bundled": true,
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ },
+ "hash-base": {
+ "version": "3.1.0",
+ "bundled": true,
+ "requires": {
+ "inherits": "^2.0.4",
+ "readable-stream": "^3.6.0",
+ "safe-buffer": "^5.2.0"
+ }
+ },
+ "hash.js": {
+ "version": "1.1.7",
+ "bundled": true,
+ "requires": {
+ "inherits": "^2.0.3",
+ "minimalistic-assert": "^1.0.1"
+ }
+ },
+ "hmac-drbg": {
+ "version": "1.0.1",
+ "bundled": true,
+ "requires": {
+ "hash.js": "^1.0.3",
+ "minimalistic-assert": "^1.0.0",
+ "minimalistic-crypto-utils": "^1.0.1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.4",
+ "bundled": true
+ },
+ "invert-kv": {
+ "version": "2.0.0",
+ "bundled": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "2.0.0",
+ "bundled": true
+ },
+ "is-hex-prefixed": {
+ "version": "1.0.0",
+ "bundled": true
+ },
+ "is-stream": {
+ "version": "1.1.0",
+ "bundled": true
+ },
+ "isexe": {
+ "version": "2.0.0",
+ "bundled": true
+ },
+ "keccak": {
+ "version": "3.0.1",
+ "bundled": true,
+ "requires": {
+ "node-addon-api": "^2.0.0",
+ "node-gyp-build": "^4.2.0"
+ }
+ },
+ "lcid": {
+ "version": "2.0.0",
+ "bundled": true,
+ "requires": {
+ "invert-kv": "^2.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "3.0.0",
+ "bundled": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "map-age-cleaner": {
+ "version": "0.1.3",
+ "bundled": true,
+ "requires": {
+ "p-defer": "^1.0.0"
+ }
+ },
+ "md5.js": {
+ "version": "1.3.5",
+ "bundled": true,
+ "requires": {
+ "hash-base": "^3.0.0",
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.1.2"
+ }
+ },
+ "mem": {
+ "version": "4.3.0",
+ "bundled": true,
+ "requires": {
+ "map-age-cleaner": "^0.1.1",
+ "mimic-fn": "^2.0.0",
+ "p-is-promise": "^2.0.0"
+ }
+ },
+ "mimic-fn": {
+ "version": "2.1.0",
+ "bundled": true
+ },
+ "minimalistic-assert": {
+ "version": "1.0.1",
+ "bundled": true
+ },
+ "minimalistic-crypto-utils": {
+ "version": "1.0.1",
+ "bundled": true
+ },
+ "nice-try": {
+ "version": "1.0.5",
+ "bundled": true
+ },
+ "node-addon-api": {
+ "version": "2.0.2",
+ "bundled": true
+ },
+ "node-gyp-build": {
+ "version": "4.2.3",
+ "bundled": true
+ },
+ "npm-run-path": {
+ "version": "2.0.2",
+ "bundled": true,
+ "requires": {
+ "path-key": "^2.0.0"
+ }
+ },
+ "once": {
+ "version": "1.4.0",
+ "bundled": true,
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "os-locale": {
+ "version": "3.1.0",
+ "bundled": true,
+ "requires": {
+ "execa": "^1.0.0",
+ "lcid": "^2.0.0",
+ "mem": "^4.0.0"
+ }
+ },
+ "p-defer": {
+ "version": "1.0.0",
+ "bundled": true
+ },
+ "p-finally": {
+ "version": "1.0.0",
+ "bundled": true
+ },
+ "p-is-promise": {
+ "version": "2.1.0",
+ "bundled": true
+ },
+ "p-limit": {
+ "version": "2.3.0",
+ "bundled": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "bundled": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "bundled": true
+ },
+ "path-exists": {
+ "version": "3.0.0",
+ "bundled": true
+ },
+ "path-key": {
+ "version": "2.0.1",
+ "bundled": true
+ },
+ "pbkdf2": {
+ "version": "3.1.1",
+ "bundled": true,
+ "requires": {
+ "create-hash": "^1.1.2",
+ "create-hmac": "^1.1.4",
+ "ripemd160": "^2.0.1",
+ "safe-buffer": "^5.0.1",
+ "sha.js": "^2.4.8"
+ }
+ },
+ "pump": {
+ "version": "3.0.0",
+ "bundled": true,
+ "requires": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "randombytes": {
+ "version": "2.1.0",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "^5.1.0"
+ }
+ },
+ "readable-stream": {
+ "version": "3.6.0",
+ "bundled": true,
+ "requires": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ }
+ },
+ "require-directory": {
+ "version": "2.1.1",
+ "bundled": true
+ },
+ "require-main-filename": {
+ "version": "2.0.0",
+ "bundled": true
+ },
+ "ripemd160": {
+ "version": "2.0.2",
+ "bundled": true,
+ "requires": {
+ "hash-base": "^3.0.0",
+ "inherits": "^2.0.1"
+ }
+ },
+ "rlp": {
+ "version": "2.2.6",
+ "bundled": true,
+ "requires": {
+ "bn.js": "^4.11.1"
+ }
+ },
+ "safe-buffer": {
+ "version": "5.2.1",
+ "bundled": true
+ },
+ "scrypt-js": {
+ "version": "3.0.1",
+ "bundled": true
+ },
+ "secp256k1": {
+ "version": "4.0.2",
+ "bundled": true,
+ "requires": {
+ "elliptic": "^6.5.2",
+ "node-addon-api": "^2.0.0",
+ "node-gyp-build": "^4.2.0"
+ }
+ },
+ "semver": {
+ "version": "5.7.1",
+ "bundled": true
+ },
+ "set-blocking": {
+ "version": "2.0.0",
+ "bundled": true
+ },
+ "setimmediate": {
+ "version": "1.0.5",
+ "bundled": true
+ },
+ "sha.js": {
+ "version": "2.4.11",
+ "bundled": true,
+ "requires": {
+ "inherits": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "shebang-command": {
+ "version": "1.2.0",
+ "bundled": true,
+ "requires": {
+ "shebang-regex": "^1.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "1.0.0",
+ "bundled": true
+ },
+ "signal-exit": {
+ "version": "3.0.3",
+ "bundled": true
+ },
+ "source-map": {
+ "version": "0.6.1",
+ "bundled": true
+ },
+ "source-map-support": {
+ "version": "0.5.12",
+ "bundled": true,
+ "requires": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ }
+ },
+ "string-width": {
+ "version": "3.1.0",
+ "bundled": true,
+ "requires": {
+ "emoji-regex": "^7.0.1",
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^5.1.0"
+ }
+ },
+ "string_decoder": {
+ "version": "1.3.0",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.2.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "5.2.0",
+ "bundled": true,
+ "requires": {
+ "ansi-regex": "^4.1.0"
+ }
+ },
+ "strip-eof": {
+ "version": "1.0.0",
+ "bundled": true
+ },
+ "strip-hex-prefix": {
+ "version": "1.0.0",
+ "bundled": true,
+ "requires": {
+ "is-hex-prefixed": "1.0.0"
+ }
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "bundled": true
+ },
+ "which": {
+ "version": "1.3.1",
+ "bundled": true,
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "which-module": {
+ "version": "2.0.0",
+ "bundled": true
+ },
+ "wrap-ansi": {
+ "version": "5.1.0",
+ "bundled": true,
+ "requires": {
+ "ansi-styles": "^3.2.0",
+ "string-width": "^3.0.0",
+ "strip-ansi": "^5.0.0"
+ }
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "bundled": true
+ },
+ "y18n": {
+ "version": "4.0.0",
+ "bundled": true
+ },
+ "yargs": {
+ "version": "13.2.4",
+ "bundled": true,
+ "requires": {
+ "cliui": "^5.0.0",
+ "find-up": "^3.0.0",
+ "get-caller-file": "^2.0.1",
+ "os-locale": "^3.1.0",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^2.0.0",
+ "set-blocking": "^2.0.0",
+ "string-width": "^3.0.0",
+ "which-module": "^2.0.0",
+ "y18n": "^4.0.0",
+ "yargs-parser": "^13.1.0"
+ }
+ },
+ "yargs-parser": {
+ "version": "13.1.2",
+ "bundled": true,
+ "requires": {
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
+ }
+ }
+ }
+ },
"get-caller-file": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
@@ -2256,6 +4245,15 @@
"assert-plus": "^1.0.0"
}
},
+ "ghost-testrpc": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz",
+ "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==",
+ "requires": {
+ "chalk": "^2.4.2",
+ "node-emoji": "^1.10.0"
+ }
+ },
"glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
@@ -2305,7 +4303,6 @@
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
- "optional": true,
"requires": {
"is-glob": "^4.0.1"
}
@@ -2319,6 +4316,46 @@
"process": "~0.5.1"
}
},
+ "global-modules": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz",
+ "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==",
+ "requires": {
+ "global-prefix": "^3.0.0"
+ }
+ },
+ "global-prefix": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz",
+ "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==",
+ "requires": {
+ "ini": "^1.3.5",
+ "kind-of": "^6.0.2",
+ "which": "^1.3.1"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="
+ }
+ }
+ },
+ "globby": {
+ "version": "10.0.2",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz",
+ "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==",
+ "requires": {
+ "@types/glob": "^7.1.1",
+ "array-union": "^2.1.0",
+ "dir-glob": "^3.0.1",
+ "fast-glob": "^3.0.3",
+ "glob": "^7.1.3",
+ "ignore": "^5.1.1",
+ "merge2": "^1.2.3",
+ "slash": "^3.0.0"
+ }
+ },
"got": {
"version": "9.6.0",
"resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
@@ -2357,6 +4394,25 @@
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz",
"integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q=="
},
+ "handlebars": {
+ "version": "4.7.6",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz",
+ "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==",
+ "requires": {
+ "minimist": "^1.2.5",
+ "neo-async": "^2.6.0",
+ "source-map": "^0.6.1",
+ "uglify-js": "^3.1.4",
+ "wordwrap": "^1.0.0"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
+ }
+ }
+ },
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
@@ -2567,6 +4623,11 @@
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
},
+ "ignore": {
+ "version": "5.1.8",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",
+ "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw=="
+ },
"immediate": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz",
@@ -2591,6 +4652,16 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
+ "ini": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
+ },
+ "interpret": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
+ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA=="
+ },
"invert-kv": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
@@ -2689,8 +4760,7 @@
"is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
- "optional": true
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="
},
"is-fullwidth-code-point": {
"version": "1.0.0",
@@ -2709,7 +4779,6 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
"integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
- "optional": true,
"requires": {
"is-extglob": "^2.1.1"
}
@@ -2727,8 +4796,7 @@
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "optional": true
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="
},
"is-object": {
"version": "1.0.1",
@@ -2864,6 +4932,22 @@
"resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz",
"integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8="
},
+ "js-yaml": {
+ "version": "3.14.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
+ "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
+ "requires": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ },
+ "dependencies": {
+ "esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
+ }
+ }
+ },
"jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
@@ -2902,6 +4986,11 @@
"graceful-fs": "^4.1.6"
}
},
+ "jsonschema": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.0.tgz",
+ "integrity": "sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw=="
+ },
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
@@ -3059,6 +5148,15 @@
}
}
},
+ "levn": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
+ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
+ "requires": {
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2"
+ }
+ },
"load-json-file": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
@@ -3094,6 +5192,11 @@
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
+ "lodash.toarray": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz",
+ "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE="
+ },
"loud-rejection": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
@@ -3130,6 +5233,14 @@
"pify": "^3.0.0"
}
},
+ "map-age-cleaner": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
+ "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
+ "requires": {
+ "p-defer": "^1.0.0"
+ }
+ },
"map-cache": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
@@ -3169,11 +5280,12 @@
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"mem": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz",
- "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/mem/-/mem-8.0.0.tgz",
+ "integrity": "sha512-qrcJOe6uD+EW8Wrci1Vdiua/15Xw3n/QnaNXE7varnB6InxSk7nu3/i5jfy3S6kWxr8WYJ6R1o0afMUtvorTsA==",
"requires": {
- "mimic-fn": "^1.0.0"
+ "map-age-cleaner": "^0.1.3",
+ "mimic-fn": "^3.1.0"
}
},
"memdown": {
@@ -3230,6 +5342,11 @@
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
},
+ "merge2": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="
+ },
"merkle-patricia-tree": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz",
@@ -3393,9 +5510,9 @@
}
},
"mimic-fn": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
- "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz",
+ "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ=="
},
"mimic-response": {
"version": "1.0.1",
@@ -3568,6 +5685,44 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
+ "multibase": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz",
+ "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==",
+ "requires": {
+ "base-x": "^3.0.8",
+ "buffer": "^5.5.0"
+ }
+ },
+ "multicodec": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz",
+ "integrity": "sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==",
+ "requires": {
+ "varint": "^5.0.0"
+ }
+ },
+ "multihashes": {
+ "version": "0.4.21",
+ "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz",
+ "integrity": "sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==",
+ "requires": {
+ "buffer": "^5.5.0",
+ "multibase": "^0.7.0",
+ "varint": "^5.0.0"
+ },
+ "dependencies": {
+ "multibase": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz",
+ "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==",
+ "requires": {
+ "base-x": "^3.0.8",
+ "buffer": "^5.5.0"
+ }
+ }
+ }
+ },
"nan": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz",
@@ -3618,6 +5773,11 @@
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
+ "neo-async": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
+ },
"next-tick": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
@@ -3628,6 +5788,14 @@
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz",
"integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA=="
},
+ "node-emoji": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz",
+ "integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==",
+ "requires": {
+ "lodash.toarray": "^4.4.0"
+ }
+ },
"node-fetch": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
@@ -3642,6 +5810,14 @@
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz",
"integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg=="
},
+ "nopt": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
+ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
+ "requires": {
+ "abbrev": "1"
+ }
+ },
"normalize-package-data": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
@@ -3841,6 +6017,24 @@
"wrappy": "1"
}
},
+ "openzeppelin-solidity": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-3.3.0.tgz",
+ "integrity": "sha512-hTgOBwCGxJEn6KnNaSzCKYT72aw84VpBl9AuZSLqpxFoQIr0ST/06M2jTVlv+YEQu2q4kq+1GU8CaTBmOotrgA=="
+ },
+ "optionator": {
+ "version": "0.8.3",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
+ "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
+ "requires": {
+ "deep-is": "~0.1.3",
+ "fast-levenshtein": "~2.0.6",
+ "levn": "~0.3.0",
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2",
+ "word-wrap": "~1.2.3"
+ }
+ },
"os-locale": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
@@ -3854,6 +6048,11 @@
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
"integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw=="
},
+ "p-defer": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
+ "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww="
+ },
"p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
@@ -4013,8 +6212,7 @@
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
- "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
- "optional": true
+ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg=="
},
"pify": {
"version": "3.0.0",
@@ -4039,6 +6237,11 @@
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
"integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs="
},
+ "prelude-ls": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
+ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
+ },
"prepend-http": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
@@ -4233,6 +6436,22 @@
"picomatch": "^2.2.1"
}
},
+ "rechoir": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
+ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
+ "requires": {
+ "resolve": "^1.1.6"
+ }
+ },
+ "recursive-readdir": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz",
+ "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==",
+ "requires": {
+ "minimatch": "3.0.4"
+ }
+ },
"redent": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz",
@@ -4366,6 +6585,11 @@
"resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg=="
},
+ "reusify": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
+ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw=="
+ },
"rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
@@ -4391,6 +6615,11 @@
"bn.js": "^4.11.1"
}
},
+ "run-parallel": {
+ "version": "1.1.10",
+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz",
+ "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw=="
+ },
"rustbn.js": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz",
@@ -4414,6 +6643,64 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
+ "sc-istanbul": {
+ "version": "0.4.5",
+ "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.5.tgz",
+ "integrity": "sha512-7wR5EZFLsC4w0wSm9BUuCgW+OGKAU7PNlW5L0qwVPbh+Q1sfVn2fyzfMXYCm6rkNA5ipaCOt94nApcguQwF5Gg==",
+ "requires": {
+ "abbrev": "1.0.x",
+ "async": "1.x",
+ "escodegen": "1.8.x",
+ "esprima": "2.7.x",
+ "glob": "^5.0.15",
+ "handlebars": "^4.0.1",
+ "js-yaml": "3.x",
+ "mkdirp": "0.5.x",
+ "nopt": "3.x",
+ "once": "1.x",
+ "resolve": "1.1.x",
+ "supports-color": "^3.1.0",
+ "which": "^1.1.1",
+ "wordwrap": "^1.0.0"
+ },
+ "dependencies": {
+ "async": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
+ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="
+ },
+ "glob": {
+ "version": "5.0.15",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
+ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
+ "requires": {
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "2 || 3",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "has-flag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
+ "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo="
+ },
+ "resolve": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
+ "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs="
+ },
+ "supports-color": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz",
+ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
+ "requires": {
+ "has-flag": "^1.0.0"
+ }
+ }
+ }
+ },
"scrypt-js": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz",
@@ -4570,6 +6857,16 @@
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
},
+ "shelljs": {
+ "version": "0.8.4",
+ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz",
+ "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==",
+ "requires": {
+ "glob": "^7.0.0",
+ "interpret": "^1.0.0",
+ "rechoir": "^0.6.2"
+ }
+ },
"signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
@@ -4590,6 +6887,11 @@
"simple-concat": "^1.0.0"
}
},
+ "slash": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
+ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="
+ },
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@@ -4717,6 +7019,108 @@
"truffle-hdwallet-provider": "0.0.3"
}
},
+ "solidity-coverage": {
+ "version": "0.7.14",
+ "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.7.14.tgz",
+ "integrity": "sha512-2X9oNtu4yBbtDXtVe2tc9vYHtwON6QRqNvVylKdkhcJgAdCzP/OkJy9fWcWH/g3fnNCIOFssHoe0LPGZ2ppMZg==",
+ "requires": {
+ "@solidity-parser/parser": "^0.11.0",
+ "@truffle/provider": "^0.2.24",
+ "chalk": "^2.4.2",
+ "death": "^1.1.0",
+ "detect-port": "^1.3.0",
+ "fs-extra": "^8.1.0",
+ "ganache-cli": "^6.11.0",
+ "ghost-testrpc": "^0.0.2",
+ "global-modules": "^2.0.0",
+ "globby": "^10.0.1",
+ "jsonschema": "^1.2.4",
+ "lodash": "^4.17.15",
+ "node-emoji": "^1.10.0",
+ "pify": "^4.0.1",
+ "recursive-readdir": "^2.2.2",
+ "sc-istanbul": "^0.4.5",
+ "semver": "^7.3.4",
+ "shelljs": "^0.8.3",
+ "web3-utils": "^1.3.0"
+ },
+ "dependencies": {
+ "@solidity-parser/parser": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.11.1.tgz",
+ "integrity": "sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ=="
+ },
+ "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"
+ }
+ },
+ "fs-extra": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
+ "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
+ "requires": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^4.0.0",
+ "universalify": "^0.1.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"
+ }
+ },
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ },
+ "pify": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g=="
+ },
+ "semver": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+ "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "web3-utils": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.3.4.tgz",
+ "integrity": "sha512-/vC2v0MaZNpWooJfpRw63u0Y3ag2gNjAWiLtMSL6QQLmCqCy4SQIndMt/vRyx0uMoeGt1YTwSXEcHjUzOhLg0A==",
+ "requires": {
+ "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",
+ "randombytes": "^2.1.0",
+ "underscore": "1.9.1",
+ "utf8": "3.0.0"
+ }
+ },
+ "yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
+ }
+ }
+ },
"solium": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/solium/-/solium-1.2.5.tgz",
@@ -5183,6 +7587,11 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
},
+ "mimic-fn": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
+ },
"os-locale": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz",
@@ -5191,6 +7600,16 @@
"execa": "^0.7.0",
"lcid": "^1.0.0",
"mem": "^1.1.0"
+ },
+ "dependencies": {
+ "mem": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz",
+ "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=",
+ "requires": {
+ "mimic-fn": "^1.0.0"
+ }
+ }
}
},
"string-width": {
@@ -5261,6 +7680,22 @@
"urix": "^0.1.0"
}
},
+ "source-map-support": {
+ "version": "0.5.19",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
+ "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+ "requires": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
+ }
+ }
+ },
"source-map-url": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
@@ -5302,6 +7737,11 @@
"extend-shallow": "^3.0.0"
}
},
+ "sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
+ },
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
@@ -5657,7 +8097,6 @@
"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==",
- "optional": true,
"requires": {
"is-number": "^7.0.0"
}
@@ -5762,6 +8201,14 @@
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
},
+ "type-check": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
+ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
+ "requires": {
+ "prelude-ls": "~1.1.2"
+ }
+ },
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@@ -5779,6 +8226,12 @@
"is-typedarray": "^1.0.0"
}
},
+ "uglify-js": {
+ "version": "3.12.6",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.6.tgz",
+ "integrity": "sha512-aqWHe3DfQmZUDGWBbabZ2eQnJlQd1fKlMUu7gV+MiTuDzdgDw31bI3wA2jLLsV/hNcDP26IfyEgSVoft5+0SVw==",
+ "optional": true
+ },
"ultron": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
@@ -5906,6 +8359,14 @@
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
"integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ=="
},
+ "utf-8-validate": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz",
+ "integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==",
+ "requires": {
+ "node-gyp-build": "^4.2.0"
+ }
+ },
"utf8": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
@@ -5935,6 +8396,11 @@
"spdx-expression-parse": "^3.0.0"
}
},
+ "varint": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz",
+ "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow=="
+ },
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
@@ -6398,6 +8864,19 @@
}
}
},
+ "websocket": {
+ "version": "1.0.33",
+ "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.33.tgz",
+ "integrity": "sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA==",
+ "requires": {
+ "bufferutil": "^4.0.1",
+ "debug": "^2.2.0",
+ "es5-ext": "^0.10.50",
+ "typedarray-to-buffer": "^3.1.5",
+ "utf-8-validate": "^5.0.2",
+ "yaeti": "^0.0.6"
+ }
+ },
"whatwg-fetch": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.4.1.tgz",
@@ -6421,6 +8900,16 @@
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz",
"integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU="
},
+ "word-wrap": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
+ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ=="
+ },
+ "wordwrap": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus="
+ },
"wrap-ansi": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
diff --git a/package.json b/package.json
index 6a54081..ca66815 100644
--- a/package.json
+++ b/package.json
@@ -4,14 +4,27 @@
"description": "",
"main": "index.js",
"scripts": {
- "flatten": "truffle-flattener contracts/SwapProxy.sol > contracts/flattened/SwapProxy.sol"
+ "testrpc": "ganache-cli --gasLimit 13000000 -e 100000 -i 123",
+ "truffle": "truffle",
+ "truffle:test": "truffle test",
+ "truffle:compile": "truffle compile",
+ "truffle:migrate": "truffle migrate",
+ "coverage": "truffle run coverage --network development",
+ "test:ci": "scripts/run-test.sh",
+ "lint": "npm run lint:sol && npm run lint:js",
+ "lint:js": "eslint test/**/*.js",
+ "lint:sol:fix": "solium -d contracts/ --fix",
+ "lint:sol": "solium -d contracts/",
+ "flatten": "truffle-flattener contracts/bep20/BEP20UpgradeableProxy.sol > contracts/flattened/BEP20UpgradeableProxy.sol && truffle-flattener contracts/bep20/BEP20TokenImplementation.sol > contracts/flattened/BEP20TokenImplementation.sol && truffle-flattener contracts/BSCSwapAgentImpl.sol > contracts/flattened/BSCSwapAgentImpl.sol && truffle-flattener contracts/BSCSwapAgentUpgradeableProxy.sol > contracts/flattened/BSCSwapAgentUpgradeableProxy.sol && truffle-flattener contracts/ETHSwapAgentUpgradeableProxy.sol > contracts/flattened/ETHSwapAgentUpgradeableProxy.sol && truffle-flattener contracts/ETHSwapAgentImpl.sol > contracts/flattened/ETHSwapAgentImpl.sol",
+ "generate": "node generate-bsc-swap-agent.js && node generate-eth-swap-agent.js",
+ "generate-test": "node generate-bsc-swap-agent.js --mock true && node generate-eth-swap-agent.js --mock true"
},
"author": "",
"license": "MIT",
"dependencies": {
"commander": "^3.0.1",
"nunjucks": "^3.2.0",
- "@openzeppelin/contracts": "^3.1.0",
+ "openzeppelin-solidity": "3.3.0",
"solidity-bytes-utils": "0.0.8",
"solium": "^1.2.5",
"truffle-assertions": "0.9.2",
@@ -19,6 +32,11 @@
"web3": "1.2.6",
"await-sleep": "0.0.1",
"ethereum-input-data-decoder": "0.3.0",
- "rlp": "2.2.5"
+ "rlp": "2.2.5",
+ "elliptic": ">=6.5.3",
+ "minimist": ">=1.2.3",
+ "mem": ">=4.0.0",
+ "lodash": ">=4.17.19",
+ "solidity-coverage": "0.7.14"
}
}
diff --git a/test/TestSwap.js b/test/TestSwap.js
new file mode 100644
index 0000000..e804c22
--- /dev/null
+++ b/test/TestSwap.js
@@ -0,0 +1,206 @@
+const BSCSwapAgentImpl = artifacts.require("BSCSwapAgentImpl");
+const ETHSwapAgentImpl = artifacts.require("ETHSwapAgentImpl");
+
+const ERC20ABC = artifacts.require("ERC20ABC");
+const ERC20DEF = artifacts.require("ERC20DEF");
+const ERC20EMPTYNAME = artifacts.require("ERC20EMPTYNAME");
+const ERC20EMPTYSYMBOL = artifacts.require("ERC20EMPTYSYMBOL");
+
+const fs = require('fs');
+const Web3 = require('web3');
+const truffleAssert = require('truffle-assertions');
+const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
+
+let createdBEP20TokenAddr;
+let swapTxFromETH2BSC;
+
+contract('ETHSwapAgent and BSCSwapAgent', (accounts) => {
+ it('Register Standard ERC20 and create swap pair', async () => {
+ const ethSwap = await ETHSwapAgentImpl.deployed();
+ const bscSwap = await BSCSwapAgentImpl.deployed();
+
+ let isERC20ABCRegistered = await ethSwap.registeredERC20(ERC20ABC.address);
+ assert.equal(isERC20ABCRegistered, false, "wrong register status");
+ let isERC20DEFRegistered = await ethSwap.registeredERC20(ERC20DEF.address);
+ assert.equal(isERC20DEFRegistered, false, "wrong register status");
+
+ let registerTx = await ethSwap.registerSwapPairToBSC(ERC20ABC.address, {from: accounts[0]});
+ truffleAssert.eventEmitted(registerTx, "SwapPairRegister",(ev) => {
+ return ev.erc20Addr === ERC20ABC.address && ev.name.toString() === "ABC token" && ev.symbol.toString() === "ABC" && ev.decimals.toString() === "18";
+ });
+
+ // create bsc swap pair
+ let createTx = await bscSwap.createSwapPair(registerTx.tx, ERC20ABC.address, "ABC token", "ABC", web3.utils.toBN(18), {from: accounts[0]});
+ truffleAssert.eventEmitted(createTx, "SwapPairCreated",(ev) => {
+ createdBEP20TokenAddr = ev.bep20Addr;
+ return ev.ethRegisterTxHash === registerTx.tx && ev.erc20Addr === ERC20ABC.address && ev.symbol.toString() === "ABC" && ev.decimals.toString() === "18";
+ });
+
+ // created pair
+ try {
+ await bscSwap.createSwapPair(registerTx.tx, ERC20ABC.address, "ABC token", "ABC", web3.utils.toBN(18), {from: accounts[0]});
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("duplicated swap pair"))
+ }
+
+ // registered
+ try {
+ await ethSwap.registerSwapPairToBSC(ERC20ABC.address, {from: accounts[0]});
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("already registered"))
+ }
+
+ // empty name
+ try {
+ await ethSwap.registerSwapPairToBSC(ERC20EMPTYNAME.address, {from: accounts[0]});
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("empty name"))
+ }
+
+ // empty symbol
+ try {
+ await ethSwap.registerSwapPairToBSC(ERC20EMPTYSYMBOL.address, {from: accounts[0]});
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("empty symbol"))
+ }
+ });
+
+ it('Swap from ETH to BSC', async () => {
+ const ethSwap = await ETHSwapAgentImpl.deployed();
+ const erc20ABC = await ERC20ABC.deployed();
+
+ await erc20ABC.approve(ETHSwapAgentImpl.address, "1000000000000", {from: accounts[0]})
+
+ try {
+ await ethSwap.swapETH2BSC(ERC20ABC.address, "100000", {from: accounts[0]})
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("swap fee not equal"))
+ }
+
+ try {
+ await ethSwap.swapETH2BSC(ERC20DEF.address, "100000", {from: accounts[0], value:web3.utils.toBN(10000000)})
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("not registered token"))
+ }
+
+ let swapTx = await ethSwap.swapETH2BSC(ERC20ABC.address, "100000", {from: accounts[0], value:web3.utils.toBN(10000000)});
+
+ truffleAssert.eventEmitted(swapTx, "SwapStarted",(ev) => {
+ swapTxFromETH2BSC = swapTx.tx;
+ return ev.erc20Addr === ERC20ABC.address && ev.fromAddr === accounts[0] && ev.amount.toString() === "100000";
+ });
+
+ let fillTx = await ethSwap.fillBSC2ETHSwap(swapTxFromETH2BSC, ERC20ABC.address, accounts[0], "100000", {from: accounts[0]});
+ truffleAssert.eventEmitted(fillTx, "SwapFilled",(ev) => {
+ swapTxFromETH2BSC = swapTx.tx;
+ return ev.erc20Addr === ERC20ABC.address && ev.amount.toString() === "100000";
+ });
+
+ // fill unregistered
+ try {
+ await ethSwap.fillBSC2ETHSwap(swapTxFromETH2BSC, ERC20DEF.address, accounts[0], "100000", {from: accounts[0]})
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("bsc tx filled already"))
+ }
+
+ // fill filled tx
+ try {
+ await ethSwap.fillBSC2ETHSwap(swapTxFromETH2BSC, ERC20DEF.address, accounts[0], "100000", {from: accounts[0]})
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("bsc tx filled already"))
+ }
+
+ // fill unregistered token
+ try {
+ await ethSwap.fillBSC2ETHSwap("0x01", ERC20DEF.address, accounts[0], "100000", {from: accounts[0]})
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("not registered token"))
+ }
+ });
+
+ it('Swap from BSC to ETH', async () => {
+ const bscSwap = await BSCSwapAgentImpl.deployed();
+
+ const erc20ABIJsonFile = "test/abi/erc20ABI.json";
+ const erc20ABI= JSON.parse(fs.readFileSync(erc20ABIJsonFile));
+ const createdBEP2OToken = new web3.eth.Contract(erc20ABI, createdBEP20TokenAddr);
+
+ await createdBEP2OToken.methods.approve(BSCSwapAgentImpl.address, "1000000000000").send({from: accounts[0]});
+
+ let fillTx = await bscSwap.fillETH2BSCSwap(swapTxFromETH2BSC, ERC20ABC.address, accounts[0], "100000", {from: accounts[0]});
+ truffleAssert.eventEmitted(fillTx, "SwapFilled",(ev) => {
+ return ev.bep20Addr === createdBEP20TokenAddr && ev.amount.toString() === "100000";
+ });
+
+ let swapTx = await bscSwap.swapBSC2ETH(createdBEP20TokenAddr, "100000", {from: accounts[0], value:web3.utils.toBN(10000000000000000)});
+
+ truffleAssert.eventEmitted(swapTx, "SwapStarted",(ev) => {
+ return ev.bep20Addr === createdBEP20TokenAddr && ev.erc20Addr === ERC20ABC.address && ev.amount.toString() === "100000";
+ });
+
+ // fill filled tx
+ try {
+ await bscSwap.fillETH2BSCSwap(swapTxFromETH2BSC, ERC20DEF.address, accounts[0], "100000", {from: accounts[0]});
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("eth tx filled already"))
+ }
+
+ // fill unregistered token
+ try {
+ await bscSwap.fillETH2BSCSwap("0x01", ERC20DEF.address, accounts[0], "100000", {from: accounts[0]});
+ assert.fail();
+ } catch (error) {
+ assert.ok(error.toString().includes("no swap pair for this token"))
+ }
+ });
+
+ it('Set BSC to ETH swap fee', async () => {
+ const bscSwap = await BSCSwapAgentImpl.deployed();
+
+ await bscSwap.setSwapFee("100000", {from: accounts[0]});
+ let swapFee = await bscSwap.swapFee();
+
+ assert.ok(swapFee.toString() === "100000");
+ });
+
+ it('Set ETH to BSC swap fee', async () => {
+ const ethSwap = await ETHSwapAgentImpl.deployed();
+
+ await ethSwap.setSwapFee("100000", {from: accounts[0]});
+ let swapFee = await ethSwap.swapFee();
+
+ assert.ok(swapFee.toString() === "100000");
+ });
+
+ it('ETH ownership', async () => {
+ const ethSwap = await ETHSwapAgentImpl.deployed();
+
+ await ethSwap.transferOwnership(accounts[1], {from: accounts[0]});
+ let newOwner = await ethSwap.owner();
+
+ assert.ok(newOwner === accounts[1]);
+
+ await ethSwap.renounceOwnership({from: accounts[1]});
+ });
+
+ it('BSC ownership', async () => {
+ const bscSwap = await BSCSwapAgentImpl.deployed();
+
+ await bscSwap.transferOwnership(accounts[1], {from: accounts[0]});
+ let newOwner = await bscSwap.owner();
+
+ assert.ok(newOwner === accounts[1]);
+
+ await bscSwap.renounceOwnership({from: accounts[1]});
+ });
+});
\ No newline at end of file
diff --git a/test/abi/erc20ABI.json b/test/abi/erc20ABI.json
new file mode 100644
index 0000000..dfa0c10
--- /dev/null
+++ b/test/abi/erc20ABI.json
@@ -0,0 +1,185 @@
+[
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "spender",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "value",
+ "type": "uint256"
+ }
+ ],
+ "name": "Approval",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "from",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "to",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "value",
+ "type": "uint256"
+ }
+ ],
+ "name": "Transfer",
+ "type": "event"
+ },
+ {
+ "inputs": [],
+ "name": "totalSupply",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ }
+ ],
+ "name": "balanceOf",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "recipient",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
+ }
+ ],
+ "name": "transfer",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "owner",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "spender",
+ "type": "address"
+ }
+ ],
+ "name": "allowance",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "spender",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
+ }
+ ],
+ "name": "approve",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "sender",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "recipient",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
+ }
+ ],
+ "name": "transferFrom",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ }
+]
\ No newline at end of file
diff --git a/truffle-config.js b/truffle-config.js
index 7a90d76..18dc594 100644
--- a/truffle-config.js
+++ b/truffle-config.js
@@ -42,11 +42,11 @@ module.exports = {
// tab if you use this network and you must also set the `host`, `port` and `network_id`
// options below to some value.
//
- // development: {
- // host: "127.0.0.1", // Localhost (default: none)
- // port: 8545, // Standard Ethereum port (default: none)
- // network_id: "*", // Any network (default: none)
- // },
+ development: {
+ host: "127.0.0.1", // Localhost (default: none)
+ port: 8545, // Standard Ethereum port (default: none)
+ network_id: "*", // Any network (default: none)
+ },
// Another network with more advanced options...
// advanced: {
@@ -81,19 +81,18 @@ module.exports = {
mocha: {
// timeout: 100000
},
-
+ plugins: ["solidity-coverage"],
// Configure your compilers
compilers: {
solc: {
- // version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version)
- // docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
- // settings: { // See the solidity docs for advice about optimization and evmVersion
- // optimizer: {
- // enabled: false,
- // runs: 200
- // },
- // evmVersion: "byzantium"
- // }
+ version: "0.6.4", // Fetch exact version from solc-bin (default: truffle's version)
+ docker: false, // Use "0.5.1" you've installed locally with docker (default: false)
+ settings: { // See the solidity docs for advice about optimization and evmVersion
+ optimizer: {
+ enabled: true,
+ runs: 200
+ }
+ }
}
}
}