diff --git a/packages/hardhat-core/test/internal/hardhat-network/abi/ERC20/ERC20.json b/packages/hardhat-core/test/internal/hardhat-network/abi/ERC20/ERC20.json deleted file mode 100644 index 369b77adb5..0000000000 --- a/packages/hardhat-core/test/internal/hardhat-network/abi/ERC20/ERC20.json +++ /dev/null @@ -1,563 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "uint256", - "name": "chainId_", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "src", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "guy", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": true, - "inputs": [ - { - "indexed": true, - "internalType": "bytes4", - "name": "sig", - "type": "bytes4" - }, - { - "indexed": true, - "internalType": "address", - "name": "usr", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "arg1", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "arg2", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "LogNote", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "src", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "dst", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "PERMIT_TYPEHASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "usr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "usr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "guy", - "type": "address" - } - ], - "name": "deny", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "usr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "src", - "type": "address" - }, - { - "internalType": "address", - "name": "dst", - "type": "address" - }, - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "move", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "nonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "allowed", - "type": "bool" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "permit", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "usr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "pull", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "usr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "push", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "guy", - "type": "address" - } - ], - "name": "rely", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "dst", - "type": "address" - }, - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "src", - "type": "address" - }, - { - "internalType": "address", - "name": "dst", - "type": "address" - }, - { - "internalType": "uint256", - "name": "wad", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "wards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } -] diff --git a/packages/hardhat-core/test/internal/hardhat-network/abi/Uniswap/Exchange.json b/packages/hardhat-core/test/internal/hardhat-network/abi/Uniswap/Exchange.json deleted file mode 100644 index a256e5fef0..0000000000 --- a/packages/hardhat-core/test/internal/hardhat-network/abi/Uniswap/Exchange.json +++ /dev/null @@ -1,971 +0,0 @@ -[ - { - "name": "TokenPurchase", - "inputs": [ - { - "type": "address", - "name": "buyer", - "indexed": true - }, - { - "type": "uint256", - "name": "eth_sold", - "indexed": true - }, - { - "type": "uint256", - "name": "tokens_bought", - "indexed": true - } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "EthPurchase", - "inputs": [ - { - "type": "address", - "name": "buyer", - "indexed": true - }, - { - "type": "uint256", - "name": "tokens_sold", - "indexed": true - }, - { - "type": "uint256", - "name": "eth_bought", - "indexed": true - } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "AddLiquidity", - "inputs": [ - { - "type": "address", - "name": "provider", - "indexed": true - }, - { - "type": "uint256", - "name": "eth_amount", - "indexed": true - }, - { - "type": "uint256", - "name": "token_amount", - "indexed": true - } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "RemoveLiquidity", - "inputs": [ - { - "type": "address", - "name": "provider", - "indexed": true - }, - { - "type": "uint256", - "name": "eth_amount", - "indexed": true - }, - { - "type": "uint256", - "name": "token_amount", - "indexed": true - } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "Transfer", - "inputs": [ - { - "type": "address", - "name": "_from", - "indexed": true - }, - { - "type": "address", - "name": "_to", - "indexed": true - }, - { - "type": "uint256", - "name": "_value", - "indexed": false - } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "Approval", - "inputs": [ - { - "type": "address", - "name": "_owner", - "indexed": true - }, - { - "type": "address", - "name": "_spender", - "indexed": true - }, - { - "type": "uint256", - "name": "_value", - "indexed": false - } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "setup", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "token_addr" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "addLiquidity", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "min_liquidity" - }, - { - "type": "uint256", - "name": "max_tokens" - }, - { - "type": "uint256", - "name": "deadline" - } - ], - "constant": false, - "payable": true, - "type": "function" - }, - { - "name": "removeLiquidity", - "outputs": [ - { - "type": "uint256", - "name": "out" - }, - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "amount" - }, - { - "type": "uint256", - "name": "min_eth" - }, - { - "type": "uint256", - "name": "min_tokens" - }, - { - "type": "uint256", - "name": "deadline" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "__default__", - "outputs": [], - "inputs": [], - "constant": false, - "payable": true, - "type": "function" - }, - { - "name": "ethToTokenSwapInput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "min_tokens" - }, - { - "type": "uint256", - "name": "deadline" - } - ], - "constant": false, - "payable": true, - "type": "function" - }, - { - "name": "ethToTokenTransferInput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "min_tokens" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "recipient" - } - ], - "constant": false, - "payable": true, - "type": "function" - }, - { - "name": "ethToTokenSwapOutput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_bought" - }, - { - "type": "uint256", - "name": "deadline" - } - ], - "constant": false, - "payable": true, - "type": "function" - }, - { - "name": "ethToTokenTransferOutput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_bought" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "recipient" - } - ], - "constant": false, - "payable": true, - "type": "function" - }, - { - "name": "tokenToEthSwapInput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_sold" - }, - { - "type": "uint256", - "name": "min_eth" - }, - { - "type": "uint256", - "name": "deadline" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToEthTransferInput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_sold" - }, - { - "type": "uint256", - "name": "min_eth" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "recipient" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToEthSwapOutput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "eth_bought" - }, - { - "type": "uint256", - "name": "max_tokens" - }, - { - "type": "uint256", - "name": "deadline" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToEthTransferOutput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "eth_bought" - }, - { - "type": "uint256", - "name": "max_tokens" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "recipient" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToTokenSwapInput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_sold" - }, - { - "type": "uint256", - "name": "min_tokens_bought" - }, - { - "type": "uint256", - "name": "min_eth_bought" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "token_addr" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToTokenTransferInput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_sold" - }, - { - "type": "uint256", - "name": "min_tokens_bought" - }, - { - "type": "uint256", - "name": "min_eth_bought" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "recipient" - }, - { - "type": "address", - "name": "token_addr" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToTokenSwapOutput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_bought" - }, - { - "type": "uint256", - "name": "max_tokens_sold" - }, - { - "type": "uint256", - "name": "max_eth_sold" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "token_addr" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToTokenTransferOutput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_bought" - }, - { - "type": "uint256", - "name": "max_tokens_sold" - }, - { - "type": "uint256", - "name": "max_eth_sold" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "recipient" - }, - { - "type": "address", - "name": "token_addr" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToExchangeSwapInput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_sold" - }, - { - "type": "uint256", - "name": "min_tokens_bought" - }, - { - "type": "uint256", - "name": "min_eth_bought" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "exchange_addr" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToExchangeTransferInput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_sold" - }, - { - "type": "uint256", - "name": "min_tokens_bought" - }, - { - "type": "uint256", - "name": "min_eth_bought" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "recipient" - }, - { - "type": "address", - "name": "exchange_addr" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToExchangeSwapOutput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_bought" - }, - { - "type": "uint256", - "name": "max_tokens_sold" - }, - { - "type": "uint256", - "name": "max_eth_sold" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "exchange_addr" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "tokenToExchangeTransferOutput", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_bought" - }, - { - "type": "uint256", - "name": "max_tokens_sold" - }, - { - "type": "uint256", - "name": "max_eth_sold" - }, - { - "type": "uint256", - "name": "deadline" - }, - { - "type": "address", - "name": "recipient" - }, - { - "type": "address", - "name": "exchange_addr" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "getEthToTokenInputPrice", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "eth_sold" - } - ], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "getEthToTokenOutputPrice", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_bought" - } - ], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "getTokenToEthInputPrice", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "tokens_sold" - } - ], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "getTokenToEthOutputPrice", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "eth_bought" - } - ], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "tokenAddress", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "factoryAddress", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "balanceOf", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "_owner" - } - ], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "transfer", - "outputs": [ - { - "type": "bool", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "_to" - }, - { - "type": "uint256", - "name": "_value" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "transferFrom", - "outputs": [ - { - "type": "bool", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "_from" - }, - { - "type": "address", - "name": "_to" - }, - { - "type": "uint256", - "name": "_value" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "approve", - "outputs": [ - { - "type": "bool", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "_spender" - }, - { - "type": "uint256", - "name": "_value" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "allowance", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "_owner" - }, - { - "type": "address", - "name": "_spender" - } - ], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "name", - "outputs": [ - { - "type": "bytes32", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "symbol", - "outputs": [ - { - "type": "bytes32", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "decimals", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "totalSupply", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function" - } -] diff --git a/packages/hardhat-core/test/internal/hardhat-network/abi/Uniswap/Factory.json b/packages/hardhat-core/test/internal/hardhat-network/abi/Uniswap/Factory.json deleted file mode 100644 index 3056fcc4fc..0000000000 --- a/packages/hardhat-core/test/internal/hardhat-network/abi/Uniswap/Factory.json +++ /dev/null @@ -1,130 +0,0 @@ -[ - { - "name": "NewExchange", - "inputs": [ - { - "type": "address", - "name": "token", - "indexed": true - }, - { - "type": "address", - "name": "exchange", - "indexed": true - } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "initializeFactory", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "template" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "createExchange", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "token" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "getExchange", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "token" - } - ], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "getToken", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "exchange" - } - ], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "getTokenWithId", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "token_id" - } - ], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "exchangeTemplate", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function" - }, - { - "name": "tokenCount", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function" - } -] diff --git a/packages/hardhat-core/test/internal/hardhat-network/provider/forked-provider.ts b/packages/hardhat-core/test/internal/hardhat-network/provider/forked-provider.ts index b3d71931a6..d2378764c8 100644 --- a/packages/hardhat-core/test/internal/hardhat-network/provider/forked-provider.ts +++ b/packages/hardhat-core/test/internal/hardhat-network/provider/forked-provider.ts @@ -1,8 +1,5 @@ import { assert } from "chai"; import { BN, bufferToHex, toBuffer } from "ethereumjs-util"; -// eslint-disable-next-line import/no-extraneous-dependencies -import { Contract, utils, Wallet } from "ethers"; -import fsExtra from "fs-extra"; import { numberToRpcQuantity, @@ -29,25 +26,15 @@ import { } from "../helpers/constants"; import { EXAMPLE_CONTRACT } from "../helpers/contracts"; import { setCWD } from "../helpers/cwd"; -import { EthersProviderWrapper } from "../helpers/ethers-provider-wrapper"; import { hexStripZeros } from "../helpers/hexStripZeros"; import { leftPad32 } from "../helpers/leftPad32"; import { - DEFAULT_ACCOUNTS, DEFAULT_ACCOUNTS_ADDRESSES, FORKED_PROVIDERS, } from "../helpers/providers"; import { retrieveForkBlockNumber } from "../helpers/retrieveForkBlockNumber"; import { deployContract } from "../helpers/transactions"; -const ERC20Abi = fsExtra.readJsonSync(`${__dirname}/../abi/ERC20/ERC20.json`); -const UniswapExchangeAbi = fsExtra.readJsonSync( - `${__dirname}/../abi/Uniswap/Exchange.json` -); -const UniswapFactoryAbi = fsExtra.readJsonSync( - `${__dirname}/../abi/Uniswap/Factory.json` -); - const WETH_DEPOSIT_SELECTOR = "0xd0e30db0"; describe("Forked provider", function () { @@ -501,72 +488,6 @@ describe("Forked provider", function () { }); }); - describe("Tests on remote contracts", () => { - describe("Uniswap", () => { - let wallet: Wallet; - let factory: Contract; - let daiExchange: Contract; - let dai: Contract; - - beforeEach(async function () { - const ethersProvider = new EthersProviderWrapper(this.provider); - wallet = new Wallet(DEFAULT_ACCOUNTS[0].privateKey, ethersProvider); - - factory = new Contract( - UNISWAP_FACTORY_ADDRESS.toString(), - UniswapFactoryAbi, - ethersProvider - ); - - const daiExchangeAddress = await factory.getExchange( - DAI_ADDRESS.toString() - ); - - daiExchange = new Contract( - daiExchangeAddress, - UniswapExchangeAbi, - wallet - ); - - dai = new Contract( - DAI_ADDRESS.toString(), - ERC20Abi, - ethersProvider - ); - }); - - it("can buy DAI for Ether", async function () { - const ethBefore = await wallet.getBalance(); - const daiBefore = await dai.balanceOf(wallet.address); - assert.equal(daiBefore.toNumber(), 0); - - const expectedDai = await daiExchange.getEthToTokenInputPrice( - utils.parseEther("0.5") - ); - assert.isTrue(expectedDai.gt(0)); - - await daiExchange.ethToTokenSwapInput( - 1, // min amount of token retrieved - 2525644800, // random timestamp in the future (year 2050) - { - gasLimit: 4000000, - value: utils.parseEther("0.5"), - } - ); - - const ethAfter = await wallet.getBalance(); - const daiAfter = await dai.balanceOf(wallet.address); - - const ethLost = parseFloat( - utils.formatUnits(ethBefore.sub(ethAfter), "ether") - ); - - assert.equal(daiAfter.toString(), expectedDai.toString()); - assert.closeTo(ethLost, 0.5, 0.01); - }); - }); - }); - describe("blocks timestamps", () => { it("should use a timestamp relative to the forked block timestamp", async function () { if (ALCHEMY_URL === undefined) {