From 62f91c4331191f546edd48d520a4d819a8afac51 Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Wed, 11 Sep 2019 18:25:26 -0300 Subject: [PATCH 01/10] Improved address mapper test --- src/tests/e2e/address-mapper-tests.ts | 67 +++++++++++++++++++-------- src/tests/e2e_tests.ts | 54 ++++++++++----------- 2 files changed, 74 insertions(+), 47 deletions(-) diff --git a/src/tests/e2e/address-mapper-tests.ts b/src/tests/e2e/address-mapper-tests.ts index 90585282..f13cf585 100644 --- a/src/tests/e2e/address-mapper-tests.ts +++ b/src/tests/e2e/address-mapper-tests.ts @@ -10,18 +10,16 @@ import { } from '../../index' import { createTestHttpClient } from '../helpers' import { EthersSigner, getJsonRPCSignerAsync } from '../../solidity-helpers' -import { ethers, Signer } from 'ethers' async function getClientAndContract( - createClient: () => Client + createClient: () => Client, + privateKey: string ): Promise<{ client: Client addressMapper: Contracts.AddressMapper pubKey: Uint8Array }> { - const privKey = CryptoUtils.B64ToUint8Array( - 'RkNvOsko0nQFrJnXXVbmjGyaVmjQyr+ecJG8qGiF1LisazmV44qDcpsVsYvQZ9jxx7mIWJuZumIzYyLL6FOb4A==' - ) + const privKey = CryptoUtils.B64ToUint8Array(privateKey) const pubKey = CryptoUtils.publicKeyFromPrivateKey(privKey) const client = createClient() client.txMiddleware = createDefaultTxMiddleware(client, privKey) @@ -34,31 +32,60 @@ async function getClientAndContract( return { client, addressMapper, pubKey } } -async function testAddIdentity(t: test.Test, createClient: () => Client) { - const { client, addressMapper, pubKey } = await getClientAndContract(createClient) +test('Should add identity to mapping', async t => { + const { client, addressMapper, pubKey } = await getClientAndContract( + createTestHttpClient, + 'RkNvOsko0nQFrJnXXVbmjGyaVmjQyr+ecJG8qGiF1LisazmV44qDcpsVsYvQZ9jxx7mIWJuZumIzYyLL6FOb4A==' + ) - const ethAddress = '0xffcf8fdee72ac11b5c542428b35eef5769c409f0' - const from = new Address('eth', LocalAddress.fromHexString(ethAddress)) - const to = new Address(client.chainId, LocalAddress.fromPublicKey(pubKey)) + try { + const ethAddress = '0xffcf8fdee72ac11b5c542428b35eef5769c409f0' + const from = new Address('eth', LocalAddress.fromHexString(ethAddress)) + const to = new Address(client.chainId, LocalAddress.fromPublicKey(pubKey)) - const ethers = await getJsonRPCSignerAsync('http://localhost:8545', 1) - const ethersSigner = new EthersSigner(ethers) + const ethers = await getJsonRPCSignerAsync('http://localhost:8545', 1) + const ethersSigner = new EthersSigner(ethers) - await addressMapper.addIdentityMappingAsync(from, to, ethersSigner) + await addressMapper.addIdentityMappingAsync(from, to, ethersSigner) - const result = await addressMapper.getMappingAsync(from) + const result = await addressMapper.getMappingAsync(from) - t.assert(from.equals(result.from), 'Identity "from" correctly returned') - t.assert(to.equals(result.to), 'Identity "to" correctly returned') + t.assert(from.equals(result.from), 'Identity "from" correctly returned') + t.assert(to.equals(result.to), 'Identity "to" correctly returned') + } catch (err) { + t.error(err) + } client.disconnect() -} + t.end() +}) + +test('Should has mapping identity added correctly', async t => { + const { client, addressMapper, pubKey } = await getClientAndContract( + createTestHttpClient, + '1UgjYgUMZUhGzCfoRxEYFIOJPZQ3y4JjiJ0LdWdvrQO3RySLGno9bhlSWdtqaImycU2wcslcF/7K6GAHGMxe+A==' + ) -test('Address Mapper', async t => { try { - await testAddIdentity(t, createTestHttpClient) + const ethAddress = '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b' + const from = new Address('eth', LocalAddress.fromHexString(ethAddress)) + const to = new Address(client.chainId, LocalAddress.fromPublicKey(pubKey)) + + const ethers = await getJsonRPCSignerAsync('http://localhost:8545', 2) + const ethersSigner = new EthersSigner(ethers) + + await addressMapper.addIdentityMappingAsync(from, to, ethersSigner) + + const result = await addressMapper.hasMappingAsync(from) + + t.assert(result, 'Mapping has added with success') } catch (err) { - t.fail(err) + t.error(err) } + + client.disconnect() t.end() }) + +// TODO: Add Binance test +test.skip('Should add Binance identity to mapping', async t => {}) diff --git a/src/tests/e2e_tests.ts b/src/tests/e2e_tests.ts index f87b081a..bf76f0e8 100644 --- a/src/tests/e2e_tests.ts +++ b/src/tests/e2e_tests.ts @@ -1,38 +1,38 @@ -// Client WS-RPC -import './e2e/ws-rpc-client-tests' +// // Client WS-RPC +// import './e2e/ws-rpc-client-tests' -// Loom Provider -import './e2e/loom-provider-tests' -import './e2e/loom-provider-eth-get-logs' -import './e2e/loom-provider-eth-filters' -import './e2e/loom-provider-eth-filters-2' -import './e2e/loom-provider-subscribe' -import './e2e/loom-provider-web3-tests' -import './e2e/loom-provider-web3-middlewares-tests' -import './e2e/loom-provider-web3-child-events' +// // Loom Provider +// import './e2e/loom-provider-tests' +// import './e2e/loom-provider-eth-get-logs' +// import './e2e/loom-provider-eth-filters' +// import './e2e/loom-provider-eth-filters-2' +// import './e2e/loom-provider-subscribe' +// import './e2e/loom-provider-web3-tests' +// import './e2e/loom-provider-web3-middlewares-tests' +// import './e2e/loom-provider-web3-child-events' -// EVM -import './e2e/client-evm-tests' -import './e2e/client-evm-event-tests' -import './e2e/client-evm-event-tests-2' +// // EVM +// import './e2e/client-evm-tests' +// import './e2e/client-evm-event-tests' +// import './e2e/client-evm-event-tests-2' -// Middlewares -import './e2e/client-test-tx-cache' -import './e2e/client-test-tx-middleware' -import './e2e/tron-test-tx-middleware' -import './e2e/binance-test-tx-middleware' +// // Middlewares +// import './e2e/client-test-tx-cache' +// import './e2e/client-test-tx-middleware' +// import './e2e/tron-test-tx-middleware' +// import './e2e/binance-test-tx-middleware' -// Events -import './e2e/multiple-events-nd-tests' +// // Events +// import './e2e/multiple-events-nd-tests' // Contracts -import './e2e/coin-tests' +// import './e2e/coin-tests' import './e2e/address-mapper-tests' // TODO: Re-enable once this is updated to DPOSv2 //import './e2e/dpos-tests' -// Weave Blueprint Contract -import './e2e/contract-tests' +// // Weave Blueprint Contract +// import './e2e/contract-tests' -// Simple Store Contract -import './e2e/evm-contract-tests' +// // Simple Store Contract +// import './e2e/evm-contract-tests' From 354316daf418394ed1e739d540857c915c2b247d Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Wed, 11 Sep 2019 19:00:08 -0300 Subject: [PATCH 02/10] Improved coin test --- src/tests/e2e/coin-tests.ts | 66 +++++++++++++------------------------ src/tests/e2e_tests.ts | 4 +-- 2 files changed, 25 insertions(+), 45 deletions(-) diff --git a/src/tests/e2e/coin-tests.ts b/src/tests/e2e/coin-tests.ts index bc90d96b..3af02748 100644 --- a/src/tests/e2e/coin-tests.ts +++ b/src/tests/e2e/coin-tests.ts @@ -54,16 +54,17 @@ async function getClientAndContract( return { acct1Client, acct1Coin, acct1PubKey, acct2Client, acct2Coin, acct2PubKey } } -async function testTotalSupply(t: test.Test, createClient: () => Client) { - const { acct1Client, acct1Coin } = await getClientAndContract(createClient) +test('Should get total supply', async (t: test.Test) => { + const { acct1Client, acct1Coin } = await getClientAndContract(createTestHttpClient) const totalSupply = await acct1Coin.getTotalSupplyAsync() t.assert(totalSupply.eq(toCoinE18(100)), 'Total Supply should be 100e18') acct1Client.disconnect() -} + t.end() +}) -async function testBalanceOf(t: test.Test, createClient: () => Client) { +test('Should get balanceOf', async (t: test.Test) => { const { acct1Client, acct1Coin, @@ -71,7 +72,7 @@ async function testBalanceOf(t: test.Test, createClient: () => Client) { acct2Client, acct2Coin, acct2PubKey - } = await getClientAndContract(createClient) + } = await getClientAndContract(createTestHttpClient) const acct1Owner = new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) const acct1Balance = await acct1Coin.getBalanceOfAsync(acct1Owner) @@ -85,9 +86,10 @@ async function testBalanceOf(t: test.Test, createClient: () => Client) { acct1Client.disconnect() acct2Client.disconnect() -} + t.end() +}) -async function testTransfer(t: test.Test, createClient: () => Client) { +test('Should get correct balanceOf after transfer', async (t: test.Test) => { const { acct1Client, acct1Coin, @@ -95,7 +97,7 @@ async function testTransfer(t: test.Test, createClient: () => Client) { acct2Client, acct2Coin, acct2PubKey - } = await getClientAndContract(createClient) + } = await getClientAndContract(createTestHttpClient) const from = new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) const to = new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) @@ -110,41 +112,32 @@ async function testTransfer(t: test.Test, createClient: () => Client) { acct1Client.disconnect() acct2Client.disconnect() -} - -async function testApprove(t: test.Test, createClient: () => Client) { - const { acct1Client, acct1Coin, acct2Client, acct2PubKey } = await getClientAndContract( - createClient - ) - - const spender = new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) - - await acct1Coin.approveAsync(spender, toCoinE18(1)) - - acct1Client.disconnect() -} + t.end() +}) -async function testAllowance(t: test.Test, createClient: () => Client) { +test('Should correctly approve transfer', async (t: test.Test) => { const { acct1Client, acct1Coin, - acct1PubKey, acct2Client, + acct1PubKey, acct2PubKey - } = await getClientAndContract(createClient) + } = await getClientAndContract(createTestHttpClient) - const spender = new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) const owner = new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + const spender = new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) - const allowance = await acct1Coin.getAllowanceAsync(owner, spender) + await acct1Coin.approveAsync(spender, toCoinE18(1)) + const bn = await acct1Coin.getAllowanceAsync(owner, spender) - t.assert(allowance.eq(toCoinE18(1)), 'Allowance should be 1') + t.isEqual(bn.toString(), toCoinE18(1).toString(), 'Approved the allowance correctly') acct1Client.disconnect() acct2Client.disconnect() -} + t.end() +}) -async function testTransferFrom(t: test.Test, createClient: () => Client) { +test('Should correctly approve transfer', async (t: test.Test) => { const { acct1Client, acct1Coin, @@ -152,7 +145,7 @@ async function testTransferFrom(t: test.Test, createClient: () => Client) { acct2Client, acct2Coin, acct2PubKey - } = await getClientAndContract(createClient) + } = await getClientAndContract(createTestHttpClient) const spender = new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) const owner = new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) @@ -167,18 +160,5 @@ async function testTransferFrom(t: test.Test, createClient: () => Client) { acct1Client.disconnect() acct2Client.disconnect() -} - -test('Coin', async t => { - try { - await testTotalSupply(t, createTestHttpClient) - await testBalanceOf(t, createTestHttpClient) - await testTransfer(t, createTestHttpClient) - await testApprove(t, createTestHttpClient) - await testAllowance(t, createTestHttpClient) - await testTransferFrom(t, createTestHttpClient) - } catch (err) { - t.fail(err) - } t.end() }) diff --git a/src/tests/e2e_tests.ts b/src/tests/e2e_tests.ts index bf76f0e8..b568b609 100644 --- a/src/tests/e2e_tests.ts +++ b/src/tests/e2e_tests.ts @@ -26,8 +26,8 @@ // import './e2e/multiple-events-nd-tests' // Contracts -// import './e2e/coin-tests' -import './e2e/address-mapper-tests' +import './e2e/coin-tests' +// import './e2e/address-mapper-tests' // TODO: Re-enable once this is updated to DPOSv2 //import './e2e/dpos-tests' From 5425b79097c46b0c833497e6faedc4937f0cf7e2 Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Thu, 12 Sep 2019 13:53:44 -0300 Subject: [PATCH 03/10] Adding ethcoin test --- e2e_support/genesis.json | 24 +++-- src/tests/e2e/ethcoin-tests.ts | 164 +++++++++++++++++++++++++++++++++ src/tests/e2e_tests.ts | 3 +- 3 files changed, 183 insertions(+), 8 deletions(-) create mode 100644 src/tests/e2e/ethcoin-tests.ts diff --git a/e2e_support/genesis.json b/e2e_support/genesis.json index 51eeb2af..7dd6062f 100644 --- a/e2e_support/genesis.json +++ b/e2e_support/genesis.json @@ -24,6 +24,23 @@ ] } }, + { + "vm": "plugin", + "format": "plugin", + "name": "ethcoin", + "location": "ethcoin:1.0.0", + "init": { + "accounts": [ + { + "owner": { + "chain_id": "default", + "local": "dHVZ95Bqnn3dsget6tyq72cJS3E=" + }, + "balance": 100 + } + ] + } + }, { "vm": "plugin", "format": "plugin", @@ -66,13 +83,6 @@ ] } }, - { - "vm": "plugin", - "format": "plugin", - "name": "ethcoin", - "location": "ethcoin:1.0.0", - "init": null - }, { "vm": "plugin", "format": "plugin", diff --git a/src/tests/e2e/ethcoin-tests.ts b/src/tests/e2e/ethcoin-tests.ts new file mode 100644 index 00000000..b1d02b93 --- /dev/null +++ b/src/tests/e2e/ethcoin-tests.ts @@ -0,0 +1,164 @@ +import test from 'tape' +import BN from 'bn.js' +import { + Address, + Contracts, + CryptoUtils, + createDefaultTxMiddleware, + Client, + LocalAddress +} from '../../index' +import { createTestHttpClient } from '../helpers' +import { B64ToUint8Array } from '../../crypto-utils' + +const toEthCoinE18 = (amount: number): BN => { + return new BN(10).pow(new BN(18)).mul(new BN(amount)) +} + +async function getClientAndContract( + createClient: () => Client +): Promise<{ + acct1Client: Client + acct2Client: Client + acct1EthCoin: Contracts.EthCoin + acct2EthCoin: Contracts.EthCoin + acct1PubKey: Uint8Array + acct2PubKey: Uint8Array +}> { + const acct1PrivKey = B64ToUint8Array( + 'Hz9P3aHH62mO75A6uMVW3mn0U1KkZSq3t03jfOZfyZxjyJoJctNDY6awaVqOpjCGTjHZZxkc23Z3l39EjLOIFQ==' + ) + + const acct2PrivKey = B64ToUint8Array( + '3bpboaOX/8R2XPS6q6SmhGq+RBvs+3DDkWXayy58lIC+9k1Sj1K0BEQb82OcLZ8Ivkh9EL5/hWgXLKu3vNLc/g==' + ) + + const acct1PubKey = CryptoUtils.publicKeyFromPrivateKey(acct1PrivKey) + const acct2PubKey = CryptoUtils.publicKeyFromPrivateKey(acct2PrivKey) + const acct1Client = createClient() + const acct2Client = createClient() + + acct1Client.txMiddleware = createDefaultTxMiddleware(acct1Client, acct1PrivKey) + acct2Client.txMiddleware = createDefaultTxMiddleware(acct2Client, acct2PrivKey) + + const acct1EthCoin = await Contracts.EthCoin.createAsync( + acct1Client, + new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + ) + + const acct2EthCoin = await Contracts.EthCoin.createAsync( + acct2Client, + new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) + ) + + return { acct1Client, acct1EthCoin, acct1PubKey, acct2Client, acct2EthCoin, acct2PubKey } +} + +test('Should get total supply', async (t: test.Test) => { + const { acct1Client, acct1EthCoin } = await getClientAndContract(createTestHttpClient) + const totalSupply = await acct1EthCoin.getTotalSupplyAsync() + + t.assert(totalSupply.eq(toEthCoinE18(100)), 'Total Supply should be 100e18') + + acct1Client.disconnect() + t.end() +}) + +test('Should get balanceOf', async (t: test.Test) => { + const { + acct1Client, + acct1EthCoin, + acct1PubKey, + acct2Client, + acct2EthCoin, + acct2PubKey + } = await getClientAndContract(createTestHttpClient) + + const acct1Owner = new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + const acct1Balance = await acct1EthCoin.getBalanceOfAsync(acct1Owner) + + t.assert(acct1Balance.eq(toEthCoinE18(100)), 'Acct 1 balance should be 100e18') + + const acct2Owner = new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) + const acct2Balance = await acct2EthCoin.getBalanceOfAsync(acct2Owner) + + t.assert(acct2Balance.eq(toEthCoinE18(0)), 'Acct 2 balance should be 0') + + acct1Client.disconnect() + acct2Client.disconnect() + t.end() +}) + +test('Should get correct balanceOf after transfer', async (t: test.Test) => { + const { + acct1Client, + acct1EthCoin, + acct1PubKey, + acct2Client, + acct2EthCoin, + acct2PubKey + } = await getClientAndContract(createTestHttpClient) + + const from = new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + const to = new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) + + await acct1EthCoin.transferAsync(to, toEthCoinE18(10)) + + const acct1Balance = await acct1EthCoin.getBalanceOfAsync(from) + t.assert(acct1Balance.eq(toEthCoinE18(90)), 'Acct 1 Balance after transfer should be 90e18') + + const acct2Balance = await acct2EthCoin.getBalanceOfAsync(to) + t.assert(acct2Balance.eq(toEthCoinE18(10)), 'Acct 2 Balance after transfer should be 10e18') + + acct1Client.disconnect() + acct2Client.disconnect() + t.end() +}) + +test('Should correctly approve transfer', async (t: test.Test) => { + const { + acct1Client, + acct1EthCoin, + acct2Client, + acct1PubKey, + acct2PubKey + } = await getClientAndContract(createTestHttpClient) + + const owner = new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + const spender = new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) + + await acct1EthCoin.approveAsync(spender, toEthCoinE18(1)) + const bn = await acct1EthCoin.getAllowanceAsync(owner, spender) + + t.isEqual(bn.toString(), toEthCoinE18(1).toString(), 'Approved the allowance correctly') + + acct1Client.disconnect() + acct2Client.disconnect() + t.end() +}) + +test('Should correctly approve transfer', async (t: test.Test) => { + const { + acct1Client, + acct1EthCoin, + acct1PubKey, + acct2Client, + acct2EthCoin, + acct2PubKey + } = await getClientAndContract(createTestHttpClient) + + const spender = new Address(acct2Client.chainId, LocalAddress.fromPublicKey(acct2PubKey)) + const owner = new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + + await acct2EthCoin.transferFromAsync(owner, spender, toEthCoinE18(1)) + + const acct1Balance = await acct1EthCoin.getBalanceOfAsync(owner) + t.assert(acct1Balance.eq(toEthCoinE18(89)), 'Acct 1 Balance after transfer should be 89e18') + + const acct2Balance = await acct2EthCoin.getBalanceOfAsync(spender) + t.assert(acct2Balance.eq(toEthCoinE18(11)), 'Acct 2 Balance after transfer should be 11e18') + + acct1Client.disconnect() + acct2Client.disconnect() + t.end() +}) diff --git a/src/tests/e2e_tests.ts b/src/tests/e2e_tests.ts index b568b609..21d81b32 100644 --- a/src/tests/e2e_tests.ts +++ b/src/tests/e2e_tests.ts @@ -26,7 +26,8 @@ // import './e2e/multiple-events-nd-tests' // Contracts -import './e2e/coin-tests' +// import './e2e/coin-tests' +import './e2e/ethcoin-tests' // import './e2e/address-mapper-tests' // TODO: Re-enable once this is updated to DPOSv2 //import './e2e/dpos-tests' From e3333879ac3481feb72b73e051ad32ead63df33c Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Thu, 12 Sep 2019 22:57:55 -0300 Subject: [PATCH 04/10] Adding gateway contract --- e2e_support/genesis.json | 2 +- .../e2e/loom-provider-web3-child-events.ts | 24 +-- src/tests/e2e/transfer-gateway-tests.ts | 153 ++++++++++++++++++ src/tests/e2e_tests.ts | 4 +- src/tests/evm-helpers.ts | 27 ++++ 5 files changed, 185 insertions(+), 25 deletions(-) create mode 100644 src/tests/e2e/transfer-gateway-tests.ts diff --git a/e2e_support/genesis.json b/e2e_support/genesis.json index 7dd6062f..9729ec63 100644 --- a/e2e_support/genesis.json +++ b/e2e_support/genesis.json @@ -98,7 +98,7 @@ "init": { "owner": { "chain_id": "default", - "local": "c/IFoEFkm4+D3wdqLmFU9F3t3Sk=" + "local": "dHVZ95Bqnn3dsget6tyq72cJS3E=" }, "oracles": [ { diff --git a/src/tests/e2e/loom-provider-web3-child-events.ts b/src/tests/e2e/loom-provider-web3-child-events.ts index 166addf7..227a1e2b 100644 --- a/src/tests/e2e/loom-provider-web3-child-events.ts +++ b/src/tests/e2e/loom-provider-web3-child-events.ts @@ -4,7 +4,7 @@ import { LocalAddress, CryptoUtils } from '../../index' import { createTestClient, waitForMillisecondsAsync } from '../helpers' import { LoomProvider } from '../../loom-provider' -import { deployContract } from '../evm-helpers' +import { deployContract, deployContractGanache } from '../evm-helpers' const Web3 = require('web3') @@ -110,28 +110,6 @@ async function testContracts(t: Test, contractB: any, contractA: any) { } } -async function deployContractGanache(web3Provider: any, contractData: string) { - const web3 = new Web3(web3Provider) - const fromAddr = '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1' - - const ethSendTransactionDeployResult = await web3.eth.sendTransaction({ - from: fromAddr, - data: contractData, - gas: '300000', - gasPrice: '0x1' - }) - - if (!ethSendTransactionDeployResult.status) { - throw Error('Cant deploy contract on ganache') - } - - const ethGetTransactionReceiptResult = await web3.eth.getTransactionReceipt( - ethSendTransactionDeployResult.transactionHash - ) - - return ethGetTransactionReceiptResult -} - async function testGanache(t: Test) { const from = '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1' diff --git a/src/tests/e2e/transfer-gateway-tests.ts b/src/tests/e2e/transfer-gateway-tests.ts new file mode 100644 index 00000000..dd5511fc --- /dev/null +++ b/src/tests/e2e/transfer-gateway-tests.ts @@ -0,0 +1,153 @@ +import test, { Test } from 'tape' +import BN from 'bn.js' +import { + Address, + Contracts, + CryptoUtils, + createDefaultTxMiddleware, + Client, + LocalAddress +} from '../../index' +import { createTestHttpClient, getTestUrls } from '../helpers' +import { B64ToUint8Array } from '../../crypto-utils' +import { LoomProvider } from '../../loom-provider' +import Web3 from 'web3' +import { getJsonRPCSignerAsync, EthersSigner, soliditySha3 } from '../../solidity-helpers' +import { deployContractGanache, deployContract } from '../evm-helpers' + +async function getClientAndContract( + createClient: () => Client +): Promise<{ + acct1Client: Client + acct2Client: Client + transferGateway: Contracts.TransferGateway + addressMapper: Contracts.AddressMapper + acct1PubKey: Uint8Array + acct2PubKey: Uint8Array + web3Loom: Web3 + web3Ganache: Web3 + loomContractAddress: string + ganacheConctractAddress: string + ganacheContractHash: string +}> { + const acct1PrivKey = B64ToUint8Array( + 'Hz9P3aHH62mO75A6uMVW3mn0U1KkZSq3t03jfOZfyZxjyJoJctNDY6awaVqOpjCGTjHZZxkc23Z3l39EjLOIFQ==' + ) + + const acct2PrivKey = B64ToUint8Array( + '3bpboaOX/8R2XPS6q6SmhGq+RBvs+3DDkWXayy58lIC+9k1Sj1K0BEQb82OcLZ8Ivkh9EL5/hWgXLKu3vNLc/g==' + ) + + const acct1PubKey = CryptoUtils.publicKeyFromPrivateKey(acct1PrivKey) + const acct2PubKey = CryptoUtils.publicKeyFromPrivateKey(acct2PrivKey) + const acct1Client = createClient() + const acct2Client = createClient() + + acct1Client.txMiddleware = createDefaultTxMiddleware(acct1Client, acct1PrivKey) + acct2Client.txMiddleware = createDefaultTxMiddleware(acct2Client, acct2PrivKey) + + const transferGateway = await Contracts.TransferGateway.createAsync( + acct1Client, + new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + ) + + const addressMapper = await Contracts.AddressMapper.createAsync( + acct1Client, + new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + ) + + const loomProvider = new LoomProvider(acct1Client, acct1PrivKey) + const web3Loom = new Web3(loomProvider) + const web3Ganache = new Web3('http://localhost:8545') + + const contractData = + '608060405234801561001057600080fd5b50600a600081905550610118806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c146078575b600080fd5b348015605957600080fd5b5060766004803603810190808035906020019092919050505060a0565b005b348015608357600080fd5b50608a60e3565b6040518082815260200191505060405180910390f35b806000819055507fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b6000546040518082815260200191505060405180910390a150565b600080549050905600a165627a7a72305820fabe42649c29e53c4b9fad19100d72a1e825603058e1678432a76f94a10d352a0029' + + const loomDeployedContractResults = await deployContract(loomProvider, contractData) + const ganacheDeployedContractResults = await deployContractGanache(web3Ganache, contractData) + + const loomContractAddress = loomDeployedContractResults.contractAddress + const ganacheConctractAddress = ganacheDeployedContractResults.contractAddress + const ganacheContractHash = ganacheDeployedContractResults.transactionHash + + return { + acct1Client, + acct2Client, + transferGateway, + addressMapper, + acct1PubKey, + acct2PubKey, + web3Loom, + web3Ganache, + loomContractAddress, + ganacheConctractAddress, + ganacheContractHash + } +} + +test('Should gateway owner authorize contract mapping', async (t: Test) => { + const { + acct1Client, + loomContractAddress, + ganacheConctractAddress, + transferGateway + } = await getClientAndContract(createTestHttpClient) + + const localContract = new Address( + acct1Client.chainId, + LocalAddress.fromHexString(loomContractAddress) + ) + const foreignContract = new Address('eth', LocalAddress.fromHexString(ganacheConctractAddress)) + + await transferGateway.addAuthorizedContractMappingAsync({ foreignContract, localContract }) + const contractsAuthorized = await transferGateway.listContractMappingsAsync() + + const match = contractsAuthorized.confirmed.find(({ from, to }) => { + return ( + `eth:${ganacheConctractAddress.toLowerCase()}` == to.toString() && + `default:${loomContractAddress.toLowerCase()}` == from.toString() + ) + }) + + t.assert(match, 'Contracts should be confirmed') + + t.end() +}) + +test('Should user mapping contracts on gateway', async (t: Test) => { + const { + acct1Client, + transferGateway, + loomContractAddress, + ganacheConctractAddress, + ganacheContractHash + } = await getClientAndContract(createTestHttpClient) + + const localContract = new Address( + acct1Client.chainId, + LocalAddress.fromHexString(loomContractAddress) + ) + + const foreignContract = new Address('eth', LocalAddress.fromHexString(ganacheConctractAddress)) + + const ethers = await getJsonRPCSignerAsync('http://localhost:8545', 0) + const ethersSigner = new EthersSigner(ethers) + const hash = soliditySha3( + { type: 'address', value: foreignContract.local.toString().slice(2) }, + { type: 'address', value: localContract.local.toString().slice(2) } + ) + + const foreignContractCreatorSig = await ethersSigner.signAsync(hash) + const foreignContractCreatorTxHash = Buffer.from(ganacheContractHash.slice(2), 'hex') + + const params = { + foreignContract, + localContract, + foreignContractCreatorSig, + foreignContractCreatorTxHash + } + + await transferGateway.addContractMappingAsync(params) + + t.end() +}) diff --git a/src/tests/e2e_tests.ts b/src/tests/e2e_tests.ts index 21d81b32..74bf1c87 100644 --- a/src/tests/e2e_tests.ts +++ b/src/tests/e2e_tests.ts @@ -27,8 +27,10 @@ // Contracts // import './e2e/coin-tests' -import './e2e/ethcoin-tests' +// import './e2e/ethcoin-tests' // import './e2e/address-mapper-tests' +import './e2e/transfer-gateway-tests' + // TODO: Re-enable once this is updated to DPOSv2 //import './e2e/dpos-tests' diff --git a/src/tests/evm-helpers.ts b/src/tests/evm-helpers.ts index d58a3e34..60d6e83a 100644 --- a/src/tests/evm-helpers.ts +++ b/src/tests/evm-helpers.ts @@ -1,6 +1,7 @@ import { LoomProvider } from '../loom-provider' import { LocalAddress } from '../address' import { CryptoUtils } from '..' +import Web3 = require('web3') export async function deployContract(loomProvider: LoomProvider, contractData: string) { const privKey = loomProvider.accounts.values().next().value @@ -35,3 +36,29 @@ export async function deployContract(loomProvider: LoomProvider, contractData: s return ethGetTransactionReceiptResult.result } + +// Requires ganache cli running with -d flag for deteministic results on create addresses +export async function deployContractGanache( + web3Provider: any, + contractData: string, + fromAddr: string = '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1' +) { + const web3 = new Web3(web3Provider) + + const ethSendTransactionDeployResult = await web3.eth.sendTransaction({ + from: fromAddr, + data: contractData, + gas: '300000', + gasPrice: '0x1' + }) + + if (!ethSendTransactionDeployResult.status) { + throw Error('Cant deploy contract on ganache') + } + + const ethGetTransactionReceiptResult = await web3.eth.getTransactionReceipt( + ethSendTransactionDeployResult.transactionHash + ) + + return ethGetTransactionReceiptResult +} From cdc0098817c6f8815f01d440b0a78d4cb8071cd6 Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Tue, 17 Sep 2019 14:42:16 -0300 Subject: [PATCH 05/10] Improving tests with truffle artifacts on e2e --- .../solidity-contracts/SimpleStore.sol | 20 + .../solidity-contracts/SimpleStore2.sol | 26 + .../solidity-contracts/SimpleStore3.sol | 27 + e2e_support/truffle-artifacts/GameToken.json | 287 +++++++ .../truffle-artifacts/GameTokenDappChain.json | 343 ++++++++ e2e_support/truffle-artifacts/Gateway.json | 737 ++++++++++++++++++ .../truffle-artifacts/SimpleStore.json | 57 ++ .../truffle-artifacts/SimpleStore2.json | 78 ++ .../truffle-artifacts/SimpleStore3.json | 78 ++ .../ValidatorManagerContract.json | 344 ++++++++ src/tests/contracts_bytecode.ts | 116 +++ src/tests/e2e/client-evm-event-tests-2.ts | 41 +- src/tests/e2e/client-evm-event-tests.ts | 35 +- src/tests/e2e/client-test-tx-cache.ts | 43 +- src/tests/e2e/client-test-tx-middleware.ts | 88 +-- src/tests/e2e/loom-provider-eth-filters.ts | 33 +- src/tests/e2e/loom-provider-eth-get-logs.ts | 33 +- src/tests/e2e/loom-provider-subscribe.ts | 33 +- src/tests/e2e/loom-provider-tests.ts | 23 +- .../loom-provider-web3-middlewares-tests.ts | 33 +- src/tests/e2e/loom-provider-web3-tests.ts | 33 +- src/tests/e2e/transfer-gateway-tests.ts | 151 ++-- src/tests/evm-helpers.ts | 2 +- 23 files changed, 2212 insertions(+), 449 deletions(-) create mode 100644 e2e_support/solidity-contracts/SimpleStore.sol create mode 100644 e2e_support/solidity-contracts/SimpleStore2.sol create mode 100644 e2e_support/solidity-contracts/SimpleStore3.sol create mode 100644 e2e_support/truffle-artifacts/GameToken.json create mode 100644 e2e_support/truffle-artifacts/GameTokenDappChain.json create mode 100644 e2e_support/truffle-artifacts/Gateway.json create mode 100644 e2e_support/truffle-artifacts/SimpleStore.json create mode 100644 e2e_support/truffle-artifacts/SimpleStore2.json create mode 100644 e2e_support/truffle-artifacts/SimpleStore3.json create mode 100644 e2e_support/truffle-artifacts/ValidatorManagerContract.json create mode 100644 src/tests/contracts_bytecode.ts diff --git a/e2e_support/solidity-contracts/SimpleStore.sol b/e2e_support/solidity-contracts/SimpleStore.sol new file mode 100644 index 00000000..dfe46b83 --- /dev/null +++ b/e2e_support/solidity-contracts/SimpleStore.sol @@ -0,0 +1,20 @@ +pragma solidity ^0.4.25; + +contract SimpleStore { + uint256 value; + + constructor() public { + value = 10; + } + + event NewValueSet(uint indexed _value, address sender); + + function set(uint _value) public { + value = _value; + emit NewValueSet(value, msg.sender); + } + + function get() public view returns (uint) { + return value; + } +} \ No newline at end of file diff --git a/e2e_support/solidity-contracts/SimpleStore2.sol b/e2e_support/solidity-contracts/SimpleStore2.sol new file mode 100644 index 00000000..89c417f3 --- /dev/null +++ b/e2e_support/solidity-contracts/SimpleStore2.sol @@ -0,0 +1,26 @@ +pragma solidity ^0.4.25; + +contract SimpleStore { + uint value; + + constructor() public { + value = 10; + } + + event NewValueSet(uint indexed _value); + event NewValueSetAgain(uint indexed _value); + + function set(uint _value) public { + value = _value; + emit NewValueSet(value); + } + + function setAgain(uint _value) public { + value = _value; + emit NewValueSetAgain(value); + } + + function get() public view returns (uint) { + return value; + } +} \ No newline at end of file diff --git a/e2e_support/solidity-contracts/SimpleStore3.sol b/e2e_support/solidity-contracts/SimpleStore3.sol new file mode 100644 index 00000000..2126433c --- /dev/null +++ b/e2e_support/solidity-contracts/SimpleStore3.sol @@ -0,0 +1,27 @@ +pragma solidity ^0.4.25; + +contract SimpleStore { + uint value; + + constructor() public { + value = 10; + } + + event NewValueSet(uint indexed _value); + event NewValueSetAgain(uint indexed _value); + + function set(uint _value) public { + value = _value; + require(_value != 100, "Magic value"); + emit NewValueSet(value); + } + + function setAgain(uint _value) public { + value = _value; + emit NewValueSetAgain(value); + } + + function get() public view returns (uint) { + return value; + } +} \ No newline at end of file diff --git a/e2e_support/truffle-artifacts/GameToken.json b/e2e_support/truffle-artifacts/GameToken.json new file mode 100644 index 00000000..a8a1afbc --- /dev/null +++ b/e2e_support/truffle-artifacts/GameToken.json @@ -0,0 +1,287 @@ +{ + "contractName": "GameToken", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "from", + "type": "address" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "INITIAL_SUPPLY", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + }, + { + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + } + ], + "bytecode": "0x60c0604052600960808190527f47616d65546f6b656e000000000000000000000000000000000000000000000060a090815261003e916003919061018f565b506040805180820190915260038082527f47544b000000000000000000000000000000000000000000000000000000000060209092019182526100839160049161018f565b506005805460ff1916601217905534801561009d57600080fd5b506005546100bf90339060ff16600a0a633b9aca00026100c4602090811b901c565b61022a565b6001600160a01b0382166100d757600080fd5b6100f08160025461017660201b61066c1790919060201c565b6002556001600160a01b0382166000908152602081815260409091205461012091839061066c610176821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60008282018381101561018857600080fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106101d057805160ff19168380011785556101fd565b828001600101855582156101fd579182015b828111156101fd5782518255916020019190600101906101e2565b5061020992915061020d565b5090565b61022791905b808211156102095760008155600101610213565b90565b6106b1806102396000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063395093511161007157806339509351146101ec57806370a082311461021857806395d89b411461023e578063a457c2d714610246578063a9059cbb14610272578063dd62ed3e1461029e576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd146101905780632ff2e9dc146101c6578063313ce567146101ce575b600080fd5b6100c16102cc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b03813516906020013561035a565b604080519115158252519081900360200190f35b61017e610370565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610376565b61017e6103cd565b6101d66103d5565b6040805160ff9092168252519081900360200190f35b6101626004803603604081101561020257600080fd5b506001600160a01b0381351690602001356103de565b61017e6004803603602081101561022e57600080fd5b50356001600160a01b031661041a565b6100c1610435565b6101626004803603604081101561025c57600080fd5b506001600160a01b038135169060200135610490565b6101626004803603604081101561028857600080fd5b506001600160a01b0381351690602001356104cc565b61017e600480360360408110156102b457600080fd5b506001600160a01b03813581169160200135166104d9565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b820191906000526020600020905b81548152906001019060200180831161033557829003601f168201915b505050505081565b6000610367338484610504565b50600192915050565b60025490565b600061038384848461058c565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546103c39186916103be908663ffffffff61065716565b610504565b5060019392505050565b633b9aca0081565b60055460ff1681565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61066c16565b6001600160a01b031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61065716565b600061036733848461058c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b03821661051757600080fd5b6001600160a01b03831661052a57600080fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03821661059f57600080fd5b6001600160a01b0383166000908152602081905260409020546105c8908263ffffffff61065716565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105fd908263ffffffff61066c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282111561066657600080fd5b50900390565b60008282018381101561067e57600080fd5b939250505056fea165627a7a7230582041cecab436b72ee60ec580c80fc72861e5db86881f87a1197730ab2b55324bc80029", +} \ No newline at end of file diff --git a/e2e_support/truffle-artifacts/GameTokenDappChain.json b/e2e_support/truffle-artifacts/GameTokenDappChain.json new file mode 100644 index 00000000..9da9e170 --- /dev/null +++ b/e2e_support/truffle-artifacts/GameTokenDappChain.json @@ -0,0 +1,343 @@ +{ + "contractName": "GameTokenDappChain", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "gateway", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "INITIAL_SUPPLY", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_addedValue", + "type": "uint256" + } + ], + "name": "increaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_gateway", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "mintToGateway", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "onERC20Received", + "outputs": [ + { + "name": "", + "type": "bytes4" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60806040526040805190810160405280601281526020017f47616d65546f6b656e44617070436861696e000000000000000000000000000081525060049080519060200190620000519291906200019c565b506040805190810160405280600581526020017f47544b4443000000000000000000000000000000000000000000000000000000815250600590805190602001906200009f9291906200019c565b506012600660006101000a81548160ff021916908360ff160217905550348015620000c957600080fd5b506040516020806200187a8339810180604052810190808051906020019092919050505080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600660009054906101000a900460ff1660ff16600a0a633b9aca00026001819055506001546000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550506200024b565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620001df57805160ff191683800117855562000210565b8280016001018555821562000210579182015b828111156200020f578251825591602001919060010190620001f2565b5b5090506200021f919062000223565b5090565b6200024891905b80821115620002445760008160009055506001016200022a565b5090565b90565b61161f806200025b6000396000f3006080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b314610170578063116191b6146101d557806318160ddd1461022c57806323b872dd146102575780632ff2e9dc146102dc578063313ce56714610307578063544297f514610338578063661884631461036557806370a08231146103ca57806395d89b4114610421578063a9059cbb146104b1578063bc04f0af14610516578063d73dd623146105b5578063dd62ed3e1461061a575b600080fd5b3480156100ec57600080fd5b506100f5610691565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061072f565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea610821565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023857600080fd5b50610241610847565b6040518082815260200191505060405180910390f35b34801561026357600080fd5b506102c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610851565b604051808215151515815260200191505060405180910390f35b3480156102e857600080fd5b506102f1610c0b565b6040518082815260200191505060405180910390f35b34801561031357600080fd5b5061031c610c13565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034457600080fd5b5061036360048036038101908080359060200190929190505050610c26565b005b34801561037157600080fd5b506103b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d77565b604051808215151515815260200191505060405180910390f35b3480156103d657600080fd5b5061040b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611008565b6040518082815260200191505060405180910390f35b34801561042d57600080fd5b50610436611050565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561047657808201518184015260208101905061045b565b50505050905090810190601f1680156104a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104bd57600080fd5b506104fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110ee565b604051808215151515815260200191505060405180910390f35b34801561052257600080fd5b50610561600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061130d565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b3480156105c157600080fd5b50610600600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061133b565b604051808215151515815260200191505060405180910390f35b34801561062657600080fd5b5061067b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611537565b6040518082815260200191505060405180910390f35b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107275780601f106106fc57610100808354040283529160200191610727565b820191906000526020600020905b81548152906001019060200180831161070a57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561088e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108db57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561096657600080fd5b6109b7826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115be90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a4a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115be90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b633b9aca0081565b600660009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c8257600080fd5b610c97816001546115d790919063ffffffff16565b600181905550610d1081600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e88576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f1c565b610e9b83826115be90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110e65780601f106110bb576101008083540402835291602001916110e6565b820191906000526020600020905b8154815290600101906020018083116110c957829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561112b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561117857600080fd5b6111c9826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115be90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061125c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600063bc04f0af7c010000000000000000000000000000000000000000000000000000000002905092915050565b60006113cc82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156115cc57fe5b818303905092915050565b600081830190508281101515156115ea57fe5b809050929150505600a165627a7a7230582027917e92483a768bd5e7116e0daeeeb5f567c7234529de98a8ff63f4bdca99b30029", +} \ No newline at end of file diff --git a/e2e_support/truffle-artifacts/Gateway.json b/e2e_support/truffle-artifacts/Gateway.json new file mode 100644 index 00000000..052a3c11 --- /dev/null +++ b/e2e_support/truffle-artifacts/Gateway.json @@ -0,0 +1,737 @@ +{ + "contractName": "Gateway", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "vmc", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getAllowAnyToken", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "loomAddress", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "amount", + "type": "uint256" + }, + { + "name": "contractAddress", + "type": "address" + } + ], + "name": "depositERC20", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "enable", + "type": "bool" + } + ], + "name": "enableGateway", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "contractAddress", + "type": "address" + } + ], + "name": "getERC20", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getOwner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "amount", + "type": "uint256" + }, + { + "name": "contractAddress", + "type": "address" + }, + { + "name": "_signersIndexes", + "type": "uint256[]" + }, + { + "name": "_v", + "type": "uint8[]" + }, + { + "name": "_r", + "type": "bytes32[]" + }, + { + "name": "_s", + "type": "bytes32[]" + } + ], + "name": "withdrawERC20", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "tokenAddress", + "type": "address" + }, + { + "name": "allow", + "type": "bool" + } + ], + "name": "toggleAllowToken", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getGatewayEnabled", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "allow", + "type": "bool" + } + ], + "name": "toggleAllowAnyToken", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "allowedTokens", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenAddress", + "type": "address" + } + ], + "name": "isTokenAllowed", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_vmc", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "from", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "name": "from", + "type": "address" + }, + { + "indexed": false, + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "name": "data", + "type": "bytes" + } + ], + "name": "ERC721Received", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "name": "from", + "type": "address" + }, + { + "indexed": false, + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "name": "data", + "type": "bytes" + } + ], + "name": "ERC721XReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "tokenTypes", + "type": "uint256[]" + }, + { + "indexed": false, + "name": "amounts", + "type": "uint256[]" + }, + { + "indexed": false, + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "name": "data", + "type": "bytes" + } + ], + "name": "ERC721XBatchReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "name": "kind", + "type": "uint8" + }, + { + "indexed": false, + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "TokenWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "name": "loomCoinAddress", + "type": "address" + } + ], + "name": "LoomCoinReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "from", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "name": "contractAddress", + "type": "address" + } + ], + "name": "ERC20Received", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "tokenId", + "type": "uint256" + }, + { + "name": "amount", + "type": "uint256" + }, + { + "name": "contractAddress", + "type": "address" + }, + { + "name": "_signersIndexes", + "type": "uint256[]" + }, + { + "name": "_v", + "type": "uint8[]" + }, + { + "name": "_r", + "type": "bytes32[]" + }, + { + "name": "_s", + "type": "bytes32[]" + } + ], + "name": "withdrawERC721X", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "uid", + "type": "uint256" + }, + { + "name": "contractAddress", + "type": "address" + }, + { + "name": "_signersIndexes", + "type": "uint256[]" + }, + { + "name": "_v", + "type": "uint8[]" + }, + { + "name": "_r", + "type": "bytes32[]" + }, + { + "name": "_s", + "type": "bytes32[]" + } + ], + "name": "withdrawERC721", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "amount", + "type": "uint256" + }, + { + "name": "_signersIndexes", + "type": "uint256[]" + }, + { + "name": "_v", + "type": "uint8[]" + }, + { + "name": "_r", + "type": "bytes32[]" + }, + { + "name": "_s", + "type": "bytes32[]" + } + ], + "name": "withdrawETH", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_operator", + "type": "address" + }, + { + "name": "_from", + "type": "address" + }, + { + "name": "_tokenId", + "type": "uint256" + }, + { + "name": "_amount", + "type": "uint256" + }, + { + "name": "_data", + "type": "bytes" + } + ], + "name": "onERC721XReceived", + "outputs": [ + { + "name": "", + "type": "bytes4" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_operator", + "type": "address" + }, + { + "name": "_from", + "type": "address" + }, + { + "name": "_types", + "type": "uint256[]" + }, + { + "name": "_amounts", + "type": "uint256[]" + }, + { + "name": "_data", + "type": "bytes" + } + ], + "name": "onERC721XBatchReceived", + "outputs": [ + { + "name": "", + "type": "bytes4" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_operator", + "type": "address" + }, + { + "name": "_from", + "type": "address" + }, + { + "name": "_uid", + "type": "uint256" + }, + { + "name": "_data", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "name": "", + "type": "bytes4" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getETH", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "uid", + "type": "uint256" + }, + { + "name": "contractAddress", + "type": "address" + } + ], + "name": "getERC721", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "tokenId", + "type": "uint256" + }, + { + "name": "contractAddress", + "type": "address" + } + ], + "name": "getERC721X", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5060405160208062002aab8339810180604052602081101561003157600080fd5b5051600480546001600160a01b0319166001600160a01b0380841691909117808355604080517f37179db80000000000000000000000000000000000000000000000000000000081529051859492909316926337179db892828101926020929190829003018186803b1580156100a657600080fd5b505afa1580156100ba573d6000803e3d6000fd5b505050506040513d60208110156100d057600080fd5b505160008054600280546001600160a01b03199081163317909155600160a81b60ff0219600160a01b60ff02196001600160a01b039095169190921617929092167401000000000000000000000000000000000000000017919091167501000000000000000000000000000000000000000000179055505061295380620001586000396000f3fe60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063ced7c92a1161006f578063ced7c92a14610aa2578063da293eb314610c29578063e32f375114610d9b578063e402fbc814610db0578063e744092e14610ddc578063f9eaee0d14610e0f5761014b565b80638da5cb5b146105f557806393ba7daa1461060a578063b0116dc7146106e0578063b3b0f4c714610860578063b4c6034214610a2e578063b82730ab14610a675761014b565b8063392d661c11610108578063392d661c146104dc57806341c25c4a146105155780634e0dc557146105415780634e56ef52146105745780637ecebe00146105ad578063893d20e8146105e05761014b565b806303c0fe3a146101d657806314f6c3be14610358578063150b7a021461037f57806320cc8e511461046d5780632fc85c521461049e57806337179db8146104c7575b600054600160a01b900460ff1661019a5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6040805133815234602082015281517fbfe611b001dfcd411432f7bf0d79b82b4b2ee81511edac123a3403c357fb972a929181900390910190a1005b3480156101e257600080fd5b50610356600480360360c08110156101f957600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561022857600080fd5b82018360208201111561023a57600080fd5b803590602001918460208302840111600160201b8311171561025b57600080fd5b919390929091602081019035600160201b81111561027857600080fd5b82018360208201111561028a57600080fd5b803590602001918460208302840111600160201b831117156102ab57600080fd5b919390929091602081019035600160201b8111156102c857600080fd5b8201836020820111156102da57600080fd5b803590602001918460208302840111600160201b831117156102fb57600080fd5b919390929091602081019035600160201b81111561031857600080fd5b82018360208201111561032a57600080fd5b803590602001918460208302840111600160201b8311171561034b57600080fd5b509092509050610e42565b005b34801561036457600080fd5b5061036d611149565b60408051918252519081900360200190f35b34801561038b57600080fd5b50610450600480360360808110156103a257600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b8111156103dc57600080fd5b8201836020820111156103ee57600080fd5b803590602001918460018302840111600160201b8311171561040f57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061114e945050505050565b604080516001600160e01b03199092168252519081900360200190f35b34801561047957600080fd5b506104826112f5565b604080516001600160a01b039092168252519081900360200190f35b3480156104aa57600080fd5b506104b3611304565b604080519115158252519081900360200190f35b3480156104d357600080fd5b50610482611314565b3480156104e857600080fd5b50610356600480360360408110156104ff57600080fd5b50803590602001356001600160a01b0316611323565b34801561052157600080fd5b506103566004803603602081101561053857600080fd5b50351515611432565b34801561054d57600080fd5b5061036d6004803603602081101561056457600080fd5b50356001600160a01b03166114ad565b34801561058057600080fd5b506104b36004803603604081101561059757600080fd5b50803590602001356001600160a01b031661152c565b3480156105b957600080fd5b5061036d600480360360208110156105d057600080fd5b50356001600160a01b03166115b9565b3480156105ec57600080fd5b506104826115cb565b34801561060157600080fd5b506104826115da565b34801561061657600080fd5b50610450600480360360a081101561062d57600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b81111561066c57600080fd5b82018360208201111561067e57600080fd5b803590602001918460018302840111600160201b8311171561069f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506115e9945050505050565b3480156106ec57600080fd5b50610356600480360360c081101561070357600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561073257600080fd5b82018360208201111561074457600080fd5b803590602001918460208302840111600160201b8311171561076557600080fd5b919390929091602081019035600160201b81111561078257600080fd5b82018360208201111561079457600080fd5b803590602001918460208302840111600160201b831117156107b557600080fd5b919390929091602081019035600160201b8111156107d257600080fd5b8201836020820111156107e457600080fd5b803590602001918460208302840111600160201b8311171561080557600080fd5b919390929091602081019035600160201b81111561082257600080fd5b82018360208201111561083457600080fd5b803590602001918460208302840111600160201b8311171561085557600080fd5b509092509050611799565b34801561086c57600080fd5b50610450600480360360a081101561088357600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b8111156108b657600080fd5b8201836020820111156108c857600080fd5b803590602001918460208302840111600160201b831117156108e957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561093857600080fd5b82018360208201111561094a57600080fd5b803590602001918460208302840111600160201b8311171561096b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156109ba57600080fd5b8201836020820111156109cc57600080fd5b803590602001918460018302840111600160201b831117156109ed57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b02945050505050565b348015610a3a57600080fd5b5061036d60048036036040811015610a5157600080fd5b50803590602001356001600160a01b0316611d89565b348015610a7357600080fd5b5061035660048036036040811015610a8a57600080fd5b506001600160a01b0381351690602001351515611e0e565b348015610aae57600080fd5b50610356600480360360e0811015610ac557600080fd5b8135916020810135916001600160a01b036040830135169190810190608081016060820135600160201b811115610afb57600080fd5b820183602082011115610b0d57600080fd5b803590602001918460208302840111600160201b83111715610b2e57600080fd5b919390929091602081019035600160201b811115610b4b57600080fd5b820183602082011115610b5d57600080fd5b803590602001918460208302840111600160201b83111715610b7e57600080fd5b919390929091602081019035600160201b811115610b9b57600080fd5b820183602082011115610bad57600080fd5b803590602001918460208302840111600160201b83111715610bce57600080fd5b919390929091602081019035600160201b811115610beb57600080fd5b820183602082011115610bfd57600080fd5b803590602001918460208302840111600160201b83111715610c1e57600080fd5b509092509050611e85565b348015610c3557600080fd5b50610356600480360360a0811015610c4c57600080fd5b81359190810190604081016020820135600160201b811115610c6d57600080fd5b820183602082011115610c7f57600080fd5b803590602001918460208302840111600160201b83111715610ca057600080fd5b919390929091602081019035600160201b811115610cbd57600080fd5b820183602082011115610ccf57600080fd5b803590602001918460208302840111600160201b83111715610cf057600080fd5b919390929091602081019035600160201b811115610d0d57600080fd5b820183602082011115610d1f57600080fd5b803590602001918460208302840111600160201b83111715610d4057600080fd5b919390929091602081019035600160201b811115610d5d57600080fd5b820183602082011115610d6f57600080fd5b803590602001918460208302840111600160201b83111715610d9057600080fd5b50909250905061218c565b348015610da757600080fd5b506104b36123fb565b348015610dbc57600080fd5b5061035660048036036020811015610dd357600080fd5b5035151561240b565b348015610de857600080fd5b506104b360048036036020811015610dff57600080fd5b50356001600160a01b0316612478565b348015610e1b57600080fd5b506104b360048036036020811015610e3257600080fd5b50356001600160a01b031661248d565b600054600160a01b900460ff16610e915760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000610f156040518060400160405280601281526020017f115769746864726177204552433732313a0a00000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561103757600080fd5b505afa15801561104b573d6000803e3d6000fd5b5050336000818152600360205260408120805460010190559250611073915030908e8e6125ab565b9050806110e45760408051600160e31b6308934a5f028152336004820152602481018e905290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b1580156110cb57600080fd5b505af11580156110df573d6000803e3d6000fd5b505050505b336001600160a01b031660008051602061288083398151915260028d8f6040518084600481111561111157fe5b60ff1681526001600160a01b0390931660208401525060408083019190915251908190036060019150a2505050505050505050505050565b303190565b60008054600160a01b900460ff1661119e5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6111a73361248d565b6111f25760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7f691f4eac2b8850491851c72f70a121d76b20836d776658438f5b13dd9f8dbc6e858585338660405180866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156112a357818101518382015260200161128b565b50505050905090810190601f1680156112d05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a150600160e11b630a85bd0102949350505050565b6004546001600160a01b031681565b600054600160a81b900460ff1690565b6000546001600160a01b031681565b600054600160a01b900460ff166113725760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b61138d6001600160a01b03821633308563ffffffff6126a616565b60408051338152602081018490526001600160a01b0383168183015290517fa13cf347fb36122550e414f6fd1a0c2e490cff76331c4dcc20f760891ecca12a9181900360600190a16000546001600160a01b038281169116141561142e57604080518381526001600160a01b0383166020820152815133927f91557346f7592c9279b67cc52709a00442f0597658ec38a5fe84568c016331d7928290030190a25b5050565b6002546001600160a01b0316331461147e57604051600160e51b62461bcd0281526004018080602001828103825260378152602001806128c76037913960400191505060405180910390fd5b60008054911515600160a01b0274ff000000000000000000000000000000000000000019909216919091179055565b60408051600160e01b6370a0823102815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b1580156114fa57600080fd5b505afa15801561150e573d6000803e3d6000fd5b505050506040513d602081101561152457600080fd5b505192915050565b6000306001600160a01b0316826001600160a01b0316636352211e856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561157c57600080fd5b505afa158015611590573d6000803e3d6000fd5b505050506040513d60208110156115a657600080fd5b50516001600160a01b0316149392505050565b60036020526000908152604090205481565b6002546001600160a01b031690565b6002546001600160a01b031681565b60008054600160a01b900460ff166116395760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6116423361248d565b61168d5760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7fc341982fb8843f55f2f7aae4eb89231a4ef94a199f370debe7bc5c07c2de2bab86868686338760405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001858152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561174557818101518382015260200161172d565b50505050905090810190601f1680156117725780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a150600160e41b630660b3370295945050505050565b600054600160a01b900460ff166117e85760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b600061186c6040518060400160405280601181526020017f1057697468647261772045524332303a0a0000000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561198e57600080fd5b505afa1580156119a2573d6000803e3d6000fd5b5050336000908152600360209081526040808320805460010190558051600160e01b6370a0823102815230600482015290519294506001600160a01b038f1693506370a082319260248083019392829003018186803b158015611a0457600080fd5b505afa158015611a18573d6000803e3d6000fd5b505050506040513d6020811015611a2e57600080fd5b505190508b811015611aa55760408051600160e31b6308934a5f028152306004820152828e03602482015290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b158015611a8c57600080fd5b505af1158015611aa0573d6000803e3d6000fd5b505050505b611abf6001600160a01b038c16338e63ffffffff61270916565b6000543390600080516020612880833981519152906001600160a01b038e8116911614611aed576001611af0565b60045b8d8f6040518084600481111561111157fe5b60008054600160a01b900460ff16611b525760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b611b5b3361248d565b611ba65760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b835183518114611c005760408051600160e51b62461bcd02815260206004820152601a60248201527f4172726179206c656e6774687320646f206e6f74206d61746368000000000000604482015290519081900360640190fd5b7f48d67933be7b1e6d77d914145d793b5c9ced38156f34ebab23216e085435ac5587878787338860405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b031681526020018060200180602001856001600160a01b03166001600160a01b0316815260200180602001848103845288818151815260200191508051906020019060200280838360005b83811015611cb7578181015183820152602001611c9f565b50505050905001848103835287818151815260200191508051906020019060200280838360005b83811015611cf6578181015183820152602001611cde565b50505050905001848103825285818151815260200191508051906020019080838360005b83811015611d32578181015183820152602001611d1a565b50505050905090810190601f168015611d5f5780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390a150600160e11b6374f2df35029695505050505050565b60408051600160e11b627eeac70281523060048201526024810184905290516000916001600160a01b0384169162fdd58e91604480820192602092909190829003018186803b158015611ddb57600080fd5b505afa158015611def573d6000803e3d6000fd5b505050506040513d6020811015611e0557600080fd5b50519392505050565b6002546001600160a01b03163314611e5a57604051600160e51b62461bcd0281526004018080602001828103825260278152602001806128a06027913960400191505060405180910390fd5b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b600054600160a01b900460ff16611ed45760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000611f606040518060400160405280601381526020017f12576974686472617720455243373231583a0a000000000000000000000000008152508d8d8d60405160200180848152602001838152602001826001600160a01b03166001600160a01b031660601b81526014019350505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561208257600080fd5b505afa158015612096573d6000803e3d6000fd5b5050505060036000336001600160a01b03166001600160a01b0316815260200190815260200160002060008154809291906001019190505550896001600160a01b0316630febdd4930338f8f6040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001838152602001828152602001945050505050600060405180830381600087803b15801561215157600080fd5b505af1158015612165573d6000803e3d6000fd5b505060405133925060008051602061288083398151915291506003908d908f908084611111565b600054600160a01b900460ff166121db5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b60006122426040518060400160405280600f81526020017f0e5769746864726177204554483a0a00000000000000000000000000000000008152508b60405160200180828152602001915050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561236457600080fd5b505afa158015612378573d6000803e3d6000fd5b50503360008181526003602052604080822080546001019055519193508d156108fc0292508d9190818181858888f193505050501580156123bd573d6000803e3d6000fd5b5060408051600080825260208201528082018c905290513391600080516020612880833981519152919081900360600190a250505050505050505050565b600054600160a01b900460ff1690565b6002546001600160a01b0316331461245757604051600160e51b62461bcd02815260040180806020018281038252602a8152602001806128fe602a913960400191505060405180910390fd5b60008054911515600160a81b02600160a81b60ff0219909216919091179055565b60016020526000908152604090205460ff1681565b60008054600160a81b900460ff16806124be57506001600160a01b03821660009081526001602052604090205460ff165b92915050565b6000823360036000336001600160a01b03166001600160a01b031681526020019081526020016000205430856040516020018086805190602001908083835b602083106125225780518252601f199092019160209182019101612503565b6001836020036101000a038019825116818451168082178552505050505050905001856001600160a01b03166001600160a01b031660601b8152601401848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905092915050565b604080516001600160a01b0386811660248301528581166044830152606480830186905283518084039091018152608490920183526020820180516001600160e01b0316600160e01b6323b872dd021781529251825160009485949387169392918291908083835b602083106126325780518252601f199092019160209182019101612613565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612694576040519150601f19603f3d011682016040523d82523d6000602084013e612699565b606091505b5090979650505050505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b0316600160e01b6323b872dd02179052612703908590612763565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0316600160e01b63a9059cbb0217905261275e908490612763565b505050565b612775826001600160a01b0316612859565b61277e57600080fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106127bc5780518252601f19909201916020918201910161279d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461281e576040519150601f19603f3d011682016040523d82523d6000602084013e612823565b606091505b50915091508161283257600080fd5b8051156127035780806020019051602081101561284e57600080fd5b505161270357600080fd5b3b15159056fe476174657761792069732064697361626c65642e000000000000000000000000591f2d33d85291e32c4067b5a497caf3ddb5b1830eba9909e66006ec3a0051b4746f67676c65416c6c6f77546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65656e61626c65476174657761793a206f6e6c79206f776e65722063616e20656e61626c65206f722064697361626c652067617465776179746f67676c65416c6c6f77416e79546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65a165627a7a72305820ace81939002d8d64077e021434066edca9c22927222014369aef418d15fd26bb0029", +} \ No newline at end of file diff --git a/e2e_support/truffle-artifacts/SimpleStore.json b/e2e_support/truffle-artifacts/SimpleStore.json new file mode 100644 index 00000000..66c873a9 --- /dev/null +++ b/e2e_support/truffle-artifacts/SimpleStore.json @@ -0,0 +1,57 @@ +{ + "contractName": "SimpleStore", + "abi": [ + { + "constant": false, + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "name": "set", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "get", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "_value", + "type": "uint256" + }, + { + "indexed": false, + "name": "sender", + "type": "address" + } + ], + "name": "NewValueSet", + "type": "event" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50600a60008190555061014e806100286000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b1146100515780636d4ce63c1461007e575b600080fd5b34801561005d57600080fd5b5061007c600480360381019080803590602001909291905050506100a9565b005b34801561008a57600080fd5b50610093610119565b6040518082815260200191505060405180910390f35b806000819055506000547f7e0b7a35f017ec94e71d7012fe8fa8011f1dab6090674f92de08f8092ab30dda33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250565b600080549050905600a165627a7a7230582035a7c0b902730ae40b99fa53435bfc1ecb46daac9faaa72b82c83345ba0c5a760029" +} diff --git a/e2e_support/truffle-artifacts/SimpleStore2.json b/e2e_support/truffle-artifacts/SimpleStore2.json new file mode 100644 index 00000000..affdabdb --- /dev/null +++ b/e2e_support/truffle-artifacts/SimpleStore2.json @@ -0,0 +1,78 @@ +{ + "contractName": "SimpleStore", + "abi": [ + { + "constant": false, + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "name": "set", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "get", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "name": "setAgain", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "_value", + "type": "uint256" + } + ], + "name": "NewValueSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "_value", + "type": "uint256" + } + ], + "name": "NewValueSetAgain", + "type": "event" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50600a600081905550610188806100286000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b11461005c5780636d4ce63c14610089578063cf718921146100b4575b600080fd5b34801561006857600080fd5b50610087600480360381019080803590602001909291905050506100e1565b005b34801561009557600080fd5b5061009e61011a565b6040518082815260200191505060405180910390f35b3480156100c057600080fd5b506100df60048036038101908080359060200190929190505050610123565b005b806000819055506000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b60008054905090565b806000819055506000547fc151b22f26f815d64ae384647d49bc5655149c4b273318d8c3846086dae3835e60405160405180910390a2505600a165627a7a723058203bb659196869397aae7df0a21d242aa3ffc782a8860cbdddad86912f9c757a260029" +} \ No newline at end of file diff --git a/e2e_support/truffle-artifacts/SimpleStore3.json b/e2e_support/truffle-artifacts/SimpleStore3.json new file mode 100644 index 00000000..caee529e --- /dev/null +++ b/e2e_support/truffle-artifacts/SimpleStore3.json @@ -0,0 +1,78 @@ +{ + "contractName": "SimpleStore", + "abi": [ + { + "constant": false, + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "name": "set", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "get", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "name": "setAgain", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "_value", + "type": "uint256" + } + ], + "name": "NewValueSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "_value", + "type": "uint256" + } + ], + "name": "NewValueSetAgain", + "type": "event" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50600a600081905550610201806100286000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b11461005c5780636d4ce63c14610089578063cf718921146100b4575b600080fd5b34801561006857600080fd5b50610087600480360381019080803590602001909291905050506100e1565b005b34801561009557600080fd5b5061009e610193565b6040518082815260200191505060405180910390f35b3480156100c057600080fd5b506100df6004803603810190808035906020019092919050505061019c565b005b8060008190555060648114151515610161576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4d616769632076616c756500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b60008054905090565b806000819055506000547fc151b22f26f815d64ae384647d49bc5655149c4b273318d8c3846086dae3835e60405160405180910390a2505600a165627a7a723058202cf1a889f06f34c0879b44afba034b765e999ce748fd760b77324c92ce6b33180029" +} diff --git a/e2e_support/truffle-artifacts/ValidatorManagerContract.json b/e2e_support/truffle-artifacts/ValidatorManagerContract.json new file mode 100644 index 00000000..6259c4e4 --- /dev/null +++ b/e2e_support/truffle-artifacts/ValidatorManagerContract.json @@ -0,0 +1,344 @@ +{ + "contractName": "ValidatorManagerContract", + "abi": [ + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "validators", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "loomAddress", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "powers", + "outputs": [ + { + "name": "", + "type": "uint64" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "threshold_denom", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nonce", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "threshold_num", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalPower", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_validators", + "type": "address[]" + }, + { + "name": "_powers", + "type": "uint64[]" + }, + { + "name": "_threshold_num", + "type": "uint8" + }, + { + "name": "_threshold_denom", + "type": "uint8" + }, + { + "name": "_loomAddress", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "_validators", + "type": "address[]" + }, + { + "indexed": false, + "name": "_powers", + "type": "uint64[]" + } + ], + "name": "ValidatorSetChanged", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "getPowers", + "outputs": [ + { + "name": "", + "type": "uint64[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getValidators", + "outputs": [ + { + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_loomAddress", + "type": "address" + }, + { + "name": "_signersIndexes", + "type": "uint256[]" + }, + { + "name": "_v", + "type": "uint8[]" + }, + { + "name": "_r", + "type": "bytes32[]" + }, + { + "name": "_s", + "type": "bytes32[]" + } + ], + "name": "setLoom", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_num", + "type": "uint8" + }, + { + "name": "_denom", + "type": "uint8" + }, + { + "name": "_signersIndexes", + "type": "uint256[]" + }, + { + "name": "_v", + "type": "uint8[]" + }, + { + "name": "_r", + "type": "bytes32[]" + }, + { + "name": "_s", + "type": "bytes32[]" + } + ], + "name": "setQuorum", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_newValidators", + "type": "address[]" + }, + { + "name": "_newPowers", + "type": "uint64[]" + }, + { + "name": "_signersIndexes", + "type": "uint256[]" + }, + { + "name": "_v", + "type": "uint8[]" + }, + { + "name": "_r", + "type": "bytes32[]" + }, + { + "name": "_s", + "type": "bytes32[]" + } + ], + "name": "rotateValidators", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_message", + "type": "bytes32" + }, + { + "name": "_signersIndex", + "type": "uint256" + }, + { + "name": "_v", + "type": "uint8" + }, + { + "name": "_r", + "type": "bytes32" + }, + { + "name": "_s", + "type": "bytes32" + } + ], + "name": "signedByValidator", + "outputs": [], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_message", + "type": "bytes32" + }, + { + "name": "_signersIndexes", + "type": "uint256[]" + }, + { + "name": "_v", + "type": "uint8[]" + }, + { + "name": "_r", + "type": "bytes32[]" + }, + { + "name": "_s", + "type": "bytes32[]" + } + ], + "name": "checkThreshold", + "outputs": [], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x60806040523480156200001157600080fd5b5060405162001e7f38038062001e7f833981018060405260a08110156200003757600080fd5b8101908080516401000000008111156200005057600080fd5b820160208101848111156200006457600080fd5b81518560208202830111640100000000821117156200008257600080fd5b505092919060200180516401000000008111156200009f57600080fd5b82016020810184811115620000b357600080fd5b8151856020820283011164010000000082111715620000d157600080fd5b5050602082015160408301516060909301516000805460ff191660ff8085169190911761ff001916610100828816810291909117928390559497509295509092810482169116118015906200012a575060005460ff1615155b6200019657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c6964207468726573686f6c64206672616374696f6e2e0000000000604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b038316179055620001c48585620001cf602090811b901c565b50505050506200055d565b8151815181146200022c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018062001e51602e913960400191505060405180910390fd5b6000811162000287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018062001e2e6023913960400191505060405180910390fd5b6000805b82811015620002d657620002cb848281518110620002a557fe5b60200260200101516001600160401b031683620003cd60201b620014121790919060201c565b91506001016200028b565b5060038190558351620002f1906001906020870190620003e7565b5082516200030790600290602086019062000451565b507f323c51e0ad42c317ff3b00c6ce354d799a4b5eaf3a25cf3169cf2efd339d4d548484604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156200037157818101518382015260200162000357565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015620003b257818101518382015260200162000398565b5050505090500194505050505060405180910390a150505050565b600082820183811015620003e057600080fd5b9392505050565b8280548282559060005260206000209081019282156200043f579160200282015b828111156200043f57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000408565b506200044d9291506200050c565b5090565b82805482825590600052602060002090600301600490048101928215620004fe5791602002820160005b83821115620004c757835183826101000a8154816001600160401b0302191690836001600160401b0316021790555092602001926008016020816007010492830192600103026200047b565b8015620004fc5782816101000a8154906001600160401b030219169055600801602081600701049283019260010302620004c7565b505b506200044d92915062000536565b6200053391905b808211156200044d5780546001600160a01b031916815560010162000513565b90565b6200053391905b808211156200044d5780546001600160401b03191681556001016200053d565b6118c1806200056d6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063affed0e01161008c578063c57829d211610066578063c57829d214610741578063db3ad22c14610749578063eb2eb0ef14610751578063ff13a1ac1461094f576100ea565b8063affed0e014610697578063b7ab4db5146106b1578063c47c479a14610709576100ea565b806337179db8116100c857806337179db8146104c957806340c1bfab146104d157806357d717d11461050b5780639b96372214610529576100ea565b80630d8618ce146100ef5780630fba29c31461026257806335aa2e4414610490575b600080fd5b610260600480360360c081101561010557600080fd5b60ff8235811692602081013590911691810190606081016040820135600160201b81111561013257600080fd5b82018360208201111561014457600080fd5b803590602001918460208302840111600160201b8311171561016557600080fd5b919390929091602081019035600160201b81111561018257600080fd5b82018360208201111561019457600080fd5b803590602001918460208302840111600160201b831117156101b557600080fd5b919390929091602081019035600160201b8111156101d257600080fd5b8201836020820111156101e457600080fd5b803590602001918460208302840111600160201b8311171561020557600080fd5b919390929091602081019035600160201b81111561022257600080fd5b82018360208201111561023457600080fd5b803590602001918460208302840111600160201b8311171561025557600080fd5b509092509050610957565b005b610260600480360360a081101561027857600080fd5b81359190810190604081016020820135600160201b81111561029957600080fd5b8201836020820111156102ab57600080fd5b803590602001918460208302840111600160201b831117156102cc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561031b57600080fd5b82018360208201111561032d57600080fd5b803590602001918460208302840111600160201b8311171561034e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561039d57600080fd5b8201836020820111156103af57600080fd5b803590602001918460208302840111600160201b831117156103d057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561041f57600080fd5b82018360208201111561043157600080fd5b803590602001918460208302840111600160201b8311171561045257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b1a945050505050565b6104ad600480360360208110156104a657600080fd5b5035610e78565b604080516001600160a01b039092168252519081900360200190f35b6104ad610e9f565b6104ee600480360360208110156104e757600080fd5b5035610eae565b6040805167ffffffffffffffff9092168252519081900360200190f35b610513610ee9565b6040805160ff9092168252519081900360200190f35b610260600480360360a081101561053f57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056957600080fd5b82018360208201111561057b57600080fd5b803590602001918460208302840111600160201b8311171561059c57600080fd5b919390929091602081019035600160201b8111156105b957600080fd5b8201836020820111156105cb57600080fd5b803590602001918460208302840111600160201b831117156105ec57600080fd5b919390929091602081019035600160201b81111561060957600080fd5b82018360208201111561061b57600080fd5b803590602001918460208302840111600160201b8311171561063c57600080fd5b919390929091602081019035600160201b81111561065957600080fd5b82018360208201111561066b57600080fd5b803590602001918460208302840111600160201b8311171561068c57600080fd5b509092509050610ef7565b61069f611044565b60408051918252519081900360200190f35b6106b961104a565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156106f55781810151838201526020016106dd565b505050509050019250505060405180910390f35b610260600480360360a081101561071f57600080fd5b5080359060208101359060ff60408201351690606081013590608001356110ad565b610513611184565b61069f61118d565b610260600480360360c081101561076757600080fd5b810190602081018135600160201b81111561078157600080fd5b82018360208201111561079357600080fd5b803590602001918460208302840111600160201b831117156107b457600080fd5b919390929091602081019035600160201b8111156107d157600080fd5b8201836020820111156107e357600080fd5b803590602001918460208302840111600160201b8311171561080457600080fd5b919390929091602081019035600160201b81111561082157600080fd5b82018360208201111561083357600080fd5b803590602001918460208302840111600160201b8311171561085457600080fd5b919390929091602081019035600160201b81111561087157600080fd5b82018360208201111561088357600080fd5b803590602001918460208302840111600160201b831117156108a457600080fd5b919390929091602081019035600160201b8111156108c157600080fd5b8201836020820111156108d357600080fd5b803590602001918460208302840111600160201b831117156108f457600080fd5b919390929091602081019035600160201b81111561091157600080fd5b82018360208201111561092357600080fd5b803590602001918460208302840111600160201b8311171561094457600080fd5b509092509050611193565b6106b961134b565b8860ff168a60ff1611158015610970575060008a60ff16115b6109c45760408051600160e51b62461bcd02815260206004820152601a60248201527f496e76616c6964207468726573686f6c64206672616374696f6e000000000000604482015290519081900360640190fd5b6000610a0f8b8b604051602001808360ff1660ff1660f81b81526001018260ff1660ff1660f81b815260010192505050604051602081830303815290604052805190602001206113d6565b9050610ae1818a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610b1a92505050565b50506000805460ff191660ff9a8b161761ff00191661010099909a16989098029890981790965550506004805460010190555050505050565b8251600154811115610b6057604051600160e51b62461bcd0281526004018080602001828103825260478152602001806117cd6047913960600191505060405180910390fd5b600081118015610b705750825181145b8015610b7d575081518351145b8015610b895750845181145b610bc757604051600160e51b62461bcd02815260040180806020018281038252602b81526020018061174c602b913960400191505060405180910390fd5b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083018a905283518084039091018152605c90920190925280519101206000805b83811015610e16578015610c5b57876001820381518110610c3557fe5b6020026020010151888281518110610c4957fe5b602002602001015111610c5b57600080fd5b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0858281518110610c8857fe5b602002602001015160001c1115610c9e57610e0e565b6000600184898481518110610caf57fe5b6020026020010151898581518110610cc357fe5b6020026020010151898681518110610cd757fe5b602002602001015160405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610d36573d6000803e3d6000fd5b5050506020604051035190506001898381518110610d5057fe5b602002602001015181548110610d6257fe5b6000918252602090912001546001600160a01b03828116911614610dba57604051600160e51b62461bcd0281526004018080602001828103825260358152602001806117986035913960400191505060405180910390fd5b610e0a60028a8481518110610dcb57fe5b602002602001015181548110610ddd57fe5b6000918252602090912060048204015485916003166008026101000a900467ffffffffffffffff16611412565b9250505b600101610c18565b5060005460035460ff8083169091026101009092041682021015610e6e57604051600160e51b62461bcd0281526004018080602001828103825260318152602001806118376031913960400191505060405180910390fd5b5050505050505050565b60018181548110610e8557fe5b6000918252602090912001546001600160a01b0316905081565b6005546001600160a01b031681565b60028181548110610ebb57fe5b9060005260206000209060049182820401919006600802915054906101000a900467ffffffffffffffff1681565b600054610100900460ff1681565b6000610f3d8a60405160200180826001600160a01b03166001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206113d6565b905061100f818a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610b1a92505050565b5050600580546001600160a01b0319166001600160a01b03999099169890981790975550506004805460010190555050505050565b60045481565b606060018054806020026020016040519081016040528092919081815260200182805480156110a257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611084575b505050505090505b90565b604080516000808252602080830180855289905260ff87168385015260608301869052608083018590529251909260019260a080820193601f1981019281900390910190855afa158015611105573d6000803e3d6000fd5b505050602060405103519050806001600160a01b03166001868154811061112857fe5b6000918252602090912001546001600160a01b03161461117c57604051600160e51b62461bcd0281526004018080602001828103825260218152602001806117776021913960400191505060405180910390fd5b505050505050565b60005460ff1681565b60035481565b60006111e38d8d8d8d6040516020018085856020028082843791909101905083602084028082843780830192505050945050505050604051602081830303815290604052805190602001206113d6565b90506112b5818a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610b1a92505050565b6113338d8d80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508c8c8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061142b92505050565b50506004805460010190555050505050505050505050565b606060028054806020026020016040519081016040528092919081815260200182805480156110a257602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff16815260200190600801906020826007010492830192600103820291508084116113885790505050505050905090565b600454604080513060601b6020808301919091526034820193909352605480820194909452815180820390940184526074019052815191012090565b60008282018381101561142457600080fd5b9392505050565b81518151811461146f57604051600160e51b62461bcd02815260040180806020018281038252602e815260200180611868602e913960400191505060405180910390fd5b600081116114b157604051600160e51b62461bcd0281526004018080602001828103825260238152602001806118146023913960400191505060405180910390fd5b6000805b828110156114f7576114ed8482815181106114cc57fe5b602002602001015167ffffffffffffffff168361141290919063ffffffff16565b91506001016114b5565b50600381905583516115109060019060208701906115e6565b50825161152490600290602086019061164b565b507f323c51e0ad42c317ff3b00c6ce354d799a4b5eaf3a25cf3169cf2efd339d4d548484604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561158c578181015183820152602001611574565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156115cb5781810151838201526020016115b3565b5050505090500194505050505060405180910390a150505050565b82805482825590600052602060002090810192821561163b579160200282015b8281111561163b57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611606565b50611647929150611702565b5090565b828054828255906000526020600020906003016004900481019282156116f65791602002820160005b838211156116c057835183826101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509260200192600801602081600701049283019260010302611674565b80156116f45782816101000a81549067ffffffffffffffff02191690556008016020816007010492830192600103026116c0565b505b50611647929150611726565b6110aa91905b808211156116475780546001600160a01b0319168155600101611708565b6110aa91905b8082111561164757805467ffffffffffffffff1916815560010161172c56fe636865636b5468726573686f6c643a3a20496e636f7272656374206e756d626572206f6620706172616d734d657373616765206e6f74207369676e656420627920612076616c696461746f72636865636b5468726573686f6c643a3a205265636f76657265642061646472657373206973206e6f7420612076616c696461746f72636865636b5468726573686f6c643a3a2043616e6e6f74207375626d6974206d6f7265207369676e617475726573207468616e206578697374696e672076616c696461746f72734d7573742070726f76696465206d6f7265207468616e20302076616c696461746f7273636865636b5468726573686f6c643a3a204e6f7420656e6f75676820706f7765722066726f6d2076616c696461746f72735f726f7461746556616c696461746f72733a204172726179206c656e6774687320646f206e6f74206d6174636821a165627a7a72305820a5af8bf54c20df23d48951f8872de635eef9ee89958738cb8fa0c1a734271fb700294d7573742070726f76696465206d6f7265207468616e20302076616c696461746f72735f726f7461746556616c696461746f72733a204172726179206c656e6774687320646f206e6f74206d6174636821", +} \ No newline at end of file diff --git a/src/tests/contracts_bytecode.ts b/src/tests/contracts_bytecode.ts new file mode 100644 index 00000000..83b4037d --- /dev/null +++ b/src/tests/contracts_bytecode.ts @@ -0,0 +1,116 @@ +export const gateway = + '0x608060405234801561001057600080fd5b5060405160208062002aab8339810180604052602081101561003157600080fd5b5051600480546001600160a01b0319166001600160a01b0380841691909117808355604080517f37179db80000000000000000000000000000000000000000000000000000000081529051859492909316926337179db892828101926020929190829003018186803b1580156100a657600080fd5b505afa1580156100ba573d6000803e3d6000fd5b505050506040513d60208110156100d057600080fd5b505160008054600280546001600160a01b03199081163317909155600160a81b60ff0219600160a01b60ff02196001600160a01b039095169190921617929092167401000000000000000000000000000000000000000017919091167501000000000000000000000000000000000000000000179055505061295380620001586000396000f3fe60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063ced7c92a1161006f578063ced7c92a14610aa2578063da293eb314610c29578063e32f375114610d9b578063e402fbc814610db0578063e744092e14610ddc578063f9eaee0d14610e0f5761014b565b80638da5cb5b146105f557806393ba7daa1461060a578063b0116dc7146106e0578063b3b0f4c714610860578063b4c6034214610a2e578063b82730ab14610a675761014b565b8063392d661c11610108578063392d661c146104dc57806341c25c4a146105155780634e0dc557146105415780634e56ef52146105745780637ecebe00146105ad578063893d20e8146105e05761014b565b806303c0fe3a146101d657806314f6c3be14610358578063150b7a021461037f57806320cc8e511461046d5780632fc85c521461049e57806337179db8146104c7575b600054600160a01b900460ff1661019a5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6040805133815234602082015281517fbfe611b001dfcd411432f7bf0d79b82b4b2ee81511edac123a3403c357fb972a929181900390910190a1005b3480156101e257600080fd5b50610356600480360360c08110156101f957600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561022857600080fd5b82018360208201111561023a57600080fd5b803590602001918460208302840111600160201b8311171561025b57600080fd5b919390929091602081019035600160201b81111561027857600080fd5b82018360208201111561028a57600080fd5b803590602001918460208302840111600160201b831117156102ab57600080fd5b919390929091602081019035600160201b8111156102c857600080fd5b8201836020820111156102da57600080fd5b803590602001918460208302840111600160201b831117156102fb57600080fd5b919390929091602081019035600160201b81111561031857600080fd5b82018360208201111561032a57600080fd5b803590602001918460208302840111600160201b8311171561034b57600080fd5b509092509050610e42565b005b34801561036457600080fd5b5061036d611149565b60408051918252519081900360200190f35b34801561038b57600080fd5b50610450600480360360808110156103a257600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b8111156103dc57600080fd5b8201836020820111156103ee57600080fd5b803590602001918460018302840111600160201b8311171561040f57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061114e945050505050565b604080516001600160e01b03199092168252519081900360200190f35b34801561047957600080fd5b506104826112f5565b604080516001600160a01b039092168252519081900360200190f35b3480156104aa57600080fd5b506104b3611304565b604080519115158252519081900360200190f35b3480156104d357600080fd5b50610482611314565b3480156104e857600080fd5b50610356600480360360408110156104ff57600080fd5b50803590602001356001600160a01b0316611323565b34801561052157600080fd5b506103566004803603602081101561053857600080fd5b50351515611432565b34801561054d57600080fd5b5061036d6004803603602081101561056457600080fd5b50356001600160a01b03166114ad565b34801561058057600080fd5b506104b36004803603604081101561059757600080fd5b50803590602001356001600160a01b031661152c565b3480156105b957600080fd5b5061036d600480360360208110156105d057600080fd5b50356001600160a01b03166115b9565b3480156105ec57600080fd5b506104826115cb565b34801561060157600080fd5b506104826115da565b34801561061657600080fd5b50610450600480360360a081101561062d57600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b81111561066c57600080fd5b82018360208201111561067e57600080fd5b803590602001918460018302840111600160201b8311171561069f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506115e9945050505050565b3480156106ec57600080fd5b50610356600480360360c081101561070357600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561073257600080fd5b82018360208201111561074457600080fd5b803590602001918460208302840111600160201b8311171561076557600080fd5b919390929091602081019035600160201b81111561078257600080fd5b82018360208201111561079457600080fd5b803590602001918460208302840111600160201b831117156107b557600080fd5b919390929091602081019035600160201b8111156107d257600080fd5b8201836020820111156107e457600080fd5b803590602001918460208302840111600160201b8311171561080557600080fd5b919390929091602081019035600160201b81111561082257600080fd5b82018360208201111561083457600080fd5b803590602001918460208302840111600160201b8311171561085557600080fd5b509092509050611799565b34801561086c57600080fd5b50610450600480360360a081101561088357600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b8111156108b657600080fd5b8201836020820111156108c857600080fd5b803590602001918460208302840111600160201b831117156108e957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561093857600080fd5b82018360208201111561094a57600080fd5b803590602001918460208302840111600160201b8311171561096b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156109ba57600080fd5b8201836020820111156109cc57600080fd5b803590602001918460018302840111600160201b831117156109ed57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b02945050505050565b348015610a3a57600080fd5b5061036d60048036036040811015610a5157600080fd5b50803590602001356001600160a01b0316611d89565b348015610a7357600080fd5b5061035660048036036040811015610a8a57600080fd5b506001600160a01b0381351690602001351515611e0e565b348015610aae57600080fd5b50610356600480360360e0811015610ac557600080fd5b8135916020810135916001600160a01b036040830135169190810190608081016060820135600160201b811115610afb57600080fd5b820183602082011115610b0d57600080fd5b803590602001918460208302840111600160201b83111715610b2e57600080fd5b919390929091602081019035600160201b811115610b4b57600080fd5b820183602082011115610b5d57600080fd5b803590602001918460208302840111600160201b83111715610b7e57600080fd5b919390929091602081019035600160201b811115610b9b57600080fd5b820183602082011115610bad57600080fd5b803590602001918460208302840111600160201b83111715610bce57600080fd5b919390929091602081019035600160201b811115610beb57600080fd5b820183602082011115610bfd57600080fd5b803590602001918460208302840111600160201b83111715610c1e57600080fd5b509092509050611e85565b348015610c3557600080fd5b50610356600480360360a0811015610c4c57600080fd5b81359190810190604081016020820135600160201b811115610c6d57600080fd5b820183602082011115610c7f57600080fd5b803590602001918460208302840111600160201b83111715610ca057600080fd5b919390929091602081019035600160201b811115610cbd57600080fd5b820183602082011115610ccf57600080fd5b803590602001918460208302840111600160201b83111715610cf057600080fd5b919390929091602081019035600160201b811115610d0d57600080fd5b820183602082011115610d1f57600080fd5b803590602001918460208302840111600160201b83111715610d4057600080fd5b919390929091602081019035600160201b811115610d5d57600080fd5b820183602082011115610d6f57600080fd5b803590602001918460208302840111600160201b83111715610d9057600080fd5b50909250905061218c565b348015610da757600080fd5b506104b36123fb565b348015610dbc57600080fd5b5061035660048036036020811015610dd357600080fd5b5035151561240b565b348015610de857600080fd5b506104b360048036036020811015610dff57600080fd5b50356001600160a01b0316612478565b348015610e1b57600080fd5b506104b360048036036020811015610e3257600080fd5b50356001600160a01b031661248d565b600054600160a01b900460ff16610e915760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000610f156040518060400160405280601281526020017f115769746864726177204552433732313a0a00000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561103757600080fd5b505afa15801561104b573d6000803e3d6000fd5b5050336000818152600360205260408120805460010190559250611073915030908e8e6125ab565b9050806110e45760408051600160e31b6308934a5f028152336004820152602481018e905290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b1580156110cb57600080fd5b505af11580156110df573d6000803e3d6000fd5b505050505b336001600160a01b031660008051602061288083398151915260028d8f6040518084600481111561111157fe5b60ff1681526001600160a01b0390931660208401525060408083019190915251908190036060019150a2505050505050505050505050565b303190565b60008054600160a01b900460ff1661119e5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6111a73361248d565b6111f25760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7f691f4eac2b8850491851c72f70a121d76b20836d776658438f5b13dd9f8dbc6e858585338660405180866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156112a357818101518382015260200161128b565b50505050905090810190601f1680156112d05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a150600160e11b630a85bd0102949350505050565b6004546001600160a01b031681565b600054600160a81b900460ff1690565b6000546001600160a01b031681565b600054600160a01b900460ff166113725760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b61138d6001600160a01b03821633308563ffffffff6126a616565b60408051338152602081018490526001600160a01b0383168183015290517fa13cf347fb36122550e414f6fd1a0c2e490cff76331c4dcc20f760891ecca12a9181900360600190a16000546001600160a01b038281169116141561142e57604080518381526001600160a01b0383166020820152815133927f91557346f7592c9279b67cc52709a00442f0597658ec38a5fe84568c016331d7928290030190a25b5050565b6002546001600160a01b0316331461147e57604051600160e51b62461bcd0281526004018080602001828103825260378152602001806128c76037913960400191505060405180910390fd5b60008054911515600160a01b0274ff000000000000000000000000000000000000000019909216919091179055565b60408051600160e01b6370a0823102815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b1580156114fa57600080fd5b505afa15801561150e573d6000803e3d6000fd5b505050506040513d602081101561152457600080fd5b505192915050565b6000306001600160a01b0316826001600160a01b0316636352211e856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561157c57600080fd5b505afa158015611590573d6000803e3d6000fd5b505050506040513d60208110156115a657600080fd5b50516001600160a01b0316149392505050565b60036020526000908152604090205481565b6002546001600160a01b031690565b6002546001600160a01b031681565b60008054600160a01b900460ff166116395760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6116423361248d565b61168d5760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7fc341982fb8843f55f2f7aae4eb89231a4ef94a199f370debe7bc5c07c2de2bab86868686338760405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001858152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561174557818101518382015260200161172d565b50505050905090810190601f1680156117725780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a150600160e41b630660b3370295945050505050565b600054600160a01b900460ff166117e85760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b600061186c6040518060400160405280601181526020017f1057697468647261772045524332303a0a0000000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561198e57600080fd5b505afa1580156119a2573d6000803e3d6000fd5b5050336000908152600360209081526040808320805460010190558051600160e01b6370a0823102815230600482015290519294506001600160a01b038f1693506370a082319260248083019392829003018186803b158015611a0457600080fd5b505afa158015611a18573d6000803e3d6000fd5b505050506040513d6020811015611a2e57600080fd5b505190508b811015611aa55760408051600160e31b6308934a5f028152306004820152828e03602482015290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b158015611a8c57600080fd5b505af1158015611aa0573d6000803e3d6000fd5b505050505b611abf6001600160a01b038c16338e63ffffffff61270916565b6000543390600080516020612880833981519152906001600160a01b038e8116911614611aed576001611af0565b60045b8d8f6040518084600481111561111157fe5b60008054600160a01b900460ff16611b525760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b611b5b3361248d565b611ba65760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b835183518114611c005760408051600160e51b62461bcd02815260206004820152601a60248201527f4172726179206c656e6774687320646f206e6f74206d61746368000000000000604482015290519081900360640190fd5b7f48d67933be7b1e6d77d914145d793b5c9ced38156f34ebab23216e085435ac5587878787338860405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b031681526020018060200180602001856001600160a01b03166001600160a01b0316815260200180602001848103845288818151815260200191508051906020019060200280838360005b83811015611cb7578181015183820152602001611c9f565b50505050905001848103835287818151815260200191508051906020019060200280838360005b83811015611cf6578181015183820152602001611cde565b50505050905001848103825285818151815260200191508051906020019080838360005b83811015611d32578181015183820152602001611d1a565b50505050905090810190601f168015611d5f5780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390a150600160e11b6374f2df35029695505050505050565b60408051600160e11b627eeac70281523060048201526024810184905290516000916001600160a01b0384169162fdd58e91604480820192602092909190829003018186803b158015611ddb57600080fd5b505afa158015611def573d6000803e3d6000fd5b505050506040513d6020811015611e0557600080fd5b50519392505050565b6002546001600160a01b03163314611e5a57604051600160e51b62461bcd0281526004018080602001828103825260278152602001806128a06027913960400191505060405180910390fd5b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b600054600160a01b900460ff16611ed45760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000611f606040518060400160405280601381526020017f12576974686472617720455243373231583a0a000000000000000000000000008152508d8d8d60405160200180848152602001838152602001826001600160a01b03166001600160a01b031660601b81526014019350505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561208257600080fd5b505afa158015612096573d6000803e3d6000fd5b5050505060036000336001600160a01b03166001600160a01b0316815260200190815260200160002060008154809291906001019190505550896001600160a01b0316630febdd4930338f8f6040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001838152602001828152602001945050505050600060405180830381600087803b15801561215157600080fd5b505af1158015612165573d6000803e3d6000fd5b505060405133925060008051602061288083398151915291506003908d908f908084611111565b600054600160a01b900460ff166121db5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b60006122426040518060400160405280600f81526020017f0e5769746864726177204554483a0a00000000000000000000000000000000008152508b60405160200180828152602001915050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561236457600080fd5b505afa158015612378573d6000803e3d6000fd5b50503360008181526003602052604080822080546001019055519193508d156108fc0292508d9190818181858888f193505050501580156123bd573d6000803e3d6000fd5b5060408051600080825260208201528082018c905290513391600080516020612880833981519152919081900360600190a250505050505050505050565b600054600160a01b900460ff1690565b6002546001600160a01b0316331461245757604051600160e51b62461bcd02815260040180806020018281038252602a8152602001806128fe602a913960400191505060405180910390fd5b60008054911515600160a81b02600160a81b60ff0219909216919091179055565b60016020526000908152604090205460ff1681565b60008054600160a81b900460ff16806124be57506001600160a01b03821660009081526001602052604090205460ff165b92915050565b6000823360036000336001600160a01b03166001600160a01b031681526020019081526020016000205430856040516020018086805190602001908083835b602083106125225780518252601f199092019160209182019101612503565b6001836020036101000a038019825116818451168082178552505050505050905001856001600160a01b03166001600160a01b031660601b8152601401848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905092915050565b604080516001600160a01b0386811660248301528581166044830152606480830186905283518084039091018152608490920183526020820180516001600160e01b0316600160e01b6323b872dd021781529251825160009485949387169392918291908083835b602083106126325780518252601f199092019160209182019101612613565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612694576040519150601f19603f3d011682016040523d82523d6000602084013e612699565b606091505b5090979650505050505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b0316600160e01b6323b872dd02179052612703908590612763565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0316600160e01b63a9059cbb0217905261275e908490612763565b505050565b612775826001600160a01b0316612859565b61277e57600080fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106127bc5780518252601f19909201916020918201910161279d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461281e576040519150601f19603f3d011682016040523d82523d6000602084013e612823565b606091505b50915091508161283257600080fd5b8051156127035780806020019051602081101561284e57600080fd5b505161270357600080fd5b3b15159056fe476174657761792069732064697361626c65642e000000000000000000000000591f2d33d85291e32c4067b5a497caf3ddb5b1830eba9909e66006ec3a0051b4746f67676c65416c6c6f77546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65656e61626c65476174657761793a206f6e6c79206f776e65722063616e20656e61626c65206f722064697361626c652067617465776179746f67676c65416c6c6f77416e79546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65a165627a7a72305820ace81939002d8d64077e021434066edca9c22927222014369aef418d15fd26bb0029' + +export const dappChainERC20 = + '0x60806040526040805190810160405280600581526020017f45524332300000000000000000000000000000000000000000000000000000008152506005908051906020019062000051929190620001f6565b506040805190810160405280600381526020017f4443430000000000000000000000000000000000000000000000000000000000815250600690805190602001906200009f929190620001f6565b506012600760006101000a81548160ff021916908360ff160217905550348015620000c957600080fd5b5060405160208062001aa48339810180604052810190808051906020019092919050505080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900460ff1660ff16600a0a633b9aca0002600181905550600760009054906101000a900460ff1660ff16600a0a633b9aca00026000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555033600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050620002a5565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200023957805160ff19168380011785556200026a565b828001600101855582156200026a579182015b82811115620002695782518255916020019190600101906200024c565b5b5090506200027991906200027d565b5090565b620002a291905b808211156200029e57600081600090555060010162000284565b5090565b90565b6117ef80620002b56000396000f3006080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b314610170578063116191b6146101d557806318160ddd1461022c57806323b872dd14610257578063313ce567146102dc578063449a52f81461030d578063544297f51461035a578063661884631461038757806370a08231146103ec57806395d89b4114610443578063a9059cbb146104d3578063d5f3948814610538578063d73dd6231461058f578063dd62ed3e146105f4575b600080fd5b3480156100ec57600080fd5b506100f561066b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610709565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea6107fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023857600080fd5b50610241610821565b6040518082815260200191505060405180910390f35b34801561026357600080fd5b506102c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082b565b604051808215151515815260200191505060405180910390f35b3480156102e857600080fd5b506102f1610be6565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031957600080fd5b50610358600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bf9565b005b34801561036657600080fd5b5061038560048036038101908080359060200190929190505050610dfc565b005b34801561039357600080fd5b506103d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f4d565b604051808215151515815260200191505060405180910390f35b3480156103f857600080fd5b5061042d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111df565b6040518082815260200191505060405180910390f35b34801561044f57600080fd5b50610458611227565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561049857808201518184015260208101905061047d565b50505050905090810190601f1680156104c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104df57600080fd5b5061051e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112c5565b604051808215151515815260200191505060405180910390f35b34801561054457600080fd5b5061054d6114e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059b57600080fd5b506105da600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061150b565b604051808215151515815260200191505060405180910390f35b34801561060057600080fd5b50610655600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611707565b6040518082815260200191505060405180910390f35b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107015780601f106106d657610100808354040283529160200191610701565b820191906000526020600020905b8154815290600101906020018083116106e457829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087a57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561090557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561094157600080fd5b610992826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178e90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a25826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610af682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ce4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f6e6f7420617574686f72697a656420746f20706572666f726d2074686973206181526020017f6374696f6e00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610cf9816001546117a790919063ffffffff16565b600181905550610d50816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5857600080fd5b610e6d816001546117a790919063ffffffff16565b600181905550610ee681600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808310151561105f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110f3565b611072838261178e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112bd5780601f10611292576101008083540402835291602001916112bd565b820191906000526020600020905b8154815290600101906020018083116112a057829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561131457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561135057600080fd5b6113a1826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178e90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611434826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061159c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561179c57fe5b818303905092915050565b600081830190508281101515156117ba57fe5b809050929150505600a165627a7a72305820cc50de3ef6f8756e5e3796a0e739d1d17ec1a936953cfa2c5b545031033ddba50029' + +/** + * pragma solidity <0.6.0; + * + * import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; + * + * contract LoomToken is ERC20 { + * string public name = "Loom Token"; + * string public symbol = "LOOM"; + * uint8 public decimals = 18; + * + * // one billion in initial supply + * uint256 public constant INITIAL_SUPPLY = 1000000000; + * + * constructor () public { + * _mint(msg.sender, INITIAL_SUPPLY * (10 ** uint256(decimals))); + * } + * } + */ +export const mainnetERC20 = + '0x60c0604052600a60808190527f4c6f6f6d20546f6b656e0000000000000000000000000000000000000000000060a090815261003e916003919061018d565b506040805180820190915260048082527f4c4f4f4d000000000000000000000000000000000000000000000000000000006020909201918252610081918161018d565b506005805460ff1916601217905534801561009b57600080fd5b506005546100bd90339060ff16600a0a633b9aca00026100c2602090811b901c565b610228565b6001600160a01b0382166100d557600080fd5b6100ee8160025461017460201b61066c1790919060201c565b6002556001600160a01b0382166000908152602081815260409091205461011e91839061066c610174821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60008282018381101561018657600080fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106101ce57805160ff19168380011785556101fb565b828001600101855582156101fb579182015b828111156101fb5782518255916020019190600101906101e0565b5061020792915061020b565b5090565b61022591905b808211156102075760008155600101610211565b90565b6106b1806102376000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063395093511161007157806339509351146101ec57806370a082311461021857806395d89b411461023e578063a457c2d714610246578063a9059cbb14610272578063dd62ed3e1461029e576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd146101905780632ff2e9dc146101c6578063313ce567146101ce575b600080fd5b6100c16102cc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b03813516906020013561035a565b604080519115158252519081900360200190f35b61017e610370565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610376565b61017e6103cd565b6101d66103d5565b6040805160ff9092168252519081900360200190f35b6101626004803603604081101561020257600080fd5b506001600160a01b0381351690602001356103de565b61017e6004803603602081101561022e57600080fd5b50356001600160a01b031661041a565b6100c1610435565b6101626004803603604081101561025c57600080fd5b506001600160a01b038135169060200135610490565b6101626004803603604081101561028857600080fd5b506001600160a01b0381351690602001356104cc565b61017e600480360360408110156102b457600080fd5b506001600160a01b03813581169160200135166104d9565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b820191906000526020600020905b81548152906001019060200180831161033557829003601f168201915b505050505081565b6000610367338484610504565b50600192915050565b60025490565b600061038384848461058c565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546103c39186916103be908663ffffffff61065716565b610504565b5060019392505050565b633b9aca0081565b60055460ff1681565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61066c16565b6001600160a01b031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61065716565b600061036733848461058c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b03821661051757600080fd5b6001600160a01b03831661052a57600080fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03821661059f57600080fd5b6001600160a01b0383166000908152602081905260409020546105c8908263ffffffff61065716565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105fd908263ffffffff61066c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282111561066657600080fd5b50900390565b60008282018381101561067e57600080fd5b939250505056fea165627a7a723058206d82d10902ac3d0fd578314b284fba835070c43adb2fbc46a2ba644e83b7580c0029' + +/** + * pragma solidity ^0.4.24; + * + * contract SimpleStore { + * uint256 value; + * + * constructor() public { + * value = 10; + * } + * + * event NewValueSet(uint indexed _value, address sender); + * + * function set(uint _value) public { + * value = _value; + * emit NewValueSet(value, msg.sender); + * } + * + * function get() public view returns (uint) { + * return value; + * } + * } + */ +export const SimpleStore = + '0x608060405234801561001057600080fd5b50600a60008190555061010e806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c146078575b600080fd5b348015605957600080fd5b5060766004803603810190808035906020019092919050505060a0565b005b348015608357600080fd5b50608a60d9565b6040518082815260200191505060405180910390f35b806000819055506000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b600080549050905600a165627a7a72305820b76f6c855a1f95260fc70490b16774074225da52ea165a58e95eb7a72a59d1700029' + +/** + * pragma solidity ^0.4.22; + * + * contract SimpleStore { + * uint value; + * + * constructor() public { + * value = 10; + * } + * + * event NewValueSet(uint indexed _value); + * event NewValueSetAgain(uint indexed _value); + * + * function set(uint _value) public { + * value = _value; + * emit NewValueSet(value); + * } + * + * function setAgain(uint _value) public { + * value = _value; + * emit NewValueSetAgain(value); + * } + * + * function get() public view returns (uint) { + * return value; + * } + * } + */ +export const SimpleStore2 = + 'x608060405234801561001057600080fd5b50600a60005561015c806100256000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166360fe47b1811461005b5780636d4ce63c14610075578063cf7189211461009c575b600080fd5b34801561006757600080fd5b506100736004356100b4565b005b34801561008157600080fd5b5061008a6100ef565b60408051918252519081900360200190f35b3480156100a857600080fd5b506100736004356100f5565b60008190556040805182815290517fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b9181900360200190a150565b60005490565b60008190556040805182815290517fc151b22f26f815d64ae384647d49bc5655149c4b273318d8c3846086dae3835e9181900360200190a1505600a165627a7a723058206e4e5f5b6acc54b18ad15cb2110379c386cd8327527ca2d203a563300b37e3890029' + +/** + * pragma solidity ^0.4.22; + * + * contract SimpleStore { + * uint value; + * + * constructor() public { + * value = 10; + * } + * + * event NewValueSet(uint indexed _value); + * event NewValueSetAgain(uint indexed _value); + * + * function set(uint _value) public { + * value = _value; + * + * require(_value != 100, "Magic value"); + * + * emit NewValueSet(value); + * } + * + * function setAgain(uint _value) public { + * value = _value; + * emit NewValueSetAgain(value); + * } + * + * function get() public view returns (uint) { + * return value; + * } + * } + */ +export const SimpleStore3 = + '608060405234801561001057600080fd5b50600a600081905550610201806100286000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b11461005c5780636d4ce63c14610089578063cf718921146100b4575b600080fd5b34801561006857600080fd5b50610087600480360381019080803590602001909291905050506100e1565b005b34801561009557600080fd5b5061009e610193565b6040518082815260200191505060405180910390f35b3480156100c057600080fd5b506100df6004803603810190808035906020019092919050505061019c565b005b8060008190555060648114151515610161576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4d616769632076616c756500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b60008054905090565b806000819055506000547fc151b22f26f815d64ae384647d49bc5655149c4b273318d8c3846086dae3835e60405160405180910390a2505600a165627a7a723058204c7af9b8100ac44b72d5498cd5d9034844c7b2249060740bafbe2876fbbcb6d40029' diff --git a/src/tests/e2e/client-evm-event-tests-2.ts b/src/tests/e2e/client-evm-event-tests-2.ts index 0a4359f7..d6d6a5b9 100644 --- a/src/tests/e2e/client-evm-event-tests-2.ts +++ b/src/tests/e2e/client-evm-event-tests-2.ts @@ -8,39 +8,7 @@ import { deployContract } from '../evm-helpers' import { bufferToProtobufBytes } from '../../crypto-utils' import { Address, LocalAddress } from '../../address' import { createDefaultTxMiddleware } from '../../helpers' - -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * - * constructor() public { - * value = 10; - * } - * - * event NewValueSet(uint indexed _value); - * event NewValueSetAgain(uint indexed _value); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value); - * } - * - * function setAgain(uint _value) public { - * value = _value; - * emit NewValueSetAgain(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - * - */ +import { SimpleStore2 } from '../contracts_bytecode' const callTransactionAsync = async ( client: Client, @@ -66,6 +34,7 @@ const callTransactionAsync = async ( test('Client EVM Event test (two filters)', async t => { let client + try { const privateKey = CryptoUtils.generatePrivateKey() const publicKey = CryptoUtils.publicKeyFromPrivateKey(privateKey) @@ -76,12 +45,8 @@ test('Client EVM Event test (two filters)', async t => { // Only used for deploy the contract const loomProvider = new LoomProvider(client, privateKey) - // Contract bytecode to deploy - const contractData = - '608060405234801561001057600080fd5b50600a60005561015c806100256000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166360fe47b1811461005b5780636d4ce63c14610075578063cf7189211461009c575b600080fd5b34801561006757600080fd5b506100736004356100b4565b005b34801561008157600080fd5b5061008a6100ef565b60408051918252519081900360200190f35b3480156100a857600080fd5b506100736004356100f5565b60008190556040805182815290517fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b9181900360200190a150565b60005490565b60008190556040805182815290517fc151b22f26f815d64ae384647d49bc5655149c4b273318d8c3846086dae3835e9181900360200190a1505600a165627a7a723058206e4e5f5b6acc54b18ad15cb2110379c386cd8327527ca2d203a563300b37e3890029' - // Deploy - const result = await deployContract(loomProvider, contractData) + const result = await deployContract(loomProvider, SimpleStore2) // Middleware used for client client.txMiddleware = createDefaultTxMiddleware(client, privateKey) diff --git a/src/tests/e2e/client-evm-event-tests.ts b/src/tests/e2e/client-evm-event-tests.ts index 891f388f..47bcf540 100644 --- a/src/tests/e2e/client-evm-event-tests.ts +++ b/src/tests/e2e/client-evm-event-tests.ts @@ -7,33 +7,7 @@ import { LoomProvider } from '../../loom-provider' import { deployContract } from '../evm-helpers' import { bufferToProtobufBytes } from '../../crypto-utils' import { Address, LocalAddress } from '../../address' - -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * constructor() public { - * value = 10; - * } - * - * event NewValueSet(uint indexed _value); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - * - * - */ +import { SimpleStore } from '../contracts_bytecode' test('Client EVM Event test', async t => { let client @@ -48,12 +22,8 @@ test('Client EVM Event test', async t => { // Only used for deploy the contract const loomProvider = new LoomProvider(client, privateKey) - // Contract bytecode to deploy - const contractData = - '0x608060405234801561001057600080fd5b50600a60008190555061010e806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c146078575b600080fd5b348015605957600080fd5b5060766004803603810190808035906020019092919050505060a0565b005b348015608357600080fd5b50608a60d9565b6040518082815260200191505060405180910390f35b806000819055506000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b600080549050905600a165627a7a72305820b76f6c855a1f95260fc70490b16774074225da52ea165a58e95eb7a72a59d1700029' - // Deploy - const result = await deployContract(loomProvider, contractData) + const result = await deployContract(loomProvider, SimpleStore) // Middleware used for client client.txMiddleware = [ @@ -100,6 +70,7 @@ test('Client EVM Event test', async t => { tx.setId(2) tx.setData(msgTx.serializeBinary()) + // @ts-ignore await client.commitTxAsync(tx) console.log('Disconnected') diff --git a/src/tests/e2e/client-test-tx-cache.ts b/src/tests/e2e/client-test-tx-cache.ts index ef85e16b..478e6dcb 100644 --- a/src/tests/e2e/client-test-tx-cache.ts +++ b/src/tests/e2e/client-test-tx-cache.ts @@ -16,42 +16,7 @@ import { deployContract } from '../evm-helpers' import { bufferToProtobufBytes } from '../../crypto-utils' import { Address, LocalAddress } from '../../address' import { sleep } from '../../helpers' - -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * - * constructor() public { - * value = 10; - * } - * - * event NewValueSet(uint indexed _value); - * event NewValueSetAgain(uint indexed _value); - * - * function set(uint _value) public { - * value = _value; - * - * require(_value != 100, "Magic value"); - * - * emit NewValueSet(value); - * } - * - * function setAgain(uint _value) public { - * value = _value; - * emit NewValueSetAgain(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - * - */ +import { SimpleStore3 } from '../contracts_bytecode' async function deploySimpleStoreContract(): Promise
{ let privateKey = CryptoUtils.generatePrivateKey() @@ -63,12 +28,8 @@ async function deploySimpleStoreContract(): Promise
{ // Only used for deploy the contract const loomProvider = new LoomProvider(client, privateKey) - // Contract bytecode to deploy - const contractData = - '608060405234801561001057600080fd5b50600a600081905550610201806100286000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b11461005c5780636d4ce63c14610089578063cf718921146100b4575b600080fd5b34801561006857600080fd5b50610087600480360381019080803590602001909291905050506100e1565b005b34801561009557600080fd5b5061009e610193565b6040518082815260200191505060405180910390f35b3480156100c057600080fd5b506100df6004803603810190808035906020019092919050505061019c565b005b8060008190555060648114151515610161576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4d616769632076616c756500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b60008054905090565b806000819055506000547fc151b22f26f815d64ae384647d49bc5655149c4b273318d8c3846086dae3835e60405160405180910390a2505600a165627a7a723058204c7af9b8100ac44b72d5498cd5d9034844c7b2249060740bafbe2876fbbcb6d40029' - // Deploy - const result = await deployContract(loomProvider, contractData) + const result = await deployContract(loomProvider, SimpleStore3) contractAddress = new Address('default', LocalAddress.fromHexString(result.contractAddress)) } catch (err) { throw err diff --git a/src/tests/e2e/client-test-tx-middleware.ts b/src/tests/e2e/client-test-tx-middleware.ts index 5e553bde..4f73fbfb 100644 --- a/src/tests/e2e/client-test-tx-middleware.ts +++ b/src/tests/e2e/client-test-tx-middleware.ts @@ -16,37 +16,11 @@ import { createDefaultTxMiddleware } from '../../helpers' import { EthersSigner, getJsonRPCSignerAsync } from '../../solidity-helpers' import { createTestHttpClient } from '../helpers' import { AddressMapper, Coin } from '../../contracts' +import { SimpleStore } from '../contracts_bytecode' // import Web3 from 'web3' const Web3 = require('web3') -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.24; - * - * contract SimpleStore { - * uint256 value; - * - * constructor() public { - * value = 10; - * } - * - * event NewValueSet(uint indexed _value, address sender); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value, msg.sender); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - * - */ - const toCoinE18 = (amount: number): BN => { return new BN(10).pow(new BN(18)).mul(new BN(amount)) } @@ -77,66 +51,10 @@ async function bootstrapTest( // Create LoomProvider instance const loomProvider = new LoomProvider(client, privKey) - // Contract data and ABI - const contractData = - '608060405234801561001057600080fd5b50600a60008190555061014e806100286000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b1146100515780636d4ce63c1461007e575b600080fd5b34801561005d57600080fd5b5061007c600480360381019080803590602001909291905050506100a9565b005b34801561008a57600080fd5b50610093610119565b6040518082815260200191505060405180910390f35b806000819055506000547f7e0b7a35f017ec94e71d7012fe8fa8011f1dab6090674f92de08f8092ab30dda33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250565b600080549050905600a165627a7a7230582041f33d6a8b78928e192affcb980ca6bef9b6f5b7da5aa4b2d75b1208720caeeb0029' - - const ABI = [ - { - constant: false, - inputs: [ - { - name: '_value', - type: 'uint256' - } - ], - name: 'set', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function' - }, - { - constant: true, - inputs: [], - name: 'get', - outputs: [ - { - name: '', - type: 'uint256' - } - ], - payable: false, - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - name: '_value', - type: 'uint256' - }, - { - indexed: false, - name: 'sender', - type: 'address' - } - ], - name: 'NewValueSet', - type: 'event' - } - ] + const ABI = [] // Deploy the contract using loom provider - const result = await deployContract(loomProvider, contractData) + const result = await deployContract(loomProvider, SimpleStore) // Instantiate Contract using web3 const web3 = new Web3(loomProvider) diff --git a/src/tests/e2e/loom-provider-eth-filters.ts b/src/tests/e2e/loom-provider-eth-filters.ts index a645307d..85644eb8 100644 --- a/src/tests/e2e/loom-provider-eth-filters.ts +++ b/src/tests/e2e/loom-provider-eth-filters.ts @@ -4,36 +4,7 @@ import { CryptoUtils } from '../../index' import { createTestClient, execAndWaitForMillisecondsAsync } from '../helpers' import { LoomProvider } from '../../loom-provider' import { deployContract } from '../evm-helpers' - -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * - * constructor() { - * value = 10; - * } - * - * event NewValueSet(uint _value); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - * - */ - -const contractData = - '608060405234801561001057600080fd5b50600a600081905550610114806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c14606c575b600080fd5b606a600480360381019080803590602001909291905050506094565b005b348015607757600080fd5b50607e60df565b6040518082815260200191505060405180910390f35b806000819055507f2afa03c814297ffc234ff967b6f0863d3c358be243103f20217c8d3a4d39f9c060005434604051808381526020018281526020019250505060405180910390a150565b600080549050905600a165627a7a72305820deed812a797567167162d0af3ae5f0528c39bea0620e32b28e243628cd655dc40029' +import { SimpleStore } from '../contracts_bytecode' test('LoomProvider + Filters', async t => { let client @@ -44,7 +15,7 @@ test('LoomProvider + Filters', async t => { client.on('error', msg => console.error('Error on client:', msg)) const loomProvider = new LoomProvider(client, privKey) - await deployContract(loomProvider, contractData) + await deployContract(loomProvider, SimpleStore) // Transaction receipt in order to obtain the topic of the event NewValueSet const ethNewFilterResult = await execAndWaitForMillisecondsAsync( diff --git a/src/tests/e2e/loom-provider-eth-get-logs.ts b/src/tests/e2e/loom-provider-eth-get-logs.ts index 57383a61..55f0dedb 100644 --- a/src/tests/e2e/loom-provider-eth-get-logs.ts +++ b/src/tests/e2e/loom-provider-eth-get-logs.ts @@ -5,39 +5,10 @@ import { createTestClient, execAndWaitForMillisecondsAsync } from '../helpers' import { LoomProvider } from '../../loom-provider' import { deployContract } from '../evm-helpers' import { numberToHex } from '../../crypto-utils' - -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * - * constructor() { - * value = 10; - * } - * - * event NewValueSet(uint _value); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - * - */ - -const contractData = - '608060405234801561001057600080fd5b50600a600081905550610114806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c14606c575b600080fd5b606a600480360381019080803590602001909291905050506094565b005b348015607757600080fd5b50607e60df565b6040518082815260200191505060405180910390f35b806000819055507f2afa03c814297ffc234ff967b6f0863d3c358be243103f20217c8d3a4d39f9c060005434604051808381526020018281526020019250505060405180910390a150565b600080549050905600a165627a7a72305820deed812a797567167162d0af3ae5f0528c39bea0620e32b28e243628cd655dc40029' +import { SimpleStore } from '../contracts_bytecode' async function newTransactionToSetState(loomProvider: LoomProvider, fromAddr: string) { - const contractDeployResult = await deployContract(loomProvider, contractData) + const contractDeployResult = await deployContract(loomProvider, SimpleStore) const contractAddress = contractDeployResult.contractAddress // Send transaction to function set in order dispatch event NewValueSet diff --git a/src/tests/e2e/loom-provider-subscribe.ts b/src/tests/e2e/loom-provider-subscribe.ts index abb412ed..67c16deb 100644 --- a/src/tests/e2e/loom-provider-subscribe.ts +++ b/src/tests/e2e/loom-provider-subscribe.ts @@ -4,36 +4,7 @@ import { LocalAddress, CryptoUtils } from '../../index' import { createTestClient, execAndWaitForMillisecondsAsync } from '../helpers' import { LoomProvider } from '../../loom-provider' import { deployContract } from '../evm-helpers' - -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * - * constructor() { - * value = 10; - * } - * - * event NewValueSet(uint _value); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - * - */ - -const contractData = - '608060405234801561001057600080fd5b50600a600081905550610114806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c14606c575b600080fd5b606a600480360381019080803590602001909291905050506094565b005b348015607757600080fd5b50607e60df565b6040518082815260200191505060405180910390f35b806000819055507f2afa03c814297ffc234ff967b6f0863d3c358be243103f20217c8d3a4d39f9c060005434604051808381526020018281526020019250505060405180910390a150565b600080549050905600a165627a7a72305820deed812a797567167162d0af3ae5f0528c39bea0620e32b28e243628cd655dc40029' +import { SimpleStore } from '../contracts_bytecode' test('LoomProvider + Subscribe', async t => { let client @@ -46,7 +17,7 @@ test('LoomProvider + Subscribe', async t => { ).toString() const loomProvider = new LoomProvider(client, privKey) - const contractDeployResult = await deployContract(loomProvider, contractData) + const contractDeployResult = await deployContract(loomProvider, SimpleStore) const id = 1 const ethSubscribeNewHardsResult = await execAndWaitForMillisecondsAsync( diff --git a/src/tests/e2e/loom-provider-tests.ts b/src/tests/e2e/loom-provider-tests.ts index 4ce1a3bf..efebb263 100644 --- a/src/tests/e2e/loom-provider-tests.ts +++ b/src/tests/e2e/loom-provider-tests.ts @@ -12,23 +12,7 @@ import { deployContract } from '../evm-helpers' import { ecrecover, privateToPublic, fromRpcSig, toBuffer } from 'ethereumjs-util' import { soliditySha3 } from '../../solidity-helpers' import { bytesToHexAddr } from '../../crypto-utils' - -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.18; - * contract SimpleStore { - * function set(uint _value) public { - * value = _value; - * } - * function get() public constant returns (uint) { - * return value; - * } - * uint value; - * } - * - */ +import { SimpleStore } from '../contracts_bytecode' const newContractAndClient = async () => { const privKey = CryptoUtils.generatePrivateKey() @@ -36,10 +20,7 @@ const newContractAndClient = async () => { const from = LocalAddress.fromPublicKey(CryptoUtils.publicKeyFromPrivateKey(privKey)).toString() const loomProvider = new LoomProvider(client, privKey) - const contractData = - '608060405234801561001057600080fd5b50600a600081905550610118806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c146078575b600080fd5b348015605957600080fd5b5060766004803603810190808035906020019092919050505060a0565b005b348015608357600080fd5b50608a60e3565b6040518082815260200191505060405180910390f35b806000819055507fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b6000546040518082815260200191505060405180910390a150565b600080549050905600a165627a7a72305820fabe42649c29e53c4b9fad19100d72a1e825603058e1678432a76f94a10d352a0029' - - const { contractAddress, transactionHash } = await deployContract(loomProvider, contractData) + const { contractAddress, transactionHash } = await deployContract(loomProvider, SimpleStore) client.on('error', msg => console.error('Error on client:', msg)) diff --git a/src/tests/e2e/loom-provider-web3-middlewares-tests.ts b/src/tests/e2e/loom-provider-web3-middlewares-tests.ts index 4776cac1..b3bbb2c9 100644 --- a/src/tests/e2e/loom-provider-web3-middlewares-tests.ts +++ b/src/tests/e2e/loom-provider-web3-middlewares-tests.ts @@ -8,37 +8,11 @@ import { deployContract } from '../evm-helpers' import { SignedTxMiddleware } from '../../middleware' import { ITxMiddlewareHandler } from '../../client' import { NonceTx } from '../../proto/loom_pb' +import { SimpleStore } from '../contracts_bytecode' // import Web3 from 'web3' const Web3 = require('web3') -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * constructor() public { - * value = 10; - * } - * - * event NewValueSet(uint indexed _value); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - * - * - */ - /** * Super simple custom middleware for more about middlewares see "loom-js/src/middleware" */ @@ -79,9 +53,6 @@ test('LoomProvider + Web3 + Middleware', async t => { client.on('error', console.log) - const contractData = - '0x608060405234801561001057600080fd5b50600a60008190555061010e806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c146078575b600080fd5b348015605957600080fd5b5060766004803603810190808035906020019092919050505060a0565b005b348015608357600080fd5b50608a60d9565b6040518082815260200191505060405180910390f35b806000819055506000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b600080549050905600a165627a7a72305820b76f6c855a1f95260fc70490b16774074225da52ea165a58e95eb7a72a59d1700029' - const ABI = [ { constant: false, @@ -110,7 +81,7 @@ test('LoomProvider + Web3 + Middleware', async t => { } ] - const result = await deployContract(loomProvider, contractData) + const result = await deployContract(loomProvider, SimpleStore) const contract = new web3.eth.Contract(ABI, result.contractAddress, { from }) diff --git a/src/tests/e2e/loom-provider-web3-tests.ts b/src/tests/e2e/loom-provider-web3-tests.ts index c7d10953..0ef83008 100644 --- a/src/tests/e2e/loom-provider-web3-tests.ts +++ b/src/tests/e2e/loom-provider-web3-tests.ts @@ -9,37 +9,11 @@ import { deployContract } from '../evm-helpers' import { ecrecover, privateToPublic, fromRpcSig } from 'ethereumjs-util' import { soliditySha3 } from '../../solidity-helpers' import { bytesToHexAddr } from '../../crypto-utils' +import { SimpleStore } from '../contracts_bytecode' // import Web3 from 'web3' const Web3 = require('web3') -/** - * Requires the SimpleStore solidity contract deployed on a loomchain. - * go-loom/examples/plugins/evmexample/contract/SimpleStore.sol - * - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * constructor() public { - * value = 10; - * } - * - * event NewValueSet(uint indexed _value); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - * - * - */ - const newContractAndClient = async () => { const privKey = CryptoUtils.generatePrivateKey() const client = createTestClient() @@ -49,9 +23,6 @@ const newContractAndClient = async () => { client.on('error', console.log) - const contractData = - '0x608060405234801561001057600080fd5b50600a60008190555061010e806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c146078575b600080fd5b348015605957600080fd5b5060766004803603810190808035906020019092919050505060a0565b005b348015608357600080fd5b50608a60d9565b6040518082815260200191505060405180910390f35b806000819055506000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b600080549050905600a165627a7a72305820b76f6c855a1f95260fc70490b16774074225da52ea165a58e95eb7a72a59d1700029' - const ABI = [ { constant: false, @@ -80,7 +51,7 @@ const newContractAndClient = async () => { } ] - const result = await deployContract(loomProvider, contractData) + const result = await deployContract(loomProvider, SimpleStore) const contract = new web3.eth.Contract(ABI, result.contractAddress, { from }) diff --git a/src/tests/e2e/transfer-gateway-tests.ts b/src/tests/e2e/transfer-gateway-tests.ts index dd5511fc..bee8f9e8 100644 --- a/src/tests/e2e/transfer-gateway-tests.ts +++ b/src/tests/e2e/transfer-gateway-tests.ts @@ -8,28 +8,15 @@ import { Client, LocalAddress } from '../../index' -import { createTestHttpClient, getTestUrls } from '../helpers' +import { createTestHttpClient, getTestUrls, waitForMillisecondsAsync } from '../helpers' import { B64ToUint8Array } from '../../crypto-utils' import { LoomProvider } from '../../loom-provider' import Web3 from 'web3' import { getJsonRPCSignerAsync, EthersSigner, soliditySha3 } from '../../solidity-helpers' import { deployContractGanache, deployContract } from '../evm-helpers' +import { gateway, dappChainERC20, mainnetERC20 } from '../contracts_bytecode' -async function getClientAndContract( - createClient: () => Client -): Promise<{ - acct1Client: Client - acct2Client: Client - transferGateway: Contracts.TransferGateway - addressMapper: Contracts.AddressMapper - acct1PubKey: Uint8Array - acct2PubKey: Uint8Array - web3Loom: Web3 - web3Ganache: Web3 - loomContractAddress: string - ganacheConctractAddress: string - ganacheContractHash: string -}> { +async function getClientAndContract(createClient: () => Client) { const acct1PrivKey = B64ToUint8Array( 'Hz9P3aHH62mO75A6uMVW3mn0U1KkZSq3t03jfOZfyZxjyJoJctNDY6awaVqOpjCGTjHZZxkc23Z3l39EjLOIFQ==' ) @@ -60,15 +47,17 @@ async function getClientAndContract( const web3Loom = new Web3(loomProvider) const web3Ganache = new Web3('http://localhost:8545') - const contractData = - '608060405234801561001057600080fd5b50600a600081905550610118806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c146078575b600080fd5b348015605957600080fd5b5060766004803603810190808035906020019092919050505060a0565b005b348015608357600080fd5b50608a60e3565b6040518082815260200191505060405180910390f35b806000819055507fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b6000546040518082815260200191505060405180910390a150565b600080549050905600a165627a7a72305820fabe42649c29e53c4b9fad19100d72a1e825603058e1678432a76f94a10d352a0029' + const dappchainERC20DeployedContractResults = await deployContract(loomProvider, dappChainERC20) + const gatewayDeployedContractResults = await deployContractGanache(web3Ganache, gateway) + // const mainnetERC20DeployedContractResults = await deployContractGanache( + // web3Ganache, + // mainnetERC20 + // ) - const loomDeployedContractResults = await deployContract(loomProvider, contractData) - const ganacheDeployedContractResults = await deployContractGanache(web3Ganache, contractData) - - const loomContractAddress = loomDeployedContractResults.contractAddress - const ganacheConctractAddress = ganacheDeployedContractResults.contractAddress - const ganacheContractHash = ganacheDeployedContractResults.transactionHash + // const mainnetERC20ContractAddress = mainnetERC20DeployedContractResults.contractAddress + // const gatewayContractAddress = gatewayDeployedContractResults.contractAddress + // const dappchainERC20ContractAddress = dappchainERC20DeployedContractResults.contractAddress + // const mainnetERC20ContractHash = mainnetERC20DeployedContractResults.transactionHash return { acct1Client, @@ -78,76 +67,86 @@ async function getClientAndContract( acct1PubKey, acct2PubKey, web3Loom, - web3Ganache, - loomContractAddress, - ganacheConctractAddress, - ganacheContractHash + web3Ganache + // mainnetERC20ContractAddress + // gatewayContractAddress, + // dappchainERC20ContractAddress, + // mainnetERC20ContractHash } } test('Should gateway owner authorize contract mapping', async (t: Test) => { const { - acct1Client, - loomContractAddress, - ganacheConctractAddress, - transferGateway + // acct1Client, + // dappchainERC20ContractAddress, + // mainnetERC20ContractAddress, + // transferGateway } = await getClientAndContract(createTestHttpClient) - const localContract = new Address( - acct1Client.chainId, - LocalAddress.fromHexString(loomContractAddress) - ) - const foreignContract = new Address('eth', LocalAddress.fromHexString(ganacheConctractAddress)) + // const localContract = new Address( + // acct1Client.chainId, + // LocalAddress.fromHexString(dappchainERC20ContractAddress) + // ) + // const foreignContract = new Address( + // 'eth', + // LocalAddress.fromHexString(mainnetERC20ContractAddress) + // ) - await transferGateway.addAuthorizedContractMappingAsync({ foreignContract, localContract }) - const contractsAuthorized = await transferGateway.listContractMappingsAsync() + // await transferGateway.addAuthorizedContractMappingAsync({ foreignContract, localContract }) + // const contractsAuthorized = await transferGateway.listContractMappingsAsync() - const match = contractsAuthorized.confirmed.find(({ from, to }) => { - return ( - `eth:${ganacheConctractAddress.toLowerCase()}` == to.toString() && - `default:${loomContractAddress.toLowerCase()}` == from.toString() - ) - }) + // const match = contractsAuthorized.confirmed.find(({ from, to }) => { + // return ( + // `eth:${mainnetERC20ContractAddress.toLowerCase()}` == to.toString() && + // `default:${dappchainERC20ContractAddress.toLowerCase()}` == from.toString() + // ) + // }) - t.assert(match, 'Contracts should be confirmed') + // t.assert(match, 'Contracts should be confirmed') t.end() }) -test('Should user mapping contracts on gateway', async (t: Test) => { - const { - acct1Client, - transferGateway, - loomContractAddress, - ganacheConctractAddress, - ganacheContractHash - } = await getClientAndContract(createTestHttpClient) +// test.only('Should user mapping contracts on gateway', async (t: Test) => { +// const { +// acct1Client, +// transferGateway, +// loomContractAddress, +// ganacheConctractAddress, +// ganacheContractHash +// } = await getClientAndContract(createTestHttpClient) - const localContract = new Address( - acct1Client.chainId, - LocalAddress.fromHexString(loomContractAddress) - ) +// const localContract = new Address( +// acct1Client.chainId, +// LocalAddress.fromHexString(loomContractAddress) +// ) - const foreignContract = new Address('eth', LocalAddress.fromHexString(ganacheConctractAddress)) +// const foreignContract = new Address('eth', LocalAddress.fromHexString(ganacheConctractAddress)) - const ethers = await getJsonRPCSignerAsync('http://localhost:8545', 0) - const ethersSigner = new EthersSigner(ethers) - const hash = soliditySha3( - { type: 'address', value: foreignContract.local.toString().slice(2) }, - { type: 'address', value: localContract.local.toString().slice(2) } - ) +// const ethers = await getJsonRPCSignerAsync('http://localhost:8545', 0) +// const ethersSigner = new EthersSigner(ethers) +// const hash = soliditySha3( +// { type: 'address', value: foreignContract.local.toString().slice(2) }, +// { type: 'address', value: localContract.local.toString().slice(2) } +// ) - const foreignContractCreatorSig = await ethersSigner.signAsync(hash) - const foreignContractCreatorTxHash = Buffer.from(ganacheContractHash.slice(2), 'hex') +// const foreignContractCreatorSig = await ethersSigner.signAsync(hash) +// const foreignContractCreatorTxHash = Buffer.from(ganacheContractHash.slice(2), 'hex') - const params = { - foreignContract, - localContract, - foreignContractCreatorSig, - foreignContractCreatorTxHash - } +// const params = { +// foreignContract, +// localContract, +// foreignContractCreatorSig, +// foreignContractCreatorTxHash +// } - await transferGateway.addContractMappingAsync(params) +// await transferGateway.addContractMappingAsync(params) - t.end() -}) +// waitForMillisecondsAsync(60000) + +// const contractsAuthorized = await transferGateway.listContractMappingsAsync() + +// console.log(JSON.stringify(contractsAuthorized)) + +// t.end() +// }) diff --git a/src/tests/evm-helpers.ts b/src/tests/evm-helpers.ts index 60d6e83a..4ee9c1d8 100644 --- a/src/tests/evm-helpers.ts +++ b/src/tests/evm-helpers.ts @@ -48,7 +48,7 @@ export async function deployContractGanache( const ethSendTransactionDeployResult = await web3.eth.sendTransaction({ from: fromAddr, data: contractData, - gas: '300000', + gas: '6721975', gasPrice: '0x1' }) From 2c0601b33fe132071f131e501e9f5e966a231165 Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Tue, 17 Sep 2019 23:04:07 -0300 Subject: [PATCH 06/10] Testing gateway with all contracts --- .../truffle-artifacts/GameTokenDappChain.json | 343 ------------ scripts/abi.js | 30 +- src/tests/contracts_bytecode.ts | 116 ---- .../tests/e2e/artifacts}/Gateway.json | 2 +- .../tests/e2e/artifacts/LoomToken.json | 4 +- .../artifacts/SampleERC20MintableToken.json | 527 ++++++++++++++++++ src/tests/e2e/artifacts/SampleERC20Token.json | 338 +++++++++++ .../tests/e2e/artifacts}/SimpleStore.json | 0 .../tests/e2e/artifacts}/SimpleStore2.json | 0 .../tests/e2e/artifacts}/SimpleStore3.json | 0 .../artifacts}/ValidatorManagerContract.json | 2 +- src/tests/e2e/binance-test-tx-middleware.ts | 65 +-- src/tests/e2e/client-evm-event-tests-2.ts | 6 +- src/tests/e2e/client-evm-event-tests.ts | 6 +- src/tests/e2e/transfer-gateway-tests.ts | 281 ++++++---- 15 files changed, 1078 insertions(+), 642 deletions(-) delete mode 100644 e2e_support/truffle-artifacts/GameTokenDappChain.json delete mode 100644 src/tests/contracts_bytecode.ts rename {e2e_support/truffle-artifacts => src/tests/e2e/artifacts}/Gateway.json (99%) rename e2e_support/truffle-artifacts/GameToken.json => src/tests/e2e/artifacts/LoomToken.json (54%) create mode 100644 src/tests/e2e/artifacts/SampleERC20MintableToken.json create mode 100644 src/tests/e2e/artifacts/SampleERC20Token.json rename {e2e_support/truffle-artifacts => src/tests/e2e/artifacts}/SimpleStore.json (100%) rename {e2e_support/truffle-artifacts => src/tests/e2e/artifacts}/SimpleStore2.json (100%) rename {e2e_support/truffle-artifacts => src/tests/e2e/artifacts}/SimpleStore3.json (100%) rename {e2e_support/truffle-artifacts => src/tests/e2e/artifacts}/ValidatorManagerContract.json (99%) diff --git a/e2e_support/truffle-artifacts/GameTokenDappChain.json b/e2e_support/truffle-artifacts/GameTokenDappChain.json deleted file mode 100644 index 9da9e170..00000000 --- a/e2e_support/truffle-artifacts/GameTokenDappChain.json +++ /dev/null @@ -1,343 +0,0 @@ -{ - "contractName": "GameTokenDappChain", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_spender", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "gateway", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_from", - "type": "address" - }, - { - "name": "_to", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "INITIAL_SUPPLY", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_spender", - "type": "address" - }, - { - "name": "_subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseApproval", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_to", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_spender", - "type": "address" - }, - { - "name": "_addedValue", - "type": "uint256" - } - ], - "name": "increaseApproval", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_owner", - "type": "address" - }, - { - "name": "_spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "_gateway", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "_amount", - "type": "uint256" - } - ], - "name": "mintToGateway", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_from", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "onERC20Received", - "outputs": [ - { - "name": "", - "type": "bytes4" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60806040526040805190810160405280601281526020017f47616d65546f6b656e44617070436861696e000000000000000000000000000081525060049080519060200190620000519291906200019c565b506040805190810160405280600581526020017f47544b4443000000000000000000000000000000000000000000000000000000815250600590805190602001906200009f9291906200019c565b506012600660006101000a81548160ff021916908360ff160217905550348015620000c957600080fd5b506040516020806200187a8339810180604052810190808051906020019092919050505080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600660009054906101000a900460ff1660ff16600a0a633b9aca00026001819055506001546000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550506200024b565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620001df57805160ff191683800117855562000210565b8280016001018555821562000210579182015b828111156200020f578251825591602001919060010190620001f2565b5b5090506200021f919062000223565b5090565b6200024891905b80821115620002445760008160009055506001016200022a565b5090565b90565b61161f806200025b6000396000f3006080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b314610170578063116191b6146101d557806318160ddd1461022c57806323b872dd146102575780632ff2e9dc146102dc578063313ce56714610307578063544297f514610338578063661884631461036557806370a08231146103ca57806395d89b4114610421578063a9059cbb146104b1578063bc04f0af14610516578063d73dd623146105b5578063dd62ed3e1461061a575b600080fd5b3480156100ec57600080fd5b506100f5610691565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061072f565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea610821565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023857600080fd5b50610241610847565b6040518082815260200191505060405180910390f35b34801561026357600080fd5b506102c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610851565b604051808215151515815260200191505060405180910390f35b3480156102e857600080fd5b506102f1610c0b565b6040518082815260200191505060405180910390f35b34801561031357600080fd5b5061031c610c13565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034457600080fd5b5061036360048036038101908080359060200190929190505050610c26565b005b34801561037157600080fd5b506103b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d77565b604051808215151515815260200191505060405180910390f35b3480156103d657600080fd5b5061040b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611008565b6040518082815260200191505060405180910390f35b34801561042d57600080fd5b50610436611050565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561047657808201518184015260208101905061045b565b50505050905090810190601f1680156104a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104bd57600080fd5b506104fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110ee565b604051808215151515815260200191505060405180910390f35b34801561052257600080fd5b50610561600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061130d565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b3480156105c157600080fd5b50610600600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061133b565b604051808215151515815260200191505060405180910390f35b34801561062657600080fd5b5061067b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611537565b6040518082815260200191505060405180910390f35b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107275780601f106106fc57610100808354040283529160200191610727565b820191906000526020600020905b81548152906001019060200180831161070a57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561088e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108db57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561096657600080fd5b6109b7826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115be90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a4a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115be90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b633b9aca0081565b600660009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c8257600080fd5b610c97816001546115d790919063ffffffff16565b600181905550610d1081600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e88576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f1c565b610e9b83826115be90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110e65780601f106110bb576101008083540402835291602001916110e6565b820191906000526020600020905b8154815290600101906020018083116110c957829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561112b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561117857600080fd5b6111c9826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115be90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061125c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600063bc04f0af7c010000000000000000000000000000000000000000000000000000000002905092915050565b60006113cc82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156115cc57fe5b818303905092915050565b600081830190508281101515156115ea57fe5b809050929150505600a165627a7a7230582027917e92483a768bd5e7116e0daeeeb5f567c7234529de98a8ff63f4bdca99b30029", -} \ No newline at end of file diff --git a/scripts/abi.js b/scripts/abi.js index b7f2f379..1a5dda9a 100644 --- a/scripts/abi.js +++ b/scripts/abi.js @@ -2,24 +2,24 @@ const shell = require('shelljs') const typechain = require('typechain') -const ts_generator = require("ts-generator"); - +const ts_generator = require('ts-generator') const cwd = process.cwd() const options = { - files: "src/mainnet-contracts/*.json", - target: "ethers", - outDir: "src/mainnet-contracts" + files: 'src/mainnet-contracts/*.json', + target: 'ethers', + outDir: 'src/mainnet-contracts' } -ts_generator.tsGenerator( - { cwd, loggingLvl: "info" }, - new typechain.Typechain({ cwd, rawConfig: options }) -).then(() => { +ts_generator + .tsGenerator({ cwd, loggingLvl: 'info' }, new typechain.Typechain({ cwd, rawConfig: options })) + .then(() => { + shell.mkdir('-p', './dist/mainnet-contracts') + shell.cp( + './src/mainnet-contracts/*', // copy everything regarding types + './dist/mainnet-contracts/' + ) + }) - shell.mkdir('-p', './dist/mainnet-contracts') - shell.cp( - './src/mainnet-contracts/*', // copy everything regarding types - './dist/mainnet-contracts/' - ) -}) +shell.mkdir('-p', './dist/tests/e2e/artifacts') +shell.cp('./src/tests/e2e/artifacts/*', './dist/tests/e2e/artifacts') diff --git a/src/tests/contracts_bytecode.ts b/src/tests/contracts_bytecode.ts deleted file mode 100644 index 83b4037d..00000000 --- a/src/tests/contracts_bytecode.ts +++ /dev/null @@ -1,116 +0,0 @@ -export const gateway = - '0x608060405234801561001057600080fd5b5060405160208062002aab8339810180604052602081101561003157600080fd5b5051600480546001600160a01b0319166001600160a01b0380841691909117808355604080517f37179db80000000000000000000000000000000000000000000000000000000081529051859492909316926337179db892828101926020929190829003018186803b1580156100a657600080fd5b505afa1580156100ba573d6000803e3d6000fd5b505050506040513d60208110156100d057600080fd5b505160008054600280546001600160a01b03199081163317909155600160a81b60ff0219600160a01b60ff02196001600160a01b039095169190921617929092167401000000000000000000000000000000000000000017919091167501000000000000000000000000000000000000000000179055505061295380620001586000396000f3fe60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063ced7c92a1161006f578063ced7c92a14610aa2578063da293eb314610c29578063e32f375114610d9b578063e402fbc814610db0578063e744092e14610ddc578063f9eaee0d14610e0f5761014b565b80638da5cb5b146105f557806393ba7daa1461060a578063b0116dc7146106e0578063b3b0f4c714610860578063b4c6034214610a2e578063b82730ab14610a675761014b565b8063392d661c11610108578063392d661c146104dc57806341c25c4a146105155780634e0dc557146105415780634e56ef52146105745780637ecebe00146105ad578063893d20e8146105e05761014b565b806303c0fe3a146101d657806314f6c3be14610358578063150b7a021461037f57806320cc8e511461046d5780632fc85c521461049e57806337179db8146104c7575b600054600160a01b900460ff1661019a5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6040805133815234602082015281517fbfe611b001dfcd411432f7bf0d79b82b4b2ee81511edac123a3403c357fb972a929181900390910190a1005b3480156101e257600080fd5b50610356600480360360c08110156101f957600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561022857600080fd5b82018360208201111561023a57600080fd5b803590602001918460208302840111600160201b8311171561025b57600080fd5b919390929091602081019035600160201b81111561027857600080fd5b82018360208201111561028a57600080fd5b803590602001918460208302840111600160201b831117156102ab57600080fd5b919390929091602081019035600160201b8111156102c857600080fd5b8201836020820111156102da57600080fd5b803590602001918460208302840111600160201b831117156102fb57600080fd5b919390929091602081019035600160201b81111561031857600080fd5b82018360208201111561032a57600080fd5b803590602001918460208302840111600160201b8311171561034b57600080fd5b509092509050610e42565b005b34801561036457600080fd5b5061036d611149565b60408051918252519081900360200190f35b34801561038b57600080fd5b50610450600480360360808110156103a257600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b8111156103dc57600080fd5b8201836020820111156103ee57600080fd5b803590602001918460018302840111600160201b8311171561040f57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061114e945050505050565b604080516001600160e01b03199092168252519081900360200190f35b34801561047957600080fd5b506104826112f5565b604080516001600160a01b039092168252519081900360200190f35b3480156104aa57600080fd5b506104b3611304565b604080519115158252519081900360200190f35b3480156104d357600080fd5b50610482611314565b3480156104e857600080fd5b50610356600480360360408110156104ff57600080fd5b50803590602001356001600160a01b0316611323565b34801561052157600080fd5b506103566004803603602081101561053857600080fd5b50351515611432565b34801561054d57600080fd5b5061036d6004803603602081101561056457600080fd5b50356001600160a01b03166114ad565b34801561058057600080fd5b506104b36004803603604081101561059757600080fd5b50803590602001356001600160a01b031661152c565b3480156105b957600080fd5b5061036d600480360360208110156105d057600080fd5b50356001600160a01b03166115b9565b3480156105ec57600080fd5b506104826115cb565b34801561060157600080fd5b506104826115da565b34801561061657600080fd5b50610450600480360360a081101561062d57600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b81111561066c57600080fd5b82018360208201111561067e57600080fd5b803590602001918460018302840111600160201b8311171561069f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506115e9945050505050565b3480156106ec57600080fd5b50610356600480360360c081101561070357600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561073257600080fd5b82018360208201111561074457600080fd5b803590602001918460208302840111600160201b8311171561076557600080fd5b919390929091602081019035600160201b81111561078257600080fd5b82018360208201111561079457600080fd5b803590602001918460208302840111600160201b831117156107b557600080fd5b919390929091602081019035600160201b8111156107d257600080fd5b8201836020820111156107e457600080fd5b803590602001918460208302840111600160201b8311171561080557600080fd5b919390929091602081019035600160201b81111561082257600080fd5b82018360208201111561083457600080fd5b803590602001918460208302840111600160201b8311171561085557600080fd5b509092509050611799565b34801561086c57600080fd5b50610450600480360360a081101561088357600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b8111156108b657600080fd5b8201836020820111156108c857600080fd5b803590602001918460208302840111600160201b831117156108e957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561093857600080fd5b82018360208201111561094a57600080fd5b803590602001918460208302840111600160201b8311171561096b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156109ba57600080fd5b8201836020820111156109cc57600080fd5b803590602001918460018302840111600160201b831117156109ed57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b02945050505050565b348015610a3a57600080fd5b5061036d60048036036040811015610a5157600080fd5b50803590602001356001600160a01b0316611d89565b348015610a7357600080fd5b5061035660048036036040811015610a8a57600080fd5b506001600160a01b0381351690602001351515611e0e565b348015610aae57600080fd5b50610356600480360360e0811015610ac557600080fd5b8135916020810135916001600160a01b036040830135169190810190608081016060820135600160201b811115610afb57600080fd5b820183602082011115610b0d57600080fd5b803590602001918460208302840111600160201b83111715610b2e57600080fd5b919390929091602081019035600160201b811115610b4b57600080fd5b820183602082011115610b5d57600080fd5b803590602001918460208302840111600160201b83111715610b7e57600080fd5b919390929091602081019035600160201b811115610b9b57600080fd5b820183602082011115610bad57600080fd5b803590602001918460208302840111600160201b83111715610bce57600080fd5b919390929091602081019035600160201b811115610beb57600080fd5b820183602082011115610bfd57600080fd5b803590602001918460208302840111600160201b83111715610c1e57600080fd5b509092509050611e85565b348015610c3557600080fd5b50610356600480360360a0811015610c4c57600080fd5b81359190810190604081016020820135600160201b811115610c6d57600080fd5b820183602082011115610c7f57600080fd5b803590602001918460208302840111600160201b83111715610ca057600080fd5b919390929091602081019035600160201b811115610cbd57600080fd5b820183602082011115610ccf57600080fd5b803590602001918460208302840111600160201b83111715610cf057600080fd5b919390929091602081019035600160201b811115610d0d57600080fd5b820183602082011115610d1f57600080fd5b803590602001918460208302840111600160201b83111715610d4057600080fd5b919390929091602081019035600160201b811115610d5d57600080fd5b820183602082011115610d6f57600080fd5b803590602001918460208302840111600160201b83111715610d9057600080fd5b50909250905061218c565b348015610da757600080fd5b506104b36123fb565b348015610dbc57600080fd5b5061035660048036036020811015610dd357600080fd5b5035151561240b565b348015610de857600080fd5b506104b360048036036020811015610dff57600080fd5b50356001600160a01b0316612478565b348015610e1b57600080fd5b506104b360048036036020811015610e3257600080fd5b50356001600160a01b031661248d565b600054600160a01b900460ff16610e915760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000610f156040518060400160405280601281526020017f115769746864726177204552433732313a0a00000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561103757600080fd5b505afa15801561104b573d6000803e3d6000fd5b5050336000818152600360205260408120805460010190559250611073915030908e8e6125ab565b9050806110e45760408051600160e31b6308934a5f028152336004820152602481018e905290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b1580156110cb57600080fd5b505af11580156110df573d6000803e3d6000fd5b505050505b336001600160a01b031660008051602061288083398151915260028d8f6040518084600481111561111157fe5b60ff1681526001600160a01b0390931660208401525060408083019190915251908190036060019150a2505050505050505050505050565b303190565b60008054600160a01b900460ff1661119e5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6111a73361248d565b6111f25760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7f691f4eac2b8850491851c72f70a121d76b20836d776658438f5b13dd9f8dbc6e858585338660405180866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156112a357818101518382015260200161128b565b50505050905090810190601f1680156112d05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a150600160e11b630a85bd0102949350505050565b6004546001600160a01b031681565b600054600160a81b900460ff1690565b6000546001600160a01b031681565b600054600160a01b900460ff166113725760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b61138d6001600160a01b03821633308563ffffffff6126a616565b60408051338152602081018490526001600160a01b0383168183015290517fa13cf347fb36122550e414f6fd1a0c2e490cff76331c4dcc20f760891ecca12a9181900360600190a16000546001600160a01b038281169116141561142e57604080518381526001600160a01b0383166020820152815133927f91557346f7592c9279b67cc52709a00442f0597658ec38a5fe84568c016331d7928290030190a25b5050565b6002546001600160a01b0316331461147e57604051600160e51b62461bcd0281526004018080602001828103825260378152602001806128c76037913960400191505060405180910390fd5b60008054911515600160a01b0274ff000000000000000000000000000000000000000019909216919091179055565b60408051600160e01b6370a0823102815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b1580156114fa57600080fd5b505afa15801561150e573d6000803e3d6000fd5b505050506040513d602081101561152457600080fd5b505192915050565b6000306001600160a01b0316826001600160a01b0316636352211e856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561157c57600080fd5b505afa158015611590573d6000803e3d6000fd5b505050506040513d60208110156115a657600080fd5b50516001600160a01b0316149392505050565b60036020526000908152604090205481565b6002546001600160a01b031690565b6002546001600160a01b031681565b60008054600160a01b900460ff166116395760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6116423361248d565b61168d5760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7fc341982fb8843f55f2f7aae4eb89231a4ef94a199f370debe7bc5c07c2de2bab86868686338760405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001858152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561174557818101518382015260200161172d565b50505050905090810190601f1680156117725780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a150600160e41b630660b3370295945050505050565b600054600160a01b900460ff166117e85760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b600061186c6040518060400160405280601181526020017f1057697468647261772045524332303a0a0000000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561198e57600080fd5b505afa1580156119a2573d6000803e3d6000fd5b5050336000908152600360209081526040808320805460010190558051600160e01b6370a0823102815230600482015290519294506001600160a01b038f1693506370a082319260248083019392829003018186803b158015611a0457600080fd5b505afa158015611a18573d6000803e3d6000fd5b505050506040513d6020811015611a2e57600080fd5b505190508b811015611aa55760408051600160e31b6308934a5f028152306004820152828e03602482015290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b158015611a8c57600080fd5b505af1158015611aa0573d6000803e3d6000fd5b505050505b611abf6001600160a01b038c16338e63ffffffff61270916565b6000543390600080516020612880833981519152906001600160a01b038e8116911614611aed576001611af0565b60045b8d8f6040518084600481111561111157fe5b60008054600160a01b900460ff16611b525760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b611b5b3361248d565b611ba65760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b835183518114611c005760408051600160e51b62461bcd02815260206004820152601a60248201527f4172726179206c656e6774687320646f206e6f74206d61746368000000000000604482015290519081900360640190fd5b7f48d67933be7b1e6d77d914145d793b5c9ced38156f34ebab23216e085435ac5587878787338860405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b031681526020018060200180602001856001600160a01b03166001600160a01b0316815260200180602001848103845288818151815260200191508051906020019060200280838360005b83811015611cb7578181015183820152602001611c9f565b50505050905001848103835287818151815260200191508051906020019060200280838360005b83811015611cf6578181015183820152602001611cde565b50505050905001848103825285818151815260200191508051906020019080838360005b83811015611d32578181015183820152602001611d1a565b50505050905090810190601f168015611d5f5780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390a150600160e11b6374f2df35029695505050505050565b60408051600160e11b627eeac70281523060048201526024810184905290516000916001600160a01b0384169162fdd58e91604480820192602092909190829003018186803b158015611ddb57600080fd5b505afa158015611def573d6000803e3d6000fd5b505050506040513d6020811015611e0557600080fd5b50519392505050565b6002546001600160a01b03163314611e5a57604051600160e51b62461bcd0281526004018080602001828103825260278152602001806128a06027913960400191505060405180910390fd5b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b600054600160a01b900460ff16611ed45760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000611f606040518060400160405280601381526020017f12576974686472617720455243373231583a0a000000000000000000000000008152508d8d8d60405160200180848152602001838152602001826001600160a01b03166001600160a01b031660601b81526014019350505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561208257600080fd5b505afa158015612096573d6000803e3d6000fd5b5050505060036000336001600160a01b03166001600160a01b0316815260200190815260200160002060008154809291906001019190505550896001600160a01b0316630febdd4930338f8f6040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001838152602001828152602001945050505050600060405180830381600087803b15801561215157600080fd5b505af1158015612165573d6000803e3d6000fd5b505060405133925060008051602061288083398151915291506003908d908f908084611111565b600054600160a01b900460ff166121db5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b60006122426040518060400160405280600f81526020017f0e5769746864726177204554483a0a00000000000000000000000000000000008152508b60405160200180828152602001915050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561236457600080fd5b505afa158015612378573d6000803e3d6000fd5b50503360008181526003602052604080822080546001019055519193508d156108fc0292508d9190818181858888f193505050501580156123bd573d6000803e3d6000fd5b5060408051600080825260208201528082018c905290513391600080516020612880833981519152919081900360600190a250505050505050505050565b600054600160a01b900460ff1690565b6002546001600160a01b0316331461245757604051600160e51b62461bcd02815260040180806020018281038252602a8152602001806128fe602a913960400191505060405180910390fd5b60008054911515600160a81b02600160a81b60ff0219909216919091179055565b60016020526000908152604090205460ff1681565b60008054600160a81b900460ff16806124be57506001600160a01b03821660009081526001602052604090205460ff165b92915050565b6000823360036000336001600160a01b03166001600160a01b031681526020019081526020016000205430856040516020018086805190602001908083835b602083106125225780518252601f199092019160209182019101612503565b6001836020036101000a038019825116818451168082178552505050505050905001856001600160a01b03166001600160a01b031660601b8152601401848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905092915050565b604080516001600160a01b0386811660248301528581166044830152606480830186905283518084039091018152608490920183526020820180516001600160e01b0316600160e01b6323b872dd021781529251825160009485949387169392918291908083835b602083106126325780518252601f199092019160209182019101612613565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612694576040519150601f19603f3d011682016040523d82523d6000602084013e612699565b606091505b5090979650505050505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b0316600160e01b6323b872dd02179052612703908590612763565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0316600160e01b63a9059cbb0217905261275e908490612763565b505050565b612775826001600160a01b0316612859565b61277e57600080fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106127bc5780518252601f19909201916020918201910161279d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461281e576040519150601f19603f3d011682016040523d82523d6000602084013e612823565b606091505b50915091508161283257600080fd5b8051156127035780806020019051602081101561284e57600080fd5b505161270357600080fd5b3b15159056fe476174657761792069732064697361626c65642e000000000000000000000000591f2d33d85291e32c4067b5a497caf3ddb5b1830eba9909e66006ec3a0051b4746f67676c65416c6c6f77546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65656e61626c65476174657761793a206f6e6c79206f776e65722063616e20656e61626c65206f722064697361626c652067617465776179746f67676c65416c6c6f77416e79546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65a165627a7a72305820ace81939002d8d64077e021434066edca9c22927222014369aef418d15fd26bb0029' - -export const dappChainERC20 = - '0x60806040526040805190810160405280600581526020017f45524332300000000000000000000000000000000000000000000000000000008152506005908051906020019062000051929190620001f6565b506040805190810160405280600381526020017f4443430000000000000000000000000000000000000000000000000000000000815250600690805190602001906200009f929190620001f6565b506012600760006101000a81548160ff021916908360ff160217905550348015620000c957600080fd5b5060405160208062001aa48339810180604052810190808051906020019092919050505080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900460ff1660ff16600a0a633b9aca0002600181905550600760009054906101000a900460ff1660ff16600a0a633b9aca00026000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555033600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050620002a5565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200023957805160ff19168380011785556200026a565b828001600101855582156200026a579182015b82811115620002695782518255916020019190600101906200024c565b5b5090506200027991906200027d565b5090565b620002a291905b808211156200029e57600081600090555060010162000284565b5090565b90565b6117ef80620002b56000396000f3006080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b314610170578063116191b6146101d557806318160ddd1461022c57806323b872dd14610257578063313ce567146102dc578063449a52f81461030d578063544297f51461035a578063661884631461038757806370a08231146103ec57806395d89b4114610443578063a9059cbb146104d3578063d5f3948814610538578063d73dd6231461058f578063dd62ed3e146105f4575b600080fd5b3480156100ec57600080fd5b506100f561066b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610709565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea6107fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023857600080fd5b50610241610821565b6040518082815260200191505060405180910390f35b34801561026357600080fd5b506102c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082b565b604051808215151515815260200191505060405180910390f35b3480156102e857600080fd5b506102f1610be6565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031957600080fd5b50610358600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bf9565b005b34801561036657600080fd5b5061038560048036038101908080359060200190929190505050610dfc565b005b34801561039357600080fd5b506103d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f4d565b604051808215151515815260200191505060405180910390f35b3480156103f857600080fd5b5061042d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111df565b6040518082815260200191505060405180910390f35b34801561044f57600080fd5b50610458611227565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561049857808201518184015260208101905061047d565b50505050905090810190601f1680156104c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104df57600080fd5b5061051e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112c5565b604051808215151515815260200191505060405180910390f35b34801561054457600080fd5b5061054d6114e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059b57600080fd5b506105da600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061150b565b604051808215151515815260200191505060405180910390f35b34801561060057600080fd5b50610655600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611707565b6040518082815260200191505060405180910390f35b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107015780601f106106d657610100808354040283529160200191610701565b820191906000526020600020905b8154815290600101906020018083116106e457829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087a57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561090557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561094157600080fd5b610992826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178e90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a25826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610af682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ce4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f6e6f7420617574686f72697a656420746f20706572666f726d2074686973206181526020017f6374696f6e00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610cf9816001546117a790919063ffffffff16565b600181905550610d50816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5857600080fd5b610e6d816001546117a790919063ffffffff16565b600181905550610ee681600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808310151561105f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110f3565b611072838261178e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112bd5780601f10611292576101008083540402835291602001916112bd565b820191906000526020600020905b8154815290600101906020018083116112a057829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561131457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561135057600080fd5b6113a1826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178e90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611434826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061159c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561179c57fe5b818303905092915050565b600081830190508281101515156117ba57fe5b809050929150505600a165627a7a72305820cc50de3ef6f8756e5e3796a0e739d1d17ec1a936953cfa2c5b545031033ddba50029' - -/** - * pragma solidity <0.6.0; - * - * import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; - * - * contract LoomToken is ERC20 { - * string public name = "Loom Token"; - * string public symbol = "LOOM"; - * uint8 public decimals = 18; - * - * // one billion in initial supply - * uint256 public constant INITIAL_SUPPLY = 1000000000; - * - * constructor () public { - * _mint(msg.sender, INITIAL_SUPPLY * (10 ** uint256(decimals))); - * } - * } - */ -export const mainnetERC20 = - '0x60c0604052600a60808190527f4c6f6f6d20546f6b656e0000000000000000000000000000000000000000000060a090815261003e916003919061018d565b506040805180820190915260048082527f4c4f4f4d000000000000000000000000000000000000000000000000000000006020909201918252610081918161018d565b506005805460ff1916601217905534801561009b57600080fd5b506005546100bd90339060ff16600a0a633b9aca00026100c2602090811b901c565b610228565b6001600160a01b0382166100d557600080fd5b6100ee8160025461017460201b61066c1790919060201c565b6002556001600160a01b0382166000908152602081815260409091205461011e91839061066c610174821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60008282018381101561018657600080fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106101ce57805160ff19168380011785556101fb565b828001600101855582156101fb579182015b828111156101fb5782518255916020019190600101906101e0565b5061020792915061020b565b5090565b61022591905b808211156102075760008155600101610211565b90565b6106b1806102376000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063395093511161007157806339509351146101ec57806370a082311461021857806395d89b411461023e578063a457c2d714610246578063a9059cbb14610272578063dd62ed3e1461029e576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd146101905780632ff2e9dc146101c6578063313ce567146101ce575b600080fd5b6100c16102cc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b03813516906020013561035a565b604080519115158252519081900360200190f35b61017e610370565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610376565b61017e6103cd565b6101d66103d5565b6040805160ff9092168252519081900360200190f35b6101626004803603604081101561020257600080fd5b506001600160a01b0381351690602001356103de565b61017e6004803603602081101561022e57600080fd5b50356001600160a01b031661041a565b6100c1610435565b6101626004803603604081101561025c57600080fd5b506001600160a01b038135169060200135610490565b6101626004803603604081101561028857600080fd5b506001600160a01b0381351690602001356104cc565b61017e600480360360408110156102b457600080fd5b506001600160a01b03813581169160200135166104d9565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b820191906000526020600020905b81548152906001019060200180831161033557829003601f168201915b505050505081565b6000610367338484610504565b50600192915050565b60025490565b600061038384848461058c565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546103c39186916103be908663ffffffff61065716565b610504565b5060019392505050565b633b9aca0081565b60055460ff1681565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61066c16565b6001600160a01b031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61065716565b600061036733848461058c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b03821661051757600080fd5b6001600160a01b03831661052a57600080fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03821661059f57600080fd5b6001600160a01b0383166000908152602081905260409020546105c8908263ffffffff61065716565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105fd908263ffffffff61066c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282111561066657600080fd5b50900390565b60008282018381101561067e57600080fd5b939250505056fea165627a7a723058206d82d10902ac3d0fd578314b284fba835070c43adb2fbc46a2ba644e83b7580c0029' - -/** - * pragma solidity ^0.4.24; - * - * contract SimpleStore { - * uint256 value; - * - * constructor() public { - * value = 10; - * } - * - * event NewValueSet(uint indexed _value, address sender); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value, msg.sender); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - */ -export const SimpleStore = - '0x608060405234801561001057600080fd5b50600a60008190555061010e806100286000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b114604e5780636d4ce63c146078575b600080fd5b348015605957600080fd5b5060766004803603810190808035906020019092919050505060a0565b005b348015608357600080fd5b50608a60d9565b6040518082815260200191505060405180910390f35b806000819055506000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b600080549050905600a165627a7a72305820b76f6c855a1f95260fc70490b16774074225da52ea165a58e95eb7a72a59d1700029' - -/** - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * - * constructor() public { - * value = 10; - * } - * - * event NewValueSet(uint indexed _value); - * event NewValueSetAgain(uint indexed _value); - * - * function set(uint _value) public { - * value = _value; - * emit NewValueSet(value); - * } - * - * function setAgain(uint _value) public { - * value = _value; - * emit NewValueSetAgain(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - */ -export const SimpleStore2 = - 'x608060405234801561001057600080fd5b50600a60005561015c806100256000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166360fe47b1811461005b5780636d4ce63c14610075578063cf7189211461009c575b600080fd5b34801561006757600080fd5b506100736004356100b4565b005b34801561008157600080fd5b5061008a6100ef565b60408051918252519081900360200190f35b3480156100a857600080fd5b506100736004356100f5565b60008190556040805182815290517fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b9181900360200190a150565b60005490565b60008190556040805182815290517fc151b22f26f815d64ae384647d49bc5655149c4b273318d8c3846086dae3835e9181900360200190a1505600a165627a7a723058206e4e5f5b6acc54b18ad15cb2110379c386cd8327527ca2d203a563300b37e3890029' - -/** - * pragma solidity ^0.4.22; - * - * contract SimpleStore { - * uint value; - * - * constructor() public { - * value = 10; - * } - * - * event NewValueSet(uint indexed _value); - * event NewValueSetAgain(uint indexed _value); - * - * function set(uint _value) public { - * value = _value; - * - * require(_value != 100, "Magic value"); - * - * emit NewValueSet(value); - * } - * - * function setAgain(uint _value) public { - * value = _value; - * emit NewValueSetAgain(value); - * } - * - * function get() public view returns (uint) { - * return value; - * } - * } - */ -export const SimpleStore3 = - '608060405234801561001057600080fd5b50600a600081905550610201806100286000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b11461005c5780636d4ce63c14610089578063cf718921146100b4575b600080fd5b34801561006857600080fd5b50610087600480360381019080803590602001909291905050506100e1565b005b34801561009557600080fd5b5061009e610193565b6040518082815260200191505060405180910390f35b3480156100c057600080fd5b506100df6004803603810190808035906020019092919050505061019c565b005b8060008190555060648114151515610161576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f4d616769632076616c756500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000547fb922f092a64f1a076de6f21e4d7c6400b6e55791cc935e7bb8e7e90f7652f15b60405160405180910390a250565b60008054905090565b806000819055506000547fc151b22f26f815d64ae384647d49bc5655149c4b273318d8c3846086dae3835e60405160405180910390a2505600a165627a7a723058204c7af9b8100ac44b72d5498cd5d9034844c7b2249060740bafbe2876fbbcb6d40029' diff --git a/e2e_support/truffle-artifacts/Gateway.json b/src/tests/e2e/artifacts/Gateway.json similarity index 99% rename from e2e_support/truffle-artifacts/Gateway.json rename to src/tests/e2e/artifacts/Gateway.json index 052a3c11..710af9a0 100644 --- a/e2e_support/truffle-artifacts/Gateway.json +++ b/src/tests/e2e/artifacts/Gateway.json @@ -733,5 +733,5 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b5060405160208062002aab8339810180604052602081101561003157600080fd5b5051600480546001600160a01b0319166001600160a01b0380841691909117808355604080517f37179db80000000000000000000000000000000000000000000000000000000081529051859492909316926337179db892828101926020929190829003018186803b1580156100a657600080fd5b505afa1580156100ba573d6000803e3d6000fd5b505050506040513d60208110156100d057600080fd5b505160008054600280546001600160a01b03199081163317909155600160a81b60ff0219600160a01b60ff02196001600160a01b039095169190921617929092167401000000000000000000000000000000000000000017919091167501000000000000000000000000000000000000000000179055505061295380620001586000396000f3fe60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063ced7c92a1161006f578063ced7c92a14610aa2578063da293eb314610c29578063e32f375114610d9b578063e402fbc814610db0578063e744092e14610ddc578063f9eaee0d14610e0f5761014b565b80638da5cb5b146105f557806393ba7daa1461060a578063b0116dc7146106e0578063b3b0f4c714610860578063b4c6034214610a2e578063b82730ab14610a675761014b565b8063392d661c11610108578063392d661c146104dc57806341c25c4a146105155780634e0dc557146105415780634e56ef52146105745780637ecebe00146105ad578063893d20e8146105e05761014b565b806303c0fe3a146101d657806314f6c3be14610358578063150b7a021461037f57806320cc8e511461046d5780632fc85c521461049e57806337179db8146104c7575b600054600160a01b900460ff1661019a5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6040805133815234602082015281517fbfe611b001dfcd411432f7bf0d79b82b4b2ee81511edac123a3403c357fb972a929181900390910190a1005b3480156101e257600080fd5b50610356600480360360c08110156101f957600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561022857600080fd5b82018360208201111561023a57600080fd5b803590602001918460208302840111600160201b8311171561025b57600080fd5b919390929091602081019035600160201b81111561027857600080fd5b82018360208201111561028a57600080fd5b803590602001918460208302840111600160201b831117156102ab57600080fd5b919390929091602081019035600160201b8111156102c857600080fd5b8201836020820111156102da57600080fd5b803590602001918460208302840111600160201b831117156102fb57600080fd5b919390929091602081019035600160201b81111561031857600080fd5b82018360208201111561032a57600080fd5b803590602001918460208302840111600160201b8311171561034b57600080fd5b509092509050610e42565b005b34801561036457600080fd5b5061036d611149565b60408051918252519081900360200190f35b34801561038b57600080fd5b50610450600480360360808110156103a257600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b8111156103dc57600080fd5b8201836020820111156103ee57600080fd5b803590602001918460018302840111600160201b8311171561040f57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061114e945050505050565b604080516001600160e01b03199092168252519081900360200190f35b34801561047957600080fd5b506104826112f5565b604080516001600160a01b039092168252519081900360200190f35b3480156104aa57600080fd5b506104b3611304565b604080519115158252519081900360200190f35b3480156104d357600080fd5b50610482611314565b3480156104e857600080fd5b50610356600480360360408110156104ff57600080fd5b50803590602001356001600160a01b0316611323565b34801561052157600080fd5b506103566004803603602081101561053857600080fd5b50351515611432565b34801561054d57600080fd5b5061036d6004803603602081101561056457600080fd5b50356001600160a01b03166114ad565b34801561058057600080fd5b506104b36004803603604081101561059757600080fd5b50803590602001356001600160a01b031661152c565b3480156105b957600080fd5b5061036d600480360360208110156105d057600080fd5b50356001600160a01b03166115b9565b3480156105ec57600080fd5b506104826115cb565b34801561060157600080fd5b506104826115da565b34801561061657600080fd5b50610450600480360360a081101561062d57600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b81111561066c57600080fd5b82018360208201111561067e57600080fd5b803590602001918460018302840111600160201b8311171561069f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506115e9945050505050565b3480156106ec57600080fd5b50610356600480360360c081101561070357600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561073257600080fd5b82018360208201111561074457600080fd5b803590602001918460208302840111600160201b8311171561076557600080fd5b919390929091602081019035600160201b81111561078257600080fd5b82018360208201111561079457600080fd5b803590602001918460208302840111600160201b831117156107b557600080fd5b919390929091602081019035600160201b8111156107d257600080fd5b8201836020820111156107e457600080fd5b803590602001918460208302840111600160201b8311171561080557600080fd5b919390929091602081019035600160201b81111561082257600080fd5b82018360208201111561083457600080fd5b803590602001918460208302840111600160201b8311171561085557600080fd5b509092509050611799565b34801561086c57600080fd5b50610450600480360360a081101561088357600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b8111156108b657600080fd5b8201836020820111156108c857600080fd5b803590602001918460208302840111600160201b831117156108e957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561093857600080fd5b82018360208201111561094a57600080fd5b803590602001918460208302840111600160201b8311171561096b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156109ba57600080fd5b8201836020820111156109cc57600080fd5b803590602001918460018302840111600160201b831117156109ed57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b02945050505050565b348015610a3a57600080fd5b5061036d60048036036040811015610a5157600080fd5b50803590602001356001600160a01b0316611d89565b348015610a7357600080fd5b5061035660048036036040811015610a8a57600080fd5b506001600160a01b0381351690602001351515611e0e565b348015610aae57600080fd5b50610356600480360360e0811015610ac557600080fd5b8135916020810135916001600160a01b036040830135169190810190608081016060820135600160201b811115610afb57600080fd5b820183602082011115610b0d57600080fd5b803590602001918460208302840111600160201b83111715610b2e57600080fd5b919390929091602081019035600160201b811115610b4b57600080fd5b820183602082011115610b5d57600080fd5b803590602001918460208302840111600160201b83111715610b7e57600080fd5b919390929091602081019035600160201b811115610b9b57600080fd5b820183602082011115610bad57600080fd5b803590602001918460208302840111600160201b83111715610bce57600080fd5b919390929091602081019035600160201b811115610beb57600080fd5b820183602082011115610bfd57600080fd5b803590602001918460208302840111600160201b83111715610c1e57600080fd5b509092509050611e85565b348015610c3557600080fd5b50610356600480360360a0811015610c4c57600080fd5b81359190810190604081016020820135600160201b811115610c6d57600080fd5b820183602082011115610c7f57600080fd5b803590602001918460208302840111600160201b83111715610ca057600080fd5b919390929091602081019035600160201b811115610cbd57600080fd5b820183602082011115610ccf57600080fd5b803590602001918460208302840111600160201b83111715610cf057600080fd5b919390929091602081019035600160201b811115610d0d57600080fd5b820183602082011115610d1f57600080fd5b803590602001918460208302840111600160201b83111715610d4057600080fd5b919390929091602081019035600160201b811115610d5d57600080fd5b820183602082011115610d6f57600080fd5b803590602001918460208302840111600160201b83111715610d9057600080fd5b50909250905061218c565b348015610da757600080fd5b506104b36123fb565b348015610dbc57600080fd5b5061035660048036036020811015610dd357600080fd5b5035151561240b565b348015610de857600080fd5b506104b360048036036020811015610dff57600080fd5b50356001600160a01b0316612478565b348015610e1b57600080fd5b506104b360048036036020811015610e3257600080fd5b50356001600160a01b031661248d565b600054600160a01b900460ff16610e915760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000610f156040518060400160405280601281526020017f115769746864726177204552433732313a0a00000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561103757600080fd5b505afa15801561104b573d6000803e3d6000fd5b5050336000818152600360205260408120805460010190559250611073915030908e8e6125ab565b9050806110e45760408051600160e31b6308934a5f028152336004820152602481018e905290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b1580156110cb57600080fd5b505af11580156110df573d6000803e3d6000fd5b505050505b336001600160a01b031660008051602061288083398151915260028d8f6040518084600481111561111157fe5b60ff1681526001600160a01b0390931660208401525060408083019190915251908190036060019150a2505050505050505050505050565b303190565b60008054600160a01b900460ff1661119e5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6111a73361248d565b6111f25760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7f691f4eac2b8850491851c72f70a121d76b20836d776658438f5b13dd9f8dbc6e858585338660405180866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156112a357818101518382015260200161128b565b50505050905090810190601f1680156112d05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a150600160e11b630a85bd0102949350505050565b6004546001600160a01b031681565b600054600160a81b900460ff1690565b6000546001600160a01b031681565b600054600160a01b900460ff166113725760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b61138d6001600160a01b03821633308563ffffffff6126a616565b60408051338152602081018490526001600160a01b0383168183015290517fa13cf347fb36122550e414f6fd1a0c2e490cff76331c4dcc20f760891ecca12a9181900360600190a16000546001600160a01b038281169116141561142e57604080518381526001600160a01b0383166020820152815133927f91557346f7592c9279b67cc52709a00442f0597658ec38a5fe84568c016331d7928290030190a25b5050565b6002546001600160a01b0316331461147e57604051600160e51b62461bcd0281526004018080602001828103825260378152602001806128c76037913960400191505060405180910390fd5b60008054911515600160a01b0274ff000000000000000000000000000000000000000019909216919091179055565b60408051600160e01b6370a0823102815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b1580156114fa57600080fd5b505afa15801561150e573d6000803e3d6000fd5b505050506040513d602081101561152457600080fd5b505192915050565b6000306001600160a01b0316826001600160a01b0316636352211e856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561157c57600080fd5b505afa158015611590573d6000803e3d6000fd5b505050506040513d60208110156115a657600080fd5b50516001600160a01b0316149392505050565b60036020526000908152604090205481565b6002546001600160a01b031690565b6002546001600160a01b031681565b60008054600160a01b900460ff166116395760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6116423361248d565b61168d5760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7fc341982fb8843f55f2f7aae4eb89231a4ef94a199f370debe7bc5c07c2de2bab86868686338760405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001858152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561174557818101518382015260200161172d565b50505050905090810190601f1680156117725780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a150600160e41b630660b3370295945050505050565b600054600160a01b900460ff166117e85760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b600061186c6040518060400160405280601181526020017f1057697468647261772045524332303a0a0000000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561198e57600080fd5b505afa1580156119a2573d6000803e3d6000fd5b5050336000908152600360209081526040808320805460010190558051600160e01b6370a0823102815230600482015290519294506001600160a01b038f1693506370a082319260248083019392829003018186803b158015611a0457600080fd5b505afa158015611a18573d6000803e3d6000fd5b505050506040513d6020811015611a2e57600080fd5b505190508b811015611aa55760408051600160e31b6308934a5f028152306004820152828e03602482015290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b158015611a8c57600080fd5b505af1158015611aa0573d6000803e3d6000fd5b505050505b611abf6001600160a01b038c16338e63ffffffff61270916565b6000543390600080516020612880833981519152906001600160a01b038e8116911614611aed576001611af0565b60045b8d8f6040518084600481111561111157fe5b60008054600160a01b900460ff16611b525760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b611b5b3361248d565b611ba65760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b835183518114611c005760408051600160e51b62461bcd02815260206004820152601a60248201527f4172726179206c656e6774687320646f206e6f74206d61746368000000000000604482015290519081900360640190fd5b7f48d67933be7b1e6d77d914145d793b5c9ced38156f34ebab23216e085435ac5587878787338860405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b031681526020018060200180602001856001600160a01b03166001600160a01b0316815260200180602001848103845288818151815260200191508051906020019060200280838360005b83811015611cb7578181015183820152602001611c9f565b50505050905001848103835287818151815260200191508051906020019060200280838360005b83811015611cf6578181015183820152602001611cde565b50505050905001848103825285818151815260200191508051906020019080838360005b83811015611d32578181015183820152602001611d1a565b50505050905090810190601f168015611d5f5780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390a150600160e11b6374f2df35029695505050505050565b60408051600160e11b627eeac70281523060048201526024810184905290516000916001600160a01b0384169162fdd58e91604480820192602092909190829003018186803b158015611ddb57600080fd5b505afa158015611def573d6000803e3d6000fd5b505050506040513d6020811015611e0557600080fd5b50519392505050565b6002546001600160a01b03163314611e5a57604051600160e51b62461bcd0281526004018080602001828103825260278152602001806128a06027913960400191505060405180910390fd5b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b600054600160a01b900460ff16611ed45760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000611f606040518060400160405280601381526020017f12576974686472617720455243373231583a0a000000000000000000000000008152508d8d8d60405160200180848152602001838152602001826001600160a01b03166001600160a01b031660601b81526014019350505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561208257600080fd5b505afa158015612096573d6000803e3d6000fd5b5050505060036000336001600160a01b03166001600160a01b0316815260200190815260200160002060008154809291906001019190505550896001600160a01b0316630febdd4930338f8f6040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001838152602001828152602001945050505050600060405180830381600087803b15801561215157600080fd5b505af1158015612165573d6000803e3d6000fd5b505060405133925060008051602061288083398151915291506003908d908f908084611111565b600054600160a01b900460ff166121db5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b60006122426040518060400160405280600f81526020017f0e5769746864726177204554483a0a00000000000000000000000000000000008152508b60405160200180828152602001915050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561236457600080fd5b505afa158015612378573d6000803e3d6000fd5b50503360008181526003602052604080822080546001019055519193508d156108fc0292508d9190818181858888f193505050501580156123bd573d6000803e3d6000fd5b5060408051600080825260208201528082018c905290513391600080516020612880833981519152919081900360600190a250505050505050505050565b600054600160a01b900460ff1690565b6002546001600160a01b0316331461245757604051600160e51b62461bcd02815260040180806020018281038252602a8152602001806128fe602a913960400191505060405180910390fd5b60008054911515600160a81b02600160a81b60ff0219909216919091179055565b60016020526000908152604090205460ff1681565b60008054600160a81b900460ff16806124be57506001600160a01b03821660009081526001602052604090205460ff165b92915050565b6000823360036000336001600160a01b03166001600160a01b031681526020019081526020016000205430856040516020018086805190602001908083835b602083106125225780518252601f199092019160209182019101612503565b6001836020036101000a038019825116818451168082178552505050505050905001856001600160a01b03166001600160a01b031660601b8152601401848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905092915050565b604080516001600160a01b0386811660248301528581166044830152606480830186905283518084039091018152608490920183526020820180516001600160e01b0316600160e01b6323b872dd021781529251825160009485949387169392918291908083835b602083106126325780518252601f199092019160209182019101612613565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612694576040519150601f19603f3d011682016040523d82523d6000602084013e612699565b606091505b5090979650505050505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b0316600160e01b6323b872dd02179052612703908590612763565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0316600160e01b63a9059cbb0217905261275e908490612763565b505050565b612775826001600160a01b0316612859565b61277e57600080fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106127bc5780518252601f19909201916020918201910161279d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461281e576040519150601f19603f3d011682016040523d82523d6000602084013e612823565b606091505b50915091508161283257600080fd5b8051156127035780806020019051602081101561284e57600080fd5b505161270357600080fd5b3b15159056fe476174657761792069732064697361626c65642e000000000000000000000000591f2d33d85291e32c4067b5a497caf3ddb5b1830eba9909e66006ec3a0051b4746f67676c65416c6c6f77546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65656e61626c65476174657761793a206f6e6c79206f776e65722063616e20656e61626c65206f722064697361626c652067617465776179746f67676c65416c6c6f77416e79546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65a165627a7a72305820ace81939002d8d64077e021434066edca9c22927222014369aef418d15fd26bb0029", + "bytecode": "0x608060405234801561001057600080fd5b5060405160208062002aab8339810180604052602081101561003157600080fd5b5051600480546001600160a01b0319166001600160a01b0380841691909117808355604080517f37179db80000000000000000000000000000000000000000000000000000000081529051859492909316926337179db892828101926020929190829003018186803b1580156100a657600080fd5b505afa1580156100ba573d6000803e3d6000fd5b505050506040513d60208110156100d057600080fd5b505160008054600280546001600160a01b03199081163317909155600160a81b60ff0219600160a01b60ff02196001600160a01b039095169190921617929092167401000000000000000000000000000000000000000017919091167501000000000000000000000000000000000000000000179055505061295380620001586000396000f3fe60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063ced7c92a1161006f578063ced7c92a14610aa2578063da293eb314610c29578063e32f375114610d9b578063e402fbc814610db0578063e744092e14610ddc578063f9eaee0d14610e0f5761014b565b80638da5cb5b146105f557806393ba7daa1461060a578063b0116dc7146106e0578063b3b0f4c714610860578063b4c6034214610a2e578063b82730ab14610a675761014b565b8063392d661c11610108578063392d661c146104dc57806341c25c4a146105155780634e0dc557146105415780634e56ef52146105745780637ecebe00146105ad578063893d20e8146105e05761014b565b806303c0fe3a146101d657806314f6c3be14610358578063150b7a021461037f57806320cc8e511461046d5780632fc85c521461049e57806337179db8146104c7575b600054600160a01b900460ff1661019a5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6040805133815234602082015281517fbfe611b001dfcd411432f7bf0d79b82b4b2ee81511edac123a3403c357fb972a929181900390910190a1005b3480156101e257600080fd5b50610356600480360360c08110156101f957600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561022857600080fd5b82018360208201111561023a57600080fd5b803590602001918460208302840111600160201b8311171561025b57600080fd5b919390929091602081019035600160201b81111561027857600080fd5b82018360208201111561028a57600080fd5b803590602001918460208302840111600160201b831117156102ab57600080fd5b919390929091602081019035600160201b8111156102c857600080fd5b8201836020820111156102da57600080fd5b803590602001918460208302840111600160201b831117156102fb57600080fd5b919390929091602081019035600160201b81111561031857600080fd5b82018360208201111561032a57600080fd5b803590602001918460208302840111600160201b8311171561034b57600080fd5b509092509050610e42565b005b34801561036457600080fd5b5061036d611149565b60408051918252519081900360200190f35b34801561038b57600080fd5b50610450600480360360808110156103a257600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b8111156103dc57600080fd5b8201836020820111156103ee57600080fd5b803590602001918460018302840111600160201b8311171561040f57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061114e945050505050565b604080516001600160e01b03199092168252519081900360200190f35b34801561047957600080fd5b506104826112f5565b604080516001600160a01b039092168252519081900360200190f35b3480156104aa57600080fd5b506104b3611304565b604080519115158252519081900360200190f35b3480156104d357600080fd5b50610482611314565b3480156104e857600080fd5b50610356600480360360408110156104ff57600080fd5b50803590602001356001600160a01b0316611323565b34801561052157600080fd5b506103566004803603602081101561053857600080fd5b50351515611432565b34801561054d57600080fd5b5061036d6004803603602081101561056457600080fd5b50356001600160a01b03166114ad565b34801561058057600080fd5b506104b36004803603604081101561059757600080fd5b50803590602001356001600160a01b031661152c565b3480156105b957600080fd5b5061036d600480360360208110156105d057600080fd5b50356001600160a01b03166115b9565b3480156105ec57600080fd5b506104826115cb565b34801561060157600080fd5b506104826115da565b34801561061657600080fd5b50610450600480360360a081101561062d57600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b81111561066c57600080fd5b82018360208201111561067e57600080fd5b803590602001918460018302840111600160201b8311171561069f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506115e9945050505050565b3480156106ec57600080fd5b50610356600480360360c081101561070357600080fd5b8135916001600160a01b0360208201351691810190606081016040820135600160201b81111561073257600080fd5b82018360208201111561074457600080fd5b803590602001918460208302840111600160201b8311171561076557600080fd5b919390929091602081019035600160201b81111561078257600080fd5b82018360208201111561079457600080fd5b803590602001918460208302840111600160201b831117156107b557600080fd5b919390929091602081019035600160201b8111156107d257600080fd5b8201836020820111156107e457600080fd5b803590602001918460208302840111600160201b8311171561080557600080fd5b919390929091602081019035600160201b81111561082257600080fd5b82018360208201111561083457600080fd5b803590602001918460208302840111600160201b8311171561085557600080fd5b509092509050611799565b34801561086c57600080fd5b50610450600480360360a081101561088357600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b8111156108b657600080fd5b8201836020820111156108c857600080fd5b803590602001918460208302840111600160201b831117156108e957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561093857600080fd5b82018360208201111561094a57600080fd5b803590602001918460208302840111600160201b8311171561096b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156109ba57600080fd5b8201836020820111156109cc57600080fd5b803590602001918460018302840111600160201b831117156109ed57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b02945050505050565b348015610a3a57600080fd5b5061036d60048036036040811015610a5157600080fd5b50803590602001356001600160a01b0316611d89565b348015610a7357600080fd5b5061035660048036036040811015610a8a57600080fd5b506001600160a01b0381351690602001351515611e0e565b348015610aae57600080fd5b50610356600480360360e0811015610ac557600080fd5b8135916020810135916001600160a01b036040830135169190810190608081016060820135600160201b811115610afb57600080fd5b820183602082011115610b0d57600080fd5b803590602001918460208302840111600160201b83111715610b2e57600080fd5b919390929091602081019035600160201b811115610b4b57600080fd5b820183602082011115610b5d57600080fd5b803590602001918460208302840111600160201b83111715610b7e57600080fd5b919390929091602081019035600160201b811115610b9b57600080fd5b820183602082011115610bad57600080fd5b803590602001918460208302840111600160201b83111715610bce57600080fd5b919390929091602081019035600160201b811115610beb57600080fd5b820183602082011115610bfd57600080fd5b803590602001918460208302840111600160201b83111715610c1e57600080fd5b509092509050611e85565b348015610c3557600080fd5b50610356600480360360a0811015610c4c57600080fd5b81359190810190604081016020820135600160201b811115610c6d57600080fd5b820183602082011115610c7f57600080fd5b803590602001918460208302840111600160201b83111715610ca057600080fd5b919390929091602081019035600160201b811115610cbd57600080fd5b820183602082011115610ccf57600080fd5b803590602001918460208302840111600160201b83111715610cf057600080fd5b919390929091602081019035600160201b811115610d0d57600080fd5b820183602082011115610d1f57600080fd5b803590602001918460208302840111600160201b83111715610d4057600080fd5b919390929091602081019035600160201b811115610d5d57600080fd5b820183602082011115610d6f57600080fd5b803590602001918460208302840111600160201b83111715610d9057600080fd5b50909250905061218c565b348015610da757600080fd5b506104b36123fb565b348015610dbc57600080fd5b5061035660048036036020811015610dd357600080fd5b5035151561240b565b348015610de857600080fd5b506104b360048036036020811015610dff57600080fd5b50356001600160a01b0316612478565b348015610e1b57600080fd5b506104b360048036036020811015610e3257600080fd5b50356001600160a01b031661248d565b600054600160a01b900460ff16610e915760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000610f156040518060400160405280601281526020017f115769746864726177204552433732313a0a00000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561103757600080fd5b505afa15801561104b573d6000803e3d6000fd5b5050336000818152600360205260408120805460010190559250611073915030908e8e6125ab565b9050806110e45760408051600160e31b6308934a5f028152336004820152602481018e905290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b1580156110cb57600080fd5b505af11580156110df573d6000803e3d6000fd5b505050505b336001600160a01b031660008051602061288083398151915260028d8f6040518084600481111561111157fe5b60ff1681526001600160a01b0390931660208401525060408083019190915251908190036060019150a2505050505050505050505050565b303190565b60008054600160a01b900460ff1661119e5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6111a73361248d565b6111f25760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7f691f4eac2b8850491851c72f70a121d76b20836d776658438f5b13dd9f8dbc6e858585338660405180866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156112a357818101518382015260200161128b565b50505050905090810190601f1680156112d05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a150600160e11b630a85bd0102949350505050565b6004546001600160a01b031681565b600054600160a81b900460ff1690565b6000546001600160a01b031681565b600054600160a01b900460ff166113725760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b61138d6001600160a01b03821633308563ffffffff6126a616565b60408051338152602081018490526001600160a01b0383168183015290517fa13cf347fb36122550e414f6fd1a0c2e490cff76331c4dcc20f760891ecca12a9181900360600190a16000546001600160a01b038281169116141561142e57604080518381526001600160a01b0383166020820152815133927f91557346f7592c9279b67cc52709a00442f0597658ec38a5fe84568c016331d7928290030190a25b5050565b6002546001600160a01b0316331461147e57604051600160e51b62461bcd0281526004018080602001828103825260378152602001806128c76037913960400191505060405180910390fd5b60008054911515600160a01b0274ff000000000000000000000000000000000000000019909216919091179055565b60408051600160e01b6370a0823102815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b1580156114fa57600080fd5b505afa15801561150e573d6000803e3d6000fd5b505050506040513d602081101561152457600080fd5b505192915050565b6000306001600160a01b0316826001600160a01b0316636352211e856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561157c57600080fd5b505afa158015611590573d6000803e3d6000fd5b505050506040513d60208110156115a657600080fd5b50516001600160a01b0316149392505050565b60036020526000908152604090205481565b6002546001600160a01b031690565b6002546001600160a01b031681565b60008054600160a01b900460ff166116395760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6116423361248d565b61168d5760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b7fc341982fb8843f55f2f7aae4eb89231a4ef94a199f370debe7bc5c07c2de2bab86868686338760405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001858152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561174557818101518382015260200161172d565b50505050905090810190601f1680156117725780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a150600160e41b630660b3370295945050505050565b600054600160a01b900460ff166117e85760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b600061186c6040518060400160405280601181526020017f1057697468647261772045524332303a0a0000000000000000000000000000008152508c8c60405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561198e57600080fd5b505afa1580156119a2573d6000803e3d6000fd5b5050336000908152600360209081526040808320805460010190558051600160e01b6370a0823102815230600482015290519294506001600160a01b038f1693506370a082319260248083019392829003018186803b158015611a0457600080fd5b505afa158015611a18573d6000803e3d6000fd5b505050506040513d6020811015611a2e57600080fd5b505190508b811015611aa55760408051600160e31b6308934a5f028152306004820152828e03602482015290516001600160a01b038d169163449a52f891604480830192600092919082900301818387803b158015611a8c57600080fd5b505af1158015611aa0573d6000803e3d6000fd5b505050505b611abf6001600160a01b038c16338e63ffffffff61270916565b6000543390600080516020612880833981519152906001600160a01b038e8116911614611aed576001611af0565b60045b8d8f6040518084600481111561111157fe5b60008054600160a01b900460ff16611b525760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b611b5b3361248d565b611ba65760408051600160e51b62461bcd0281526020600482015260116024820152600160791b702737ba1030903b30b634b2103a37b5b2b702604482015290519081900360640190fd5b835183518114611c005760408051600160e51b62461bcd02815260206004820152601a60248201527f4172726179206c656e6774687320646f206e6f74206d61746368000000000000604482015290519081900360640190fd5b7f48d67933be7b1e6d77d914145d793b5c9ced38156f34ebab23216e085435ac5587878787338860405180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b031681526020018060200180602001856001600160a01b03166001600160a01b0316815260200180602001848103845288818151815260200191508051906020019060200280838360005b83811015611cb7578181015183820152602001611c9f565b50505050905001848103835287818151815260200191508051906020019060200280838360005b83811015611cf6578181015183820152602001611cde565b50505050905001848103825285818151815260200191508051906020019080838360005b83811015611d32578181015183820152602001611d1a565b50505050905090810190601f168015611d5f5780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390a150600160e11b6374f2df35029695505050505050565b60408051600160e11b627eeac70281523060048201526024810184905290516000916001600160a01b0384169162fdd58e91604480820192602092909190829003018186803b158015611ddb57600080fd5b505afa158015611def573d6000803e3d6000fd5b505050506040513d6020811015611e0557600080fd5b50519392505050565b6002546001600160a01b03163314611e5a57604051600160e51b62461bcd0281526004018080602001828103825260278152602001806128a06027913960400191505060405180910390fd5b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b600054600160a01b900460ff16611ed45760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b6000611f606040518060400160405280601381526020017f12576974686472617720455243373231583a0a000000000000000000000000008152508d8d8d60405160200180848152602001838152602001826001600160a01b03166001600160a01b031660601b81526014019350505050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561208257600080fd5b505afa158015612096573d6000803e3d6000fd5b5050505060036000336001600160a01b03166001600160a01b0316815260200190815260200160002060008154809291906001019190505550896001600160a01b0316630febdd4930338f8f6040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001838152602001828152602001945050505050600060405180830381600087803b15801561215157600080fd5b505af1158015612165573d6000803e3d6000fd5b505060405133925060008051602061288083398151915291506003908d908f908084611111565b600054600160a01b900460ff166121db5760408051600160e51b62461bcd0281526020600482015260146024820152600080516020612860833981519152604482015290519081900360640190fd5b60006122426040518060400160405280600f81526020017f0e5769746864726177204554483a0a00000000000000000000000000000000008152508b60405160200180828152602001915050604051602081830303815290604052805190602001206124c4565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316630fba29c3828b8b8b8b8b8b8b8b6040518a63ffffffff1660e01b8152600401808a81526020018060200180602001806020018060200185810385528d8d82818152602001925060200280828437600083820152601f01601f191690910186810385528b8152602090810191508c908c0280828437600083820152601f01601f19169091018681038452898152602090810191508a908a0280828437600083820152601f01601f19169091018681038352878152602090810191508890880280828437600081840152601f19601f8201169050808301925050509d505050505050505050505050505060006040518083038186803b15801561236457600080fd5b505afa158015612378573d6000803e3d6000fd5b50503360008181526003602052604080822080546001019055519193508d156108fc0292508d9190818181858888f193505050501580156123bd573d6000803e3d6000fd5b5060408051600080825260208201528082018c905290513391600080516020612880833981519152919081900360600190a250505050505050505050565b600054600160a01b900460ff1690565b6002546001600160a01b0316331461245757604051600160e51b62461bcd02815260040180806020018281038252602a8152602001806128fe602a913960400191505060405180910390fd5b60008054911515600160a81b02600160a81b60ff0219909216919091179055565b60016020526000908152604090205460ff1681565b60008054600160a81b900460ff16806124be57506001600160a01b03821660009081526001602052604090205460ff165b92915050565b6000823360036000336001600160a01b03166001600160a01b031681526020019081526020016000205430856040516020018086805190602001908083835b602083106125225780518252601f199092019160209182019101612503565b6001836020036101000a038019825116818451168082178552505050505050905001856001600160a01b03166001600160a01b031660601b8152601401848152602001836001600160a01b03166001600160a01b031660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905092915050565b604080516001600160a01b0386811660248301528581166044830152606480830186905283518084039091018152608490920183526020820180516001600160e01b0316600160e01b6323b872dd021781529251825160009485949387169392918291908083835b602083106126325780518252601f199092019160209182019101612613565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612694576040519150601f19603f3d011682016040523d82523d6000602084013e612699565b606091505b5090979650505050505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b0316600160e01b6323b872dd02179052612703908590612763565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0316600160e01b63a9059cbb0217905261275e908490612763565b505050565b612775826001600160a01b0316612859565b61277e57600080fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106127bc5780518252601f19909201916020918201910161279d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461281e576040519150601f19603f3d011682016040523d82523d6000602084013e612823565b606091505b50915091508161283257600080fd5b8051156127035780806020019051602081101561284e57600080fd5b505161270357600080fd5b3b15159056fe476174657761792069732064697361626c65642e000000000000000000000000591f2d33d85291e32c4067b5a497caf3ddb5b1830eba9909e66006ec3a0051b4746f67676c65416c6c6f77546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65656e61626c65476174657761793a206f6e6c79206f776e65722063616e20656e61626c65206f722064697361626c652067617465776179746f67676c65416c6c6f77416e79546f6b656e3a206f6e6c79206f776e65722063616e20746f67676c65a165627a7a72305820ace81939002d8d64077e021434066edca9c22927222014369aef418d15fd26bb0029" } \ No newline at end of file diff --git a/e2e_support/truffle-artifacts/GameToken.json b/src/tests/e2e/artifacts/LoomToken.json similarity index 54% rename from e2e_support/truffle-artifacts/GameToken.json rename to src/tests/e2e/artifacts/LoomToken.json index a8a1afbc..44efa4ca 100644 --- a/e2e_support/truffle-artifacts/GameToken.json +++ b/src/tests/e2e/artifacts/LoomToken.json @@ -1,5 +1,5 @@ { - "contractName": "GameToken", + "contractName": "LoomToken", "abi": [ { "constant": true, @@ -283,5 +283,5 @@ "type": "event" } ], - "bytecode": "0x60c0604052600960808190527f47616d65546f6b656e000000000000000000000000000000000000000000000060a090815261003e916003919061018f565b506040805180820190915260038082527f47544b000000000000000000000000000000000000000000000000000000000060209092019182526100839160049161018f565b506005805460ff1916601217905534801561009d57600080fd5b506005546100bf90339060ff16600a0a633b9aca00026100c4602090811b901c565b61022a565b6001600160a01b0382166100d757600080fd5b6100f08160025461017660201b61066c1790919060201c565b6002556001600160a01b0382166000908152602081815260409091205461012091839061066c610176821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60008282018381101561018857600080fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106101d057805160ff19168380011785556101fd565b828001600101855582156101fd579182015b828111156101fd5782518255916020019190600101906101e2565b5061020992915061020d565b5090565b61022791905b808211156102095760008155600101610213565b90565b6106b1806102396000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063395093511161007157806339509351146101ec57806370a082311461021857806395d89b411461023e578063a457c2d714610246578063a9059cbb14610272578063dd62ed3e1461029e576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd146101905780632ff2e9dc146101c6578063313ce567146101ce575b600080fd5b6100c16102cc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b03813516906020013561035a565b604080519115158252519081900360200190f35b61017e610370565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610376565b61017e6103cd565b6101d66103d5565b6040805160ff9092168252519081900360200190f35b6101626004803603604081101561020257600080fd5b506001600160a01b0381351690602001356103de565b61017e6004803603602081101561022e57600080fd5b50356001600160a01b031661041a565b6100c1610435565b6101626004803603604081101561025c57600080fd5b506001600160a01b038135169060200135610490565b6101626004803603604081101561028857600080fd5b506001600160a01b0381351690602001356104cc565b61017e600480360360408110156102b457600080fd5b506001600160a01b03813581169160200135166104d9565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b820191906000526020600020905b81548152906001019060200180831161033557829003601f168201915b505050505081565b6000610367338484610504565b50600192915050565b60025490565b600061038384848461058c565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546103c39186916103be908663ffffffff61065716565b610504565b5060019392505050565b633b9aca0081565b60055460ff1681565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61066c16565b6001600160a01b031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61065716565b600061036733848461058c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b03821661051757600080fd5b6001600160a01b03831661052a57600080fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03821661059f57600080fd5b6001600160a01b0383166000908152602081905260409020546105c8908263ffffffff61065716565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105fd908263ffffffff61066c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282111561066657600080fd5b50900390565b60008282018381101561067e57600080fd5b939250505056fea165627a7a7230582041cecab436b72ee60ec580c80fc72861e5db86881f87a1197730ab2b55324bc80029", + "bytecode": "0x60c0604052600a60808190527f4c6f6f6d20546f6b656e0000000000000000000000000000000000000000000060a090815261003e916003919061018d565b506040805180820190915260048082527f4c4f4f4d000000000000000000000000000000000000000000000000000000006020909201918252610081918161018d565b506005805460ff1916601217905534801561009b57600080fd5b506005546100bd90339060ff16600a0a633b9aca00026100c2602090811b901c565b610228565b6001600160a01b0382166100d557600080fd5b6100ee8160025461017460201b61066c1790919060201c565b6002556001600160a01b0382166000908152602081815260409091205461011e91839061066c610174821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60008282018381101561018657600080fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106101ce57805160ff19168380011785556101fb565b828001600101855582156101fb579182015b828111156101fb5782518255916020019190600101906101e0565b5061020792915061020b565b5090565b61022591905b808211156102075760008155600101610211565b90565b6106b1806102376000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063395093511161007157806339509351146101ec57806370a082311461021857806395d89b411461023e578063a457c2d714610246578063a9059cbb14610272578063dd62ed3e1461029e576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd146101905780632ff2e9dc146101c6578063313ce567146101ce575b600080fd5b6100c16102cc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b03813516906020013561035a565b604080519115158252519081900360200190f35b61017e610370565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610376565b61017e6103cd565b6101d66103d5565b6040805160ff9092168252519081900360200190f35b6101626004803603604081101561020257600080fd5b506001600160a01b0381351690602001356103de565b61017e6004803603602081101561022e57600080fd5b50356001600160a01b031661041a565b6100c1610435565b6101626004803603604081101561025c57600080fd5b506001600160a01b038135169060200135610490565b6101626004803603604081101561028857600080fd5b506001600160a01b0381351690602001356104cc565b61017e600480360360408110156102b457600080fd5b506001600160a01b03813581169160200135166104d9565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b820191906000526020600020905b81548152906001019060200180831161033557829003601f168201915b505050505081565b6000610367338484610504565b50600192915050565b60025490565b600061038384848461058c565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546103c39186916103be908663ffffffff61065716565b610504565b5060019392505050565b633b9aca0081565b60055460ff1681565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61066c16565b6001600160a01b031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103525780601f1061032757610100808354040283529160200191610352565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103679185906103be908663ffffffff61065716565b600061036733848461058c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b03821661051757600080fd5b6001600160a01b03831661052a57600080fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03821661059f57600080fd5b6001600160a01b0383166000908152602081905260409020546105c8908263ffffffff61065716565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105fd908263ffffffff61066c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282111561066657600080fd5b50900390565b60008282018381101561067e57600080fd5b939250505056fea165627a7a723058206d82d10902ac3d0fd578314b284fba835070c43adb2fbc46a2ba644e83b7580c0029" } \ No newline at end of file diff --git a/src/tests/e2e/artifacts/SampleERC20MintableToken.json b/src/tests/e2e/artifacts/SampleERC20MintableToken.json new file mode 100644 index 00000000..0b2a363b --- /dev/null +++ b/src/tests/e2e/artifacts/SampleERC20MintableToken.json @@ -0,0 +1,527 @@ +{ + "contractName": "SampleERC20MintableToken", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "from", + "type": "address" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "account", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceMinter", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "account", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + }, + { + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_gateway", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "validator", + "type": "address" + } + ], + "name": "ValidatorAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "validator", + "type": "address" + } + ], + "name": "ValidatorRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "gateway", + "type": "address" + } + ], + "name": "GatewayAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "gateway", + "type": "address" + } + ], + "name": "GatewayRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "account", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "account", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "mintTo", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "newValidator", + "type": "address" + } + ], + "name": "addValidator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "validator", + "type": "address" + } + ], + "name": "removeValidator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_gateway", + "type": "address" + } + ], + "name": "addGateway", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_gateway", + "type": "address" + } + ], + "name": "removeGateway", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "validator", + "type": "address" + } + ], + "name": "isValidator", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "gateway", + "type": "address" + } + ], + "name": "isGateway", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x60806040523480156200001157600080fd5b50604051602080620011af833981018060405260208110156200003357600080fd5b5051620000473362000117602090811b901c565b6001600160a01b03811660009081526004602090815260408083208054600160ff19918216811790925533855260078452938290208054909416179092558151808301909252600d8083527f65726332306d696e7461626c650000000000000000000000000000000000000092909101918252620000c891600591620001f5565b506040805180820190915260058082527f4d4e54323000000000000000000000000000000000000000000000000000000060209092019182526200010f91600691620001f5565b50506200029a565b620001328160036200016960201b62000e141790919060201c565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6001600160a01b0381166200017d57600080fd5b6200018f8282620001bf60201b60201c565b156200019a57600080fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b038216620001d557600080fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200023857805160ff191683800117855562000268565b8280016001018555821562000268579182015b82811115620002685782518255916020019190600101906200024b565b50620002769291506200027a565b5090565b6200029791905b8082111562000276576000815560010162000281565b90565b610f0580620002aa6000396000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b8578063a457c2d71161007c578063a457c2d7146103ec578063a9059cbb14610418578063aa271e1a14610444578063bfe69d9a1461046a578063dd62ed3e14610490578063facd743b146104be57610142565b806370a082311461036a5780638a885e351461039057806395d89b41146103b6578063983b2d56146103be57806398650275146103e457610142565b8063395093511161010a578063395093511461027257806340a141ff1461029e57806340c10f19146102c6578063449a52f8146102f25780634d238c8e1461031e57806368bb37951461034457610142565b806306fdde0314610147578063095ea7b3146101c457806318160ddd1461020457806323b872dd1461021e578063313ce56714610254575b600080fd5b61014f6104e4565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610189578181015183820152602001610171565b50505050905090810190601f1680156101b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101f0600480360360408110156101da57600080fd5b506001600160a01b038135169060200135610572565b604080519115158252519081900360200190f35b61020c610588565b60408051918252519081900360200190f35b6101f06004803603606081101561023457600080fd5b506001600160a01b0381358116916020810135909116906040013561058e565b61025c6105e5565b6040805160ff9092168252519081900360200190f35b6101f06004803603604081101561028857600080fd5b506001600160a01b0381351690602001356105ea565b6102c4600480360360208110156102b457600080fd5b50356001600160a01b0316610626565b005b6101f0600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106d4565b6102c46004803603604081101561030857600080fd5b506001600160a01b038135169060200135610734565b6102c46004803603602081101561033457600080fd5b50356001600160a01b03166107ae565b6102c46004803603602081101561035a57600080fd5b50356001600160a01b031661085f565b61020c6004803603602081101561038057600080fd5b50356001600160a01b0316610910565b6102c4600480360360208110156103a657600080fd5b50356001600160a01b031661092b565b61014f6109d9565b6102c4600480360360208110156103d457600080fd5b50356001600160a01b0316610a34565b6102c4610a52565b6101f06004803603604081101561040257600080fd5b506001600160a01b038135169060200135610a5d565b6101f06004803603604081101561042e57600080fd5b506001600160a01b038135169060200135610a99565b6101f06004803603602081101561045a57600080fd5b50356001600160a01b0316610aa6565b6101f06004803603602081101561048057600080fd5b50356001600160a01b0316610abf565b61020c600480360360408110156104a657600080fd5b506001600160a01b0381358116916020013516610add565b6101f0600480360360208110156104d457600080fd5b50356001600160a01b0316610b08565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561056a5780601f1061053f5761010080835404028352916020019161056a565b820191906000526020600020905b81548152906001019060200180831161054d57829003601f168201915b505050505081565b600061057f338484610b26565b50600192915050565b60025490565b600061059b848484610bae565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546105db9186916105d6908663ffffffff610c7916565b610b26565b5060019392505050565b601281565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161057f9185906105d6908663ffffffff610c8e16565b3360009081526007602052604090205460ff16151560011461067c57604051600160e51b62461bcd028152600401808060200182810382526031815260200180610ea96031913960400191505060405180910390fd5b6001600160a01b038116600081815260076020908152604091829020805460ff19169055815192835290517fe1434e25d6611e0db941968fdc97811c982ac1602e951637d206f5fdda9dd8f19281900390910190a150565b3360009081526007602052604081205460ff16151560011461072a57604051600160e51b62461bcd028152600401808060200182810382526031815260200180610ea96031913960400191505060405180910390fd5b61057f8383610ca7565b3360009081526004602052604090205460ff1615156001146107a05760408051600160e51b62461bcd02815260206004820152601e60248201527f6f6e6c792067617465776179732061726520616c6c6f776564206d696e740000604482015290519081900360640190fd5b6107aa8282610ca7565b5050565b3360009081526007602052604090205460ff16151560011461080457604051600160e51b62461bcd028152600401808060200182810382526031815260200180610ea96031913960400191505060405180910390fd5b6001600160a01b038116600081815260076020908152604091829020805460ff19166001179055815192835290517fe366c1c0452ed8eec96861e9e54141ebff23c9ec89fe27b996b45f5ec38849879281900390910190a150565b3360009081526007602052604090205460ff1615156001146108b557604051600160e51b62461bcd028152600401808060200182810382526031815260200180610ea96031913960400191505060405180910390fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f7137528d21fb7b0b9462886348954009edac49570e27ef9dba8bb3a676fc11e29281900390910190a150565b6001600160a01b031660009081526020819052604090205490565b3360009081526007602052604090205460ff16151560011461098157604051600160e51b62461bcd028152600401808060200182810382526031815260200180610ea96031913960400191505060405180910390fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f6ad07cb5676ab639fa3821550f0ec4379900d542e2d8bd8f0f8158d8bd352da29281900390910190a150565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561056a5780601f1061053f5761010080835404028352916020019161056a565b610a3d33610aa6565b610a4657600080fd5b610a4f81610d4f565b50565b610a5b33610d97565b565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161057f9185906105d6908663ffffffff610c7916565b600061057f338484610bae565b6000610ab960038363ffffffff610ddf16565b92915050565b6001600160a01b031660009081526004602052604090205460ff1690565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b031660009081526007602052604090205460ff1690565b6001600160a01b038216610b3957600080fd5b6001600160a01b038316610b4c57600080fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038216610bc157600080fd5b6001600160a01b038316600090815260208190526040902054610bea908263ffffffff610c7916565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610c1f908263ffffffff610c8e16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610c8857600080fd5b50900390565b600082820183811015610ca057600080fd5b9392505050565b6001600160a01b038216610cba57600080fd5b600254610ccd908263ffffffff610c8e16565b6002556001600160a01b038216600090815260208190526040902054610cf9908263ffffffff610c8e16565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b610d6060038263ffffffff610e1416565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b610da860038263ffffffff610e6016565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60006001600160a01b038216610df457600080fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b6001600160a01b038116610e2757600080fd5b610e318282610ddf565b15610e3b57600080fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6001600160a01b038116610e7357600080fd5b610e7d8282610ddf565b610e8657600080fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe6f6e6c792076616c696461746f727320617574686f72697a656420746f20706572666f726d207468697320616374696f6ea165627a7a7230582024cd34142bd7b608289e143e616f91c42f5435b9ff93205e35bd5f7f8808bd520029" +} \ No newline at end of file diff --git a/src/tests/e2e/artifacts/SampleERC20Token.json b/src/tests/e2e/artifacts/SampleERC20Token.json new file mode 100644 index 00000000..b812cab4 --- /dev/null +++ b/src/tests/e2e/artifacts/SampleERC20Token.json @@ -0,0 +1,338 @@ +{ + "contractName": "SampleERC20Token", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "gateway", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "deployer", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_addedValue", + "type": "uint256" + } + ], + "name": "increaseApproval", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_gateway", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "mintToGateway", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_address", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "mintTo", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60806040526040805190810160405280600581526020017f45524332300000000000000000000000000000000000000000000000000000008152506005908051906020019062000051929190620001f6565b506040805190810160405280600381526020017f4443430000000000000000000000000000000000000000000000000000000000815250600690805190602001906200009f929190620001f6565b506012600760006101000a81548160ff021916908360ff160217905550348015620000c957600080fd5b5060405160208062001aa48339810180604052810190808051906020019092919050505080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900460ff1660ff16600a0a633b9aca0002600181905550600760009054906101000a900460ff1660ff16600a0a633b9aca00026000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555033600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050620002a5565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200023957805160ff19168380011785556200026a565b828001600101855582156200026a579182015b82811115620002695782518255916020019190600101906200024c565b5b5090506200027991906200027d565b5090565b620002a291905b808211156200029e57600081600090555060010162000284565b5090565b90565b6117ef80620002b56000396000f3006080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b314610170578063116191b6146101d557806318160ddd1461022c57806323b872dd14610257578063313ce567146102dc578063449a52f81461030d578063544297f51461035a578063661884631461038757806370a08231146103ec57806395d89b4114610443578063a9059cbb146104d3578063d5f3948814610538578063d73dd6231461058f578063dd62ed3e146105f4575b600080fd5b3480156100ec57600080fd5b506100f561066b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610709565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea6107fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023857600080fd5b50610241610821565b6040518082815260200191505060405180910390f35b34801561026357600080fd5b506102c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082b565b604051808215151515815260200191505060405180910390f35b3480156102e857600080fd5b506102f1610be6565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031957600080fd5b50610358600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bf9565b005b34801561036657600080fd5b5061038560048036038101908080359060200190929190505050610dfc565b005b34801561039357600080fd5b506103d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f4d565b604051808215151515815260200191505060405180910390f35b3480156103f857600080fd5b5061042d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111df565b6040518082815260200191505060405180910390f35b34801561044f57600080fd5b50610458611227565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561049857808201518184015260208101905061047d565b50505050905090810190601f1680156104c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104df57600080fd5b5061051e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112c5565b604051808215151515815260200191505060405180910390f35b34801561054457600080fd5b5061054d6114e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059b57600080fd5b506105da600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061150b565b604051808215151515815260200191505060405180910390f35b34801561060057600080fd5b50610655600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611707565b6040518082815260200191505060405180910390f35b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107015780601f106106d657610100808354040283529160200191610701565b820191906000526020600020905b8154815290600101906020018083116106e457829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087a57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561090557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561094157600080fd5b610992826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178e90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a25826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610af682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ce4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f6e6f7420617574686f72697a656420746f20706572666f726d2074686973206181526020017f6374696f6e00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610cf9816001546117a790919063ffffffff16565b600181905550610d50816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5857600080fd5b610e6d816001546117a790919063ffffffff16565b600181905550610ee681600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808310151561105f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110f3565b611072838261178e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112bd5780601f10611292576101008083540402835291602001916112bd565b820191906000526020600020905b8154815290600101906020018083116112a057829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561131457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561135057600080fd5b6113a1826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461178e90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611434826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061159c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561179c57fe5b818303905092915050565b600081830190508281101515156117ba57fe5b809050929150505600a165627a7a72305820cc50de3ef6f8756e5e3796a0e739d1d17ec1a936953cfa2c5b545031033ddba50029" +} \ No newline at end of file diff --git a/e2e_support/truffle-artifacts/SimpleStore.json b/src/tests/e2e/artifacts/SimpleStore.json similarity index 100% rename from e2e_support/truffle-artifacts/SimpleStore.json rename to src/tests/e2e/artifacts/SimpleStore.json diff --git a/e2e_support/truffle-artifacts/SimpleStore2.json b/src/tests/e2e/artifacts/SimpleStore2.json similarity index 100% rename from e2e_support/truffle-artifacts/SimpleStore2.json rename to src/tests/e2e/artifacts/SimpleStore2.json diff --git a/e2e_support/truffle-artifacts/SimpleStore3.json b/src/tests/e2e/artifacts/SimpleStore3.json similarity index 100% rename from e2e_support/truffle-artifacts/SimpleStore3.json rename to src/tests/e2e/artifacts/SimpleStore3.json diff --git a/e2e_support/truffle-artifacts/ValidatorManagerContract.json b/src/tests/e2e/artifacts/ValidatorManagerContract.json similarity index 99% rename from e2e_support/truffle-artifacts/ValidatorManagerContract.json rename to src/tests/e2e/artifacts/ValidatorManagerContract.json index 6259c4e4..9dffdeee 100644 --- a/e2e_support/truffle-artifacts/ValidatorManagerContract.json +++ b/src/tests/e2e/artifacts/ValidatorManagerContract.json @@ -340,5 +340,5 @@ "type": "function" } ], - "bytecode": "0x60806040523480156200001157600080fd5b5060405162001e7f38038062001e7f833981018060405260a08110156200003757600080fd5b8101908080516401000000008111156200005057600080fd5b820160208101848111156200006457600080fd5b81518560208202830111640100000000821117156200008257600080fd5b505092919060200180516401000000008111156200009f57600080fd5b82016020810184811115620000b357600080fd5b8151856020820283011164010000000082111715620000d157600080fd5b5050602082015160408301516060909301516000805460ff191660ff8085169190911761ff001916610100828816810291909117928390559497509295509092810482169116118015906200012a575060005460ff1615155b6200019657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c6964207468726573686f6c64206672616374696f6e2e0000000000604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b038316179055620001c48585620001cf602090811b901c565b50505050506200055d565b8151815181146200022c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018062001e51602e913960400191505060405180910390fd5b6000811162000287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018062001e2e6023913960400191505060405180910390fd5b6000805b82811015620002d657620002cb848281518110620002a557fe5b60200260200101516001600160401b031683620003cd60201b620014121790919060201c565b91506001016200028b565b5060038190558351620002f1906001906020870190620003e7565b5082516200030790600290602086019062000451565b507f323c51e0ad42c317ff3b00c6ce354d799a4b5eaf3a25cf3169cf2efd339d4d548484604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156200037157818101518382015260200162000357565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015620003b257818101518382015260200162000398565b5050505090500194505050505060405180910390a150505050565b600082820183811015620003e057600080fd5b9392505050565b8280548282559060005260206000209081019282156200043f579160200282015b828111156200043f57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000408565b506200044d9291506200050c565b5090565b82805482825590600052602060002090600301600490048101928215620004fe5791602002820160005b83821115620004c757835183826101000a8154816001600160401b0302191690836001600160401b0316021790555092602001926008016020816007010492830192600103026200047b565b8015620004fc5782816101000a8154906001600160401b030219169055600801602081600701049283019260010302620004c7565b505b506200044d92915062000536565b6200053391905b808211156200044d5780546001600160a01b031916815560010162000513565b90565b6200053391905b808211156200044d5780546001600160401b03191681556001016200053d565b6118c1806200056d6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063affed0e01161008c578063c57829d211610066578063c57829d214610741578063db3ad22c14610749578063eb2eb0ef14610751578063ff13a1ac1461094f576100ea565b8063affed0e014610697578063b7ab4db5146106b1578063c47c479a14610709576100ea565b806337179db8116100c857806337179db8146104c957806340c1bfab146104d157806357d717d11461050b5780639b96372214610529576100ea565b80630d8618ce146100ef5780630fba29c31461026257806335aa2e4414610490575b600080fd5b610260600480360360c081101561010557600080fd5b60ff8235811692602081013590911691810190606081016040820135600160201b81111561013257600080fd5b82018360208201111561014457600080fd5b803590602001918460208302840111600160201b8311171561016557600080fd5b919390929091602081019035600160201b81111561018257600080fd5b82018360208201111561019457600080fd5b803590602001918460208302840111600160201b831117156101b557600080fd5b919390929091602081019035600160201b8111156101d257600080fd5b8201836020820111156101e457600080fd5b803590602001918460208302840111600160201b8311171561020557600080fd5b919390929091602081019035600160201b81111561022257600080fd5b82018360208201111561023457600080fd5b803590602001918460208302840111600160201b8311171561025557600080fd5b509092509050610957565b005b610260600480360360a081101561027857600080fd5b81359190810190604081016020820135600160201b81111561029957600080fd5b8201836020820111156102ab57600080fd5b803590602001918460208302840111600160201b831117156102cc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561031b57600080fd5b82018360208201111561032d57600080fd5b803590602001918460208302840111600160201b8311171561034e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561039d57600080fd5b8201836020820111156103af57600080fd5b803590602001918460208302840111600160201b831117156103d057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561041f57600080fd5b82018360208201111561043157600080fd5b803590602001918460208302840111600160201b8311171561045257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b1a945050505050565b6104ad600480360360208110156104a657600080fd5b5035610e78565b604080516001600160a01b039092168252519081900360200190f35b6104ad610e9f565b6104ee600480360360208110156104e757600080fd5b5035610eae565b6040805167ffffffffffffffff9092168252519081900360200190f35b610513610ee9565b6040805160ff9092168252519081900360200190f35b610260600480360360a081101561053f57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056957600080fd5b82018360208201111561057b57600080fd5b803590602001918460208302840111600160201b8311171561059c57600080fd5b919390929091602081019035600160201b8111156105b957600080fd5b8201836020820111156105cb57600080fd5b803590602001918460208302840111600160201b831117156105ec57600080fd5b919390929091602081019035600160201b81111561060957600080fd5b82018360208201111561061b57600080fd5b803590602001918460208302840111600160201b8311171561063c57600080fd5b919390929091602081019035600160201b81111561065957600080fd5b82018360208201111561066b57600080fd5b803590602001918460208302840111600160201b8311171561068c57600080fd5b509092509050610ef7565b61069f611044565b60408051918252519081900360200190f35b6106b961104a565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156106f55781810151838201526020016106dd565b505050509050019250505060405180910390f35b610260600480360360a081101561071f57600080fd5b5080359060208101359060ff60408201351690606081013590608001356110ad565b610513611184565b61069f61118d565b610260600480360360c081101561076757600080fd5b810190602081018135600160201b81111561078157600080fd5b82018360208201111561079357600080fd5b803590602001918460208302840111600160201b831117156107b457600080fd5b919390929091602081019035600160201b8111156107d157600080fd5b8201836020820111156107e357600080fd5b803590602001918460208302840111600160201b8311171561080457600080fd5b919390929091602081019035600160201b81111561082157600080fd5b82018360208201111561083357600080fd5b803590602001918460208302840111600160201b8311171561085457600080fd5b919390929091602081019035600160201b81111561087157600080fd5b82018360208201111561088357600080fd5b803590602001918460208302840111600160201b831117156108a457600080fd5b919390929091602081019035600160201b8111156108c157600080fd5b8201836020820111156108d357600080fd5b803590602001918460208302840111600160201b831117156108f457600080fd5b919390929091602081019035600160201b81111561091157600080fd5b82018360208201111561092357600080fd5b803590602001918460208302840111600160201b8311171561094457600080fd5b509092509050611193565b6106b961134b565b8860ff168a60ff1611158015610970575060008a60ff16115b6109c45760408051600160e51b62461bcd02815260206004820152601a60248201527f496e76616c6964207468726573686f6c64206672616374696f6e000000000000604482015290519081900360640190fd5b6000610a0f8b8b604051602001808360ff1660ff1660f81b81526001018260ff1660ff1660f81b815260010192505050604051602081830303815290604052805190602001206113d6565b9050610ae1818a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610b1a92505050565b50506000805460ff191660ff9a8b161761ff00191661010099909a16989098029890981790965550506004805460010190555050505050565b8251600154811115610b6057604051600160e51b62461bcd0281526004018080602001828103825260478152602001806117cd6047913960600191505060405180910390fd5b600081118015610b705750825181145b8015610b7d575081518351145b8015610b895750845181145b610bc757604051600160e51b62461bcd02815260040180806020018281038252602b81526020018061174c602b913960400191505060405180910390fd5b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083018a905283518084039091018152605c90920190925280519101206000805b83811015610e16578015610c5b57876001820381518110610c3557fe5b6020026020010151888281518110610c4957fe5b602002602001015111610c5b57600080fd5b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0858281518110610c8857fe5b602002602001015160001c1115610c9e57610e0e565b6000600184898481518110610caf57fe5b6020026020010151898581518110610cc357fe5b6020026020010151898681518110610cd757fe5b602002602001015160405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610d36573d6000803e3d6000fd5b5050506020604051035190506001898381518110610d5057fe5b602002602001015181548110610d6257fe5b6000918252602090912001546001600160a01b03828116911614610dba57604051600160e51b62461bcd0281526004018080602001828103825260358152602001806117986035913960400191505060405180910390fd5b610e0a60028a8481518110610dcb57fe5b602002602001015181548110610ddd57fe5b6000918252602090912060048204015485916003166008026101000a900467ffffffffffffffff16611412565b9250505b600101610c18565b5060005460035460ff8083169091026101009092041682021015610e6e57604051600160e51b62461bcd0281526004018080602001828103825260318152602001806118376031913960400191505060405180910390fd5b5050505050505050565b60018181548110610e8557fe5b6000918252602090912001546001600160a01b0316905081565b6005546001600160a01b031681565b60028181548110610ebb57fe5b9060005260206000209060049182820401919006600802915054906101000a900467ffffffffffffffff1681565b600054610100900460ff1681565b6000610f3d8a60405160200180826001600160a01b03166001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206113d6565b905061100f818a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610b1a92505050565b5050600580546001600160a01b0319166001600160a01b03999099169890981790975550506004805460010190555050505050565b60045481565b606060018054806020026020016040519081016040528092919081815260200182805480156110a257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611084575b505050505090505b90565b604080516000808252602080830180855289905260ff87168385015260608301869052608083018590529251909260019260a080820193601f1981019281900390910190855afa158015611105573d6000803e3d6000fd5b505050602060405103519050806001600160a01b03166001868154811061112857fe5b6000918252602090912001546001600160a01b03161461117c57604051600160e51b62461bcd0281526004018080602001828103825260218152602001806117776021913960400191505060405180910390fd5b505050505050565b60005460ff1681565b60035481565b60006111e38d8d8d8d6040516020018085856020028082843791909101905083602084028082843780830192505050945050505050604051602081830303815290604052805190602001206113d6565b90506112b5818a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610b1a92505050565b6113338d8d80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508c8c8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061142b92505050565b50506004805460010190555050505050505050505050565b606060028054806020026020016040519081016040528092919081815260200182805480156110a257602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff16815260200190600801906020826007010492830192600103820291508084116113885790505050505050905090565b600454604080513060601b6020808301919091526034820193909352605480820194909452815180820390940184526074019052815191012090565b60008282018381101561142457600080fd5b9392505050565b81518151811461146f57604051600160e51b62461bcd02815260040180806020018281038252602e815260200180611868602e913960400191505060405180910390fd5b600081116114b157604051600160e51b62461bcd0281526004018080602001828103825260238152602001806118146023913960400191505060405180910390fd5b6000805b828110156114f7576114ed8482815181106114cc57fe5b602002602001015167ffffffffffffffff168361141290919063ffffffff16565b91506001016114b5565b50600381905583516115109060019060208701906115e6565b50825161152490600290602086019061164b565b507f323c51e0ad42c317ff3b00c6ce354d799a4b5eaf3a25cf3169cf2efd339d4d548484604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561158c578181015183820152602001611574565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156115cb5781810151838201526020016115b3565b5050505090500194505050505060405180910390a150505050565b82805482825590600052602060002090810192821561163b579160200282015b8281111561163b57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611606565b50611647929150611702565b5090565b828054828255906000526020600020906003016004900481019282156116f65791602002820160005b838211156116c057835183826101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509260200192600801602081600701049283019260010302611674565b80156116f45782816101000a81549067ffffffffffffffff02191690556008016020816007010492830192600103026116c0565b505b50611647929150611726565b6110aa91905b808211156116475780546001600160a01b0319168155600101611708565b6110aa91905b8082111561164757805467ffffffffffffffff1916815560010161172c56fe636865636b5468726573686f6c643a3a20496e636f7272656374206e756d626572206f6620706172616d734d657373616765206e6f74207369676e656420627920612076616c696461746f72636865636b5468726573686f6c643a3a205265636f76657265642061646472657373206973206e6f7420612076616c696461746f72636865636b5468726573686f6c643a3a2043616e6e6f74207375626d6974206d6f7265207369676e617475726573207468616e206578697374696e672076616c696461746f72734d7573742070726f76696465206d6f7265207468616e20302076616c696461746f7273636865636b5468726573686f6c643a3a204e6f7420656e6f75676820706f7765722066726f6d2076616c696461746f72735f726f7461746556616c696461746f72733a204172726179206c656e6774687320646f206e6f74206d6174636821a165627a7a72305820a5af8bf54c20df23d48951f8872de635eef9ee89958738cb8fa0c1a734271fb700294d7573742070726f76696465206d6f7265207468616e20302076616c696461746f72735f726f7461746556616c696461746f72733a204172726179206c656e6774687320646f206e6f74206d6174636821", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162001e7f38038062001e7f833981018060405260a08110156200003757600080fd5b8101908080516401000000008111156200005057600080fd5b820160208101848111156200006457600080fd5b81518560208202830111640100000000821117156200008257600080fd5b505092919060200180516401000000008111156200009f57600080fd5b82016020810184811115620000b357600080fd5b8151856020820283011164010000000082111715620000d157600080fd5b5050602082015160408301516060909301516000805460ff191660ff8085169190911761ff001916610100828816810291909117928390559497509295509092810482169116118015906200012a575060005460ff1615155b6200019657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c6964207468726573686f6c64206672616374696f6e2e0000000000604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b038316179055620001c48585620001cf602090811b901c565b50505050506200055d565b8151815181146200022c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018062001e51602e913960400191505060405180910390fd5b6000811162000287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018062001e2e6023913960400191505060405180910390fd5b6000805b82811015620002d657620002cb848281518110620002a557fe5b60200260200101516001600160401b031683620003cd60201b620014121790919060201c565b91506001016200028b565b5060038190558351620002f1906001906020870190620003e7565b5082516200030790600290602086019062000451565b507f323c51e0ad42c317ff3b00c6ce354d799a4b5eaf3a25cf3169cf2efd339d4d548484604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156200037157818101518382015260200162000357565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015620003b257818101518382015260200162000398565b5050505090500194505050505060405180910390a150505050565b600082820183811015620003e057600080fd5b9392505050565b8280548282559060005260206000209081019282156200043f579160200282015b828111156200043f57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000408565b506200044d9291506200050c565b5090565b82805482825590600052602060002090600301600490048101928215620004fe5791602002820160005b83821115620004c757835183826101000a8154816001600160401b0302191690836001600160401b0316021790555092602001926008016020816007010492830192600103026200047b565b8015620004fc5782816101000a8154906001600160401b030219169055600801602081600701049283019260010302620004c7565b505b506200044d92915062000536565b6200053391905b808211156200044d5780546001600160a01b031916815560010162000513565b90565b6200053391905b808211156200044d5780546001600160401b03191681556001016200053d565b6118c1806200056d6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063affed0e01161008c578063c57829d211610066578063c57829d214610741578063db3ad22c14610749578063eb2eb0ef14610751578063ff13a1ac1461094f576100ea565b8063affed0e014610697578063b7ab4db5146106b1578063c47c479a14610709576100ea565b806337179db8116100c857806337179db8146104c957806340c1bfab146104d157806357d717d11461050b5780639b96372214610529576100ea565b80630d8618ce146100ef5780630fba29c31461026257806335aa2e4414610490575b600080fd5b610260600480360360c081101561010557600080fd5b60ff8235811692602081013590911691810190606081016040820135600160201b81111561013257600080fd5b82018360208201111561014457600080fd5b803590602001918460208302840111600160201b8311171561016557600080fd5b919390929091602081019035600160201b81111561018257600080fd5b82018360208201111561019457600080fd5b803590602001918460208302840111600160201b831117156101b557600080fd5b919390929091602081019035600160201b8111156101d257600080fd5b8201836020820111156101e457600080fd5b803590602001918460208302840111600160201b8311171561020557600080fd5b919390929091602081019035600160201b81111561022257600080fd5b82018360208201111561023457600080fd5b803590602001918460208302840111600160201b8311171561025557600080fd5b509092509050610957565b005b610260600480360360a081101561027857600080fd5b81359190810190604081016020820135600160201b81111561029957600080fd5b8201836020820111156102ab57600080fd5b803590602001918460208302840111600160201b831117156102cc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561031b57600080fd5b82018360208201111561032d57600080fd5b803590602001918460208302840111600160201b8311171561034e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561039d57600080fd5b8201836020820111156103af57600080fd5b803590602001918460208302840111600160201b831117156103d057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561041f57600080fd5b82018360208201111561043157600080fd5b803590602001918460208302840111600160201b8311171561045257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b1a945050505050565b6104ad600480360360208110156104a657600080fd5b5035610e78565b604080516001600160a01b039092168252519081900360200190f35b6104ad610e9f565b6104ee600480360360208110156104e757600080fd5b5035610eae565b6040805167ffffffffffffffff9092168252519081900360200190f35b610513610ee9565b6040805160ff9092168252519081900360200190f35b610260600480360360a081101561053f57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056957600080fd5b82018360208201111561057b57600080fd5b803590602001918460208302840111600160201b8311171561059c57600080fd5b919390929091602081019035600160201b8111156105b957600080fd5b8201836020820111156105cb57600080fd5b803590602001918460208302840111600160201b831117156105ec57600080fd5b919390929091602081019035600160201b81111561060957600080fd5b82018360208201111561061b57600080fd5b803590602001918460208302840111600160201b8311171561063c57600080fd5b919390929091602081019035600160201b81111561065957600080fd5b82018360208201111561066b57600080fd5b803590602001918460208302840111600160201b8311171561068c57600080fd5b509092509050610ef7565b61069f611044565b60408051918252519081900360200190f35b6106b961104a565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156106f55781810151838201526020016106dd565b505050509050019250505060405180910390f35b610260600480360360a081101561071f57600080fd5b5080359060208101359060ff60408201351690606081013590608001356110ad565b610513611184565b61069f61118d565b610260600480360360c081101561076757600080fd5b810190602081018135600160201b81111561078157600080fd5b82018360208201111561079357600080fd5b803590602001918460208302840111600160201b831117156107b457600080fd5b919390929091602081019035600160201b8111156107d157600080fd5b8201836020820111156107e357600080fd5b803590602001918460208302840111600160201b8311171561080457600080fd5b919390929091602081019035600160201b81111561082157600080fd5b82018360208201111561083357600080fd5b803590602001918460208302840111600160201b8311171561085457600080fd5b919390929091602081019035600160201b81111561087157600080fd5b82018360208201111561088357600080fd5b803590602001918460208302840111600160201b831117156108a457600080fd5b919390929091602081019035600160201b8111156108c157600080fd5b8201836020820111156108d357600080fd5b803590602001918460208302840111600160201b831117156108f457600080fd5b919390929091602081019035600160201b81111561091157600080fd5b82018360208201111561092357600080fd5b803590602001918460208302840111600160201b8311171561094457600080fd5b509092509050611193565b6106b961134b565b8860ff168a60ff1611158015610970575060008a60ff16115b6109c45760408051600160e51b62461bcd02815260206004820152601a60248201527f496e76616c6964207468726573686f6c64206672616374696f6e000000000000604482015290519081900360640190fd5b6000610a0f8b8b604051602001808360ff1660ff1660f81b81526001018260ff1660ff1660f81b815260010192505050604051602081830303815290604052805190602001206113d6565b9050610ae1818a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610b1a92505050565b50506000805460ff191660ff9a8b161761ff00191661010099909a16989098029890981790965550506004805460010190555050505050565b8251600154811115610b6057604051600160e51b62461bcd0281526004018080602001828103825260478152602001806117cd6047913960600191505060405180910390fd5b600081118015610b705750825181145b8015610b7d575081518351145b8015610b895750845181145b610bc757604051600160e51b62461bcd02815260040180806020018281038252602b81526020018061174c602b913960400191505060405180910390fd5b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083018a905283518084039091018152605c90920190925280519101206000805b83811015610e16578015610c5b57876001820381518110610c3557fe5b6020026020010151888281518110610c4957fe5b602002602001015111610c5b57600080fd5b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0858281518110610c8857fe5b602002602001015160001c1115610c9e57610e0e565b6000600184898481518110610caf57fe5b6020026020010151898581518110610cc357fe5b6020026020010151898681518110610cd757fe5b602002602001015160405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610d36573d6000803e3d6000fd5b5050506020604051035190506001898381518110610d5057fe5b602002602001015181548110610d6257fe5b6000918252602090912001546001600160a01b03828116911614610dba57604051600160e51b62461bcd0281526004018080602001828103825260358152602001806117986035913960400191505060405180910390fd5b610e0a60028a8481518110610dcb57fe5b602002602001015181548110610ddd57fe5b6000918252602090912060048204015485916003166008026101000a900467ffffffffffffffff16611412565b9250505b600101610c18565b5060005460035460ff8083169091026101009092041682021015610e6e57604051600160e51b62461bcd0281526004018080602001828103825260318152602001806118376031913960400191505060405180910390fd5b5050505050505050565b60018181548110610e8557fe5b6000918252602090912001546001600160a01b0316905081565b6005546001600160a01b031681565b60028181548110610ebb57fe5b9060005260206000209060049182820401919006600802915054906101000a900467ffffffffffffffff1681565b600054610100900460ff1681565b6000610f3d8a60405160200180826001600160a01b03166001600160a01b031660601b8152601401915050604051602081830303815290604052805190602001206113d6565b905061100f818a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610b1a92505050565b5050600580546001600160a01b0319166001600160a01b03999099169890981790975550506004805460010190555050505050565b60045481565b606060018054806020026020016040519081016040528092919081815260200182805480156110a257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611084575b505050505090505b90565b604080516000808252602080830180855289905260ff87168385015260608301869052608083018590529251909260019260a080820193601f1981019281900390910190855afa158015611105573d6000803e3d6000fd5b505050602060405103519050806001600160a01b03166001868154811061112857fe5b6000918252602090912001546001600160a01b03161461117c57604051600160e51b62461bcd0281526004018080602001828103825260218152602001806117776021913960400191505060405180910390fd5b505050505050565b60005460ff1681565b60035481565b60006111e38d8d8d8d6040516020018085856020028082843791909101905083602084028082843780830192505050945050505050604051602081830303815290604052805190602001206113d6565b90506112b5818a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b91829185019084908082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a918291850190849080828437600092019190915250610b1a92505050565b6113338d8d80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508c8c8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061142b92505050565b50506004805460010190555050505050505050505050565b606060028054806020026020016040519081016040528092919081815260200182805480156110a257602002820191906000526020600020906000905b82829054906101000a900467ffffffffffffffff1667ffffffffffffffff16815260200190600801906020826007010492830192600103820291508084116113885790505050505050905090565b600454604080513060601b6020808301919091526034820193909352605480820194909452815180820390940184526074019052815191012090565b60008282018381101561142457600080fd5b9392505050565b81518151811461146f57604051600160e51b62461bcd02815260040180806020018281038252602e815260200180611868602e913960400191505060405180910390fd5b600081116114b157604051600160e51b62461bcd0281526004018080602001828103825260238152602001806118146023913960400191505060405180910390fd5b6000805b828110156114f7576114ed8482815181106114cc57fe5b602002602001015167ffffffffffffffff168361141290919063ffffffff16565b91506001016114b5565b50600381905583516115109060019060208701906115e6565b50825161152490600290602086019061164b565b507f323c51e0ad42c317ff3b00c6ce354d799a4b5eaf3a25cf3169cf2efd339d4d548484604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561158c578181015183820152602001611574565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156115cb5781810151838201526020016115b3565b5050505090500194505050505060405180910390a150505050565b82805482825590600052602060002090810192821561163b579160200282015b8281111561163b57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611606565b50611647929150611702565b5090565b828054828255906000526020600020906003016004900481019282156116f65791602002820160005b838211156116c057835183826101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509260200192600801602081600701049283019260010302611674565b80156116f45782816101000a81549067ffffffffffffffff02191690556008016020816007010492830192600103026116c0565b505b50611647929150611726565b6110aa91905b808211156116475780546001600160a01b0319168155600101611708565b6110aa91905b8082111561164757805467ffffffffffffffff1916815560010161172c56fe636865636b5468726573686f6c643a3a20496e636f7272656374206e756d626572206f6620706172616d734d657373616765206e6f74207369676e656420627920612076616c696461746f72636865636b5468726573686f6c643a3a205265636f76657265642061646472657373206973206e6f7420612076616c696461746f72636865636b5468726573686f6c643a3a2043616e6e6f74207375626d6974206d6f7265207369676e617475726573207468616e206578697374696e672076616c696461746f72734d7573742070726f76696465206d6f7265207468616e20302076616c696461746f7273636865636b5468726573686f6c643a3a204e6f7420656e6f75676820706f7765722066726f6d2076616c696461746f72735f726f7461746556616c696461746f72733a204172726179206c656e6774687320646f206e6f74206d6174636821a165627a7a72305820a5af8bf54c20df23d48951f8872de635eef9ee89958738cb8fa0c1a734271fb700294d7573742070726f76696465206d6f7265207468616e20302076616c696461746f72735f726f7461746556616c696461746f72733a204172726179206c656e6774687320646f206e6f74206d6174636821" } \ No newline at end of file diff --git a/src/tests/e2e/binance-test-tx-middleware.ts b/src/tests/e2e/binance-test-tx-middleware.ts index 7dbc8b07..776b7c7d 100644 --- a/src/tests/e2e/binance-test-tx-middleware.ts +++ b/src/tests/e2e/binance-test-tx-middleware.ts @@ -13,8 +13,10 @@ import { Address, LocalAddress } from '../../address' import { createDefaultTxMiddleware } from '../../helpers' import { createTestHttpClient } from '../helpers' import { AddressMapper } from '../../contracts' +import Web3 from 'web3' -const Web3 = require('web3') +// Get JSON truffle artifact +const SimpleStore = require('./truffle-artifacts/SimpleStore.json') async function bootstrapTest( createClient: () => Client @@ -43,65 +45,11 @@ async function bootstrapTest( const loomProvider = new LoomProvider(client, privKey) // Contract data and ABI - const contractData = - '608060405234801561001057600080fd5b50600a60008190555061014e806100286000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b1146100515780636d4ce63c1461007e575b600080fd5b34801561005d57600080fd5b5061007c600480360381019080803590602001909291905050506100a9565b005b34801561008a57600080fd5b50610093610119565b6040518082815260200191505060405180910390f35b806000819055506000547f7e0b7a35f017ec94e71d7012fe8fa8011f1dab6090674f92de08f8092ab30dda33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250565b600080549050905600a165627a7a7230582041f33d6a8b78928e192affcb980ca6bef9b6f5b7da5aa4b2d75b1208720caeeb0029' - - const ABI = [ - { - constant: false, - inputs: [ - { - name: '_value', - type: 'uint256' - } - ], - name: 'set', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function' - }, - { - constant: true, - inputs: [], - name: 'get', - outputs: [ - { - name: '', - type: 'uint256' - } - ], - payable: false, - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - name: '_value', - type: 'uint256' - }, - { - indexed: false, - name: 'sender', - type: 'address' - } - ], - name: 'NewValueSet', - type: 'event' - } - ] + const contractBytecode = SimpleStore.bytecode + const ABI = SimpleStore.abi // Deploy the contract using loom provider - const result = await deployContract(loomProvider, contractData) + const result = await deployContract(loomProvider, contractBytecode) // Instantiate Contract using web3 const web3 = new Web3(loomProvider) @@ -110,7 +58,6 @@ async function bootstrapTest( }) // Instantiate Binance signer - // const privateKey = crypto.generatePrivateKey() const privateKey = '276932de6251efb607422ec0860fca05cb0a32f1257d6f8759b24e8371e111c4' const signer = new BinanceSigner(privateKey) diff --git a/src/tests/e2e/client-evm-event-tests-2.ts b/src/tests/e2e/client-evm-event-tests-2.ts index d6d6a5b9..f4471a7b 100644 --- a/src/tests/e2e/client-evm-event-tests-2.ts +++ b/src/tests/e2e/client-evm-event-tests-2.ts @@ -8,7 +8,9 @@ import { deployContract } from '../evm-helpers' import { bufferToProtobufBytes } from '../../crypto-utils' import { Address, LocalAddress } from '../../address' import { createDefaultTxMiddleware } from '../../helpers' -import { SimpleStore2 } from '../contracts_bytecode' + +// Get JSON truffle artifact +const SimpleStore = require('./truffle-artifacts/SimpleStore2.json') const callTransactionAsync = async ( client: Client, @@ -46,7 +48,7 @@ test('Client EVM Event test (two filters)', async t => { const loomProvider = new LoomProvider(client, privateKey) // Deploy - const result = await deployContract(loomProvider, SimpleStore2) + const result = await deployContract(loomProvider, SimpleStore.bytecode) // Middleware used for client client.txMiddleware = createDefaultTxMiddleware(client, privateKey) diff --git a/src/tests/e2e/client-evm-event-tests.ts b/src/tests/e2e/client-evm-event-tests.ts index 47bcf540..476be269 100644 --- a/src/tests/e2e/client-evm-event-tests.ts +++ b/src/tests/e2e/client-evm-event-tests.ts @@ -7,7 +7,9 @@ import { LoomProvider } from '../../loom-provider' import { deployContract } from '../evm-helpers' import { bufferToProtobufBytes } from '../../crypto-utils' import { Address, LocalAddress } from '../../address' -import { SimpleStore } from '../contracts_bytecode' + +// Get JSON truffle artifact +const SimpleStore = require('./truffle-artifacts/SimpleStore.json') test('Client EVM Event test', async t => { let client @@ -23,7 +25,7 @@ test('Client EVM Event test', async t => { const loomProvider = new LoomProvider(client, privateKey) // Deploy - const result = await deployContract(loomProvider, SimpleStore) + const result = await deployContract(loomProvider, SimpleStore.bytecode) // Middleware used for client client.txMiddleware = [ diff --git a/src/tests/e2e/transfer-gateway-tests.ts b/src/tests/e2e/transfer-gateway-tests.ts index bee8f9e8..03a9ad45 100644 --- a/src/tests/e2e/transfer-gateway-tests.ts +++ b/src/tests/e2e/transfer-gateway-tests.ts @@ -1,5 +1,4 @@ import test, { Test } from 'tape' -import BN from 'bn.js' import { Address, Contracts, @@ -8,145 +7,225 @@ import { Client, LocalAddress } from '../../index' -import { createTestHttpClient, getTestUrls, waitForMillisecondsAsync } from '../helpers' +import { createTestHttpClient, waitForMillisecondsAsync } from '../helpers' import { B64ToUint8Array } from '../../crypto-utils' import { LoomProvider } from '../../loom-provider' import Web3 from 'web3' import { getJsonRPCSignerAsync, EthersSigner, soliditySha3 } from '../../solidity-helpers' -import { deployContractGanache, deployContract } from '../evm-helpers' -import { gateway, dappChainERC20, mainnetERC20 } from '../contracts_bytecode' +import { resolve } from 'dns' +import { rejects } from 'assert' + +const loomToken = require('./artifacts/LoomToken.json') +const validatorManager = require('./artifacts/ValidatorManagerContract.json') +const gateway = require('./artifacts/Gateway.json') +const sampleERC20MintableToken = require('./artifacts/SampleERC20MintableToken.json') +const sampleERC20Token = require('./artifacts/SampleERC20Token.json') + +// Deploy and return the contract also the txHash +async function deployContract( + web3Contract: any, + from: string, + bytecode: any, + params: any[] +): Promise { + return new Promise((resolve, reject) => { + let txHash: any + + web3Contract + .deploy({ + data: bytecode, + arguments: params + }) + .send({ + from, + gas: '6721975' + }) + .on('transactionHash', (txHashResult: string) => { + txHash = txHashResult + }) + .then((contractDeployed: any) => { + contractDeployed.txHash = txHash + resolve(contractDeployed) + }) + .catch(reject) + }) +} async function getClientAndContract(createClient: () => Client) { - const acct1PrivKey = B64ToUint8Array( - 'Hz9P3aHH62mO75A6uMVW3mn0U1KkZSq3t03jfOZfyZxjyJoJctNDY6awaVqOpjCGTjHZZxkc23Z3l39EjLOIFQ==' - ) - - const acct2PrivKey = B64ToUint8Array( + // Dappchain private keys + const dappChainPrivKeys = [ + 'Hz9P3aHH62mO75A6uMVW3mn0U1KkZSq3t03jfOZfyZxjyJoJctNDY6awaVqOpjCGTjHZZxkc23Z3l39EjLOIFQ==', '3bpboaOX/8R2XPS6q6SmhGq+RBvs+3DDkWXayy58lIC+9k1Sj1K0BEQb82OcLZ8Ivkh9EL5/hWgXLKu3vNLc/g==' + ].map(B64ToUint8Array) + + // Main net private keys (ganache) + const mainNetPrivKeys = [ + '0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d', + '0x6cbed15c793ce57650b9877cf6fa156fbef513c4e6134f022a85b1ffdd59b2a1' + ] + + // Main net address (ganache) + const mainNetAddresses = [ + '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1', + '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0' + ] + + // Dappchain pub keys + const dappChainPubKeys = dappChainPrivKeys.map(CryptoUtils.publicKeyFromPrivateKey) + + // Setting up clients with the middlewares + const clients = [createClient(), createClient()].map((client, idx) => { + client.txMiddleware = createDefaultTxMiddleware(client, dappChainPrivKeys[idx]) + return client + }) + + // Bind to transfer gateway + const transferGateway = await Contracts.TransferGateway.createAsync( + clients[0], + new Address(clients[0].chainId, LocalAddress.fromPublicKey(dappChainPubKeys[0])) ) - const acct1PubKey = CryptoUtils.publicKeyFromPrivateKey(acct1PrivKey) - const acct2PubKey = CryptoUtils.publicKeyFromPrivateKey(acct2PrivKey) - const acct1Client = createClient() - const acct2Client = createClient() + // Creates Web3 for Loom + const web3Loom = new Web3(new LoomProvider(clients[0], dappChainPrivKeys[0])) - acct1Client.txMiddleware = createDefaultTxMiddleware(acct1Client, acct1PrivKey) - acct2Client.txMiddleware = createDefaultTxMiddleware(acct2Client, acct2PrivKey) + // Creates Web3 for Main net (ganache) + const web3MainNet = new Web3('http://localhost:8545') - const transferGateway = await Contracts.TransferGateway.createAsync( - acct1Client, - new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + // Creates contracts to deploy + const loomTokenContract = new web3MainNet.eth.Contract(loomToken.abi) + const validatorManagerContract = new web3MainNet.eth.Contract(validatorManager.abi) + const gatewayContract = new web3MainNet.eth.Contract(gateway.abi) + const sampleERC20MintableTokenContract = new web3MainNet.eth.Contract( + sampleERC20MintableToken.abi + ) + const sampleERC20TokenContract = new web3Loom.eth.Contract(sampleERC20Token.abi) + + // Deploy Loom token on main net + const loomTokenDeployed = await deployContract( + loomTokenContract, + mainNetAddresses[0], + loomToken.bytecode, + [] ) - const addressMapper = await Contracts.AddressMapper.createAsync( - acct1Client, - new Address(acct1Client.chainId, LocalAddress.fromPublicKey(acct1PubKey)) + const validators = [mainNetAddresses[0]] + const powers = [1] + const threshold_num = 3 + const threshold_denom = 4 + + const validatorManagerDeployed = await deployContract( + validatorManagerContract, + mainNetAddresses[0], + validatorManager.bytecode, + [validators, powers, threshold_num, threshold_denom, loomTokenDeployed.options.address] ) - const loomProvider = new LoomProvider(acct1Client, acct1PrivKey) - const web3Loom = new Web3(loomProvider) - const web3Ganache = new Web3('http://localhost:8545') + const gatewayDeployed = await deployContract( + gatewayContract, + mainNetAddresses[0], + gateway.bytecode, + [validatorManagerDeployed.options.address] + ) - const dappchainERC20DeployedContractResults = await deployContract(loomProvider, dappChainERC20) - const gatewayDeployedContractResults = await deployContractGanache(web3Ganache, gateway) - // const mainnetERC20DeployedContractResults = await deployContractGanache( - // web3Ganache, - // mainnetERC20 - // ) + const sampleERC20MintableTokenDeployed = await deployContract( + sampleERC20MintableTokenContract, + mainNetAddresses[0], + sampleERC20MintableToken.bytecode, + [gatewayDeployed.options.address] + ) - // const mainnetERC20ContractAddress = mainnetERC20DeployedContractResults.contractAddress - // const gatewayContractAddress = gatewayDeployedContractResults.contractAddress - // const dappchainERC20ContractAddress = dappchainERC20DeployedContractResults.contractAddress - // const mainnetERC20ContractHash = mainnetERC20DeployedContractResults.transactionHash + const sampleERC20TokenDeployed = await deployContract( + sampleERC20TokenContract, + LocalAddress.fromPublicKey( + CryptoUtils.publicKeyFromPrivateKey(dappChainPrivKeys[0]) + ).toString(), + sampleERC20Token.bytecode, + [gatewayDeployed.options.address] + ) return { - acct1Client, - acct2Client, - transferGateway, - addressMapper, - acct1PubKey, - acct2PubKey, - web3Loom, - web3Ganache - // mainnetERC20ContractAddress - // gatewayContractAddress, - // dappchainERC20ContractAddress, - // mainnetERC20ContractHash + clients, + sampleERC20MintableTokenDeployed, + sampleERC20TokenDeployed, + transferGateway } } test('Should gateway owner authorize contract mapping', async (t: Test) => { const { - // acct1Client, - // dappchainERC20ContractAddress, - // mainnetERC20ContractAddress, - // transferGateway + clients, + sampleERC20MintableTokenDeployed, + sampleERC20TokenDeployed, + transferGateway } = await getClientAndContract(createTestHttpClient) - // const localContract = new Address( - // acct1Client.chainId, - // LocalAddress.fromHexString(dappchainERC20ContractAddress) - // ) - // const foreignContract = new Address( - // 'eth', - // LocalAddress.fromHexString(mainnetERC20ContractAddress) - // ) + const localContract = new Address( + clients[0].chainId, + LocalAddress.fromHexString(sampleERC20TokenDeployed.options.address) + ) + const foreignContract = new Address( + 'eth', + LocalAddress.fromHexString(sampleERC20MintableTokenDeployed.options.address) + ) - // await transferGateway.addAuthorizedContractMappingAsync({ foreignContract, localContract }) - // const contractsAuthorized = await transferGateway.listContractMappingsAsync() + await transferGateway.addAuthorizedContractMappingAsync({ foreignContract, localContract }) + const contractsAuthorized = await transferGateway.listContractMappingsAsync() - // const match = contractsAuthorized.confirmed.find(({ from, to }) => { - // return ( - // `eth:${mainnetERC20ContractAddress.toLowerCase()}` == to.toString() && - // `default:${dappchainERC20ContractAddress.toLowerCase()}` == from.toString() - // ) - // }) + const match = contractsAuthorized.confirmed.find(({ from, to }) => { + return ( + `eth:${sampleERC20MintableTokenDeployed.options.address.toLowerCase()}` == to.toString() && + `default:${sampleERC20TokenDeployed.options.address.toLowerCase()}` == from.toString() + ) + }) - // t.assert(match, 'Contracts should be confirmed') + t.assert(match, 'Contracts should be confirmed') t.end() }) -// test.only('Should user mapping contracts on gateway', async (t: Test) => { -// const { -// acct1Client, -// transferGateway, -// loomContractAddress, -// ganacheConctractAddress, -// ganacheContractHash -// } = await getClientAndContract(createTestHttpClient) - -// const localContract = new Address( -// acct1Client.chainId, -// LocalAddress.fromHexString(loomContractAddress) -// ) +test.only('Should user mapping contracts on gateway', async (t: Test) => { + const { + clients, + sampleERC20MintableTokenDeployed, + sampleERC20TokenDeployed, + transferGateway + } = await getClientAndContract(createTestHttpClient) -// const foreignContract = new Address('eth', LocalAddress.fromHexString(ganacheConctractAddress)) + const localContract = new Address( + clients[0].chainId, + LocalAddress.fromHexString(sampleERC20TokenDeployed.options.address) + ) -// const ethers = await getJsonRPCSignerAsync('http://localhost:8545', 0) -// const ethersSigner = new EthersSigner(ethers) -// const hash = soliditySha3( -// { type: 'address', value: foreignContract.local.toString().slice(2) }, -// { type: 'address', value: localContract.local.toString().slice(2) } -// ) + const foreignContract = new Address( + 'eth', + LocalAddress.fromHexString(sampleERC20MintableTokenDeployed.options.address) + ) -// const foreignContractCreatorSig = await ethersSigner.signAsync(hash) -// const foreignContractCreatorTxHash = Buffer.from(ganacheContractHash.slice(2), 'hex') + const ethers = await getJsonRPCSignerAsync('http://localhost:8545', 0) + const ethersSigner = new EthersSigner(ethers) + const hash = soliditySha3( + { type: 'address', value: foreignContract.local.toString().slice(2) }, + { type: 'address', value: localContract.local.toString().slice(2) } + ) -// const params = { -// foreignContract, -// localContract, -// foreignContractCreatorSig, -// foreignContractCreatorTxHash -// } + const foreignContractCreatorSig = await ethersSigner.signAsync(hash) + const foreignContractCreatorTxHash = Buffer.from( + sampleERC20MintableTokenDeployed.hash.slice(2), + 'hex' + ) -// await transferGateway.addContractMappingAsync(params) + const params = { + foreignContract, + localContract, + foreignContractCreatorSig, + foreignContractCreatorTxHash + } -// waitForMillisecondsAsync(60000) + await transferGateway.addContractMappingAsync(params) -// const contractsAuthorized = await transferGateway.listContractMappingsAsync() + const contractsAuthorized = await transferGateway.listContractMappingsAsync() -// console.log(JSON.stringify(contractsAuthorized)) + console.log(JSON.stringify(contractsAuthorized)) -// t.end() -// }) + t.end() +}) From fe11b5b65a5c5db8057beb21bb502c5479aeaec7 Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Tue, 17 Sep 2019 23:23:29 -0300 Subject: [PATCH 07/10] Updating build version --- .travis_e2e_test.sh | 2 +- src/tests/e2e/transfer-gateway-tests.ts | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.travis_e2e_test.sh b/.travis_e2e_test.sh index f3b12f5c..82c9235b 100755 --- a/.travis_e2e_test.sh +++ b/.travis_e2e_test.sh @@ -4,7 +4,7 @@ set -euxo pipefail eval "$(GIMME_GO_VERSION=1.10.2 gimme)" -export BUILD_ID=build-1213 +export BUILD_ID=build-1268 bash e2e_tests.sh diff --git a/src/tests/e2e/transfer-gateway-tests.ts b/src/tests/e2e/transfer-gateway-tests.ts index 03a9ad45..2cbafe75 100644 --- a/src/tests/e2e/transfer-gateway-tests.ts +++ b/src/tests/e2e/transfer-gateway-tests.ts @@ -12,8 +12,6 @@ import { B64ToUint8Array } from '../../crypto-utils' import { LoomProvider } from '../../loom-provider' import Web3 from 'web3' import { getJsonRPCSignerAsync, EthersSigner, soliditySha3 } from '../../solidity-helpers' -import { resolve } from 'dns' -import { rejects } from 'assert' const loomToken = require('./artifacts/LoomToken.json') const validatorManager = require('./artifacts/ValidatorManagerContract.json') @@ -108,10 +106,11 @@ async function getClientAndContract(createClient: () => Client) { [] ) + // Deploy validator manager on main net const validators = [mainNetAddresses[0]] const powers = [1] - const threshold_num = 3 - const threshold_denom = 4 + const threshold_num = 2 + const threshold_denom = 3 const validatorManagerDeployed = await deployContract( validatorManagerContract, @@ -120,6 +119,7 @@ async function getClientAndContract(createClient: () => Client) { [validators, powers, threshold_num, threshold_denom, loomTokenDeployed.options.address] ) + // Deploy gateway on main net const gatewayDeployed = await deployContract( gatewayContract, mainNetAddresses[0], @@ -127,6 +127,7 @@ async function getClientAndContract(createClient: () => Client) { [validatorManagerDeployed.options.address] ) + // Deploy game token on main net const sampleERC20MintableTokenDeployed = await deployContract( sampleERC20MintableTokenContract, mainNetAddresses[0], @@ -134,6 +135,7 @@ async function getClientAndContract(createClient: () => Client) { [gatewayDeployed.options.address] ) + // Deploy game token on loomchain const sampleERC20TokenDeployed = await deployContract( sampleERC20TokenContract, LocalAddress.fromPublicKey( @@ -210,7 +212,7 @@ test.only('Should user mapping contracts on gateway', async (t: Test) => { const foreignContractCreatorSig = await ethersSigner.signAsync(hash) const foreignContractCreatorTxHash = Buffer.from( - sampleERC20MintableTokenDeployed.hash.slice(2), + sampleERC20MintableTokenDeployed.txHash.slice(2), 'hex' ) @@ -227,5 +229,14 @@ test.only('Should user mapping contracts on gateway', async (t: Test) => { console.log(JSON.stringify(contractsAuthorized)) + const match = contractsAuthorized.confirmed.find(({ from, to }) => { + return ( + `eth:${sampleERC20MintableTokenDeployed.options.address.toLowerCase()}` == to.toString() && + `default:${sampleERC20TokenDeployed.options.address.toLowerCase()}` == from.toString() + ) + }) + + t.assert(match, 'Contracts should be confirmed') + t.end() }) From 5757b6d36567ad05fbbdb50453bb577cbe96f855 Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Mon, 23 Sep 2019 15:51:21 -0300 Subject: [PATCH 08/10] Reenable tests --- src/tests/e2e/transfer-gateway-tests.ts | 4 +- src/tests/e2e_tests.ts | 70 +++++++++++++------------ 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/tests/e2e/transfer-gateway-tests.ts b/src/tests/e2e/transfer-gateway-tests.ts index 2cbafe75..9664bc04 100644 --- a/src/tests/e2e/transfer-gateway-tests.ts +++ b/src/tests/e2e/transfer-gateway-tests.ts @@ -185,7 +185,7 @@ test('Should gateway owner authorize contract mapping', async (t: Test) => { t.end() }) -test.only('Should user mapping contracts on gateway', async (t: Test) => { +test('Should user mapping contracts on gateway', async (t: Test) => { const { clients, sampleERC20MintableTokenDeployed, @@ -225,6 +225,8 @@ test.only('Should user mapping contracts on gateway', async (t: Test) => { await transferGateway.addContractMappingAsync(params) + await waitForMillisecondsAsync(60000) + const contractsAuthorized = await transferGateway.listContractMappingsAsync() console.log(JSON.stringify(contractsAuthorized)) diff --git a/src/tests/e2e_tests.ts b/src/tests/e2e_tests.ts index 74bf1c87..5ba6182a 100644 --- a/src/tests/e2e_tests.ts +++ b/src/tests/e2e_tests.ts @@ -1,41 +1,43 @@ -// // Client WS-RPC -// import './e2e/ws-rpc-client-tests' - -// // Loom Provider -// import './e2e/loom-provider-tests' -// import './e2e/loom-provider-eth-get-logs' -// import './e2e/loom-provider-eth-filters' -// import './e2e/loom-provider-eth-filters-2' -// import './e2e/loom-provider-subscribe' -// import './e2e/loom-provider-web3-tests' -// import './e2e/loom-provider-web3-middlewares-tests' -// import './e2e/loom-provider-web3-child-events' - -// // EVM -// import './e2e/client-evm-tests' -// import './e2e/client-evm-event-tests' -// import './e2e/client-evm-event-tests-2' - -// // Middlewares -// import './e2e/client-test-tx-cache' -// import './e2e/client-test-tx-middleware' -// import './e2e/tron-test-tx-middleware' -// import './e2e/binance-test-tx-middleware' - -// // Events -// import './e2e/multiple-events-nd-tests' +// Client WS-RPC +import './e2e/ws-rpc-client-tests' + +// Loom Provider +import './e2e/loom-provider-tests' +import './e2e/loom-provider-eth-get-logs' +import './e2e/loom-provider-eth-filters' +import './e2e/loom-provider-eth-filters-2' +import './e2e/loom-provider-subscribe' +import './e2e/loom-provider-web3-tests' +import './e2e/loom-provider-web3-middlewares-tests' +import './e2e/loom-provider-web3-child-events' + +// EVM +import './e2e/client-evm-tests' +import './e2e/client-evm-event-tests' +import './e2e/client-evm-event-tests-2' + +// Middlewares +import './e2e/client-test-tx-cache' +import './e2e/client-test-tx-middleware' +import './e2e/tron-test-tx-middleware' +import './e2e/binance-test-tx-middleware' + +// Events +import './e2e/multiple-events-nd-tests' // Contracts -// import './e2e/coin-tests' -// import './e2e/ethcoin-tests' -// import './e2e/address-mapper-tests' -import './e2e/transfer-gateway-tests' +import './e2e/coin-tests' +import './e2e/ethcoin-tests' +import './e2e/address-mapper-tests' + +// TODO: Re-enable this once e2e test for oracle able to ping local ganache +// import './e2e/transfer-gateway-tests' // TODO: Re-enable once this is updated to DPOSv2 //import './e2e/dpos-tests' -// // Weave Blueprint Contract -// import './e2e/contract-tests' +// Weave Blueprint Contract +import './e2e/contract-tests' -// // Simple Store Contract -// import './e2e/evm-contract-tests' +// Simple Store Contract +import './e2e/evm-contract-tests' From eb8c5d4bd00b1a7ef0ffeab2e00d0ddc52b27303 Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Mon, 23 Sep 2019 16:15:50 -0300 Subject: [PATCH 09/10] Byte and ABI loading from e2e/artifacts --- src/tests/e2e/client-evm-event-tests-2.ts | 1 - src/tests/e2e/client-test-tx-cache.ts | 5 +-- src/tests/e2e/client-test-tx-middleware.ts | 9 ++--- src/tests/e2e/loom-provider-eth-filters.ts | 5 +-- src/tests/e2e/loom-provider-eth-get-logs.ts | 5 +-- src/tests/e2e/loom-provider-subscribe.ts | 5 +-- src/tests/e2e/loom-provider-tests.ts | 18 +++++----- .../loom-provider-web3-middlewares-tests.ts | 35 +++---------------- src/tests/e2e/loom-provider-web3-tests.ts | 35 +++---------------- src/tests/e2e/tron-test-tx-middleware.ts | 2 +- 10 files changed, 37 insertions(+), 83 deletions(-) diff --git a/src/tests/e2e/client-evm-event-tests-2.ts b/src/tests/e2e/client-evm-event-tests-2.ts index f4471a7b..6cb49c83 100644 --- a/src/tests/e2e/client-evm-event-tests-2.ts +++ b/src/tests/e2e/client-evm-event-tests-2.ts @@ -9,7 +9,6 @@ import { bufferToProtobufBytes } from '../../crypto-utils' import { Address, LocalAddress } from '../../address' import { createDefaultTxMiddleware } from '../../helpers' -// Get JSON truffle artifact const SimpleStore = require('./truffle-artifacts/SimpleStore2.json') const callTransactionAsync = async ( diff --git a/src/tests/e2e/client-test-tx-cache.ts b/src/tests/e2e/client-test-tx-cache.ts index 478e6dcb..336f8ce6 100644 --- a/src/tests/e2e/client-test-tx-cache.ts +++ b/src/tests/e2e/client-test-tx-cache.ts @@ -16,7 +16,8 @@ import { deployContract } from '../evm-helpers' import { bufferToProtobufBytes } from '../../crypto-utils' import { Address, LocalAddress } from '../../address' import { sleep } from '../../helpers' -import { SimpleStore3 } from '../contracts_bytecode' + +const SimpleStore = require('./artifacts/SimpleStore3.json') async function deploySimpleStoreContract(): Promise
{ let privateKey = CryptoUtils.generatePrivateKey() @@ -29,7 +30,7 @@ async function deploySimpleStoreContract(): Promise
{ const loomProvider = new LoomProvider(client, privateKey) // Deploy - const result = await deployContract(loomProvider, SimpleStore3) + const result = await deployContract(loomProvider, SimpleStore.bytecode) contractAddress = new Address('default', LocalAddress.fromHexString(result.contractAddress)) } catch (err) { throw err diff --git a/src/tests/e2e/client-test-tx-middleware.ts b/src/tests/e2e/client-test-tx-middleware.ts index 4f73fbfb..fbf9e1f0 100644 --- a/src/tests/e2e/client-test-tx-middleware.ts +++ b/src/tests/e2e/client-test-tx-middleware.ts @@ -16,7 +16,8 @@ import { createDefaultTxMiddleware } from '../../helpers' import { EthersSigner, getJsonRPCSignerAsync } from '../../solidity-helpers' import { createTestHttpClient } from '../helpers' import { AddressMapper, Coin } from '../../contracts' -import { SimpleStore } from '../contracts_bytecode' + +const SimpleStore = require('./artifacts/SimpleStore.json') // import Web3 from 'web3' const Web3 = require('web3') @@ -51,14 +52,14 @@ async function bootstrapTest( // Create LoomProvider instance const loomProvider = new LoomProvider(client, privKey) - const ABI = [] + const ABI = SimpleStore.abi // Deploy the contract using loom provider - const result = await deployContract(loomProvider, SimpleStore) + const result = await deployContract(loomProvider, SimpleStore.bytecode) // Instantiate Contract using web3 const web3 = new Web3(loomProvider) - const contract = new web3.eth.Contract(ABI, result.contractAddress, { + const contract = new web3.eth.Contract(SimpleStore.abi, result.contractAddress, { from: LocalAddress.fromPublicKey(pubKey).toString() }) diff --git a/src/tests/e2e/loom-provider-eth-filters.ts b/src/tests/e2e/loom-provider-eth-filters.ts index 85644eb8..5c3098d4 100644 --- a/src/tests/e2e/loom-provider-eth-filters.ts +++ b/src/tests/e2e/loom-provider-eth-filters.ts @@ -4,7 +4,8 @@ import { CryptoUtils } from '../../index' import { createTestClient, execAndWaitForMillisecondsAsync } from '../helpers' import { LoomProvider } from '../../loom-provider' import { deployContract } from '../evm-helpers' -import { SimpleStore } from '../contracts_bytecode' + +const SimpleStore = require('./artifacts/SimpleStore.json') test('LoomProvider + Filters', async t => { let client @@ -15,7 +16,7 @@ test('LoomProvider + Filters', async t => { client.on('error', msg => console.error('Error on client:', msg)) const loomProvider = new LoomProvider(client, privKey) - await deployContract(loomProvider, SimpleStore) + await deployContract(loomProvider, SimpleStore.bytecode) // Transaction receipt in order to obtain the topic of the event NewValueSet const ethNewFilterResult = await execAndWaitForMillisecondsAsync( diff --git a/src/tests/e2e/loom-provider-eth-get-logs.ts b/src/tests/e2e/loom-provider-eth-get-logs.ts index 55f0dedb..63cb16a3 100644 --- a/src/tests/e2e/loom-provider-eth-get-logs.ts +++ b/src/tests/e2e/loom-provider-eth-get-logs.ts @@ -5,10 +5,11 @@ import { createTestClient, execAndWaitForMillisecondsAsync } from '../helpers' import { LoomProvider } from '../../loom-provider' import { deployContract } from '../evm-helpers' import { numberToHex } from '../../crypto-utils' -import { SimpleStore } from '../contracts_bytecode' + +const SimpleStore = require('./artifacts/SimpleStore.json') async function newTransactionToSetState(loomProvider: LoomProvider, fromAddr: string) { - const contractDeployResult = await deployContract(loomProvider, SimpleStore) + const contractDeployResult = await deployContract(loomProvider, SimpleStore.bytecode) const contractAddress = contractDeployResult.contractAddress // Send transaction to function set in order dispatch event NewValueSet diff --git a/src/tests/e2e/loom-provider-subscribe.ts b/src/tests/e2e/loom-provider-subscribe.ts index 67c16deb..2f52a29b 100644 --- a/src/tests/e2e/loom-provider-subscribe.ts +++ b/src/tests/e2e/loom-provider-subscribe.ts @@ -4,7 +4,8 @@ import { LocalAddress, CryptoUtils } from '../../index' import { createTestClient, execAndWaitForMillisecondsAsync } from '../helpers' import { LoomProvider } from '../../loom-provider' import { deployContract } from '../evm-helpers' -import { SimpleStore } from '../contracts_bytecode' + +const SimpleStore = require('./artifacts/SimpleStore.json') test('LoomProvider + Subscribe', async t => { let client @@ -17,7 +18,7 @@ test('LoomProvider + Subscribe', async t => { ).toString() const loomProvider = new LoomProvider(client, privKey) - const contractDeployResult = await deployContract(loomProvider, SimpleStore) + await deployContract(loomProvider, SimpleStore.bytecode) const id = 1 const ethSubscribeNewHardsResult = await execAndWaitForMillisecondsAsync( diff --git a/src/tests/e2e/loom-provider-tests.ts b/src/tests/e2e/loom-provider-tests.ts index efebb263..df8334cc 100644 --- a/src/tests/e2e/loom-provider-tests.ts +++ b/src/tests/e2e/loom-provider-tests.ts @@ -2,17 +2,14 @@ import test from 'tape' import BN from 'bn.js' import { LocalAddress, CryptoUtils } from '../../index' -import { - createTestClient, - execAndWaitForMillisecondsAsync, - waitForMillisecondsAsync -} from '../helpers' +import { createTestClient, execAndWaitForMillisecondsAsync } from '../helpers' import { LoomProvider } from '../../loom-provider' import { deployContract } from '../evm-helpers' -import { ecrecover, privateToPublic, fromRpcSig, toBuffer } from 'ethereumjs-util' +import { ecrecover, privateToPublic, fromRpcSig } from 'ethereumjs-util' import { soliditySha3 } from '../../solidity-helpers' import { bytesToHexAddr } from '../../crypto-utils' -import { SimpleStore } from '../contracts_bytecode' + +const SimpleStore = require('./artifacts/SimpleStore.json') const newContractAndClient = async () => { const privKey = CryptoUtils.generatePrivateKey() @@ -20,11 +17,14 @@ const newContractAndClient = async () => { const from = LocalAddress.fromPublicKey(CryptoUtils.publicKeyFromPrivateKey(privKey)).toString() const loomProvider = new LoomProvider(client, privKey) - const { contractAddress, transactionHash } = await deployContract(loomProvider, SimpleStore) + const { contractAddress, transactionHash } = await deployContract( + loomProvider, + SimpleStore.bytecode + ) client.on('error', msg => console.error('Error on client:', msg)) - return { privKey, client, contractData, contractAddress, transactionHash, from, loomProvider } + return { privKey, client, contractAddress, transactionHash, from, loomProvider } } test('LoomProvider method eth_sign', async t => { diff --git a/src/tests/e2e/loom-provider-web3-middlewares-tests.ts b/src/tests/e2e/loom-provider-web3-middlewares-tests.ts index b3bbb2c9..6a0f3841 100644 --- a/src/tests/e2e/loom-provider-web3-middlewares-tests.ts +++ b/src/tests/e2e/loom-provider-web3-middlewares-tests.ts @@ -8,7 +8,8 @@ import { deployContract } from '../evm-helpers' import { SignedTxMiddleware } from '../../middleware' import { ITxMiddlewareHandler } from '../../client' import { NonceTx } from '../../proto/loom_pb' -import { SimpleStore } from '../contracts_bytecode' + +const SimpleStore = require('./artifacts/SimpleStore.json') // import Web3 from 'web3' const Web3 = require('web3') @@ -53,35 +54,9 @@ test('LoomProvider + Web3 + Middleware', async t => { client.on('error', console.log) - const ABI = [ - { - constant: false, - inputs: [{ name: '_value', type: 'uint256' }], - name: 'set', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function' - }, - { - constant: true, - inputs: [], - name: 'get', - outputs: [{ name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function' - }, - { inputs: [], payable: false, stateMutability: 'nonpayable', type: 'constructor' }, - { - anonymous: false, - inputs: [{ indexed: true, name: '_value', type: 'uint256' }], - name: 'NewValueSet', - type: 'event' - } - ] - - const result = await deployContract(loomProvider, SimpleStore) + const ABI = SimpleStore.abi + + const result = await deployContract(loomProvider, SimpleStore.bytecode) const contract = new web3.eth.Contract(ABI, result.contractAddress, { from }) diff --git a/src/tests/e2e/loom-provider-web3-tests.ts b/src/tests/e2e/loom-provider-web3-tests.ts index 0ef83008..636a9d04 100644 --- a/src/tests/e2e/loom-provider-web3-tests.ts +++ b/src/tests/e2e/loom-provider-web3-tests.ts @@ -9,7 +9,8 @@ import { deployContract } from '../evm-helpers' import { ecrecover, privateToPublic, fromRpcSig } from 'ethereumjs-util' import { soliditySha3 } from '../../solidity-helpers' import { bytesToHexAddr } from '../../crypto-utils' -import { SimpleStore } from '../contracts_bytecode' + +const SimpleStore = require('./artifacts/SimpleStore.json') // import Web3 from 'web3' const Web3 = require('web3') @@ -23,35 +24,9 @@ const newContractAndClient = async () => { client.on('error', console.log) - const ABI = [ - { - constant: false, - inputs: [{ name: '_value', type: 'uint256' }], - name: 'set', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function' - }, - { - constant: true, - inputs: [], - name: 'get', - outputs: [{ name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function' - }, - { inputs: [], payable: false, stateMutability: 'nonpayable', type: 'constructor' }, - { - anonymous: false, - inputs: [{ indexed: true, name: '_value', type: 'uint256' }], - name: 'NewValueSet', - type: 'event' - } - ] - - const result = await deployContract(loomProvider, SimpleStore) + const ABI = SimpleStore.abi + + const result = await deployContract(loomProvider, SimpleStore.bytecode) const contract = new web3.eth.Contract(ABI, result.contractAddress, { from }) diff --git a/src/tests/e2e/tron-test-tx-middleware.ts b/src/tests/e2e/tron-test-tx-middleware.ts index f9a96e97..da9b8fea 100644 --- a/src/tests/e2e/tron-test-tx-middleware.ts +++ b/src/tests/e2e/tron-test-tx-middleware.ts @@ -8,8 +8,8 @@ import { createDefaultTxMiddleware } from '../../helpers' import { TronWebSigner } from '../../tron-web-signer' import { createTestHttpClient } from '../helpers' import { AddressMapper } from '../../contracts' +import Web3 from 'web3' -const Web3 = require('web3') const TronWeb = require('tronweb') async function bootstrapTest( From 848694c5c4ac4104245231c6a59495ca6cfbc03c Mon Sep 17 00:00:00 2001 From: Eduardo Pereira Date: Mon, 23 Sep 2019 17:15:25 -0300 Subject: [PATCH 10/10] Fixed artifacts paths --- src/tests/e2e/binance-test-tx-middleware.ts | 2 +- src/tests/e2e/client-evm-event-tests-2.ts | 2 +- src/tests/e2e/client-evm-event-tests.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/e2e/binance-test-tx-middleware.ts b/src/tests/e2e/binance-test-tx-middleware.ts index 776b7c7d..9e93488e 100644 --- a/src/tests/e2e/binance-test-tx-middleware.ts +++ b/src/tests/e2e/binance-test-tx-middleware.ts @@ -16,7 +16,7 @@ import { AddressMapper } from '../../contracts' import Web3 from 'web3' // Get JSON truffle artifact -const SimpleStore = require('./truffle-artifacts/SimpleStore.json') +const SimpleStore = require('./artifacts/SimpleStore.json') async function bootstrapTest( createClient: () => Client diff --git a/src/tests/e2e/client-evm-event-tests-2.ts b/src/tests/e2e/client-evm-event-tests-2.ts index 6cb49c83..77f5c7ec 100644 --- a/src/tests/e2e/client-evm-event-tests-2.ts +++ b/src/tests/e2e/client-evm-event-tests-2.ts @@ -9,7 +9,7 @@ import { bufferToProtobufBytes } from '../../crypto-utils' import { Address, LocalAddress } from '../../address' import { createDefaultTxMiddleware } from '../../helpers' -const SimpleStore = require('./truffle-artifacts/SimpleStore2.json') +const SimpleStore = require('./artifacts/SimpleStore2.json') const callTransactionAsync = async ( client: Client, diff --git a/src/tests/e2e/client-evm-event-tests.ts b/src/tests/e2e/client-evm-event-tests.ts index 476be269..0a6676db 100644 --- a/src/tests/e2e/client-evm-event-tests.ts +++ b/src/tests/e2e/client-evm-event-tests.ts @@ -9,7 +9,7 @@ import { bufferToProtobufBytes } from '../../crypto-utils' import { Address, LocalAddress } from '../../address' // Get JSON truffle artifact -const SimpleStore = require('./truffle-artifacts/SimpleStore.json') +const SimpleStore = require('./artifacts/SimpleStore.json') test('Client EVM Event test', async t => { let client