From 5dd7877c1c0f71626bbc1662dc427a7510d2aaa6 Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Thu, 12 Mar 2020 15:00:29 -0300 Subject: [PATCH 01/11] swap,contracts/swap: added bounced cheque verification, replace mock with actual go sc binding --- contracts/swap/swap.go | 9 +++++ swap/protocol.go | 11 ++++++ swap/swap.go | 18 +++++++++ swap/swap_test.go | 86 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 124 insertions(+) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index fec90fd99a..9ebd477fab 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -91,6 +91,15 @@ func InstanceAt(address common.Address, backend chain.Backend) (Contract, error) return c, err } +// Bounced obtains if a cheque has been bounced previously of a contract at a specific address. +// Once it's bounced, it will not change it's state again, unless re deployed. +func Bounced(address common.Address, backend chain.Backend) (bool, error) { + //TODO: REPLACE THIS MOCK, WHEN SC ARE UPDATED + //TEST BOUNCED TRUE/FALSE + //TEST ERROR + return false, nil +} + // Withdraw withdraws amount from the chequebook and blocks until the transaction is mined func (s simpleContract) Withdraw(auth *bind.TransactOpts, amount *big.Int) (*types.Receipt, error) { tx, err := s.instance.Withdraw(auth, amount) diff --git a/swap/protocol.go b/swap/protocol.go index e9f067a323..820bd979e7 100644 --- a/swap/protocol.go +++ b/swap/protocol.go @@ -39,6 +39,9 @@ var ( // structure of the HandshakeMsg ErrInvalidHandshakeMsg = errors.New("invalid handshake message") + // ErrBouncedCheque is used when the peer has a bounced cheque and should be disconnected + ErrBouncedCheque = errors.New("bounced cheque detected") + // Spec is the swap protocol specification Spec = &protocols.Spec{ Name: "swap", @@ -116,6 +119,14 @@ func (s *Swap) run(p *p2p.Peer, rw p2p.MsgReadWriter) error { return err } + bounced, err := s.getBouncedCheque(context.Background(), response.ContractAddress) + if err != nil { + return err + } + if bounced { + return ErrBouncedCheque + } + swapPeer, err := s.addPeer(protoPeer, beneficiary, response.ContractAddress) if err != nil { return err diff --git a/swap/swap.go b/swap/swap.go index 0417a7294f..8b4f5d3b73 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -463,6 +463,14 @@ func (s *Swap) processAndVerifyCheque(cheque *Cheque, p *Peer) (*uint256.Uint256 return nil, err } + bounced, err := s.getBouncedCheque(context.Background(), s.owner.address) + if err != nil { + return nil, err + } + if bounced { + return nil, ErrBouncedCheque + } + lastCheque := p.getLastReceivedCheque() // TODO: there should probably be a lock here? @@ -583,6 +591,16 @@ func (s *Swap) getContractOwner(ctx context.Context, address common.Address) (co return contr.Issuer(nil) } +// getBouncedCheque retrieves if a bounced cheque exists at address from the blockchain +func (s *Swap) getBouncedCheque(ctx context.Context, address common.Address) (bool, error) { + bounced, err := contract.Bounced(address, s.backend) + if err != nil { + return false, err + } + + return bounced, nil +} + // promptDepositAmount blocks and asks the user how much ERC20 he wants to deposit func (s *Swap) promptDepositAmount() (*big.Int, error) { // retrieve available balance diff --git a/swap/swap_test.go b/swap/swap_test.go index 42f04caebb..531a19127b 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -1508,3 +1508,89 @@ func TestAvailableBalance(t *testing.T) { } } +func TestBouncedCheque(t *testing.T) { + // TODO: REPLACE WITH TEST + // ON CONNECT TO PEER NO BOUNCED CHEQUE + // ON CONNECT TO PEER BOUNCED CHEQUE + // ON RECEIVE EmitChequeMsg BOUNCED CHEQUE AFTER A COUPLE OF MESSAGES + // ON RECEIVE EmitChequeMsg NO BOUNCED CHEQUE AFTER A COUPLE OF MESSAGES + + testBackend := newTestBackend(t) + defer testBackend.Close() + swap, clean := newTestSwap(t, ownerKey, testBackend) + defer clean() + cleanup := setupContractTest() + defer cleanup() + + depositAmount := uint256.FromUint64(9000 * RetrieveRequestPrice) + + // deploy a chequebook + err := testDeploy(context.TODO(), swap, depositAmount) + if err != nil { + t.Fatal(err) + } + // create a peer + peer, err := swap.addPeer(newDummyPeerWithSpec(Spec).Peer, swap.owner.address, swap.GetParams().ContractAddress) + if err != nil { + t.Fatal(err) + } + + // verify that available balance equals depositAmount (we deposit during deployment) + availableBalance, err := swap.AvailableBalance() + if err != nil { + t.Fatal(err) + } + if !availableBalance.Equals(depositAmount) { + t.Fatalf("available balance not equal to deposited amount. available balance: %v, deposit amount: %v", availableBalance, depositAmount) + } + // withdraw 50 + withdrawAmount := uint256.FromUint64(50) + netDeposit, err := uint256.New().Sub(depositAmount, withdrawAmount) + if err != nil { + t.Fatal(err) + } + withdraw := withdrawAmount.Value() + + opts := bind.NewKeyedTransactor(swap.owner.privateKey) + opts.Context = context.TODO() + rec, err := swap.contract.Withdraw(opts, &withdraw) + if err != nil { + t.Fatal(err) + } + if rec.Status != types.ReceiptStatusSuccessful { + t.Fatal("Transaction reverted") + } + + // verify available balance + availableBalance, err = swap.AvailableBalance() + if err != nil { + t.Fatal(err) + } + if !availableBalance.Equals(netDeposit) { + t.Fatalf("available balance not equal to deposited minus withdraw. available balance: %v, deposit minus withdrawn: %v", availableBalance, netDeposit) + } + + // send a cheque worth 42 + chequeAmount := uint64(42) + // create a dummy peer. Note: the peer's contract address and the peers address are resp the swap contract and the swap owner + if err = peer.setBalance(int64(-chequeAmount)); err != nil { + t.Fatal(err) + } + if err = peer.sendCheque(); err != nil { + t.Fatal(err) + } + + availableBalance, err = swap.AvailableBalance() + if err != nil { + t.Fatal(err) + } + // verify available balance + expectedBalance, err := uint256.New().Sub(netDeposit, uint256.FromUint64(chequeAmount)) + if err != nil { + t.Fatal(err) + } + if !availableBalance.Equals(expectedBalance) { + t.Fatalf("available balance not equal to deposited minus withdraw. available balance: %v, expected balance: %v", availableBalance, expectedBalance) + } + +} From 0e369873180a9ffbed455f26159ca7f0bb3fd51d Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Thu, 12 Mar 2020 16:39:16 -0300 Subject: [PATCH 02/11] contracts/swap,swap,vendor: updates swap from go-sw3@v0.2.0 to go-sw3@v0.2.3 This update contains new bounced cheque functionality --- contracts/swap/factory.go | 2 +- contracts/swap/swap.go | 2 +- go.mod | 2 +- go.sum | 2 + swap/common_test.go | 2 +- swap/simulations_test.go | 2 +- swap/swap_test.go | 2 +- .../contracts-v0-2-0/erc20simpleswap/code.go | 22 ---------- .../simpleswapfactory/code.go | 22 ---------- .../contracts-v0-2-3/erc20simpleswap/code.go | 22 ++++++++++ .../erc20simpleswap/erc20simpleswap.go | 42 ++++++++++++++---- .../simpleswapfactory/code.go | 22 ++++++++++ .../simpleswapfactory/simpleswapfactory.go | 44 +++++++++++++++---- vendor/modules.txt | 6 +-- 14 files changed, 124 insertions(+), 70 deletions(-) delete mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/code.go delete mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory/code.go create mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/erc20simpleswap/code.go rename vendor/github.com/ethersphere/go-sw3/{contracts-v0-2-0 => contracts-v0-2-3}/erc20simpleswap/erc20simpleswap.go (93%) create mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory/code.go rename vendor/github.com/ethersphere/go-sw3/{contracts-v0-2-0 => contracts-v0-2-3}/simpleswapfactory/simpleswapfactory.go (89%) diff --git a/contracts/swap/factory.go b/contracts/swap/factory.go index 38f399d96a..a9f86a3b76 100644 --- a/contracts/swap/factory.go +++ b/contracts/swap/factory.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - chequebookFactory "github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory" + chequebookFactory "github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory" "github.com/ethersphere/swarm/swap/chain" ) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index 9ebd477fab..10de3f12fb 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -26,7 +26,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - contract "github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap" + contract "github.com/ethersphere/go-sw3/contracts-v0-2-3/erc20simpleswap" "github.com/ethersphere/swarm/swap/chain" "github.com/ethersphere/swarm/uint256" ) diff --git a/go.mod b/go.mod index a64125cf9a..b557d5c1fe 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect github.com/ethereum/go-ethereum v1.9.2 - github.com/ethersphere/go-sw3 v0.2.1 + github.com/ethersphere/go-sw3 v0.2.3 github.com/fatih/color v1.7.0 // indirect github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc github.com/go-kit/kit v0.9.0 // indirect diff --git a/go.sum b/go.sum index 3f65912b67..598fb215ff 100644 --- a/go.sum +++ b/go.sum @@ -68,6 +68,8 @@ github.com/ethereum/go-ethereum v1.9.2 h1:RMIHDO/diqXEgORSVzYx8xW9x2+S32PoAX5lQw github.com/ethereum/go-ethereum v1.9.2/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= github.com/ethersphere/go-sw3 v0.2.1 h1:+i660uWzhRbT1YO7MAeuxzn+jUeYOTc8rGRVjsKaw+4= github.com/ethersphere/go-sw3 v0.2.1/go.mod h1:HukT0aZ6QdW/d7zuD/0g5xlw6ewu9QeqHojxLDsaERQ= +github.com/ethersphere/go-sw3 v0.2.3 h1:7fmXB26sDvwoWiQ2wA53x9GRhi5+hPn4mUTuClx7wPc= +github.com/ethersphere/go-sw3 v0.2.3/go.mod h1:HukT0aZ6QdW/d7zuD/0g5xlw6ewu9QeqHojxLDsaERQ= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= diff --git a/swap/common_test.go b/swap/common_test.go index 5eff2714e2..61c114f457 100644 --- a/swap/common_test.go +++ b/swap/common_test.go @@ -18,7 +18,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - contractFactory "github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory" + contractFactory "github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory" cswap "github.com/ethersphere/swarm/contracts/swap" "github.com/ethersphere/swarm/network" "github.com/ethersphere/swarm/p2p/protocols" diff --git a/swap/simulations_test.go b/swap/simulations_test.go index b9e5aec927..06b16b8c9f 100644 --- a/swap/simulations_test.go +++ b/swap/simulations_test.go @@ -42,7 +42,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/simulations" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" - contractFactory "github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory" + contractFactory "github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory" cswap "github.com/ethersphere/swarm/contracts/swap" "github.com/ethersphere/swarm/network/simulation" "github.com/ethersphere/swarm/p2p/protocols" diff --git a/swap/swap_test.go b/swap/swap_test.go index 531a19127b..d72ad63237 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -43,7 +43,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/rpc" - contractFactory "github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory" + contractFactory "github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory" cswap "github.com/ethersphere/swarm/contracts/swap" "github.com/ethersphere/swarm/p2p/protocols" "github.com/ethersphere/swarm/state" diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/code.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/code.go deleted file mode 100644 index 7401c1e6a5..0000000000 --- a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/code.go +++ /dev/null @@ -1,22 +0,0 @@ - // Copyright 2019 The Swarm Authors - // This file is part of the Swarm library. - // - // The Swarm library is free software: you can redistribute it and/or modify - // it under the terms of the GNU Lesser General Public License as published by - // the Free Software Foundation, either version 3 of the License, or - // (at your option) any later version. - // - // The Swarm library is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - // GNU Lesser General Public License for more details. - // - // You should have received a copy of the GNU Lesser General Public License - // along with the Swarm library. If not, see . - // - // Code generated - DO NOT EDIT. - // This file was autogenerated with 'npm run abigen' from ethersphere/swap-swear-and-swindle and any manual changes will be lost. - package erc20simpleswap - - // ERC20SimpleSwapDeployedCode is the bytecode ERC20SimpleSwap will have after deployment - const ERC20SimpleSwapDeployedCode = "0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032" diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory/code.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory/code.go deleted file mode 100644 index f4b154cda1..0000000000 --- a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory/code.go +++ /dev/null @@ -1,22 +0,0 @@ - // Copyright 2019 The Swarm Authors - // This file is part of the Swarm library. - // - // The Swarm library is free software: you can redistribute it and/or modify - // it under the terms of the GNU Lesser General Public License as published by - // the Free Software Foundation, either version 3 of the License, or - // (at your option) any later version. - // - // The Swarm library is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - // GNU Lesser General Public License for more details. - // - // You should have received a copy of the GNU Lesser General Public License - // along with the Swarm library. If not, see . - // - // Code generated - DO NOT EDIT. - // This file was autogenerated with 'npm run abigen' from ethersphere/swap-swear-and-swindle and any manual changes will be lost. - package simpleswapfactory - - // SimpleSwapFactoryDeployedCode is the bytecode SimpleSwapFactory will have after deployment - const SimpleSwapFactoryDeployedCode = "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b611610806101c28339019056fe608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032a265627a7a7231582074f28023ea8adc36d5f6aac79fa6353a114852f91b58f3e8b0dbf1b481c203e364736f6c634300050d0032" diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/erc20simpleswap/code.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/erc20simpleswap/code.go new file mode 100644 index 0000000000..f6595169af --- /dev/null +++ b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/erc20simpleswap/code.go @@ -0,0 +1,22 @@ + // Copyright 2019 The Swarm Authors + // This file is part of the Swarm library. + // + // The Swarm library is free software: you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as published by + // the Free Software Foundation, either version 3 of the License, or + // (at your option) any later version. + // + // The Swarm library is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public License + // along with the Swarm library. If not, see . + // + // Code generated - DO NOT EDIT. + // This file was autogenerated with 'npm run abigen' from ethersphere/swap-swear-and-swindle and any manual changes will be lost. + package erc20simpleswap + + // ERC20SimpleSwapDeployedCode is the bytecode ERC20SimpleSwap will have after deployment + const ERC20SimpleSwapDeployedCode = "0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063b6343b0d116100a2578063b7ec1a3311610071578063b7ec1a331461049e578063c76a4d31146104a6578063d4c9a8e8146104cc578063e0bcf13a14610585578063fc0c546a1461058d57610116565b8063b6343b0d14610402578063b648b4171461044e578063b69ef8a81461046a578063b77703501461047257610116565b80631d143848116100e95780631d143848146103495780632e1a7d4d1461036d578063338f3fed1461038a57806381f03fcb146103b6578063946f46a2146103dc57610116565b80630d5f26591461011b57806312101021146101d65780631357e1dc146101f05780631633fb1d146101f8575b600080fd5b6101d46004803603606081101561013157600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561016057600080fd5b82018360208201111561017257600080fd5b803590602001918460018302840111600160201b8311171561019357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610595945050505050565b005b6101de6105a8565b60408051918252519081900360200190f35b6101de6105ae565b6101d4600480360360c081101561020e57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561024857600080fd5b82018360208201111561025a57600080fd5b803590602001918460018302840111600160201b8311171561027b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102d557600080fd5b8201836020820111156102e757600080fd5b803590602001918460018302840111600160201b8311171561030857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105b4945050505050565b61035161062e565b604080516001600160a01b039092168252519081900360200190f35b6101d46004803603602081101561038357600080fd5b503561063d565b6101d4600480360360408110156103a057600080fd5b506001600160a01b03813516906020013561079e565b6101de600480360360208110156103cc57600080fd5b50356001600160a01b03166108dc565b6101d4600480360360208110156103f257600080fd5b50356001600160a01b03166108ee565b6104286004803603602081101561041857600080fd5b50356001600160a01b03166109d5565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6104566109fc565b604080519115158252519081900360200190f35b6101de610a0c565b6101d46004803603604081101561048857600080fd5b506001600160a01b038135169060200135610a88565b6101de610baa565b6101de600480360360208110156104bc57600080fd5b50356001600160a01b0316610bcb565b6101d4600480360360608110156104e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561051157600080fd5b82018360208201111561052357600080fd5b803590602001918460018302840111600160201b8311171561054457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610c02945050505050565b6101de610d15565b610351610d1b565b6105a3338484600085610d2a565b505050565b60005481565b60035481565b6105ca6105c4303387898761115c565b846111bd565b6001600160a01b0316866001600160a01b0316146106195760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6106268686868585610d2a565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b03163314610695576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b61069d610baa565b8111156106db5760405162461bcd60e51b815260040180806020018281038252602881526020018061157b6028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561073457600080fd5b505af1158015610748573d6000803e3d6000fd5b505050506040513d602081101561075e57600080fd5b505161079b5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107f6576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107fe610a0c565b600554610811908363ffffffff6111d816565b111561084e5760405162461bcd60e51b81526004018080602001828103825260348152602001806114b26034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610878908363ffffffff6111d816565b815560055461088d908363ffffffff6111d816565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b03811660009081526004602052604090206003810154421080159061091d5750600381015415155b6109585760405162461bcd60e51b81526004018080602001828103825260258152602001806115086025913960400191505060405180910390fd5b6001810154815461096e9163ffffffff61123216565b815560006003820155600181015460055461098e9163ffffffff61123216565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600654600160a01b900460ff1681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a5757600080fd5b505afa158015610a6b573d6000803e3d6000fd5b505050506040513d6020811015610a8157600080fd5b5051905090565b6006546001600160a01b03163314610ae0576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b385760405162461bcd60e51b81526004018080602001828103825260278152602001806115546027913960400191505060405180910390fd5b60008160020154600014610b50578160020154610b54565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610bc6600554610bba610a0c565b9063ffffffff61123216565b905090565b6001600160a01b038116600090815260046020526040812054610bfc90610bf0610baa565b9063ffffffff6111d816565b92915050565b6006546001600160a01b03163314610c5a576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c6e610c68308585611274565b826111bd565b6001600160a01b0316836001600160a01b031614610cbd5760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610dac57610d4a610c68308786611274565b6006546001600160a01b03908116911614610dac576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610dd690859063ffffffff61123216565b90506000610dec82610de789610bcb565b6112c5565b6001600160a01b03881660009081526004602052604081205491925090610e149083906112c5565b905084821015610e6b576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610eca576001600160a01b038816600090815260046020526040902054610e9a908263ffffffff61123216565b6001600160a01b038916600090815260046020526040902055600554610ec6908263ffffffff61123216565b6005555b6001600160a01b038816600090815260026020526040902054610ef3908363ffffffff6111d816565b6001600160a01b038916600090815260026020526040902055600354610f1f908363ffffffff6111d816565b6003556001546001600160a01b031663a9059cbb88610f44858963ffffffff61123216565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f9357600080fd5b505af1158015610fa7573d6000803e3d6000fd5b505050506040513d6020811015610fbd57600080fd5b5051610ffa5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b84156110bb576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561105457600080fd5b505af1158015611068573d6000803e3d6000fd5b505050506040513d602081101561107e57600080fd5b50516110bb5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611152576006805460ff60a01b1916600160a01b1790556040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b60006111d16111cb846112db565b8361132c565b9392505050565b6000828201838110156111d1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006111d183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061141a565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b60008183106112d457816111d1565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b6000815160411461133f57506000610bfc565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156113855760009350505050610bfc565b8060ff16601b1415801561139d57508060ff16601c14155b156113ae5760009350505050610bfc565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa158015611405573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600081848411156114a95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561146e578181015183820152602001611456565b50505050905090810190601f16801561149b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582066828f9746bfad86cee7036662102e93878ec986c0aba50cc9798c50a2a1c6cd64736f6c634300050f0032" diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/erc20simpleswap.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/erc20simpleswap/erc20simpleswap.go similarity index 93% rename from vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/erc20simpleswap.go rename to vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/erc20simpleswap/erc20simpleswap.go index 95ec9b2dd7..5b7779da95 100644 --- a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/erc20simpleswap.go +++ b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/erc20simpleswap/erc20simpleswap.go @@ -176,7 +176,7 @@ func (_Context *ContextTransactorRaw) Transact(opts *bind.TransactOpts, method s const ECDSAABI = "[]" // ECDSABin is the compiled bytecode used for deploying new contracts. -var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820872a175153bafae69ff9a23d9f9bb4a85e5703da816064f5d5ede3ecbb91b56564736f6c634300050d0032" +var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582080c675c91bdd0caa525eec9cee27ad4e6399122208a57e9617d9d6d83ebd26d364736f6c634300050f0032" // DeployECDSA deploys a new Ethereum contract, binding an instance of ECDSA to it. func DeployECDSA(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ECDSA, error) { @@ -338,7 +338,7 @@ func (_ECDSA *ECDSATransactorRaw) Transact(opts *bind.TransactOpts, method strin const ERC20ABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // ERC20Bin is the compiled bytecode used for deploying new contracts. -var ERC20Bin = "0x608060405261083b806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a0823114610149578063a457c2d71461016f578063a9059cbb1461019b578063dd62ed3e146101c757610088565b8063095ea7b31461008d57806318160ddd146100cd57806323b872dd146100e7578063395093511461011d575b600080fd5b6100b9600480360360408110156100a357600080fd5b506001600160a01b0381351690602001356101f5565b604080519115158252519081900360200190f35b6100d5610212565b60408051918252519081900360200190f35b6100b9600480360360608110156100fd57600080fd5b506001600160a01b03813581169160208101359091169060400135610218565b6100b96004803603604081101561013357600080fd5b506001600160a01b0381351690602001356102a5565b6100d56004803603602081101561015f57600080fd5b50356001600160a01b03166102f9565b6100b96004803603604081101561018557600080fd5b506001600160a01b038135169060200135610314565b6100b9600480360360408110156101b157600080fd5b506001600160a01b038135169060200135610382565b6100d5600480360360408110156101dd57600080fd5b506001600160a01b0381358116916020013516610396565b60006102096102026103c1565b84846103c5565b50600192915050565b60025490565b60006102258484846104b1565b61029b846102316103c1565b61029685604051806060016040528060288152602001610771602891396001600160a01b038a1660009081526001602052604081209061026f6103c1565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61060d16565b6103c5565b5060019392505050565b60006102096102b26103c1565b8461029685600160006102c36103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6106a416565b6001600160a01b031660009081526020819052604090205490565b60006102096103216103c1565b84610296856040518060600160405280602581526020016107e2602591396001600061034b6103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61060d16565b600061020961038f6103c1565b84846104b1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661040a5760405162461bcd60e51b81526004018080602001828103825260248152602001806107be6024913960400191505060405180910390fd5b6001600160a01b03821661044f5760405162461bcd60e51b81526004018080602001828103825260228152602001806107296022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166104f65760405162461bcd60e51b81526004018080602001828103825260258152602001806107996025913960400191505060405180910390fd5b6001600160a01b03821661053b5760405162461bcd60e51b81526004018080602001828103825260238152602001806107066023913960400191505060405180910390fd5b61057e8160405180606001604052806026815260200161074b602691396001600160a01b038616600090815260208190526040902054919063ffffffff61060d16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105b3908263ffffffff6106a416565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561069c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610661578181015183820152602001610649565b50505050905090810190601f16801561068e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156106fe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820e7920dfefc274a9bba653bb8a8dda9ad48643ad5bcf3e2bac0457e7caf286fe964736f6c634300050d0032" +var ERC20Bin = "0x608060405261083b806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a0823114610149578063a457c2d71461016f578063a9059cbb1461019b578063dd62ed3e146101c757610088565b8063095ea7b31461008d57806318160ddd146100cd57806323b872dd146100e7578063395093511461011d575b600080fd5b6100b9600480360360408110156100a357600080fd5b506001600160a01b0381351690602001356101f5565b604080519115158252519081900360200190f35b6100d5610212565b60408051918252519081900360200190f35b6100b9600480360360608110156100fd57600080fd5b506001600160a01b03813581169160208101359091169060400135610218565b6100b96004803603604081101561013357600080fd5b506001600160a01b0381351690602001356102a5565b6100d56004803603602081101561015f57600080fd5b50356001600160a01b03166102f9565b6100b96004803603604081101561018557600080fd5b506001600160a01b038135169060200135610314565b6100b9600480360360408110156101b157600080fd5b506001600160a01b038135169060200135610382565b6100d5600480360360408110156101dd57600080fd5b506001600160a01b0381358116916020013516610396565b60006102096102026103c1565b84846103c5565b50600192915050565b60025490565b60006102258484846104b1565b61029b846102316103c1565b61029685604051806060016040528060288152602001610771602891396001600160a01b038a1660009081526001602052604081209061026f6103c1565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61060d16565b6103c5565b5060019392505050565b60006102096102b26103c1565b8461029685600160006102c36103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6106a416565b6001600160a01b031660009081526020819052604090205490565b60006102096103216103c1565b84610296856040518060600160405280602581526020016107e2602591396001600061034b6103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61060d16565b600061020961038f6103c1565b84846104b1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661040a5760405162461bcd60e51b81526004018080602001828103825260248152602001806107be6024913960400191505060405180910390fd5b6001600160a01b03821661044f5760405162461bcd60e51b81526004018080602001828103825260228152602001806107296022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166104f65760405162461bcd60e51b81526004018080602001828103825260258152602001806107996025913960400191505060405180910390fd5b6001600160a01b03821661053b5760405162461bcd60e51b81526004018080602001828103825260238152602001806107066023913960400191505060405180910390fd5b61057e8160405180606001604052806026815260200161074b602691396001600160a01b038616600090815260208190526040902054919063ffffffff61060d16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105b3908263ffffffff6106a416565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561069c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610661578181015183820152602001610649565b50505050905090810190601f16801561068e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156106fe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820b519ddff223cfcef943a5f0529d5527214a7e7f3b8574f2550eba95dec7393b464736f6c634300050f0032" // DeployERC20 deploys a new Ethereum contract, binding an instance of ERC20 to it. func DeployERC20(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ERC20, error) { @@ -989,7 +989,7 @@ func (_ERC20 *ERC20Filterer) ParseTransfer(log types.Log) (*ERC20Transfer, error const ERC20MintableABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"MinterAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"MinterRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isMinter\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // ERC20MintableBin is the compiled bytecode used for deploying new contracts. -var ERC20MintableBin = "0x60806040526100266100186001600160e01b0361002b16565b6001600160e01b0361002f16565b6101a3565b3390565b61004781600361007e60201b610a6e1790919060201c565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b61009182826001600160e01b0361012216565b156100fd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b038216610183576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610eb16022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610cff806101b26000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146101c757806398650275146101ef578063a457c2d7146101f7578063a9059cbb14610223578063aa271e1a1461024f578063dd62ed3e14610275576100b4565b8063095ea7b3146100b957806318160ddd146100f957806323b872dd14610113578063395093511461014957806340c10f191461017557806370a08231146101a1575b600080fd5b6100e5600480360360408110156100cf57600080fd5b506001600160a01b0381351690602001356102a3565b604080519115158252519081900360200190f35b6101016102c0565b60408051918252519081900360200190f35b6100e56004803603606081101561012957600080fd5b506001600160a01b038135811691602081013590911690604001356102c6565b6100e56004803603604081101561015f57600080fd5b506001600160a01b038135169060200135610353565b6100e56004803603604081101561018b57600080fd5b506001600160a01b0381351690602001356103a7565b610101600480360360208110156101b757600080fd5b50356001600160a01b03166103fe565b6101ed600480360360208110156101dd57600080fd5b50356001600160a01b0316610419565b005b6101ed61046b565b6100e56004803603604081101561020d57600080fd5b506001600160a01b03813516906020013561047d565b6100e56004803603604081101561023957600080fd5b506001600160a01b0381351690602001356104eb565b6100e56004803603602081101561026557600080fd5b50356001600160a01b03166104ff565b6101016004803603604081101561028b57600080fd5b506001600160a01b0381358116916020013516610518565b60006102b76102b0610543565b8484610547565b50600192915050565b60025490565b60006102d3848484610633565b610349846102df610543565b61034485604051806060016040528060288152602001610c13602891396001600160a01b038a1660009081526001602052604081209061031d610543565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61078f16565b610547565b5060019392505050565b60006102b7610360610543565b846103448560016000610371610543565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61082616565b60006103b96103b4610543565b6104ff565b6103f45760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b6102b78383610887565b6001600160a01b031660009081526020819052604090205490565b6104246103b4610543565b61045f5760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b61046881610977565b50565b61047b610476610543565b6109bf565b565b60006102b761048a610543565b8461034485604051806060016040528060258152602001610ca660259139600160006104b4610543565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61078f16565b60006102b76104f8610543565b8484610633565b600061051260038363ffffffff610a0716565b92915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661058c5760405162461bcd60e51b8152600401808060200182810382526024815260200180610c826024913960400191505060405180910390fd5b6001600160a01b0382166105d15760405162461bcd60e51b8152600401808060200182810382526022815260200180610b7a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106785760405162461bcd60e51b8152600401808060200182810382526025815260200180610c5d6025913960400191505060405180910390fd5b6001600160a01b0382166106bd5760405162461bcd60e51b8152600401808060200182810382526023815260200180610b576023913960400191505060405180910390fd5b61070081604051806060016040528060268152602001610b9c602691396001600160a01b038616600090815260208190526040902054919063ffffffff61078f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610735908263ffffffff61082616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561081e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107e35781810151838201526020016107cb565b50505050905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610880576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166108e2576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6002546108f5908263ffffffff61082616565b6002556001600160a01b038216600090815260208190526040902054610921908263ffffffff61082616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b61098860038263ffffffff610a6e16565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6109d060038263ffffffff610aef16565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60006001600160a01b038216610a4e5760405162461bcd60e51b8152600401808060200182810382526022815260200180610c3b6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610a788282610a07565b15610aca576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b610af98282610a07565b610b345760405162461bcd60e51b8152600401808060200182810382526021815260200180610bf26021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158205d954def161c622e62537fbcd64f678436a7ae5e2c2484dfd0bd5c4448bff59864736f6c634300050d0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" +var ERC20MintableBin = "0x60806040526100266100186001600160e01b0361002b16565b6001600160e01b0361002f16565b6101a3565b3390565b61004781600361007e60201b610a6e1790919060201c565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b61009182826001600160e01b0361012216565b156100fd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b038216610183576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610eb16022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610cff806101b26000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146101c757806398650275146101ef578063a457c2d7146101f7578063a9059cbb14610223578063aa271e1a1461024f578063dd62ed3e14610275576100b4565b8063095ea7b3146100b957806318160ddd146100f957806323b872dd14610113578063395093511461014957806340c10f191461017557806370a08231146101a1575b600080fd5b6100e5600480360360408110156100cf57600080fd5b506001600160a01b0381351690602001356102a3565b604080519115158252519081900360200190f35b6101016102c0565b60408051918252519081900360200190f35b6100e56004803603606081101561012957600080fd5b506001600160a01b038135811691602081013590911690604001356102c6565b6100e56004803603604081101561015f57600080fd5b506001600160a01b038135169060200135610353565b6100e56004803603604081101561018b57600080fd5b506001600160a01b0381351690602001356103a7565b610101600480360360208110156101b757600080fd5b50356001600160a01b03166103fe565b6101ed600480360360208110156101dd57600080fd5b50356001600160a01b0316610419565b005b6101ed61046b565b6100e56004803603604081101561020d57600080fd5b506001600160a01b03813516906020013561047d565b6100e56004803603604081101561023957600080fd5b506001600160a01b0381351690602001356104eb565b6100e56004803603602081101561026557600080fd5b50356001600160a01b03166104ff565b6101016004803603604081101561028b57600080fd5b506001600160a01b0381358116916020013516610518565b60006102b76102b0610543565b8484610547565b50600192915050565b60025490565b60006102d3848484610633565b610349846102df610543565b61034485604051806060016040528060288152602001610c13602891396001600160a01b038a1660009081526001602052604081209061031d610543565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61078f16565b610547565b5060019392505050565b60006102b7610360610543565b846103448560016000610371610543565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61082616565b60006103b96103b4610543565b6104ff565b6103f45760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b6102b78383610887565b6001600160a01b031660009081526020819052604090205490565b6104246103b4610543565b61045f5760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b61046881610977565b50565b61047b610476610543565b6109bf565b565b60006102b761048a610543565b8461034485604051806060016040528060258152602001610ca660259139600160006104b4610543565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61078f16565b60006102b76104f8610543565b8484610633565b600061051260038363ffffffff610a0716565b92915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661058c5760405162461bcd60e51b8152600401808060200182810382526024815260200180610c826024913960400191505060405180910390fd5b6001600160a01b0382166105d15760405162461bcd60e51b8152600401808060200182810382526022815260200180610b7a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106785760405162461bcd60e51b8152600401808060200182810382526025815260200180610c5d6025913960400191505060405180910390fd5b6001600160a01b0382166106bd5760405162461bcd60e51b8152600401808060200182810382526023815260200180610b576023913960400191505060405180910390fd5b61070081604051806060016040528060268152602001610b9c602691396001600160a01b038616600090815260208190526040902054919063ffffffff61078f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610735908263ffffffff61082616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561081e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107e35781810151838201526020016107cb565b50505050905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610880576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166108e2576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6002546108f5908263ffffffff61082616565b6002556001600160a01b038216600090815260208190526040902054610921908263ffffffff61082616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b61098860038263ffffffff610a6e16565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6109d060038263ffffffff610aef16565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60006001600160a01b038216610a4e5760405162461bcd60e51b8152600401808060200182810382526022815260200180610c3b6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610a788282610a07565b15610aca576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b610af98282610a07565b610b345760405162461bcd60e51b8152600401808060200182810382526021815260200180610bf26021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158209e6bb74f71aac35e0171f92a355cd3716e63ca45ab0d56d6a85691a5f4a710c064736f6c634300050f0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" // DeployERC20Mintable deploys a new Ethereum contract, binding an instance of ERC20Mintable to it. func DeployERC20Mintable(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ERC20Mintable, error) { @@ -2012,10 +2012,10 @@ func (_ERC20Mintable *ERC20MintableFilterer) ParseTransfer(log types.Log) (*ERC2 } // ERC20SimpleSwapABI is the input ABI used to generate the binding from. -const ERC20SimpleSwapABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_issuer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_defaultHardDepositTimeout\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"ChequeBounced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalPayout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callerPayout\",\"type\":\"uint256\"}],\"name\":\"ChequeCashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"HardDepositAmountChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"HardDepositDecreasePrepared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"}],\"name\":\"HardDepositTimeoutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callerPayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"issuerSig\",\"type\":\"bytes\"}],\"name\":\"cashCheque\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"issuerSig\",\"type\":\"bytes\"}],\"name\":\"cashChequeBeneficiary\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"decreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"defaultHardDepositTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"hardDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"canBeDecreasedAt\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"increaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"issuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"liquidBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"liquidBalanceFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"paidOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"prepareDecreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"hardDepositTimeout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"}],\"name\":\"setCustomHardDepositTimeout\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contractERC20\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalHardDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalPaidOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" +const ERC20SimpleSwapABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_issuer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_defaultHardDepositTimeout\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"ChequeBounced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalPayout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callerPayout\",\"type\":\"uint256\"}],\"name\":\"ChequeCashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"HardDepositAmountChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"HardDepositDecreasePrepared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"}],\"name\":\"HardDepositTimeoutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"bounced\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callerPayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"issuerSig\",\"type\":\"bytes\"}],\"name\":\"cashCheque\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"issuerSig\",\"type\":\"bytes\"}],\"name\":\"cashChequeBeneficiary\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"decreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"defaultHardDepositTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"hardDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"canBeDecreasedAt\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"increaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"issuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"liquidBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"liquidBalanceFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"paidOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"prepareDecreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"hardDepositTimeout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"}],\"name\":\"setCustomHardDepositTimeout\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contractERC20\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalHardDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalPaidOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // ERC20SimpleSwapBin is the compiled bytecode used for deploying new contracts. -var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032" +var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b5060405161165a38038061165a8339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b03199182161790915560018054939094169216919091179091556000556115d7806100836000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063b6343b0d116100a2578063b7ec1a3311610071578063b7ec1a331461049e578063c76a4d31146104a6578063d4c9a8e8146104cc578063e0bcf13a14610585578063fc0c546a1461058d57610116565b8063b6343b0d14610402578063b648b4171461044e578063b69ef8a81461046a578063b77703501461047257610116565b80631d143848116100e95780631d143848146103495780632e1a7d4d1461036d578063338f3fed1461038a57806381f03fcb146103b6578063946f46a2146103dc57610116565b80630d5f26591461011b57806312101021146101d65780631357e1dc146101f05780631633fb1d146101f8575b600080fd5b6101d46004803603606081101561013157600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561016057600080fd5b82018360208201111561017257600080fd5b803590602001918460018302840111600160201b8311171561019357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610595945050505050565b005b6101de6105a8565b60408051918252519081900360200190f35b6101de6105ae565b6101d4600480360360c081101561020e57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561024857600080fd5b82018360208201111561025a57600080fd5b803590602001918460018302840111600160201b8311171561027b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102d557600080fd5b8201836020820111156102e757600080fd5b803590602001918460018302840111600160201b8311171561030857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105b4945050505050565b61035161062e565b604080516001600160a01b039092168252519081900360200190f35b6101d46004803603602081101561038357600080fd5b503561063d565b6101d4600480360360408110156103a057600080fd5b506001600160a01b03813516906020013561079e565b6101de600480360360208110156103cc57600080fd5b50356001600160a01b03166108dc565b6101d4600480360360208110156103f257600080fd5b50356001600160a01b03166108ee565b6104286004803603602081101561041857600080fd5b50356001600160a01b03166109d5565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6104566109fc565b604080519115158252519081900360200190f35b6101de610a0c565b6101d46004803603604081101561048857600080fd5b506001600160a01b038135169060200135610a88565b6101de610baa565b6101de600480360360208110156104bc57600080fd5b50356001600160a01b0316610bcb565b6101d4600480360360608110156104e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561051157600080fd5b82018360208201111561052357600080fd5b803590602001918460018302840111600160201b8311171561054457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610c02945050505050565b6101de610d15565b610351610d1b565b6105a3338484600085610d2a565b505050565b60005481565b60035481565b6105ca6105c4303387898761115c565b846111bd565b6001600160a01b0316866001600160a01b0316146106195760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6106268686868585610d2a565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b03163314610695576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b61069d610baa565b8111156106db5760405162461bcd60e51b815260040180806020018281038252602881526020018061157b6028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561073457600080fd5b505af1158015610748573d6000803e3d6000fd5b505050506040513d602081101561075e57600080fd5b505161079b5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107f6576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107fe610a0c565b600554610811908363ffffffff6111d816565b111561084e5760405162461bcd60e51b81526004018080602001828103825260348152602001806114b26034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610878908363ffffffff6111d816565b815560055461088d908363ffffffff6111d816565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b03811660009081526004602052604090206003810154421080159061091d5750600381015415155b6109585760405162461bcd60e51b81526004018080602001828103825260258152602001806115086025913960400191505060405180910390fd5b6001810154815461096e9163ffffffff61123216565b815560006003820155600181015460055461098e9163ffffffff61123216565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600654600160a01b900460ff1681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a5757600080fd5b505afa158015610a6b573d6000803e3d6000fd5b505050506040513d6020811015610a8157600080fd5b5051905090565b6006546001600160a01b03163314610ae0576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b385760405162461bcd60e51b81526004018080602001828103825260278152602001806115546027913960400191505060405180910390fd5b60008160020154600014610b50578160020154610b54565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610bc6600554610bba610a0c565b9063ffffffff61123216565b905090565b6001600160a01b038116600090815260046020526040812054610bfc90610bf0610baa565b9063ffffffff6111d816565b92915050565b6006546001600160a01b03163314610c5a576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c6e610c68308585611274565b826111bd565b6001600160a01b0316836001600160a01b031614610cbd5760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610dac57610d4a610c68308786611274565b6006546001600160a01b03908116911614610dac576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610dd690859063ffffffff61123216565b90506000610dec82610de789610bcb565b6112c5565b6001600160a01b03881660009081526004602052604081205491925090610e149083906112c5565b905084821015610e6b576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610eca576001600160a01b038816600090815260046020526040902054610e9a908263ffffffff61123216565b6001600160a01b038916600090815260046020526040902055600554610ec6908263ffffffff61123216565b6005555b6001600160a01b038816600090815260026020526040902054610ef3908363ffffffff6111d816565b6001600160a01b038916600090815260026020526040902055600354610f1f908363ffffffff6111d816565b6003556001546001600160a01b031663a9059cbb88610f44858963ffffffff61123216565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f9357600080fd5b505af1158015610fa7573d6000803e3d6000fd5b505050506040513d6020811015610fbd57600080fd5b5051610ffa5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b84156110bb576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561105457600080fd5b505af1158015611068573d6000803e3d6000fd5b505050506040513d602081101561107e57600080fd5b50516110bb5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611152576006805460ff60a01b1916600160a01b1790556040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b60006111d16111cb846112db565b8361132c565b9392505050565b6000828201838110156111d1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006111d183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061141a565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b60008183106112d457816111d1565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b6000815160411461133f57506000610bfc565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156113855760009350505050610bfc565b8060ff16601b1415801561139d57508060ff16601c14155b156113ae5760009350505050610bfc565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa158015611405573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600081848411156114a95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561146e578181015183820152602001611456565b50505050905090810190601f16801561149b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582066828f9746bfad86cee7036662102e93878ec986c0aba50cc9798c50a2a1c6cd64736f6c634300050f0032" // DeployERC20SimpleSwap deploys a new Ethereum contract, binding an instance of ERC20SimpleSwap to it. func DeployERC20SimpleSwap(auth *bind.TransactOpts, backend bind.ContractBackend, _issuer common.Address, _token common.Address, _defaultHardDepositTimeout *big.Int) (common.Address, *types.Transaction, *ERC20SimpleSwap, error) { @@ -2199,6 +2199,32 @@ func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Balance() (*big.Int, error return _ERC20SimpleSwap.Contract.Balance(&_ERC20SimpleSwap.CallOpts) } +// Bounced is a free data retrieval call binding the contract method 0xb648b417. +// +// Solidity: function bounced() constant returns(bool) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Bounced(opts *bind.CallOpts) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "bounced") + return *ret0, err +} + +// Bounced is a free data retrieval call binding the contract method 0xb648b417. +// +// Solidity: function bounced() constant returns(bool) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Bounced() (bool, error) { + return _ERC20SimpleSwap.Contract.Bounced(&_ERC20SimpleSwap.CallOpts) +} + +// Bounced is a free data retrieval call binding the contract method 0xb648b417. +// +// Solidity: function bounced() constant returns(bool) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Bounced() (bool, error) { + return _ERC20SimpleSwap.Contract.Bounced(&_ERC20SimpleSwap.CallOpts) +} + // DefaultHardDepositTimeout is a free data retrieval call binding the contract method 0x12101021. // // Solidity: function defaultHardDepositTimeout() constant returns(uint256) @@ -4055,7 +4081,7 @@ func (_IERC20 *IERC20Filterer) ParseTransfer(log types.Log) (*IERC20Transfer, er const MathABI = "[]" // MathBin is the compiled bytecode used for deploying new contracts. -var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820dd27f118e79de85d5f755c5a3bf6bac19388a29bf024ae4a936b3d02ec89c5c764736f6c634300050d0032" +var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820d81b4a69b9eb2dd426807b69288708d536fb3cd7231d1047d02b43da9561923c64736f6c634300050f0032" // DeployMath deploys a new Ethereum contract, binding an instance of Math to it. func DeployMath(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Math, error) { @@ -4716,7 +4742,7 @@ func (_MinterRole *MinterRoleFilterer) ParseMinterRemoved(log types.Log) (*Minte const RolesABI = "[]" // RolesBin is the compiled bytecode used for deploying new contracts. -var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582093431205522ed7cdc0c6ada062554f81ef4be833793063e8eeaeeaf10fe9b1e664736f6c634300050d0032" +var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820145d2af0e57b6186560c295a4cb410ff409e09e93215f83fc988830375c4077d64736f6c634300050f0032" // DeployRoles deploys a new Ethereum contract, binding an instance of Roles to it. func DeployRoles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Roles, error) { @@ -4878,7 +4904,7 @@ func (_Roles *RolesTransactorRaw) Transact(opts *bind.TransactOpts, method strin const SafeMathABI = "[]" // SafeMathBin is the compiled bytecode used for deploying new contracts. -var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820a40cac344427ea0c4f6bebf4c23c2a56e02a64c63860ffbd55a691451c32385e64736f6c634300050d0032" +var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820c76828b34b42d7658e28245385e4885df89f0ecdeaae2138fbacfcff0feceb6f64736f6c634300050f0032" // DeploySafeMath deploys a new Ethereum contract, binding an instance of SafeMath to it. func DeploySafeMath(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeMath, error) { diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory/code.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory/code.go new file mode 100644 index 0000000000..c26bd0a282 --- /dev/null +++ b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory/code.go @@ -0,0 +1,22 @@ + // Copyright 2019 The Swarm Authors + // This file is part of the Swarm library. + // + // The Swarm library is free software: you can redistribute it and/or modify + // it under the terms of the GNU Lesser General Public License as published by + // the Free Software Foundation, either version 3 of the License, or + // (at your option) any later version. + // + // The Swarm library is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU Lesser General Public License for more details. + // + // You should have received a copy of the GNU Lesser General Public License + // along with the Swarm library. If not, see . + // + // Code generated - DO NOT EDIT. + // This file was autogenerated with 'npm run abigen' from ethersphere/swap-swear-and-swindle and any manual changes will be lost. + package simpleswapfactory + + // SimpleSwapFactoryDeployedCode is the bytecode SimpleSwapFactory will have after deployment + const SimpleSwapFactoryDeployedCode = "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b61165a806101c28339019056fe608060405234801561001057600080fd5b5060405161165a38038061165a8339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b03199182161790915560018054939094169216919091179091556000556115d7806100836000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063b6343b0d116100a2578063b7ec1a3311610071578063b7ec1a331461049e578063c76a4d31146104a6578063d4c9a8e8146104cc578063e0bcf13a14610585578063fc0c546a1461058d57610116565b8063b6343b0d14610402578063b648b4171461044e578063b69ef8a81461046a578063b77703501461047257610116565b80631d143848116100e95780631d143848146103495780632e1a7d4d1461036d578063338f3fed1461038a57806381f03fcb146103b6578063946f46a2146103dc57610116565b80630d5f26591461011b57806312101021146101d65780631357e1dc146101f05780631633fb1d146101f8575b600080fd5b6101d46004803603606081101561013157600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561016057600080fd5b82018360208201111561017257600080fd5b803590602001918460018302840111600160201b8311171561019357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610595945050505050565b005b6101de6105a8565b60408051918252519081900360200190f35b6101de6105ae565b6101d4600480360360c081101561020e57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561024857600080fd5b82018360208201111561025a57600080fd5b803590602001918460018302840111600160201b8311171561027b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102d557600080fd5b8201836020820111156102e757600080fd5b803590602001918460018302840111600160201b8311171561030857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105b4945050505050565b61035161062e565b604080516001600160a01b039092168252519081900360200190f35b6101d46004803603602081101561038357600080fd5b503561063d565b6101d4600480360360408110156103a057600080fd5b506001600160a01b03813516906020013561079e565b6101de600480360360208110156103cc57600080fd5b50356001600160a01b03166108dc565b6101d4600480360360208110156103f257600080fd5b50356001600160a01b03166108ee565b6104286004803603602081101561041857600080fd5b50356001600160a01b03166109d5565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6104566109fc565b604080519115158252519081900360200190f35b6101de610a0c565b6101d46004803603604081101561048857600080fd5b506001600160a01b038135169060200135610a88565b6101de610baa565b6101de600480360360208110156104bc57600080fd5b50356001600160a01b0316610bcb565b6101d4600480360360608110156104e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561051157600080fd5b82018360208201111561052357600080fd5b803590602001918460018302840111600160201b8311171561054457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610c02945050505050565b6101de610d15565b610351610d1b565b6105a3338484600085610d2a565b505050565b60005481565b60035481565b6105ca6105c4303387898761115c565b846111bd565b6001600160a01b0316866001600160a01b0316146106195760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6106268686868585610d2a565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b03163314610695576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b61069d610baa565b8111156106db5760405162461bcd60e51b815260040180806020018281038252602881526020018061157b6028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561073457600080fd5b505af1158015610748573d6000803e3d6000fd5b505050506040513d602081101561075e57600080fd5b505161079b5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107f6576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107fe610a0c565b600554610811908363ffffffff6111d816565b111561084e5760405162461bcd60e51b81526004018080602001828103825260348152602001806114b26034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610878908363ffffffff6111d816565b815560055461088d908363ffffffff6111d816565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b03811660009081526004602052604090206003810154421080159061091d5750600381015415155b6109585760405162461bcd60e51b81526004018080602001828103825260258152602001806115086025913960400191505060405180910390fd5b6001810154815461096e9163ffffffff61123216565b815560006003820155600181015460055461098e9163ffffffff61123216565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600654600160a01b900460ff1681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a5757600080fd5b505afa158015610a6b573d6000803e3d6000fd5b505050506040513d6020811015610a8157600080fd5b5051905090565b6006546001600160a01b03163314610ae0576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b385760405162461bcd60e51b81526004018080602001828103825260278152602001806115546027913960400191505060405180910390fd5b60008160020154600014610b50578160020154610b54565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610bc6600554610bba610a0c565b9063ffffffff61123216565b905090565b6001600160a01b038116600090815260046020526040812054610bfc90610bf0610baa565b9063ffffffff6111d816565b92915050565b6006546001600160a01b03163314610c5a576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c6e610c68308585611274565b826111bd565b6001600160a01b0316836001600160a01b031614610cbd5760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610dac57610d4a610c68308786611274565b6006546001600160a01b03908116911614610dac576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610dd690859063ffffffff61123216565b90506000610dec82610de789610bcb565b6112c5565b6001600160a01b03881660009081526004602052604081205491925090610e149083906112c5565b905084821015610e6b576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610eca576001600160a01b038816600090815260046020526040902054610e9a908263ffffffff61123216565b6001600160a01b038916600090815260046020526040902055600554610ec6908263ffffffff61123216565b6005555b6001600160a01b038816600090815260026020526040902054610ef3908363ffffffff6111d816565b6001600160a01b038916600090815260026020526040902055600354610f1f908363ffffffff6111d816565b6003556001546001600160a01b031663a9059cbb88610f44858963ffffffff61123216565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f9357600080fd5b505af1158015610fa7573d6000803e3d6000fd5b505050506040513d6020811015610fbd57600080fd5b5051610ffa5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b84156110bb576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561105457600080fd5b505af1158015611068573d6000803e3d6000fd5b505050506040513d602081101561107e57600080fd5b50516110bb5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611152576006805460ff60a01b1916600160a01b1790556040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b60006111d16111cb846112db565b8361132c565b9392505050565b6000828201838110156111d1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006111d183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061141a565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b60008183106112d457816111d1565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b6000815160411461133f57506000610bfc565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156113855760009350505050610bfc565b8060ff16601b1415801561139d57508060ff16601c14155b156113ae5760009350505050610bfc565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa158015611405573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600081848411156114a95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561146e578181015183820152602001611456565b50505050905090810190601f16801561149b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582066828f9746bfad86cee7036662102e93878ec986c0aba50cc9798c50a2a1c6cd64736f6c634300050f0032a265627a7a723158200647bcd981f5a76fb11b7cba2d879482ce35c63a668288f4f8e909c657e7e8b564736f6c634300050f0032" diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory/simpleswapfactory.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory/simpleswapfactory.go similarity index 89% rename from vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory/simpleswapfactory.go rename to vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory/simpleswapfactory.go index 817006d4ce..160a2d6598 100644 --- a/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory/simpleswapfactory.go +++ b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory/simpleswapfactory.go @@ -176,7 +176,7 @@ func (_Context *ContextTransactorRaw) Transact(opts *bind.TransactOpts, method s const ECDSAABI = "[]" // ECDSABin is the compiled bytecode used for deploying new contracts. -var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820872a175153bafae69ff9a23d9f9bb4a85e5703da816064f5d5ede3ecbb91b56564736f6c634300050d0032" +var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582080c675c91bdd0caa525eec9cee27ad4e6399122208a57e9617d9d6d83ebd26d364736f6c634300050f0032" // DeployECDSA deploys a new Ethereum contract, binding an instance of ECDSA to it. func DeployECDSA(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ECDSA, error) { @@ -338,7 +338,7 @@ func (_ECDSA *ECDSATransactorRaw) Transact(opts *bind.TransactOpts, method strin const ERC20ABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // ERC20Bin is the compiled bytecode used for deploying new contracts. -var ERC20Bin = "0x608060405261083b806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a0823114610149578063a457c2d71461016f578063a9059cbb1461019b578063dd62ed3e146101c757610088565b8063095ea7b31461008d57806318160ddd146100cd57806323b872dd146100e7578063395093511461011d575b600080fd5b6100b9600480360360408110156100a357600080fd5b506001600160a01b0381351690602001356101f5565b604080519115158252519081900360200190f35b6100d5610212565b60408051918252519081900360200190f35b6100b9600480360360608110156100fd57600080fd5b506001600160a01b03813581169160208101359091169060400135610218565b6100b96004803603604081101561013357600080fd5b506001600160a01b0381351690602001356102a5565b6100d56004803603602081101561015f57600080fd5b50356001600160a01b03166102f9565b6100b96004803603604081101561018557600080fd5b506001600160a01b038135169060200135610314565b6100b9600480360360408110156101b157600080fd5b506001600160a01b038135169060200135610382565b6100d5600480360360408110156101dd57600080fd5b506001600160a01b0381358116916020013516610396565b60006102096102026103c1565b84846103c5565b50600192915050565b60025490565b60006102258484846104b1565b61029b846102316103c1565b61029685604051806060016040528060288152602001610771602891396001600160a01b038a1660009081526001602052604081209061026f6103c1565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61060d16565b6103c5565b5060019392505050565b60006102096102b26103c1565b8461029685600160006102c36103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6106a416565b6001600160a01b031660009081526020819052604090205490565b60006102096103216103c1565b84610296856040518060600160405280602581526020016107e2602591396001600061034b6103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61060d16565b600061020961038f6103c1565b84846104b1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661040a5760405162461bcd60e51b81526004018080602001828103825260248152602001806107be6024913960400191505060405180910390fd5b6001600160a01b03821661044f5760405162461bcd60e51b81526004018080602001828103825260228152602001806107296022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166104f65760405162461bcd60e51b81526004018080602001828103825260258152602001806107996025913960400191505060405180910390fd5b6001600160a01b03821661053b5760405162461bcd60e51b81526004018080602001828103825260238152602001806107066023913960400191505060405180910390fd5b61057e8160405180606001604052806026815260200161074b602691396001600160a01b038616600090815260208190526040902054919063ffffffff61060d16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105b3908263ffffffff6106a416565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561069c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610661578181015183820152602001610649565b50505050905090810190601f16801561068e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156106fe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820e7920dfefc274a9bba653bb8a8dda9ad48643ad5bcf3e2bac0457e7caf286fe964736f6c634300050d0032" +var ERC20Bin = "0x608060405261083b806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a0823114610149578063a457c2d71461016f578063a9059cbb1461019b578063dd62ed3e146101c757610088565b8063095ea7b31461008d57806318160ddd146100cd57806323b872dd146100e7578063395093511461011d575b600080fd5b6100b9600480360360408110156100a357600080fd5b506001600160a01b0381351690602001356101f5565b604080519115158252519081900360200190f35b6100d5610212565b60408051918252519081900360200190f35b6100b9600480360360608110156100fd57600080fd5b506001600160a01b03813581169160208101359091169060400135610218565b6100b96004803603604081101561013357600080fd5b506001600160a01b0381351690602001356102a5565b6100d56004803603602081101561015f57600080fd5b50356001600160a01b03166102f9565b6100b96004803603604081101561018557600080fd5b506001600160a01b038135169060200135610314565b6100b9600480360360408110156101b157600080fd5b506001600160a01b038135169060200135610382565b6100d5600480360360408110156101dd57600080fd5b506001600160a01b0381358116916020013516610396565b60006102096102026103c1565b84846103c5565b50600192915050565b60025490565b60006102258484846104b1565b61029b846102316103c1565b61029685604051806060016040528060288152602001610771602891396001600160a01b038a1660009081526001602052604081209061026f6103c1565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61060d16565b6103c5565b5060019392505050565b60006102096102b26103c1565b8461029685600160006102c36103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6106a416565b6001600160a01b031660009081526020819052604090205490565b60006102096103216103c1565b84610296856040518060600160405280602581526020016107e2602591396001600061034b6103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61060d16565b600061020961038f6103c1565b84846104b1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661040a5760405162461bcd60e51b81526004018080602001828103825260248152602001806107be6024913960400191505060405180910390fd5b6001600160a01b03821661044f5760405162461bcd60e51b81526004018080602001828103825260228152602001806107296022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166104f65760405162461bcd60e51b81526004018080602001828103825260258152602001806107996025913960400191505060405180910390fd5b6001600160a01b03821661053b5760405162461bcd60e51b81526004018080602001828103825260238152602001806107066023913960400191505060405180910390fd5b61057e8160405180606001604052806026815260200161074b602691396001600160a01b038616600090815260208190526040902054919063ffffffff61060d16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105b3908263ffffffff6106a416565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561069c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610661578181015183820152602001610649565b50505050905090810190601f16801561068e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156106fe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820b519ddff223cfcef943a5f0529d5527214a7e7f3b8574f2550eba95dec7393b464736f6c634300050f0032" // DeployERC20 deploys a new Ethereum contract, binding an instance of ERC20 to it. func DeployERC20(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ERC20, error) { @@ -989,7 +989,7 @@ func (_ERC20 *ERC20Filterer) ParseTransfer(log types.Log) (*ERC20Transfer, error const ERC20MintableABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"MinterAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"MinterRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isMinter\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // ERC20MintableBin is the compiled bytecode used for deploying new contracts. -var ERC20MintableBin = "0x60806040526100266100186001600160e01b0361002b16565b6001600160e01b0361002f16565b6101a3565b3390565b61004781600361007e60201b610a6e1790919060201c565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b61009182826001600160e01b0361012216565b156100fd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b038216610183576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610eb16022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610cff806101b26000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146101c757806398650275146101ef578063a457c2d7146101f7578063a9059cbb14610223578063aa271e1a1461024f578063dd62ed3e14610275576100b4565b8063095ea7b3146100b957806318160ddd146100f957806323b872dd14610113578063395093511461014957806340c10f191461017557806370a08231146101a1575b600080fd5b6100e5600480360360408110156100cf57600080fd5b506001600160a01b0381351690602001356102a3565b604080519115158252519081900360200190f35b6101016102c0565b60408051918252519081900360200190f35b6100e56004803603606081101561012957600080fd5b506001600160a01b038135811691602081013590911690604001356102c6565b6100e56004803603604081101561015f57600080fd5b506001600160a01b038135169060200135610353565b6100e56004803603604081101561018b57600080fd5b506001600160a01b0381351690602001356103a7565b610101600480360360208110156101b757600080fd5b50356001600160a01b03166103fe565b6101ed600480360360208110156101dd57600080fd5b50356001600160a01b0316610419565b005b6101ed61046b565b6100e56004803603604081101561020d57600080fd5b506001600160a01b03813516906020013561047d565b6100e56004803603604081101561023957600080fd5b506001600160a01b0381351690602001356104eb565b6100e56004803603602081101561026557600080fd5b50356001600160a01b03166104ff565b6101016004803603604081101561028b57600080fd5b506001600160a01b0381358116916020013516610518565b60006102b76102b0610543565b8484610547565b50600192915050565b60025490565b60006102d3848484610633565b610349846102df610543565b61034485604051806060016040528060288152602001610c13602891396001600160a01b038a1660009081526001602052604081209061031d610543565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61078f16565b610547565b5060019392505050565b60006102b7610360610543565b846103448560016000610371610543565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61082616565b60006103b96103b4610543565b6104ff565b6103f45760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b6102b78383610887565b6001600160a01b031660009081526020819052604090205490565b6104246103b4610543565b61045f5760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b61046881610977565b50565b61047b610476610543565b6109bf565b565b60006102b761048a610543565b8461034485604051806060016040528060258152602001610ca660259139600160006104b4610543565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61078f16565b60006102b76104f8610543565b8484610633565b600061051260038363ffffffff610a0716565b92915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661058c5760405162461bcd60e51b8152600401808060200182810382526024815260200180610c826024913960400191505060405180910390fd5b6001600160a01b0382166105d15760405162461bcd60e51b8152600401808060200182810382526022815260200180610b7a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106785760405162461bcd60e51b8152600401808060200182810382526025815260200180610c5d6025913960400191505060405180910390fd5b6001600160a01b0382166106bd5760405162461bcd60e51b8152600401808060200182810382526023815260200180610b576023913960400191505060405180910390fd5b61070081604051806060016040528060268152602001610b9c602691396001600160a01b038616600090815260208190526040902054919063ffffffff61078f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610735908263ffffffff61082616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561081e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107e35781810151838201526020016107cb565b50505050905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610880576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166108e2576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6002546108f5908263ffffffff61082616565b6002556001600160a01b038216600090815260208190526040902054610921908263ffffffff61082616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b61098860038263ffffffff610a6e16565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6109d060038263ffffffff610aef16565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60006001600160a01b038216610a4e5760405162461bcd60e51b8152600401808060200182810382526022815260200180610c3b6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610a788282610a07565b15610aca576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b610af98282610a07565b610b345760405162461bcd60e51b8152600401808060200182810382526021815260200180610bf26021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158205d954def161c622e62537fbcd64f678436a7ae5e2c2484dfd0bd5c4448bff59864736f6c634300050d0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" +var ERC20MintableBin = "0x60806040526100266100186001600160e01b0361002b16565b6001600160e01b0361002f16565b6101a3565b3390565b61004781600361007e60201b610a6e1790919060201c565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b61009182826001600160e01b0361012216565b156100fd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b038216610183576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610eb16022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610cff806101b26000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146101c757806398650275146101ef578063a457c2d7146101f7578063a9059cbb14610223578063aa271e1a1461024f578063dd62ed3e14610275576100b4565b8063095ea7b3146100b957806318160ddd146100f957806323b872dd14610113578063395093511461014957806340c10f191461017557806370a08231146101a1575b600080fd5b6100e5600480360360408110156100cf57600080fd5b506001600160a01b0381351690602001356102a3565b604080519115158252519081900360200190f35b6101016102c0565b60408051918252519081900360200190f35b6100e56004803603606081101561012957600080fd5b506001600160a01b038135811691602081013590911690604001356102c6565b6100e56004803603604081101561015f57600080fd5b506001600160a01b038135169060200135610353565b6100e56004803603604081101561018b57600080fd5b506001600160a01b0381351690602001356103a7565b610101600480360360208110156101b757600080fd5b50356001600160a01b03166103fe565b6101ed600480360360208110156101dd57600080fd5b50356001600160a01b0316610419565b005b6101ed61046b565b6100e56004803603604081101561020d57600080fd5b506001600160a01b03813516906020013561047d565b6100e56004803603604081101561023957600080fd5b506001600160a01b0381351690602001356104eb565b6100e56004803603602081101561026557600080fd5b50356001600160a01b03166104ff565b6101016004803603604081101561028b57600080fd5b506001600160a01b0381358116916020013516610518565b60006102b76102b0610543565b8484610547565b50600192915050565b60025490565b60006102d3848484610633565b610349846102df610543565b61034485604051806060016040528060288152602001610c13602891396001600160a01b038a1660009081526001602052604081209061031d610543565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61078f16565b610547565b5060019392505050565b60006102b7610360610543565b846103448560016000610371610543565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61082616565b60006103b96103b4610543565b6104ff565b6103f45760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b6102b78383610887565b6001600160a01b031660009081526020819052604090205490565b6104246103b4610543565b61045f5760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b61046881610977565b50565b61047b610476610543565b6109bf565b565b60006102b761048a610543565b8461034485604051806060016040528060258152602001610ca660259139600160006104b4610543565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61078f16565b60006102b76104f8610543565b8484610633565b600061051260038363ffffffff610a0716565b92915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661058c5760405162461bcd60e51b8152600401808060200182810382526024815260200180610c826024913960400191505060405180910390fd5b6001600160a01b0382166105d15760405162461bcd60e51b8152600401808060200182810382526022815260200180610b7a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106785760405162461bcd60e51b8152600401808060200182810382526025815260200180610c5d6025913960400191505060405180910390fd5b6001600160a01b0382166106bd5760405162461bcd60e51b8152600401808060200182810382526023815260200180610b576023913960400191505060405180910390fd5b61070081604051806060016040528060268152602001610b9c602691396001600160a01b038616600090815260208190526040902054919063ffffffff61078f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610735908263ffffffff61082616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561081e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107e35781810151838201526020016107cb565b50505050905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610880576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166108e2576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6002546108f5908263ffffffff61082616565b6002556001600160a01b038216600090815260208190526040902054610921908263ffffffff61082616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b61098860038263ffffffff610a6e16565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6109d060038263ffffffff610aef16565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60006001600160a01b038216610a4e5760405162461bcd60e51b8152600401808060200182810382526022815260200180610c3b6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610a788282610a07565b15610aca576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b610af98282610a07565b610b345760405162461bcd60e51b8152600401808060200182810382526021815260200180610bf26021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158209e6bb74f71aac35e0171f92a355cd3716e63ca45ab0d56d6a85691a5f4a710c064736f6c634300050f0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" // DeployERC20Mintable deploys a new Ethereum contract, binding an instance of ERC20Mintable to it. func DeployERC20Mintable(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ERC20Mintable, error) { @@ -2012,10 +2012,10 @@ func (_ERC20Mintable *ERC20MintableFilterer) ParseTransfer(log types.Log) (*ERC2 } // ERC20SimpleSwapABI is the input ABI used to generate the binding from. -const ERC20SimpleSwapABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_issuer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_defaultHardDepositTimeout\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"ChequeBounced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalPayout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callerPayout\",\"type\":\"uint256\"}],\"name\":\"ChequeCashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"HardDepositAmountChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"HardDepositDecreasePrepared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"}],\"name\":\"HardDepositTimeoutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callerPayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"issuerSig\",\"type\":\"bytes\"}],\"name\":\"cashCheque\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"issuerSig\",\"type\":\"bytes\"}],\"name\":\"cashChequeBeneficiary\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"decreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"defaultHardDepositTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"hardDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"canBeDecreasedAt\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"increaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"issuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"liquidBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"liquidBalanceFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"paidOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"prepareDecreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"hardDepositTimeout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"}],\"name\":\"setCustomHardDepositTimeout\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contractERC20\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalHardDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalPaidOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" +const ERC20SimpleSwapABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_issuer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_defaultHardDepositTimeout\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"ChequeBounced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalPayout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"callerPayout\",\"type\":\"uint256\"}],\"name\":\"ChequeCashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"HardDepositAmountChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"HardDepositDecreasePrepared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"}],\"name\":\"HardDepositTimeoutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"bounced\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callerPayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"issuerSig\",\"type\":\"bytes\"}],\"name\":\"cashCheque\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cumulativePayout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"issuerSig\",\"type\":\"bytes\"}],\"name\":\"cashChequeBeneficiary\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"decreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"defaultHardDepositTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"hardDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"canBeDecreasedAt\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"increaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"issuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"liquidBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"liquidBalanceFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"paidOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"prepareDecreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"hardDepositTimeout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"}],\"name\":\"setCustomHardDepositTimeout\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contractERC20\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalHardDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalPaidOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // ERC20SimpleSwapBin is the compiled bytecode used for deploying new contracts. -var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032" +var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b5060405161165a38038061165a8339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b03199182161790915560018054939094169216919091179091556000556115d7806100836000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063b6343b0d116100a2578063b7ec1a3311610071578063b7ec1a331461049e578063c76a4d31146104a6578063d4c9a8e8146104cc578063e0bcf13a14610585578063fc0c546a1461058d57610116565b8063b6343b0d14610402578063b648b4171461044e578063b69ef8a81461046a578063b77703501461047257610116565b80631d143848116100e95780631d143848146103495780632e1a7d4d1461036d578063338f3fed1461038a57806381f03fcb146103b6578063946f46a2146103dc57610116565b80630d5f26591461011b57806312101021146101d65780631357e1dc146101f05780631633fb1d146101f8575b600080fd5b6101d46004803603606081101561013157600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561016057600080fd5b82018360208201111561017257600080fd5b803590602001918460018302840111600160201b8311171561019357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610595945050505050565b005b6101de6105a8565b60408051918252519081900360200190f35b6101de6105ae565b6101d4600480360360c081101561020e57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561024857600080fd5b82018360208201111561025a57600080fd5b803590602001918460018302840111600160201b8311171561027b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102d557600080fd5b8201836020820111156102e757600080fd5b803590602001918460018302840111600160201b8311171561030857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105b4945050505050565b61035161062e565b604080516001600160a01b039092168252519081900360200190f35b6101d46004803603602081101561038357600080fd5b503561063d565b6101d4600480360360408110156103a057600080fd5b506001600160a01b03813516906020013561079e565b6101de600480360360208110156103cc57600080fd5b50356001600160a01b03166108dc565b6101d4600480360360208110156103f257600080fd5b50356001600160a01b03166108ee565b6104286004803603602081101561041857600080fd5b50356001600160a01b03166109d5565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6104566109fc565b604080519115158252519081900360200190f35b6101de610a0c565b6101d46004803603604081101561048857600080fd5b506001600160a01b038135169060200135610a88565b6101de610baa565b6101de600480360360208110156104bc57600080fd5b50356001600160a01b0316610bcb565b6101d4600480360360608110156104e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561051157600080fd5b82018360208201111561052357600080fd5b803590602001918460018302840111600160201b8311171561054457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610c02945050505050565b6101de610d15565b610351610d1b565b6105a3338484600085610d2a565b505050565b60005481565b60035481565b6105ca6105c4303387898761115c565b846111bd565b6001600160a01b0316866001600160a01b0316146106195760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6106268686868585610d2a565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b03163314610695576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b61069d610baa565b8111156106db5760405162461bcd60e51b815260040180806020018281038252602881526020018061157b6028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561073457600080fd5b505af1158015610748573d6000803e3d6000fd5b505050506040513d602081101561075e57600080fd5b505161079b5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107f6576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107fe610a0c565b600554610811908363ffffffff6111d816565b111561084e5760405162461bcd60e51b81526004018080602001828103825260348152602001806114b26034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610878908363ffffffff6111d816565b815560055461088d908363ffffffff6111d816565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b03811660009081526004602052604090206003810154421080159061091d5750600381015415155b6109585760405162461bcd60e51b81526004018080602001828103825260258152602001806115086025913960400191505060405180910390fd5b6001810154815461096e9163ffffffff61123216565b815560006003820155600181015460055461098e9163ffffffff61123216565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600654600160a01b900460ff1681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a5757600080fd5b505afa158015610a6b573d6000803e3d6000fd5b505050506040513d6020811015610a8157600080fd5b5051905090565b6006546001600160a01b03163314610ae0576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b385760405162461bcd60e51b81526004018080602001828103825260278152602001806115546027913960400191505060405180910390fd5b60008160020154600014610b50578160020154610b54565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610bc6600554610bba610a0c565b9063ffffffff61123216565b905090565b6001600160a01b038116600090815260046020526040812054610bfc90610bf0610baa565b9063ffffffff6111d816565b92915050565b6006546001600160a01b03163314610c5a576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c6e610c68308585611274565b826111bd565b6001600160a01b0316836001600160a01b031614610cbd5760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610dac57610d4a610c68308786611274565b6006546001600160a01b03908116911614610dac576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610dd690859063ffffffff61123216565b90506000610dec82610de789610bcb565b6112c5565b6001600160a01b03881660009081526004602052604081205491925090610e149083906112c5565b905084821015610e6b576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610eca576001600160a01b038816600090815260046020526040902054610e9a908263ffffffff61123216565b6001600160a01b038916600090815260046020526040902055600554610ec6908263ffffffff61123216565b6005555b6001600160a01b038816600090815260026020526040902054610ef3908363ffffffff6111d816565b6001600160a01b038916600090815260026020526040902055600354610f1f908363ffffffff6111d816565b6003556001546001600160a01b031663a9059cbb88610f44858963ffffffff61123216565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f9357600080fd5b505af1158015610fa7573d6000803e3d6000fd5b505050506040513d6020811015610fbd57600080fd5b5051610ffa5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b84156110bb576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561105457600080fd5b505af1158015611068573d6000803e3d6000fd5b505050506040513d602081101561107e57600080fd5b50516110bb5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611152576006805460ff60a01b1916600160a01b1790556040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b60006111d16111cb846112db565b8361132c565b9392505050565b6000828201838110156111d1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006111d183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061141a565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b60008183106112d457816111d1565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b6000815160411461133f57506000610bfc565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156113855760009350505050610bfc565b8060ff16601b1415801561139d57508060ff16601c14155b156113ae5760009350505050610bfc565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa158015611405573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600081848411156114a95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561146e578181015183820152602001611456565b50505050905090810190601f16801561149b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582066828f9746bfad86cee7036662102e93878ec986c0aba50cc9798c50a2a1c6cd64736f6c634300050f0032" // DeployERC20SimpleSwap deploys a new Ethereum contract, binding an instance of ERC20SimpleSwap to it. func DeployERC20SimpleSwap(auth *bind.TransactOpts, backend bind.ContractBackend, _issuer common.Address, _token common.Address, _defaultHardDepositTimeout *big.Int) (common.Address, *types.Transaction, *ERC20SimpleSwap, error) { @@ -2199,6 +2199,32 @@ func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Balance() (*big.Int, error return _ERC20SimpleSwap.Contract.Balance(&_ERC20SimpleSwap.CallOpts) } +// Bounced is a free data retrieval call binding the contract method 0xb648b417. +// +// Solidity: function bounced() constant returns(bool) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Bounced(opts *bind.CallOpts) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "bounced") + return *ret0, err +} + +// Bounced is a free data retrieval call binding the contract method 0xb648b417. +// +// Solidity: function bounced() constant returns(bool) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Bounced() (bool, error) { + return _ERC20SimpleSwap.Contract.Bounced(&_ERC20SimpleSwap.CallOpts) +} + +// Bounced is a free data retrieval call binding the contract method 0xb648b417. +// +// Solidity: function bounced() constant returns(bool) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Bounced() (bool, error) { + return _ERC20SimpleSwap.Contract.Bounced(&_ERC20SimpleSwap.CallOpts) +} + // DefaultHardDepositTimeout is a free data retrieval call binding the contract method 0x12101021. // // Solidity: function defaultHardDepositTimeout() constant returns(uint256) @@ -4055,7 +4081,7 @@ func (_IERC20 *IERC20Filterer) ParseTransfer(log types.Log) (*IERC20Transfer, er const MathABI = "[]" // MathBin is the compiled bytecode used for deploying new contracts. -var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820dd27f118e79de85d5f755c5a3bf6bac19388a29bf024ae4a936b3d02ec89c5c764736f6c634300050d0032" +var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820d81b4a69b9eb2dd426807b69288708d536fb3cd7231d1047d02b43da9561923c64736f6c634300050f0032" // DeployMath deploys a new Ethereum contract, binding an instance of Math to it. func DeployMath(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Math, error) { @@ -4716,7 +4742,7 @@ func (_MinterRole *MinterRoleFilterer) ParseMinterRemoved(log types.Log) (*Minte const RolesABI = "[]" // RolesBin is the compiled bytecode used for deploying new contracts. -var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582093431205522ed7cdc0c6ada062554f81ef4be833793063e8eeaeeaf10fe9b1e664736f6c634300050d0032" +var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820145d2af0e57b6186560c295a4cb410ff409e09e93215f83fc988830375c4077d64736f6c634300050f0032" // DeployRoles deploys a new Ethereum contract, binding an instance of Roles to it. func DeployRoles(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Roles, error) { @@ -4878,7 +4904,7 @@ func (_Roles *RolesTransactorRaw) Transact(opts *bind.TransactOpts, method strin const SafeMathABI = "[]" // SafeMathBin is the compiled bytecode used for deploying new contracts. -var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820a40cac344427ea0c4f6bebf4c23c2a56e02a64c63860ffbd55a691451c32385e64736f6c634300050d0032" +var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820c76828b34b42d7658e28245385e4885df89f0ecdeaae2138fbacfcff0feceb6f64736f6c634300050f0032" // DeploySafeMath deploys a new Ethereum contract, binding an instance of SafeMath to it. func DeploySafeMath(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeMath, error) { @@ -5040,7 +5066,7 @@ func (_SafeMath *SafeMathTransactorRaw) Transact(opts *bind.TransactOpts, method const SimpleSwapFactoryABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_ERC20Address\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"SimpleSwapDeployed\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"ERC20Address\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"defaultHardDepositTimeoutDuration\",\"type\":\"uint256\"}],\"name\":\"deploySimpleSwap\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deployedContracts\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // SimpleSwapFactoryBin is the compiled bytecode used for deploying new contracts. -var SimpleSwapFactoryBin = "0x608060405234801561001057600080fd5b506040516118693803806118698339818101604052602081101561003357600080fd5b5051600180546001600160a01b0319166001600160a01b03909216919091179055611806806100636000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b611610806101c28339019056fe608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032a265627a7a7231582074f28023ea8adc36d5f6aac79fa6353a114852f91b58f3e8b0dbf1b481c203e364736f6c634300050d0032" +var SimpleSwapFactoryBin = "0x608060405234801561001057600080fd5b506040516118b33803806118b38339818101604052602081101561003357600080fd5b5051600180546001600160a01b0319166001600160a01b03909216919091179055611850806100636000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b61165a806101c28339019056fe608060405234801561001057600080fd5b5060405161165a38038061165a8339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b03199182161790915560018054939094169216919091179091556000556115d7806100836000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c8063b6343b0d116100a2578063b7ec1a3311610071578063b7ec1a331461049e578063c76a4d31146104a6578063d4c9a8e8146104cc578063e0bcf13a14610585578063fc0c546a1461058d57610116565b8063b6343b0d14610402578063b648b4171461044e578063b69ef8a81461046a578063b77703501461047257610116565b80631d143848116100e95780631d143848146103495780632e1a7d4d1461036d578063338f3fed1461038a57806381f03fcb146103b6578063946f46a2146103dc57610116565b80630d5f26591461011b57806312101021146101d65780631357e1dc146101f05780631633fb1d146101f8575b600080fd5b6101d46004803603606081101561013157600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561016057600080fd5b82018360208201111561017257600080fd5b803590602001918460018302840111600160201b8311171561019357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610595945050505050565b005b6101de6105a8565b60408051918252519081900360200190f35b6101de6105ae565b6101d4600480360360c081101561020e57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561024857600080fd5b82018360208201111561025a57600080fd5b803590602001918460018302840111600160201b8311171561027b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102d557600080fd5b8201836020820111156102e757600080fd5b803590602001918460018302840111600160201b8311171561030857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105b4945050505050565b61035161062e565b604080516001600160a01b039092168252519081900360200190f35b6101d46004803603602081101561038357600080fd5b503561063d565b6101d4600480360360408110156103a057600080fd5b506001600160a01b03813516906020013561079e565b6101de600480360360208110156103cc57600080fd5b50356001600160a01b03166108dc565b6101d4600480360360208110156103f257600080fd5b50356001600160a01b03166108ee565b6104286004803603602081101561041857600080fd5b50356001600160a01b03166109d5565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6104566109fc565b604080519115158252519081900360200190f35b6101de610a0c565b6101d46004803603604081101561048857600080fd5b506001600160a01b038135169060200135610a88565b6101de610baa565b6101de600480360360208110156104bc57600080fd5b50356001600160a01b0316610bcb565b6101d4600480360360608110156104e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561051157600080fd5b82018360208201111561052357600080fd5b803590602001918460018302840111600160201b8311171561054457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610c02945050505050565b6101de610d15565b610351610d1b565b6105a3338484600085610d2a565b505050565b60005481565b60035481565b6105ca6105c4303387898761115c565b846111bd565b6001600160a01b0316866001600160a01b0316146106195760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6106268686868585610d2a565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b03163314610695576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b61069d610baa565b8111156106db5760405162461bcd60e51b815260040180806020018281038252602881526020018061157b6028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561073457600080fd5b505af1158015610748573d6000803e3d6000fd5b505050506040513d602081101561075e57600080fd5b505161079b5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107f6576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107fe610a0c565b600554610811908363ffffffff6111d816565b111561084e5760405162461bcd60e51b81526004018080602001828103825260348152602001806114b26034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610878908363ffffffff6111d816565b815560055461088d908363ffffffff6111d816565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b03811660009081526004602052604090206003810154421080159061091d5750600381015415155b6109585760405162461bcd60e51b81526004018080602001828103825260258152602001806115086025913960400191505060405180910390fd5b6001810154815461096e9163ffffffff61123216565b815560006003820155600181015460055461098e9163ffffffff61123216565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600654600160a01b900460ff1681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a5757600080fd5b505afa158015610a6b573d6000803e3d6000fd5b505050506040513d6020811015610a8157600080fd5b5051905090565b6006546001600160a01b03163314610ae0576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b385760405162461bcd60e51b81526004018080602001828103825260278152602001806115546027913960400191505060405180910390fd5b60008160020154600014610b50578160020154610b54565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610bc6600554610bba610a0c565b9063ffffffff61123216565b905090565b6001600160a01b038116600090815260046020526040812054610bfc90610bf0610baa565b9063ffffffff6111d816565b92915050565b6006546001600160a01b03163314610c5a576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c6e610c68308585611274565b826111bd565b6001600160a01b0316836001600160a01b031614610cbd5760405162461bcd60e51b81526004018080602001828103825260228152602001806114e66022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610dac57610d4a610c68308786611274565b6006546001600160a01b03908116911614610dac576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610dd690859063ffffffff61123216565b90506000610dec82610de789610bcb565b6112c5565b6001600160a01b03881660009081526004602052604081205491925090610e149083906112c5565b905084821015610e6b576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610eca576001600160a01b038816600090815260046020526040902054610e9a908263ffffffff61123216565b6001600160a01b038916600090815260046020526040902055600554610ec6908263ffffffff61123216565b6005555b6001600160a01b038816600090815260026020526040902054610ef3908363ffffffff6111d816565b6001600160a01b038916600090815260026020526040902055600354610f1f908363ffffffff6111d816565b6003556001546001600160a01b031663a9059cbb88610f44858963ffffffff61123216565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f9357600080fd5b505af1158015610fa7573d6000803e3d6000fd5b505050506040513d6020811015610fbd57600080fd5b5051610ffa5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b84156110bb576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561105457600080fd5b505af1158015611068573d6000803e3d6000fd5b505050506040513d602081101561107e57600080fd5b50516110bb5760405162461bcd60e51b815260040180806020018281038252602781526020018061152d6027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611152576006805460ff60a01b1916600160a01b1790556040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b60006111d16111cb846112db565b8361132c565b9392505050565b6000828201838110156111d1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006111d183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061141a565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b60008183106112d457816111d1565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b6000815160411461133f57506000610bfc565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156113855760009350505050610bfc565b8060ff16601b1415801561139d57508060ff16601c14155b156113ae5760009350505050610bfc565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa158015611405573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600081848411156114a95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561146e578181015183820152602001611456565b50505050905090810190601f16801561149b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582066828f9746bfad86cee7036662102e93878ec986c0aba50cc9798c50a2a1c6cd64736f6c634300050f0032a265627a7a723158200647bcd981f5a76fb11b7cba2d879482ce35c63a668288f4f8e909c657e7e8b564736f6c634300050f0032" // DeploySimpleSwapFactory deploys a new Ethereum contract, binding an instance of SimpleSwapFactory to it. func DeploySimpleSwapFactory(auth *bind.TransactOpts, backend bind.ContractBackend, _ERC20Address common.Address) (common.Address, *types.Transaction, *SimpleSwapFactory, error) { diff --git a/vendor/modules.txt b/vendor/modules.txt index 2da31c0059..adb1b82ff8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -174,9 +174,9 @@ github.com/ethereum/go-ethereum/signer/core github.com/ethereum/go-ethereum/signer/storage github.com/ethereum/go-ethereum/trie github.com/ethereum/go-ethereum/whisper/whisperv6 -# github.com/ethersphere/go-sw3 v0.2.1 -github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap -github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory +# github.com/ethersphere/go-sw3 v0.2.3 +github.com/ethersphere/go-sw3/contracts-v0-2-3/erc20simpleswap +github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory # github.com/fatih/color v1.7.0 github.com/fatih/color # github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc From c57f5cb603070865500e33ca6e6c43a76f5d7383 Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Thu, 12 Mar 2020 19:29:10 -0300 Subject: [PATCH 03/11] cmd/swarm,pss,swap: fixed linter errors S1038/S1039 --- cmd/swarm/config.go | 2 +- cmd/swarm/download.go | 2 +- cmd/swarm/main.go | 6 +++--- cmd/swarm/upload_test.go | 4 ++-- pss/api.go | 2 +- swap/swap.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index b691e58886..92d990c4f2 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -104,7 +104,7 @@ var tomlSettings = toml.Config{ MissingField: func(rt reflect.Type, field string) error { link := "" if unicode.IsUpper(rune(rt.Name()[0])) && rt.PkgPath() != "main" { - link = fmt.Sprintf(", check github.com/ethersphere/swarm/api/config.go for available fields") + link = ", check github.com/ethersphere/swarm/api/config.go for available fields" } return fmt.Errorf("field '%s' is not defined in %s%s", field, rt.String(), link) }, diff --git a/cmd/swarm/download.go b/cmd/swarm/download.go index 97cada64cb..b3c9894539 100644 --- a/cmd/swarm/download.go +++ b/cmd/swarm/download.go @@ -46,7 +46,7 @@ func download(ctx *cli.Context) { case 0: utils.Fatalf("Usage: swarm down [options] []") case 1: - log.Trace(fmt.Sprintf("swarm down: no destination path - assuming working dir")) + log.Trace("swarm down: no destination path - assuming working dir") default: log.Trace(fmt.Sprintf("destination path arg: %s", args[1])) if absDest, err := filepath.Abs(args[1]); err == nil { diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index b1205268e0..bd0c518a53 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -283,10 +283,10 @@ func keys(ctx *cli.Context) error { bzzkey := crypto.Keccak256Hash(pubkey).Hex() if !ctx.Bool(SwarmCompressedFlag.Name) { - fmt.Println(fmt.Sprintf("bzzkey=%s", bzzkey[2:])) - fmt.Println(fmt.Sprintf("publicKey=%s", pubkeyhex)) + fmt.Print(fmt.Sprintf("bzzkey=%s", bzzkey[2:]), "\n") + fmt.Print(fmt.Sprintf("publicKey=%s", pubkeyhex), "\n") } - fmt.Println(fmt.Sprintf("publicKeyCompressed=%s", pubCompressed)) + fmt.Print(fmt.Sprintf("publicKeyCompressed=%s", pubCompressed), "\n") return nil } diff --git a/cmd/swarm/upload_test.go b/cmd/swarm/upload_test.go index 2d82302eed..f6941ad0cb 100644 --- a/cmd/swarm/upload_test.go +++ b/cmd/swarm/upload_test.go @@ -100,7 +100,7 @@ func testDefault(t *testing.T, cluster *testCluster, toEncrypt bool) { tmpFileName} } // upload the file with 'swarm up' and expect a hash - log.Info(fmt.Sprintf("uploading file with 'swarm up'")) + log.Info("uploading file with 'swarm up'") up := runSwarm(t, flags...) _, matches := up.ExpectRegexp(hashRegexp) up.ExpectExit() @@ -215,7 +215,7 @@ func testRecursive(t *testing.T, cluster *testCluster, toEncrypt bool) { tmpUploadDir} } // upload the file with 'swarm up' and expect a hash - log.Info(fmt.Sprintf("uploading file with 'swarm up'")) + log.Info("uploading file with 'swarm up'") up := runSwarm(t, flags...) _, matches := up.ExpectRegexp(hashRegexp) up.ExpectExit() diff --git a/pss/api.go b/pss/api.go index 97ea641310..5eccf2138a 100644 --- a/pss/api.go +++ b/pss/api.go @@ -84,7 +84,7 @@ func (pssapi *API) Receive(ctx context.Context, topic message.Topic, raw bool, p case err := <-psssub.Err(): log.Warn(fmt.Sprintf("caught subscription error in pss sub topic %x: %v", topic, err)) case <-notifier.Closed(): - log.Warn(fmt.Sprintf("rpc sub notifier closed")) + log.Warn("rpc sub notifier closed") } }() diff --git a/swap/swap.go b/swap/swap.go index 8b4f5d3b73..114dc38cc7 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -614,7 +614,7 @@ func (s *Swap) promptDepositAmount() (*big.Int, error) { } // log available balance and ERC20 balance s.logger.Info(InitAction, "Balance information", "chequebook available balance", availableBalance, "ERC20 balance", balance) - promptMessage := fmt.Sprintf("Please provide the amount in HONEY which will deposited to your chequebook (0 for skipping deposit): ") + promptMessage := "Please provide the amount in HONEY which will deposited to your chequebook (0 for skipping deposit): " // need to prompt user for deposit amount prompter := console.Stdin // ask user for input From df12915594defaebbe98f9475d609ff9a87a9dc0 Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Wed, 25 Mar 2020 13:54:15 -0300 Subject: [PATCH 04/11] contracts/swap,swap: added Bounced call to sc --- contracts/swap/swap.go | 9 ++++----- swap/protocol.go | 2 +- swap/swap.go | 6 +++--- swap/swap_test.go | 24 +++++++++++++++++++++++- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index 10de3f12fb..91344fc0c3 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -53,6 +53,8 @@ type Contract interface { Issuer(opts *bind.CallOpts) (common.Address, error) // PaidOut returns the total paid out amount for the given address PaidOut(opts *bind.CallOpts, addr common.Address) (*big.Int, error) + // Bounced returns if there has been a bounced cheque from the chequebook + Bounced(opts *bind.CallOpts) (bool, error) } // CashChequeResult summarizes the result of a CashCheque or CashChequeBeneficiary call @@ -93,11 +95,8 @@ func InstanceAt(address common.Address, backend chain.Backend) (Contract, error) // Bounced obtains if a cheque has been bounced previously of a contract at a specific address. // Once it's bounced, it will not change it's state again, unless re deployed. -func Bounced(address common.Address, backend chain.Backend) (bool, error) { - //TODO: REPLACE THIS MOCK, WHEN SC ARE UPDATED - //TEST BOUNCED TRUE/FALSE - //TEST ERROR - return false, nil +func (s simpleContract) Bounced(opts *bind.CallOpts) (bool, error) { + return s.instance.Bounced(opts) } // Withdraw withdraws amount from the chequebook and blocks until the transaction is mined diff --git a/swap/protocol.go b/swap/protocol.go index 820bd979e7..ada600cb46 100644 --- a/swap/protocol.go +++ b/swap/protocol.go @@ -119,7 +119,7 @@ func (s *Swap) run(p *p2p.Peer, rw p2p.MsgReadWriter) error { return err } - bounced, err := s.getBouncedCheque(context.Background(), response.ContractAddress) + bounced, err := s.getBouncedCheque() if err != nil { return err } diff --git a/swap/swap.go b/swap/swap.go index 114dc38cc7..b962e6c682 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -463,7 +463,7 @@ func (s *Swap) processAndVerifyCheque(cheque *Cheque, p *Peer) (*uint256.Uint256 return nil, err } - bounced, err := s.getBouncedCheque(context.Background(), s.owner.address) + bounced, err := s.getBouncedCheque() if err != nil { return nil, err } @@ -592,8 +592,8 @@ func (s *Swap) getContractOwner(ctx context.Context, address common.Address) (co } // getBouncedCheque retrieves if a bounced cheque exists at address from the blockchain -func (s *Swap) getBouncedCheque(ctx context.Context, address common.Address) (bool, error) { - bounced, err := contract.Bounced(address, s.backend) +func (s *Swap) getBouncedCheque() (bool, error) { + bounced, err := s.contract.Bounced(nil) if err != nil { return false, err } diff --git a/swap/swap_test.go b/swap/swap_test.go index d72ad63237..53e83b5f4e 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -1152,8 +1152,30 @@ func TestPeerVerifyChequeAgainstLastInvalid(t *testing.T) { // TestPeerProcessAndVerifyCheque tests that processAndVerifyCheque accepts a valid cheque and also saves it func TestPeerProcessAndVerifyCheque(t *testing.T) { - swap, peer, clean := newTestSwapAndPeer(t, ownerKey) + //////////////////////////// + testBackend := newTestBackend(t) + defer testBackend.Close() + swap, clean := newTestSwap(t, ownerKey, testBackend) defer clean() + cleanup := setupContractTest() + defer cleanup() + + depositAmount := uint256.FromUint64(9000 * RetrieveRequestPrice) + + // deploy a chequebook + err := testDeploy(context.TODO(), swap, depositAmount) + if err != nil { + t.Fatal(err) + } + // create a peer + peer, err := swap.addPeer(newDummyPeerWithSpec(Spec).Peer, swap.owner.address, swap.GetParams().ContractAddress) + if err != nil { + t.Fatal(err) + } + + ///////////////////////// + //swap, peer, clean := newTestSwapAndPeer(t, ownerKey) + //defer clean() // create test cheque and process cheque := newTestCheque() From a5e942ee03efd95d6d9c68853537bcfe3ef3d281 Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Fri, 27 Mar 2020 09:50:30 -0300 Subject: [PATCH 05/11] swap: refactored bounced cheque into peer --- swap/peer.go | 10 ++++++++++ swap/protocol.go | 12 ++++++------ swap/swap.go | 12 +----------- swap/swap_test.go | 43 ++++++++++++++++++++++++------------------- 4 files changed, 41 insertions(+), 36 deletions(-) diff --git a/swap/peer.go b/swap/peer.go index 78e0786006..9989a27569 100644 --- a/swap/peer.go +++ b/swap/peer.go @@ -221,3 +221,13 @@ func (p *Peer) sendCheque() error { Cheque: cheque, }) } + +// getBouncedCheque retrieves if a bounced cheque exists at address from the blockchain +func (p *Peer) getBouncedCheque() (bool, error) { + bounced, err := p.swap.contract.Bounced(nil) + if err != nil { + return false, err + } + + return bounced, nil +} diff --git a/swap/protocol.go b/swap/protocol.go index ada600cb46..12b40ba5f4 100644 --- a/swap/protocol.go +++ b/swap/protocol.go @@ -119,19 +119,19 @@ func (s *Swap) run(p *p2p.Peer, rw p2p.MsgReadWriter) error { return err } - bounced, err := s.getBouncedCheque() + swapPeer, err := s.addPeer(protoPeer, beneficiary, response.ContractAddress) if err != nil { return err } - if bounced { - return ErrBouncedCheque - } + defer s.removePeer(swapPeer) - swapPeer, err := s.addPeer(protoPeer, beneficiary, response.ContractAddress) + bounced, err := swapPeer.getBouncedCheque() if err != nil { return err } - defer s.removePeer(swapPeer) + if bounced { + return ErrBouncedCheque + } return swapPeer.Run(s.handleMsg(swapPeer)) } diff --git a/swap/swap.go b/swap/swap.go index b962e6c682..a61333d392 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -463,7 +463,7 @@ func (s *Swap) processAndVerifyCheque(cheque *Cheque, p *Peer) (*uint256.Uint256 return nil, err } - bounced, err := s.getBouncedCheque() + bounced, err := p.getBouncedCheque() if err != nil { return nil, err } @@ -591,16 +591,6 @@ func (s *Swap) getContractOwner(ctx context.Context, address common.Address) (co return contr.Issuer(nil) } -// getBouncedCheque retrieves if a bounced cheque exists at address from the blockchain -func (s *Swap) getBouncedCheque() (bool, error) { - bounced, err := s.contract.Bounced(nil) - if err != nil { - return false, err - } - - return bounced, nil -} - // promptDepositAmount blocks and asks the user how much ERC20 he wants to deposit func (s *Swap) promptDepositAmount() (*big.Int, error) { // retrieve available balance diff --git a/swap/swap_test.go b/swap/swap_test.go index 53e83b5f4e..c221f35798 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -1152,34 +1152,35 @@ func TestPeerVerifyChequeAgainstLastInvalid(t *testing.T) { // TestPeerProcessAndVerifyCheque tests that processAndVerifyCheque accepts a valid cheque and also saves it func TestPeerProcessAndVerifyCheque(t *testing.T) { - //////////////////////////// testBackend := newTestBackend(t) defer testBackend.Close() - swap, clean := newTestSwap(t, ownerKey, testBackend) - defer clean() cleanup := setupContractTest() defer cleanup() - depositAmount := uint256.FromUint64(9000 * RetrieveRequestPrice) + swap, cleanup := newTestSwap(t, beneficiaryKey, testBackend) + defer cleanup() - // deploy a chequebook - err := testDeploy(context.TODO(), swap, depositAmount) - if err != nil { + ctx := context.Background() + if err := testDeploy(ctx, swap, uint256.FromUint64(0)); err != nil { t.Fatal(err) } - // create a peer - peer, err := swap.addPeer(newDummyPeerWithSpec(Spec).Peer, swap.owner.address, swap.GetParams().ContractAddress) + + debitorChequebook, err := testDeployWithPrivateKey(ctx, testBackend, ownerKey, ownerAddress, uint256.FromUint64((DefaultPaymentThreshold * 2))) if err != nil { t.Fatal(err) } - ///////////////////////// - //swap, peer, clean := newTestSwapAndPeer(t, ownerKey) - //defer clean() + debitorDummyPeer := newDummyPeerWithSpec(Spec) + peer, err := swap.addPeer(debitorDummyPeer.Peer, ownerAddress, debitorChequebook.ContractParams().ContractAddress) + if err != nil { + t.Fatal(err) + } - // create test cheque and process - cheque := newTestCheque() - cheque.Signature, _ = cheque.Sign(ownerKey) + chequeAmount := uint256.FromUint64(42) + cheque, err := newSignedTestCheque(debitorChequebook.ContractParams().ContractAddress, swap.owner.address, chequeAmount, ownerKey) + if err != nil { + t.Fatal(err) + } actualAmount, err := swap.processAndVerifyCheque(cheque, peer) if err != nil { @@ -1195,14 +1196,18 @@ func TestPeerProcessAndVerifyCheque(t *testing.T) { t.Fatalf("last received cheque has wrong cumulative payout, was: %v, expected: %v", peer.lastReceivedCheque.CumulativePayout, cheque.CumulativePayout) } - // create another cheque with higher amount - otherCheque := newTestCheque() - _, err = otherCheque.CumulativePayout.Add(cheque.CumulativePayout, uint256.FromUint64(10)) + otherChequeAmount := uint256.FromUint64(42) + _, err = otherChequeAmount.Add(otherChequeAmount, uint256.FromUint64(10)) if err != nil { t.Fatal(err) } + + otherCheque, err := newSignedTestCheque(debitorChequebook.ContractParams().ContractAddress, swap.owner.address, otherChequeAmount, ownerKey) + if err != nil { + t.Fatal(err) + } + otherCheque.Honey = 10 - otherCheque.Signature, _ = otherCheque.Sign(ownerKey) if _, err := swap.processAndVerifyCheque(otherCheque, peer); err != nil { t.Fatalf("failed to process cheque: %s", err) From 7ae1bd2837b621c6e4b31558d0ffdd3244751394 Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Mon, 30 Mar 2020 10:03:28 -0300 Subject: [PATCH 06/11] swap: fixed broken swap tests --- swap/swap_test.go | 49 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/swap/swap_test.go b/swap/swap_test.go index c221f35798..5795143f48 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -1224,21 +1224,47 @@ func TestPeerProcessAndVerifyCheque(t *testing.T) { // then it processes a valid cheque // then rejects one with lower amount func TestPeerProcessAndVerifyChequeInvalid(t *testing.T) { - swap, peer, clean := newTestSwapAndPeer(t, ownerKey) - defer clean() + testBackend := newTestBackend(t) + defer testBackend.Close() + cleanup := setupContractTest() + defer cleanup() + + swap, cleanup := newTestSwap(t, beneficiaryKey, testBackend) + defer cleanup() + + ctx := context.Background() + if err := testDeploy(ctx, swap, uint256.FromUint64(0)); err != nil { + t.Fatal(err) + } + + chequebook, err := testDeployWithPrivateKey(ctx, testBackend, ownerKey, ownerAddress, uint256.FromUint64((DefaultPaymentThreshold * 2))) + if err != nil { + t.Fatal(err) + } + + dummyPeer := newDummyPeerWithSpec(Spec) + peer, err := swap.addPeer(dummyPeer.Peer, ownerAddress, chequebook.ContractParams().ContractAddress) + if err != nil { + t.Fatal(err) + } + chequeAmount := uint256.FromUint64(42) // invalid cheque because wrong recipient - cheque := newTestCheque() - cheque.Beneficiary = ownerAddress - cheque.Signature, _ = cheque.Sign(ownerKey) + cheque, err := newSignedTestCheque(chequebook.ContractParams().ContractAddress, ownerAddress, chequeAmount, ownerKey) + if err != nil { + t.Fatal(err) + } + /// =================================== if _, err := swap.processAndVerifyCheque(cheque, peer); err == nil { t.Fatal("accecpted an invalid cheque as first cheque") } // valid cheque - cheque = newTestCheque() - cheque.Signature, _ = cheque.Sign(ownerKey) + cheque, err = newSignedTestCheque(chequebook.ContractParams().ContractAddress, swap.owner.address, chequeAmount, ownerKey) + if err != nil { + t.Fatal(err) + } if _, err := swap.processAndVerifyCheque(cheque, peer); err != nil { t.Fatalf("failed to process cheque: %s", err) @@ -1249,13 +1275,16 @@ func TestPeerProcessAndVerifyChequeInvalid(t *testing.T) { } // invalid cheque because amount is lower - otherCheque := newTestCheque() - _, err := otherCheque.CumulativePayout.Sub(cheque.CumulativePayout, uint256.FromUint64(10)) + otherCheque, err := newSignedTestCheque(chequebook.ContractParams().ContractAddress, swap.owner.address, chequeAmount, ownerKey) + if err != nil { + t.Fatal(err) + } + + _, err = otherCheque.CumulativePayout.Sub(cheque.CumulativePayout, uint256.FromUint64(10)) if err != nil { t.Fatal(err) } otherCheque.Honey = 10 - otherCheque.Signature, _ = otherCheque.Sign(ownerKey) if _, err := swap.processAndVerifyCheque(otherCheque, peer); err == nil { t.Fatal("accepted a cheque with lower amount") From 2e0527026ff6499d259d94fd7b81dc5b2ac73f3e Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Mon, 30 Mar 2020 14:06:40 -0300 Subject: [PATCH 07/11] swap: moved bouncedCheque to addPeer, included tests for bounced cheques --- swap/peer.go | 21 ++++++-- swap/protocol.go | 8 --- swap/swap_test.go | 128 ++++++++++++++++++++++++++++------------------ 3 files changed, 95 insertions(+), 62 deletions(-) diff --git a/swap/peer.go b/swap/peer.go index 9989a27569..ac6e06dcae 100644 --- a/swap/peer.go +++ b/swap/peer.go @@ -72,6 +72,15 @@ func NewPeer(p *protocols.Peer, s *Swap, beneficiary common.Address, contractAdd return nil, err } + bounced := false + bounced, err = peer.getBouncedCheque() + if err != nil { + return nil, err + } + if bounced { + return nil, ErrBouncedCheque + } + return peer, nil } @@ -224,9 +233,15 @@ func (p *Peer) sendCheque() error { // getBouncedCheque retrieves if a bounced cheque exists at address from the blockchain func (p *Peer) getBouncedCheque() (bool, error) { - bounced, err := p.swap.contract.Bounced(nil) - if err != nil { - return false, err + bounced := false + var err error + + // if chequebook not defined don't call contract methods + if p.swap.contract != nil { + bounced, err = p.swap.contract.Bounced(nil) + if err != nil { + return false, err + } } return bounced, nil diff --git a/swap/protocol.go b/swap/protocol.go index 12b40ba5f4..c7b188c960 100644 --- a/swap/protocol.go +++ b/swap/protocol.go @@ -125,14 +125,6 @@ func (s *Swap) run(p *p2p.Peer, rw p2p.MsgReadWriter) error { } defer s.removePeer(swapPeer) - bounced, err := swapPeer.getBouncedCheque() - if err != nil { - return err - } - if bounced { - return ErrBouncedCheque - } - return swapPeer.Run(s.handleMsg(swapPeer)) } diff --git a/swap/swap_test.go b/swap/swap_test.go index 5795143f48..4f85fbea18 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -1565,88 +1565,114 @@ func TestAvailableBalance(t *testing.T) { } func TestBouncedCheque(t *testing.T) { - // TODO: REPLACE WITH TEST - // ON CONNECT TO PEER NO BOUNCED CHEQUE - // ON CONNECT TO PEER BOUNCED CHEQUE - // ON RECEIVE EmitChequeMsg BOUNCED CHEQUE AFTER A COUPLE OF MESSAGES - // ON RECEIVE EmitChequeMsg NO BOUNCED CHEQUE AFTER A COUPLE OF MESSAGES - testBackend := newTestBackend(t) defer testBackend.Close() - swap, clean := newTestSwap(t, ownerKey, testBackend) - defer clean() - cleanup := setupContractTest() - defer cleanup() + // create both test swap accounts + creditorSwap, clean1 := newTestSwap(t, beneficiaryKey, testBackend) + debitorSwap, clean2 := newTestSwap(t, ownerKey, testBackend) + defer clean1() + defer clean2() - depositAmount := uint256.FromUint64(9000 * RetrieveRequestPrice) + testAmount := DefaultPaymentThreshold + 42 - // deploy a chequebook - err := testDeploy(context.TODO(), swap, depositAmount) + ctx := context.Background() + err := testDeploy(ctx, creditorSwap, uint256.FromUint64(0)) if err != nil { t.Fatal(err) } - // create a peer - peer, err := swap.addPeer(newDummyPeerWithSpec(Spec).Peer, swap.owner.address, swap.GetParams().ContractAddress) + err = testDeploy(ctx, debitorSwap, uint256.FromUint64(testAmount)) if err != nil { t.Fatal(err) } - // verify that available balance equals depositAmount (we deposit during deployment) - availableBalance, err := swap.AvailableBalance() + // create Peer instances + // NOTE: remember that these are peer instances representing each **a model of the remote peer** for every local node + // so creditor is the model of the remote mode for the debitor! (and vice versa) + cPeer := newDummyPeerWithSpec(Spec) + dPeer := newDummyPeerWithSpec(Spec) + creditor, err := debitorSwap.addPeer(cPeer.Peer, creditorSwap.owner.address, debitorSwap.GetParams().ContractAddress) if err != nil { - t.Fatal(err) - } - if !availableBalance.Equals(depositAmount) { - t.Fatalf("available balance not equal to deposited amount. available balance: %v, deposit amount: %v", availableBalance, depositAmount) + // ON CONNECT TO PEER NO BOUNCED CHEQUE + if err == ErrBouncedCheque { + t.Fatalf("Bounced cheque in chequebook") + } else { + t.Fatal(err) + } } - // withdraw 50 - withdrawAmount := uint256.FromUint64(50) - netDeposit, err := uint256.New().Sub(depositAmount, withdrawAmount) + + debitor, err := creditorSwap.addPeer(dPeer.Peer, debitorSwap.owner.address, debitorSwap.GetParams().ContractAddress) if err != nil { - t.Fatal(err) + // ON CONNECT TO PEER NO BOUNCED CHEQUE + if err == ErrBouncedCheque { + t.Fatalf("Bounced cheque in chequebook") + } else { + t.Fatal(err) + } } - withdraw := withdrawAmount.Value() - opts := bind.NewKeyedTransactor(swap.owner.privateKey) - opts.Context = context.TODO() - rec, err := swap.contract.Withdraw(opts, &withdraw) - if err != nil { + // set balances arbitrarily + if err = debitor.setBalance(int64(ChequeDebtTolerance * 1000)); err != nil { t.Fatal(err) } - if rec.Status != types.ReceiptStatusSuccessful { - t.Fatal("Transaction reverted") + if err = creditor.setBalance(int64(-testAmount * 100)); err != nil { + t.Fatal(err) } - // verify available balance - availableBalance, err = swap.AvailableBalance() - if err != nil { + // setup the wait for mined transaction function for testing + cleanup := setupContractTest() + defer cleanup() + + // now simulate sending the cheque to the creditor from the debitor + if err = creditor.sendCheque(); err != nil { t.Fatal(err) } - if !availableBalance.Equals(netDeposit) { - t.Fatalf("available balance not equal to deposited minus withdraw. available balance: %v, deposit minus withdrawn: %v", availableBalance, netDeposit) + + debitorSwap.handleConfirmChequeMsg(ctx, creditor, &ConfirmChequeMsg{ + Cheque: creditor.getPendingCheque(), + }) + // the debitor should have already reset its balance + if creditor.getBalance() != 0 { + t.Fatalf("unexpected balance to be 0, but it is %d", creditor.getBalance()) } - // send a cheque worth 42 - chequeAmount := uint64(42) - // create a dummy peer. Note: the peer's contract address and the peers address are resp the swap contract and the swap owner - if err = peer.setBalance(int64(-chequeAmount)); err != nil { - t.Fatal(err) + // now load the cheque that the debitor created... + cheque := creditor.getLastSentCheque() + if cheque == nil { + t.Fatal("expected to find a cheque, but it was empty") } - if err = peer.sendCheque(); err != nil { - t.Fatal(err) + // ...create a message... + msg := &EmitChequeMsg{ + Cheque: cheque, } - availableBalance, err = swap.AvailableBalance() + // ...and trigger message handling on the receiver side (creditor) + // remember that debitor is the model of the remote node for the creditor... + err = creditorSwap.handleEmitChequeMsg(ctx, debitor, msg) if err != nil { t.Fatal(err) } - // verify available balance - expectedBalance, err := uint256.New().Sub(netDeposit, uint256.FromUint64(chequeAmount)) - if err != nil { - t.Fatal(err) + // ...on which we wait until the cashCheque is actually terminated (ensures proper nonce count) + select { + case <-testBackend.cashDone: + creditorSwap.logger.Debug(CashChequeAction, "cash transaction completed and committed") + case <-time.After(4 * time.Second): + t.Fatalf("Timeout waiting for cash transactions to complete") } - if !availableBalance.Equals(expectedBalance) { - t.Fatalf("available balance not equal to deposited minus withdraw. available balance: %v, expected balance: %v", availableBalance, expectedBalance) + // ON RECEIVE EmitChequeMsg BOUNCED CHEQUE + if cBounced, _ := creditor.getBouncedCheque(); !cBounced { + t.Fatalf("Creditor should have bounced cheques") } + // ON CONNECT TO PEER BOUNCED CHEQUE + // Disconnect from peer and connect again + // There should be a bounced cheque + //creditor.Disconnect(p2p.DiscUselessPeer) + //creditorSwap.removePeer(creditor) + + //creditor, err = debitorSwap.addPeer(cPeer.Peer, creditorSwap.owner.address, debitorSwap.GetParams().ContractAddress) + //if cBounced, _ := creditor.getBouncedCheque(); !cBounced { + // t.Fatalf("Creditor should have bounced cheques") + //} + + // ON RECEIVE EmitChequeMsg NO BOUNCED CHEQUE AFTER A COUPLE OF MESSAGES } From 1ab87565a449b3fa6e84d18b2c1f2d59447e2cd2 Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Mon, 30 Mar 2020 14:53:17 -0300 Subject: [PATCH 08/11] swap: TestSwapRPC added contract for testing --- swap/protocol_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/swap/protocol_test.go b/swap/protocol_test.go index ca120ae9d6..9e2faeb574 100644 --- a/swap/protocol_test.go +++ b/swap/protocol_test.go @@ -549,7 +549,10 @@ func TestSwapRPC(t *testing.T) { defer clean() // need to have a dummy contract or the call will fail at `GetParams` due to `NewAPI` - swap.contract, err = contract.InstanceAt(common.Address{}, swap.backend) + depositAmount := uint256.FromUint64(9000 * RetrieveRequestPrice) + + // deploy a chequebook + err = testDeploy(context.TODO(), swap, depositAmount) if err != nil { t.Fatal(err) } @@ -594,7 +597,7 @@ func TestSwapRPC(t *testing.T) { t.Fatalf("Expected balance to be 0 but it is %d", balance) } - peer1, err := swap.addPeer(dummyPeer1.Peer, common.Address{}, common.Address{}) + peer1, err := swap.addPeer(dummyPeer1.Peer, common.Address{}, swap.GetParams().ContractAddress) if err != nil { t.Fatal(err) } @@ -603,7 +606,7 @@ func TestSwapRPC(t *testing.T) { t.Fatal(err) } - peer2, err := swap.addPeer(dummyPeer2.Peer, common.Address{}, common.Address{}) + peer2, err := swap.addPeer(dummyPeer2.Peer, common.Address{}, swap.GetParams().ContractAddress) if err != nil { t.Fatal(err) } From a8a06ff451ee6114c380d2e4e28f406fbb6a1909 Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Mon, 30 Mar 2020 15:34:15 -0300 Subject: [PATCH 09/11] swap: changed FromUint64 to Uint256From --- swap/protocol_test.go | 2 +- swap/swap_test.go | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/swap/protocol_test.go b/swap/protocol_test.go index c6e5325aa6..49a16a3b36 100644 --- a/swap/protocol_test.go +++ b/swap/protocol_test.go @@ -549,7 +549,7 @@ func TestSwapRPC(t *testing.T) { defer clean() // need to have a dummy contract or the call will fail at `GetParams` due to `NewAPI` - depositAmount := uint256.FromUint64(9000 * RetrieveRequestPrice) + depositAmount := int256.Uint256From(9000 * RetrieveRequestPrice) // deploy a chequebook err = testDeploy(context.TODO(), swap, depositAmount) diff --git a/swap/swap_test.go b/swap/swap_test.go index d6d50fac16..702953a467 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -1161,11 +1161,11 @@ func TestPeerProcessAndVerifyCheque(t *testing.T) { defer cleanup() ctx := context.Background() - if err := testDeploy(ctx, swap, uint256.FromUint64(0)); err != nil { + if err := testDeploy(ctx, swap, int256.Uint256From(0)); err != nil { t.Fatal(err) } - debitorChequebook, err := testDeployWithPrivateKey(ctx, testBackend, ownerKey, ownerAddress, uint256.FromUint64((DefaultPaymentThreshold * 2))) + debitorChequebook, err := testDeployWithPrivateKey(ctx, testBackend, ownerKey, ownerAddress, int256.Uint256From((DefaultPaymentThreshold * 2))) if err != nil { t.Fatal(err) } @@ -1176,7 +1176,7 @@ func TestPeerProcessAndVerifyCheque(t *testing.T) { t.Fatal(err) } - chequeAmount := uint256.FromUint64(42) + chequeAmount := int256.Uint256From(42) cheque, err := newSignedTestCheque(debitorChequebook.ContractParams().ContractAddress, swap.owner.address, chequeAmount, ownerKey) if err != nil { t.Fatal(err) @@ -1196,7 +1196,7 @@ func TestPeerProcessAndVerifyCheque(t *testing.T) { t.Fatalf("last received cheque has wrong cumulative payout, was: %v, expected: %v", peer.lastReceivedCheque.CumulativePayout, cheque.CumulativePayout) } - otherChequeAmount := uint256.FromUint64(42) + otherChequeAmount := int256.Uint256From(42) _, err = otherChequeAmount.Add(otherChequeAmount, int256.Uint256From(10)) if err != nil { t.Fatal(err) @@ -1233,11 +1233,11 @@ func TestPeerProcessAndVerifyChequeInvalid(t *testing.T) { defer cleanup() ctx := context.Background() - if err := testDeploy(ctx, swap, uint256.FromUint64(0)); err != nil { + if err := testDeploy(ctx, swap, int256.Uint256From(0)); err != nil { t.Fatal(err) } - chequebook, err := testDeployWithPrivateKey(ctx, testBackend, ownerKey, ownerAddress, uint256.FromUint64((DefaultPaymentThreshold * 2))) + chequebook, err := testDeployWithPrivateKey(ctx, testBackend, ownerKey, ownerAddress, int256.Uint256From((DefaultPaymentThreshold * 2))) if err != nil { t.Fatal(err) } @@ -1248,7 +1248,7 @@ func TestPeerProcessAndVerifyChequeInvalid(t *testing.T) { t.Fatal(err) } - chequeAmount := uint64(42) + chequeAmount := int256.Uint256From(42) // invalid cheque because wrong recipient cheque, err := newSignedTestCheque(chequebook.ContractParams().ContractAddress, ownerAddress, chequeAmount, ownerKey) if err != nil { @@ -1576,11 +1576,11 @@ func TestBouncedCheque(t *testing.T) { testAmount := DefaultPaymentThreshold + 42 ctx := context.Background() - err := testDeploy(ctx, creditorSwap, uint256.FromUint64(0)) + err := testDeploy(ctx, creditorSwap, int256.Uint256From(0)) if err != nil { t.Fatal(err) } - err = testDeploy(ctx, debitorSwap, uint256.FromUint64(testAmount)) + err = testDeploy(ctx, debitorSwap, int256.Uint256From(testAmount)) if err != nil { t.Fatal(err) } From bbdde40fe51b7873565b9c9a88ba04a46eea67cb Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Tue, 31 Mar 2020 11:08:47 -0300 Subject: [PATCH 10/11] swap: fixed TestBouncedCheque --- swap/swap_test.go | 79 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/swap/swap_test.go b/swap/swap_test.go index 702953a467..f3f794da1b 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -41,6 +41,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/rpc" contractFactory "github.com/ethersphere/go-sw3/contracts-v0-2-3/simpleswapfactory" @@ -1610,6 +1611,30 @@ func TestBouncedCheque(t *testing.T) { } } + // setup the wait for mined transaction function for testing + cleanup := setupContractTest() + defer cleanup() + + // ON RECEIVE EmitChequeMsg NO BOUNCED CHEQUE + // set balances arbitrarily + if err = debitor.setBalance(int64(testAmount)); err != nil { + t.Fatal(err) + } + if err = creditor.setBalance(int64(-testAmount)); err != nil { + t.Fatal(err) + } + + err = sendAndHandleCheque(ctx, testBackend, creditorSwap, debitorSwap, creditor, debitor) + if err != nil { + t.Fatal(err) + } + + // ON RECEIVE EmitChequeMsg NO BOUNCED CHEQUE + if cBounced, _ := creditor.getBouncedCheque(); cBounced { + t.Fatalf("Creditor should NOT have bounced cheques") + } + + // ON RECEIVE EmitChequeMsg BOUNCED CHEQUE // set balances arbitrarily if err = debitor.setBalance(int64(ChequeDebtTolerance * 1000)); err != nil { t.Fatal(err) @@ -1618,13 +1643,33 @@ func TestBouncedCheque(t *testing.T) { t.Fatal(err) } - // setup the wait for mined transaction function for testing - cleanup := setupContractTest() - defer cleanup() + err = sendAndHandleCheque(ctx, testBackend, creditorSwap, debitorSwap, creditor, debitor) + if err != nil { + t.Fatal(err) + } + + // ON RECEIVE EmitChequeMsg BOUNCED CHEQUE + if cBounced, _ := creditor.getBouncedCheque(); !cBounced { + t.Fatalf("Creditor should have bounced cheques") + } + + // ON CONNECT TO PEER BOUNCED CHEQUE + // Disconnect from peer and connect again + // There should be a bounced cheque + creditor.Disconnect(p2p.DiscUselessPeer) + debitorSwap.removePeer(creditor) + creditor, err = debitorSwap.addPeer(cPeer.Peer, creditorSwap.owner.address, debitorSwap.GetParams().ContractAddress) + if err != ErrBouncedCheque { + t.Fatal(err) + } + +} + +func sendAndHandleCheque(ctx context.Context, testBackend *swapTestBackend, creditorSwap *Swap, debitorSwap *Swap, creditor *Peer, debitor *Peer) (err error) { // now simulate sending the cheque to the creditor from the debitor if err = creditor.sendCheque(); err != nil { - t.Fatal(err) + return err } debitorSwap.handleConfirmChequeMsg(ctx, creditor, &ConfirmChequeMsg{ @@ -1632,13 +1677,13 @@ func TestBouncedCheque(t *testing.T) { }) // the debitor should have already reset its balance if creditor.getBalance() != 0 { - t.Fatalf("unexpected balance to be 0, but it is %d", creditor.getBalance()) + return fmt.Errorf("unexpected balance to be 0, but it is %d", creditor.getBalance()) } // now load the cheque that the debitor created... cheque := creditor.getLastSentCheque() if cheque == nil { - t.Fatal("expected to find a cheque, but it was empty") + return fmt.Errorf("expected to find a cheque, but it was empty") } // ...create a message... msg := &EmitChequeMsg{ @@ -1649,30 +1694,14 @@ func TestBouncedCheque(t *testing.T) { // remember that debitor is the model of the remote node for the creditor... err = creditorSwap.handleEmitChequeMsg(ctx, debitor, msg) if err != nil { - t.Fatal(err) + return err } // ...on which we wait until the cashCheque is actually terminated (ensures proper nonce count) select { case <-testBackend.cashDone: creditorSwap.logger.Debug(CashChequeAction, "cash transaction completed and committed") case <-time.After(4 * time.Second): - t.Fatalf("Timeout waiting for cash transactions to complete") - } - // ON RECEIVE EmitChequeMsg BOUNCED CHEQUE - if cBounced, _ := creditor.getBouncedCheque(); !cBounced { - t.Fatalf("Creditor should have bounced cheques") + return fmt.Errorf("Timeout waiting for cash transactions to complete") } - - // ON CONNECT TO PEER BOUNCED CHEQUE - // Disconnect from peer and connect again - // There should be a bounced cheque - //creditor.Disconnect(p2p.DiscUselessPeer) - //creditorSwap.removePeer(creditor) - - //creditor, err = debitorSwap.addPeer(cPeer.Peer, creditorSwap.owner.address, debitorSwap.GetParams().ContractAddress) - //if cBounced, _ := creditor.getBouncedCheque(); !cBounced { - // t.Fatalf("Creditor should have bounced cheques") - //} - - // ON RECEIVE EmitChequeMsg NO BOUNCED CHEQUE AFTER A COUPLE OF MESSAGES + return nil } From bde1927389900b2617376e8cc667a197df6d3cdd Mon Sep 17 00:00:00 2001 From: santicomp2014 Date: Wed, 1 Apr 2020 12:16:15 -0300 Subject: [PATCH 11/11] contracts/swap,swap: cleanup of comments and variable naming in code --- contracts/swap/swap.go | 4 ++-- swap/peer.go | 17 +++++++++-------- swap/protocol_test.go | 4 ++-- swap/swap.go | 4 ++-- swap/swap_test.go | 22 ++++++++++------------ 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index c556f5b4e2..30b4e4a735 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -93,8 +93,8 @@ func InstanceAt(address common.Address, backend chain.Backend) (Contract, error) return c, err } -// Bounced obtains if a cheque has been bounced previously of a contract at a specific address. -// Once it's bounced, it will not change it's state again, unless re deployed. +// Bounced returns the boolean indicating if a cheque attempted to be cashed has been bounced it in the receiver contract +// Once its bounced, it will not change it's state again, unless re deployed. func (s simpleContract) Bounced(opts *bind.CallOpts) (bool, error) { return s.instance.Bounced(opts) } diff --git a/swap/peer.go b/swap/peer.go index 9c31b33e43..59455f173f 100644 --- a/swap/peer.go +++ b/swap/peer.go @@ -72,12 +72,12 @@ func NewPeer(p *protocols.Peer, s *Swap, beneficiary common.Address, contractAdd return nil, err } - bounced := false - bounced, err = peer.getBouncedCheque() + bouncedCheque := false + bouncedCheque, err = peer.hasBouncedCheque() if err != nil { return nil, err } - if bounced { + if bouncedCheque { return nil, ErrBouncedCheque } @@ -231,18 +231,19 @@ func (p *Peer) sendCheque() error { }) } -// getBouncedCheque retrieves if a bounced cheque exists at address from the blockchain -func (p *Peer) getBouncedCheque() (bool, error) { - bounced := false +// hasBouncedCheque returns the boolean indicating if a cheque attempted to be cashed has been bounced it in the receiver peer +// Once its bounced, it will not change it's state again, unless re deployed. +func (p *Peer) hasBouncedCheque() (bool, error) { + bouncedCheque := false var err error // if chequebook not defined don't call contract methods if p.swap.contract != nil { - bounced, err = p.swap.contract.Bounced(nil) + bouncedCheque, err = p.swap.contract.Bounced(nil) if err != nil { return false, err } } - return bounced, nil + return bouncedCheque, nil } diff --git a/swap/protocol_test.go b/swap/protocol_test.go index 49a16a3b36..1d3c873459 100644 --- a/swap/protocol_test.go +++ b/swap/protocol_test.go @@ -548,10 +548,10 @@ func TestSwapRPC(t *testing.T) { swap, clean := newTestSwap(t, ownerKey, nil) defer clean() - // need to have a dummy contract or the call will fail at `GetParams` due to `NewAPI` depositAmount := int256.Uint256From(9000 * RetrieveRequestPrice) - // deploy a chequebook + // need to have a dummy contract or the call will fail at `GetParams` due to `NewAPI` + // deploy a chequebook due to bouncedCheque verification or it will fail err = testDeploy(context.TODO(), swap, depositAmount) if err != nil { t.Fatal(err) diff --git a/swap/swap.go b/swap/swap.go index 7f1d1d9cba..0e3ee77144 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -463,11 +463,11 @@ func (s *Swap) processAndVerifyCheque(cheque *Cheque, p *Peer) (*int256.Uint256, return nil, err } - bounced, err := p.getBouncedCheque() + bouncedCheque, err := p.hasBouncedCheque() if err != nil { return nil, err } - if bounced { + if bouncedCheque { return nil, ErrBouncedCheque } diff --git a/swap/swap_test.go b/swap/swap_test.go index f3f794da1b..e01b1c7f9b 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -1255,7 +1255,6 @@ func TestPeerProcessAndVerifyChequeInvalid(t *testing.T) { if err != nil { t.Fatal(err) } - /// =================================== if _, err := swap.processAndVerifyCheque(cheque, peer); err == nil { t.Fatal("accecpted an invalid cheque as first cheque") @@ -1593,7 +1592,7 @@ func TestBouncedCheque(t *testing.T) { dPeer := newDummyPeerWithSpec(Spec) creditor, err := debitorSwap.addPeer(cPeer.Peer, creditorSwap.owner.address, debitorSwap.GetParams().ContractAddress) if err != nil { - // ON CONNECT TO PEER NO BOUNCED CHEQUE + // On connection to peer fail if a bounced cheque exists if err == ErrBouncedCheque { t.Fatalf("Bounced cheque in chequebook") } else { @@ -1603,7 +1602,7 @@ func TestBouncedCheque(t *testing.T) { debitor, err := creditorSwap.addPeer(dPeer.Peer, debitorSwap.owner.address, debitorSwap.GetParams().ContractAddress) if err != nil { - // ON CONNECT TO PEER NO BOUNCED CHEQUE + // On connection to peer fail if a bounced cheque exists if err == ErrBouncedCheque { t.Fatalf("Bounced cheque in chequebook") } else { @@ -1615,7 +1614,7 @@ func TestBouncedCheque(t *testing.T) { cleanup := setupContractTest() defer cleanup() - // ON RECEIVE EmitChequeMsg NO BOUNCED CHEQUE + // Verifies no bounced cheque after correct cheque sent // set balances arbitrarily if err = debitor.setBalance(int64(testAmount)); err != nil { t.Fatal(err) @@ -1629,13 +1628,13 @@ func TestBouncedCheque(t *testing.T) { t.Fatal(err) } - // ON RECEIVE EmitChequeMsg NO BOUNCED CHEQUE - if cBounced, _ := creditor.getBouncedCheque(); cBounced { + // Verifies no bounced cheque after correct cheque sent + if creditorBouncedCheque, _ := creditor.hasBouncedCheque(); creditorBouncedCheque { t.Fatalf("Creditor should NOT have bounced cheques") } - // ON RECEIVE EmitChequeMsg BOUNCED CHEQUE - // set balances arbitrarily + // Verifies bounced cheque after incorrect cheque sent + // set balances that will cause a bounce cheque if err = debitor.setBalance(int64(ChequeDebtTolerance * 1000)); err != nil { t.Fatal(err) } @@ -1648,14 +1647,13 @@ func TestBouncedCheque(t *testing.T) { t.Fatal(err) } - // ON RECEIVE EmitChequeMsg BOUNCED CHEQUE - if cBounced, _ := creditor.getBouncedCheque(); !cBounced { + // Verify that bounced cheque is detected + if creditorBouncedCheque, _ := creditor.hasBouncedCheque(); !creditorBouncedCheque { t.Fatalf("Creditor should have bounced cheques") } - // ON CONNECT TO PEER BOUNCED CHEQUE // Disconnect from peer and connect again - // There should be a bounced cheque + // There should still be a bounced cheque creditor.Disconnect(p2p.DiscUselessPeer) debitorSwap.removePeer(creditor)