From 69df5705ceb8ed44797a2818efc8e1be3abc569c Mon Sep 17 00:00:00 2001 From: Ralph Pichler Date: Tue, 19 Nov 2019 13:06:43 +0100 Subject: [PATCH 01/22] swap, contracts, vendor: move to ERC20 note: while tests pass not all logic has been updated yet --- contracts/swap/factory.go | 7 +- contracts/swap/swap.go | 36 +- go.mod | 2 +- go.sum | 4 +- swap/simulations_test.go | 18 +- swap/swap_test.go | 36 +- .../btcsuite/btcd/btcec/genprecomps.go | 63 - .../docker/pkg/archive/example_changes.go | 97 - .../contracts-v0-1-1/simpleswap/code.go | 22 - .../contracts-v0-1-1/simpleswap/simpleswap.go | 2018 ------ .../simpleswapfactory/code.go | 22 - .../simpleswapfactory/simpleswapfactory.go | 2360 ------- .../contracts-v0-2-0/erc20simpleswap/code.go | 22 + .../erc20simpleswap/erc20simpleswap.go | 5037 +++++++++++++++ .../simpleswapfactory/code.go | 22 + .../simpleswapfactory/simpleswapfactory.go | 5405 +++++++++++++++++ vendor/golang.org/x/net/html/atom/gen.go | 712 --- vendor/golang.org/x/sys/unix/mkasm_darwin.go | 61 - vendor/golang.org/x/sys/unix/mkpost.go | 122 - vendor/golang.org/x/sys/unix/mksyscall.go | 407 -- .../x/sys/unix/mksyscall_aix_ppc.go | 415 -- .../x/sys/unix/mksyscall_aix_ppc64.go | 614 -- .../x/sys/unix/mksyscall_solaris.go | 335 - .../golang.org/x/sys/unix/mksysctl_openbsd.go | 355 -- vendor/golang.org/x/sys/unix/mksysnum.go | 190 - vendor/golang.org/x/sys/unix/types_aix.go | 237 - vendor/golang.org/x/sys/unix/types_darwin.go | 283 - .../golang.org/x/sys/unix/types_dragonfly.go | 263 - vendor/golang.org/x/sys/unix/types_freebsd.go | 400 -- vendor/golang.org/x/sys/unix/types_netbsd.go | 290 - vendor/golang.org/x/sys/unix/types_openbsd.go | 283 - vendor/golang.org/x/sys/unix/types_solaris.go | 266 - .../x/text/encoding/charmap/maketables.go | 556 -- .../x/text/encoding/htmlindex/gen.go | 173 - .../text/encoding/internal/identifier/gen.go | 142 - .../x/text/encoding/japanese/maketables.go | 161 - .../x/text/encoding/korean/maketables.go | 143 - .../encoding/simplifiedchinese/maketables.go | 161 - .../encoding/traditionalchinese/maketables.go | 140 - .../x/text/internal/language/compact/gen.go | 64 - .../internal/language/compact/gen_index.go | 113 - .../internal/language/compact/gen_parents.go | 54 - .../x/text/internal/language/gen.go | 1520 ----- .../x/text/internal/language/gen_common.go | 20 - vendor/golang.org/x/text/language/gen.go | 305 - vendor/golang.org/x/text/unicode/bidi/gen.go | 133 - .../x/text/unicode/bidi/gen_ranges.go | 57 - .../x/text/unicode/bidi/gen_trieval.go | 64 - .../x/text/unicode/norm/maketables.go | 986 --- .../golang.org/x/text/unicode/norm/triegen.go | 117 - vendor/modules.txt | 317 +- 51 files changed, 10715 insertions(+), 14915 deletions(-) delete mode 100644 vendor/github.com/btcsuite/btcd/btcec/genprecomps.go delete mode 100644 vendor/github.com/docker/docker/pkg/archive/example_changes.go delete mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswap/code.go delete mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswap/simpleswap.go delete mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswapfactory/code.go delete mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswapfactory/simpleswapfactory.go create mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/code.go create mode 100644 vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/erc20simpleswap.go create 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-0/simpleswapfactory/simpleswapfactory.go delete mode 100644 vendor/golang.org/x/net/html/atom/gen.go delete mode 100644 vendor/golang.org/x/sys/unix/mkasm_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/mkpost.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_solaris.go delete mode 100644 vendor/golang.org/x/sys/unix/mksysctl_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/mksysnum.go delete mode 100644 vendor/golang.org/x/sys/unix/types_aix.go delete mode 100644 vendor/golang.org/x/sys/unix/types_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/types_dragonfly.go delete mode 100644 vendor/golang.org/x/sys/unix/types_freebsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_netbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_solaris.go delete mode 100644 vendor/golang.org/x/text/encoding/charmap/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/htmlindex/gen.go delete mode 100644 vendor/golang.org/x/text/encoding/internal/identifier/gen.go delete mode 100644 vendor/golang.org/x/text/encoding/japanese/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/korean/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen_index.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen_parents.go delete mode 100644 vendor/golang.org/x/text/internal/language/gen.go delete mode 100644 vendor/golang.org/x/text/internal/language/gen_common.go delete mode 100644 vendor/golang.org/x/text/language/gen.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen_ranges.go delete mode 100644 vendor/golang.org/x/text/unicode/bidi/gen_trieval.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/maketables.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/triegen.go diff --git a/contracts/swap/factory.go b/contracts/swap/factory.go index 1808c1c4db..361b0ae225 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-1-1/simpleswapfactory" + chequebookFactory "github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory" ) var ( @@ -76,9 +76,10 @@ func (sf simpleSwapFactory) VerifySelf() error { // DeploySimpleSwap deploys a new SimpleSwap contract from the factory and returns the ready to use Contract abstraction func (sf simpleSwapFactory) DeploySimpleSwap(auth *bind.TransactOpts, issuer common.Address, defaultHardDepositTimeoutDuration *big.Int) (Contract, error) { // for some reason the automatic gas estimation is too low - // this value was determind by deploying through truffle and rounding up to the next 100000 + // this value was determined by experimentation and is higher than what works in truffle + // this might be due to the simulated backend running on a different evm version // the deployment cost should always be constant - auth.GasLimit = 1700000 + auth.GasLimit = 2000000 tx, err := sf.instance.DeploySimpleSwap(auth, issuer, defaultHardDepositTimeoutDuration) if err != nil { return nil, err diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index f9cfe5f417..fb56a14248 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -24,12 +24,11 @@ import ( "errors" "fmt" "math/big" - "time" "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-1-1/simpleswap" + contract "github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap" ) var ( @@ -80,23 +79,16 @@ type Params struct { } type simpleContract struct { - instance *contract.SimpleSwap + instance *contract.ERC20SimpleSwap address common.Address backend Backend } -// Deploy deploys an instance of the underlying contract and returns its instance and the transaction identifier -func Deploy(auth *bind.TransactOpts, backend Backend, owner common.Address, harddepositTimeout time.Duration) (Contract, *types.Transaction, error) { - addr, tx, instance, err := contract.DeploySimpleSwap(auth, backend, owner, big.NewInt(int64(harddepositTimeout))) - c := simpleContract{instance: instance, address: addr, backend: backend} - return c, tx, err -} - // InstanceAt creates a new instance of a contract at a specific address. // It assumes that there is an existing contract instance at the given address, or an error is returned // This function is needed to communicate with remote Swap contracts (e.g. sending a cheque) func InstanceAt(address common.Address, backend Backend) (Contract, error) { - instance, err := contract.NewSimpleSwap(address, backend) + instance, err := contract.NewERC20SimpleSwap(address, backend) if err != nil { return nil, err } @@ -115,15 +107,21 @@ func (s simpleContract) Withdraw(auth *bind.TransactOpts, backend Backend, amoun // Deposit sends a transaction to the chequebook, which deposits the amount set in Auth.Value and blocks until the transaction is mined func (s simpleContract) Deposit(auth *bind.TransactOpts, backend Backend, amount *big.Int) (*types.Receipt, error) { - rawSimpleSwap := contract.SimpleSwapRaw{Contract: s.instance} - if auth.Value != big.NewInt(0) { - return nil, fmt.Errorf("Deposit value can only be set via amount parameter") - } if amount == big.NewInt(0) { return nil, fmt.Errorf("Deposit amount cannot be equal to zero") } - auth.Value = amount - tx, err := rawSimpleSwap.Transfer(auth) + + tokenAddress, err := s.instance.Token(nil) + if err != nil { + return nil, err + } + + token, err := contract.NewERC20(tokenAddress, nil) + if err != nil { + return nil, err + } + + tx, err := token.Transfer(auth, s.address, amount) if err != nil { return nil, err } @@ -172,8 +170,8 @@ func (s simpleContract) LiquidBalance(opts *bind.CallOpts) (*big.Int, error) { // ContractParams returns contract information func (s simpleContract) ContractParams() *Params { return &Params{ - ContractCode: contract.SimpleSwapBin, - ContractAbi: contract.SimpleSwapABI, + ContractCode: contract.ERC20SimpleSwapBin, + ContractAbi: contract.ERC20SimpleSwapABI, ContractAddress: s.address, } } diff --git a/go.mod b/go.mod index de1a38c1dd..82631ded63 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c // indirect github.com/elastic/gosigar v0.0.0-20180330100440-37f05ff46ffa // indirect github.com/ethereum/go-ethereum v1.9.2 - github.com/ethersphere/go-sw3 v0.1.1 + github.com/ethersphere/go-sw3 v0.2.0 github.com/fatih/color v1.7.0 // indirect github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc github.com/gballet/go-libpcsclite v0.0.0-20190528105824-2fd9b619dd3c // indirect diff --git a/go.sum b/go.sum index c0fb5f80eb..60f62c8580 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,8 @@ github.com/elastic/gosigar v0.0.0-20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/ethereum/go-ethereum v1.9.2 h1:RMIHDO/diqXEgORSVzYx8xW9x2+S32PoAX5lQwya0Lw= github.com/ethereum/go-ethereum v1.9.2/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= -github.com/ethersphere/go-sw3 v0.1.1 h1:czLnLSU0/XJLJt/GyPiEAds9YYnIgZZzfy+OQyiYQtk= -github.com/ethersphere/go-sw3 v0.1.1/go.mod h1:HukT0aZ6QdW/d7zuD/0g5xlw6ewu9QeqHojxLDsaERQ= +github.com/ethersphere/go-sw3 v0.2.0 h1:o+YtqwsOWBGNr3nO19WU/sokc53ZV3IxZDvRasSdjko= +github.com/ethersphere/go-sw3 v0.2.0/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/simulations_test.go b/swap/simulations_test.go index aefc479730..f2cba87841 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-1-1/simpleswapfactory" + contractFactory "github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory" cswap "github.com/ethersphere/swarm/contracts/swap" "github.com/ethersphere/swarm/network/simulation" "github.com/ethersphere/swarm/p2p/protocols" @@ -215,7 +215,21 @@ func newSharedBackendSwaps(t *testing.T, nodeCount int) (*swapSimulationParams, defaultBackend := backends.NewSimulatedBackend(alloc, gasLimit) defaultBackend.Commit() - factoryAddress, _, _, err := contractFactory.DeploySimpleSwapFactory(bind.NewKeyedTransactor(keys[0]), defaultBackend) + tokenAddress, _, token, err := contractFactory.DeployERC20Mintable(bind.NewKeyedTransactor(keys[0]), defaultBackend) + if err != nil { + return nil, err + } + defaultBackend.Commit() + + for i := 0; i < nodeCount; i++ { + _, err = token.Mint(bind.NewKeyedTransactor(keys[0]), addrs[i], big.NewInt(10000*int64(RetrieveRequestPrice))) + if err != nil { + return nil, err + } + defaultBackend.Commit() + } + + factoryAddress, _, _, err := contractFactory.DeploySimpleSwapFactory(bind.NewKeyedTransactor(keys[0]), defaultBackend, tokenAddress) if err != nil { t.Fatalf("Error while deploying factory: %v", err) } diff --git a/swap/swap_test.go b/swap/swap_test.go index ba0b4ba28d..7b74e3bc21 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -48,7 +48,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" - contractFactory "github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswapfactory" + contractFactory "github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory" "github.com/ethersphere/swarm/contracts/swap" cswap "github.com/ethersphere/swarm/contracts/swap" "github.com/ethersphere/swarm/p2p/protocols" @@ -79,6 +79,7 @@ type booking struct { type swapTestBackend struct { *backends.SimulatedBackend factoryAddress common.Address // address of the SimpleSwapFactory in the simulated network + tokenAddress common.Address // address of the token in the simulated network // the async cashing go routine needs synchronization for tests cashDone chan struct{} } @@ -112,13 +113,29 @@ func newTestBackend() *swapTestBackend { // commit the initial "pre-mined" accounts (issuer and beneficiary addresses) defaultBackend.Commit() + tokenAddress, _, token, err := contractFactory.DeployERC20Mintable(bind.NewKeyedTransactor(ownerKey), defaultBackend) + if err != nil { + log.Crit(err.Error()) + } + defaultBackend.Commit() + + _, err = token.Mint(bind.NewKeyedTransactor(ownerKey), ownerAddress, big.NewInt(1000000000000000000)) + if err != nil { + log.Crit(err.Error()) + } + defaultBackend.Commit() + // deploy a SimpleSwapFactoy - factoryAddress, _, _, _ := contractFactory.DeploySimpleSwapFactory(bind.NewKeyedTransactor(ownerKey), defaultBackend) + factoryAddress, _, _, err := contractFactory.DeploySimpleSwapFactory(bind.NewKeyedTransactor(ownerKey), defaultBackend, tokenAddress) + if err != nil { + log.Crit(err.Error()) + } defaultBackend.Commit() return &swapTestBackend{ SimulatedBackend: defaultBackend, factoryAddress: factoryAddress, + tokenAddress: tokenAddress, } } @@ -1043,7 +1060,7 @@ func TestVerifyContractNotDeployedByFactory(t *testing.T) { opts := bind.NewKeyedTransactor(ownerKey) - addr, _, _, err := contractFactory.DeploySimpleSwap(opts, swap.backend, ownerAddress, big.NewInt(int64(defaultHarddepositTimeoutDuration))) + addr, _, _, err := contractFactory.DeployERC20SimpleSwap(opts, swap.backend, ownerAddress, common.Address{}, big.NewInt(int64(defaultHarddepositTimeoutDuration))) if err != nil { t.Fatalf("Error in deploy: %v", err) } @@ -1225,7 +1242,6 @@ func testWaitForTx(auth *bind.TransactOpts, backend cswap.Backend, tx *types.Tra // deploy for testing (needs simulated backend commit) func testDeploy(ctx context.Context, swap *Swap) (err error) { opts := bind.NewKeyedTransactor(swap.owner.privateKey) - opts.Value = big.NewInt(9000 * int64(RetrieveRequestPrice)) opts.Context = ctx var stb *swapTestBackend @@ -1242,12 +1258,22 @@ func testDeploy(ctx context.Context, swap *Swap) (err error) { // setup the wait for mined transaction function for testing cleanup := setupContractTest() defer cleanup() - swap.contract, err = factory.DeploySimpleSwap(opts, swap.owner.address, big.NewInt(int64(defaultHarddepositTimeoutDuration))) if err != nil { return err } + stb.Commit() + // send money into the new chequebook + token, err := contractFactory.NewERC20(stb.tokenAddress, stb) + if err != nil { + return err + } + + _, err = token.Transfer(opts, swap.contract.ContractParams().ContractAddress, big.NewInt(9000*int64(RetrieveRequestPrice))) + if err != nil { + return err + } stb.Commit() return err diff --git a/vendor/github.com/btcsuite/btcd/btcec/genprecomps.go b/vendor/github.com/btcsuite/btcd/btcec/genprecomps.go deleted file mode 100644 index d4a9c1b830..0000000000 --- a/vendor/github.com/btcsuite/btcd/btcec/genprecomps.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2015 The btcsuite developers -// Use of this source code is governed by an ISC -// license that can be found in the LICENSE file. - -// This file is ignored during the regular build due to the following build tag. -// It is called by go generate and used to automatically generate pre-computed -// tables used to accelerate operations. -// +build ignore - -package main - -import ( - "bytes" - "compress/zlib" - "encoding/base64" - "fmt" - "log" - "os" - - "github.com/btcsuite/btcd/btcec" -) - -func main() { - fi, err := os.Create("secp256k1.go") - if err != nil { - log.Fatal(err) - } - defer fi.Close() - - // Compress the serialized byte points. - serialized := btcec.S256().SerializedBytePoints() - var compressed bytes.Buffer - w := zlib.NewWriter(&compressed) - if _, err := w.Write(serialized); err != nil { - fmt.Println(err) - os.Exit(1) - } - w.Close() - - // Encode the compressed byte points with base64. - encoded := make([]byte, base64.StdEncoding.EncodedLen(compressed.Len())) - base64.StdEncoding.Encode(encoded, compressed.Bytes()) - - fmt.Fprintln(fi, "// Copyright (c) 2015 The btcsuite developers") - fmt.Fprintln(fi, "// Use of this source code is governed by an ISC") - fmt.Fprintln(fi, "// license that can be found in the LICENSE file.") - fmt.Fprintln(fi) - fmt.Fprintln(fi, "package btcec") - fmt.Fprintln(fi) - fmt.Fprintln(fi, "// Auto-generated file (see genprecomps.go)") - fmt.Fprintln(fi, "// DO NOT EDIT") - fmt.Fprintln(fi) - fmt.Fprintf(fi, "var secp256k1BytePoints = %q\n", string(encoded)) - - a1, b1, a2, b2 := btcec.S256().EndomorphismVectors() - fmt.Println("The following values are the computed linearly " + - "independent vectors needed to make use of the secp256k1 " + - "endomorphism:") - fmt.Printf("a1: %x\n", a1) - fmt.Printf("b1: %x\n", b1) - fmt.Printf("a2: %x\n", a2) - fmt.Printf("b2: %x\n", b2) -} diff --git a/vendor/github.com/docker/docker/pkg/archive/example_changes.go b/vendor/github.com/docker/docker/pkg/archive/example_changes.go deleted file mode 100644 index 495db809e9..0000000000 --- a/vendor/github.com/docker/docker/pkg/archive/example_changes.go +++ /dev/null @@ -1,97 +0,0 @@ -// +build ignore - -// Simple tool to create an archive stream from an old and new directory -// -// By default it will stream the comparison of two temporary directories with junk files -package main - -import ( - "flag" - "fmt" - "io" - "io/ioutil" - "os" - "path" - - "github.com/docker/docker/pkg/archive" - "github.com/sirupsen/logrus" -) - -var ( - flDebug = flag.Bool("D", false, "debugging output") - flNewDir = flag.String("newdir", "", "") - flOldDir = flag.String("olddir", "", "") - log = logrus.New() -) - -func main() { - flag.Usage = func() { - fmt.Println("Produce a tar from comparing two directory paths. By default a demo tar is created of around 200 files (including hardlinks)") - fmt.Printf("%s [OPTIONS]\n", os.Args[0]) - flag.PrintDefaults() - } - flag.Parse() - log.Out = os.Stderr - if (len(os.Getenv("DEBUG")) > 0) || *flDebug { - logrus.SetLevel(logrus.DebugLevel) - } - var newDir, oldDir string - - if len(*flNewDir) == 0 { - var err error - newDir, err = ioutil.TempDir("", "docker-test-newDir") - if err != nil { - log.Fatal(err) - } - defer os.RemoveAll(newDir) - if _, err := prepareUntarSourceDirectory(100, newDir, true); err != nil { - log.Fatal(err) - } - } else { - newDir = *flNewDir - } - - if len(*flOldDir) == 0 { - oldDir, err := ioutil.TempDir("", "docker-test-oldDir") - if err != nil { - log.Fatal(err) - } - defer os.RemoveAll(oldDir) - } else { - oldDir = *flOldDir - } - - changes, err := archive.ChangesDirs(newDir, oldDir) - if err != nil { - log.Fatal(err) - } - - a, err := archive.ExportChanges(newDir, changes) - if err != nil { - log.Fatal(err) - } - defer a.Close() - - i, err := io.Copy(os.Stdout, a) - if err != nil && err != io.EOF { - log.Fatal(err) - } - fmt.Fprintf(os.Stderr, "wrote archive of %d bytes", i) -} - -func prepareUntarSourceDirectory(numberOfFiles int, targetPath string, makeLinks bool) (int, error) { - fileData := []byte("fooo") - for n := 0; n < numberOfFiles; n++ { - fileName := fmt.Sprintf("file-%d", n) - if err := ioutil.WriteFile(path.Join(targetPath, fileName), fileData, 0700); err != nil { - return 0, err - } - if makeLinks { - if err := os.Link(path.Join(targetPath, fileName), path.Join(targetPath, fileName+"-link")); err != nil { - return 0, err - } - } - } - totalSize := numberOfFiles * len(fileData) - return totalSize, nil -} diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswap/code.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswap/code.go deleted file mode 100644 index 7056d43390..0000000000 --- a/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswap/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 simpleswap - - // SimpleSwapDeployedCode is the bytecode SimpleSwap will have after deployment - const SimpleSwapDeployedCode = "0x6080604052600436106100dd5760003560e01c806381f03fcb1161007f578063b777035011610059578063b7770350146106a6578063b7ec1a3314610701578063df3243801461072c578063e0bcf13a1461081e576100dd565b806381f03fcb14610576578063946f46a2146105db578063b6343b0d1461062c576100dd565b80631d143848116100bb5780631d1438481461045e5780632e1a7d4d146104b5578063338f3fed146104f05780635eb541601461054b576100dd565b8063065c804f146101545780630d5f2659146101b95780631633fb1d146102ab575b6000341115610152577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b005b34801561016057600080fd5b506101a36004803603602081101561017757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610849565b6040518082815260200191505060405180910390f35b3480156101c557600080fd5b506102a9600480360360608110156101dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561022357600080fd5b82018360208201111561023557600080fd5b8035906020019184600183028401116401000000008311171561025757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108ae565b005b3480156102b757600080fd5b5061045c600480360360c08110156102ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561033557600080fd5b82018360208201111561034757600080fd5b8035906020019184600183028401116401000000008311171561036957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001906401000000008111156103d657600080fd5b8201836020820111156103e857600080fd5b8035906020019184600183028401116401000000008311171561040a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108c1565b005b34801561046a57600080fd5b5061047361096f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c157600080fd5b506104ee600480360360208110156104d857600080fd5b8101908080359060200190929190505050610995565b005b3480156104fc57600080fd5b506105496004803603604081101561051357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5b565b005b34801561055757600080fd5b50610560610d80565b6040518082815260200191505060405180910390f35b34801561058257600080fd5b506105c56004803603602081101561059957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d86565b6040518082815260200191505060405180910390f35b3480156105e757600080fd5b5061062a600480360360208110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d9e565b005b34801561063857600080fd5b5061067b6004803603602081101561064f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef1565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b3480156106b257600080fd5b506106ff600480360360408110156106c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f21565b005b34801561070d57600080fd5b50610716611109565b6040518082815260200191505060405180910390f35b34801561073857600080fd5b5061081c6004803603606081101561074f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561079657600080fd5b8201836020820111156107a857600080fd5b803590602001918460018302840111640100000000831117156107ca57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061113c565b005b34801561082a57600080fd5b50610833611372565b6040518082815260200191505060405180910390f35b60006108a7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610899611109565b61137890919063ffffffff16565b9050919050565b6108bc338484600085611400565b505050565b6108d76108d13033878987611925565b84611a06565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461095a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b6109678686868585611400565b505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610a60611109565b811115610ab8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611e036028913960400191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b20573d6000803e3d6000fd5b507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d816040518082815260200191505060405180910390a150565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1631610c4b8260035461137890919063ffffffff16565b1115610ca2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611d616034913960400191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cfc82826000015461137890919063ffffffff16565b8160000181905550610d198260035461137890919063ffffffff16565b600381905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60005481565b60016020528060005260406000206000915090505481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dfa57506000816003015414155b610e4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611db76025913960400191505060405180910390fd5b610e6a81600101548260000154611a2290919063ffffffff16565b816000018190555060008160030181905550610e958160010154600354611a2290919063ffffffff16565b6003819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60026020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fe4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000154821115611084576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611ddc6027913960400191505060405180910390fd5b60008082600201541461109b57816002015461109f565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111376003543073ffffffffffffffffffffffffffffffffffffffff1631611a2290919063ffffffff16565b905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61121361120d308585611aab565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546040518082815260200191505060405180910390a2505050565b60035481565b6000808284019050838110156113f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461152c57611469611463308786611b4b565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461152b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b6000611580600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611a2290919063ffffffff16565b905060006115968261159189610849565b611beb565b905060006115e682600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611beb565b90508482101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b6000811461171d576116bb81600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611a2290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061171681600354611a2290919063ffffffff16565b6003819055505b61176f82600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137890919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff166108fc6117df8785611a2290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561180a573d6000803e3d6000fd5b506000851461185b573373ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015611859573d6000803e3d6000fd5b505b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a481831461191b577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611a1a611a1484611c04565b83611c5c565b905092915050565b600082821115611a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611bfa5781611bfc565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611c705760009050611d5a565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611cc45760009350505050611d5a565b601b8160ff1614158015611cdc5750601c8160ff1614155b15611ced5760009350505050611d5a565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611d4a573d6000803e3d6000fd5b5050506020604051035193505050505b9291505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582089af678b6e43eebcf058524d8177d9f06f37f73f03c7dec537f3652623c5ea4f64736f6c634300050b0032" diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswap/simpleswap.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswap/simpleswap.go deleted file mode 100644 index b314ec2084..0000000000 --- a/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswap/simpleswap.go +++ /dev/null @@ -1,2018 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package simpleswap - -import ( - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = abi.U256 - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// ECDSAABI is the input ABI used to generate the binding from. -const ECDSAABI = "[]" - -// ECDSABin is the compiled bytecode used for deploying new contracts. -var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158207d4a51dc51591c15576f3f090bcc64fce0d144dc00f5c2b1b5d8a2e33c87ec1664736f6c634300050b0032" - -// 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) { - parsed, err := abi.JSON(strings.NewReader(ECDSAABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ECDSABin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &ECDSA{ECDSACaller: ECDSACaller{contract: contract}, ECDSATransactor: ECDSATransactor{contract: contract}, ECDSAFilterer: ECDSAFilterer{contract: contract}}, nil -} - -// ECDSA is an auto generated Go binding around an Ethereum contract. -type ECDSA struct { - ECDSACaller // Read-only binding to the contract - ECDSATransactor // Write-only binding to the contract - ECDSAFilterer // Log filterer for contract events -} - -// ECDSACaller is an auto generated read-only Go binding around an Ethereum contract. -type ECDSACaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ECDSATransactor is an auto generated write-only Go binding around an Ethereum contract. -type ECDSATransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ECDSAFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ECDSAFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ECDSASession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type ECDSASession struct { - Contract *ECDSA // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ECDSACallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type ECDSACallerSession struct { - Contract *ECDSACaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// ECDSATransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type ECDSATransactorSession struct { - Contract *ECDSATransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ECDSARaw is an auto generated low-level Go binding around an Ethereum contract. -type ECDSARaw struct { - Contract *ECDSA // Generic contract binding to access the raw methods on -} - -// ECDSACallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ECDSACallerRaw struct { - Contract *ECDSACaller // Generic read-only contract binding to access the raw methods on -} - -// ECDSATransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ECDSATransactorRaw struct { - Contract *ECDSATransactor // Generic write-only contract binding to access the raw methods on -} - -// NewECDSA creates a new instance of ECDSA, bound to a specific deployed contract. -func NewECDSA(address common.Address, backend bind.ContractBackend) (*ECDSA, error) { - contract, err := bindECDSA(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &ECDSA{ECDSACaller: ECDSACaller{contract: contract}, ECDSATransactor: ECDSATransactor{contract: contract}, ECDSAFilterer: ECDSAFilterer{contract: contract}}, nil -} - -// NewECDSACaller creates a new read-only instance of ECDSA, bound to a specific deployed contract. -func NewECDSACaller(address common.Address, caller bind.ContractCaller) (*ECDSACaller, error) { - contract, err := bindECDSA(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ECDSACaller{contract: contract}, nil -} - -// NewECDSATransactor creates a new write-only instance of ECDSA, bound to a specific deployed contract. -func NewECDSATransactor(address common.Address, transactor bind.ContractTransactor) (*ECDSATransactor, error) { - contract, err := bindECDSA(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ECDSATransactor{contract: contract}, nil -} - -// NewECDSAFilterer creates a new log filterer instance of ECDSA, bound to a specific deployed contract. -func NewECDSAFilterer(address common.Address, filterer bind.ContractFilterer) (*ECDSAFilterer, error) { - contract, err := bindECDSA(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ECDSAFilterer{contract: contract}, nil -} - -// bindECDSA binds a generic wrapper to an already deployed contract. -func bindECDSA(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(ECDSAABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_ECDSA *ECDSARaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _ECDSA.Contract.ECDSACaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_ECDSA *ECDSARaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ECDSA.Contract.ECDSATransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ECDSA *ECDSARaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ECDSA.Contract.ECDSATransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_ECDSA *ECDSACallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _ECDSA.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_ECDSA *ECDSATransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ECDSA.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ECDSA *ECDSATransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ECDSA.Contract.contract.Transact(opts, method, params...) -} - -// MathABI is the input ABI used to generate the binding from. -const MathABI = "[]" - -// MathBin is the compiled bytecode used for deploying new contracts. -var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158203d48eda12ade7ffd2511c167327d7097a04df9d90d01f741c63a03038c920bbb64736f6c634300050b0032" - -// 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) { - parsed, err := abi.JSON(strings.NewReader(MathABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MathBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Math{MathCaller: MathCaller{contract: contract}, MathTransactor: MathTransactor{contract: contract}, MathFilterer: MathFilterer{contract: contract}}, nil -} - -// Math is an auto generated Go binding around an Ethereum contract. -type Math struct { - MathCaller // Read-only binding to the contract - MathTransactor // Write-only binding to the contract - MathFilterer // Log filterer for contract events -} - -// MathCaller is an auto generated read-only Go binding around an Ethereum contract. -type MathCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MathTransactor is an auto generated write-only Go binding around an Ethereum contract. -type MathTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MathFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type MathFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MathSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type MathSession struct { - Contract *Math // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// MathCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type MathCallerSession struct { - Contract *MathCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// MathTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type MathTransactorSession struct { - Contract *MathTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// MathRaw is an auto generated low-level Go binding around an Ethereum contract. -type MathRaw struct { - Contract *Math // Generic contract binding to access the raw methods on -} - -// MathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type MathCallerRaw struct { - Contract *MathCaller // Generic read-only contract binding to access the raw methods on -} - -// MathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type MathTransactorRaw struct { - Contract *MathTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewMath creates a new instance of Math, bound to a specific deployed contract. -func NewMath(address common.Address, backend bind.ContractBackend) (*Math, error) { - contract, err := bindMath(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Math{MathCaller: MathCaller{contract: contract}, MathTransactor: MathTransactor{contract: contract}, MathFilterer: MathFilterer{contract: contract}}, nil -} - -// NewMathCaller creates a new read-only instance of Math, bound to a specific deployed contract. -func NewMathCaller(address common.Address, caller bind.ContractCaller) (*MathCaller, error) { - contract, err := bindMath(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &MathCaller{contract: contract}, nil -} - -// NewMathTransactor creates a new write-only instance of Math, bound to a specific deployed contract. -func NewMathTransactor(address common.Address, transactor bind.ContractTransactor) (*MathTransactor, error) { - contract, err := bindMath(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &MathTransactor{contract: contract}, nil -} - -// NewMathFilterer creates a new log filterer instance of Math, bound to a specific deployed contract. -func NewMathFilterer(address common.Address, filterer bind.ContractFilterer) (*MathFilterer, error) { - contract, err := bindMath(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &MathFilterer{contract: contract}, nil -} - -// bindMath binds a generic wrapper to an already deployed contract. -func bindMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(MathABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Math *MathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _Math.Contract.MathCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Math *MathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Math.Contract.MathTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Math *MathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Math.Contract.MathTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Math *MathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _Math.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Math *MathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Math.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Math *MathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Math.Contract.contract.Transact(opts, method, params...) -} - -// SafeMathABI is the input ABI used to generate the binding from. -const SafeMathABI = "[]" - -// SafeMathBin is the compiled bytecode used for deploying new contracts. -var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820e713fd774261cf97036ea1b8fcf34d15dfef29b8ed77519add1c0348b139cfcf64736f6c634300050b0032" - -// 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) { - parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SafeMathBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil -} - -// SafeMath is an auto generated Go binding around an Ethereum contract. -type SafeMath struct { - SafeMathCaller // Read-only binding to the contract - SafeMathTransactor // Write-only binding to the contract - SafeMathFilterer // Log filterer for contract events -} - -// SafeMathCaller is an auto generated read-only Go binding around an Ethereum contract. -type SafeMathCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SafeMathTransactor is an auto generated write-only Go binding around an Ethereum contract. -type SafeMathTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SafeMathFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type SafeMathFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SafeMathSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type SafeMathSession struct { - Contract *SafeMath // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SafeMathCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type SafeMathCallerSession struct { - Contract *SafeMathCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// SafeMathTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type SafeMathTransactorSession struct { - Contract *SafeMathTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SafeMathRaw is an auto generated low-level Go binding around an Ethereum contract. -type SafeMathRaw struct { - Contract *SafeMath // Generic contract binding to access the raw methods on -} - -// SafeMathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type SafeMathCallerRaw struct { - Contract *SafeMathCaller // Generic read-only contract binding to access the raw methods on -} - -// SafeMathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type SafeMathTransactorRaw struct { - Contract *SafeMathTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewSafeMath creates a new instance of SafeMath, bound to a specific deployed contract. -func NewSafeMath(address common.Address, backend bind.ContractBackend) (*SafeMath, error) { - contract, err := bindSafeMath(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil -} - -// NewSafeMathCaller creates a new read-only instance of SafeMath, bound to a specific deployed contract. -func NewSafeMathCaller(address common.Address, caller bind.ContractCaller) (*SafeMathCaller, error) { - contract, err := bindSafeMath(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &SafeMathCaller{contract: contract}, nil -} - -// NewSafeMathTransactor creates a new write-only instance of SafeMath, bound to a specific deployed contract. -func NewSafeMathTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeMathTransactor, error) { - contract, err := bindSafeMath(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &SafeMathTransactor{contract: contract}, nil -} - -// NewSafeMathFilterer creates a new log filterer instance of SafeMath, bound to a specific deployed contract. -func NewSafeMathFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeMathFilterer, error) { - contract, err := bindSafeMath(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &SafeMathFilterer{contract: contract}, nil -} - -// bindSafeMath binds a generic wrapper to an already deployed contract. -func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SafeMath *SafeMathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SafeMath.Contract.SafeMathTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SafeMath.Contract.SafeMathTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SafeMath.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SafeMath *SafeMathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SafeMath.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SafeMath *SafeMathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SafeMath.Contract.contract.Transact(opts, method, params...) -} - -// SimpleSwapABI is the input ABI used to generate the binding from. -const SimpleSwapABI = "[{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"availableBalanceFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"addresspayable\",\"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\"},{\"internalType\":\"addresspayable\",\"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\":true,\"inputs\":[],\"name\":\"issuer\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"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\":\"DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT\",\"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\"}],\"name\":\"decreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"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\":\"decreaseTimeout\",\"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\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"prepareDecreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"liquidBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"decreaseTimeout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"}],\"name\":\"setCustomHardDepositDecreaseTimeout\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalHardDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"defaultHardDepositTimeoutDuration\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"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\":[],\"name\":\"ChequeBounced\",\"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\":\"decreaseTimeout\",\"type\":\"uint256\"}],\"name\":\"HardDepositDecreaseTimeoutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"}]" - -// SimpleSwapBin is the compiled bytecode used for deploying new contracts. -var SimpleSwapBin = "0x6080604052604051611f6e380380611f6e8339818101604052604081101561002657600080fd5b8101908080519060200190929190805190602001909291905050508060008190555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060003411156100fe577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5050611e5f8061010f6000396000f3fe6080604052600436106100dd5760003560e01c806381f03fcb1161007f578063b777035011610059578063b7770350146106a6578063b7ec1a3314610701578063df3243801461072c578063e0bcf13a1461081e576100dd565b806381f03fcb14610576578063946f46a2146105db578063b6343b0d1461062c576100dd565b80631d143848116100bb5780631d1438481461045e5780632e1a7d4d146104b5578063338f3fed146104f05780635eb541601461054b576100dd565b8063065c804f146101545780630d5f2659146101b95780631633fb1d146102ab575b6000341115610152577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b005b34801561016057600080fd5b506101a36004803603602081101561017757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610849565b6040518082815260200191505060405180910390f35b3480156101c557600080fd5b506102a9600480360360608110156101dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561022357600080fd5b82018360208201111561023557600080fd5b8035906020019184600183028401116401000000008311171561025757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108ae565b005b3480156102b757600080fd5b5061045c600480360360c08110156102ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561033557600080fd5b82018360208201111561034757600080fd5b8035906020019184600183028401116401000000008311171561036957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001906401000000008111156103d657600080fd5b8201836020820111156103e857600080fd5b8035906020019184600183028401116401000000008311171561040a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108c1565b005b34801561046a57600080fd5b5061047361096f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c157600080fd5b506104ee600480360360208110156104d857600080fd5b8101908080359060200190929190505050610995565b005b3480156104fc57600080fd5b506105496004803603604081101561051357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5b565b005b34801561055757600080fd5b50610560610d80565b6040518082815260200191505060405180910390f35b34801561058257600080fd5b506105c56004803603602081101561059957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d86565b6040518082815260200191505060405180910390f35b3480156105e757600080fd5b5061062a600480360360208110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d9e565b005b34801561063857600080fd5b5061067b6004803603602081101561064f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef1565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b3480156106b257600080fd5b506106ff600480360360408110156106c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f21565b005b34801561070d57600080fd5b50610716611109565b6040518082815260200191505060405180910390f35b34801561073857600080fd5b5061081c6004803603606081101561074f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561079657600080fd5b8201836020820111156107a857600080fd5b803590602001918460018302840111640100000000831117156107ca57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061113c565b005b34801561082a57600080fd5b50610833611372565b6040518082815260200191505060405180910390f35b60006108a7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610899611109565b61137890919063ffffffff16565b9050919050565b6108bc338484600085611400565b505050565b6108d76108d13033878987611925565b84611a06565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461095a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b6109678686868585611400565b505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610a60611109565b811115610ab8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611e036028913960400191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b20573d6000803e3d6000fd5b507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d816040518082815260200191505060405180910390a150565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1631610c4b8260035461137890919063ffffffff16565b1115610ca2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611d616034913960400191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cfc82826000015461137890919063ffffffff16565b8160000181905550610d198260035461137890919063ffffffff16565b600381905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60005481565b60016020528060005260406000206000915090505481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dfa57506000816003015414155b610e4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611db76025913960400191505060405180910390fd5b610e6a81600101548260000154611a2290919063ffffffff16565b816000018190555060008160030181905550610e958160010154600354611a2290919063ffffffff16565b6003819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60026020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fe4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000154821115611084576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611ddc6027913960400191505060405180910390fd5b60008082600201541461109b57816002015461109f565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111376003543073ffffffffffffffffffffffffffffffffffffffff1631611a2290919063ffffffff16565b905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61121361120d308585611aab565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546040518082815260200191505060405180910390a2505050565b60035481565b6000808284019050838110156113f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461152c57611469611463308786611b4b565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461152b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b6000611580600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611a2290919063ffffffff16565b905060006115968261159189610849565b611beb565b905060006115e682600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611beb565b90508482101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b6000811461171d576116bb81600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611a2290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061171681600354611a2290919063ffffffff16565b6003819055505b61176f82600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137890919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff166108fc6117df8785611a2290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561180a573d6000803e3d6000fd5b506000851461185b573373ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015611859573d6000803e3d6000fd5b505b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a481831461191b577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611a1a611a1484611c04565b83611c5c565b905092915050565b600082821115611a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611bfa5781611bfc565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611c705760009050611d5a565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611cc45760009350505050611d5a565b601b8160ff1614158015611cdc5750601c8160ff1614155b15611ced5760009350505050611d5a565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611d4a573d6000803e3d6000fd5b5050506020604051035193505050505b9291505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582089af678b6e43eebcf058524d8177d9f06f37f73f03c7dec537f3652623c5ea4f64736f6c634300050b0032" - -// DeploySimpleSwap deploys a new Ethereum contract, binding an instance of SimpleSwap to it. -func DeploySimpleSwap(auth *bind.TransactOpts, backend bind.ContractBackend, _issuer common.Address, defaultHardDepositTimeoutDuration *big.Int) (common.Address, *types.Transaction, *SimpleSwap, error) { - parsed, err := abi.JSON(strings.NewReader(SimpleSwapABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SimpleSwapBin), backend, _issuer, defaultHardDepositTimeoutDuration) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &SimpleSwap{SimpleSwapCaller: SimpleSwapCaller{contract: contract}, SimpleSwapTransactor: SimpleSwapTransactor{contract: contract}, SimpleSwapFilterer: SimpleSwapFilterer{contract: contract}}, nil -} - -// SimpleSwap is an auto generated Go binding around an Ethereum contract. -type SimpleSwap struct { - SimpleSwapCaller // Read-only binding to the contract - SimpleSwapTransactor // Write-only binding to the contract - SimpleSwapFilterer // Log filterer for contract events -} - -// SimpleSwapCaller is an auto generated read-only Go binding around an Ethereum contract. -type SimpleSwapCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SimpleSwapTransactor is an auto generated write-only Go binding around an Ethereum contract. -type SimpleSwapTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SimpleSwapFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type SimpleSwapFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SimpleSwapSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type SimpleSwapSession struct { - Contract *SimpleSwap // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SimpleSwapCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type SimpleSwapCallerSession struct { - Contract *SimpleSwapCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// SimpleSwapTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type SimpleSwapTransactorSession struct { - Contract *SimpleSwapTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SimpleSwapRaw is an auto generated low-level Go binding around an Ethereum contract. -type SimpleSwapRaw struct { - Contract *SimpleSwap // Generic contract binding to access the raw methods on -} - -// SimpleSwapCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type SimpleSwapCallerRaw struct { - Contract *SimpleSwapCaller // Generic read-only contract binding to access the raw methods on -} - -// SimpleSwapTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type SimpleSwapTransactorRaw struct { - Contract *SimpleSwapTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewSimpleSwap creates a new instance of SimpleSwap, bound to a specific deployed contract. -func NewSimpleSwap(address common.Address, backend bind.ContractBackend) (*SimpleSwap, error) { - contract, err := bindSimpleSwap(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &SimpleSwap{SimpleSwapCaller: SimpleSwapCaller{contract: contract}, SimpleSwapTransactor: SimpleSwapTransactor{contract: contract}, SimpleSwapFilterer: SimpleSwapFilterer{contract: contract}}, nil -} - -// NewSimpleSwapCaller creates a new read-only instance of SimpleSwap, bound to a specific deployed contract. -func NewSimpleSwapCaller(address common.Address, caller bind.ContractCaller) (*SimpleSwapCaller, error) { - contract, err := bindSimpleSwap(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &SimpleSwapCaller{contract: contract}, nil -} - -// NewSimpleSwapTransactor creates a new write-only instance of SimpleSwap, bound to a specific deployed contract. -func NewSimpleSwapTransactor(address common.Address, transactor bind.ContractTransactor) (*SimpleSwapTransactor, error) { - contract, err := bindSimpleSwap(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &SimpleSwapTransactor{contract: contract}, nil -} - -// NewSimpleSwapFilterer creates a new log filterer instance of SimpleSwap, bound to a specific deployed contract. -func NewSimpleSwapFilterer(address common.Address, filterer bind.ContractFilterer) (*SimpleSwapFilterer, error) { - contract, err := bindSimpleSwap(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &SimpleSwapFilterer{contract: contract}, nil -} - -// bindSimpleSwap binds a generic wrapper to an already deployed contract. -func bindSimpleSwap(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(SimpleSwapABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SimpleSwap *SimpleSwapRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SimpleSwap.Contract.SimpleSwapCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SimpleSwap *SimpleSwapRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SimpleSwap.Contract.SimpleSwapTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SimpleSwap *SimpleSwapRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SimpleSwap.Contract.SimpleSwapTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SimpleSwap *SimpleSwapCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SimpleSwap.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SimpleSwap *SimpleSwapTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SimpleSwap.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SimpleSwap *SimpleSwapTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SimpleSwap.Contract.contract.Transact(opts, method, params...) -} - -// DEFAULTHARDDEPOSITDECREASETIMEOUT is a free data retrieval call binding the contract method 0x5eb54160. -// -// Solidity: function DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) DEFAULTHARDDEPOSITDECREASETIMEOUT(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT") - return *ret0, err -} - -// DEFAULTHARDDEPOSITDECREASETIMEOUT is a free data retrieval call binding the contract method 0x5eb54160. -// -// Solidity: function DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT() constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) DEFAULTHARDDEPOSITDECREASETIMEOUT() (*big.Int, error) { - return _SimpleSwap.Contract.DEFAULTHARDDEPOSITDECREASETIMEOUT(&_SimpleSwap.CallOpts) -} - -// DEFAULTHARDDEPOSITDECREASETIMEOUT is a free data retrieval call binding the contract method 0x5eb54160. -// -// Solidity: function DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) DEFAULTHARDDEPOSITDECREASETIMEOUT() (*big.Int, error) { - return _SimpleSwap.Contract.DEFAULTHARDDEPOSITDECREASETIMEOUT(&_SimpleSwap.CallOpts) -} - -// AvailableBalanceFor is a free data retrieval call binding the contract method 0x065c804f. -// -// Solidity: function availableBalanceFor(address beneficiary) constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) AvailableBalanceFor(opts *bind.CallOpts, beneficiary common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "availableBalanceFor", beneficiary) - return *ret0, err -} - -// AvailableBalanceFor is a free data retrieval call binding the contract method 0x065c804f. -// -// Solidity: function availableBalanceFor(address beneficiary) constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) AvailableBalanceFor(beneficiary common.Address) (*big.Int, error) { - return _SimpleSwap.Contract.AvailableBalanceFor(&_SimpleSwap.CallOpts, beneficiary) -} - -// AvailableBalanceFor is a free data retrieval call binding the contract method 0x065c804f. -// -// Solidity: function availableBalanceFor(address beneficiary) constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) AvailableBalanceFor(beneficiary common.Address) (*big.Int, error) { - return _SimpleSwap.Contract.AvailableBalanceFor(&_SimpleSwap.CallOpts, beneficiary) -} - -// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. -// -// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 decreaseTimeout, uint256 canBeDecreasedAt) -func (_SimpleSwap *SimpleSwapCaller) HardDeposits(opts *bind.CallOpts, arg0 common.Address) (struct { - Amount *big.Int - DecreaseAmount *big.Int - DecreaseTimeout *big.Int - CanBeDecreasedAt *big.Int -}, error) { - ret := new(struct { - Amount *big.Int - DecreaseAmount *big.Int - DecreaseTimeout *big.Int - CanBeDecreasedAt *big.Int - }) - out := ret - err := _SimpleSwap.contract.Call(opts, out, "hardDeposits", arg0) - return *ret, err -} - -// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. -// -// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 decreaseTimeout, uint256 canBeDecreasedAt) -func (_SimpleSwap *SimpleSwapSession) HardDeposits(arg0 common.Address) (struct { - Amount *big.Int - DecreaseAmount *big.Int - DecreaseTimeout *big.Int - CanBeDecreasedAt *big.Int -}, error) { - return _SimpleSwap.Contract.HardDeposits(&_SimpleSwap.CallOpts, arg0) -} - -// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. -// -// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 decreaseTimeout, uint256 canBeDecreasedAt) -func (_SimpleSwap *SimpleSwapCallerSession) HardDeposits(arg0 common.Address) (struct { - Amount *big.Int - DecreaseAmount *big.Int - DecreaseTimeout *big.Int - CanBeDecreasedAt *big.Int -}, error) { - return _SimpleSwap.Contract.HardDeposits(&_SimpleSwap.CallOpts, arg0) -} - -// Issuer is a free data retrieval call binding the contract method 0x1d143848. -// -// Solidity: function issuer() constant returns(address) -func (_SimpleSwap *SimpleSwapCaller) Issuer(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "issuer") - return *ret0, err -} - -// Issuer is a free data retrieval call binding the contract method 0x1d143848. -// -// Solidity: function issuer() constant returns(address) -func (_SimpleSwap *SimpleSwapSession) Issuer() (common.Address, error) { - return _SimpleSwap.Contract.Issuer(&_SimpleSwap.CallOpts) -} - -// Issuer is a free data retrieval call binding the contract method 0x1d143848. -// -// Solidity: function issuer() constant returns(address) -func (_SimpleSwap *SimpleSwapCallerSession) Issuer() (common.Address, error) { - return _SimpleSwap.Contract.Issuer(&_SimpleSwap.CallOpts) -} - -// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. -// -// Solidity: function liquidBalance() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) LiquidBalance(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "liquidBalance") - return *ret0, err -} - -// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. -// -// Solidity: function liquidBalance() constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) LiquidBalance() (*big.Int, error) { - return _SimpleSwap.Contract.LiquidBalance(&_SimpleSwap.CallOpts) -} - -// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. -// -// Solidity: function liquidBalance() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) LiquidBalance() (*big.Int, error) { - return _SimpleSwap.Contract.LiquidBalance(&_SimpleSwap.CallOpts) -} - -// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. -// -// Solidity: function paidOut(address ) constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) PaidOut(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "paidOut", arg0) - return *ret0, err -} - -// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. -// -// Solidity: function paidOut(address ) constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) PaidOut(arg0 common.Address) (*big.Int, error) { - return _SimpleSwap.Contract.PaidOut(&_SimpleSwap.CallOpts, arg0) -} - -// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. -// -// Solidity: function paidOut(address ) constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) PaidOut(arg0 common.Address) (*big.Int, error) { - return _SimpleSwap.Contract.PaidOut(&_SimpleSwap.CallOpts, arg0) -} - -// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. -// -// Solidity: function totalHardDeposit() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) TotalHardDeposit(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "totalHardDeposit") - return *ret0, err -} - -// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. -// -// Solidity: function totalHardDeposit() constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) TotalHardDeposit() (*big.Int, error) { - return _SimpleSwap.Contract.TotalHardDeposit(&_SimpleSwap.CallOpts) -} - -// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. -// -// Solidity: function totalHardDeposit() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) TotalHardDeposit() (*big.Int, error) { - return _SimpleSwap.Contract.TotalHardDeposit(&_SimpleSwap.CallOpts) -} - -// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. -// -// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapTransactor) CashCheque(opts *bind.TransactOpts, beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "cashCheque", beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) -} - -// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. -// -// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapSession) CashCheque(beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.CashCheque(&_SimpleSwap.TransactOpts, beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) -} - -// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. -// -// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) CashCheque(beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.CashCheque(&_SimpleSwap.TransactOpts, beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) -} - -// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. -// -// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapTransactor) CashChequeBeneficiary(opts *bind.TransactOpts, recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "cashChequeBeneficiary", recipient, cumulativePayout, issuerSig) -} - -// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. -// -// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapSession) CashChequeBeneficiary(recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.CashChequeBeneficiary(&_SimpleSwap.TransactOpts, recipient, cumulativePayout, issuerSig) -} - -// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. -// -// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) CashChequeBeneficiary(recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.CashChequeBeneficiary(&_SimpleSwap.TransactOpts, recipient, cumulativePayout, issuerSig) -} - -// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. -// -// Solidity: function decreaseHardDeposit(address beneficiary) returns() -func (_SimpleSwap *SimpleSwapTransactor) DecreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "decreaseHardDeposit", beneficiary) -} - -// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. -// -// Solidity: function decreaseHardDeposit(address beneficiary) returns() -func (_SimpleSwap *SimpleSwapSession) DecreaseHardDeposit(beneficiary common.Address) (*types.Transaction, error) { - return _SimpleSwap.Contract.DecreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary) -} - -// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. -// -// Solidity: function decreaseHardDeposit(address beneficiary) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) DecreaseHardDeposit(beneficiary common.Address) (*types.Transaction, error) { - return _SimpleSwap.Contract.DecreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary) -} - -// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. -// -// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() -func (_SimpleSwap *SimpleSwapTransactor) IncreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "increaseHardDeposit", beneficiary, amount) -} - -// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. -// -// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() -func (_SimpleSwap *SimpleSwapSession) IncreaseHardDeposit(beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.IncreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary, amount) -} - -// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. -// -// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) IncreaseHardDeposit(beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.IncreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary, amount) -} - -// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. -// -// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() -func (_SimpleSwap *SimpleSwapTransactor) PrepareDecreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "prepareDecreaseHardDeposit", beneficiary, decreaseAmount) -} - -// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. -// -// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() -func (_SimpleSwap *SimpleSwapSession) PrepareDecreaseHardDeposit(beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.PrepareDecreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary, decreaseAmount) -} - -// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. -// -// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) PrepareDecreaseHardDeposit(beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.PrepareDecreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary, decreaseAmount) -} - -// SetCustomHardDepositDecreaseTimeout is a paid mutator transaction binding the contract method 0xdf324380. -// -// Solidity: function setCustomHardDepositDecreaseTimeout(address beneficiary, uint256 decreaseTimeout, bytes beneficiarySig) returns() -func (_SimpleSwap *SimpleSwapTransactor) SetCustomHardDepositDecreaseTimeout(opts *bind.TransactOpts, beneficiary common.Address, decreaseTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "setCustomHardDepositDecreaseTimeout", beneficiary, decreaseTimeout, beneficiarySig) -} - -// SetCustomHardDepositDecreaseTimeout is a paid mutator transaction binding the contract method 0xdf324380. -// -// Solidity: function setCustomHardDepositDecreaseTimeout(address beneficiary, uint256 decreaseTimeout, bytes beneficiarySig) returns() -func (_SimpleSwap *SimpleSwapSession) SetCustomHardDepositDecreaseTimeout(beneficiary common.Address, decreaseTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.SetCustomHardDepositDecreaseTimeout(&_SimpleSwap.TransactOpts, beneficiary, decreaseTimeout, beneficiarySig) -} - -// SetCustomHardDepositDecreaseTimeout is a paid mutator transaction binding the contract method 0xdf324380. -// -// Solidity: function setCustomHardDepositDecreaseTimeout(address beneficiary, uint256 decreaseTimeout, bytes beneficiarySig) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) SetCustomHardDepositDecreaseTimeout(beneficiary common.Address, decreaseTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.SetCustomHardDepositDecreaseTimeout(&_SimpleSwap.TransactOpts, beneficiary, decreaseTimeout, beneficiarySig) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. -// -// Solidity: function withdraw(uint256 amount) returns() -func (_SimpleSwap *SimpleSwapTransactor) Withdraw(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "withdraw", amount) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. -// -// Solidity: function withdraw(uint256 amount) returns() -func (_SimpleSwap *SimpleSwapSession) Withdraw(amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.Withdraw(&_SimpleSwap.TransactOpts, amount) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. -// -// Solidity: function withdraw(uint256 amount) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) Withdraw(amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.Withdraw(&_SimpleSwap.TransactOpts, amount) -} - -// SimpleSwapChequeBouncedIterator is returned from FilterChequeBounced and is used to iterate over the raw logs and unpacked data for ChequeBounced events raised by the SimpleSwap contract. -type SimpleSwapChequeBouncedIterator struct { - Event *SimpleSwapChequeBounced // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapChequeBouncedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapChequeBounced) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapChequeBounced) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapChequeBouncedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapChequeBouncedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapChequeBounced represents a ChequeBounced event raised by the SimpleSwap contract. -type SimpleSwapChequeBounced struct { - Raw types.Log // Blockchain specific contextual infos -} - -// FilterChequeBounced is a free log retrieval operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. -// -// Solidity: event ChequeBounced() -func (_SimpleSwap *SimpleSwapFilterer) FilterChequeBounced(opts *bind.FilterOpts) (*SimpleSwapChequeBouncedIterator, error) { - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "ChequeBounced") - if err != nil { - return nil, err - } - return &SimpleSwapChequeBouncedIterator{contract: _SimpleSwap.contract, event: "ChequeBounced", logs: logs, sub: sub}, nil -} - -// WatchChequeBounced is a free log subscription operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. -// -// Solidity: event ChequeBounced() -func (_SimpleSwap *SimpleSwapFilterer) WatchChequeBounced(opts *bind.WatchOpts, sink chan<- *SimpleSwapChequeBounced) (event.Subscription, error) { - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "ChequeBounced") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapChequeBounced) - if err := _SimpleSwap.contract.UnpackLog(event, "ChequeBounced", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseChequeBounced is a log parse operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. -// -// Solidity: event ChequeBounced() -func (_SimpleSwap *SimpleSwapFilterer) ParseChequeBounced(log types.Log) (*SimpleSwapChequeBounced, error) { - event := new(SimpleSwapChequeBounced) - if err := _SimpleSwap.contract.UnpackLog(event, "ChequeBounced", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapChequeCashedIterator is returned from FilterChequeCashed and is used to iterate over the raw logs and unpacked data for ChequeCashed events raised by the SimpleSwap contract. -type SimpleSwapChequeCashedIterator struct { - Event *SimpleSwapChequeCashed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapChequeCashedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapChequeCashed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapChequeCashed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapChequeCashedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapChequeCashedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapChequeCashed represents a ChequeCashed event raised by the SimpleSwap contract. -type SimpleSwapChequeCashed struct { - Beneficiary common.Address - Recipient common.Address - Caller common.Address - TotalPayout *big.Int - CumulativePayout *big.Int - CallerPayout *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterChequeCashed is a free log retrieval operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. -// -// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) -func (_SimpleSwap *SimpleSwapFilterer) FilterChequeCashed(opts *bind.FilterOpts, beneficiary []common.Address, recipient []common.Address, caller []common.Address) (*SimpleSwapChequeCashedIterator, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - var recipientRule []interface{} - for _, recipientItem := range recipient { - recipientRule = append(recipientRule, recipientItem) - } - var callerRule []interface{} - for _, callerItem := range caller { - callerRule = append(callerRule, callerItem) - } - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "ChequeCashed", beneficiaryRule, recipientRule, callerRule) - if err != nil { - return nil, err - } - return &SimpleSwapChequeCashedIterator{contract: _SimpleSwap.contract, event: "ChequeCashed", logs: logs, sub: sub}, nil -} - -// WatchChequeCashed is a free log subscription operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. -// -// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) -func (_SimpleSwap *SimpleSwapFilterer) WatchChequeCashed(opts *bind.WatchOpts, sink chan<- *SimpleSwapChequeCashed, beneficiary []common.Address, recipient []common.Address, caller []common.Address) (event.Subscription, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - var recipientRule []interface{} - for _, recipientItem := range recipient { - recipientRule = append(recipientRule, recipientItem) - } - var callerRule []interface{} - for _, callerItem := range caller { - callerRule = append(callerRule, callerItem) - } - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "ChequeCashed", beneficiaryRule, recipientRule, callerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapChequeCashed) - if err := _SimpleSwap.contract.UnpackLog(event, "ChequeCashed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseChequeCashed is a log parse operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. -// -// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) -func (_SimpleSwap *SimpleSwapFilterer) ParseChequeCashed(log types.Log) (*SimpleSwapChequeCashed, error) { - event := new(SimpleSwapChequeCashed) - if err := _SimpleSwap.contract.UnpackLog(event, "ChequeCashed", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the SimpleSwap contract. -type SimpleSwapDepositIterator struct { - Event *SimpleSwapDeposit // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapDepositIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapDeposit) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapDeposit) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapDepositIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapDepositIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapDeposit represents a Deposit event raised by the SimpleSwap contract. -type SimpleSwapDeposit struct { - Depositor common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address depositor, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) FilterDeposit(opts *bind.FilterOpts) (*SimpleSwapDepositIterator, error) { - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "Deposit") - if err != nil { - return nil, err - } - return &SimpleSwapDepositIterator{contract: _SimpleSwap.contract, event: "Deposit", logs: logs, sub: sub}, nil -} - -// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address depositor, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *SimpleSwapDeposit) (event.Subscription, error) { - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "Deposit") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapDeposit) - if err := _SimpleSwap.contract.UnpackLog(event, "Deposit", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address depositor, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) ParseDeposit(log types.Log) (*SimpleSwapDeposit, error) { - event := new(SimpleSwapDeposit) - if err := _SimpleSwap.contract.UnpackLog(event, "Deposit", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapHardDepositAmountChangedIterator is returned from FilterHardDepositAmountChanged and is used to iterate over the raw logs and unpacked data for HardDepositAmountChanged events raised by the SimpleSwap contract. -type SimpleSwapHardDepositAmountChangedIterator struct { - Event *SimpleSwapHardDepositAmountChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapHardDepositAmountChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositAmountChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositAmountChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapHardDepositAmountChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapHardDepositAmountChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapHardDepositAmountChanged represents a HardDepositAmountChanged event raised by the SimpleSwap contract. -type SimpleSwapHardDepositAmountChanged struct { - Beneficiary common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterHardDepositAmountChanged is a free log retrieval operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. -// -// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) FilterHardDepositAmountChanged(opts *bind.FilterOpts, beneficiary []common.Address) (*SimpleSwapHardDepositAmountChangedIterator, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "HardDepositAmountChanged", beneficiaryRule) - if err != nil { - return nil, err - } - return &SimpleSwapHardDepositAmountChangedIterator{contract: _SimpleSwap.contract, event: "HardDepositAmountChanged", logs: logs, sub: sub}, nil -} - -// WatchHardDepositAmountChanged is a free log subscription operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. -// -// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) WatchHardDepositAmountChanged(opts *bind.WatchOpts, sink chan<- *SimpleSwapHardDepositAmountChanged, beneficiary []common.Address) (event.Subscription, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "HardDepositAmountChanged", beneficiaryRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapHardDepositAmountChanged) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositAmountChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseHardDepositAmountChanged is a log parse operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. -// -// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) ParseHardDepositAmountChanged(log types.Log) (*SimpleSwapHardDepositAmountChanged, error) { - event := new(SimpleSwapHardDepositAmountChanged) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositAmountChanged", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapHardDepositDecreasePreparedIterator is returned from FilterHardDepositDecreasePrepared and is used to iterate over the raw logs and unpacked data for HardDepositDecreasePrepared events raised by the SimpleSwap contract. -type SimpleSwapHardDepositDecreasePreparedIterator struct { - Event *SimpleSwapHardDepositDecreasePrepared // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapHardDepositDecreasePreparedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositDecreasePrepared) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositDecreasePrepared) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapHardDepositDecreasePreparedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapHardDepositDecreasePreparedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapHardDepositDecreasePrepared represents a HardDepositDecreasePrepared event raised by the SimpleSwap contract. -type SimpleSwapHardDepositDecreasePrepared struct { - Beneficiary common.Address - DecreaseAmount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterHardDepositDecreasePrepared is a free log retrieval operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. -// -// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) -func (_SimpleSwap *SimpleSwapFilterer) FilterHardDepositDecreasePrepared(opts *bind.FilterOpts, beneficiary []common.Address) (*SimpleSwapHardDepositDecreasePreparedIterator, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "HardDepositDecreasePrepared", beneficiaryRule) - if err != nil { - return nil, err - } - return &SimpleSwapHardDepositDecreasePreparedIterator{contract: _SimpleSwap.contract, event: "HardDepositDecreasePrepared", logs: logs, sub: sub}, nil -} - -// WatchHardDepositDecreasePrepared is a free log subscription operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. -// -// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) -func (_SimpleSwap *SimpleSwapFilterer) WatchHardDepositDecreasePrepared(opts *bind.WatchOpts, sink chan<- *SimpleSwapHardDepositDecreasePrepared, beneficiary []common.Address) (event.Subscription, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "HardDepositDecreasePrepared", beneficiaryRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapHardDepositDecreasePrepared) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositDecreasePrepared", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseHardDepositDecreasePrepared is a log parse operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. -// -// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) -func (_SimpleSwap *SimpleSwapFilterer) ParseHardDepositDecreasePrepared(log types.Log) (*SimpleSwapHardDepositDecreasePrepared, error) { - event := new(SimpleSwapHardDepositDecreasePrepared) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositDecreasePrepared", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapHardDepositDecreaseTimeoutChangedIterator is returned from FilterHardDepositDecreaseTimeoutChanged and is used to iterate over the raw logs and unpacked data for HardDepositDecreaseTimeoutChanged events raised by the SimpleSwap contract. -type SimpleSwapHardDepositDecreaseTimeoutChangedIterator struct { - Event *SimpleSwapHardDepositDecreaseTimeoutChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapHardDepositDecreaseTimeoutChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositDecreaseTimeoutChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositDecreaseTimeoutChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapHardDepositDecreaseTimeoutChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapHardDepositDecreaseTimeoutChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapHardDepositDecreaseTimeoutChanged represents a HardDepositDecreaseTimeoutChanged event raised by the SimpleSwap contract. -type SimpleSwapHardDepositDecreaseTimeoutChanged struct { - Beneficiary common.Address - DecreaseTimeout *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterHardDepositDecreaseTimeoutChanged is a free log retrieval operation binding the contract event 0x86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f. -// -// Solidity: event HardDepositDecreaseTimeoutChanged(address indexed beneficiary, uint256 decreaseTimeout) -func (_SimpleSwap *SimpleSwapFilterer) FilterHardDepositDecreaseTimeoutChanged(opts *bind.FilterOpts, beneficiary []common.Address) (*SimpleSwapHardDepositDecreaseTimeoutChangedIterator, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "HardDepositDecreaseTimeoutChanged", beneficiaryRule) - if err != nil { - return nil, err - } - return &SimpleSwapHardDepositDecreaseTimeoutChangedIterator{contract: _SimpleSwap.contract, event: "HardDepositDecreaseTimeoutChanged", logs: logs, sub: sub}, nil -} - -// WatchHardDepositDecreaseTimeoutChanged is a free log subscription operation binding the contract event 0x86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f. -// -// Solidity: event HardDepositDecreaseTimeoutChanged(address indexed beneficiary, uint256 decreaseTimeout) -func (_SimpleSwap *SimpleSwapFilterer) WatchHardDepositDecreaseTimeoutChanged(opts *bind.WatchOpts, sink chan<- *SimpleSwapHardDepositDecreaseTimeoutChanged, beneficiary []common.Address) (event.Subscription, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "HardDepositDecreaseTimeoutChanged", beneficiaryRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapHardDepositDecreaseTimeoutChanged) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositDecreaseTimeoutChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseHardDepositDecreaseTimeoutChanged is a log parse operation binding the contract event 0x86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f. -// -// Solidity: event HardDepositDecreaseTimeoutChanged(address indexed beneficiary, uint256 decreaseTimeout) -func (_SimpleSwap *SimpleSwapFilterer) ParseHardDepositDecreaseTimeoutChanged(log types.Log) (*SimpleSwapHardDepositDecreaseTimeoutChanged, error) { - event := new(SimpleSwapHardDepositDecreaseTimeoutChanged) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositDecreaseTimeoutChanged", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapWithdrawIterator is returned from FilterWithdraw and is used to iterate over the raw logs and unpacked data for Withdraw events raised by the SimpleSwap contract. -type SimpleSwapWithdrawIterator struct { - Event *SimpleSwapWithdraw // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapWithdrawIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapWithdraw) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapWithdraw) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapWithdrawIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapWithdrawIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapWithdraw represents a Withdraw event raised by the SimpleSwap contract. -type SimpleSwapWithdraw struct { - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterWithdraw is a free log retrieval operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. -// -// Solidity: event Withdraw(uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) FilterWithdraw(opts *bind.FilterOpts) (*SimpleSwapWithdrawIterator, error) { - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "Withdraw") - if err != nil { - return nil, err - } - return &SimpleSwapWithdrawIterator{contract: _SimpleSwap.contract, event: "Withdraw", logs: logs, sub: sub}, nil -} - -// WatchWithdraw is a free log subscription operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. -// -// Solidity: event Withdraw(uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *SimpleSwapWithdraw) (event.Subscription, error) { - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "Withdraw") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapWithdraw) - if err := _SimpleSwap.contract.UnpackLog(event, "Withdraw", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseWithdraw is a log parse operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. -// -// Solidity: event Withdraw(uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) ParseWithdraw(log types.Log) (*SimpleSwapWithdraw, error) { - event := new(SimpleSwapWithdraw) - if err := _SimpleSwap.contract.UnpackLog(event, "Withdraw", log); err != nil { - return nil, err - } - return event, nil -} diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswapfactory/code.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswapfactory/code.go deleted file mode 100644 index a87afdbd37..0000000000 --- a/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/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 = "0x6080604052600436106100295760003560e01c8063576d72711461002e578063c70242ad146100bc575b600080fd5b61007a6004803603604081101561004457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610125565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100c857600080fd5b5061010b600480360360208110156100df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610258565b604051808215151515815260200191505060405180910390f35b60008034848460405161013790610278565b808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040518091039082f08015801561018f573d6000803e3d6000fd5b509050905060016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00481604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18091505092915050565b60006020528060005260406000206000915054906101000a900460ff1681565b611f6e806102868339019056fe6080604052604051611f6e380380611f6e8339818101604052604081101561002657600080fd5b8101908080519060200190929190805190602001909291905050508060008190555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060003411156100fe577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5050611e5f8061010f6000396000f3fe6080604052600436106100dd5760003560e01c806381f03fcb1161007f578063b777035011610059578063b7770350146106a6578063b7ec1a3314610701578063df3243801461072c578063e0bcf13a1461081e576100dd565b806381f03fcb14610576578063946f46a2146105db578063b6343b0d1461062c576100dd565b80631d143848116100bb5780631d1438481461045e5780632e1a7d4d146104b5578063338f3fed146104f05780635eb541601461054b576100dd565b8063065c804f146101545780630d5f2659146101b95780631633fb1d146102ab575b6000341115610152577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b005b34801561016057600080fd5b506101a36004803603602081101561017757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610849565b6040518082815260200191505060405180910390f35b3480156101c557600080fd5b506102a9600480360360608110156101dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561022357600080fd5b82018360208201111561023557600080fd5b8035906020019184600183028401116401000000008311171561025757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108ae565b005b3480156102b757600080fd5b5061045c600480360360c08110156102ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561033557600080fd5b82018360208201111561034757600080fd5b8035906020019184600183028401116401000000008311171561036957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001906401000000008111156103d657600080fd5b8201836020820111156103e857600080fd5b8035906020019184600183028401116401000000008311171561040a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108c1565b005b34801561046a57600080fd5b5061047361096f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c157600080fd5b506104ee600480360360208110156104d857600080fd5b8101908080359060200190929190505050610995565b005b3480156104fc57600080fd5b506105496004803603604081101561051357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5b565b005b34801561055757600080fd5b50610560610d80565b6040518082815260200191505060405180910390f35b34801561058257600080fd5b506105c56004803603602081101561059957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d86565b6040518082815260200191505060405180910390f35b3480156105e757600080fd5b5061062a600480360360208110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d9e565b005b34801561063857600080fd5b5061067b6004803603602081101561064f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef1565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b3480156106b257600080fd5b506106ff600480360360408110156106c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f21565b005b34801561070d57600080fd5b50610716611109565b6040518082815260200191505060405180910390f35b34801561073857600080fd5b5061081c6004803603606081101561074f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561079657600080fd5b8201836020820111156107a857600080fd5b803590602001918460018302840111640100000000831117156107ca57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061113c565b005b34801561082a57600080fd5b50610833611372565b6040518082815260200191505060405180910390f35b60006108a7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610899611109565b61137890919063ffffffff16565b9050919050565b6108bc338484600085611400565b505050565b6108d76108d13033878987611925565b84611a06565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461095a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b6109678686868585611400565b505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610a60611109565b811115610ab8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611e036028913960400191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b20573d6000803e3d6000fd5b507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d816040518082815260200191505060405180910390a150565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1631610c4b8260035461137890919063ffffffff16565b1115610ca2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611d616034913960400191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cfc82826000015461137890919063ffffffff16565b8160000181905550610d198260035461137890919063ffffffff16565b600381905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60005481565b60016020528060005260406000206000915090505481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dfa57506000816003015414155b610e4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611db76025913960400191505060405180910390fd5b610e6a81600101548260000154611a2290919063ffffffff16565b816000018190555060008160030181905550610e958160010154600354611a2290919063ffffffff16565b6003819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60026020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fe4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000154821115611084576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611ddc6027913960400191505060405180910390fd5b60008082600201541461109b57816002015461109f565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111376003543073ffffffffffffffffffffffffffffffffffffffff1631611a2290919063ffffffff16565b905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61121361120d308585611aab565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546040518082815260200191505060405180910390a2505050565b60035481565b6000808284019050838110156113f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461152c57611469611463308786611b4b565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461152b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b6000611580600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611a2290919063ffffffff16565b905060006115968261159189610849565b611beb565b905060006115e682600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611beb565b90508482101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b6000811461171d576116bb81600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611a2290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061171681600354611a2290919063ffffffff16565b6003819055505b61176f82600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137890919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff166108fc6117df8785611a2290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561180a573d6000803e3d6000fd5b506000851461185b573373ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015611859573d6000803e3d6000fd5b505b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a481831461191b577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611a1a611a1484611c04565b83611c5c565b905092915050565b600082821115611a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611bfa5781611bfc565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611c705760009050611d5a565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611cc45760009350505050611d5a565b601b8160ff1614158015611cdc5750601c8160ff1614155b15611ced5760009350505050611d5a565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611d4a573d6000803e3d6000fd5b5050506020604051035193505050505b9291505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582089af678b6e43eebcf058524d8177d9f06f37f73f03c7dec537f3652623c5ea4f64736f6c634300050b0032a265627a7a72315820ebd4cb32a61da1ceb5a10453df5bff99698d82ce29addf07fe22d33246f941de64736f6c634300050b0032" diff --git a/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswapfactory/simpleswapfactory.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswapfactory/simpleswapfactory.go deleted file mode 100644 index ab4354c822..0000000000 --- a/vendor/github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswapfactory/simpleswapfactory.go +++ /dev/null @@ -1,2360 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package simpleswapfactory - -import ( - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = abi.U256 - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// ECDSAABI is the input ABI used to generate the binding from. -const ECDSAABI = "[]" - -// ECDSABin is the compiled bytecode used for deploying new contracts. -var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158207d4a51dc51591c15576f3f090bcc64fce0d144dc00f5c2b1b5d8a2e33c87ec1664736f6c634300050b0032" - -// 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) { - parsed, err := abi.JSON(strings.NewReader(ECDSAABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ECDSABin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &ECDSA{ECDSACaller: ECDSACaller{contract: contract}, ECDSATransactor: ECDSATransactor{contract: contract}, ECDSAFilterer: ECDSAFilterer{contract: contract}}, nil -} - -// ECDSA is an auto generated Go binding around an Ethereum contract. -type ECDSA struct { - ECDSACaller // Read-only binding to the contract - ECDSATransactor // Write-only binding to the contract - ECDSAFilterer // Log filterer for contract events -} - -// ECDSACaller is an auto generated read-only Go binding around an Ethereum contract. -type ECDSACaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ECDSATransactor is an auto generated write-only Go binding around an Ethereum contract. -type ECDSATransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ECDSAFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ECDSAFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ECDSASession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type ECDSASession struct { - Contract *ECDSA // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ECDSACallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type ECDSACallerSession struct { - Contract *ECDSACaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// ECDSATransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type ECDSATransactorSession struct { - Contract *ECDSATransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ECDSARaw is an auto generated low-level Go binding around an Ethereum contract. -type ECDSARaw struct { - Contract *ECDSA // Generic contract binding to access the raw methods on -} - -// ECDSACallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ECDSACallerRaw struct { - Contract *ECDSACaller // Generic read-only contract binding to access the raw methods on -} - -// ECDSATransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ECDSATransactorRaw struct { - Contract *ECDSATransactor // Generic write-only contract binding to access the raw methods on -} - -// NewECDSA creates a new instance of ECDSA, bound to a specific deployed contract. -func NewECDSA(address common.Address, backend bind.ContractBackend) (*ECDSA, error) { - contract, err := bindECDSA(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &ECDSA{ECDSACaller: ECDSACaller{contract: contract}, ECDSATransactor: ECDSATransactor{contract: contract}, ECDSAFilterer: ECDSAFilterer{contract: contract}}, nil -} - -// NewECDSACaller creates a new read-only instance of ECDSA, bound to a specific deployed contract. -func NewECDSACaller(address common.Address, caller bind.ContractCaller) (*ECDSACaller, error) { - contract, err := bindECDSA(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ECDSACaller{contract: contract}, nil -} - -// NewECDSATransactor creates a new write-only instance of ECDSA, bound to a specific deployed contract. -func NewECDSATransactor(address common.Address, transactor bind.ContractTransactor) (*ECDSATransactor, error) { - contract, err := bindECDSA(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ECDSATransactor{contract: contract}, nil -} - -// NewECDSAFilterer creates a new log filterer instance of ECDSA, bound to a specific deployed contract. -func NewECDSAFilterer(address common.Address, filterer bind.ContractFilterer) (*ECDSAFilterer, error) { - contract, err := bindECDSA(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ECDSAFilterer{contract: contract}, nil -} - -// bindECDSA binds a generic wrapper to an already deployed contract. -func bindECDSA(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(ECDSAABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_ECDSA *ECDSARaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _ECDSA.Contract.ECDSACaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_ECDSA *ECDSARaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ECDSA.Contract.ECDSATransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ECDSA *ECDSARaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ECDSA.Contract.ECDSATransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_ECDSA *ECDSACallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _ECDSA.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_ECDSA *ECDSATransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ECDSA.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ECDSA *ECDSATransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ECDSA.Contract.contract.Transact(opts, method, params...) -} - -// MathABI is the input ABI used to generate the binding from. -const MathABI = "[]" - -// MathBin is the compiled bytecode used for deploying new contracts. -var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158203d48eda12ade7ffd2511c167327d7097a04df9d90d01f741c63a03038c920bbb64736f6c634300050b0032" - -// 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) { - parsed, err := abi.JSON(strings.NewReader(MathABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MathBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Math{MathCaller: MathCaller{contract: contract}, MathTransactor: MathTransactor{contract: contract}, MathFilterer: MathFilterer{contract: contract}}, nil -} - -// Math is an auto generated Go binding around an Ethereum contract. -type Math struct { - MathCaller // Read-only binding to the contract - MathTransactor // Write-only binding to the contract - MathFilterer // Log filterer for contract events -} - -// MathCaller is an auto generated read-only Go binding around an Ethereum contract. -type MathCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MathTransactor is an auto generated write-only Go binding around an Ethereum contract. -type MathTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MathFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type MathFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// MathSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type MathSession struct { - Contract *Math // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// MathCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type MathCallerSession struct { - Contract *MathCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// MathTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type MathTransactorSession struct { - Contract *MathTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// MathRaw is an auto generated low-level Go binding around an Ethereum contract. -type MathRaw struct { - Contract *Math // Generic contract binding to access the raw methods on -} - -// MathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type MathCallerRaw struct { - Contract *MathCaller // Generic read-only contract binding to access the raw methods on -} - -// MathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type MathTransactorRaw struct { - Contract *MathTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewMath creates a new instance of Math, bound to a specific deployed contract. -func NewMath(address common.Address, backend bind.ContractBackend) (*Math, error) { - contract, err := bindMath(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Math{MathCaller: MathCaller{contract: contract}, MathTransactor: MathTransactor{contract: contract}, MathFilterer: MathFilterer{contract: contract}}, nil -} - -// NewMathCaller creates a new read-only instance of Math, bound to a specific deployed contract. -func NewMathCaller(address common.Address, caller bind.ContractCaller) (*MathCaller, error) { - contract, err := bindMath(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &MathCaller{contract: contract}, nil -} - -// NewMathTransactor creates a new write-only instance of Math, bound to a specific deployed contract. -func NewMathTransactor(address common.Address, transactor bind.ContractTransactor) (*MathTransactor, error) { - contract, err := bindMath(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &MathTransactor{contract: contract}, nil -} - -// NewMathFilterer creates a new log filterer instance of Math, bound to a specific deployed contract. -func NewMathFilterer(address common.Address, filterer bind.ContractFilterer) (*MathFilterer, error) { - contract, err := bindMath(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &MathFilterer{contract: contract}, nil -} - -// bindMath binds a generic wrapper to an already deployed contract. -func bindMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(MathABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Math *MathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _Math.Contract.MathCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Math *MathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Math.Contract.MathTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Math *MathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Math.Contract.MathTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Math *MathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _Math.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Math *MathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Math.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Math *MathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Math.Contract.contract.Transact(opts, method, params...) -} - -// SafeMathABI is the input ABI used to generate the binding from. -const SafeMathABI = "[]" - -// SafeMathBin is the compiled bytecode used for deploying new contracts. -var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820e713fd774261cf97036ea1b8fcf34d15dfef29b8ed77519add1c0348b139cfcf64736f6c634300050b0032" - -// 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) { - parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SafeMathBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil -} - -// SafeMath is an auto generated Go binding around an Ethereum contract. -type SafeMath struct { - SafeMathCaller // Read-only binding to the contract - SafeMathTransactor // Write-only binding to the contract - SafeMathFilterer // Log filterer for contract events -} - -// SafeMathCaller is an auto generated read-only Go binding around an Ethereum contract. -type SafeMathCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SafeMathTransactor is an auto generated write-only Go binding around an Ethereum contract. -type SafeMathTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SafeMathFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type SafeMathFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SafeMathSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type SafeMathSession struct { - Contract *SafeMath // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SafeMathCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type SafeMathCallerSession struct { - Contract *SafeMathCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// SafeMathTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type SafeMathTransactorSession struct { - Contract *SafeMathTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SafeMathRaw is an auto generated low-level Go binding around an Ethereum contract. -type SafeMathRaw struct { - Contract *SafeMath // Generic contract binding to access the raw methods on -} - -// SafeMathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type SafeMathCallerRaw struct { - Contract *SafeMathCaller // Generic read-only contract binding to access the raw methods on -} - -// SafeMathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type SafeMathTransactorRaw struct { - Contract *SafeMathTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewSafeMath creates a new instance of SafeMath, bound to a specific deployed contract. -func NewSafeMath(address common.Address, backend bind.ContractBackend) (*SafeMath, error) { - contract, err := bindSafeMath(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil -} - -// NewSafeMathCaller creates a new read-only instance of SafeMath, bound to a specific deployed contract. -func NewSafeMathCaller(address common.Address, caller bind.ContractCaller) (*SafeMathCaller, error) { - contract, err := bindSafeMath(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &SafeMathCaller{contract: contract}, nil -} - -// NewSafeMathTransactor creates a new write-only instance of SafeMath, bound to a specific deployed contract. -func NewSafeMathTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeMathTransactor, error) { - contract, err := bindSafeMath(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &SafeMathTransactor{contract: contract}, nil -} - -// NewSafeMathFilterer creates a new log filterer instance of SafeMath, bound to a specific deployed contract. -func NewSafeMathFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeMathFilterer, error) { - contract, err := bindSafeMath(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &SafeMathFilterer{contract: contract}, nil -} - -// bindSafeMath binds a generic wrapper to an already deployed contract. -func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SafeMath *SafeMathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SafeMath.Contract.SafeMathTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SafeMath.Contract.SafeMathTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SafeMath.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SafeMath *SafeMathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SafeMath.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SafeMath *SafeMathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SafeMath.Contract.contract.Transact(opts, method, params...) -} - -// SimpleSwapABI is the input ABI used to generate the binding from. -const SimpleSwapABI = "[{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"availableBalanceFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"addresspayable\",\"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\"},{\"internalType\":\"addresspayable\",\"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\":true,\"inputs\":[],\"name\":\"issuer\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"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\":\"DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT\",\"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\"}],\"name\":\"decreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"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\":\"decreaseTimeout\",\"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\":\"decreaseAmount\",\"type\":\"uint256\"}],\"name\":\"prepareDecreaseHardDeposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"liquidBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"decreaseTimeout\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"beneficiarySig\",\"type\":\"bytes\"}],\"name\":\"setCustomHardDepositDecreaseTimeout\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalHardDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"defaultHardDepositTimeoutDuration\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"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\":[],\"name\":\"ChequeBounced\",\"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\":\"decreaseTimeout\",\"type\":\"uint256\"}],\"name\":\"HardDepositDecreaseTimeoutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"}]" - -// SimpleSwapBin is the compiled bytecode used for deploying new contracts. -var SimpleSwapBin = "0x6080604052604051611f6e380380611f6e8339818101604052604081101561002657600080fd5b8101908080519060200190929190805190602001909291905050508060008190555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060003411156100fe577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5050611e5f8061010f6000396000f3fe6080604052600436106100dd5760003560e01c806381f03fcb1161007f578063b777035011610059578063b7770350146106a6578063b7ec1a3314610701578063df3243801461072c578063e0bcf13a1461081e576100dd565b806381f03fcb14610576578063946f46a2146105db578063b6343b0d1461062c576100dd565b80631d143848116100bb5780631d1438481461045e5780632e1a7d4d146104b5578063338f3fed146104f05780635eb541601461054b576100dd565b8063065c804f146101545780630d5f2659146101b95780631633fb1d146102ab575b6000341115610152577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b005b34801561016057600080fd5b506101a36004803603602081101561017757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610849565b6040518082815260200191505060405180910390f35b3480156101c557600080fd5b506102a9600480360360608110156101dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561022357600080fd5b82018360208201111561023557600080fd5b8035906020019184600183028401116401000000008311171561025757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108ae565b005b3480156102b757600080fd5b5061045c600480360360c08110156102ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561033557600080fd5b82018360208201111561034757600080fd5b8035906020019184600183028401116401000000008311171561036957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001906401000000008111156103d657600080fd5b8201836020820111156103e857600080fd5b8035906020019184600183028401116401000000008311171561040a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108c1565b005b34801561046a57600080fd5b5061047361096f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c157600080fd5b506104ee600480360360208110156104d857600080fd5b8101908080359060200190929190505050610995565b005b3480156104fc57600080fd5b506105496004803603604081101561051357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5b565b005b34801561055757600080fd5b50610560610d80565b6040518082815260200191505060405180910390f35b34801561058257600080fd5b506105c56004803603602081101561059957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d86565b6040518082815260200191505060405180910390f35b3480156105e757600080fd5b5061062a600480360360208110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d9e565b005b34801561063857600080fd5b5061067b6004803603602081101561064f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef1565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b3480156106b257600080fd5b506106ff600480360360408110156106c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f21565b005b34801561070d57600080fd5b50610716611109565b6040518082815260200191505060405180910390f35b34801561073857600080fd5b5061081c6004803603606081101561074f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561079657600080fd5b8201836020820111156107a857600080fd5b803590602001918460018302840111640100000000831117156107ca57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061113c565b005b34801561082a57600080fd5b50610833611372565b6040518082815260200191505060405180910390f35b60006108a7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610899611109565b61137890919063ffffffff16565b9050919050565b6108bc338484600085611400565b505050565b6108d76108d13033878987611925565b84611a06565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461095a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b6109678686868585611400565b505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610a60611109565b811115610ab8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611e036028913960400191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b20573d6000803e3d6000fd5b507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d816040518082815260200191505060405180910390a150565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1631610c4b8260035461137890919063ffffffff16565b1115610ca2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611d616034913960400191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cfc82826000015461137890919063ffffffff16565b8160000181905550610d198260035461137890919063ffffffff16565b600381905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60005481565b60016020528060005260406000206000915090505481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dfa57506000816003015414155b610e4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611db76025913960400191505060405180910390fd5b610e6a81600101548260000154611a2290919063ffffffff16565b816000018190555060008160030181905550610e958160010154600354611a2290919063ffffffff16565b6003819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60026020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fe4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000154821115611084576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611ddc6027913960400191505060405180910390fd5b60008082600201541461109b57816002015461109f565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111376003543073ffffffffffffffffffffffffffffffffffffffff1631611a2290919063ffffffff16565b905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61121361120d308585611aab565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546040518082815260200191505060405180910390a2505050565b60035481565b6000808284019050838110156113f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461152c57611469611463308786611b4b565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461152b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b6000611580600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611a2290919063ffffffff16565b905060006115968261159189610849565b611beb565b905060006115e682600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611beb565b90508482101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b6000811461171d576116bb81600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611a2290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061171681600354611a2290919063ffffffff16565b6003819055505b61176f82600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137890919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff166108fc6117df8785611a2290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561180a573d6000803e3d6000fd5b506000851461185b573373ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015611859573d6000803e3d6000fd5b505b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a481831461191b577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611a1a611a1484611c04565b83611c5c565b905092915050565b600082821115611a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611bfa5781611bfc565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611c705760009050611d5a565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611cc45760009350505050611d5a565b601b8160ff1614158015611cdc5750601c8160ff1614155b15611ced5760009350505050611d5a565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611d4a573d6000803e3d6000fd5b5050506020604051035193505050505b9291505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582089af678b6e43eebcf058524d8177d9f06f37f73f03c7dec537f3652623c5ea4f64736f6c634300050b0032" - -// DeploySimpleSwap deploys a new Ethereum contract, binding an instance of SimpleSwap to it. -func DeploySimpleSwap(auth *bind.TransactOpts, backend bind.ContractBackend, _issuer common.Address, defaultHardDepositTimeoutDuration *big.Int) (common.Address, *types.Transaction, *SimpleSwap, error) { - parsed, err := abi.JSON(strings.NewReader(SimpleSwapABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SimpleSwapBin), backend, _issuer, defaultHardDepositTimeoutDuration) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &SimpleSwap{SimpleSwapCaller: SimpleSwapCaller{contract: contract}, SimpleSwapTransactor: SimpleSwapTransactor{contract: contract}, SimpleSwapFilterer: SimpleSwapFilterer{contract: contract}}, nil -} - -// SimpleSwap is an auto generated Go binding around an Ethereum contract. -type SimpleSwap struct { - SimpleSwapCaller // Read-only binding to the contract - SimpleSwapTransactor // Write-only binding to the contract - SimpleSwapFilterer // Log filterer for contract events -} - -// SimpleSwapCaller is an auto generated read-only Go binding around an Ethereum contract. -type SimpleSwapCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SimpleSwapTransactor is an auto generated write-only Go binding around an Ethereum contract. -type SimpleSwapTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SimpleSwapFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type SimpleSwapFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SimpleSwapSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type SimpleSwapSession struct { - Contract *SimpleSwap // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SimpleSwapCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type SimpleSwapCallerSession struct { - Contract *SimpleSwapCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// SimpleSwapTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type SimpleSwapTransactorSession struct { - Contract *SimpleSwapTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SimpleSwapRaw is an auto generated low-level Go binding around an Ethereum contract. -type SimpleSwapRaw struct { - Contract *SimpleSwap // Generic contract binding to access the raw methods on -} - -// SimpleSwapCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type SimpleSwapCallerRaw struct { - Contract *SimpleSwapCaller // Generic read-only contract binding to access the raw methods on -} - -// SimpleSwapTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type SimpleSwapTransactorRaw struct { - Contract *SimpleSwapTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewSimpleSwap creates a new instance of SimpleSwap, bound to a specific deployed contract. -func NewSimpleSwap(address common.Address, backend bind.ContractBackend) (*SimpleSwap, error) { - contract, err := bindSimpleSwap(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &SimpleSwap{SimpleSwapCaller: SimpleSwapCaller{contract: contract}, SimpleSwapTransactor: SimpleSwapTransactor{contract: contract}, SimpleSwapFilterer: SimpleSwapFilterer{contract: contract}}, nil -} - -// NewSimpleSwapCaller creates a new read-only instance of SimpleSwap, bound to a specific deployed contract. -func NewSimpleSwapCaller(address common.Address, caller bind.ContractCaller) (*SimpleSwapCaller, error) { - contract, err := bindSimpleSwap(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &SimpleSwapCaller{contract: contract}, nil -} - -// NewSimpleSwapTransactor creates a new write-only instance of SimpleSwap, bound to a specific deployed contract. -func NewSimpleSwapTransactor(address common.Address, transactor bind.ContractTransactor) (*SimpleSwapTransactor, error) { - contract, err := bindSimpleSwap(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &SimpleSwapTransactor{contract: contract}, nil -} - -// NewSimpleSwapFilterer creates a new log filterer instance of SimpleSwap, bound to a specific deployed contract. -func NewSimpleSwapFilterer(address common.Address, filterer bind.ContractFilterer) (*SimpleSwapFilterer, error) { - contract, err := bindSimpleSwap(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &SimpleSwapFilterer{contract: contract}, nil -} - -// bindSimpleSwap binds a generic wrapper to an already deployed contract. -func bindSimpleSwap(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(SimpleSwapABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SimpleSwap *SimpleSwapRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SimpleSwap.Contract.SimpleSwapCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SimpleSwap *SimpleSwapRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SimpleSwap.Contract.SimpleSwapTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SimpleSwap *SimpleSwapRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SimpleSwap.Contract.SimpleSwapTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SimpleSwap *SimpleSwapCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SimpleSwap.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SimpleSwap *SimpleSwapTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SimpleSwap.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SimpleSwap *SimpleSwapTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SimpleSwap.Contract.contract.Transact(opts, method, params...) -} - -// DEFAULTHARDDEPOSITDECREASETIMEOUT is a free data retrieval call binding the contract method 0x5eb54160. -// -// Solidity: function DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) DEFAULTHARDDEPOSITDECREASETIMEOUT(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT") - return *ret0, err -} - -// DEFAULTHARDDEPOSITDECREASETIMEOUT is a free data retrieval call binding the contract method 0x5eb54160. -// -// Solidity: function DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT() constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) DEFAULTHARDDEPOSITDECREASETIMEOUT() (*big.Int, error) { - return _SimpleSwap.Contract.DEFAULTHARDDEPOSITDECREASETIMEOUT(&_SimpleSwap.CallOpts) -} - -// DEFAULTHARDDEPOSITDECREASETIMEOUT is a free data retrieval call binding the contract method 0x5eb54160. -// -// Solidity: function DEFAULT_HARDDEPOSIT_DECREASE_TIMEOUT() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) DEFAULTHARDDEPOSITDECREASETIMEOUT() (*big.Int, error) { - return _SimpleSwap.Contract.DEFAULTHARDDEPOSITDECREASETIMEOUT(&_SimpleSwap.CallOpts) -} - -// AvailableBalanceFor is a free data retrieval call binding the contract method 0x065c804f. -// -// Solidity: function availableBalanceFor(address beneficiary) constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) AvailableBalanceFor(opts *bind.CallOpts, beneficiary common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "availableBalanceFor", beneficiary) - return *ret0, err -} - -// AvailableBalanceFor is a free data retrieval call binding the contract method 0x065c804f. -// -// Solidity: function availableBalanceFor(address beneficiary) constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) AvailableBalanceFor(beneficiary common.Address) (*big.Int, error) { - return _SimpleSwap.Contract.AvailableBalanceFor(&_SimpleSwap.CallOpts, beneficiary) -} - -// AvailableBalanceFor is a free data retrieval call binding the contract method 0x065c804f. -// -// Solidity: function availableBalanceFor(address beneficiary) constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) AvailableBalanceFor(beneficiary common.Address) (*big.Int, error) { - return _SimpleSwap.Contract.AvailableBalanceFor(&_SimpleSwap.CallOpts, beneficiary) -} - -// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. -// -// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 decreaseTimeout, uint256 canBeDecreasedAt) -func (_SimpleSwap *SimpleSwapCaller) HardDeposits(opts *bind.CallOpts, arg0 common.Address) (struct { - Amount *big.Int - DecreaseAmount *big.Int - DecreaseTimeout *big.Int - CanBeDecreasedAt *big.Int -}, error) { - ret := new(struct { - Amount *big.Int - DecreaseAmount *big.Int - DecreaseTimeout *big.Int - CanBeDecreasedAt *big.Int - }) - out := ret - err := _SimpleSwap.contract.Call(opts, out, "hardDeposits", arg0) - return *ret, err -} - -// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. -// -// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 decreaseTimeout, uint256 canBeDecreasedAt) -func (_SimpleSwap *SimpleSwapSession) HardDeposits(arg0 common.Address) (struct { - Amount *big.Int - DecreaseAmount *big.Int - DecreaseTimeout *big.Int - CanBeDecreasedAt *big.Int -}, error) { - return _SimpleSwap.Contract.HardDeposits(&_SimpleSwap.CallOpts, arg0) -} - -// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. -// -// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 decreaseTimeout, uint256 canBeDecreasedAt) -func (_SimpleSwap *SimpleSwapCallerSession) HardDeposits(arg0 common.Address) (struct { - Amount *big.Int - DecreaseAmount *big.Int - DecreaseTimeout *big.Int - CanBeDecreasedAt *big.Int -}, error) { - return _SimpleSwap.Contract.HardDeposits(&_SimpleSwap.CallOpts, arg0) -} - -// Issuer is a free data retrieval call binding the contract method 0x1d143848. -// -// Solidity: function issuer() constant returns(address) -func (_SimpleSwap *SimpleSwapCaller) Issuer(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "issuer") - return *ret0, err -} - -// Issuer is a free data retrieval call binding the contract method 0x1d143848. -// -// Solidity: function issuer() constant returns(address) -func (_SimpleSwap *SimpleSwapSession) Issuer() (common.Address, error) { - return _SimpleSwap.Contract.Issuer(&_SimpleSwap.CallOpts) -} - -// Issuer is a free data retrieval call binding the contract method 0x1d143848. -// -// Solidity: function issuer() constant returns(address) -func (_SimpleSwap *SimpleSwapCallerSession) Issuer() (common.Address, error) { - return _SimpleSwap.Contract.Issuer(&_SimpleSwap.CallOpts) -} - -// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. -// -// Solidity: function liquidBalance() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) LiquidBalance(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "liquidBalance") - return *ret0, err -} - -// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. -// -// Solidity: function liquidBalance() constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) LiquidBalance() (*big.Int, error) { - return _SimpleSwap.Contract.LiquidBalance(&_SimpleSwap.CallOpts) -} - -// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. -// -// Solidity: function liquidBalance() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) LiquidBalance() (*big.Int, error) { - return _SimpleSwap.Contract.LiquidBalance(&_SimpleSwap.CallOpts) -} - -// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. -// -// Solidity: function paidOut(address ) constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) PaidOut(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "paidOut", arg0) - return *ret0, err -} - -// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. -// -// Solidity: function paidOut(address ) constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) PaidOut(arg0 common.Address) (*big.Int, error) { - return _SimpleSwap.Contract.PaidOut(&_SimpleSwap.CallOpts, arg0) -} - -// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. -// -// Solidity: function paidOut(address ) constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) PaidOut(arg0 common.Address) (*big.Int, error) { - return _SimpleSwap.Contract.PaidOut(&_SimpleSwap.CallOpts, arg0) -} - -// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. -// -// Solidity: function totalHardDeposit() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCaller) TotalHardDeposit(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _SimpleSwap.contract.Call(opts, out, "totalHardDeposit") - return *ret0, err -} - -// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. -// -// Solidity: function totalHardDeposit() constant returns(uint256) -func (_SimpleSwap *SimpleSwapSession) TotalHardDeposit() (*big.Int, error) { - return _SimpleSwap.Contract.TotalHardDeposit(&_SimpleSwap.CallOpts) -} - -// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. -// -// Solidity: function totalHardDeposit() constant returns(uint256) -func (_SimpleSwap *SimpleSwapCallerSession) TotalHardDeposit() (*big.Int, error) { - return _SimpleSwap.Contract.TotalHardDeposit(&_SimpleSwap.CallOpts) -} - -// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. -// -// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapTransactor) CashCheque(opts *bind.TransactOpts, beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "cashCheque", beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) -} - -// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. -// -// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapSession) CashCheque(beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.CashCheque(&_SimpleSwap.TransactOpts, beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) -} - -// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. -// -// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) CashCheque(beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.CashCheque(&_SimpleSwap.TransactOpts, beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) -} - -// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. -// -// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapTransactor) CashChequeBeneficiary(opts *bind.TransactOpts, recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "cashChequeBeneficiary", recipient, cumulativePayout, issuerSig) -} - -// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. -// -// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapSession) CashChequeBeneficiary(recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.CashChequeBeneficiary(&_SimpleSwap.TransactOpts, recipient, cumulativePayout, issuerSig) -} - -// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. -// -// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) CashChequeBeneficiary(recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.CashChequeBeneficiary(&_SimpleSwap.TransactOpts, recipient, cumulativePayout, issuerSig) -} - -// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. -// -// Solidity: function decreaseHardDeposit(address beneficiary) returns() -func (_SimpleSwap *SimpleSwapTransactor) DecreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "decreaseHardDeposit", beneficiary) -} - -// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. -// -// Solidity: function decreaseHardDeposit(address beneficiary) returns() -func (_SimpleSwap *SimpleSwapSession) DecreaseHardDeposit(beneficiary common.Address) (*types.Transaction, error) { - return _SimpleSwap.Contract.DecreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary) -} - -// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. -// -// Solidity: function decreaseHardDeposit(address beneficiary) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) DecreaseHardDeposit(beneficiary common.Address) (*types.Transaction, error) { - return _SimpleSwap.Contract.DecreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary) -} - -// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. -// -// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() -func (_SimpleSwap *SimpleSwapTransactor) IncreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "increaseHardDeposit", beneficiary, amount) -} - -// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. -// -// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() -func (_SimpleSwap *SimpleSwapSession) IncreaseHardDeposit(beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.IncreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary, amount) -} - -// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. -// -// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) IncreaseHardDeposit(beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.IncreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary, amount) -} - -// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. -// -// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() -func (_SimpleSwap *SimpleSwapTransactor) PrepareDecreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "prepareDecreaseHardDeposit", beneficiary, decreaseAmount) -} - -// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. -// -// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() -func (_SimpleSwap *SimpleSwapSession) PrepareDecreaseHardDeposit(beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.PrepareDecreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary, decreaseAmount) -} - -// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. -// -// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) PrepareDecreaseHardDeposit(beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.PrepareDecreaseHardDeposit(&_SimpleSwap.TransactOpts, beneficiary, decreaseAmount) -} - -// SetCustomHardDepositDecreaseTimeout is a paid mutator transaction binding the contract method 0xdf324380. -// -// Solidity: function setCustomHardDepositDecreaseTimeout(address beneficiary, uint256 decreaseTimeout, bytes beneficiarySig) returns() -func (_SimpleSwap *SimpleSwapTransactor) SetCustomHardDepositDecreaseTimeout(opts *bind.TransactOpts, beneficiary common.Address, decreaseTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "setCustomHardDepositDecreaseTimeout", beneficiary, decreaseTimeout, beneficiarySig) -} - -// SetCustomHardDepositDecreaseTimeout is a paid mutator transaction binding the contract method 0xdf324380. -// -// Solidity: function setCustomHardDepositDecreaseTimeout(address beneficiary, uint256 decreaseTimeout, bytes beneficiarySig) returns() -func (_SimpleSwap *SimpleSwapSession) SetCustomHardDepositDecreaseTimeout(beneficiary common.Address, decreaseTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.SetCustomHardDepositDecreaseTimeout(&_SimpleSwap.TransactOpts, beneficiary, decreaseTimeout, beneficiarySig) -} - -// SetCustomHardDepositDecreaseTimeout is a paid mutator transaction binding the contract method 0xdf324380. -// -// Solidity: function setCustomHardDepositDecreaseTimeout(address beneficiary, uint256 decreaseTimeout, bytes beneficiarySig) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) SetCustomHardDepositDecreaseTimeout(beneficiary common.Address, decreaseTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { - return _SimpleSwap.Contract.SetCustomHardDepositDecreaseTimeout(&_SimpleSwap.TransactOpts, beneficiary, decreaseTimeout, beneficiarySig) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. -// -// Solidity: function withdraw(uint256 amount) returns() -func (_SimpleSwap *SimpleSwapTransactor) Withdraw(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.contract.Transact(opts, "withdraw", amount) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. -// -// Solidity: function withdraw(uint256 amount) returns() -func (_SimpleSwap *SimpleSwapSession) Withdraw(amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.Withdraw(&_SimpleSwap.TransactOpts, amount) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. -// -// Solidity: function withdraw(uint256 amount) returns() -func (_SimpleSwap *SimpleSwapTransactorSession) Withdraw(amount *big.Int) (*types.Transaction, error) { - return _SimpleSwap.Contract.Withdraw(&_SimpleSwap.TransactOpts, amount) -} - -// SimpleSwapChequeBouncedIterator is returned from FilterChequeBounced and is used to iterate over the raw logs and unpacked data for ChequeBounced events raised by the SimpleSwap contract. -type SimpleSwapChequeBouncedIterator struct { - Event *SimpleSwapChequeBounced // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapChequeBouncedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapChequeBounced) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapChequeBounced) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapChequeBouncedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapChequeBouncedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapChequeBounced represents a ChequeBounced event raised by the SimpleSwap contract. -type SimpleSwapChequeBounced struct { - Raw types.Log // Blockchain specific contextual infos -} - -// FilterChequeBounced is a free log retrieval operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. -// -// Solidity: event ChequeBounced() -func (_SimpleSwap *SimpleSwapFilterer) FilterChequeBounced(opts *bind.FilterOpts) (*SimpleSwapChequeBouncedIterator, error) { - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "ChequeBounced") - if err != nil { - return nil, err - } - return &SimpleSwapChequeBouncedIterator{contract: _SimpleSwap.contract, event: "ChequeBounced", logs: logs, sub: sub}, nil -} - -// WatchChequeBounced is a free log subscription operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. -// -// Solidity: event ChequeBounced() -func (_SimpleSwap *SimpleSwapFilterer) WatchChequeBounced(opts *bind.WatchOpts, sink chan<- *SimpleSwapChequeBounced) (event.Subscription, error) { - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "ChequeBounced") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapChequeBounced) - if err := _SimpleSwap.contract.UnpackLog(event, "ChequeBounced", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseChequeBounced is a log parse operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. -// -// Solidity: event ChequeBounced() -func (_SimpleSwap *SimpleSwapFilterer) ParseChequeBounced(log types.Log) (*SimpleSwapChequeBounced, error) { - event := new(SimpleSwapChequeBounced) - if err := _SimpleSwap.contract.UnpackLog(event, "ChequeBounced", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapChequeCashedIterator is returned from FilterChequeCashed and is used to iterate over the raw logs and unpacked data for ChequeCashed events raised by the SimpleSwap contract. -type SimpleSwapChequeCashedIterator struct { - Event *SimpleSwapChequeCashed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapChequeCashedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapChequeCashed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapChequeCashed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapChequeCashedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapChequeCashedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapChequeCashed represents a ChequeCashed event raised by the SimpleSwap contract. -type SimpleSwapChequeCashed struct { - Beneficiary common.Address - Recipient common.Address - Caller common.Address - TotalPayout *big.Int - CumulativePayout *big.Int - CallerPayout *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterChequeCashed is a free log retrieval operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. -// -// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) -func (_SimpleSwap *SimpleSwapFilterer) FilterChequeCashed(opts *bind.FilterOpts, beneficiary []common.Address, recipient []common.Address, caller []common.Address) (*SimpleSwapChequeCashedIterator, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - var recipientRule []interface{} - for _, recipientItem := range recipient { - recipientRule = append(recipientRule, recipientItem) - } - var callerRule []interface{} - for _, callerItem := range caller { - callerRule = append(callerRule, callerItem) - } - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "ChequeCashed", beneficiaryRule, recipientRule, callerRule) - if err != nil { - return nil, err - } - return &SimpleSwapChequeCashedIterator{contract: _SimpleSwap.contract, event: "ChequeCashed", logs: logs, sub: sub}, nil -} - -// WatchChequeCashed is a free log subscription operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. -// -// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) -func (_SimpleSwap *SimpleSwapFilterer) WatchChequeCashed(opts *bind.WatchOpts, sink chan<- *SimpleSwapChequeCashed, beneficiary []common.Address, recipient []common.Address, caller []common.Address) (event.Subscription, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - var recipientRule []interface{} - for _, recipientItem := range recipient { - recipientRule = append(recipientRule, recipientItem) - } - var callerRule []interface{} - for _, callerItem := range caller { - callerRule = append(callerRule, callerItem) - } - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "ChequeCashed", beneficiaryRule, recipientRule, callerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapChequeCashed) - if err := _SimpleSwap.contract.UnpackLog(event, "ChequeCashed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseChequeCashed is a log parse operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. -// -// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) -func (_SimpleSwap *SimpleSwapFilterer) ParseChequeCashed(log types.Log) (*SimpleSwapChequeCashed, error) { - event := new(SimpleSwapChequeCashed) - if err := _SimpleSwap.contract.UnpackLog(event, "ChequeCashed", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the SimpleSwap contract. -type SimpleSwapDepositIterator struct { - Event *SimpleSwapDeposit // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapDepositIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapDeposit) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapDeposit) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapDepositIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapDepositIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapDeposit represents a Deposit event raised by the SimpleSwap contract. -type SimpleSwapDeposit struct { - Depositor common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address depositor, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) FilterDeposit(opts *bind.FilterOpts) (*SimpleSwapDepositIterator, error) { - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "Deposit") - if err != nil { - return nil, err - } - return &SimpleSwapDepositIterator{contract: _SimpleSwap.contract, event: "Deposit", logs: logs, sub: sub}, nil -} - -// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address depositor, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *SimpleSwapDeposit) (event.Subscription, error) { - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "Deposit") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapDeposit) - if err := _SimpleSwap.contract.UnpackLog(event, "Deposit", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseDeposit is a log parse operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(address depositor, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) ParseDeposit(log types.Log) (*SimpleSwapDeposit, error) { - event := new(SimpleSwapDeposit) - if err := _SimpleSwap.contract.UnpackLog(event, "Deposit", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapHardDepositAmountChangedIterator is returned from FilterHardDepositAmountChanged and is used to iterate over the raw logs and unpacked data for HardDepositAmountChanged events raised by the SimpleSwap contract. -type SimpleSwapHardDepositAmountChangedIterator struct { - Event *SimpleSwapHardDepositAmountChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapHardDepositAmountChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositAmountChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositAmountChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapHardDepositAmountChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapHardDepositAmountChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapHardDepositAmountChanged represents a HardDepositAmountChanged event raised by the SimpleSwap contract. -type SimpleSwapHardDepositAmountChanged struct { - Beneficiary common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterHardDepositAmountChanged is a free log retrieval operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. -// -// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) FilterHardDepositAmountChanged(opts *bind.FilterOpts, beneficiary []common.Address) (*SimpleSwapHardDepositAmountChangedIterator, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "HardDepositAmountChanged", beneficiaryRule) - if err != nil { - return nil, err - } - return &SimpleSwapHardDepositAmountChangedIterator{contract: _SimpleSwap.contract, event: "HardDepositAmountChanged", logs: logs, sub: sub}, nil -} - -// WatchHardDepositAmountChanged is a free log subscription operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. -// -// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) WatchHardDepositAmountChanged(opts *bind.WatchOpts, sink chan<- *SimpleSwapHardDepositAmountChanged, beneficiary []common.Address) (event.Subscription, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "HardDepositAmountChanged", beneficiaryRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapHardDepositAmountChanged) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositAmountChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseHardDepositAmountChanged is a log parse operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. -// -// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) ParseHardDepositAmountChanged(log types.Log) (*SimpleSwapHardDepositAmountChanged, error) { - event := new(SimpleSwapHardDepositAmountChanged) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositAmountChanged", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapHardDepositDecreasePreparedIterator is returned from FilterHardDepositDecreasePrepared and is used to iterate over the raw logs and unpacked data for HardDepositDecreasePrepared events raised by the SimpleSwap contract. -type SimpleSwapHardDepositDecreasePreparedIterator struct { - Event *SimpleSwapHardDepositDecreasePrepared // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapHardDepositDecreasePreparedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositDecreasePrepared) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositDecreasePrepared) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapHardDepositDecreasePreparedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapHardDepositDecreasePreparedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapHardDepositDecreasePrepared represents a HardDepositDecreasePrepared event raised by the SimpleSwap contract. -type SimpleSwapHardDepositDecreasePrepared struct { - Beneficiary common.Address - DecreaseAmount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterHardDepositDecreasePrepared is a free log retrieval operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. -// -// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) -func (_SimpleSwap *SimpleSwapFilterer) FilterHardDepositDecreasePrepared(opts *bind.FilterOpts, beneficiary []common.Address) (*SimpleSwapHardDepositDecreasePreparedIterator, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "HardDepositDecreasePrepared", beneficiaryRule) - if err != nil { - return nil, err - } - return &SimpleSwapHardDepositDecreasePreparedIterator{contract: _SimpleSwap.contract, event: "HardDepositDecreasePrepared", logs: logs, sub: sub}, nil -} - -// WatchHardDepositDecreasePrepared is a free log subscription operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. -// -// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) -func (_SimpleSwap *SimpleSwapFilterer) WatchHardDepositDecreasePrepared(opts *bind.WatchOpts, sink chan<- *SimpleSwapHardDepositDecreasePrepared, beneficiary []common.Address) (event.Subscription, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "HardDepositDecreasePrepared", beneficiaryRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapHardDepositDecreasePrepared) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositDecreasePrepared", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseHardDepositDecreasePrepared is a log parse operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. -// -// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) -func (_SimpleSwap *SimpleSwapFilterer) ParseHardDepositDecreasePrepared(log types.Log) (*SimpleSwapHardDepositDecreasePrepared, error) { - event := new(SimpleSwapHardDepositDecreasePrepared) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositDecreasePrepared", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapHardDepositDecreaseTimeoutChangedIterator is returned from FilterHardDepositDecreaseTimeoutChanged and is used to iterate over the raw logs and unpacked data for HardDepositDecreaseTimeoutChanged events raised by the SimpleSwap contract. -type SimpleSwapHardDepositDecreaseTimeoutChangedIterator struct { - Event *SimpleSwapHardDepositDecreaseTimeoutChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapHardDepositDecreaseTimeoutChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositDecreaseTimeoutChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapHardDepositDecreaseTimeoutChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapHardDepositDecreaseTimeoutChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapHardDepositDecreaseTimeoutChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapHardDepositDecreaseTimeoutChanged represents a HardDepositDecreaseTimeoutChanged event raised by the SimpleSwap contract. -type SimpleSwapHardDepositDecreaseTimeoutChanged struct { - Beneficiary common.Address - DecreaseTimeout *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterHardDepositDecreaseTimeoutChanged is a free log retrieval operation binding the contract event 0x86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f. -// -// Solidity: event HardDepositDecreaseTimeoutChanged(address indexed beneficiary, uint256 decreaseTimeout) -func (_SimpleSwap *SimpleSwapFilterer) FilterHardDepositDecreaseTimeoutChanged(opts *bind.FilterOpts, beneficiary []common.Address) (*SimpleSwapHardDepositDecreaseTimeoutChangedIterator, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "HardDepositDecreaseTimeoutChanged", beneficiaryRule) - if err != nil { - return nil, err - } - return &SimpleSwapHardDepositDecreaseTimeoutChangedIterator{contract: _SimpleSwap.contract, event: "HardDepositDecreaseTimeoutChanged", logs: logs, sub: sub}, nil -} - -// WatchHardDepositDecreaseTimeoutChanged is a free log subscription operation binding the contract event 0x86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f. -// -// Solidity: event HardDepositDecreaseTimeoutChanged(address indexed beneficiary, uint256 decreaseTimeout) -func (_SimpleSwap *SimpleSwapFilterer) WatchHardDepositDecreaseTimeoutChanged(opts *bind.WatchOpts, sink chan<- *SimpleSwapHardDepositDecreaseTimeoutChanged, beneficiary []common.Address) (event.Subscription, error) { - - var beneficiaryRule []interface{} - for _, beneficiaryItem := range beneficiary { - beneficiaryRule = append(beneficiaryRule, beneficiaryItem) - } - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "HardDepositDecreaseTimeoutChanged", beneficiaryRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapHardDepositDecreaseTimeoutChanged) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositDecreaseTimeoutChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseHardDepositDecreaseTimeoutChanged is a log parse operation binding the contract event 0x86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f. -// -// Solidity: event HardDepositDecreaseTimeoutChanged(address indexed beneficiary, uint256 decreaseTimeout) -func (_SimpleSwap *SimpleSwapFilterer) ParseHardDepositDecreaseTimeoutChanged(log types.Log) (*SimpleSwapHardDepositDecreaseTimeoutChanged, error) { - event := new(SimpleSwapHardDepositDecreaseTimeoutChanged) - if err := _SimpleSwap.contract.UnpackLog(event, "HardDepositDecreaseTimeoutChanged", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapWithdrawIterator is returned from FilterWithdraw and is used to iterate over the raw logs and unpacked data for Withdraw events raised by the SimpleSwap contract. -type SimpleSwapWithdrawIterator struct { - Event *SimpleSwapWithdraw // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapWithdrawIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapWithdraw) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapWithdraw) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapWithdrawIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapWithdrawIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapWithdraw represents a Withdraw event raised by the SimpleSwap contract. -type SimpleSwapWithdraw struct { - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterWithdraw is a free log retrieval operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. -// -// Solidity: event Withdraw(uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) FilterWithdraw(opts *bind.FilterOpts) (*SimpleSwapWithdrawIterator, error) { - - logs, sub, err := _SimpleSwap.contract.FilterLogs(opts, "Withdraw") - if err != nil { - return nil, err - } - return &SimpleSwapWithdrawIterator{contract: _SimpleSwap.contract, event: "Withdraw", logs: logs, sub: sub}, nil -} - -// WatchWithdraw is a free log subscription operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. -// -// Solidity: event Withdraw(uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *SimpleSwapWithdraw) (event.Subscription, error) { - - logs, sub, err := _SimpleSwap.contract.WatchLogs(opts, "Withdraw") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapWithdraw) - if err := _SimpleSwap.contract.UnpackLog(event, "Withdraw", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseWithdraw is a log parse operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. -// -// Solidity: event Withdraw(uint256 amount) -func (_SimpleSwap *SimpleSwapFilterer) ParseWithdraw(log types.Log) (*SimpleSwapWithdraw, error) { - event := new(SimpleSwapWithdraw) - if err := _SimpleSwap.contract.UnpackLog(event, "Withdraw", log); err != nil { - return nil, err - } - return event, nil -} - -// SimpleSwapFactoryABI is the input ABI used to generate the binding from. -const SimpleSwapFactoryABI = "[{\"constant\":false,\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"defaultHardDepositTimeoutDuration\",\"type\":\"uint256\"}],\"name\":\"deploySimpleSwap\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deployedContracts\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"SimpleSwapDeployed\",\"type\":\"event\"}]" - -// SimpleSwapFactoryBin is the compiled bytecode used for deploying new contracts. -var SimpleSwapFactoryBin = "0x608060405234801561001057600080fd5b50612228806100206000396000f3fe6080604052600436106100295760003560e01c8063576d72711461002e578063c70242ad146100bc575b600080fd5b61007a6004803603604081101561004457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610125565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100c857600080fd5b5061010b600480360360208110156100df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610258565b604051808215151515815260200191505060405180910390f35b60008034848460405161013790610278565b808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040518091039082f08015801561018f573d6000803e3d6000fd5b509050905060016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00481604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18091505092915050565b60006020528060005260406000206000915054906101000a900460ff1681565b611f6e806102868339019056fe6080604052604051611f6e380380611f6e8339818101604052604081101561002657600080fd5b8101908080519060200190929190805190602001909291905050508060008190555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060003411156100fe577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b5050611e5f8061010f6000396000f3fe6080604052600436106100dd5760003560e01c806381f03fcb1161007f578063b777035011610059578063b7770350146106a6578063b7ec1a3314610701578063df3243801461072c578063e0bcf13a1461081e576100dd565b806381f03fcb14610576578063946f46a2146105db578063b6343b0d1461062c576100dd565b80631d143848116100bb5780631d1438481461045e5780632e1a7d4d146104b5578063338f3fed146104f05780635eb541601461054b576100dd565b8063065c804f146101545780630d5f2659146101b95780631633fb1d146102ab575b6000341115610152577fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b005b34801561016057600080fd5b506101a36004803603602081101561017757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610849565b6040518082815260200191505060405180910390f35b3480156101c557600080fd5b506102a9600480360360608110156101dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561022357600080fd5b82018360208201111561023557600080fd5b8035906020019184600183028401116401000000008311171561025757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108ae565b005b3480156102b757600080fd5b5061045c600480360360c08110156102ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561033557600080fd5b82018360208201111561034757600080fd5b8035906020019184600183028401116401000000008311171561036957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001906401000000008111156103d657600080fd5b8201836020820111156103e857600080fd5b8035906020019184600183028401116401000000008311171561040a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506108c1565b005b34801561046a57600080fd5b5061047361096f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c157600080fd5b506104ee600480360360208110156104d857600080fd5b8101908080359060200190929190505050610995565b005b3480156104fc57600080fd5b506105496004803603604081101561051357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5b565b005b34801561055757600080fd5b50610560610d80565b6040518082815260200191505060405180910390f35b34801561058257600080fd5b506105c56004803603602081101561059957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d86565b6040518082815260200191505060405180910390f35b3480156105e757600080fd5b5061062a600480360360208110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d9e565b005b34801561063857600080fd5b5061067b6004803603602081101561064f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef1565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b3480156106b257600080fd5b506106ff600480360360408110156106c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f21565b005b34801561070d57600080fd5b50610716611109565b6040518082815260200191505060405180910390f35b34801561073857600080fd5b5061081c6004803603606081101561074f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561079657600080fd5b8201836020820111156107a857600080fd5b803590602001918460018302840111640100000000831117156107ca57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061113c565b005b34801561082a57600080fd5b50610833611372565b6040518082815260200191505060405180910390f35b60006108a7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610899611109565b61137890919063ffffffff16565b9050919050565b6108bc338484600085611400565b505050565b6108d76108d13033878987611925565b84611a06565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461095a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b6109678686868585611400565b505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610a60611109565b811115610ab8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611e036028913960400191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b20573d6000803e3d6000fd5b507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d816040518082815260200191505060405180910390a150565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1631610c4b8260035461137890919063ffffffff16565b1115610ca2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611d616034913960400191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cfc82826000015461137890919063ffffffff16565b8160000181905550610d198260035461137890919063ffffffff16565b600381905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60005481565b60016020528060005260406000206000915090505481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dfa57506000816003015414155b610e4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611db76025913960400191505060405180910390fd5b610e6a81600101548260000154611a2290919063ffffffff16565b816000018190555060008160030181905550610e958160010154600354611a2290919063ffffffff16565b6003819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60026020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fe4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000154821115611084576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611ddc6027913960400191505060405180910390fd5b60008082600201541461109b57816002015461109f565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111376003543073ffffffffffffffffffffffffffffffffffffffff1631611a2290919063ffffffff16565b905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61121361120d308585611aab565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d956022913960400191505060405180910390fd5b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f86b5d1492f68620b7cc58d71bd1380193d46a46d90553b73e919e0c6f319fe1f600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546040518082815260200191505060405180910390a2505050565b60035481565b6000808284019050838110156113f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461152c57611469611463308786611b4b565b82611a06565b73ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461152b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b6000611580600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611a2290919063ffffffff16565b905060006115968261159189610849565b611beb565b905060006115e682600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611beb565b90508482101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b6000811461171d576116bb81600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611a2290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061171681600354611a2290919063ffffffff16565b6003819055505b61176f82600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137890919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff166108fc6117df8785611a2290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561180a573d6000803e3d6000fd5b506000851461185b573373ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015611859573d6000803e3d6000fd5b505b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a481831461191b577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611a1a611a1484611c04565b83611c5c565b905092915050565b600082821115611a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611bfa5781611bfc565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611c705760009050611d5a565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611cc45760009350505050611d5a565b601b8160ff1614158015611cdc5750601c8160ff1614155b15611ced5760009350505050611d5a565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611d4a573d6000803e3d6000fd5b5050506020604051035193505050505b9291505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582089af678b6e43eebcf058524d8177d9f06f37f73f03c7dec537f3652623c5ea4f64736f6c634300050b0032a265627a7a72315820ebd4cb32a61da1ceb5a10453df5bff99698d82ce29addf07fe22d33246f941de64736f6c634300050b0032" - -// DeploySimpleSwapFactory deploys a new Ethereum contract, binding an instance of SimpleSwapFactory to it. -func DeploySimpleSwapFactory(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SimpleSwapFactory, error) { - parsed, err := abi.JSON(strings.NewReader(SimpleSwapFactoryABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SimpleSwapFactoryBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &SimpleSwapFactory{SimpleSwapFactoryCaller: SimpleSwapFactoryCaller{contract: contract}, SimpleSwapFactoryTransactor: SimpleSwapFactoryTransactor{contract: contract}, SimpleSwapFactoryFilterer: SimpleSwapFactoryFilterer{contract: contract}}, nil -} - -// SimpleSwapFactory is an auto generated Go binding around an Ethereum contract. -type SimpleSwapFactory struct { - SimpleSwapFactoryCaller // Read-only binding to the contract - SimpleSwapFactoryTransactor // Write-only binding to the contract - SimpleSwapFactoryFilterer // Log filterer for contract events -} - -// SimpleSwapFactoryCaller is an auto generated read-only Go binding around an Ethereum contract. -type SimpleSwapFactoryCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SimpleSwapFactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. -type SimpleSwapFactoryTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SimpleSwapFactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type SimpleSwapFactoryFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SimpleSwapFactorySession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type SimpleSwapFactorySession struct { - Contract *SimpleSwapFactory // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SimpleSwapFactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type SimpleSwapFactoryCallerSession struct { - Contract *SimpleSwapFactoryCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// SimpleSwapFactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type SimpleSwapFactoryTransactorSession struct { - Contract *SimpleSwapFactoryTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SimpleSwapFactoryRaw is an auto generated low-level Go binding around an Ethereum contract. -type SimpleSwapFactoryRaw struct { - Contract *SimpleSwapFactory // Generic contract binding to access the raw methods on -} - -// SimpleSwapFactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type SimpleSwapFactoryCallerRaw struct { - Contract *SimpleSwapFactoryCaller // Generic read-only contract binding to access the raw methods on -} - -// SimpleSwapFactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type SimpleSwapFactoryTransactorRaw struct { - Contract *SimpleSwapFactoryTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewSimpleSwapFactory creates a new instance of SimpleSwapFactory, bound to a specific deployed contract. -func NewSimpleSwapFactory(address common.Address, backend bind.ContractBackend) (*SimpleSwapFactory, error) { - contract, err := bindSimpleSwapFactory(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &SimpleSwapFactory{SimpleSwapFactoryCaller: SimpleSwapFactoryCaller{contract: contract}, SimpleSwapFactoryTransactor: SimpleSwapFactoryTransactor{contract: contract}, SimpleSwapFactoryFilterer: SimpleSwapFactoryFilterer{contract: contract}}, nil -} - -// NewSimpleSwapFactoryCaller creates a new read-only instance of SimpleSwapFactory, bound to a specific deployed contract. -func NewSimpleSwapFactoryCaller(address common.Address, caller bind.ContractCaller) (*SimpleSwapFactoryCaller, error) { - contract, err := bindSimpleSwapFactory(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &SimpleSwapFactoryCaller{contract: contract}, nil -} - -// NewSimpleSwapFactoryTransactor creates a new write-only instance of SimpleSwapFactory, bound to a specific deployed contract. -func NewSimpleSwapFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*SimpleSwapFactoryTransactor, error) { - contract, err := bindSimpleSwapFactory(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &SimpleSwapFactoryTransactor{contract: contract}, nil -} - -// NewSimpleSwapFactoryFilterer creates a new log filterer instance of SimpleSwapFactory, bound to a specific deployed contract. -func NewSimpleSwapFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*SimpleSwapFactoryFilterer, error) { - contract, err := bindSimpleSwapFactory(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &SimpleSwapFactoryFilterer{contract: contract}, nil -} - -// bindSimpleSwapFactory binds a generic wrapper to an already deployed contract. -func bindSimpleSwapFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(SimpleSwapFactoryABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SimpleSwapFactory *SimpleSwapFactoryRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SimpleSwapFactory.Contract.SimpleSwapFactoryCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SimpleSwapFactory *SimpleSwapFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SimpleSwapFactory.Contract.SimpleSwapFactoryTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SimpleSwapFactory *SimpleSwapFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SimpleSwapFactory.Contract.SimpleSwapFactoryTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SimpleSwapFactory *SimpleSwapFactoryCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _SimpleSwapFactory.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SimpleSwapFactory *SimpleSwapFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SimpleSwapFactory.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SimpleSwapFactory *SimpleSwapFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SimpleSwapFactory.Contract.contract.Transact(opts, method, params...) -} - -// DeployedContracts is a free data retrieval call binding the contract method 0xc70242ad. -// -// Solidity: function deployedContracts(address ) constant returns(bool) -func (_SimpleSwapFactory *SimpleSwapFactoryCaller) DeployedContracts(opts *bind.CallOpts, arg0 common.Address) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _SimpleSwapFactory.contract.Call(opts, out, "deployedContracts", arg0) - return *ret0, err -} - -// DeployedContracts is a free data retrieval call binding the contract method 0xc70242ad. -// -// Solidity: function deployedContracts(address ) constant returns(bool) -func (_SimpleSwapFactory *SimpleSwapFactorySession) DeployedContracts(arg0 common.Address) (bool, error) { - return _SimpleSwapFactory.Contract.DeployedContracts(&_SimpleSwapFactory.CallOpts, arg0) -} - -// DeployedContracts is a free data retrieval call binding the contract method 0xc70242ad. -// -// Solidity: function deployedContracts(address ) constant returns(bool) -func (_SimpleSwapFactory *SimpleSwapFactoryCallerSession) DeployedContracts(arg0 common.Address) (bool, error) { - return _SimpleSwapFactory.Contract.DeployedContracts(&_SimpleSwapFactory.CallOpts, arg0) -} - -// DeploySimpleSwap is a paid mutator transaction binding the contract method 0x576d7271. -// -// Solidity: function deploySimpleSwap(address issuer, uint256 defaultHardDepositTimeoutDuration) returns(address) -func (_SimpleSwapFactory *SimpleSwapFactoryTransactor) DeploySimpleSwap(opts *bind.TransactOpts, issuer common.Address, defaultHardDepositTimeoutDuration *big.Int) (*types.Transaction, error) { - return _SimpleSwapFactory.contract.Transact(opts, "deploySimpleSwap", issuer, defaultHardDepositTimeoutDuration) -} - -// DeploySimpleSwap is a paid mutator transaction binding the contract method 0x576d7271. -// -// Solidity: function deploySimpleSwap(address issuer, uint256 defaultHardDepositTimeoutDuration) returns(address) -func (_SimpleSwapFactory *SimpleSwapFactorySession) DeploySimpleSwap(issuer common.Address, defaultHardDepositTimeoutDuration *big.Int) (*types.Transaction, error) { - return _SimpleSwapFactory.Contract.DeploySimpleSwap(&_SimpleSwapFactory.TransactOpts, issuer, defaultHardDepositTimeoutDuration) -} - -// DeploySimpleSwap is a paid mutator transaction binding the contract method 0x576d7271. -// -// Solidity: function deploySimpleSwap(address issuer, uint256 defaultHardDepositTimeoutDuration) returns(address) -func (_SimpleSwapFactory *SimpleSwapFactoryTransactorSession) DeploySimpleSwap(issuer common.Address, defaultHardDepositTimeoutDuration *big.Int) (*types.Transaction, error) { - return _SimpleSwapFactory.Contract.DeploySimpleSwap(&_SimpleSwapFactory.TransactOpts, issuer, defaultHardDepositTimeoutDuration) -} - -// SimpleSwapFactorySimpleSwapDeployedIterator is returned from FilterSimpleSwapDeployed and is used to iterate over the raw logs and unpacked data for SimpleSwapDeployed events raised by the SimpleSwapFactory contract. -type SimpleSwapFactorySimpleSwapDeployedIterator struct { - Event *SimpleSwapFactorySimpleSwapDeployed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *SimpleSwapFactorySimpleSwapDeployedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(SimpleSwapFactorySimpleSwapDeployed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(SimpleSwapFactorySimpleSwapDeployed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *SimpleSwapFactorySimpleSwapDeployedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *SimpleSwapFactorySimpleSwapDeployedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// SimpleSwapFactorySimpleSwapDeployed represents a SimpleSwapDeployed event raised by the SimpleSwapFactory contract. -type SimpleSwapFactorySimpleSwapDeployed struct { - ContractAddress common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterSimpleSwapDeployed is a free log retrieval operation binding the contract event 0xc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c004. -// -// Solidity: event SimpleSwapDeployed(address contractAddress) -func (_SimpleSwapFactory *SimpleSwapFactoryFilterer) FilterSimpleSwapDeployed(opts *bind.FilterOpts) (*SimpleSwapFactorySimpleSwapDeployedIterator, error) { - - logs, sub, err := _SimpleSwapFactory.contract.FilterLogs(opts, "SimpleSwapDeployed") - if err != nil { - return nil, err - } - return &SimpleSwapFactorySimpleSwapDeployedIterator{contract: _SimpleSwapFactory.contract, event: "SimpleSwapDeployed", logs: logs, sub: sub}, nil -} - -// WatchSimpleSwapDeployed is a free log subscription operation binding the contract event 0xc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c004. -// -// Solidity: event SimpleSwapDeployed(address contractAddress) -func (_SimpleSwapFactory *SimpleSwapFactoryFilterer) WatchSimpleSwapDeployed(opts *bind.WatchOpts, sink chan<- *SimpleSwapFactorySimpleSwapDeployed) (event.Subscription, error) { - - logs, sub, err := _SimpleSwapFactory.contract.WatchLogs(opts, "SimpleSwapDeployed") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(SimpleSwapFactorySimpleSwapDeployed) - if err := _SimpleSwapFactory.contract.UnpackLog(event, "SimpleSwapDeployed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseSimpleSwapDeployed is a log parse operation binding the contract event 0xc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c004. -// -// Solidity: event SimpleSwapDeployed(address contractAddress) -func (_SimpleSwapFactory *SimpleSwapFactoryFilterer) ParseSimpleSwapDeployed(log types.Log) (*SimpleSwapFactorySimpleSwapDeployed, error) { - event := new(SimpleSwapFactorySimpleSwapDeployed) - if err := _SimpleSwapFactory.contract.UnpackLog(event, "SimpleSwapDeployed", log); err != nil { - return nil, err - } - return event, nil -} 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 new file mode 100644 index 0000000000..419e2e34ba --- /dev/null +++ b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/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 = "0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032" 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-0/erc20simpleswap/erc20simpleswap.go new file mode 100644 index 0000000000..8c098a0340 --- /dev/null +++ b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap/erc20simpleswap.go @@ -0,0 +1,5037 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package erc20simpleswap + +import ( + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// ContextABI is the input ABI used to generate the binding from. +const ContextABI = "[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]" + +// Context is an auto generated Go binding around an Ethereum contract. +type Context struct { + ContextCaller // Read-only binding to the contract + ContextTransactor // Write-only binding to the contract + ContextFilterer // Log filterer for contract events +} + +// ContextCaller is an auto generated read-only Go binding around an Ethereum contract. +type ContextCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContextTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ContextTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContextFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ContextFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContextSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ContextSession struct { + Contract *Context // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ContextCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ContextCallerSession struct { + Contract *ContextCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ContextTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ContextTransactorSession struct { + Contract *ContextTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ContextRaw is an auto generated low-level Go binding around an Ethereum contract. +type ContextRaw struct { + Contract *Context // Generic contract binding to access the raw methods on +} + +// ContextCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ContextCallerRaw struct { + Contract *ContextCaller // Generic read-only contract binding to access the raw methods on +} + +// ContextTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ContextTransactorRaw struct { + Contract *ContextTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewContext creates a new instance of Context, bound to a specific deployed contract. +func NewContext(address common.Address, backend bind.ContractBackend) (*Context, error) { + contract, err := bindContext(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Context{ContextCaller: ContextCaller{contract: contract}, ContextTransactor: ContextTransactor{contract: contract}, ContextFilterer: ContextFilterer{contract: contract}}, nil +} + +// NewContextCaller creates a new read-only instance of Context, bound to a specific deployed contract. +func NewContextCaller(address common.Address, caller bind.ContractCaller) (*ContextCaller, error) { + contract, err := bindContext(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ContextCaller{contract: contract}, nil +} + +// NewContextTransactor creates a new write-only instance of Context, bound to a specific deployed contract. +func NewContextTransactor(address common.Address, transactor bind.ContractTransactor) (*ContextTransactor, error) { + contract, err := bindContext(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ContextTransactor{contract: contract}, nil +} + +// NewContextFilterer creates a new log filterer instance of Context, bound to a specific deployed contract. +func NewContextFilterer(address common.Address, filterer bind.ContractFilterer) (*ContextFilterer, error) { + contract, err := bindContext(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ContextFilterer{contract: contract}, nil +} + +// bindContext binds a generic wrapper to an already deployed contract. +func bindContext(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ContextABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Context *ContextRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Context.Contract.ContextCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Context *ContextRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Context.Contract.ContextTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Context *ContextRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Context.Contract.ContextTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Context *ContextCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Context.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Context *ContextTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Context.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Context *ContextTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Context.Contract.contract.Transact(opts, method, params...) +} + +// ECDSAABI is the input ABI used to generate the binding from. +const ECDSAABI = "[]" + +// ECDSABin is the compiled bytecode used for deploying new contracts. +var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820c087da536b18c4187b7cacb424c2e4c58e707414a9642df27f1db97cccc3b7f464736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(ECDSAABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ECDSABin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ECDSA{ECDSACaller: ECDSACaller{contract: contract}, ECDSATransactor: ECDSATransactor{contract: contract}, ECDSAFilterer: ECDSAFilterer{contract: contract}}, nil +} + +// ECDSA is an auto generated Go binding around an Ethereum contract. +type ECDSA struct { + ECDSACaller // Read-only binding to the contract + ECDSATransactor // Write-only binding to the contract + ECDSAFilterer // Log filterer for contract events +} + +// ECDSACaller is an auto generated read-only Go binding around an Ethereum contract. +type ECDSACaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ECDSATransactor is an auto generated write-only Go binding around an Ethereum contract. +type ECDSATransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ECDSAFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ECDSAFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ECDSASession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ECDSASession struct { + Contract *ECDSA // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ECDSACallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ECDSACallerSession struct { + Contract *ECDSACaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ECDSATransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ECDSATransactorSession struct { + Contract *ECDSATransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ECDSARaw is an auto generated low-level Go binding around an Ethereum contract. +type ECDSARaw struct { + Contract *ECDSA // Generic contract binding to access the raw methods on +} + +// ECDSACallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ECDSACallerRaw struct { + Contract *ECDSACaller // Generic read-only contract binding to access the raw methods on +} + +// ECDSATransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ECDSATransactorRaw struct { + Contract *ECDSATransactor // Generic write-only contract binding to access the raw methods on +} + +// NewECDSA creates a new instance of ECDSA, bound to a specific deployed contract. +func NewECDSA(address common.Address, backend bind.ContractBackend) (*ECDSA, error) { + contract, err := bindECDSA(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ECDSA{ECDSACaller: ECDSACaller{contract: contract}, ECDSATransactor: ECDSATransactor{contract: contract}, ECDSAFilterer: ECDSAFilterer{contract: contract}}, nil +} + +// NewECDSACaller creates a new read-only instance of ECDSA, bound to a specific deployed contract. +func NewECDSACaller(address common.Address, caller bind.ContractCaller) (*ECDSACaller, error) { + contract, err := bindECDSA(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ECDSACaller{contract: contract}, nil +} + +// NewECDSATransactor creates a new write-only instance of ECDSA, bound to a specific deployed contract. +func NewECDSATransactor(address common.Address, transactor bind.ContractTransactor) (*ECDSATransactor, error) { + contract, err := bindECDSA(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ECDSATransactor{contract: contract}, nil +} + +// NewECDSAFilterer creates a new log filterer instance of ECDSA, bound to a specific deployed contract. +func NewECDSAFilterer(address common.Address, filterer bind.ContractFilterer) (*ECDSAFilterer, error) { + contract, err := bindECDSA(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ECDSAFilterer{contract: contract}, nil +} + +// bindECDSA binds a generic wrapper to an already deployed contract. +func bindECDSA(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ECDSAABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ECDSA *ECDSARaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ECDSA.Contract.ECDSACaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ECDSA *ECDSARaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ECDSA.Contract.ECDSATransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ECDSA *ECDSARaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ECDSA.Contract.ECDSATransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ECDSA *ECDSACallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ECDSA.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ECDSA *ECDSATransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ECDSA.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ECDSA *ECDSATransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ECDSA.Contract.contract.Transact(opts, method, params...) +} + +// ERC20ABI is the input ABI used to generate the binding from. +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 = "0x6080604052610e3a806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a08231146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e1461032157610088565b8063095ea7b31461008d57806318160ddd146100f357806323b872dd146101115780633950935114610197575b600080fd5b6100d9600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610399565b604051808215151515815260200191505060405180910390f35b6100fb6103b7565b6040518082815260200191505060405180910390f35b61017d6004803603606081101561012757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103c1565b604051808215151515815260200191505060405180910390f35b6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061049a565b604051808215151515815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061054d565b6040518082815260200191505060405180910390f35b6102a16004803603604081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610595565b604051808215151515815260200191505060405180910390f35b610307600480360360408110156102d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610662565b604051808215151515815260200191505060405180910390f35b6103836004803603604081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610680565b6040518082815260200191505060405180910390f35b60006103ad6103a6610707565b848461070f565b6001905092915050565b6000600254905090565b60006103ce848484610906565b61048f846103da610707565b61048a85604051806060016040528060288152602001610d7060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610440610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b600190509392505050565b60006105436104a7610707565b8461053e85600160006104b8610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b61070f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106586105a2610707565b8461065385604051806060016040528060258152602001610de160259139600160006105cc610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b6001905092915050565b600061067661066f610707565b8484610906565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610795576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610dbd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561081b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610d286022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610d986025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610d056023913960400191505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c2e578082015181840152602081019050610c13565b50505050905090810190601f168015610c5b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582053b4b44d2fad2123e25198aa5ed2b9e7b2ed14bfa733eb6d7d64e1cf403ba57964736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(ERC20ABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC20Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil +} + +// ERC20 is an auto generated Go binding around an Ethereum contract. +type ERC20 struct { + ERC20Caller // Read-only binding to the contract + ERC20Transactor // Write-only binding to the contract + ERC20Filterer // Log filterer for contract events +} + +// ERC20Caller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC20Session struct { + Contract *ERC20 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC20CallerSession struct { + Contract *ERC20Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC20TransactorSession struct { + Contract *ERC20Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20Raw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20Raw struct { + Contract *ERC20 // Generic contract binding to access the raw methods on +} + +// ERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20CallerRaw struct { + Contract *ERC20Caller // Generic read-only contract binding to access the raw methods on +} + +// ERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20TransactorRaw struct { + Contract *ERC20Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC20 creates a new instance of ERC20, bound to a specific deployed contract. +func NewERC20(address common.Address, backend bind.ContractBackend) (*ERC20, error) { + contract, err := bindERC20(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil +} + +// NewERC20Caller creates a new read-only instance of ERC20, bound to a specific deployed contract. +func NewERC20Caller(address common.Address, caller bind.ContractCaller) (*ERC20Caller, error) { + contract, err := bindERC20(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC20Caller{contract: contract}, nil +} + +// NewERC20Transactor creates a new write-only instance of ERC20, bound to a specific deployed contract. +func NewERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC20Transactor, error) { + contract, err := bindERC20(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC20Transactor{contract: contract}, nil +} + +// NewERC20Filterer creates a new log filterer instance of ERC20, bound to a specific deployed contract. +func NewERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC20Filterer, error) { + contract, err := bindERC20(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC20Filterer{contract: contract}, nil +} + +// bindERC20 binds a generic wrapper to an already deployed contract. +func bindERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ERC20ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20 *ERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20.Contract.ERC20Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20 *ERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20.Contract.ERC20Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20 *ERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20.Contract.ERC20Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20 *ERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20 *ERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20 *ERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20 *ERC20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20.contract.Call(opts, out, "allowance", owner, spender) + return *ret0, err +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20 *ERC20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20.Contract.Allowance(&_ERC20.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20 *ERC20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20.Contract.Allowance(&_ERC20.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20 *ERC20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20.contract.Call(opts, out, "balanceOf", account) + return *ret0, err +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20 *ERC20Session) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20 *ERC20CallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, account) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20 *ERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20.contract.Call(opts, out, "totalSupply") + return *ret0, err +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20 *ERC20Session) TotalSupply() (*big.Int, error) { + return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20 *ERC20CallerSession) TotalSupply() (*big.Int, error) { + return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20 *ERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20 *ERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20 *ERC20Transactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20 *ERC20Session) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.DecreaseAllowance(&_ERC20.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20 *ERC20TransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.DecreaseAllowance(&_ERC20.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20 *ERC20Transactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20 *ERC20Session) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.IncreaseAllowance(&_ERC20.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20 *ERC20TransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.IncreaseAllowance(&_ERC20.TransactOpts, spender, addedValue) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20Transactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "transfer", recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20Session) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20TransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20Transactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "transferFrom", sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20Session) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20TransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, sender, recipient, amount) +} + +// ERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20 contract. +type ERC20ApprovalIterator struct { + Event *ERC20Approval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20ApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20Approval represents a Approval event raised by the ERC20 contract. +type ERC20Approval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &ERC20ApprovalIterator{contract: _ERC20.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20 *ERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20Approval) + if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20 *ERC20Filterer) ParseApproval(log types.Log) (*ERC20Approval, error) { + event := new(ERC20Approval) + if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20 contract. +type ERC20TransferIterator struct { + Event *ERC20Transfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20TransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20Transfer represents a Transfer event raised by the ERC20 contract. +type ERC20Transfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20 *ERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20TransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &ERC20TransferIterator{contract: _ERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20 *ERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20Transfer) + if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20 *ERC20Filterer) ParseTransfer(log types.Log) (*ERC20Transfer, error) { + event := new(ERC20Transfer) + if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20MintableABI is the input ABI used to generate the binding from. +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 = "0x608060405262000024620000186200002a60201b60201c565b6200003260201b60201c565b62000257565b600033905090565b6200004d8160036200009360201b620012a81790919060201c565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b620000a582826200017760201b60201c565b1562000119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000200576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180620018506022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6115e980620002676000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146102e7578063986502751461032b578063a457c2d714610335578063a9059cbb1461039b578063aa271e1a14610401578063dd62ed3e1461045d576100b4565b8063095ea7b3146100b957806318160ddd1461011f57806323b872dd1461013d57806339509351146101c357806340c10f191461022957806370a082311461028f575b600080fd5b610105600480360360408110156100cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104d5565b604051808215151515815260200191505060405180910390f35b6101276104f3565b6040518082815260200191505060405180910390f35b6101a96004803603606081101561015357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104fd565b604051808215151515815260200191505060405180910390f35b61020f600480360360408110156101d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105d6565b604051808215151515815260200191505060405180910390f35b6102756004803603604081101561023f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610689565b604051808215151515815260200191505060405180910390f35b6102d1600480360360208110156102a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610704565b6040518082815260200191505060405180910390f35b610329600480360360208110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061074c565b005b6103336107bd565b005b6103816004803603604081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cf565b604051808215151515815260200191505060405180910390f35b6103e7600480360360408110156103b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061089c565b604051808215151515815260200191505060405180910390f35b6104436004803603602081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ba565b604051808215151515815260200191505060405180910390f35b6104bf6004803603604081101561047357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108d7565b6040518082815260200191505060405180910390f35b60006104e96104e261095e565b8484610966565b6001905092915050565b6000600254905090565b600061050a848484610b5d565b6105cb8461051661095e565b6105c6856040518060600160405280602881526020016114fd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061057c61095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b600190509392505050565b600061067f6105e361095e565b8461067a85600160006105f461095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b610966565b6001905092915050565b600061069b61069661095e565b6108ba565b6106f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6106fa8383610f5b565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61075c61075761095e565b6108ba565b6107b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6107ba81611116565b50565b6107cd6107c861095e565b611170565b565b60006108926107dc61095e565b8461088d85604051806060016040528060258152602001611590602591396001600061080661095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b6001905092915050565b60006108b06108a961095e565b8484610b5d565b6001905092915050565b60006108d08260036111ca90919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061156c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806114646022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610be3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806115476025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114416023913960400191505060405180910390fd5b610cd481604051806060016040528060268152602001611486602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d67816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610ec0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e85578082015181840152602081019050610e6a565b50505050905090810190601f168015610eb25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610f51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61101381600254610ed390919063ffffffff16565b60028190555061106a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61112a8160036112a890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b61118481600361138390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806115256022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6112b282826111ca565b15611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61138d82826111ca565b6113e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806114dc6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820d814ae3015d19c38aed909871af148dee0d88a6be96dc04f5c4a57e543a3f83364736f6c634300050d0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(ERC20MintableABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC20MintableBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC20Mintable{ERC20MintableCaller: ERC20MintableCaller{contract: contract}, ERC20MintableTransactor: ERC20MintableTransactor{contract: contract}, ERC20MintableFilterer: ERC20MintableFilterer{contract: contract}}, nil +} + +// ERC20Mintable is an auto generated Go binding around an Ethereum contract. +type ERC20Mintable struct { + ERC20MintableCaller // Read-only binding to the contract + ERC20MintableTransactor // Write-only binding to the contract + ERC20MintableFilterer // Log filterer for contract events +} + +// ERC20MintableCaller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20MintableCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20MintableTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20MintableTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20MintableFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20MintableFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20MintableSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC20MintableSession struct { + Contract *ERC20Mintable // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20MintableCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC20MintableCallerSession struct { + Contract *ERC20MintableCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC20MintableTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC20MintableTransactorSession struct { + Contract *ERC20MintableTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20MintableRaw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20MintableRaw struct { + Contract *ERC20Mintable // Generic contract binding to access the raw methods on +} + +// ERC20MintableCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20MintableCallerRaw struct { + Contract *ERC20MintableCaller // Generic read-only contract binding to access the raw methods on +} + +// ERC20MintableTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20MintableTransactorRaw struct { + Contract *ERC20MintableTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC20Mintable creates a new instance of ERC20Mintable, bound to a specific deployed contract. +func NewERC20Mintable(address common.Address, backend bind.ContractBackend) (*ERC20Mintable, error) { + contract, err := bindERC20Mintable(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC20Mintable{ERC20MintableCaller: ERC20MintableCaller{contract: contract}, ERC20MintableTransactor: ERC20MintableTransactor{contract: contract}, ERC20MintableFilterer: ERC20MintableFilterer{contract: contract}}, nil +} + +// NewERC20MintableCaller creates a new read-only instance of ERC20Mintable, bound to a specific deployed contract. +func NewERC20MintableCaller(address common.Address, caller bind.ContractCaller) (*ERC20MintableCaller, error) { + contract, err := bindERC20Mintable(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC20MintableCaller{contract: contract}, nil +} + +// NewERC20MintableTransactor creates a new write-only instance of ERC20Mintable, bound to a specific deployed contract. +func NewERC20MintableTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20MintableTransactor, error) { + contract, err := bindERC20Mintable(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC20MintableTransactor{contract: contract}, nil +} + +// NewERC20MintableFilterer creates a new log filterer instance of ERC20Mintable, bound to a specific deployed contract. +func NewERC20MintableFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20MintableFilterer, error) { + contract, err := bindERC20Mintable(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC20MintableFilterer{contract: contract}, nil +} + +// bindERC20Mintable binds a generic wrapper to an already deployed contract. +func bindERC20Mintable(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ERC20MintableABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20Mintable *ERC20MintableRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20Mintable.Contract.ERC20MintableCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20Mintable *ERC20MintableRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20Mintable.Contract.ERC20MintableTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20Mintable *ERC20MintableRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20Mintable.Contract.ERC20MintableTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20Mintable *ERC20MintableCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20Mintable.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20Mintable *ERC20MintableTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20Mintable.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20Mintable *ERC20MintableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20Mintable.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20Mintable.contract.Call(opts, out, "allowance", owner, spender) + return *ret0, err +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20Mintable.Contract.Allowance(&_ERC20Mintable.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20Mintable.Contract.Allowance(&_ERC20Mintable.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20Mintable.contract.Call(opts, out, "balanceOf", account) + return *ret0, err +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20Mintable.Contract.BalanceOf(&_ERC20Mintable.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20Mintable.Contract.BalanceOf(&_ERC20Mintable.CallOpts, account) +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_ERC20Mintable *ERC20MintableCaller) IsMinter(opts *bind.CallOpts, account common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _ERC20Mintable.contract.Call(opts, out, "isMinter", account) + return *ret0, err +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_ERC20Mintable *ERC20MintableSession) IsMinter(account common.Address) (bool, error) { + return _ERC20Mintable.Contract.IsMinter(&_ERC20Mintable.CallOpts, account) +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_ERC20Mintable *ERC20MintableCallerSession) IsMinter(account common.Address) (bool, error) { + return _ERC20Mintable.Contract.IsMinter(&_ERC20Mintable.CallOpts, account) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20Mintable.contract.Call(opts, out, "totalSupply") + return *ret0, err +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20Mintable *ERC20MintableSession) TotalSupply() (*big.Int, error) { + return _ERC20Mintable.Contract.TotalSupply(&_ERC20Mintable.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCallerSession) TotalSupply() (*big.Int, error) { + return _ERC20Mintable.Contract.TotalSupply(&_ERC20Mintable.CallOpts) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_ERC20Mintable *ERC20MintableTransactor) AddMinter(opts *bind.TransactOpts, account common.Address) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "addMinter", account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_ERC20Mintable *ERC20MintableSession) AddMinter(account common.Address) (*types.Transaction, error) { + return _ERC20Mintable.Contract.AddMinter(&_ERC20Mintable.TransactOpts, account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_ERC20Mintable *ERC20MintableTransactorSession) AddMinter(account common.Address) (*types.Transaction, error) { + return _ERC20Mintable.Contract.AddMinter(&_ERC20Mintable.TransactOpts, account) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Approve(&_ERC20Mintable.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Approve(&_ERC20Mintable.TransactOpts, spender, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.DecreaseAllowance(&_ERC20Mintable.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.DecreaseAllowance(&_ERC20Mintable.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.IncreaseAllowance(&_ERC20Mintable.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.IncreaseAllowance(&_ERC20Mintable.TransactOpts, spender, addedValue) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "mint", account, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Mint(&_ERC20Mintable.TransactOpts, account, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Mint(&_ERC20Mintable.TransactOpts, account, amount) +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_ERC20Mintable *ERC20MintableTransactor) RenounceMinter(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "renounceMinter") +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_ERC20Mintable *ERC20MintableSession) RenounceMinter() (*types.Transaction, error) { + return _ERC20Mintable.Contract.RenounceMinter(&_ERC20Mintable.TransactOpts) +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_ERC20Mintable *ERC20MintableTransactorSession) RenounceMinter() (*types.Transaction, error) { + return _ERC20Mintable.Contract.RenounceMinter(&_ERC20Mintable.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "transfer", recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Transfer(&_ERC20Mintable.TransactOpts, recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Transfer(&_ERC20Mintable.TransactOpts, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "transferFrom", sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.TransferFrom(&_ERC20Mintable.TransactOpts, sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.TransferFrom(&_ERC20Mintable.TransactOpts, sender, recipient, amount) +} + +// ERC20MintableApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20Mintable contract. +type ERC20MintableApprovalIterator struct { + Event *ERC20MintableApproval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20MintableApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20MintableApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20MintableApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20MintableApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20MintableApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20MintableApproval represents a Approval event raised by the ERC20Mintable contract. +type ERC20MintableApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20MintableApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20Mintable.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &ERC20MintableApprovalIterator{contract: _ERC20Mintable.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20MintableApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20Mintable.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20MintableApproval) + if err := _ERC20Mintable.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) ParseApproval(log types.Log) (*ERC20MintableApproval, error) { + event := new(ERC20MintableApproval) + if err := _ERC20Mintable.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20MintableMinterAddedIterator is returned from FilterMinterAdded and is used to iterate over the raw logs and unpacked data for MinterAdded events raised by the ERC20Mintable contract. +type ERC20MintableMinterAddedIterator struct { + Event *ERC20MintableMinterAdded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20MintableMinterAddedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20MintableMinterAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20MintableMinterAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20MintableMinterAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20MintableMinterAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20MintableMinterAdded represents a MinterAdded event raised by the ERC20Mintable contract. +type ERC20MintableMinterAdded struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMinterAdded is a free log retrieval operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) FilterMinterAdded(opts *bind.FilterOpts, account []common.Address) (*ERC20MintableMinterAddedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _ERC20Mintable.contract.FilterLogs(opts, "MinterAdded", accountRule) + if err != nil { + return nil, err + } + return &ERC20MintableMinterAddedIterator{contract: _ERC20Mintable.contract, event: "MinterAdded", logs: logs, sub: sub}, nil +} + +// WatchMinterAdded is a free log subscription operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) WatchMinterAdded(opts *bind.WatchOpts, sink chan<- *ERC20MintableMinterAdded, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _ERC20Mintable.contract.WatchLogs(opts, "MinterAdded", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20MintableMinterAdded) + if err := _ERC20Mintable.contract.UnpackLog(event, "MinterAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMinterAdded is a log parse operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) ParseMinterAdded(log types.Log) (*ERC20MintableMinterAdded, error) { + event := new(ERC20MintableMinterAdded) + if err := _ERC20Mintable.contract.UnpackLog(event, "MinterAdded", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20MintableMinterRemovedIterator is returned from FilterMinterRemoved and is used to iterate over the raw logs and unpacked data for MinterRemoved events raised by the ERC20Mintable contract. +type ERC20MintableMinterRemovedIterator struct { + Event *ERC20MintableMinterRemoved // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20MintableMinterRemovedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20MintableMinterRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20MintableMinterRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20MintableMinterRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20MintableMinterRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20MintableMinterRemoved represents a MinterRemoved event raised by the ERC20Mintable contract. +type ERC20MintableMinterRemoved struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMinterRemoved is a free log retrieval operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) FilterMinterRemoved(opts *bind.FilterOpts, account []common.Address) (*ERC20MintableMinterRemovedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _ERC20Mintable.contract.FilterLogs(opts, "MinterRemoved", accountRule) + if err != nil { + return nil, err + } + return &ERC20MintableMinterRemovedIterator{contract: _ERC20Mintable.contract, event: "MinterRemoved", logs: logs, sub: sub}, nil +} + +// WatchMinterRemoved is a free log subscription operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) WatchMinterRemoved(opts *bind.WatchOpts, sink chan<- *ERC20MintableMinterRemoved, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _ERC20Mintable.contract.WatchLogs(opts, "MinterRemoved", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20MintableMinterRemoved) + if err := _ERC20Mintable.contract.UnpackLog(event, "MinterRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMinterRemoved is a log parse operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) ParseMinterRemoved(log types.Log) (*ERC20MintableMinterRemoved, error) { + event := new(ERC20MintableMinterRemoved) + if err := _ERC20Mintable.contract.UnpackLog(event, "MinterRemoved", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20MintableTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20Mintable contract. +type ERC20MintableTransferIterator struct { + Event *ERC20MintableTransfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20MintableTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20MintableTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20MintableTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20MintableTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20MintableTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20MintableTransfer represents a Transfer event raised by the ERC20Mintable contract. +type ERC20MintableTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20MintableTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20Mintable.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &ERC20MintableTransferIterator{contract: _ERC20Mintable.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20MintableTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20Mintable.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20MintableTransfer) + if err := _ERC20Mintable.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) ParseTransfer(log types.Log) (*ERC20MintableTransfer, error) { + event := new(ERC20MintableTransfer) + if err := _ERC20Mintable.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + return event, nil +} + +// 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\"}]" + +// ERC20SimpleSwapBin is the compiled bytecode used for deploying new contracts. +var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b506040516122eb3803806122eb8339818101604052606081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806000819055505050506121f8806100f36000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(ERC20SimpleSwapABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC20SimpleSwapBin), backend, _issuer, _token, _defaultHardDepositTimeout) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC20SimpleSwap{ERC20SimpleSwapCaller: ERC20SimpleSwapCaller{contract: contract}, ERC20SimpleSwapTransactor: ERC20SimpleSwapTransactor{contract: contract}, ERC20SimpleSwapFilterer: ERC20SimpleSwapFilterer{contract: contract}}, nil +} + +// ERC20SimpleSwap is an auto generated Go binding around an Ethereum contract. +type ERC20SimpleSwap struct { + ERC20SimpleSwapCaller // Read-only binding to the contract + ERC20SimpleSwapTransactor // Write-only binding to the contract + ERC20SimpleSwapFilterer // Log filterer for contract events +} + +// ERC20SimpleSwapCaller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20SimpleSwapCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20SimpleSwapTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20SimpleSwapTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20SimpleSwapFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20SimpleSwapFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20SimpleSwapSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC20SimpleSwapSession struct { + Contract *ERC20SimpleSwap // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20SimpleSwapCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC20SimpleSwapCallerSession struct { + Contract *ERC20SimpleSwapCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC20SimpleSwapTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC20SimpleSwapTransactorSession struct { + Contract *ERC20SimpleSwapTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20SimpleSwapRaw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20SimpleSwapRaw struct { + Contract *ERC20SimpleSwap // Generic contract binding to access the raw methods on +} + +// ERC20SimpleSwapCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20SimpleSwapCallerRaw struct { + Contract *ERC20SimpleSwapCaller // Generic read-only contract binding to access the raw methods on +} + +// ERC20SimpleSwapTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20SimpleSwapTransactorRaw struct { + Contract *ERC20SimpleSwapTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC20SimpleSwap creates a new instance of ERC20SimpleSwap, bound to a specific deployed contract. +func NewERC20SimpleSwap(address common.Address, backend bind.ContractBackend) (*ERC20SimpleSwap, error) { + contract, err := bindERC20SimpleSwap(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC20SimpleSwap{ERC20SimpleSwapCaller: ERC20SimpleSwapCaller{contract: contract}, ERC20SimpleSwapTransactor: ERC20SimpleSwapTransactor{contract: contract}, ERC20SimpleSwapFilterer: ERC20SimpleSwapFilterer{contract: contract}}, nil +} + +// NewERC20SimpleSwapCaller creates a new read-only instance of ERC20SimpleSwap, bound to a specific deployed contract. +func NewERC20SimpleSwapCaller(address common.Address, caller bind.ContractCaller) (*ERC20SimpleSwapCaller, error) { + contract, err := bindERC20SimpleSwap(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapCaller{contract: contract}, nil +} + +// NewERC20SimpleSwapTransactor creates a new write-only instance of ERC20SimpleSwap, bound to a specific deployed contract. +func NewERC20SimpleSwapTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20SimpleSwapTransactor, error) { + contract, err := bindERC20SimpleSwap(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapTransactor{contract: contract}, nil +} + +// NewERC20SimpleSwapFilterer creates a new log filterer instance of ERC20SimpleSwap, bound to a specific deployed contract. +func NewERC20SimpleSwapFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20SimpleSwapFilterer, error) { + contract, err := bindERC20SimpleSwap(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapFilterer{contract: contract}, nil +} + +// bindERC20SimpleSwap binds a generic wrapper to an already deployed contract. +func bindERC20SimpleSwap(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ERC20SimpleSwapABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20SimpleSwap *ERC20SimpleSwapRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20SimpleSwap.Contract.ERC20SimpleSwapCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20SimpleSwap *ERC20SimpleSwapRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.ERC20SimpleSwapTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20SimpleSwap *ERC20SimpleSwapRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.ERC20SimpleSwapTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20SimpleSwap.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.contract.Transact(opts, method, params...) +} + +// Balance is a free data retrieval call binding the contract method 0xb69ef8a8. +// +// Solidity: function balance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Balance(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "balance") + return *ret0, err +} + +// Balance is a free data retrieval call binding the contract method 0xb69ef8a8. +// +// Solidity: function balance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Balance() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.Balance(&_ERC20SimpleSwap.CallOpts) +} + +// Balance is a free data retrieval call binding the contract method 0xb69ef8a8. +// +// Solidity: function balance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Balance() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.Balance(&_ERC20SimpleSwap.CallOpts) +} + +// DefaultHardDepositTimeout is a free data retrieval call binding the contract method 0x12101021. +// +// Solidity: function defaultHardDepositTimeout() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) DefaultHardDepositTimeout(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "defaultHardDepositTimeout") + return *ret0, err +} + +// DefaultHardDepositTimeout is a free data retrieval call binding the contract method 0x12101021. +// +// Solidity: function defaultHardDepositTimeout() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) DefaultHardDepositTimeout() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.DefaultHardDepositTimeout(&_ERC20SimpleSwap.CallOpts) +} + +// DefaultHardDepositTimeout is a free data retrieval call binding the contract method 0x12101021. +// +// Solidity: function defaultHardDepositTimeout() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) DefaultHardDepositTimeout() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.DefaultHardDepositTimeout(&_ERC20SimpleSwap.CallOpts) +} + +// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. +// +// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 timeout, uint256 canBeDecreasedAt) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) HardDeposits(opts *bind.CallOpts, arg0 common.Address) (struct { + Amount *big.Int + DecreaseAmount *big.Int + Timeout *big.Int + CanBeDecreasedAt *big.Int +}, error) { + ret := new(struct { + Amount *big.Int + DecreaseAmount *big.Int + Timeout *big.Int + CanBeDecreasedAt *big.Int + }) + out := ret + err := _ERC20SimpleSwap.contract.Call(opts, out, "hardDeposits", arg0) + return *ret, err +} + +// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. +// +// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 timeout, uint256 canBeDecreasedAt) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) HardDeposits(arg0 common.Address) (struct { + Amount *big.Int + DecreaseAmount *big.Int + Timeout *big.Int + CanBeDecreasedAt *big.Int +}, error) { + return _ERC20SimpleSwap.Contract.HardDeposits(&_ERC20SimpleSwap.CallOpts, arg0) +} + +// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. +// +// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 timeout, uint256 canBeDecreasedAt) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) HardDeposits(arg0 common.Address) (struct { + Amount *big.Int + DecreaseAmount *big.Int + Timeout *big.Int + CanBeDecreasedAt *big.Int +}, error) { + return _ERC20SimpleSwap.Contract.HardDeposits(&_ERC20SimpleSwap.CallOpts, arg0) +} + +// Issuer is a free data retrieval call binding the contract method 0x1d143848. +// +// Solidity: function issuer() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Issuer(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "issuer") + return *ret0, err +} + +// Issuer is a free data retrieval call binding the contract method 0x1d143848. +// +// Solidity: function issuer() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Issuer() (common.Address, error) { + return _ERC20SimpleSwap.Contract.Issuer(&_ERC20SimpleSwap.CallOpts) +} + +// Issuer is a free data retrieval call binding the contract method 0x1d143848. +// +// Solidity: function issuer() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Issuer() (common.Address, error) { + return _ERC20SimpleSwap.Contract.Issuer(&_ERC20SimpleSwap.CallOpts) +} + +// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. +// +// Solidity: function liquidBalance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) LiquidBalance(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "liquidBalance") + return *ret0, err +} + +// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. +// +// Solidity: function liquidBalance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) LiquidBalance() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.LiquidBalance(&_ERC20SimpleSwap.CallOpts) +} + +// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. +// +// Solidity: function liquidBalance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) LiquidBalance() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.LiquidBalance(&_ERC20SimpleSwap.CallOpts) +} + +// LiquidBalanceFor is a free data retrieval call binding the contract method 0xc76a4d31. +// +// Solidity: function liquidBalanceFor(address beneficiary) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) LiquidBalanceFor(opts *bind.CallOpts, beneficiary common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "liquidBalanceFor", beneficiary) + return *ret0, err +} + +// LiquidBalanceFor is a free data retrieval call binding the contract method 0xc76a4d31. +// +// Solidity: function liquidBalanceFor(address beneficiary) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) LiquidBalanceFor(beneficiary common.Address) (*big.Int, error) { + return _ERC20SimpleSwap.Contract.LiquidBalanceFor(&_ERC20SimpleSwap.CallOpts, beneficiary) +} + +// LiquidBalanceFor is a free data retrieval call binding the contract method 0xc76a4d31. +// +// Solidity: function liquidBalanceFor(address beneficiary) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) LiquidBalanceFor(beneficiary common.Address) (*big.Int, error) { + return _ERC20SimpleSwap.Contract.LiquidBalanceFor(&_ERC20SimpleSwap.CallOpts, beneficiary) +} + +// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. +// +// Solidity: function paidOut(address ) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) PaidOut(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "paidOut", arg0) + return *ret0, err +} + +// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. +// +// Solidity: function paidOut(address ) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) PaidOut(arg0 common.Address) (*big.Int, error) { + return _ERC20SimpleSwap.Contract.PaidOut(&_ERC20SimpleSwap.CallOpts, arg0) +} + +// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. +// +// Solidity: function paidOut(address ) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) PaidOut(arg0 common.Address) (*big.Int, error) { + return _ERC20SimpleSwap.Contract.PaidOut(&_ERC20SimpleSwap.CallOpts, arg0) +} + +// Token is a free data retrieval call binding the contract method 0xfc0c546a. +// +// Solidity: function token() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Token(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "token") + return *ret0, err +} + +// Token is a free data retrieval call binding the contract method 0xfc0c546a. +// +// Solidity: function token() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Token() (common.Address, error) { + return _ERC20SimpleSwap.Contract.Token(&_ERC20SimpleSwap.CallOpts) +} + +// Token is a free data retrieval call binding the contract method 0xfc0c546a. +// +// Solidity: function token() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Token() (common.Address, error) { + return _ERC20SimpleSwap.Contract.Token(&_ERC20SimpleSwap.CallOpts) +} + +// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. +// +// Solidity: function totalHardDeposit() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) TotalHardDeposit(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "totalHardDeposit") + return *ret0, err +} + +// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. +// +// Solidity: function totalHardDeposit() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) TotalHardDeposit() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.TotalHardDeposit(&_ERC20SimpleSwap.CallOpts) +} + +// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. +// +// Solidity: function totalHardDeposit() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) TotalHardDeposit() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.TotalHardDeposit(&_ERC20SimpleSwap.CallOpts) +} + +// TotalPaidOut is a free data retrieval call binding the contract method 0x1357e1dc. +// +// Solidity: function totalPaidOut() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) TotalPaidOut(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "totalPaidOut") + return *ret0, err +} + +// TotalPaidOut is a free data retrieval call binding the contract method 0x1357e1dc. +// +// Solidity: function totalPaidOut() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) TotalPaidOut() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.TotalPaidOut(&_ERC20SimpleSwap.CallOpts) +} + +// TotalPaidOut is a free data retrieval call binding the contract method 0x1357e1dc. +// +// Solidity: function totalPaidOut() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) TotalPaidOut() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.TotalPaidOut(&_ERC20SimpleSwap.CallOpts) +} + +// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. +// +// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) CashCheque(opts *bind.TransactOpts, beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "cashCheque", beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) +} + +// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. +// +// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) CashCheque(beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.CashCheque(&_ERC20SimpleSwap.TransactOpts, beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) +} + +// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. +// +// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) CashCheque(beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.CashCheque(&_ERC20SimpleSwap.TransactOpts, beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) +} + +// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. +// +// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) CashChequeBeneficiary(opts *bind.TransactOpts, recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "cashChequeBeneficiary", recipient, cumulativePayout, issuerSig) +} + +// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. +// +// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) CashChequeBeneficiary(recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.CashChequeBeneficiary(&_ERC20SimpleSwap.TransactOpts, recipient, cumulativePayout, issuerSig) +} + +// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. +// +// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) CashChequeBeneficiary(recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.CashChequeBeneficiary(&_ERC20SimpleSwap.TransactOpts, recipient, cumulativePayout, issuerSig) +} + +// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. +// +// Solidity: function decreaseHardDeposit(address beneficiary) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) DecreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "decreaseHardDeposit", beneficiary) +} + +// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. +// +// Solidity: function decreaseHardDeposit(address beneficiary) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) DecreaseHardDeposit(beneficiary common.Address) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.DecreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary) +} + +// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. +// +// Solidity: function decreaseHardDeposit(address beneficiary) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) DecreaseHardDeposit(beneficiary common.Address) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.DecreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary) +} + +// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. +// +// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) IncreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "increaseHardDeposit", beneficiary, amount) +} + +// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. +// +// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) IncreaseHardDeposit(beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.IncreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary, amount) +} + +// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. +// +// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) IncreaseHardDeposit(beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.IncreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary, amount) +} + +// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. +// +// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) PrepareDecreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "prepareDecreaseHardDeposit", beneficiary, decreaseAmount) +} + +// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. +// +// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) PrepareDecreaseHardDeposit(beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.PrepareDecreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary, decreaseAmount) +} + +// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. +// +// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) PrepareDecreaseHardDeposit(beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.PrepareDecreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary, decreaseAmount) +} + +// SetCustomHardDepositTimeout is a paid mutator transaction binding the contract method 0xd4c9a8e8. +// +// Solidity: function setCustomHardDepositTimeout(address beneficiary, uint256 hardDepositTimeout, bytes beneficiarySig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) SetCustomHardDepositTimeout(opts *bind.TransactOpts, beneficiary common.Address, hardDepositTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "setCustomHardDepositTimeout", beneficiary, hardDepositTimeout, beneficiarySig) +} + +// SetCustomHardDepositTimeout is a paid mutator transaction binding the contract method 0xd4c9a8e8. +// +// Solidity: function setCustomHardDepositTimeout(address beneficiary, uint256 hardDepositTimeout, bytes beneficiarySig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) SetCustomHardDepositTimeout(beneficiary common.Address, hardDepositTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.SetCustomHardDepositTimeout(&_ERC20SimpleSwap.TransactOpts, beneficiary, hardDepositTimeout, beneficiarySig) +} + +// SetCustomHardDepositTimeout is a paid mutator transaction binding the contract method 0xd4c9a8e8. +// +// Solidity: function setCustomHardDepositTimeout(address beneficiary, uint256 hardDepositTimeout, bytes beneficiarySig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) SetCustomHardDepositTimeout(beneficiary common.Address, hardDepositTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.SetCustomHardDepositTimeout(&_ERC20SimpleSwap.TransactOpts, beneficiary, hardDepositTimeout, beneficiarySig) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) Withdraw(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "withdraw", amount) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Withdraw(amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.Withdraw(&_ERC20SimpleSwap.TransactOpts, amount) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) Withdraw(amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.Withdraw(&_ERC20SimpleSwap.TransactOpts, amount) +} + +// ERC20SimpleSwapChequeBouncedIterator is returned from FilterChequeBounced and is used to iterate over the raw logs and unpacked data for ChequeBounced events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapChequeBouncedIterator struct { + Event *ERC20SimpleSwapChequeBounced // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapChequeBouncedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapChequeBounced) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapChequeBounced) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapChequeBouncedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapChequeBouncedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapChequeBounced represents a ChequeBounced event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapChequeBounced struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChequeBounced is a free log retrieval operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. +// +// Solidity: event ChequeBounced() +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterChequeBounced(opts *bind.FilterOpts) (*ERC20SimpleSwapChequeBouncedIterator, error) { + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "ChequeBounced") + if err != nil { + return nil, err + } + return &ERC20SimpleSwapChequeBouncedIterator{contract: _ERC20SimpleSwap.contract, event: "ChequeBounced", logs: logs, sub: sub}, nil +} + +// WatchChequeBounced is a free log subscription operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. +// +// Solidity: event ChequeBounced() +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchChequeBounced(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapChequeBounced) (event.Subscription, error) { + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "ChequeBounced") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapChequeBounced) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "ChequeBounced", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChequeBounced is a log parse operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. +// +// Solidity: event ChequeBounced() +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseChequeBounced(log types.Log) (*ERC20SimpleSwapChequeBounced, error) { + event := new(ERC20SimpleSwapChequeBounced) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "ChequeBounced", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapChequeCashedIterator is returned from FilterChequeCashed and is used to iterate over the raw logs and unpacked data for ChequeCashed events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapChequeCashedIterator struct { + Event *ERC20SimpleSwapChequeCashed // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapChequeCashedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapChequeCashed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapChequeCashed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapChequeCashedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapChequeCashedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapChequeCashed represents a ChequeCashed event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapChequeCashed struct { + Beneficiary common.Address + Recipient common.Address + Caller common.Address + TotalPayout *big.Int + CumulativePayout *big.Int + CallerPayout *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChequeCashed is a free log retrieval operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. +// +// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterChequeCashed(opts *bind.FilterOpts, beneficiary []common.Address, recipient []common.Address, caller []common.Address) (*ERC20SimpleSwapChequeCashedIterator, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + var callerRule []interface{} + for _, callerItem := range caller { + callerRule = append(callerRule, callerItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "ChequeCashed", beneficiaryRule, recipientRule, callerRule) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapChequeCashedIterator{contract: _ERC20SimpleSwap.contract, event: "ChequeCashed", logs: logs, sub: sub}, nil +} + +// WatchChequeCashed is a free log subscription operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. +// +// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchChequeCashed(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapChequeCashed, beneficiary []common.Address, recipient []common.Address, caller []common.Address) (event.Subscription, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + var callerRule []interface{} + for _, callerItem := range caller { + callerRule = append(callerRule, callerItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "ChequeCashed", beneficiaryRule, recipientRule, callerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapChequeCashed) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "ChequeCashed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChequeCashed is a log parse operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. +// +// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseChequeCashed(log types.Log) (*ERC20SimpleSwapChequeCashed, error) { + event := new(ERC20SimpleSwapChequeCashed) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "ChequeCashed", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapHardDepositAmountChangedIterator is returned from FilterHardDepositAmountChanged and is used to iterate over the raw logs and unpacked data for HardDepositAmountChanged events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositAmountChangedIterator struct { + Event *ERC20SimpleSwapHardDepositAmountChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapHardDepositAmountChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositAmountChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositAmountChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapHardDepositAmountChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapHardDepositAmountChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapHardDepositAmountChanged represents a HardDepositAmountChanged event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositAmountChanged struct { + Beneficiary common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterHardDepositAmountChanged is a free log retrieval operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. +// +// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterHardDepositAmountChanged(opts *bind.FilterOpts, beneficiary []common.Address) (*ERC20SimpleSwapHardDepositAmountChangedIterator, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "HardDepositAmountChanged", beneficiaryRule) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapHardDepositAmountChangedIterator{contract: _ERC20SimpleSwap.contract, event: "HardDepositAmountChanged", logs: logs, sub: sub}, nil +} + +// WatchHardDepositAmountChanged is a free log subscription operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. +// +// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchHardDepositAmountChanged(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapHardDepositAmountChanged, beneficiary []common.Address) (event.Subscription, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "HardDepositAmountChanged", beneficiaryRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapHardDepositAmountChanged) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositAmountChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseHardDepositAmountChanged is a log parse operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. +// +// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseHardDepositAmountChanged(log types.Log) (*ERC20SimpleSwapHardDepositAmountChanged, error) { + event := new(ERC20SimpleSwapHardDepositAmountChanged) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositAmountChanged", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapHardDepositDecreasePreparedIterator is returned from FilterHardDepositDecreasePrepared and is used to iterate over the raw logs and unpacked data for HardDepositDecreasePrepared events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositDecreasePreparedIterator struct { + Event *ERC20SimpleSwapHardDepositDecreasePrepared // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapHardDepositDecreasePreparedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositDecreasePrepared) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositDecreasePrepared) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapHardDepositDecreasePreparedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapHardDepositDecreasePreparedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapHardDepositDecreasePrepared represents a HardDepositDecreasePrepared event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositDecreasePrepared struct { + Beneficiary common.Address + DecreaseAmount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterHardDepositDecreasePrepared is a free log retrieval operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. +// +// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterHardDepositDecreasePrepared(opts *bind.FilterOpts, beneficiary []common.Address) (*ERC20SimpleSwapHardDepositDecreasePreparedIterator, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "HardDepositDecreasePrepared", beneficiaryRule) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapHardDepositDecreasePreparedIterator{contract: _ERC20SimpleSwap.contract, event: "HardDepositDecreasePrepared", logs: logs, sub: sub}, nil +} + +// WatchHardDepositDecreasePrepared is a free log subscription operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. +// +// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchHardDepositDecreasePrepared(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapHardDepositDecreasePrepared, beneficiary []common.Address) (event.Subscription, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "HardDepositDecreasePrepared", beneficiaryRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapHardDepositDecreasePrepared) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositDecreasePrepared", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseHardDepositDecreasePrepared is a log parse operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. +// +// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseHardDepositDecreasePrepared(log types.Log) (*ERC20SimpleSwapHardDepositDecreasePrepared, error) { + event := new(ERC20SimpleSwapHardDepositDecreasePrepared) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositDecreasePrepared", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapHardDepositTimeoutChangedIterator is returned from FilterHardDepositTimeoutChanged and is used to iterate over the raw logs and unpacked data for HardDepositTimeoutChanged events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositTimeoutChangedIterator struct { + Event *ERC20SimpleSwapHardDepositTimeoutChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapHardDepositTimeoutChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositTimeoutChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositTimeoutChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapHardDepositTimeoutChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapHardDepositTimeoutChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapHardDepositTimeoutChanged represents a HardDepositTimeoutChanged event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositTimeoutChanged struct { + Beneficiary common.Address + Timeout *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterHardDepositTimeoutChanged is a free log retrieval operation binding the contract event 0x7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0. +// +// Solidity: event HardDepositTimeoutChanged(address indexed beneficiary, uint256 timeout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterHardDepositTimeoutChanged(opts *bind.FilterOpts, beneficiary []common.Address) (*ERC20SimpleSwapHardDepositTimeoutChangedIterator, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "HardDepositTimeoutChanged", beneficiaryRule) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapHardDepositTimeoutChangedIterator{contract: _ERC20SimpleSwap.contract, event: "HardDepositTimeoutChanged", logs: logs, sub: sub}, nil +} + +// WatchHardDepositTimeoutChanged is a free log subscription operation binding the contract event 0x7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0. +// +// Solidity: event HardDepositTimeoutChanged(address indexed beneficiary, uint256 timeout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchHardDepositTimeoutChanged(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapHardDepositTimeoutChanged, beneficiary []common.Address) (event.Subscription, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "HardDepositTimeoutChanged", beneficiaryRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapHardDepositTimeoutChanged) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositTimeoutChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseHardDepositTimeoutChanged is a log parse operation binding the contract event 0x7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0. +// +// Solidity: event HardDepositTimeoutChanged(address indexed beneficiary, uint256 timeout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseHardDepositTimeoutChanged(log types.Log) (*ERC20SimpleSwapHardDepositTimeoutChanged, error) { + event := new(ERC20SimpleSwapHardDepositTimeoutChanged) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositTimeoutChanged", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapWithdrawIterator is returned from FilterWithdraw and is used to iterate over the raw logs and unpacked data for Withdraw events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapWithdrawIterator struct { + Event *ERC20SimpleSwapWithdraw // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapWithdrawIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapWithdraw) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapWithdraw) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapWithdrawIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapWithdrawIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapWithdraw represents a Withdraw event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapWithdraw struct { + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdraw is a free log retrieval operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. +// +// Solidity: event Withdraw(uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterWithdraw(opts *bind.FilterOpts) (*ERC20SimpleSwapWithdrawIterator, error) { + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "Withdraw") + if err != nil { + return nil, err + } + return &ERC20SimpleSwapWithdrawIterator{contract: _ERC20SimpleSwap.contract, event: "Withdraw", logs: logs, sub: sub}, nil +} + +// WatchWithdraw is a free log subscription operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. +// +// Solidity: event Withdraw(uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapWithdraw) (event.Subscription, error) { + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "Withdraw") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapWithdraw) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "Withdraw", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdraw is a log parse operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. +// +// Solidity: event Withdraw(uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseWithdraw(log types.Log) (*ERC20SimpleSwapWithdraw, error) { + event := new(ERC20SimpleSwapWithdraw) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "Withdraw", log); err != nil { + return nil, err + } + return event, nil +} + +// IERC20ABI is the input ABI used to generate the binding from. +const IERC20ABI = "[{\"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\":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\"}]" + +// IERC20 is an auto generated Go binding around an Ethereum contract. +type IERC20 struct { + IERC20Caller // Read-only binding to the contract + IERC20Transactor // Write-only binding to the contract + IERC20Filterer // Log filterer for contract events +} + +// IERC20Caller is an auto generated read-only Go binding around an Ethereum contract. +type IERC20Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. +type IERC20Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IERC20Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IERC20Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IERC20Session struct { + Contract *IERC20 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IERC20CallerSession struct { + Contract *IERC20Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IERC20TransactorSession struct { + Contract *IERC20Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IERC20Raw is an auto generated low-level Go binding around an Ethereum contract. +type IERC20Raw struct { + Contract *IERC20 // Generic contract binding to access the raw methods on +} + +// IERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IERC20CallerRaw struct { + Contract *IERC20Caller // Generic read-only contract binding to access the raw methods on +} + +// IERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IERC20TransactorRaw struct { + Contract *IERC20Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewIERC20 creates a new instance of IERC20, bound to a specific deployed contract. +func NewIERC20(address common.Address, backend bind.ContractBackend) (*IERC20, error) { + contract, err := bindIERC20(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IERC20{IERC20Caller: IERC20Caller{contract: contract}, IERC20Transactor: IERC20Transactor{contract: contract}, IERC20Filterer: IERC20Filterer{contract: contract}}, nil +} + +// NewIERC20Caller creates a new read-only instance of IERC20, bound to a specific deployed contract. +func NewIERC20Caller(address common.Address, caller bind.ContractCaller) (*IERC20Caller, error) { + contract, err := bindIERC20(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IERC20Caller{contract: contract}, nil +} + +// NewIERC20Transactor creates a new write-only instance of IERC20, bound to a specific deployed contract. +func NewIERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*IERC20Transactor, error) { + contract, err := bindIERC20(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IERC20Transactor{contract: contract}, nil +} + +// NewIERC20Filterer creates a new log filterer instance of IERC20, bound to a specific deployed contract. +func NewIERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*IERC20Filterer, error) { + contract, err := bindIERC20(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IERC20Filterer{contract: contract}, nil +} + +// bindIERC20 binds a generic wrapper to an already deployed contract. +func bindIERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(IERC20ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IERC20 *IERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _IERC20.Contract.IERC20Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IERC20 *IERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IERC20.Contract.IERC20Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IERC20 *IERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IERC20.Contract.IERC20Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IERC20 *IERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _IERC20.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IERC20 *IERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IERC20.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IERC20 *IERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IERC20.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_IERC20 *IERC20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _IERC20.contract.Call(opts, out, "allowance", owner, spender) + return *ret0, err +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_IERC20 *IERC20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _IERC20.Contract.Allowance(&_IERC20.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_IERC20 *IERC20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _IERC20.Contract.Allowance(&_IERC20.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_IERC20 *IERC20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _IERC20.contract.Call(opts, out, "balanceOf", account) + return *ret0, err +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_IERC20 *IERC20Session) BalanceOf(account common.Address) (*big.Int, error) { + return _IERC20.Contract.BalanceOf(&_IERC20.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_IERC20 *IERC20CallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _IERC20.Contract.BalanceOf(&_IERC20.CallOpts, account) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_IERC20 *IERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _IERC20.contract.Call(opts, out, "totalSupply") + return *ret0, err +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_IERC20 *IERC20Session) TotalSupply() (*big.Int, error) { + return _IERC20.Contract.TotalSupply(&_IERC20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_IERC20 *IERC20CallerSession) TotalSupply() (*big.Int, error) { + return _IERC20.Contract.TotalSupply(&_IERC20.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_IERC20 *IERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_IERC20 *IERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_IERC20 *IERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20Transactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.contract.Transact(opts, "transfer", recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20Session) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.Transfer(&_IERC20.TransactOpts, recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20TransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.Transfer(&_IERC20.TransactOpts, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20Transactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.contract.Transact(opts, "transferFrom", sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20Session) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.TransferFrom(&_IERC20.TransactOpts, sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20TransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.TransferFrom(&_IERC20.TransactOpts, sender, recipient, amount) +} + +// IERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the IERC20 contract. +type IERC20ApprovalIterator struct { + Event *IERC20Approval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IERC20ApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IERC20ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IERC20ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IERC20Approval represents a Approval event raised by the IERC20 contract. +type IERC20Approval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_IERC20 *IERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*IERC20ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _IERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &IERC20ApprovalIterator{contract: _IERC20.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_IERC20 *IERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *IERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _IERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IERC20Approval) + if err := _IERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_IERC20 *IERC20Filterer) ParseApproval(log types.Log) (*IERC20Approval, error) { + event := new(IERC20Approval) + if err := _IERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + return event, nil +} + +// IERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the IERC20 contract. +type IERC20TransferIterator struct { + Event *IERC20Transfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IERC20TransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IERC20TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IERC20TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IERC20Transfer represents a Transfer event raised by the IERC20 contract. +type IERC20Transfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_IERC20 *IERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*IERC20TransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _IERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &IERC20TransferIterator{contract: _IERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_IERC20 *IERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *IERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _IERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IERC20Transfer) + if err := _IERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_IERC20 *IERC20Filterer) ParseTransfer(log types.Log) (*IERC20Transfer, error) { + event := new(IERC20Transfer) + if err := _IERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + return event, nil +} + +// MathABI is the input ABI used to generate the binding from. +const MathABI = "[]" + +// MathBin is the compiled bytecode used for deploying new contracts. +var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582000a7fe8f11c52b79f03af2d1ee3eb200d3fd399e2d019af8439d5bba62f64c0964736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(MathABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MathBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Math{MathCaller: MathCaller{contract: contract}, MathTransactor: MathTransactor{contract: contract}, MathFilterer: MathFilterer{contract: contract}}, nil +} + +// Math is an auto generated Go binding around an Ethereum contract. +type Math struct { + MathCaller // Read-only binding to the contract + MathTransactor // Write-only binding to the contract + MathFilterer // Log filterer for contract events +} + +// MathCaller is an auto generated read-only Go binding around an Ethereum contract. +type MathCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MathTransactor is an auto generated write-only Go binding around an Ethereum contract. +type MathTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MathFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MathFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MathSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MathSession struct { + Contract *Math // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MathCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MathCallerSession struct { + Contract *MathCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MathTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MathTransactorSession struct { + Contract *MathTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MathRaw is an auto generated low-level Go binding around an Ethereum contract. +type MathRaw struct { + Contract *Math // Generic contract binding to access the raw methods on +} + +// MathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MathCallerRaw struct { + Contract *MathCaller // Generic read-only contract binding to access the raw methods on +} + +// MathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MathTransactorRaw struct { + Contract *MathTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewMath creates a new instance of Math, bound to a specific deployed contract. +func NewMath(address common.Address, backend bind.ContractBackend) (*Math, error) { + contract, err := bindMath(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Math{MathCaller: MathCaller{contract: contract}, MathTransactor: MathTransactor{contract: contract}, MathFilterer: MathFilterer{contract: contract}}, nil +} + +// NewMathCaller creates a new read-only instance of Math, bound to a specific deployed contract. +func NewMathCaller(address common.Address, caller bind.ContractCaller) (*MathCaller, error) { + contract, err := bindMath(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MathCaller{contract: contract}, nil +} + +// NewMathTransactor creates a new write-only instance of Math, bound to a specific deployed contract. +func NewMathTransactor(address common.Address, transactor bind.ContractTransactor) (*MathTransactor, error) { + contract, err := bindMath(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MathTransactor{contract: contract}, nil +} + +// NewMathFilterer creates a new log filterer instance of Math, bound to a specific deployed contract. +func NewMathFilterer(address common.Address, filterer bind.ContractFilterer) (*MathFilterer, error) { + contract, err := bindMath(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MathFilterer{contract: contract}, nil +} + +// bindMath binds a generic wrapper to an already deployed contract. +func bindMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(MathABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Math *MathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Math.Contract.MathCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Math *MathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Math.Contract.MathTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Math *MathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Math.Contract.MathTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Math *MathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Math.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Math *MathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Math.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Math *MathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Math.Contract.contract.Transact(opts, method, params...) +} + +// MinterRoleABI is the input ABI used to generate the binding from. +const MinterRoleABI = "[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addMinter\",\"outputs\":[],\"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\":[],\"name\":\"renounceMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + +// MinterRole is an auto generated Go binding around an Ethereum contract. +type MinterRole struct { + MinterRoleCaller // Read-only binding to the contract + MinterRoleTransactor // Write-only binding to the contract + MinterRoleFilterer // Log filterer for contract events +} + +// MinterRoleCaller is an auto generated read-only Go binding around an Ethereum contract. +type MinterRoleCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MinterRoleTransactor is an auto generated write-only Go binding around an Ethereum contract. +type MinterRoleTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MinterRoleFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MinterRoleFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MinterRoleSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MinterRoleSession struct { + Contract *MinterRole // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MinterRoleCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MinterRoleCallerSession struct { + Contract *MinterRoleCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MinterRoleTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MinterRoleTransactorSession struct { + Contract *MinterRoleTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MinterRoleRaw is an auto generated low-level Go binding around an Ethereum contract. +type MinterRoleRaw struct { + Contract *MinterRole // Generic contract binding to access the raw methods on +} + +// MinterRoleCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MinterRoleCallerRaw struct { + Contract *MinterRoleCaller // Generic read-only contract binding to access the raw methods on +} + +// MinterRoleTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MinterRoleTransactorRaw struct { + Contract *MinterRoleTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewMinterRole creates a new instance of MinterRole, bound to a specific deployed contract. +func NewMinterRole(address common.Address, backend bind.ContractBackend) (*MinterRole, error) { + contract, err := bindMinterRole(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MinterRole{MinterRoleCaller: MinterRoleCaller{contract: contract}, MinterRoleTransactor: MinterRoleTransactor{contract: contract}, MinterRoleFilterer: MinterRoleFilterer{contract: contract}}, nil +} + +// NewMinterRoleCaller creates a new read-only instance of MinterRole, bound to a specific deployed contract. +func NewMinterRoleCaller(address common.Address, caller bind.ContractCaller) (*MinterRoleCaller, error) { + contract, err := bindMinterRole(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MinterRoleCaller{contract: contract}, nil +} + +// NewMinterRoleTransactor creates a new write-only instance of MinterRole, bound to a specific deployed contract. +func NewMinterRoleTransactor(address common.Address, transactor bind.ContractTransactor) (*MinterRoleTransactor, error) { + contract, err := bindMinterRole(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MinterRoleTransactor{contract: contract}, nil +} + +// NewMinterRoleFilterer creates a new log filterer instance of MinterRole, bound to a specific deployed contract. +func NewMinterRoleFilterer(address common.Address, filterer bind.ContractFilterer) (*MinterRoleFilterer, error) { + contract, err := bindMinterRole(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MinterRoleFilterer{contract: contract}, nil +} + +// bindMinterRole binds a generic wrapper to an already deployed contract. +func bindMinterRole(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(MinterRoleABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MinterRole *MinterRoleRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _MinterRole.Contract.MinterRoleCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MinterRole *MinterRoleRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MinterRole.Contract.MinterRoleTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MinterRole *MinterRoleRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MinterRole.Contract.MinterRoleTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MinterRole *MinterRoleCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _MinterRole.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MinterRole *MinterRoleTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MinterRole.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MinterRole *MinterRoleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MinterRole.Contract.contract.Transact(opts, method, params...) +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_MinterRole *MinterRoleCaller) IsMinter(opts *bind.CallOpts, account common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _MinterRole.contract.Call(opts, out, "isMinter", account) + return *ret0, err +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_MinterRole *MinterRoleSession) IsMinter(account common.Address) (bool, error) { + return _MinterRole.Contract.IsMinter(&_MinterRole.CallOpts, account) +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_MinterRole *MinterRoleCallerSession) IsMinter(account common.Address) (bool, error) { + return _MinterRole.Contract.IsMinter(&_MinterRole.CallOpts, account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_MinterRole *MinterRoleTransactor) AddMinter(opts *bind.TransactOpts, account common.Address) (*types.Transaction, error) { + return _MinterRole.contract.Transact(opts, "addMinter", account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_MinterRole *MinterRoleSession) AddMinter(account common.Address) (*types.Transaction, error) { + return _MinterRole.Contract.AddMinter(&_MinterRole.TransactOpts, account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_MinterRole *MinterRoleTransactorSession) AddMinter(account common.Address) (*types.Transaction, error) { + return _MinterRole.Contract.AddMinter(&_MinterRole.TransactOpts, account) +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_MinterRole *MinterRoleTransactor) RenounceMinter(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MinterRole.contract.Transact(opts, "renounceMinter") +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_MinterRole *MinterRoleSession) RenounceMinter() (*types.Transaction, error) { + return _MinterRole.Contract.RenounceMinter(&_MinterRole.TransactOpts) +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_MinterRole *MinterRoleTransactorSession) RenounceMinter() (*types.Transaction, error) { + return _MinterRole.Contract.RenounceMinter(&_MinterRole.TransactOpts) +} + +// MinterRoleMinterAddedIterator is returned from FilterMinterAdded and is used to iterate over the raw logs and unpacked data for MinterAdded events raised by the MinterRole contract. +type MinterRoleMinterAddedIterator struct { + Event *MinterRoleMinterAdded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *MinterRoleMinterAddedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(MinterRoleMinterAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(MinterRoleMinterAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *MinterRoleMinterAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MinterRoleMinterAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MinterRoleMinterAdded represents a MinterAdded event raised by the MinterRole contract. +type MinterRoleMinterAdded struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMinterAdded is a free log retrieval operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_MinterRole *MinterRoleFilterer) FilterMinterAdded(opts *bind.FilterOpts, account []common.Address) (*MinterRoleMinterAddedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _MinterRole.contract.FilterLogs(opts, "MinterAdded", accountRule) + if err != nil { + return nil, err + } + return &MinterRoleMinterAddedIterator{contract: _MinterRole.contract, event: "MinterAdded", logs: logs, sub: sub}, nil +} + +// WatchMinterAdded is a free log subscription operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_MinterRole *MinterRoleFilterer) WatchMinterAdded(opts *bind.WatchOpts, sink chan<- *MinterRoleMinterAdded, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _MinterRole.contract.WatchLogs(opts, "MinterAdded", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(MinterRoleMinterAdded) + if err := _MinterRole.contract.UnpackLog(event, "MinterAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMinterAdded is a log parse operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_MinterRole *MinterRoleFilterer) ParseMinterAdded(log types.Log) (*MinterRoleMinterAdded, error) { + event := new(MinterRoleMinterAdded) + if err := _MinterRole.contract.UnpackLog(event, "MinterAdded", log); err != nil { + return nil, err + } + return event, nil +} + +// MinterRoleMinterRemovedIterator is returned from FilterMinterRemoved and is used to iterate over the raw logs and unpacked data for MinterRemoved events raised by the MinterRole contract. +type MinterRoleMinterRemovedIterator struct { + Event *MinterRoleMinterRemoved // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *MinterRoleMinterRemovedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(MinterRoleMinterRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(MinterRoleMinterRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *MinterRoleMinterRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MinterRoleMinterRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MinterRoleMinterRemoved represents a MinterRemoved event raised by the MinterRole contract. +type MinterRoleMinterRemoved struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMinterRemoved is a free log retrieval operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_MinterRole *MinterRoleFilterer) FilterMinterRemoved(opts *bind.FilterOpts, account []common.Address) (*MinterRoleMinterRemovedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _MinterRole.contract.FilterLogs(opts, "MinterRemoved", accountRule) + if err != nil { + return nil, err + } + return &MinterRoleMinterRemovedIterator{contract: _MinterRole.contract, event: "MinterRemoved", logs: logs, sub: sub}, nil +} + +// WatchMinterRemoved is a free log subscription operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_MinterRole *MinterRoleFilterer) WatchMinterRemoved(opts *bind.WatchOpts, sink chan<- *MinterRoleMinterRemoved, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _MinterRole.contract.WatchLogs(opts, "MinterRemoved", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(MinterRoleMinterRemoved) + if err := _MinterRole.contract.UnpackLog(event, "MinterRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMinterRemoved is a log parse operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_MinterRole *MinterRoleFilterer) ParseMinterRemoved(log types.Log) (*MinterRoleMinterRemoved, error) { + event := new(MinterRoleMinterRemoved) + if err := _MinterRole.contract.UnpackLog(event, "MinterRemoved", log); err != nil { + return nil, err + } + return event, nil +} + +// RolesABI is the input ABI used to generate the binding from. +const RolesABI = "[]" + +// RolesBin is the compiled bytecode used for deploying new contracts. +var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158209a68d01e8b2b237a89fef9b2aa16f6200a28b6f0cb4b41af99c6e125cf59ef1e64736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(RolesABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(RolesBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Roles{RolesCaller: RolesCaller{contract: contract}, RolesTransactor: RolesTransactor{contract: contract}, RolesFilterer: RolesFilterer{contract: contract}}, nil +} + +// Roles is an auto generated Go binding around an Ethereum contract. +type Roles struct { + RolesCaller // Read-only binding to the contract + RolesTransactor // Write-only binding to the contract + RolesFilterer // Log filterer for contract events +} + +// RolesCaller is an auto generated read-only Go binding around an Ethereum contract. +type RolesCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RolesTransactor is an auto generated write-only Go binding around an Ethereum contract. +type RolesTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RolesFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type RolesFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RolesSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type RolesSession struct { + Contract *Roles // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// RolesCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type RolesCallerSession struct { + Contract *RolesCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// RolesTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type RolesTransactorSession struct { + Contract *RolesTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// RolesRaw is an auto generated low-level Go binding around an Ethereum contract. +type RolesRaw struct { + Contract *Roles // Generic contract binding to access the raw methods on +} + +// RolesCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type RolesCallerRaw struct { + Contract *RolesCaller // Generic read-only contract binding to access the raw methods on +} + +// RolesTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type RolesTransactorRaw struct { + Contract *RolesTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewRoles creates a new instance of Roles, bound to a specific deployed contract. +func NewRoles(address common.Address, backend bind.ContractBackend) (*Roles, error) { + contract, err := bindRoles(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Roles{RolesCaller: RolesCaller{contract: contract}, RolesTransactor: RolesTransactor{contract: contract}, RolesFilterer: RolesFilterer{contract: contract}}, nil +} + +// NewRolesCaller creates a new read-only instance of Roles, bound to a specific deployed contract. +func NewRolesCaller(address common.Address, caller bind.ContractCaller) (*RolesCaller, error) { + contract, err := bindRoles(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &RolesCaller{contract: contract}, nil +} + +// NewRolesTransactor creates a new write-only instance of Roles, bound to a specific deployed contract. +func NewRolesTransactor(address common.Address, transactor bind.ContractTransactor) (*RolesTransactor, error) { + contract, err := bindRoles(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &RolesTransactor{contract: contract}, nil +} + +// NewRolesFilterer creates a new log filterer instance of Roles, bound to a specific deployed contract. +func NewRolesFilterer(address common.Address, filterer bind.ContractFilterer) (*RolesFilterer, error) { + contract, err := bindRoles(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &RolesFilterer{contract: contract}, nil +} + +// bindRoles binds a generic wrapper to an already deployed contract. +func bindRoles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(RolesABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Roles *RolesRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Roles.Contract.RolesCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Roles *RolesRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Roles.Contract.RolesTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Roles *RolesRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Roles.Contract.RolesTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Roles *RolesCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Roles.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Roles *RolesTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Roles.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Roles *RolesTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Roles.Contract.contract.Transact(opts, method, params...) +} + +// SafeMathABI is the input ABI used to generate the binding from. +const SafeMathABI = "[]" + +// SafeMathBin is the compiled bytecode used for deploying new contracts. +var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820044a15379c034d2be95cff236f2765160889caff1b82a6d65660cc33f8505af664736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SafeMathBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil +} + +// SafeMath is an auto generated Go binding around an Ethereum contract. +type SafeMath struct { + SafeMathCaller // Read-only binding to the contract + SafeMathTransactor // Write-only binding to the contract + SafeMathFilterer // Log filterer for contract events +} + +// SafeMathCaller is an auto generated read-only Go binding around an Ethereum contract. +type SafeMathCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeMathTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SafeMathTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeMathFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SafeMathFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeMathSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SafeMathSession struct { + Contract *SafeMath // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeMathCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SafeMathCallerSession struct { + Contract *SafeMathCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SafeMathTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SafeMathTransactorSession struct { + Contract *SafeMathTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeMathRaw is an auto generated low-level Go binding around an Ethereum contract. +type SafeMathRaw struct { + Contract *SafeMath // Generic contract binding to access the raw methods on +} + +// SafeMathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SafeMathCallerRaw struct { + Contract *SafeMathCaller // Generic read-only contract binding to access the raw methods on +} + +// SafeMathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SafeMathTransactorRaw struct { + Contract *SafeMathTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSafeMath creates a new instance of SafeMath, bound to a specific deployed contract. +func NewSafeMath(address common.Address, backend bind.ContractBackend) (*SafeMath, error) { + contract, err := bindSafeMath(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil +} + +// NewSafeMathCaller creates a new read-only instance of SafeMath, bound to a specific deployed contract. +func NewSafeMathCaller(address common.Address, caller bind.ContractCaller) (*SafeMathCaller, error) { + contract, err := bindSafeMath(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SafeMathCaller{contract: contract}, nil +} + +// NewSafeMathTransactor creates a new write-only instance of SafeMath, bound to a specific deployed contract. +func NewSafeMathTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeMathTransactor, error) { + contract, err := bindSafeMath(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SafeMathTransactor{contract: contract}, nil +} + +// NewSafeMathFilterer creates a new log filterer instance of SafeMath, bound to a specific deployed contract. +func NewSafeMathFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeMathFilterer, error) { + contract, err := bindSafeMath(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SafeMathFilterer{contract: contract}, nil +} + +// bindSafeMath binds a generic wrapper to an already deployed contract. +func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeMath *SafeMathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeMath.Contract.SafeMathTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeMath.Contract.SafeMathTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _SafeMath.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeMath *SafeMathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeMath.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeMath *SafeMathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeMath.Contract.contract.Transact(opts, method, params...) +} 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 new file mode 100644 index 0000000000..fd54247754 --- /dev/null +++ b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/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 = "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace146100d4578063c70242ad1461011e575b600080fd5b6100926004803603604081101561005c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061017a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100dc610301565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101606004803603602081101561013457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610327565b604051808215151515815260200191505060405180910390f35b60008083600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516101ae90610347565b808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051809103906000f08015801561023a573d6000803e3d6000fd5b50905060016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00481604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18091505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006020528060005260406000206000915054906101000a900460ff1681565b6122eb806103558339019056fe608060405234801561001057600080fd5b506040516122eb3803806122eb8339818101604052606081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806000819055505050506121f8806100f36000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032a265627a7a72315820bfdcb3c4bb558adb9e8c3072b91d763f9e5b62aad72502d95e326660aaa3cbb364736f6c634300050d0032" 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-0/simpleswapfactory/simpleswapfactory.go new file mode 100644 index 0000000000..dca22aa427 --- /dev/null +++ b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory/simpleswapfactory.go @@ -0,0 +1,5405 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package simpleswapfactory + +import ( + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// ContextABI is the input ABI used to generate the binding from. +const ContextABI = "[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]" + +// Context is an auto generated Go binding around an Ethereum contract. +type Context struct { + ContextCaller // Read-only binding to the contract + ContextTransactor // Write-only binding to the contract + ContextFilterer // Log filterer for contract events +} + +// ContextCaller is an auto generated read-only Go binding around an Ethereum contract. +type ContextCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContextTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ContextTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContextFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ContextFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContextSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ContextSession struct { + Contract *Context // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ContextCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ContextCallerSession struct { + Contract *ContextCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ContextTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ContextTransactorSession struct { + Contract *ContextTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ContextRaw is an auto generated low-level Go binding around an Ethereum contract. +type ContextRaw struct { + Contract *Context // Generic contract binding to access the raw methods on +} + +// ContextCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ContextCallerRaw struct { + Contract *ContextCaller // Generic read-only contract binding to access the raw methods on +} + +// ContextTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ContextTransactorRaw struct { + Contract *ContextTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewContext creates a new instance of Context, bound to a specific deployed contract. +func NewContext(address common.Address, backend bind.ContractBackend) (*Context, error) { + contract, err := bindContext(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Context{ContextCaller: ContextCaller{contract: contract}, ContextTransactor: ContextTransactor{contract: contract}, ContextFilterer: ContextFilterer{contract: contract}}, nil +} + +// NewContextCaller creates a new read-only instance of Context, bound to a specific deployed contract. +func NewContextCaller(address common.Address, caller bind.ContractCaller) (*ContextCaller, error) { + contract, err := bindContext(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ContextCaller{contract: contract}, nil +} + +// NewContextTransactor creates a new write-only instance of Context, bound to a specific deployed contract. +func NewContextTransactor(address common.Address, transactor bind.ContractTransactor) (*ContextTransactor, error) { + contract, err := bindContext(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ContextTransactor{contract: contract}, nil +} + +// NewContextFilterer creates a new log filterer instance of Context, bound to a specific deployed contract. +func NewContextFilterer(address common.Address, filterer bind.ContractFilterer) (*ContextFilterer, error) { + contract, err := bindContext(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ContextFilterer{contract: contract}, nil +} + +// bindContext binds a generic wrapper to an already deployed contract. +func bindContext(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ContextABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Context *ContextRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Context.Contract.ContextCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Context *ContextRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Context.Contract.ContextTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Context *ContextRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Context.Contract.ContextTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Context *ContextCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Context.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Context *ContextTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Context.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Context *ContextTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Context.Contract.contract.Transact(opts, method, params...) +} + +// ECDSAABI is the input ABI used to generate the binding from. +const ECDSAABI = "[]" + +// ECDSABin is the compiled bytecode used for deploying new contracts. +var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820c087da536b18c4187b7cacb424c2e4c58e707414a9642df27f1db97cccc3b7f464736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(ECDSAABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ECDSABin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ECDSA{ECDSACaller: ECDSACaller{contract: contract}, ECDSATransactor: ECDSATransactor{contract: contract}, ECDSAFilterer: ECDSAFilterer{contract: contract}}, nil +} + +// ECDSA is an auto generated Go binding around an Ethereum contract. +type ECDSA struct { + ECDSACaller // Read-only binding to the contract + ECDSATransactor // Write-only binding to the contract + ECDSAFilterer // Log filterer for contract events +} + +// ECDSACaller is an auto generated read-only Go binding around an Ethereum contract. +type ECDSACaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ECDSATransactor is an auto generated write-only Go binding around an Ethereum contract. +type ECDSATransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ECDSAFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ECDSAFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ECDSASession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ECDSASession struct { + Contract *ECDSA // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ECDSACallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ECDSACallerSession struct { + Contract *ECDSACaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ECDSATransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ECDSATransactorSession struct { + Contract *ECDSATransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ECDSARaw is an auto generated low-level Go binding around an Ethereum contract. +type ECDSARaw struct { + Contract *ECDSA // Generic contract binding to access the raw methods on +} + +// ECDSACallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ECDSACallerRaw struct { + Contract *ECDSACaller // Generic read-only contract binding to access the raw methods on +} + +// ECDSATransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ECDSATransactorRaw struct { + Contract *ECDSATransactor // Generic write-only contract binding to access the raw methods on +} + +// NewECDSA creates a new instance of ECDSA, bound to a specific deployed contract. +func NewECDSA(address common.Address, backend bind.ContractBackend) (*ECDSA, error) { + contract, err := bindECDSA(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ECDSA{ECDSACaller: ECDSACaller{contract: contract}, ECDSATransactor: ECDSATransactor{contract: contract}, ECDSAFilterer: ECDSAFilterer{contract: contract}}, nil +} + +// NewECDSACaller creates a new read-only instance of ECDSA, bound to a specific deployed contract. +func NewECDSACaller(address common.Address, caller bind.ContractCaller) (*ECDSACaller, error) { + contract, err := bindECDSA(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ECDSACaller{contract: contract}, nil +} + +// NewECDSATransactor creates a new write-only instance of ECDSA, bound to a specific deployed contract. +func NewECDSATransactor(address common.Address, transactor bind.ContractTransactor) (*ECDSATransactor, error) { + contract, err := bindECDSA(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ECDSATransactor{contract: contract}, nil +} + +// NewECDSAFilterer creates a new log filterer instance of ECDSA, bound to a specific deployed contract. +func NewECDSAFilterer(address common.Address, filterer bind.ContractFilterer) (*ECDSAFilterer, error) { + contract, err := bindECDSA(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ECDSAFilterer{contract: contract}, nil +} + +// bindECDSA binds a generic wrapper to an already deployed contract. +func bindECDSA(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ECDSAABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ECDSA *ECDSARaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ECDSA.Contract.ECDSACaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ECDSA *ECDSARaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ECDSA.Contract.ECDSATransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ECDSA *ECDSARaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ECDSA.Contract.ECDSATransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ECDSA *ECDSACallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ECDSA.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ECDSA *ECDSATransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ECDSA.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ECDSA *ECDSATransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ECDSA.Contract.contract.Transact(opts, method, params...) +} + +// ERC20ABI is the input ABI used to generate the binding from. +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 = "0x6080604052610e3a806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a08231146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e1461032157610088565b8063095ea7b31461008d57806318160ddd146100f357806323b872dd146101115780633950935114610197575b600080fd5b6100d9600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610399565b604051808215151515815260200191505060405180910390f35b6100fb6103b7565b6040518082815260200191505060405180910390f35b61017d6004803603606081101561012757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103c1565b604051808215151515815260200191505060405180910390f35b6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061049a565b604051808215151515815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061054d565b6040518082815260200191505060405180910390f35b6102a16004803603604081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610595565b604051808215151515815260200191505060405180910390f35b610307600480360360408110156102d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610662565b604051808215151515815260200191505060405180910390f35b6103836004803603604081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610680565b6040518082815260200191505060405180910390f35b60006103ad6103a6610707565b848461070f565b6001905092915050565b6000600254905090565b60006103ce848484610906565b61048f846103da610707565b61048a85604051806060016040528060288152602001610d7060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610440610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b600190509392505050565b60006105436104a7610707565b8461053e85600160006104b8610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b61070f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106586105a2610707565b8461065385604051806060016040528060258152602001610de160259139600160006105cc610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b6001905092915050565b600061067661066f610707565b8484610906565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610795576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610dbd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561081b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610d286022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610d986025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610d056023913960400191505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c2e578082015181840152602081019050610c13565b50505050905090810190601f168015610c5b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582053b4b44d2fad2123e25198aa5ed2b9e7b2ed14bfa733eb6d7d64e1cf403ba57964736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(ERC20ABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC20Bin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil +} + +// ERC20 is an auto generated Go binding around an Ethereum contract. +type ERC20 struct { + ERC20Caller // Read-only binding to the contract + ERC20Transactor // Write-only binding to the contract + ERC20Filterer // Log filterer for contract events +} + +// ERC20Caller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC20Session struct { + Contract *ERC20 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC20CallerSession struct { + Contract *ERC20Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC20TransactorSession struct { + Contract *ERC20Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20Raw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20Raw struct { + Contract *ERC20 // Generic contract binding to access the raw methods on +} + +// ERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20CallerRaw struct { + Contract *ERC20Caller // Generic read-only contract binding to access the raw methods on +} + +// ERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20TransactorRaw struct { + Contract *ERC20Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC20 creates a new instance of ERC20, bound to a specific deployed contract. +func NewERC20(address common.Address, backend bind.ContractBackend) (*ERC20, error) { + contract, err := bindERC20(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil +} + +// NewERC20Caller creates a new read-only instance of ERC20, bound to a specific deployed contract. +func NewERC20Caller(address common.Address, caller bind.ContractCaller) (*ERC20Caller, error) { + contract, err := bindERC20(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC20Caller{contract: contract}, nil +} + +// NewERC20Transactor creates a new write-only instance of ERC20, bound to a specific deployed contract. +func NewERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC20Transactor, error) { + contract, err := bindERC20(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC20Transactor{contract: contract}, nil +} + +// NewERC20Filterer creates a new log filterer instance of ERC20, bound to a specific deployed contract. +func NewERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC20Filterer, error) { + contract, err := bindERC20(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC20Filterer{contract: contract}, nil +} + +// bindERC20 binds a generic wrapper to an already deployed contract. +func bindERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ERC20ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20 *ERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20.Contract.ERC20Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20 *ERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20.Contract.ERC20Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20 *ERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20.Contract.ERC20Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20 *ERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20 *ERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20 *ERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20 *ERC20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20.contract.Call(opts, out, "allowance", owner, spender) + return *ret0, err +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20 *ERC20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20.Contract.Allowance(&_ERC20.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20 *ERC20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20.Contract.Allowance(&_ERC20.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20 *ERC20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20.contract.Call(opts, out, "balanceOf", account) + return *ret0, err +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20 *ERC20Session) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20 *ERC20CallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, account) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20 *ERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20.contract.Call(opts, out, "totalSupply") + return *ret0, err +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20 *ERC20Session) TotalSupply() (*big.Int, error) { + return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20 *ERC20CallerSession) TotalSupply() (*big.Int, error) { + return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20 *ERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20 *ERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20 *ERC20Transactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20 *ERC20Session) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.DecreaseAllowance(&_ERC20.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20 *ERC20TransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.DecreaseAllowance(&_ERC20.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20 *ERC20Transactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20 *ERC20Session) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.IncreaseAllowance(&_ERC20.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20 *ERC20TransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.IncreaseAllowance(&_ERC20.TransactOpts, spender, addedValue) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20Transactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "transfer", recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20Session) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20TransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20Transactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.contract.Transact(opts, "transferFrom", sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20Session) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20 *ERC20TransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, sender, recipient, amount) +} + +// ERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20 contract. +type ERC20ApprovalIterator struct { + Event *ERC20Approval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20ApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20Approval represents a Approval event raised by the ERC20 contract. +type ERC20Approval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &ERC20ApprovalIterator{contract: _ERC20.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20 *ERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20Approval) + if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20 *ERC20Filterer) ParseApproval(log types.Log) (*ERC20Approval, error) { + event := new(ERC20Approval) + if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20 contract. +type ERC20TransferIterator struct { + Event *ERC20Transfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20TransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20Transfer represents a Transfer event raised by the ERC20 contract. +type ERC20Transfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20 *ERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20TransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &ERC20TransferIterator{contract: _ERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20 *ERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20Transfer) + if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20 *ERC20Filterer) ParseTransfer(log types.Log) (*ERC20Transfer, error) { + event := new(ERC20Transfer) + if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20MintableABI is the input ABI used to generate the binding from. +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 = "0x608060405262000024620000186200002a60201b60201c565b6200003260201b60201c565b62000257565b600033905090565b6200004d8160036200009360201b620012a81790919060201c565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b620000a582826200017760201b60201c565b1562000119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000200576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180620018506022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6115e980620002676000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146102e7578063986502751461032b578063a457c2d714610335578063a9059cbb1461039b578063aa271e1a14610401578063dd62ed3e1461045d576100b4565b8063095ea7b3146100b957806318160ddd1461011f57806323b872dd1461013d57806339509351146101c357806340c10f191461022957806370a082311461028f575b600080fd5b610105600480360360408110156100cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104d5565b604051808215151515815260200191505060405180910390f35b6101276104f3565b6040518082815260200191505060405180910390f35b6101a96004803603606081101561015357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104fd565b604051808215151515815260200191505060405180910390f35b61020f600480360360408110156101d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105d6565b604051808215151515815260200191505060405180910390f35b6102756004803603604081101561023f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610689565b604051808215151515815260200191505060405180910390f35b6102d1600480360360208110156102a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610704565b6040518082815260200191505060405180910390f35b610329600480360360208110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061074c565b005b6103336107bd565b005b6103816004803603604081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cf565b604051808215151515815260200191505060405180910390f35b6103e7600480360360408110156103b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061089c565b604051808215151515815260200191505060405180910390f35b6104436004803603602081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ba565b604051808215151515815260200191505060405180910390f35b6104bf6004803603604081101561047357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108d7565b6040518082815260200191505060405180910390f35b60006104e96104e261095e565b8484610966565b6001905092915050565b6000600254905090565b600061050a848484610b5d565b6105cb8461051661095e565b6105c6856040518060600160405280602881526020016114fd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061057c61095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b600190509392505050565b600061067f6105e361095e565b8461067a85600160006105f461095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b610966565b6001905092915050565b600061069b61069661095e565b6108ba565b6106f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6106fa8383610f5b565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61075c61075761095e565b6108ba565b6107b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6107ba81611116565b50565b6107cd6107c861095e565b611170565b565b60006108926107dc61095e565b8461088d85604051806060016040528060258152602001611590602591396001600061080661095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b6001905092915050565b60006108b06108a961095e565b8484610b5d565b6001905092915050565b60006108d08260036111ca90919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061156c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806114646022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610be3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806115476025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114416023913960400191505060405180910390fd5b610cd481604051806060016040528060268152602001611486602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d67816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610ec0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e85578082015181840152602081019050610e6a565b50505050905090810190601f168015610eb25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610f51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61101381600254610ed390919063ffffffff16565b60028190555061106a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61112a8160036112a890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b61118481600361138390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806115256022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6112b282826111ca565b15611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61138d82826111ca565b6113e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806114dc6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820d814ae3015d19c38aed909871af148dee0d88a6be96dc04f5c4a57e543a3f83364736f6c634300050d0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(ERC20MintableABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC20MintableBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC20Mintable{ERC20MintableCaller: ERC20MintableCaller{contract: contract}, ERC20MintableTransactor: ERC20MintableTransactor{contract: contract}, ERC20MintableFilterer: ERC20MintableFilterer{contract: contract}}, nil +} + +// ERC20Mintable is an auto generated Go binding around an Ethereum contract. +type ERC20Mintable struct { + ERC20MintableCaller // Read-only binding to the contract + ERC20MintableTransactor // Write-only binding to the contract + ERC20MintableFilterer // Log filterer for contract events +} + +// ERC20MintableCaller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20MintableCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20MintableTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20MintableTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20MintableFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20MintableFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20MintableSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC20MintableSession struct { + Contract *ERC20Mintable // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20MintableCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC20MintableCallerSession struct { + Contract *ERC20MintableCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC20MintableTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC20MintableTransactorSession struct { + Contract *ERC20MintableTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20MintableRaw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20MintableRaw struct { + Contract *ERC20Mintable // Generic contract binding to access the raw methods on +} + +// ERC20MintableCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20MintableCallerRaw struct { + Contract *ERC20MintableCaller // Generic read-only contract binding to access the raw methods on +} + +// ERC20MintableTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20MintableTransactorRaw struct { + Contract *ERC20MintableTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC20Mintable creates a new instance of ERC20Mintable, bound to a specific deployed contract. +func NewERC20Mintable(address common.Address, backend bind.ContractBackend) (*ERC20Mintable, error) { + contract, err := bindERC20Mintable(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC20Mintable{ERC20MintableCaller: ERC20MintableCaller{contract: contract}, ERC20MintableTransactor: ERC20MintableTransactor{contract: contract}, ERC20MintableFilterer: ERC20MintableFilterer{contract: contract}}, nil +} + +// NewERC20MintableCaller creates a new read-only instance of ERC20Mintable, bound to a specific deployed contract. +func NewERC20MintableCaller(address common.Address, caller bind.ContractCaller) (*ERC20MintableCaller, error) { + contract, err := bindERC20Mintable(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC20MintableCaller{contract: contract}, nil +} + +// NewERC20MintableTransactor creates a new write-only instance of ERC20Mintable, bound to a specific deployed contract. +func NewERC20MintableTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20MintableTransactor, error) { + contract, err := bindERC20Mintable(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC20MintableTransactor{contract: contract}, nil +} + +// NewERC20MintableFilterer creates a new log filterer instance of ERC20Mintable, bound to a specific deployed contract. +func NewERC20MintableFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20MintableFilterer, error) { + contract, err := bindERC20Mintable(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC20MintableFilterer{contract: contract}, nil +} + +// bindERC20Mintable binds a generic wrapper to an already deployed contract. +func bindERC20Mintable(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ERC20MintableABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20Mintable *ERC20MintableRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20Mintable.Contract.ERC20MintableCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20Mintable *ERC20MintableRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20Mintable.Contract.ERC20MintableTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20Mintable *ERC20MintableRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20Mintable.Contract.ERC20MintableTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20Mintable *ERC20MintableCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20Mintable.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20Mintable *ERC20MintableTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20Mintable.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20Mintable *ERC20MintableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20Mintable.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20Mintable.contract.Call(opts, out, "allowance", owner, spender) + return *ret0, err +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20Mintable.Contract.Allowance(&_ERC20Mintable.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _ERC20Mintable.Contract.Allowance(&_ERC20Mintable.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20Mintable.contract.Call(opts, out, "balanceOf", account) + return *ret0, err +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20Mintable.Contract.BalanceOf(&_ERC20Mintable.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _ERC20Mintable.Contract.BalanceOf(&_ERC20Mintable.CallOpts, account) +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_ERC20Mintable *ERC20MintableCaller) IsMinter(opts *bind.CallOpts, account common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _ERC20Mintable.contract.Call(opts, out, "isMinter", account) + return *ret0, err +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_ERC20Mintable *ERC20MintableSession) IsMinter(account common.Address) (bool, error) { + return _ERC20Mintable.Contract.IsMinter(&_ERC20Mintable.CallOpts, account) +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_ERC20Mintable *ERC20MintableCallerSession) IsMinter(account common.Address) (bool, error) { + return _ERC20Mintable.Contract.IsMinter(&_ERC20Mintable.CallOpts, account) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20Mintable.contract.Call(opts, out, "totalSupply") + return *ret0, err +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20Mintable *ERC20MintableSession) TotalSupply() (*big.Int, error) { + return _ERC20Mintable.Contract.TotalSupply(&_ERC20Mintable.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_ERC20Mintable *ERC20MintableCallerSession) TotalSupply() (*big.Int, error) { + return _ERC20Mintable.Contract.TotalSupply(&_ERC20Mintable.CallOpts) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_ERC20Mintable *ERC20MintableTransactor) AddMinter(opts *bind.TransactOpts, account common.Address) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "addMinter", account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_ERC20Mintable *ERC20MintableSession) AddMinter(account common.Address) (*types.Transaction, error) { + return _ERC20Mintable.Contract.AddMinter(&_ERC20Mintable.TransactOpts, account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_ERC20Mintable *ERC20MintableTransactorSession) AddMinter(account common.Address) (*types.Transaction, error) { + return _ERC20Mintable.Contract.AddMinter(&_ERC20Mintable.TransactOpts, account) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Approve(&_ERC20Mintable.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Approve(&_ERC20Mintable.TransactOpts, spender, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.DecreaseAllowance(&_ERC20Mintable.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.DecreaseAllowance(&_ERC20Mintable.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.IncreaseAllowance(&_ERC20Mintable.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.IncreaseAllowance(&_ERC20Mintable.TransactOpts, spender, addedValue) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "mint", account, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Mint(&_ERC20Mintable.TransactOpts, account, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Mint(&_ERC20Mintable.TransactOpts, account, amount) +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_ERC20Mintable *ERC20MintableTransactor) RenounceMinter(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "renounceMinter") +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_ERC20Mintable *ERC20MintableSession) RenounceMinter() (*types.Transaction, error) { + return _ERC20Mintable.Contract.RenounceMinter(&_ERC20Mintable.TransactOpts) +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_ERC20Mintable *ERC20MintableTransactorSession) RenounceMinter() (*types.Transaction, error) { + return _ERC20Mintable.Contract.RenounceMinter(&_ERC20Mintable.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "transfer", recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Transfer(&_ERC20Mintable.TransactOpts, recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.Transfer(&_ERC20Mintable.TransactOpts, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.contract.Transact(opts, "transferFrom", sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.TransferFrom(&_ERC20Mintable.TransactOpts, sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_ERC20Mintable *ERC20MintableTransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20Mintable.Contract.TransferFrom(&_ERC20Mintable.TransactOpts, sender, recipient, amount) +} + +// ERC20MintableApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20Mintable contract. +type ERC20MintableApprovalIterator struct { + Event *ERC20MintableApproval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20MintableApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20MintableApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20MintableApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20MintableApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20MintableApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20MintableApproval represents a Approval event raised by the ERC20Mintable contract. +type ERC20MintableApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20MintableApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20Mintable.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &ERC20MintableApprovalIterator{contract: _ERC20Mintable.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20MintableApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC20Mintable.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20MintableApproval) + if err := _ERC20Mintable.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) ParseApproval(log types.Log) (*ERC20MintableApproval, error) { + event := new(ERC20MintableApproval) + if err := _ERC20Mintable.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20MintableMinterAddedIterator is returned from FilterMinterAdded and is used to iterate over the raw logs and unpacked data for MinterAdded events raised by the ERC20Mintable contract. +type ERC20MintableMinterAddedIterator struct { + Event *ERC20MintableMinterAdded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20MintableMinterAddedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20MintableMinterAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20MintableMinterAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20MintableMinterAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20MintableMinterAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20MintableMinterAdded represents a MinterAdded event raised by the ERC20Mintable contract. +type ERC20MintableMinterAdded struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMinterAdded is a free log retrieval operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) FilterMinterAdded(opts *bind.FilterOpts, account []common.Address) (*ERC20MintableMinterAddedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _ERC20Mintable.contract.FilterLogs(opts, "MinterAdded", accountRule) + if err != nil { + return nil, err + } + return &ERC20MintableMinterAddedIterator{contract: _ERC20Mintable.contract, event: "MinterAdded", logs: logs, sub: sub}, nil +} + +// WatchMinterAdded is a free log subscription operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) WatchMinterAdded(opts *bind.WatchOpts, sink chan<- *ERC20MintableMinterAdded, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _ERC20Mintable.contract.WatchLogs(opts, "MinterAdded", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20MintableMinterAdded) + if err := _ERC20Mintable.contract.UnpackLog(event, "MinterAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMinterAdded is a log parse operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) ParseMinterAdded(log types.Log) (*ERC20MintableMinterAdded, error) { + event := new(ERC20MintableMinterAdded) + if err := _ERC20Mintable.contract.UnpackLog(event, "MinterAdded", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20MintableMinterRemovedIterator is returned from FilterMinterRemoved and is used to iterate over the raw logs and unpacked data for MinterRemoved events raised by the ERC20Mintable contract. +type ERC20MintableMinterRemovedIterator struct { + Event *ERC20MintableMinterRemoved // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20MintableMinterRemovedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20MintableMinterRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20MintableMinterRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20MintableMinterRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20MintableMinterRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20MintableMinterRemoved represents a MinterRemoved event raised by the ERC20Mintable contract. +type ERC20MintableMinterRemoved struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMinterRemoved is a free log retrieval operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) FilterMinterRemoved(opts *bind.FilterOpts, account []common.Address) (*ERC20MintableMinterRemovedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _ERC20Mintable.contract.FilterLogs(opts, "MinterRemoved", accountRule) + if err != nil { + return nil, err + } + return &ERC20MintableMinterRemovedIterator{contract: _ERC20Mintable.contract, event: "MinterRemoved", logs: logs, sub: sub}, nil +} + +// WatchMinterRemoved is a free log subscription operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) WatchMinterRemoved(opts *bind.WatchOpts, sink chan<- *ERC20MintableMinterRemoved, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _ERC20Mintable.contract.WatchLogs(opts, "MinterRemoved", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20MintableMinterRemoved) + if err := _ERC20Mintable.contract.UnpackLog(event, "MinterRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMinterRemoved is a log parse operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_ERC20Mintable *ERC20MintableFilterer) ParseMinterRemoved(log types.Log) (*ERC20MintableMinterRemoved, error) { + event := new(ERC20MintableMinterRemoved) + if err := _ERC20Mintable.contract.UnpackLog(event, "MinterRemoved", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20MintableTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20Mintable contract. +type ERC20MintableTransferIterator struct { + Event *ERC20MintableTransfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20MintableTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20MintableTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20MintableTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20MintableTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20MintableTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20MintableTransfer represents a Transfer event raised by the ERC20Mintable contract. +type ERC20MintableTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20MintableTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20Mintable.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &ERC20MintableTransferIterator{contract: _ERC20Mintable.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20MintableTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _ERC20Mintable.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20MintableTransfer) + if err := _ERC20Mintable.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_ERC20Mintable *ERC20MintableFilterer) ParseTransfer(log types.Log) (*ERC20MintableTransfer, error) { + event := new(ERC20MintableTransfer) + if err := _ERC20Mintable.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + return event, nil +} + +// 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\"}]" + +// ERC20SimpleSwapBin is the compiled bytecode used for deploying new contracts. +var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b506040516122eb3803806122eb8339818101604052606081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806000819055505050506121f8806100f36000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(ERC20SimpleSwapABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC20SimpleSwapBin), backend, _issuer, _token, _defaultHardDepositTimeout) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC20SimpleSwap{ERC20SimpleSwapCaller: ERC20SimpleSwapCaller{contract: contract}, ERC20SimpleSwapTransactor: ERC20SimpleSwapTransactor{contract: contract}, ERC20SimpleSwapFilterer: ERC20SimpleSwapFilterer{contract: contract}}, nil +} + +// ERC20SimpleSwap is an auto generated Go binding around an Ethereum contract. +type ERC20SimpleSwap struct { + ERC20SimpleSwapCaller // Read-only binding to the contract + ERC20SimpleSwapTransactor // Write-only binding to the contract + ERC20SimpleSwapFilterer // Log filterer for contract events +} + +// ERC20SimpleSwapCaller is an auto generated read-only Go binding around an Ethereum contract. +type ERC20SimpleSwapCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20SimpleSwapTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC20SimpleSwapTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20SimpleSwapFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC20SimpleSwapFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC20SimpleSwapSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC20SimpleSwapSession struct { + Contract *ERC20SimpleSwap // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20SimpleSwapCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC20SimpleSwapCallerSession struct { + Contract *ERC20SimpleSwapCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC20SimpleSwapTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC20SimpleSwapTransactorSession struct { + Contract *ERC20SimpleSwapTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC20SimpleSwapRaw is an auto generated low-level Go binding around an Ethereum contract. +type ERC20SimpleSwapRaw struct { + Contract *ERC20SimpleSwap // Generic contract binding to access the raw methods on +} + +// ERC20SimpleSwapCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC20SimpleSwapCallerRaw struct { + Contract *ERC20SimpleSwapCaller // Generic read-only contract binding to access the raw methods on +} + +// ERC20SimpleSwapTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC20SimpleSwapTransactorRaw struct { + Contract *ERC20SimpleSwapTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC20SimpleSwap creates a new instance of ERC20SimpleSwap, bound to a specific deployed contract. +func NewERC20SimpleSwap(address common.Address, backend bind.ContractBackend) (*ERC20SimpleSwap, error) { + contract, err := bindERC20SimpleSwap(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC20SimpleSwap{ERC20SimpleSwapCaller: ERC20SimpleSwapCaller{contract: contract}, ERC20SimpleSwapTransactor: ERC20SimpleSwapTransactor{contract: contract}, ERC20SimpleSwapFilterer: ERC20SimpleSwapFilterer{contract: contract}}, nil +} + +// NewERC20SimpleSwapCaller creates a new read-only instance of ERC20SimpleSwap, bound to a specific deployed contract. +func NewERC20SimpleSwapCaller(address common.Address, caller bind.ContractCaller) (*ERC20SimpleSwapCaller, error) { + contract, err := bindERC20SimpleSwap(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapCaller{contract: contract}, nil +} + +// NewERC20SimpleSwapTransactor creates a new write-only instance of ERC20SimpleSwap, bound to a specific deployed contract. +func NewERC20SimpleSwapTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20SimpleSwapTransactor, error) { + contract, err := bindERC20SimpleSwap(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapTransactor{contract: contract}, nil +} + +// NewERC20SimpleSwapFilterer creates a new log filterer instance of ERC20SimpleSwap, bound to a specific deployed contract. +func NewERC20SimpleSwapFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20SimpleSwapFilterer, error) { + contract, err := bindERC20SimpleSwap(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapFilterer{contract: contract}, nil +} + +// bindERC20SimpleSwap binds a generic wrapper to an already deployed contract. +func bindERC20SimpleSwap(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ERC20SimpleSwapABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20SimpleSwap *ERC20SimpleSwapRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20SimpleSwap.Contract.ERC20SimpleSwapCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20SimpleSwap *ERC20SimpleSwapRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.ERC20SimpleSwapTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20SimpleSwap *ERC20SimpleSwapRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.ERC20SimpleSwapTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _ERC20SimpleSwap.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.contract.Transact(opts, method, params...) +} + +// Balance is a free data retrieval call binding the contract method 0xb69ef8a8. +// +// Solidity: function balance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Balance(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "balance") + return *ret0, err +} + +// Balance is a free data retrieval call binding the contract method 0xb69ef8a8. +// +// Solidity: function balance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Balance() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.Balance(&_ERC20SimpleSwap.CallOpts) +} + +// Balance is a free data retrieval call binding the contract method 0xb69ef8a8. +// +// Solidity: function balance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Balance() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.Balance(&_ERC20SimpleSwap.CallOpts) +} + +// DefaultHardDepositTimeout is a free data retrieval call binding the contract method 0x12101021. +// +// Solidity: function defaultHardDepositTimeout() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) DefaultHardDepositTimeout(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "defaultHardDepositTimeout") + return *ret0, err +} + +// DefaultHardDepositTimeout is a free data retrieval call binding the contract method 0x12101021. +// +// Solidity: function defaultHardDepositTimeout() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) DefaultHardDepositTimeout() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.DefaultHardDepositTimeout(&_ERC20SimpleSwap.CallOpts) +} + +// DefaultHardDepositTimeout is a free data retrieval call binding the contract method 0x12101021. +// +// Solidity: function defaultHardDepositTimeout() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) DefaultHardDepositTimeout() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.DefaultHardDepositTimeout(&_ERC20SimpleSwap.CallOpts) +} + +// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. +// +// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 timeout, uint256 canBeDecreasedAt) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) HardDeposits(opts *bind.CallOpts, arg0 common.Address) (struct { + Amount *big.Int + DecreaseAmount *big.Int + Timeout *big.Int + CanBeDecreasedAt *big.Int +}, error) { + ret := new(struct { + Amount *big.Int + DecreaseAmount *big.Int + Timeout *big.Int + CanBeDecreasedAt *big.Int + }) + out := ret + err := _ERC20SimpleSwap.contract.Call(opts, out, "hardDeposits", arg0) + return *ret, err +} + +// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. +// +// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 timeout, uint256 canBeDecreasedAt) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) HardDeposits(arg0 common.Address) (struct { + Amount *big.Int + DecreaseAmount *big.Int + Timeout *big.Int + CanBeDecreasedAt *big.Int +}, error) { + return _ERC20SimpleSwap.Contract.HardDeposits(&_ERC20SimpleSwap.CallOpts, arg0) +} + +// HardDeposits is a free data retrieval call binding the contract method 0xb6343b0d. +// +// Solidity: function hardDeposits(address ) constant returns(uint256 amount, uint256 decreaseAmount, uint256 timeout, uint256 canBeDecreasedAt) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) HardDeposits(arg0 common.Address) (struct { + Amount *big.Int + DecreaseAmount *big.Int + Timeout *big.Int + CanBeDecreasedAt *big.Int +}, error) { + return _ERC20SimpleSwap.Contract.HardDeposits(&_ERC20SimpleSwap.CallOpts, arg0) +} + +// Issuer is a free data retrieval call binding the contract method 0x1d143848. +// +// Solidity: function issuer() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Issuer(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "issuer") + return *ret0, err +} + +// Issuer is a free data retrieval call binding the contract method 0x1d143848. +// +// Solidity: function issuer() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Issuer() (common.Address, error) { + return _ERC20SimpleSwap.Contract.Issuer(&_ERC20SimpleSwap.CallOpts) +} + +// Issuer is a free data retrieval call binding the contract method 0x1d143848. +// +// Solidity: function issuer() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Issuer() (common.Address, error) { + return _ERC20SimpleSwap.Contract.Issuer(&_ERC20SimpleSwap.CallOpts) +} + +// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. +// +// Solidity: function liquidBalance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) LiquidBalance(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "liquidBalance") + return *ret0, err +} + +// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. +// +// Solidity: function liquidBalance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) LiquidBalance() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.LiquidBalance(&_ERC20SimpleSwap.CallOpts) +} + +// LiquidBalance is a free data retrieval call binding the contract method 0xb7ec1a33. +// +// Solidity: function liquidBalance() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) LiquidBalance() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.LiquidBalance(&_ERC20SimpleSwap.CallOpts) +} + +// LiquidBalanceFor is a free data retrieval call binding the contract method 0xc76a4d31. +// +// Solidity: function liquidBalanceFor(address beneficiary) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) LiquidBalanceFor(opts *bind.CallOpts, beneficiary common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "liquidBalanceFor", beneficiary) + return *ret0, err +} + +// LiquidBalanceFor is a free data retrieval call binding the contract method 0xc76a4d31. +// +// Solidity: function liquidBalanceFor(address beneficiary) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) LiquidBalanceFor(beneficiary common.Address) (*big.Int, error) { + return _ERC20SimpleSwap.Contract.LiquidBalanceFor(&_ERC20SimpleSwap.CallOpts, beneficiary) +} + +// LiquidBalanceFor is a free data retrieval call binding the contract method 0xc76a4d31. +// +// Solidity: function liquidBalanceFor(address beneficiary) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) LiquidBalanceFor(beneficiary common.Address) (*big.Int, error) { + return _ERC20SimpleSwap.Contract.LiquidBalanceFor(&_ERC20SimpleSwap.CallOpts, beneficiary) +} + +// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. +// +// Solidity: function paidOut(address ) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) PaidOut(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "paidOut", arg0) + return *ret0, err +} + +// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. +// +// Solidity: function paidOut(address ) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) PaidOut(arg0 common.Address) (*big.Int, error) { + return _ERC20SimpleSwap.Contract.PaidOut(&_ERC20SimpleSwap.CallOpts, arg0) +} + +// PaidOut is a free data retrieval call binding the contract method 0x81f03fcb. +// +// Solidity: function paidOut(address ) constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) PaidOut(arg0 common.Address) (*big.Int, error) { + return _ERC20SimpleSwap.Contract.PaidOut(&_ERC20SimpleSwap.CallOpts, arg0) +} + +// Token is a free data retrieval call binding the contract method 0xfc0c546a. +// +// Solidity: function token() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Token(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "token") + return *ret0, err +} + +// Token is a free data retrieval call binding the contract method 0xfc0c546a. +// +// Solidity: function token() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Token() (common.Address, error) { + return _ERC20SimpleSwap.Contract.Token(&_ERC20SimpleSwap.CallOpts) +} + +// Token is a free data retrieval call binding the contract method 0xfc0c546a. +// +// Solidity: function token() constant returns(address) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Token() (common.Address, error) { + return _ERC20SimpleSwap.Contract.Token(&_ERC20SimpleSwap.CallOpts) +} + +// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. +// +// Solidity: function totalHardDeposit() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) TotalHardDeposit(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "totalHardDeposit") + return *ret0, err +} + +// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. +// +// Solidity: function totalHardDeposit() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) TotalHardDeposit() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.TotalHardDeposit(&_ERC20SimpleSwap.CallOpts) +} + +// TotalHardDeposit is a free data retrieval call binding the contract method 0xe0bcf13a. +// +// Solidity: function totalHardDeposit() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) TotalHardDeposit() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.TotalHardDeposit(&_ERC20SimpleSwap.CallOpts) +} + +// TotalPaidOut is a free data retrieval call binding the contract method 0x1357e1dc. +// +// Solidity: function totalPaidOut() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) TotalPaidOut(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _ERC20SimpleSwap.contract.Call(opts, out, "totalPaidOut") + return *ret0, err +} + +// TotalPaidOut is a free data retrieval call binding the contract method 0x1357e1dc. +// +// Solidity: function totalPaidOut() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) TotalPaidOut() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.TotalPaidOut(&_ERC20SimpleSwap.CallOpts) +} + +// TotalPaidOut is a free data retrieval call binding the contract method 0x1357e1dc. +// +// Solidity: function totalPaidOut() constant returns(uint256) +func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) TotalPaidOut() (*big.Int, error) { + return _ERC20SimpleSwap.Contract.TotalPaidOut(&_ERC20SimpleSwap.CallOpts) +} + +// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. +// +// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) CashCheque(opts *bind.TransactOpts, beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "cashCheque", beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) +} + +// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. +// +// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) CashCheque(beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.CashCheque(&_ERC20SimpleSwap.TransactOpts, beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) +} + +// CashCheque is a paid mutator transaction binding the contract method 0x1633fb1d. +// +// Solidity: function cashCheque(address beneficiary, address recipient, uint256 cumulativePayout, bytes beneficiarySig, uint256 callerPayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) CashCheque(beneficiary common.Address, recipient common.Address, cumulativePayout *big.Int, beneficiarySig []byte, callerPayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.CashCheque(&_ERC20SimpleSwap.TransactOpts, beneficiary, recipient, cumulativePayout, beneficiarySig, callerPayout, issuerSig) +} + +// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. +// +// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) CashChequeBeneficiary(opts *bind.TransactOpts, recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "cashChequeBeneficiary", recipient, cumulativePayout, issuerSig) +} + +// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. +// +// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) CashChequeBeneficiary(recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.CashChequeBeneficiary(&_ERC20SimpleSwap.TransactOpts, recipient, cumulativePayout, issuerSig) +} + +// CashChequeBeneficiary is a paid mutator transaction binding the contract method 0x0d5f2659. +// +// Solidity: function cashChequeBeneficiary(address recipient, uint256 cumulativePayout, bytes issuerSig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) CashChequeBeneficiary(recipient common.Address, cumulativePayout *big.Int, issuerSig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.CashChequeBeneficiary(&_ERC20SimpleSwap.TransactOpts, recipient, cumulativePayout, issuerSig) +} + +// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. +// +// Solidity: function decreaseHardDeposit(address beneficiary) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) DecreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "decreaseHardDeposit", beneficiary) +} + +// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. +// +// Solidity: function decreaseHardDeposit(address beneficiary) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) DecreaseHardDeposit(beneficiary common.Address) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.DecreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary) +} + +// DecreaseHardDeposit is a paid mutator transaction binding the contract method 0x946f46a2. +// +// Solidity: function decreaseHardDeposit(address beneficiary) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) DecreaseHardDeposit(beneficiary common.Address) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.DecreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary) +} + +// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. +// +// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) IncreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "increaseHardDeposit", beneficiary, amount) +} + +// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. +// +// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) IncreaseHardDeposit(beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.IncreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary, amount) +} + +// IncreaseHardDeposit is a paid mutator transaction binding the contract method 0x338f3fed. +// +// Solidity: function increaseHardDeposit(address beneficiary, uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) IncreaseHardDeposit(beneficiary common.Address, amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.IncreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary, amount) +} + +// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. +// +// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) PrepareDecreaseHardDeposit(opts *bind.TransactOpts, beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "prepareDecreaseHardDeposit", beneficiary, decreaseAmount) +} + +// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. +// +// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) PrepareDecreaseHardDeposit(beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.PrepareDecreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary, decreaseAmount) +} + +// PrepareDecreaseHardDeposit is a paid mutator transaction binding the contract method 0xb7770350. +// +// Solidity: function prepareDecreaseHardDeposit(address beneficiary, uint256 decreaseAmount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) PrepareDecreaseHardDeposit(beneficiary common.Address, decreaseAmount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.PrepareDecreaseHardDeposit(&_ERC20SimpleSwap.TransactOpts, beneficiary, decreaseAmount) +} + +// SetCustomHardDepositTimeout is a paid mutator transaction binding the contract method 0xd4c9a8e8. +// +// Solidity: function setCustomHardDepositTimeout(address beneficiary, uint256 hardDepositTimeout, bytes beneficiarySig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) SetCustomHardDepositTimeout(opts *bind.TransactOpts, beneficiary common.Address, hardDepositTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "setCustomHardDepositTimeout", beneficiary, hardDepositTimeout, beneficiarySig) +} + +// SetCustomHardDepositTimeout is a paid mutator transaction binding the contract method 0xd4c9a8e8. +// +// Solidity: function setCustomHardDepositTimeout(address beneficiary, uint256 hardDepositTimeout, bytes beneficiarySig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) SetCustomHardDepositTimeout(beneficiary common.Address, hardDepositTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.SetCustomHardDepositTimeout(&_ERC20SimpleSwap.TransactOpts, beneficiary, hardDepositTimeout, beneficiarySig) +} + +// SetCustomHardDepositTimeout is a paid mutator transaction binding the contract method 0xd4c9a8e8. +// +// Solidity: function setCustomHardDepositTimeout(address beneficiary, uint256 hardDepositTimeout, bytes beneficiarySig) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) SetCustomHardDepositTimeout(beneficiary common.Address, hardDepositTimeout *big.Int, beneficiarySig []byte) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.SetCustomHardDepositTimeout(&_ERC20SimpleSwap.TransactOpts, beneficiary, hardDepositTimeout, beneficiarySig) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactor) Withdraw(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.contract.Transact(opts, "withdraw", amount) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Withdraw(amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.Withdraw(&_ERC20SimpleSwap.TransactOpts, amount) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 amount) returns() +func (_ERC20SimpleSwap *ERC20SimpleSwapTransactorSession) Withdraw(amount *big.Int) (*types.Transaction, error) { + return _ERC20SimpleSwap.Contract.Withdraw(&_ERC20SimpleSwap.TransactOpts, amount) +} + +// ERC20SimpleSwapChequeBouncedIterator is returned from FilterChequeBounced and is used to iterate over the raw logs and unpacked data for ChequeBounced events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapChequeBouncedIterator struct { + Event *ERC20SimpleSwapChequeBounced // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapChequeBouncedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapChequeBounced) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapChequeBounced) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapChequeBouncedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapChequeBouncedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapChequeBounced represents a ChequeBounced event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapChequeBounced struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChequeBounced is a free log retrieval operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. +// +// Solidity: event ChequeBounced() +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterChequeBounced(opts *bind.FilterOpts) (*ERC20SimpleSwapChequeBouncedIterator, error) { + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "ChequeBounced") + if err != nil { + return nil, err + } + return &ERC20SimpleSwapChequeBouncedIterator{contract: _ERC20SimpleSwap.contract, event: "ChequeBounced", logs: logs, sub: sub}, nil +} + +// WatchChequeBounced is a free log subscription operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. +// +// Solidity: event ChequeBounced() +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchChequeBounced(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapChequeBounced) (event.Subscription, error) { + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "ChequeBounced") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapChequeBounced) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "ChequeBounced", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChequeBounced is a log parse operation binding the contract event 0x3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc4. +// +// Solidity: event ChequeBounced() +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseChequeBounced(log types.Log) (*ERC20SimpleSwapChequeBounced, error) { + event := new(ERC20SimpleSwapChequeBounced) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "ChequeBounced", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapChequeCashedIterator is returned from FilterChequeCashed and is used to iterate over the raw logs and unpacked data for ChequeCashed events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapChequeCashedIterator struct { + Event *ERC20SimpleSwapChequeCashed // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapChequeCashedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapChequeCashed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapChequeCashed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapChequeCashedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapChequeCashedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapChequeCashed represents a ChequeCashed event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapChequeCashed struct { + Beneficiary common.Address + Recipient common.Address + Caller common.Address + TotalPayout *big.Int + CumulativePayout *big.Int + CallerPayout *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterChequeCashed is a free log retrieval operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. +// +// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterChequeCashed(opts *bind.FilterOpts, beneficiary []common.Address, recipient []common.Address, caller []common.Address) (*ERC20SimpleSwapChequeCashedIterator, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + var callerRule []interface{} + for _, callerItem := range caller { + callerRule = append(callerRule, callerItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "ChequeCashed", beneficiaryRule, recipientRule, callerRule) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapChequeCashedIterator{contract: _ERC20SimpleSwap.contract, event: "ChequeCashed", logs: logs, sub: sub}, nil +} + +// WatchChequeCashed is a free log subscription operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. +// +// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchChequeCashed(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapChequeCashed, beneficiary []common.Address, recipient []common.Address, caller []common.Address) (event.Subscription, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + var callerRule []interface{} + for _, callerItem := range caller { + callerRule = append(callerRule, callerItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "ChequeCashed", beneficiaryRule, recipientRule, callerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapChequeCashed) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "ChequeCashed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseChequeCashed is a log parse operation binding the contract event 0x950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f. +// +// Solidity: event ChequeCashed(address indexed beneficiary, address indexed recipient, address indexed caller, uint256 totalPayout, uint256 cumulativePayout, uint256 callerPayout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseChequeCashed(log types.Log) (*ERC20SimpleSwapChequeCashed, error) { + event := new(ERC20SimpleSwapChequeCashed) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "ChequeCashed", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapHardDepositAmountChangedIterator is returned from FilterHardDepositAmountChanged and is used to iterate over the raw logs and unpacked data for HardDepositAmountChanged events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositAmountChangedIterator struct { + Event *ERC20SimpleSwapHardDepositAmountChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapHardDepositAmountChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositAmountChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositAmountChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapHardDepositAmountChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapHardDepositAmountChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapHardDepositAmountChanged represents a HardDepositAmountChanged event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositAmountChanged struct { + Beneficiary common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterHardDepositAmountChanged is a free log retrieval operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. +// +// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterHardDepositAmountChanged(opts *bind.FilterOpts, beneficiary []common.Address) (*ERC20SimpleSwapHardDepositAmountChangedIterator, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "HardDepositAmountChanged", beneficiaryRule) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapHardDepositAmountChangedIterator{contract: _ERC20SimpleSwap.contract, event: "HardDepositAmountChanged", logs: logs, sub: sub}, nil +} + +// WatchHardDepositAmountChanged is a free log subscription operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. +// +// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchHardDepositAmountChanged(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapHardDepositAmountChanged, beneficiary []common.Address) (event.Subscription, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "HardDepositAmountChanged", beneficiaryRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapHardDepositAmountChanged) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositAmountChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseHardDepositAmountChanged is a log parse operation binding the contract event 0x2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad. +// +// Solidity: event HardDepositAmountChanged(address indexed beneficiary, uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseHardDepositAmountChanged(log types.Log) (*ERC20SimpleSwapHardDepositAmountChanged, error) { + event := new(ERC20SimpleSwapHardDepositAmountChanged) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositAmountChanged", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapHardDepositDecreasePreparedIterator is returned from FilterHardDepositDecreasePrepared and is used to iterate over the raw logs and unpacked data for HardDepositDecreasePrepared events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositDecreasePreparedIterator struct { + Event *ERC20SimpleSwapHardDepositDecreasePrepared // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapHardDepositDecreasePreparedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositDecreasePrepared) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositDecreasePrepared) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapHardDepositDecreasePreparedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapHardDepositDecreasePreparedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapHardDepositDecreasePrepared represents a HardDepositDecreasePrepared event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositDecreasePrepared struct { + Beneficiary common.Address + DecreaseAmount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterHardDepositDecreasePrepared is a free log retrieval operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. +// +// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterHardDepositDecreasePrepared(opts *bind.FilterOpts, beneficiary []common.Address) (*ERC20SimpleSwapHardDepositDecreasePreparedIterator, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "HardDepositDecreasePrepared", beneficiaryRule) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapHardDepositDecreasePreparedIterator{contract: _ERC20SimpleSwap.contract, event: "HardDepositDecreasePrepared", logs: logs, sub: sub}, nil +} + +// WatchHardDepositDecreasePrepared is a free log subscription operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. +// +// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchHardDepositDecreasePrepared(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapHardDepositDecreasePrepared, beneficiary []common.Address) (event.Subscription, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "HardDepositDecreasePrepared", beneficiaryRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapHardDepositDecreasePrepared) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositDecreasePrepared", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseHardDepositDecreasePrepared is a log parse operation binding the contract event 0xc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a. +// +// Solidity: event HardDepositDecreasePrepared(address indexed beneficiary, uint256 decreaseAmount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseHardDepositDecreasePrepared(log types.Log) (*ERC20SimpleSwapHardDepositDecreasePrepared, error) { + event := new(ERC20SimpleSwapHardDepositDecreasePrepared) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositDecreasePrepared", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapHardDepositTimeoutChangedIterator is returned from FilterHardDepositTimeoutChanged and is used to iterate over the raw logs and unpacked data for HardDepositTimeoutChanged events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositTimeoutChangedIterator struct { + Event *ERC20SimpleSwapHardDepositTimeoutChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapHardDepositTimeoutChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositTimeoutChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapHardDepositTimeoutChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapHardDepositTimeoutChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapHardDepositTimeoutChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapHardDepositTimeoutChanged represents a HardDepositTimeoutChanged event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapHardDepositTimeoutChanged struct { + Beneficiary common.Address + Timeout *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterHardDepositTimeoutChanged is a free log retrieval operation binding the contract event 0x7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0. +// +// Solidity: event HardDepositTimeoutChanged(address indexed beneficiary, uint256 timeout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterHardDepositTimeoutChanged(opts *bind.FilterOpts, beneficiary []common.Address) (*ERC20SimpleSwapHardDepositTimeoutChangedIterator, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "HardDepositTimeoutChanged", beneficiaryRule) + if err != nil { + return nil, err + } + return &ERC20SimpleSwapHardDepositTimeoutChangedIterator{contract: _ERC20SimpleSwap.contract, event: "HardDepositTimeoutChanged", logs: logs, sub: sub}, nil +} + +// WatchHardDepositTimeoutChanged is a free log subscription operation binding the contract event 0x7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0. +// +// Solidity: event HardDepositTimeoutChanged(address indexed beneficiary, uint256 timeout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchHardDepositTimeoutChanged(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapHardDepositTimeoutChanged, beneficiary []common.Address) (event.Subscription, error) { + + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "HardDepositTimeoutChanged", beneficiaryRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapHardDepositTimeoutChanged) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositTimeoutChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseHardDepositTimeoutChanged is a log parse operation binding the contract event 0x7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0. +// +// Solidity: event HardDepositTimeoutChanged(address indexed beneficiary, uint256 timeout) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseHardDepositTimeoutChanged(log types.Log) (*ERC20SimpleSwapHardDepositTimeoutChanged, error) { + event := new(ERC20SimpleSwapHardDepositTimeoutChanged) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "HardDepositTimeoutChanged", log); err != nil { + return nil, err + } + return event, nil +} + +// ERC20SimpleSwapWithdrawIterator is returned from FilterWithdraw and is used to iterate over the raw logs and unpacked data for Withdraw events raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapWithdrawIterator struct { + Event *ERC20SimpleSwapWithdraw // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ERC20SimpleSwapWithdrawIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapWithdraw) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ERC20SimpleSwapWithdraw) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ERC20SimpleSwapWithdrawIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC20SimpleSwapWithdrawIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC20SimpleSwapWithdraw represents a Withdraw event raised by the ERC20SimpleSwap contract. +type ERC20SimpleSwapWithdraw struct { + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdraw is a free log retrieval operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. +// +// Solidity: event Withdraw(uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) FilterWithdraw(opts *bind.FilterOpts) (*ERC20SimpleSwapWithdrawIterator, error) { + + logs, sub, err := _ERC20SimpleSwap.contract.FilterLogs(opts, "Withdraw") + if err != nil { + return nil, err + } + return &ERC20SimpleSwapWithdrawIterator{contract: _ERC20SimpleSwap.contract, event: "Withdraw", logs: logs, sub: sub}, nil +} + +// WatchWithdraw is a free log subscription operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. +// +// Solidity: event Withdraw(uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *ERC20SimpleSwapWithdraw) (event.Subscription, error) { + + logs, sub, err := _ERC20SimpleSwap.contract.WatchLogs(opts, "Withdraw") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC20SimpleSwapWithdraw) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "Withdraw", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdraw is a log parse operation binding the contract event 0x5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d. +// +// Solidity: event Withdraw(uint256 amount) +func (_ERC20SimpleSwap *ERC20SimpleSwapFilterer) ParseWithdraw(log types.Log) (*ERC20SimpleSwapWithdraw, error) { + event := new(ERC20SimpleSwapWithdraw) + if err := _ERC20SimpleSwap.contract.UnpackLog(event, "Withdraw", log); err != nil { + return nil, err + } + return event, nil +} + +// IERC20ABI is the input ABI used to generate the binding from. +const IERC20ABI = "[{\"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\":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\"}]" + +// IERC20 is an auto generated Go binding around an Ethereum contract. +type IERC20 struct { + IERC20Caller // Read-only binding to the contract + IERC20Transactor // Write-only binding to the contract + IERC20Filterer // Log filterer for contract events +} + +// IERC20Caller is an auto generated read-only Go binding around an Ethereum contract. +type IERC20Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. +type IERC20Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IERC20Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IERC20Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IERC20Session struct { + Contract *IERC20 // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IERC20CallerSession struct { + Contract *IERC20Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IERC20TransactorSession struct { + Contract *IERC20Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IERC20Raw is an auto generated low-level Go binding around an Ethereum contract. +type IERC20Raw struct { + Contract *IERC20 // Generic contract binding to access the raw methods on +} + +// IERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IERC20CallerRaw struct { + Contract *IERC20Caller // Generic read-only contract binding to access the raw methods on +} + +// IERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IERC20TransactorRaw struct { + Contract *IERC20Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewIERC20 creates a new instance of IERC20, bound to a specific deployed contract. +func NewIERC20(address common.Address, backend bind.ContractBackend) (*IERC20, error) { + contract, err := bindIERC20(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IERC20{IERC20Caller: IERC20Caller{contract: contract}, IERC20Transactor: IERC20Transactor{contract: contract}, IERC20Filterer: IERC20Filterer{contract: contract}}, nil +} + +// NewIERC20Caller creates a new read-only instance of IERC20, bound to a specific deployed contract. +func NewIERC20Caller(address common.Address, caller bind.ContractCaller) (*IERC20Caller, error) { + contract, err := bindIERC20(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IERC20Caller{contract: contract}, nil +} + +// NewIERC20Transactor creates a new write-only instance of IERC20, bound to a specific deployed contract. +func NewIERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*IERC20Transactor, error) { + contract, err := bindIERC20(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IERC20Transactor{contract: contract}, nil +} + +// NewIERC20Filterer creates a new log filterer instance of IERC20, bound to a specific deployed contract. +func NewIERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*IERC20Filterer, error) { + contract, err := bindIERC20(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IERC20Filterer{contract: contract}, nil +} + +// bindIERC20 binds a generic wrapper to an already deployed contract. +func bindIERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(IERC20ABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IERC20 *IERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _IERC20.Contract.IERC20Caller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IERC20 *IERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IERC20.Contract.IERC20Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IERC20 *IERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IERC20.Contract.IERC20Transactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IERC20 *IERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _IERC20.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IERC20 *IERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IERC20.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IERC20 *IERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IERC20.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_IERC20 *IERC20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _IERC20.contract.Call(opts, out, "allowance", owner, spender) + return *ret0, err +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_IERC20 *IERC20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _IERC20.Contract.Allowance(&_IERC20.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_IERC20 *IERC20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _IERC20.Contract.Allowance(&_IERC20.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_IERC20 *IERC20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _IERC20.contract.Call(opts, out, "balanceOf", account) + return *ret0, err +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_IERC20 *IERC20Session) BalanceOf(account common.Address) (*big.Int, error) { + return _IERC20.Contract.BalanceOf(&_IERC20.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_IERC20 *IERC20CallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _IERC20.Contract.BalanceOf(&_IERC20.CallOpts, account) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_IERC20 *IERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _IERC20.contract.Call(opts, out, "totalSupply") + return *ret0, err +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_IERC20 *IERC20Session) TotalSupply() (*big.Int, error) { + return _IERC20.Contract.TotalSupply(&_IERC20.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() constant returns(uint256) +func (_IERC20 *IERC20CallerSession) TotalSupply() (*big.Int, error) { + return _IERC20.Contract.TotalSupply(&_IERC20.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_IERC20 *IERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_IERC20 *IERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_IERC20 *IERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20Transactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.contract.Transact(opts, "transfer", recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20Session) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.Transfer(&_IERC20.TransactOpts, recipient, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20TransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.Transfer(&_IERC20.TransactOpts, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20Transactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.contract.Transact(opts, "transferFrom", sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20Session) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.TransferFrom(&_IERC20.TransactOpts, sender, recipient, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_IERC20 *IERC20TransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IERC20.Contract.TransferFrom(&_IERC20.TransactOpts, sender, recipient, amount) +} + +// IERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the IERC20 contract. +type IERC20ApprovalIterator struct { + Event *IERC20Approval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IERC20ApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IERC20Approval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IERC20ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IERC20ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IERC20Approval represents a Approval event raised by the IERC20 contract. +type IERC20Approval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_IERC20 *IERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*IERC20ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _IERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &IERC20ApprovalIterator{contract: _IERC20.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_IERC20 *IERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *IERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _IERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IERC20Approval) + if err := _IERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_IERC20 *IERC20Filterer) ParseApproval(log types.Log) (*IERC20Approval, error) { + event := new(IERC20Approval) + if err := _IERC20.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + return event, nil +} + +// IERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the IERC20 contract. +type IERC20TransferIterator struct { + Event *IERC20Transfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IERC20TransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IERC20Transfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IERC20TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IERC20TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IERC20Transfer represents a Transfer event raised by the IERC20 contract. +type IERC20Transfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_IERC20 *IERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*IERC20TransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _IERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &IERC20TransferIterator{contract: _IERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_IERC20 *IERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *IERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _IERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IERC20Transfer) + if err := _IERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_IERC20 *IERC20Filterer) ParseTransfer(log types.Log) (*IERC20Transfer, error) { + event := new(IERC20Transfer) + if err := _IERC20.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + return event, nil +} + +// MathABI is the input ABI used to generate the binding from. +const MathABI = "[]" + +// MathBin is the compiled bytecode used for deploying new contracts. +var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582000a7fe8f11c52b79f03af2d1ee3eb200d3fd399e2d019af8439d5bba62f64c0964736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(MathABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MathBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Math{MathCaller: MathCaller{contract: contract}, MathTransactor: MathTransactor{contract: contract}, MathFilterer: MathFilterer{contract: contract}}, nil +} + +// Math is an auto generated Go binding around an Ethereum contract. +type Math struct { + MathCaller // Read-only binding to the contract + MathTransactor // Write-only binding to the contract + MathFilterer // Log filterer for contract events +} + +// MathCaller is an auto generated read-only Go binding around an Ethereum contract. +type MathCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MathTransactor is an auto generated write-only Go binding around an Ethereum contract. +type MathTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MathFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MathFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MathSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MathSession struct { + Contract *Math // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MathCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MathCallerSession struct { + Contract *MathCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MathTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MathTransactorSession struct { + Contract *MathTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MathRaw is an auto generated low-level Go binding around an Ethereum contract. +type MathRaw struct { + Contract *Math // Generic contract binding to access the raw methods on +} + +// MathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MathCallerRaw struct { + Contract *MathCaller // Generic read-only contract binding to access the raw methods on +} + +// MathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MathTransactorRaw struct { + Contract *MathTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewMath creates a new instance of Math, bound to a specific deployed contract. +func NewMath(address common.Address, backend bind.ContractBackend) (*Math, error) { + contract, err := bindMath(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Math{MathCaller: MathCaller{contract: contract}, MathTransactor: MathTransactor{contract: contract}, MathFilterer: MathFilterer{contract: contract}}, nil +} + +// NewMathCaller creates a new read-only instance of Math, bound to a specific deployed contract. +func NewMathCaller(address common.Address, caller bind.ContractCaller) (*MathCaller, error) { + contract, err := bindMath(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MathCaller{contract: contract}, nil +} + +// NewMathTransactor creates a new write-only instance of Math, bound to a specific deployed contract. +func NewMathTransactor(address common.Address, transactor bind.ContractTransactor) (*MathTransactor, error) { + contract, err := bindMath(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MathTransactor{contract: contract}, nil +} + +// NewMathFilterer creates a new log filterer instance of Math, bound to a specific deployed contract. +func NewMathFilterer(address common.Address, filterer bind.ContractFilterer) (*MathFilterer, error) { + contract, err := bindMath(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MathFilterer{contract: contract}, nil +} + +// bindMath binds a generic wrapper to an already deployed contract. +func bindMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(MathABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Math *MathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Math.Contract.MathCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Math *MathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Math.Contract.MathTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Math *MathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Math.Contract.MathTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Math *MathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Math.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Math *MathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Math.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Math *MathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Math.Contract.contract.Transact(opts, method, params...) +} + +// MinterRoleABI is the input ABI used to generate the binding from. +const MinterRoleABI = "[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addMinter\",\"outputs\":[],\"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\":[],\"name\":\"renounceMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + +// MinterRole is an auto generated Go binding around an Ethereum contract. +type MinterRole struct { + MinterRoleCaller // Read-only binding to the contract + MinterRoleTransactor // Write-only binding to the contract + MinterRoleFilterer // Log filterer for contract events +} + +// MinterRoleCaller is an auto generated read-only Go binding around an Ethereum contract. +type MinterRoleCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MinterRoleTransactor is an auto generated write-only Go binding around an Ethereum contract. +type MinterRoleTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MinterRoleFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MinterRoleFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MinterRoleSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MinterRoleSession struct { + Contract *MinterRole // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MinterRoleCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MinterRoleCallerSession struct { + Contract *MinterRoleCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MinterRoleTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MinterRoleTransactorSession struct { + Contract *MinterRoleTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MinterRoleRaw is an auto generated low-level Go binding around an Ethereum contract. +type MinterRoleRaw struct { + Contract *MinterRole // Generic contract binding to access the raw methods on +} + +// MinterRoleCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MinterRoleCallerRaw struct { + Contract *MinterRoleCaller // Generic read-only contract binding to access the raw methods on +} + +// MinterRoleTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MinterRoleTransactorRaw struct { + Contract *MinterRoleTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewMinterRole creates a new instance of MinterRole, bound to a specific deployed contract. +func NewMinterRole(address common.Address, backend bind.ContractBackend) (*MinterRole, error) { + contract, err := bindMinterRole(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MinterRole{MinterRoleCaller: MinterRoleCaller{contract: contract}, MinterRoleTransactor: MinterRoleTransactor{contract: contract}, MinterRoleFilterer: MinterRoleFilterer{contract: contract}}, nil +} + +// NewMinterRoleCaller creates a new read-only instance of MinterRole, bound to a specific deployed contract. +func NewMinterRoleCaller(address common.Address, caller bind.ContractCaller) (*MinterRoleCaller, error) { + contract, err := bindMinterRole(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MinterRoleCaller{contract: contract}, nil +} + +// NewMinterRoleTransactor creates a new write-only instance of MinterRole, bound to a specific deployed contract. +func NewMinterRoleTransactor(address common.Address, transactor bind.ContractTransactor) (*MinterRoleTransactor, error) { + contract, err := bindMinterRole(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MinterRoleTransactor{contract: contract}, nil +} + +// NewMinterRoleFilterer creates a new log filterer instance of MinterRole, bound to a specific deployed contract. +func NewMinterRoleFilterer(address common.Address, filterer bind.ContractFilterer) (*MinterRoleFilterer, error) { + contract, err := bindMinterRole(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MinterRoleFilterer{contract: contract}, nil +} + +// bindMinterRole binds a generic wrapper to an already deployed contract. +func bindMinterRole(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(MinterRoleABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MinterRole *MinterRoleRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _MinterRole.Contract.MinterRoleCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MinterRole *MinterRoleRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MinterRole.Contract.MinterRoleTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MinterRole *MinterRoleRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MinterRole.Contract.MinterRoleTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MinterRole *MinterRoleCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _MinterRole.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MinterRole *MinterRoleTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MinterRole.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MinterRole *MinterRoleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MinterRole.Contract.contract.Transact(opts, method, params...) +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_MinterRole *MinterRoleCaller) IsMinter(opts *bind.CallOpts, account common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _MinterRole.contract.Call(opts, out, "isMinter", account) + return *ret0, err +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_MinterRole *MinterRoleSession) IsMinter(account common.Address) (bool, error) { + return _MinterRole.Contract.IsMinter(&_MinterRole.CallOpts, account) +} + +// IsMinter is a free data retrieval call binding the contract method 0xaa271e1a. +// +// Solidity: function isMinter(address account) constant returns(bool) +func (_MinterRole *MinterRoleCallerSession) IsMinter(account common.Address) (bool, error) { + return _MinterRole.Contract.IsMinter(&_MinterRole.CallOpts, account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_MinterRole *MinterRoleTransactor) AddMinter(opts *bind.TransactOpts, account common.Address) (*types.Transaction, error) { + return _MinterRole.contract.Transact(opts, "addMinter", account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_MinterRole *MinterRoleSession) AddMinter(account common.Address) (*types.Transaction, error) { + return _MinterRole.Contract.AddMinter(&_MinterRole.TransactOpts, account) +} + +// AddMinter is a paid mutator transaction binding the contract method 0x983b2d56. +// +// Solidity: function addMinter(address account) returns() +func (_MinterRole *MinterRoleTransactorSession) AddMinter(account common.Address) (*types.Transaction, error) { + return _MinterRole.Contract.AddMinter(&_MinterRole.TransactOpts, account) +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_MinterRole *MinterRoleTransactor) RenounceMinter(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MinterRole.contract.Transact(opts, "renounceMinter") +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_MinterRole *MinterRoleSession) RenounceMinter() (*types.Transaction, error) { + return _MinterRole.Contract.RenounceMinter(&_MinterRole.TransactOpts) +} + +// RenounceMinter is a paid mutator transaction binding the contract method 0x98650275. +// +// Solidity: function renounceMinter() returns() +func (_MinterRole *MinterRoleTransactorSession) RenounceMinter() (*types.Transaction, error) { + return _MinterRole.Contract.RenounceMinter(&_MinterRole.TransactOpts) +} + +// MinterRoleMinterAddedIterator is returned from FilterMinterAdded and is used to iterate over the raw logs and unpacked data for MinterAdded events raised by the MinterRole contract. +type MinterRoleMinterAddedIterator struct { + Event *MinterRoleMinterAdded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *MinterRoleMinterAddedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(MinterRoleMinterAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(MinterRoleMinterAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *MinterRoleMinterAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MinterRoleMinterAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MinterRoleMinterAdded represents a MinterAdded event raised by the MinterRole contract. +type MinterRoleMinterAdded struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMinterAdded is a free log retrieval operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_MinterRole *MinterRoleFilterer) FilterMinterAdded(opts *bind.FilterOpts, account []common.Address) (*MinterRoleMinterAddedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _MinterRole.contract.FilterLogs(opts, "MinterAdded", accountRule) + if err != nil { + return nil, err + } + return &MinterRoleMinterAddedIterator{contract: _MinterRole.contract, event: "MinterAdded", logs: logs, sub: sub}, nil +} + +// WatchMinterAdded is a free log subscription operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_MinterRole *MinterRoleFilterer) WatchMinterAdded(opts *bind.WatchOpts, sink chan<- *MinterRoleMinterAdded, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _MinterRole.contract.WatchLogs(opts, "MinterAdded", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(MinterRoleMinterAdded) + if err := _MinterRole.contract.UnpackLog(event, "MinterAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMinterAdded is a log parse operation binding the contract event 0x6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f6. +// +// Solidity: event MinterAdded(address indexed account) +func (_MinterRole *MinterRoleFilterer) ParseMinterAdded(log types.Log) (*MinterRoleMinterAdded, error) { + event := new(MinterRoleMinterAdded) + if err := _MinterRole.contract.UnpackLog(event, "MinterAdded", log); err != nil { + return nil, err + } + return event, nil +} + +// MinterRoleMinterRemovedIterator is returned from FilterMinterRemoved and is used to iterate over the raw logs and unpacked data for MinterRemoved events raised by the MinterRole contract. +type MinterRoleMinterRemovedIterator struct { + Event *MinterRoleMinterRemoved // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *MinterRoleMinterRemovedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(MinterRoleMinterRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(MinterRoleMinterRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *MinterRoleMinterRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MinterRoleMinterRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MinterRoleMinterRemoved represents a MinterRemoved event raised by the MinterRole contract. +type MinterRoleMinterRemoved struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMinterRemoved is a free log retrieval operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_MinterRole *MinterRoleFilterer) FilterMinterRemoved(opts *bind.FilterOpts, account []common.Address) (*MinterRoleMinterRemovedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _MinterRole.contract.FilterLogs(opts, "MinterRemoved", accountRule) + if err != nil { + return nil, err + } + return &MinterRoleMinterRemovedIterator{contract: _MinterRole.contract, event: "MinterRemoved", logs: logs, sub: sub}, nil +} + +// WatchMinterRemoved is a free log subscription operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_MinterRole *MinterRoleFilterer) WatchMinterRemoved(opts *bind.WatchOpts, sink chan<- *MinterRoleMinterRemoved, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _MinterRole.contract.WatchLogs(opts, "MinterRemoved", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(MinterRoleMinterRemoved) + if err := _MinterRole.contract.UnpackLog(event, "MinterRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMinterRemoved is a log parse operation binding the contract event 0xe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb66692. +// +// Solidity: event MinterRemoved(address indexed account) +func (_MinterRole *MinterRoleFilterer) ParseMinterRemoved(log types.Log) (*MinterRoleMinterRemoved, error) { + event := new(MinterRoleMinterRemoved) + if err := _MinterRole.contract.UnpackLog(event, "MinterRemoved", log); err != nil { + return nil, err + } + return event, nil +} + +// RolesABI is the input ABI used to generate the binding from. +const RolesABI = "[]" + +// RolesBin is the compiled bytecode used for deploying new contracts. +var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158209a68d01e8b2b237a89fef9b2aa16f6200a28b6f0cb4b41af99c6e125cf59ef1e64736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(RolesABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(RolesBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Roles{RolesCaller: RolesCaller{contract: contract}, RolesTransactor: RolesTransactor{contract: contract}, RolesFilterer: RolesFilterer{contract: contract}}, nil +} + +// Roles is an auto generated Go binding around an Ethereum contract. +type Roles struct { + RolesCaller // Read-only binding to the contract + RolesTransactor // Write-only binding to the contract + RolesFilterer // Log filterer for contract events +} + +// RolesCaller is an auto generated read-only Go binding around an Ethereum contract. +type RolesCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RolesTransactor is an auto generated write-only Go binding around an Ethereum contract. +type RolesTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RolesFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type RolesFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RolesSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type RolesSession struct { + Contract *Roles // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// RolesCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type RolesCallerSession struct { + Contract *RolesCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// RolesTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type RolesTransactorSession struct { + Contract *RolesTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// RolesRaw is an auto generated low-level Go binding around an Ethereum contract. +type RolesRaw struct { + Contract *Roles // Generic contract binding to access the raw methods on +} + +// RolesCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type RolesCallerRaw struct { + Contract *RolesCaller // Generic read-only contract binding to access the raw methods on +} + +// RolesTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type RolesTransactorRaw struct { + Contract *RolesTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewRoles creates a new instance of Roles, bound to a specific deployed contract. +func NewRoles(address common.Address, backend bind.ContractBackend) (*Roles, error) { + contract, err := bindRoles(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Roles{RolesCaller: RolesCaller{contract: contract}, RolesTransactor: RolesTransactor{contract: contract}, RolesFilterer: RolesFilterer{contract: contract}}, nil +} + +// NewRolesCaller creates a new read-only instance of Roles, bound to a specific deployed contract. +func NewRolesCaller(address common.Address, caller bind.ContractCaller) (*RolesCaller, error) { + contract, err := bindRoles(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &RolesCaller{contract: contract}, nil +} + +// NewRolesTransactor creates a new write-only instance of Roles, bound to a specific deployed contract. +func NewRolesTransactor(address common.Address, transactor bind.ContractTransactor) (*RolesTransactor, error) { + contract, err := bindRoles(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &RolesTransactor{contract: contract}, nil +} + +// NewRolesFilterer creates a new log filterer instance of Roles, bound to a specific deployed contract. +func NewRolesFilterer(address common.Address, filterer bind.ContractFilterer) (*RolesFilterer, error) { + contract, err := bindRoles(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &RolesFilterer{contract: contract}, nil +} + +// bindRoles binds a generic wrapper to an already deployed contract. +func bindRoles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(RolesABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Roles *RolesRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Roles.Contract.RolesCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Roles *RolesRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Roles.Contract.RolesTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Roles *RolesRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Roles.Contract.RolesTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Roles *RolesCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Roles.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Roles *RolesTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Roles.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Roles *RolesTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Roles.Contract.contract.Transact(opts, method, params...) +} + +// SafeMathABI is the input ABI used to generate the binding from. +const SafeMathABI = "[]" + +// SafeMathBin is the compiled bytecode used for deploying new contracts. +var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820044a15379c034d2be95cff236f2765160889caff1b82a6d65660cc33f8505af664736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SafeMathBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil +} + +// SafeMath is an auto generated Go binding around an Ethereum contract. +type SafeMath struct { + SafeMathCaller // Read-only binding to the contract + SafeMathTransactor // Write-only binding to the contract + SafeMathFilterer // Log filterer for contract events +} + +// SafeMathCaller is an auto generated read-only Go binding around an Ethereum contract. +type SafeMathCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeMathTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SafeMathTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeMathFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SafeMathFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SafeMathSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SafeMathSession struct { + Contract *SafeMath // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeMathCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SafeMathCallerSession struct { + Contract *SafeMathCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SafeMathTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SafeMathTransactorSession struct { + Contract *SafeMathTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SafeMathRaw is an auto generated low-level Go binding around an Ethereum contract. +type SafeMathRaw struct { + Contract *SafeMath // Generic contract binding to access the raw methods on +} + +// SafeMathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SafeMathCallerRaw struct { + Contract *SafeMathCaller // Generic read-only contract binding to access the raw methods on +} + +// SafeMathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SafeMathTransactorRaw struct { + Contract *SafeMathTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSafeMath creates a new instance of SafeMath, bound to a specific deployed contract. +func NewSafeMath(address common.Address, backend bind.ContractBackend) (*SafeMath, error) { + contract, err := bindSafeMath(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil +} + +// NewSafeMathCaller creates a new read-only instance of SafeMath, bound to a specific deployed contract. +func NewSafeMathCaller(address common.Address, caller bind.ContractCaller) (*SafeMathCaller, error) { + contract, err := bindSafeMath(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SafeMathCaller{contract: contract}, nil +} + +// NewSafeMathTransactor creates a new write-only instance of SafeMath, bound to a specific deployed contract. +func NewSafeMathTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeMathTransactor, error) { + contract, err := bindSafeMath(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SafeMathTransactor{contract: contract}, nil +} + +// NewSafeMathFilterer creates a new log filterer instance of SafeMath, bound to a specific deployed contract. +func NewSafeMathFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeMathFilterer, error) { + contract, err := bindSafeMath(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SafeMathFilterer{contract: contract}, nil +} + +// bindSafeMath binds a generic wrapper to an already deployed contract. +func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeMath *SafeMathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeMath.Contract.SafeMathTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeMath.Contract.SafeMathTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _SafeMath.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SafeMath *SafeMathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SafeMath.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SafeMath *SafeMathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SafeMath.Contract.contract.Transact(opts, method, params...) +} + +// SimpleSwapFactoryABI is the input ABI used to generate the binding from. +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 = "0x608060405234801561001057600080fd5b506040516127093803806127098339818101604052602081101561003357600080fd5b810190808051906020019092919050505080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050612674806100956000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace146100d4578063c70242ad1461011e575b600080fd5b6100926004803603604081101561005c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061017a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100dc610301565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101606004803603602081101561013457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610327565b604051808215151515815260200191505060405180910390f35b60008083600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516101ae90610347565b808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051809103906000f08015801561023a573d6000803e3d6000fd5b50905060016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00481604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18091505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006020528060005260406000206000915054906101000a900460ff1681565b6122eb806103558339019056fe608060405234801561001057600080fd5b506040516122eb3803806122eb8339818101604052606081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806000819055505050506121f8806100f36000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032a265627a7a72315820bfdcb3c4bb558adb9e8c3072b91d763f9e5b62aad72502d95e326660aaa3cbb364736f6c634300050d0032" + +// 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) { + parsed, err := abi.JSON(strings.NewReader(SimpleSwapFactoryABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SimpleSwapFactoryBin), backend, _ERC20Address) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SimpleSwapFactory{SimpleSwapFactoryCaller: SimpleSwapFactoryCaller{contract: contract}, SimpleSwapFactoryTransactor: SimpleSwapFactoryTransactor{contract: contract}, SimpleSwapFactoryFilterer: SimpleSwapFactoryFilterer{contract: contract}}, nil +} + +// SimpleSwapFactory is an auto generated Go binding around an Ethereum contract. +type SimpleSwapFactory struct { + SimpleSwapFactoryCaller // Read-only binding to the contract + SimpleSwapFactoryTransactor // Write-only binding to the contract + SimpleSwapFactoryFilterer // Log filterer for contract events +} + +// SimpleSwapFactoryCaller is an auto generated read-only Go binding around an Ethereum contract. +type SimpleSwapFactoryCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SimpleSwapFactoryTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SimpleSwapFactoryTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SimpleSwapFactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SimpleSwapFactoryFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SimpleSwapFactorySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SimpleSwapFactorySession struct { + Contract *SimpleSwapFactory // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SimpleSwapFactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SimpleSwapFactoryCallerSession struct { + Contract *SimpleSwapFactoryCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SimpleSwapFactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SimpleSwapFactoryTransactorSession struct { + Contract *SimpleSwapFactoryTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SimpleSwapFactoryRaw is an auto generated low-level Go binding around an Ethereum contract. +type SimpleSwapFactoryRaw struct { + Contract *SimpleSwapFactory // Generic contract binding to access the raw methods on +} + +// SimpleSwapFactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SimpleSwapFactoryCallerRaw struct { + Contract *SimpleSwapFactoryCaller // Generic read-only contract binding to access the raw methods on +} + +// SimpleSwapFactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SimpleSwapFactoryTransactorRaw struct { + Contract *SimpleSwapFactoryTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSimpleSwapFactory creates a new instance of SimpleSwapFactory, bound to a specific deployed contract. +func NewSimpleSwapFactory(address common.Address, backend bind.ContractBackend) (*SimpleSwapFactory, error) { + contract, err := bindSimpleSwapFactory(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SimpleSwapFactory{SimpleSwapFactoryCaller: SimpleSwapFactoryCaller{contract: contract}, SimpleSwapFactoryTransactor: SimpleSwapFactoryTransactor{contract: contract}, SimpleSwapFactoryFilterer: SimpleSwapFactoryFilterer{contract: contract}}, nil +} + +// NewSimpleSwapFactoryCaller creates a new read-only instance of SimpleSwapFactory, bound to a specific deployed contract. +func NewSimpleSwapFactoryCaller(address common.Address, caller bind.ContractCaller) (*SimpleSwapFactoryCaller, error) { + contract, err := bindSimpleSwapFactory(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SimpleSwapFactoryCaller{contract: contract}, nil +} + +// NewSimpleSwapFactoryTransactor creates a new write-only instance of SimpleSwapFactory, bound to a specific deployed contract. +func NewSimpleSwapFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*SimpleSwapFactoryTransactor, error) { + contract, err := bindSimpleSwapFactory(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SimpleSwapFactoryTransactor{contract: contract}, nil +} + +// NewSimpleSwapFactoryFilterer creates a new log filterer instance of SimpleSwapFactory, bound to a specific deployed contract. +func NewSimpleSwapFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*SimpleSwapFactoryFilterer, error) { + contract, err := bindSimpleSwapFactory(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SimpleSwapFactoryFilterer{contract: contract}, nil +} + +// bindSimpleSwapFactory binds a generic wrapper to an already deployed contract. +func bindSimpleSwapFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(SimpleSwapFactoryABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SimpleSwapFactory *SimpleSwapFactoryRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _SimpleSwapFactory.Contract.SimpleSwapFactoryCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SimpleSwapFactory *SimpleSwapFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SimpleSwapFactory.Contract.SimpleSwapFactoryTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SimpleSwapFactory *SimpleSwapFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SimpleSwapFactory.Contract.SimpleSwapFactoryTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SimpleSwapFactory *SimpleSwapFactoryCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _SimpleSwapFactory.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SimpleSwapFactory *SimpleSwapFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SimpleSwapFactory.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SimpleSwapFactory *SimpleSwapFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SimpleSwapFactory.Contract.contract.Transact(opts, method, params...) +} + +// ERC20Address is a free data retrieval call binding the contract method 0xa6021ace. +// +// Solidity: function ERC20Address() constant returns(address) +func (_SimpleSwapFactory *SimpleSwapFactoryCaller) ERC20Address(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _SimpleSwapFactory.contract.Call(opts, out, "ERC20Address") + return *ret0, err +} + +// ERC20Address is a free data retrieval call binding the contract method 0xa6021ace. +// +// Solidity: function ERC20Address() constant returns(address) +func (_SimpleSwapFactory *SimpleSwapFactorySession) ERC20Address() (common.Address, error) { + return _SimpleSwapFactory.Contract.ERC20Address(&_SimpleSwapFactory.CallOpts) +} + +// ERC20Address is a free data retrieval call binding the contract method 0xa6021ace. +// +// Solidity: function ERC20Address() constant returns(address) +func (_SimpleSwapFactory *SimpleSwapFactoryCallerSession) ERC20Address() (common.Address, error) { + return _SimpleSwapFactory.Contract.ERC20Address(&_SimpleSwapFactory.CallOpts) +} + +// DeployedContracts is a free data retrieval call binding the contract method 0xc70242ad. +// +// Solidity: function deployedContracts(address ) constant returns(bool) +func (_SimpleSwapFactory *SimpleSwapFactoryCaller) DeployedContracts(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _SimpleSwapFactory.contract.Call(opts, out, "deployedContracts", arg0) + return *ret0, err +} + +// DeployedContracts is a free data retrieval call binding the contract method 0xc70242ad. +// +// Solidity: function deployedContracts(address ) constant returns(bool) +func (_SimpleSwapFactory *SimpleSwapFactorySession) DeployedContracts(arg0 common.Address) (bool, error) { + return _SimpleSwapFactory.Contract.DeployedContracts(&_SimpleSwapFactory.CallOpts, arg0) +} + +// DeployedContracts is a free data retrieval call binding the contract method 0xc70242ad. +// +// Solidity: function deployedContracts(address ) constant returns(bool) +func (_SimpleSwapFactory *SimpleSwapFactoryCallerSession) DeployedContracts(arg0 common.Address) (bool, error) { + return _SimpleSwapFactory.Contract.DeployedContracts(&_SimpleSwapFactory.CallOpts, arg0) +} + +// DeploySimpleSwap is a paid mutator transaction binding the contract method 0x576d7271. +// +// Solidity: function deploySimpleSwap(address issuer, uint256 defaultHardDepositTimeoutDuration) returns(address) +func (_SimpleSwapFactory *SimpleSwapFactoryTransactor) DeploySimpleSwap(opts *bind.TransactOpts, issuer common.Address, defaultHardDepositTimeoutDuration *big.Int) (*types.Transaction, error) { + return _SimpleSwapFactory.contract.Transact(opts, "deploySimpleSwap", issuer, defaultHardDepositTimeoutDuration) +} + +// DeploySimpleSwap is a paid mutator transaction binding the contract method 0x576d7271. +// +// Solidity: function deploySimpleSwap(address issuer, uint256 defaultHardDepositTimeoutDuration) returns(address) +func (_SimpleSwapFactory *SimpleSwapFactorySession) DeploySimpleSwap(issuer common.Address, defaultHardDepositTimeoutDuration *big.Int) (*types.Transaction, error) { + return _SimpleSwapFactory.Contract.DeploySimpleSwap(&_SimpleSwapFactory.TransactOpts, issuer, defaultHardDepositTimeoutDuration) +} + +// DeploySimpleSwap is a paid mutator transaction binding the contract method 0x576d7271. +// +// Solidity: function deploySimpleSwap(address issuer, uint256 defaultHardDepositTimeoutDuration) returns(address) +func (_SimpleSwapFactory *SimpleSwapFactoryTransactorSession) DeploySimpleSwap(issuer common.Address, defaultHardDepositTimeoutDuration *big.Int) (*types.Transaction, error) { + return _SimpleSwapFactory.Contract.DeploySimpleSwap(&_SimpleSwapFactory.TransactOpts, issuer, defaultHardDepositTimeoutDuration) +} + +// SimpleSwapFactorySimpleSwapDeployedIterator is returned from FilterSimpleSwapDeployed and is used to iterate over the raw logs and unpacked data for SimpleSwapDeployed events raised by the SimpleSwapFactory contract. +type SimpleSwapFactorySimpleSwapDeployedIterator struct { + Event *SimpleSwapFactorySimpleSwapDeployed // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SimpleSwapFactorySimpleSwapDeployedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SimpleSwapFactorySimpleSwapDeployed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SimpleSwapFactorySimpleSwapDeployed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SimpleSwapFactorySimpleSwapDeployedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SimpleSwapFactorySimpleSwapDeployedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SimpleSwapFactorySimpleSwapDeployed represents a SimpleSwapDeployed event raised by the SimpleSwapFactory contract. +type SimpleSwapFactorySimpleSwapDeployed struct { + ContractAddress common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSimpleSwapDeployed is a free log retrieval operation binding the contract event 0xc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c004. +// +// Solidity: event SimpleSwapDeployed(address contractAddress) +func (_SimpleSwapFactory *SimpleSwapFactoryFilterer) FilterSimpleSwapDeployed(opts *bind.FilterOpts) (*SimpleSwapFactorySimpleSwapDeployedIterator, error) { + + logs, sub, err := _SimpleSwapFactory.contract.FilterLogs(opts, "SimpleSwapDeployed") + if err != nil { + return nil, err + } + return &SimpleSwapFactorySimpleSwapDeployedIterator{contract: _SimpleSwapFactory.contract, event: "SimpleSwapDeployed", logs: logs, sub: sub}, nil +} + +// WatchSimpleSwapDeployed is a free log subscription operation binding the contract event 0xc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c004. +// +// Solidity: event SimpleSwapDeployed(address contractAddress) +func (_SimpleSwapFactory *SimpleSwapFactoryFilterer) WatchSimpleSwapDeployed(opts *bind.WatchOpts, sink chan<- *SimpleSwapFactorySimpleSwapDeployed) (event.Subscription, error) { + + logs, sub, err := _SimpleSwapFactory.contract.WatchLogs(opts, "SimpleSwapDeployed") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SimpleSwapFactorySimpleSwapDeployed) + if err := _SimpleSwapFactory.contract.UnpackLog(event, "SimpleSwapDeployed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSimpleSwapDeployed is a log parse operation binding the contract event 0xc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c004. +// +// Solidity: event SimpleSwapDeployed(address contractAddress) +func (_SimpleSwapFactory *SimpleSwapFactoryFilterer) ParseSimpleSwapDeployed(log types.Log) (*SimpleSwapFactorySimpleSwapDeployed, error) { + event := new(SimpleSwapFactorySimpleSwapDeployed) + if err := _SimpleSwapFactory.contract.UnpackLog(event, "SimpleSwapDeployed", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/vendor/golang.org/x/net/html/atom/gen.go b/vendor/golang.org/x/net/html/atom/gen.go deleted file mode 100644 index 5d052781bc..0000000000 --- a/vendor/golang.org/x/net/html/atom/gen.go +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -//go:generate go run gen.go -//go:generate go run gen.go -test - -package main - -import ( - "bytes" - "flag" - "fmt" - "go/format" - "io/ioutil" - "math/rand" - "os" - "sort" - "strings" -) - -// identifier converts s to a Go exported identifier. -// It converts "div" to "Div" and "accept-charset" to "AcceptCharset". -func identifier(s string) string { - b := make([]byte, 0, len(s)) - cap := true - for _, c := range s { - if c == '-' { - cap = true - continue - } - if cap && 'a' <= c && c <= 'z' { - c -= 'a' - 'A' - } - cap = false - b = append(b, byte(c)) - } - return string(b) -} - -var test = flag.Bool("test", false, "generate table_test.go") - -func genFile(name string, buf *bytes.Buffer) { - b, err := format.Source(buf.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - if err := ioutil.WriteFile(name, b, 0644); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } -} - -func main() { - flag.Parse() - - var all []string - all = append(all, elements...) - all = append(all, attributes...) - all = append(all, eventHandlers...) - all = append(all, extra...) - sort.Strings(all) - - // uniq - lists have dups - w := 0 - for _, s := range all { - if w == 0 || all[w-1] != s { - all[w] = s - w++ - } - } - all = all[:w] - - if *test { - var buf bytes.Buffer - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go -test\n") - fmt.Fprintln(&buf, "package atom\n") - fmt.Fprintln(&buf, "var testAtomList = []string{") - for _, s := range all { - fmt.Fprintf(&buf, "\t%q,\n", s) - } - fmt.Fprintln(&buf, "}") - - genFile("table_test.go", &buf) - return - } - - // Find hash that minimizes table size. - var best *table - for i := 0; i < 1000000; i++ { - if best != nil && 1<<(best.k-1) < len(all) { - break - } - h := rand.Uint32() - for k := uint(0); k <= 16; k++ { - if best != nil && k >= best.k { - break - } - var t table - if t.init(h, k, all) { - best = &t - break - } - } - } - if best == nil { - fmt.Fprintf(os.Stderr, "failed to construct string table\n") - os.Exit(1) - } - - // Lay out strings, using overlaps when possible. - layout := append([]string{}, all...) - - // Remove strings that are substrings of other strings - for changed := true; changed; { - changed = false - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i != j && t != "" && strings.Contains(s, t) { - changed = true - layout[j] = "" - } - } - } - } - - // Join strings where one suffix matches another prefix. - for { - // Find best i, j, k such that layout[i][len-k:] == layout[j][:k], - // maximizing overlap length k. - besti := -1 - bestj := -1 - bestk := 0 - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i == j { - continue - } - for k := bestk + 1; k <= len(s) && k <= len(t); k++ { - if s[len(s)-k:] == t[:k] { - besti = i - bestj = j - bestk = k - } - } - } - } - if bestk > 0 { - layout[besti] += layout[bestj][bestk:] - layout[bestj] = "" - continue - } - break - } - - text := strings.Join(layout, "") - - atom := map[string]uint32{} - for _, s := range all { - off := strings.Index(text, s) - if off < 0 { - panic("lost string " + s) - } - atom[s] = uint32(off<<8 | len(s)) - } - - var buf bytes.Buffer - // Generate the Go code. - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go\n") - fmt.Fprintln(&buf, "package atom\n\nconst (") - - // compute max len - maxLen := 0 - for _, s := range all { - if maxLen < len(s) { - maxLen = len(s) - } - fmt.Fprintf(&buf, "\t%s Atom = %#x\n", identifier(s), atom[s]) - } - fmt.Fprintln(&buf, ")\n") - - fmt.Fprintf(&buf, "const hash0 = %#x\n\n", best.h0) - fmt.Fprintf(&buf, "const maxAtomLen = %d\n\n", maxLen) - - fmt.Fprintf(&buf, "var table = [1<<%d]Atom{\n", best.k) - for i, s := range best.tab { - if s == "" { - continue - } - fmt.Fprintf(&buf, "\t%#x: %#x, // %s\n", i, atom[s], s) - } - fmt.Fprintf(&buf, "}\n") - datasize := (1 << best.k) * 4 - - fmt.Fprintln(&buf, "const atomText =") - textsize := len(text) - for len(text) > 60 { - fmt.Fprintf(&buf, "\t%q +\n", text[:60]) - text = text[60:] - } - fmt.Fprintf(&buf, "\t%q\n\n", text) - - genFile("table.go", &buf) - - fmt.Fprintf(os.Stdout, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize) -} - -type byLen []string - -func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) } -func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byLen) Len() int { return len(x) } - -// fnv computes the FNV hash with an arbitrary starting value h. -func fnv(h uint32, s string) uint32 { - for i := 0; i < len(s); i++ { - h ^= uint32(s[i]) - h *= 16777619 - } - return h -} - -// A table represents an attempt at constructing the lookup table. -// The lookup table uses cuckoo hashing, meaning that each string -// can be found in one of two positions. -type table struct { - h0 uint32 - k uint - mask uint32 - tab []string -} - -// hash returns the two hashes for s. -func (t *table) hash(s string) (h1, h2 uint32) { - h := fnv(t.h0, s) - h1 = h & t.mask - h2 = (h >> 16) & t.mask - return -} - -// init initializes the table with the given parameters. -// h0 is the initial hash value, -// k is the number of bits of hash value to use, and -// x is the list of strings to store in the table. -// init returns false if the table cannot be constructed. -func (t *table) init(h0 uint32, k uint, x []string) bool { - t.h0 = h0 - t.k = k - t.tab = make([]string, 1< len(t.tab) { - return false - } - s := t.tab[i] - h1, h2 := t.hash(s) - j := h1 + h2 - i - if t.tab[j] != "" && !t.push(j, depth+1) { - return false - } - t.tab[j] = s - return true -} - -// The lists of element names and attribute keys were taken from -// https://html.spec.whatwg.org/multipage/indices.html#index -// as of the "HTML Living Standard - Last Updated 16 April 2018" version. - -// "command", "keygen" and "menuitem" have been removed from the spec, -// but are kept here for backwards compatibility. -var elements = []string{ - "a", - "abbr", - "address", - "area", - "article", - "aside", - "audio", - "b", - "base", - "bdi", - "bdo", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "cite", - "code", - "col", - "colgroup", - "command", - "data", - "datalist", - "dd", - "del", - "details", - "dfn", - "dialog", - "div", - "dl", - "dt", - "em", - "embed", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hgroup", - "hr", - "html", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "legend", - "li", - "link", - "main", - "map", - "mark", - "menu", - "menuitem", - "meta", - "meter", - "nav", - "noscript", - "object", - "ol", - "optgroup", - "option", - "output", - "p", - "param", - "picture", - "pre", - "progress", - "q", - "rp", - "rt", - "ruby", - "s", - "samp", - "script", - "section", - "select", - "slot", - "small", - "source", - "span", - "strong", - "style", - "sub", - "summary", - "sup", - "table", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "u", - "ul", - "var", - "video", - "wbr", -} - -// https://html.spec.whatwg.org/multipage/indices.html#attributes-3 -// -// "challenge", "command", "contextmenu", "dropzone", "icon", "keytype", "mediagroup", -// "radiogroup", "spellcheck", "scoped", "seamless", "sortable" and "sorted" have been removed from the spec, -// but are kept here for backwards compatibility. -var attributes = []string{ - "abbr", - "accept", - "accept-charset", - "accesskey", - "action", - "allowfullscreen", - "allowpaymentrequest", - "allowusermedia", - "alt", - "as", - "async", - "autocomplete", - "autofocus", - "autoplay", - "challenge", - "charset", - "checked", - "cite", - "class", - "color", - "cols", - "colspan", - "command", - "content", - "contenteditable", - "contextmenu", - "controls", - "coords", - "crossorigin", - "data", - "datetime", - "default", - "defer", - "dir", - "dirname", - "disabled", - "download", - "draggable", - "dropzone", - "enctype", - "for", - "form", - "formaction", - "formenctype", - "formmethod", - "formnovalidate", - "formtarget", - "headers", - "height", - "hidden", - "high", - "href", - "hreflang", - "http-equiv", - "icon", - "id", - "inputmode", - "integrity", - "is", - "ismap", - "itemid", - "itemprop", - "itemref", - "itemscope", - "itemtype", - "keytype", - "kind", - "label", - "lang", - "list", - "loop", - "low", - "manifest", - "max", - "maxlength", - "media", - "mediagroup", - "method", - "min", - "minlength", - "multiple", - "muted", - "name", - "nomodule", - "nonce", - "novalidate", - "open", - "optimum", - "pattern", - "ping", - "placeholder", - "playsinline", - "poster", - "preload", - "radiogroup", - "readonly", - "referrerpolicy", - "rel", - "required", - "reversed", - "rows", - "rowspan", - "sandbox", - "spellcheck", - "scope", - "scoped", - "seamless", - "selected", - "shape", - "size", - "sizes", - "sortable", - "sorted", - "slot", - "span", - "spellcheck", - "src", - "srcdoc", - "srclang", - "srcset", - "start", - "step", - "style", - "tabindex", - "target", - "title", - "translate", - "type", - "typemustmatch", - "updateviacache", - "usemap", - "value", - "width", - "workertype", - "wrap", -} - -// "onautocomplete", "onautocompleteerror", "onmousewheel", -// "onshow" and "onsort" have been removed from the spec, -// but are kept here for backwards compatibility. -var eventHandlers = []string{ - "onabort", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onafterprint", - "onbeforeprint", - "onbeforeunload", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncopy", - "oncuechange", - "oncut", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "onhashchange", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onlanguagechange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloadstart", - "onmessage", - "onmessageerror", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onwheel", - "onoffline", - "ononline", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onpopstate", - "onprogress", - "onratechange", - "onreset", - "onresize", - "onrejectionhandled", - "onscroll", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onsort", - "onstalled", - "onstorage", - "onsubmit", - "onsuspend", - "ontimeupdate", - "ontoggle", - "onunhandledrejection", - "onunload", - "onvolumechange", - "onwaiting", -} - -// extra are ad-hoc values not covered by any of the lists above. -var extra = []string{ - "acronym", - "align", - "annotation", - "annotation-xml", - "applet", - "basefont", - "bgsound", - "big", - "blink", - "center", - "color", - "desc", - "face", - "font", - "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive. - "foreignobject", - "frame", - "frameset", - "image", - "isindex", - "listing", - "malignmark", - "marquee", - "math", - "mglyph", - "mi", - "mn", - "mo", - "ms", - "mtext", - "nobr", - "noembed", - "noframes", - "plaintext", - "prompt", - "public", - "rb", - "rtc", - "spacer", - "strike", - "svg", - "system", - "tt", - "xmp", -} diff --git a/vendor/golang.org/x/sys/unix/mkasm_darwin.go b/vendor/golang.org/x/sys/unix/mkasm_darwin.go deleted file mode 100644 index 4548b993db..0000000000 --- a/vendor/golang.org/x/sys/unix/mkasm_darwin.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go. -//This program must be run after mksyscall.go. -package main - -import ( - "bytes" - "fmt" - "io/ioutil" - "log" - "os" - "strings" -) - -func main() { - in1, err := ioutil.ReadFile("syscall_darwin.go") - if err != nil { - log.Fatalf("can't open syscall_darwin.go: %s", err) - } - arch := os.Args[1] - in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch)) - if err != nil { - log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err) - } - in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch)) - if err != nil { - log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err) - } - in := string(in1) + string(in2) + string(in3) - - trampolines := map[string]bool{} - - var out bytes.Buffer - - fmt.Fprintf(&out, "// go run mkasm_darwin.go %s\n", strings.Join(os.Args[1:], " ")) - fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n") - fmt.Fprintf(&out, "\n") - fmt.Fprintf(&out, "// +build go1.12\n") - fmt.Fprintf(&out, "\n") - fmt.Fprintf(&out, "#include \"textflag.h\"\n") - for _, line := range strings.Split(in, "\n") { - if !strings.HasPrefix(line, "func ") || !strings.HasSuffix(line, "_trampoline()") { - continue - } - fn := line[5 : len(line)-13] - if !trampolines[fn] { - trampolines[fn] = true - fmt.Fprintf(&out, "TEXT ·%s_trampoline(SB),NOSPLIT,$0-0\n", fn) - fmt.Fprintf(&out, "\tJMP\t%s(SB)\n", fn) - } - } - err = ioutil.WriteFile(fmt.Sprintf("zsyscall_darwin_%s.s", arch), out.Bytes(), 0644) - if err != nil { - log.Fatalf("can't write zsyscall_darwin_%s.s: %s", arch, err) - } -} diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go deleted file mode 100644 index eb4332059a..0000000000 --- a/vendor/golang.org/x/sys/unix/mkpost.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// mkpost processes the output of cgo -godefs to -// modify the generated types. It is used to clean up -// the sys API in an architecture specific manner. -// -// mkpost is run after cgo -godefs; see README.md. -package main - -import ( - "bytes" - "fmt" - "go/format" - "io/ioutil" - "log" - "os" - "regexp" -) - -func main() { - // Get the OS and architecture (using GOARCH_TARGET if it exists) - goos := os.Getenv("GOOS") - goarch := os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - // Check that we are using the Docker-based build system if we should be. - if goos == "linux" { - if os.Getenv("GOLANG_SYS_BUILD") != "docker" { - os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n") - os.Stderr.WriteString("See README.md\n") - os.Exit(1) - } - } - - b, err := ioutil.ReadAll(os.Stdin) - if err != nil { - log.Fatal(err) - } - - if goos == "aix" { - // Replace type of Atim, Mtim and Ctim by Timespec in Stat_t - // to avoid having both StTimespec and Timespec. - sttimespec := regexp.MustCompile(`_Ctype_struct_st_timespec`) - b = sttimespec.ReplaceAll(b, []byte("Timespec")) - } - - // Intentionally export __val fields in Fsid and Sigset_t - valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__(bits|val)(\s+\S+\s+)}`) - b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$4}")) - - // Intentionally export __fds_bits field in FdSet - fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`) - b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}")) - - // If we have empty Ptrace structs, we should delete them. Only s390x emits - // nonempty Ptrace structs. - ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`) - b = ptraceRexexp.ReplaceAll(b, nil) - - // Replace the control_regs union with a blank identifier for now. - controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`) - b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64")) - - // Remove fields that are added by glibc - // Note that this is unstable as the identifers are private. - removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`) - b = removeFieldsRegex.ReplaceAll(b, []byte("_")) - - // Convert [65]int8 to [65]byte in Utsname members to simplify - // conversion to string; see golang.org/issue/20753 - convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`) - b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte")) - - // Convert [1024]int8 to [1024]byte in Ptmget members - convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`) - b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte")) - - // Remove spare fields (e.g. in Statx_t) - spareFieldsRegex := regexp.MustCompile(`X__spare\S*`) - b = spareFieldsRegex.ReplaceAll(b, []byte("_")) - - // Remove cgo padding fields - removePaddingFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`) - b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_")) - - // Remove padding, hidden, or unused fields - removeFieldsRegex = regexp.MustCompile(`\b(X_\S+|Padding)`) - b = removeFieldsRegex.ReplaceAll(b, []byte("_")) - - // Remove the first line of warning from cgo - b = b[bytes.IndexByte(b, '\n')+1:] - // Modify the command in the header to include: - // mkpost, our own warning, and a build tag. - replacement := fmt.Sprintf(`$1 | go run mkpost.go -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s,%s`, goarch, goos) - cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`) - b = cgoCommandRegex.ReplaceAll(b, []byte(replacement)) - - // Rename Stat_t time fields - if goos == "freebsd" && goarch == "386" { - // Hide Stat_t.[AMCB]tim_ext fields - renameStatTimeExtFieldsRegex := regexp.MustCompile(`[AMCB]tim_ext`) - b = renameStatTimeExtFieldsRegex.ReplaceAll(b, []byte("_")) - } - renameStatTimeFieldsRegex := regexp.MustCompile(`([AMCB])(?:irth)?time?(?:spec)?\s+(Timespec|StTimespec)`) - b = renameStatTimeFieldsRegex.ReplaceAll(b, []byte("${1}tim ${2}")) - - // gofmt - b, err = format.Source(b) - if err != nil { - log.Fatal(err) - } - - os.Stdout.Write(b) -} diff --git a/vendor/golang.org/x/sys/unix/mksyscall.go b/vendor/golang.org/x/sys/unix/mksyscall.go deleted file mode 100644 index e4af9424e9..0000000000 --- a/vendor/golang.org/x/sys/unix/mksyscall.go +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -This program reads a file containing function prototypes -(like syscall_darwin.go) and generates system call bodies. -The prototypes are marked by lines beginning with "//sys" -and read like func declarations if //sys is replaced by func, but: - * The parameter lists must give a name for each argument. - This includes return parameters. - * The parameter lists must give a type for each argument: - the (x, y, z int) shorthand is not allowed. - * If the return parameter is an error number, it must be named errno. - -A line beginning with //sysnb is like //sys, except that the -goroutine will not be suspended during the execution of the system -call. This must only be used for system calls which can never -block, as otherwise the system call could cause all goroutines to -hang. -*/ -package main - -import ( - "bufio" - "flag" - "fmt" - "os" - "regexp" - "strings" -) - -var ( - b32 = flag.Bool("b32", false, "32bit big-endian") - l32 = flag.Bool("l32", false, "32bit little-endian") - plan9 = flag.Bool("plan9", false, "plan9") - openbsd = flag.Bool("openbsd", false, "openbsd") - netbsd = flag.Bool("netbsd", false, "netbsd") - dragonfly = flag.Bool("dragonfly", false, "dragonfly") - arm = flag.Bool("arm", false, "arm") // 64-bit value should use (even, odd)-pair - tags = flag.String("tags", "", "build tags") - filename = flag.String("output", "", "output file name (standard output if omitted)") -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksyscall.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return *tags -} - -// Param is function parameter -type Param struct { - Name string - Type string -} - -// usage prints the program usage -func usage() { - fmt.Fprintf(os.Stderr, "usage: go run mksyscall.go [-b32 | -l32] [-tags x,y] [file ...]\n") - os.Exit(1) -} - -// parseParamList parses parameter list and returns a slice of parameters -func parseParamList(list string) []string { - list = strings.TrimSpace(list) - if list == "" { - return []string{} - } - return regexp.MustCompile(`\s*,\s*`).Split(list, -1) -} - -// parseParam splits a parameter into name and type -func parseParam(p string) Param { - ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) - if ps == nil { - fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) - os.Exit(1) - } - return Param{ps[1], ps[2]} -} - -func main() { - // Get the OS and architecture (using GOARCH_TARGET if it exists) - goos := os.Getenv("GOOS") - if goos == "" { - fmt.Fprintln(os.Stderr, "GOOS not defined in environment") - os.Exit(1) - } - goarch := os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - - // Check that we are using the Docker-based build system if we should - if goos == "linux" { - if os.Getenv("GOLANG_SYS_BUILD") != "docker" { - fmt.Fprintf(os.Stderr, "In the Docker-based build system, mksyscall should not be called directly.\n") - fmt.Fprintf(os.Stderr, "See README.md\n") - os.Exit(1) - } - } - - flag.Usage = usage - flag.Parse() - if len(flag.Args()) <= 0 { - fmt.Fprintf(os.Stderr, "no files to parse provided\n") - usage() - } - - endianness := "" - if *b32 { - endianness = "big-endian" - } else if *l32 { - endianness = "little-endian" - } - - libc := false - if goos == "darwin" && strings.Contains(buildTags(), ",go1.12") { - libc = true - } - trampolines := map[string]bool{} - - text := "" - for _, path := range flag.Args() { - file, err := os.Open(path) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - t := s.Text() - t = strings.TrimSpace(t) - t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) - nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) - if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { - continue - } - - // Line must be of the form - // func Open(path string, mode int, perm int) (fd int, errno error) - // Split into name, in params, out params. - f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$`).FindStringSubmatch(t) - if f == nil { - fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) - os.Exit(1) - } - funct, inps, outps, sysname := f[2], f[3], f[4], f[5] - - // ClockGettime doesn't have a syscall number on Darwin, only generate libc wrappers. - if goos == "darwin" && !libc && funct == "ClockGettime" { - continue - } - - // Split argument lists on comma. - in := parseParamList(inps) - out := parseParamList(outps) - - // Try in vain to keep people from editing this file. - // The theory is that they jump into the middle of the file - // without reading the header. - text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - - // Go function header. - outDecl := "" - if len(out) > 0 { - outDecl = fmt.Sprintf(" (%s)", strings.Join(out, ", ")) - } - text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outDecl) - - // Check if err return available - errvar := "" - for _, param := range out { - p := parseParam(param) - if p.Type == "error" { - errvar = p.Name - break - } - } - - // Prepare arguments to Syscall. - var args []string - n := 0 - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))") - } else if p.Type == "string" && errvar != "" { - text += fmt.Sprintf("\tvar _p%d *byte\n", n) - text += fmt.Sprintf("\t_p%d, %s = BytePtrFromString(%s)\n", n, errvar, p.Name) - text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - n++ - } else if p.Type == "string" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") - text += fmt.Sprintf("\tvar _p%d *byte\n", n) - text += fmt.Sprintf("\t_p%d, _ = BytePtrFromString(%s)\n", n, p.Name) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - n++ - } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { - // Convert slice into pointer, length. - // Have to be careful not to take address of &a[0] if len == 0: - // pass dummy pointer in that case. - // Used to pass nil, but some OSes or simulators reject write(fd, nil, 0). - text += fmt.Sprintf("\tvar _p%d unsafe.Pointer\n", n) - text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = unsafe.Pointer(&%s[0])\n\t}", p.Name, n, p.Name) - text += fmt.Sprintf(" else {\n\t\t_p%d = unsafe.Pointer(&_zero)\n\t}\n", n) - args = append(args, fmt.Sprintf("uintptr(_p%d)", n), fmt.Sprintf("uintptr(len(%s))", p.Name)) - n++ - } else if p.Type == "int64" && (*openbsd || *netbsd) { - args = append(args, "0") - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else if endianness == "little-endian" { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) - } - } else if p.Type == "int64" && *dragonfly { - if regexp.MustCompile(`^(?i)extp(read|write)`).FindStringSubmatch(funct) == nil { - args = append(args, "0") - } - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else if endianness == "little-endian" { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) - } - } else if (p.Type == "int64" || p.Type == "uint64") && endianness != "" { - if len(args)%2 == 1 && *arm { - // arm abi specifies 64-bit argument uses - // (even, odd) pair - args = append(args, "0") - } - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) - } - } - - // Determine which form to use; pad args with zeros. - asm := "Syscall" - if nonblock != nil { - if errvar == "" && goos == "linux" { - asm = "RawSyscallNoError" - } else { - asm = "RawSyscall" - } - } else { - if errvar == "" && goos == "linux" { - asm = "SyscallNoError" - } - } - if len(args) <= 3 { - for len(args) < 3 { - args = append(args, "0") - } - } else if len(args) <= 6 { - asm += "6" - for len(args) < 6 { - args = append(args, "0") - } - } else if len(args) <= 9 { - asm += "9" - for len(args) < 9 { - args = append(args, "0") - } - } else { - fmt.Fprintf(os.Stderr, "%s:%s too many arguments to system call\n", path, funct) - } - - // System call number. - if sysname == "" { - sysname = "SYS_" + funct - sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) - sysname = strings.ToUpper(sysname) - } - - var libcFn string - if libc { - asm = "syscall_" + strings.ToLower(asm[:1]) + asm[1:] // internal syscall call - sysname = strings.TrimPrefix(sysname, "SYS_") // remove SYS_ - sysname = strings.ToLower(sysname) // lowercase - if sysname == "getdirentries64" { - // Special case - libSystem name and - // raw syscall name don't match. - sysname = "__getdirentries64" - } - libcFn = sysname - sysname = "funcPC(libc_" + sysname + "_trampoline)" - } - - // Actual call. - arglist := strings.Join(args, ", ") - call := fmt.Sprintf("%s(%s, %s)", asm, sysname, arglist) - - // Assign return values. - body := "" - ret := []string{"_", "_", "_"} - doErrno := false - for i := 0; i < len(out); i++ { - p := parseParam(out[i]) - reg := "" - if p.Name == "err" && !*plan9 { - reg = "e1" - ret[2] = reg - doErrno = true - } else if p.Name == "err" && *plan9 { - ret[0] = "r0" - ret[2] = "e1" - break - } else { - reg = fmt.Sprintf("r%d", i) - ret[i] = reg - } - if p.Type == "bool" { - reg = fmt.Sprintf("%s != 0", reg) - } - if p.Type == "int64" && endianness != "" { - // 64-bit number in r1:r0 or r0:r1. - if i+2 > len(out) { - fmt.Fprintf(os.Stderr, "%s:%s not enough registers for int64 return\n", path, funct) - } - if endianness == "big-endian" { - reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1) - } else { - reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i) - } - ret[i] = fmt.Sprintf("r%d", i) - ret[i+1] = fmt.Sprintf("r%d", i+1) - } - if reg != "e1" || *plan9 { - body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) - } - } - if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" { - text += fmt.Sprintf("\t%s\n", call) - } else { - if errvar == "" && goos == "linux" { - // raw syscall without error on Linux, see golang.org/issue/22924 - text += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], call) - } else { - text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call) - } - } - text += body - - if *plan9 && ret[2] == "e1" { - text += "\tif int32(r0) == -1 {\n" - text += "\t\terr = e1\n" - text += "\t}\n" - } else if doErrno { - text += "\tif e1 != 0 {\n" - text += "\t\terr = errnoErr(e1)\n" - text += "\t}\n" - } - text += "\treturn\n" - text += "}\n\n" - - if libc && !trampolines[libcFn] { - // some system calls share a trampoline, like read and readlen. - trampolines[libcFn] = true - // Declare assembly trampoline. - text += fmt.Sprintf("func libc_%s_trampoline()\n", libcFn) - // Assembly trampoline calls the libc_* function, which this magic - // redirects to use the function from libSystem. - text += fmt.Sprintf("//go:linkname libc_%s libc_%s\n", libcFn, libcFn) - text += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"/usr/lib/libSystem.B.dylib\"\n", libcFn, libcFn) - text += "\n" - } - } - if err := s.Err(); err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - file.Close() - } - fmt.Printf(srcTemplate, cmdLine(), buildTags(), text) -} - -const srcTemplate = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package unix - -import ( - "syscall" - "unsafe" -) - -var _ syscall.Errno - -%s -` diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go deleted file mode 100644 index 3be3cdfc3b..0000000000 --- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -This program reads a file containing function prototypes -(like syscall_aix.go) and generates system call bodies. -The prototypes are marked by lines beginning with "//sys" -and read like func declarations if //sys is replaced by func, but: - * The parameter lists must give a name for each argument. - This includes return parameters. - * The parameter lists must give a type for each argument: - the (x, y, z int) shorthand is not allowed. - * If the return parameter is an error number, it must be named err. - * If go func name needs to be different than its libc name, - * or the function is not in libc, name could be specified - * at the end, after "=" sign, like - //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt -*/ -package main - -import ( - "bufio" - "flag" - "fmt" - "os" - "regexp" - "strings" -) - -var ( - b32 = flag.Bool("b32", false, "32bit big-endian") - l32 = flag.Bool("l32", false, "32bit little-endian") - aix = flag.Bool("aix", false, "aix") - tags = flag.String("tags", "", "build tags") -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksyscall_aix_ppc.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return *tags -} - -// Param is function parameter -type Param struct { - Name string - Type string -} - -// usage prints the program usage -func usage() { - fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc.go [-b32 | -l32] [-tags x,y] [file ...]\n") - os.Exit(1) -} - -// parseParamList parses parameter list and returns a slice of parameters -func parseParamList(list string) []string { - list = strings.TrimSpace(list) - if list == "" { - return []string{} - } - return regexp.MustCompile(`\s*,\s*`).Split(list, -1) -} - -// parseParam splits a parameter into name and type -func parseParam(p string) Param { - ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) - if ps == nil { - fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) - os.Exit(1) - } - return Param{ps[1], ps[2]} -} - -func main() { - flag.Usage = usage - flag.Parse() - if len(flag.Args()) <= 0 { - fmt.Fprintf(os.Stderr, "no files to parse provided\n") - usage() - } - - endianness := "" - if *b32 { - endianness = "big-endian" - } else if *l32 { - endianness = "little-endian" - } - - pack := "" - text := "" - cExtern := "/*\n#include \n#include \n" - for _, path := range flag.Args() { - file, err := os.Open(path) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - t := s.Text() - t = strings.TrimSpace(t) - t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) - if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { - pack = p[1] - } - nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) - if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { - continue - } - - // Line must be of the form - // func Open(path string, mode int, perm int) (fd int, err error) - // Split into name, in params, out params. - f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) - if f == nil { - fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) - os.Exit(1) - } - funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] - - // Split argument lists on comma. - in := parseParamList(inps) - out := parseParamList(outps) - - inps = strings.Join(in, ", ") - outps = strings.Join(out, ", ") - - // Try in vain to keep people from editing this file. - // The theory is that they jump into the middle of the file - // without reading the header. - text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - - // Check if value return, err return available - errvar := "" - retvar := "" - rettype := "" - for _, param := range out { - p := parseParam(param) - if p.Type == "error" { - errvar = p.Name - } else { - retvar = p.Name - rettype = p.Type - } - } - - // System call name. - if sysname == "" { - sysname = funct - } - sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) - sysname = strings.ToLower(sysname) // All libc functions are lowercase. - - cRettype := "" - if rettype == "unsafe.Pointer" { - cRettype = "uintptr_t" - } else if rettype == "uintptr" { - cRettype = "uintptr_t" - } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil { - cRettype = "uintptr_t" - } else if rettype == "int" { - cRettype = "int" - } else if rettype == "int32" { - cRettype = "int" - } else if rettype == "int64" { - cRettype = "long long" - } else if rettype == "uint32" { - cRettype = "unsigned int" - } else if rettype == "uint64" { - cRettype = "unsigned long long" - } else { - cRettype = "int" - } - if sysname == "exit" { - cRettype = "void" - } - - // Change p.Types to c - var cIn []string - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "string" { - cIn = append(cIn, "uintptr_t") - } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t", "size_t") - } else if p.Type == "unsafe.Pointer" { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "uintptr" { - cIn = append(cIn, "uintptr_t") - } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "int" { - cIn = append(cIn, "int") - } else if p.Type == "int32" { - cIn = append(cIn, "int") - } else if p.Type == "int64" { - cIn = append(cIn, "long long") - } else if p.Type == "uint32" { - cIn = append(cIn, "unsigned int") - } else if p.Type == "uint64" { - cIn = append(cIn, "unsigned long long") - } else { - cIn = append(cIn, "int") - } - } - - if funct != "fcntl" && funct != "FcntlInt" && funct != "readlen" && funct != "writelen" { - if sysname == "select" { - // select is a keyword of Go. Its name is - // changed to c_select. - cExtern += "#define c_select select\n" - } - // Imports of system calls from libc - cExtern += fmt.Sprintf("%s %s", cRettype, sysname) - cIn := strings.Join(cIn, ", ") - cExtern += fmt.Sprintf("(%s);\n", cIn) - } - - // So file name. - if *aix { - if modname == "" { - modname = "libc.a/shr_64.o" - } else { - fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct) - os.Exit(1) - } - } - - strconvfunc := "C.CString" - - // Go function header. - if outps != "" { - outps = fmt.Sprintf(" (%s)", outps) - } - if text != "" { - text += "\n" - } - - text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps) - - // Prepare arguments to Syscall. - var args []string - n := 0 - argN := 0 - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - args = append(args, "C.uintptr_t(uintptr(unsafe.Pointer("+p.Name+")))") - } else if p.Type == "string" && errvar != "" { - text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name) - args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n)) - n++ - } else if p.Type == "string" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") - text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name) - args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n)) - n++ - } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil { - // Convert slice into pointer, length. - // Have to be careful not to take address of &a[0] if len == 0: - // pass nil in that case. - text += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1]) - text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) - args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(unsafe.Pointer(_p%d)))", n)) - n++ - text += fmt.Sprintf("\tvar _p%d int\n", n) - text += fmt.Sprintf("\t_p%d = len(%s)\n", n, p.Name) - args = append(args, fmt.Sprintf("C.size_t(_p%d)", n)) - n++ - } else if p.Type == "int64" && endianness != "" { - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } - n++ - } else if p.Type == "bool" { - text += fmt.Sprintf("\tvar _p%d uint32\n", n) - text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n) - args = append(args, fmt.Sprintf("_p%d", n)) - } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { - args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name)) - } else if p.Type == "unsafe.Pointer" { - args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name)) - } else if p.Type == "int" { - if (argN == 2) && ((funct == "readlen") || (funct == "writelen")) { - args = append(args, fmt.Sprintf("C.size_t(%s)", p.Name)) - } else if argN == 0 && funct == "fcntl" { - args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else if (argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt")) { - args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) - } - } else if p.Type == "int32" { - args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) - } else if p.Type == "int64" { - args = append(args, fmt.Sprintf("C.longlong(%s)", p.Name)) - } else if p.Type == "uint32" { - args = append(args, fmt.Sprintf("C.uint(%s)", p.Name)) - } else if p.Type == "uint64" { - args = append(args, fmt.Sprintf("C.ulonglong(%s)", p.Name)) - } else if p.Type == "uintptr" { - args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) - } - argN++ - } - - // Actual call. - arglist := strings.Join(args, ", ") - call := "" - if sysname == "exit" { - if errvar != "" { - call += "er :=" - } else { - call += "" - } - } else if errvar != "" { - call += "r0,er :=" - } else if retvar != "" { - call += "r0,_ :=" - } else { - call += "" - } - if sysname == "select" { - // select is a keyword of Go. Its name is - // changed to c_select. - call += fmt.Sprintf("C.c_%s(%s)", sysname, arglist) - } else { - call += fmt.Sprintf("C.%s(%s)", sysname, arglist) - } - - // Assign return values. - body := "" - for i := 0; i < len(out); i++ { - p := parseParam(out[i]) - reg := "" - if p.Name == "err" { - reg = "e1" - } else { - reg = "r0" - } - if reg != "e1" { - body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) - } - } - - // verify return - if sysname != "exit" && errvar != "" { - if regexp.MustCompile(`^uintptr`).FindStringSubmatch(cRettype) != nil { - body += "\tif (uintptr(r0) ==^uintptr(0) && er != nil) {\n" - body += fmt.Sprintf("\t\t%s = er\n", errvar) - body += "\t}\n" - } else { - body += "\tif (r0 ==-1 && er != nil) {\n" - body += fmt.Sprintf("\t\t%s = er\n", errvar) - body += "\t}\n" - } - } else if errvar != "" { - body += "\tif (er != nil) {\n" - body += fmt.Sprintf("\t\t%s = er\n", errvar) - body += "\t}\n" - } - - text += fmt.Sprintf("\t%s\n", call) - text += body - - text += "\treturn\n" - text += "}\n" - } - if err := s.Err(); err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - file.Close() - } - imp := "" - if pack != "unix" { - imp = "import \"golang.org/x/sys/unix\"\n" - - } - fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, cExtern, imp, text) -} - -const srcTemplate = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package %s - - -%s -*/ -import "C" -import ( - "unsafe" -) - - -%s - -%s -` diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go deleted file mode 100644 index c960099517..0000000000 --- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go +++ /dev/null @@ -1,614 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -This program reads a file containing function prototypes -(like syscall_aix.go) and generates system call bodies. -The prototypes are marked by lines beginning with "//sys" -and read like func declarations if //sys is replaced by func, but: - * The parameter lists must give a name for each argument. - This includes return parameters. - * The parameter lists must give a type for each argument: - the (x, y, z int) shorthand is not allowed. - * If the return parameter is an error number, it must be named err. - * If go func name needs to be different than its libc name, - * or the function is not in libc, name could be specified - * at the end, after "=" sign, like - //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt - - -This program will generate three files and handle both gc and gccgo implementation: - - zsyscall_aix_ppc64.go: the common part of each implementation (error handler, pointer creation) - - zsyscall_aix_ppc64_gc.go: gc part with //go_cgo_import_dynamic and a call to syscall6 - - zsyscall_aix_ppc64_gccgo.go: gccgo part with C function and conversion to C type. - - The generated code looks like this - -zsyscall_aix_ppc64.go -func asyscall(...) (n int, err error) { - // Pointer Creation - r1, e1 := callasyscall(...) - // Type Conversion - // Error Handler - return -} - -zsyscall_aix_ppc64_gc.go -//go:cgo_import_dynamic libc_asyscall asyscall "libc.a/shr_64.o" -//go:linkname libc_asyscall libc_asyscall -var asyscall syscallFunc - -func callasyscall(...) (r1 uintptr, e1 Errno) { - r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_asyscall)), "nb_args", ... ) - return -} - -zsyscall_aix_ppc64_ggcgo.go - -// int asyscall(...) - -import "C" - -func callasyscall(...) (r1 uintptr, e1 Errno) { - r1 = uintptr(C.asyscall(...)) - e1 = syscall.GetErrno() - return -} -*/ - -package main - -import ( - "bufio" - "flag" - "fmt" - "io/ioutil" - "os" - "regexp" - "strings" -) - -var ( - b32 = flag.Bool("b32", false, "32bit big-endian") - l32 = flag.Bool("l32", false, "32bit little-endian") - aix = flag.Bool("aix", false, "aix") - tags = flag.String("tags", "", "build tags") -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksyscall_aix_ppc64.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return *tags -} - -// Param is function parameter -type Param struct { - Name string - Type string -} - -// usage prints the program usage -func usage() { - fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc64.go [-b32 | -l32] [-tags x,y] [file ...]\n") - os.Exit(1) -} - -// parseParamList parses parameter list and returns a slice of parameters -func parseParamList(list string) []string { - list = strings.TrimSpace(list) - if list == "" { - return []string{} - } - return regexp.MustCompile(`\s*,\s*`).Split(list, -1) -} - -// parseParam splits a parameter into name and type -func parseParam(p string) Param { - ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) - if ps == nil { - fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) - os.Exit(1) - } - return Param{ps[1], ps[2]} -} - -func main() { - flag.Usage = usage - flag.Parse() - if len(flag.Args()) <= 0 { - fmt.Fprintf(os.Stderr, "no files to parse provided\n") - usage() - } - - endianness := "" - if *b32 { - endianness = "big-endian" - } else if *l32 { - endianness = "little-endian" - } - - pack := "" - // GCCGO - textgccgo := "" - cExtern := "/*\n#include \n" - // GC - textgc := "" - dynimports := "" - linknames := "" - var vars []string - // COMMON - textcommon := "" - for _, path := range flag.Args() { - file, err := os.Open(path) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - t := s.Text() - t = strings.TrimSpace(t) - t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) - if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { - pack = p[1] - } - nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) - if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { - continue - } - - // Line must be of the form - // func Open(path string, mode int, perm int) (fd int, err error) - // Split into name, in params, out params. - f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) - if f == nil { - fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) - os.Exit(1) - } - funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] - - // Split argument lists on comma. - in := parseParamList(inps) - out := parseParamList(outps) - - inps = strings.Join(in, ", ") - outps = strings.Join(out, ", ") - - if sysname == "" { - sysname = funct - } - - onlyCommon := false - if funct == "readlen" || funct == "writelen" || funct == "FcntlInt" || funct == "FcntlFlock" { - // This function call another syscall which is already implemented. - // Therefore, the gc and gccgo part must not be generated. - onlyCommon = true - } - - // Try in vain to keep people from editing this file. - // The theory is that they jump into the middle of the file - // without reading the header. - - textcommon += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - if !onlyCommon { - textgccgo += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - textgc += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - } - - // Check if value return, err return available - errvar := "" - rettype := "" - for _, param := range out { - p := parseParam(param) - if p.Type == "error" { - errvar = p.Name - } else { - rettype = p.Type - } - } - - sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) - sysname = strings.ToLower(sysname) // All libc functions are lowercase. - - // GCCGO Prototype return type - cRettype := "" - if rettype == "unsafe.Pointer" { - cRettype = "uintptr_t" - } else if rettype == "uintptr" { - cRettype = "uintptr_t" - } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil { - cRettype = "uintptr_t" - } else if rettype == "int" { - cRettype = "int" - } else if rettype == "int32" { - cRettype = "int" - } else if rettype == "int64" { - cRettype = "long long" - } else if rettype == "uint32" { - cRettype = "unsigned int" - } else if rettype == "uint64" { - cRettype = "unsigned long long" - } else { - cRettype = "int" - } - if sysname == "exit" { - cRettype = "void" - } - - // GCCGO Prototype arguments type - var cIn []string - for i, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "string" { - cIn = append(cIn, "uintptr_t") - } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t", "size_t") - } else if p.Type == "unsafe.Pointer" { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "uintptr" { - cIn = append(cIn, "uintptr_t") - } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { - cIn = append(cIn, "uintptr_t") - } else if p.Type == "int" { - if (i == 0 || i == 2) && funct == "fcntl" { - // These fcntl arguments needs to be uintptr to be able to call FcntlInt and FcntlFlock - cIn = append(cIn, "uintptr_t") - } else { - cIn = append(cIn, "int") - } - - } else if p.Type == "int32" { - cIn = append(cIn, "int") - } else if p.Type == "int64" { - cIn = append(cIn, "long long") - } else if p.Type == "uint32" { - cIn = append(cIn, "unsigned int") - } else if p.Type == "uint64" { - cIn = append(cIn, "unsigned long long") - } else { - cIn = append(cIn, "int") - } - } - - if !onlyCommon { - // GCCGO Prototype Generation - // Imports of system calls from libc - if sysname == "select" { - // select is a keyword of Go. Its name is - // changed to c_select. - cExtern += "#define c_select select\n" - } - cExtern += fmt.Sprintf("%s %s", cRettype, sysname) - cIn := strings.Join(cIn, ", ") - cExtern += fmt.Sprintf("(%s);\n", cIn) - } - // GC Library name - if modname == "" { - modname = "libc.a/shr_64.o" - } else { - fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct) - os.Exit(1) - } - sysvarname := fmt.Sprintf("libc_%s", sysname) - - if !onlyCommon { - // GC Runtime import of function to allow cross-platform builds. - dynimports += fmt.Sprintf("//go:cgo_import_dynamic %s %s \"%s\"\n", sysvarname, sysname, modname) - // GC Link symbol to proc address variable. - linknames += fmt.Sprintf("//go:linkname %s %s\n", sysvarname, sysvarname) - // GC Library proc address variable. - vars = append(vars, sysvarname) - } - - strconvfunc := "BytePtrFromString" - strconvtype := "*byte" - - // Go function header. - if outps != "" { - outps = fmt.Sprintf(" (%s)", outps) - } - if textcommon != "" { - textcommon += "\n" - } - - textcommon += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps) - - // Prepare arguments tocall. - var argscommon []string // Arguments in the common part - var argscall []string // Arguments for call prototype - var argsgc []string // Arguments for gc call (with syscall6) - var argsgccgo []string // Arguments for gccgo call (with C.name_of_syscall) - n := 0 - argN := 0 - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(%s))", p.Name)) - argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) - argsgc = append(argsgc, p.Name) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else if p.Type == "string" && errvar != "" { - textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) - textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) - textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) - - argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - argscall = append(argscall, fmt.Sprintf("_p%d uintptr ", n)) - argsgc = append(argsgc, fmt.Sprintf("_p%d", n)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n)) - n++ - } else if p.Type == "string" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") - textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) - textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) - textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) - - argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n)) - argsgc = append(argsgc, fmt.Sprintf("_p%d", n)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n)) - n++ - } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil { - // Convert slice into pointer, length. - // Have to be careful not to take address of &a[0] if len == 0: - // pass nil in that case. - textcommon += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1]) - textcommon += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) - argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("len(%s)", p.Name)) - argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n), fmt.Sprintf("_lenp%d int", n)) - argsgc = append(argsgc, fmt.Sprintf("_p%d", n), fmt.Sprintf("uintptr(_lenp%d)", n)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n), fmt.Sprintf("C.size_t(_lenp%d)", n)) - n++ - } else if p.Type == "int64" && endianness != "" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses int64 with 32 bits mode. Case not yet implemented\n") - } else if p.Type == "bool" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses bool. Case not yet implemented\n") - } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil || p.Type == "unsafe.Pointer" { - argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name)) - argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) - argsgc = append(argsgc, p.Name) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else if p.Type == "int" { - if (argN == 0 || argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt") || (funct == "FcntlFlock")) { - // These fcntl arguments need to be uintptr to be able to call FcntlInt and FcntlFlock - argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name)) - argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) - argsgc = append(argsgc, p.Name) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - - } else { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s int", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) - } - } else if p.Type == "int32" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s int32", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) - } else if p.Type == "int64" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s int64", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.longlong(%s)", p.Name)) - } else if p.Type == "uint32" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s uint32", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uint(%s)", p.Name)) - } else if p.Type == "uint64" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s uint64", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.ulonglong(%s)", p.Name)) - } else if p.Type == "uintptr" { - argscommon = append(argscommon, p.Name) - argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) - argsgc = append(argsgc, p.Name) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) - } else { - argscommon = append(argscommon, fmt.Sprintf("int(%s)", p.Name)) - argscall = append(argscall, fmt.Sprintf("%s int", p.Name)) - argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) - argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) - } - argN++ - } - nargs := len(argsgc) - - // COMMON function generation - argscommonlist := strings.Join(argscommon, ", ") - callcommon := fmt.Sprintf("call%s(%s)", sysname, argscommonlist) - ret := []string{"_", "_"} - body := "" - doErrno := false - for i := 0; i < len(out); i++ { - p := parseParam(out[i]) - reg := "" - if p.Name == "err" { - reg = "e1" - ret[1] = reg - doErrno = true - } else { - reg = "r0" - ret[0] = reg - } - if p.Type == "bool" { - reg = fmt.Sprintf("%s != 0", reg) - } - if reg != "e1" { - body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) - } - } - if ret[0] == "_" && ret[1] == "_" { - textcommon += fmt.Sprintf("\t%s\n", callcommon) - } else { - textcommon += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], callcommon) - } - textcommon += body - - if doErrno { - textcommon += "\tif e1 != 0 {\n" - textcommon += "\t\terr = errnoErr(e1)\n" - textcommon += "\t}\n" - } - textcommon += "\treturn\n" - textcommon += "}\n" - - if onlyCommon { - continue - } - - // CALL Prototype - callProto := fmt.Sprintf("func call%s(%s) (r1 uintptr, e1 Errno) {\n", sysname, strings.Join(argscall, ", ")) - - // GC function generation - asm := "syscall6" - if nonblock != nil { - asm = "rawSyscall6" - } - - if len(argsgc) <= 6 { - for len(argsgc) < 6 { - argsgc = append(argsgc, "0") - } - } else { - fmt.Fprintf(os.Stderr, "%s: too many arguments to system call", funct) - os.Exit(1) - } - argsgclist := strings.Join(argsgc, ", ") - callgc := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, argsgclist) - - textgc += callProto - textgc += fmt.Sprintf("\tr1, _, e1 = %s\n", callgc) - textgc += "\treturn\n}\n" - - // GCCGO function generation - argsgccgolist := strings.Join(argsgccgo, ", ") - var callgccgo string - if sysname == "select" { - // select is a keyword of Go. Its name is - // changed to c_select. - callgccgo = fmt.Sprintf("C.c_%s(%s)", sysname, argsgccgolist) - } else { - callgccgo = fmt.Sprintf("C.%s(%s)", sysname, argsgccgolist) - } - textgccgo += callProto - textgccgo += fmt.Sprintf("\tr1 = uintptr(%s)\n", callgccgo) - textgccgo += "\te1 = syscall.GetErrno()\n" - textgccgo += "\treturn\n}\n" - } - if err := s.Err(); err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - file.Close() - } - imp := "" - if pack != "unix" { - imp = "import \"golang.org/x/sys/unix\"\n" - - } - - // Print zsyscall_aix_ppc64.go - err := ioutil.WriteFile("zsyscall_aix_ppc64.go", - []byte(fmt.Sprintf(srcTemplate1, cmdLine(), buildTags(), pack, imp, textcommon)), - 0644) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - - // Print zsyscall_aix_ppc64_gc.go - vardecls := "\t" + strings.Join(vars, ",\n\t") - vardecls += " syscallFunc" - err = ioutil.WriteFile("zsyscall_aix_ppc64_gc.go", - []byte(fmt.Sprintf(srcTemplate2, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, textgc)), - 0644) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - - // Print zsyscall_aix_ppc64_gccgo.go - err = ioutil.WriteFile("zsyscall_aix_ppc64_gccgo.go", - []byte(fmt.Sprintf(srcTemplate3, cmdLine(), buildTags(), pack, cExtern, imp, textgccgo)), - 0644) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } -} - -const srcTemplate1 = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package %s - -import ( - "unsafe" -) - - -%s - -%s -` -const srcTemplate2 = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s -// +build !gccgo - -package %s - -import ( - "unsafe" -) -%s -%s -%s -type syscallFunc uintptr - -var ( -%s -) - -// Implemented in runtime/syscall_aix.go. -func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) -func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) - -%s -` -const srcTemplate3 = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s -// +build gccgo - -package %s - -%s -*/ -import "C" -import ( - "syscall" -) - - -%s - -%s -` diff --git a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go b/vendor/golang.org/x/sys/unix/mksyscall_solaris.go deleted file mode 100644 index 3d864738b6..0000000000 --- a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* - This program reads a file containing function prototypes - (like syscall_solaris.go) and generates system call bodies. - The prototypes are marked by lines beginning with "//sys" - and read like func declarations if //sys is replaced by func, but: - * The parameter lists must give a name for each argument. - This includes return parameters. - * The parameter lists must give a type for each argument: - the (x, y, z int) shorthand is not allowed. - * If the return parameter is an error number, it must be named err. - * If go func name needs to be different than its libc name, - * or the function is not in libc, name could be specified - * at the end, after "=" sign, like - //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt -*/ - -package main - -import ( - "bufio" - "flag" - "fmt" - "os" - "regexp" - "strings" -) - -var ( - b32 = flag.Bool("b32", false, "32bit big-endian") - l32 = flag.Bool("l32", false, "32bit little-endian") - tags = flag.String("tags", "", "build tags") -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksyscall_solaris.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return *tags -} - -// Param is function parameter -type Param struct { - Name string - Type string -} - -// usage prints the program usage -func usage() { - fmt.Fprintf(os.Stderr, "usage: go run mksyscall_solaris.go [-b32 | -l32] [-tags x,y] [file ...]\n") - os.Exit(1) -} - -// parseParamList parses parameter list and returns a slice of parameters -func parseParamList(list string) []string { - list = strings.TrimSpace(list) - if list == "" { - return []string{} - } - return regexp.MustCompile(`\s*,\s*`).Split(list, -1) -} - -// parseParam splits a parameter into name and type -func parseParam(p string) Param { - ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) - if ps == nil { - fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) - os.Exit(1) - } - return Param{ps[1], ps[2]} -} - -func main() { - flag.Usage = usage - flag.Parse() - if len(flag.Args()) <= 0 { - fmt.Fprintf(os.Stderr, "no files to parse provided\n") - usage() - } - - endianness := "" - if *b32 { - endianness = "big-endian" - } else if *l32 { - endianness = "little-endian" - } - - pack := "" - text := "" - dynimports := "" - linknames := "" - var vars []string - for _, path := range flag.Args() { - file, err := os.Open(path) - if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - t := s.Text() - t = strings.TrimSpace(t) - t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) - if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { - pack = p[1] - } - nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) - if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { - continue - } - - // Line must be of the form - // func Open(path string, mode int, perm int) (fd int, err error) - // Split into name, in params, out params. - f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) - if f == nil { - fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) - os.Exit(1) - } - funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] - - // Split argument lists on comma. - in := parseParamList(inps) - out := parseParamList(outps) - - inps = strings.Join(in, ", ") - outps = strings.Join(out, ", ") - - // Try in vain to keep people from editing this file. - // The theory is that they jump into the middle of the file - // without reading the header. - text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" - - // So file name. - if modname == "" { - modname = "libc" - } - - // System call name. - if sysname == "" { - sysname = funct - } - - // System call pointer variable name. - sysvarname := fmt.Sprintf("proc%s", sysname) - - strconvfunc := "BytePtrFromString" - strconvtype := "*byte" - - sysname = strings.ToLower(sysname) // All libc functions are lowercase. - - // Runtime import of function to allow cross-platform builds. - dynimports += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"%s.so\"\n", sysname, sysname, modname) - // Link symbol to proc address variable. - linknames += fmt.Sprintf("//go:linkname %s libc_%s\n", sysvarname, sysname) - // Library proc address variable. - vars = append(vars, sysvarname) - - // Go function header. - outlist := strings.Join(out, ", ") - if outlist != "" { - outlist = fmt.Sprintf(" (%s)", outlist) - } - if text != "" { - text += "\n" - } - text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outlist) - - // Check if err return available - errvar := "" - for _, param := range out { - p := parseParam(param) - if p.Type == "error" { - errvar = p.Name - continue - } - } - - // Prepare arguments to Syscall. - var args []string - n := 0 - for _, param := range in { - p := parseParam(param) - if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { - args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))") - } else if p.Type == "string" && errvar != "" { - text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) - text += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) - text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - n++ - } else if p.Type == "string" { - fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") - text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) - text += fmt.Sprintf("\t_p%d, _ = %s(%s)\n", n, strconvfunc, p.Name) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) - n++ - } else if s := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); s != nil { - // Convert slice into pointer, length. - // Have to be careful not to take address of &a[0] if len == 0: - // pass nil in that case. - text += fmt.Sprintf("\tvar _p%d *%s\n", n, s[1]) - text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) - args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("uintptr(len(%s))", p.Name)) - n++ - } else if p.Type == "int64" && endianness != "" { - if endianness == "big-endian" { - args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) - } - } else if p.Type == "bool" { - text += fmt.Sprintf("\tvar _p%d uint32\n", n) - text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n) - args = append(args, fmt.Sprintf("uintptr(_p%d)", n)) - n++ - } else { - args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) - } - } - nargs := len(args) - - // Determine which form to use; pad args with zeros. - asm := "sysvicall6" - if nonblock != nil { - asm = "rawSysvicall6" - } - if len(args) <= 6 { - for len(args) < 6 { - args = append(args, "0") - } - } else { - fmt.Fprintf(os.Stderr, "%s: too many arguments to system call\n", path) - os.Exit(1) - } - - // Actual call. - arglist := strings.Join(args, ", ") - call := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, arglist) - - // Assign return values. - body := "" - ret := []string{"_", "_", "_"} - doErrno := false - for i := 0; i < len(out); i++ { - p := parseParam(out[i]) - reg := "" - if p.Name == "err" { - reg = "e1" - ret[2] = reg - doErrno = true - } else { - reg = fmt.Sprintf("r%d", i) - ret[i] = reg - } - if p.Type == "bool" { - reg = fmt.Sprintf("%d != 0", reg) - } - if p.Type == "int64" && endianness != "" { - // 64-bit number in r1:r0 or r0:r1. - if i+2 > len(out) { - fmt.Fprintf(os.Stderr, "%s: not enough registers for int64 return\n", path) - os.Exit(1) - } - if endianness == "big-endian" { - reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1) - } else { - reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i) - } - ret[i] = fmt.Sprintf("r%d", i) - ret[i+1] = fmt.Sprintf("r%d", i+1) - } - if reg != "e1" { - body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) - } - } - if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" { - text += fmt.Sprintf("\t%s\n", call) - } else { - text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call) - } - text += body - - if doErrno { - text += "\tif e1 != 0 {\n" - text += "\t\terr = e1\n" - text += "\t}\n" - } - text += "\treturn\n" - text += "}\n" - } - if err := s.Err(); err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - os.Exit(1) - } - file.Close() - } - imp := "" - if pack != "unix" { - imp = "import \"golang.org/x/sys/unix\"\n" - - } - vardecls := "\t" + strings.Join(vars, ",\n\t") - vardecls += " syscallFunc" - fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, text) -} - -const srcTemplate = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package %s - -import ( - "syscall" - "unsafe" -) -%s -%s -%s -var ( -%s -) - -%s -` diff --git a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go b/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go deleted file mode 100644 index b6b409909c..0000000000 --- a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Parse the header files for OpenBSD and generate a Go usable sysctl MIB. -// -// Build a MIB with each entry being an array containing the level, type and -// a hash that will contain additional entries if the current entry is a node. -// We then walk this MIB and create a flattened sysctl name to OID hash. - -package main - -import ( - "bufio" - "fmt" - "os" - "path/filepath" - "regexp" - "sort" - "strings" -) - -var ( - goos, goarch string -) - -// cmdLine returns this programs's commandline arguments. -func cmdLine() string { - return "go run mksysctl_openbsd.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags. -func buildTags() string { - return fmt.Sprintf("%s,%s", goarch, goos) -} - -// reMatch performs regular expression match and stores the substring slice to value pointed by m. -func reMatch(re *regexp.Regexp, str string, m *[]string) bool { - *m = re.FindStringSubmatch(str) - if *m != nil { - return true - } - return false -} - -type nodeElement struct { - n int - t string - pE *map[string]nodeElement -} - -var ( - debugEnabled bool - mib map[string]nodeElement - node *map[string]nodeElement - nodeMap map[string]string - sysCtl []string -) - -var ( - ctlNames1RE = regexp.MustCompile(`^#define\s+(CTL_NAMES)\s+{`) - ctlNames2RE = regexp.MustCompile(`^#define\s+(CTL_(.*)_NAMES)\s+{`) - ctlNames3RE = regexp.MustCompile(`^#define\s+((.*)CTL_NAMES)\s+{`) - netInetRE = regexp.MustCompile(`^netinet/`) - netInet6RE = regexp.MustCompile(`^netinet6/`) - netRE = regexp.MustCompile(`^net/`) - bracesRE = regexp.MustCompile(`{.*}`) - ctlTypeRE = regexp.MustCompile(`{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}`) - fsNetKernRE = regexp.MustCompile(`^(fs|net|kern)_`) -) - -func debug(s string) { - if debugEnabled { - fmt.Fprintln(os.Stderr, s) - } -} - -// Walk the MIB and build a sysctl name to OID mapping. -func buildSysctl(pNode *map[string]nodeElement, name string, oid []int) { - lNode := pNode // local copy of pointer to node - var keys []string - for k := range *lNode { - keys = append(keys, k) - } - sort.Strings(keys) - - for _, key := range keys { - nodename := name - if name != "" { - nodename += "." - } - nodename += key - - nodeoid := append(oid, (*pNode)[key].n) - - if (*pNode)[key].t == `CTLTYPE_NODE` { - if _, ok := nodeMap[nodename]; ok { - lNode = &mib - ctlName := nodeMap[nodename] - for _, part := range strings.Split(ctlName, ".") { - lNode = ((*lNode)[part]).pE - } - } else { - lNode = (*pNode)[key].pE - } - buildSysctl(lNode, nodename, nodeoid) - } else if (*pNode)[key].t != "" { - oidStr := []string{} - for j := range nodeoid { - oidStr = append(oidStr, fmt.Sprintf("%d", nodeoid[j])) - } - text := "\t{ \"" + nodename + "\", []_C_int{ " + strings.Join(oidStr, ", ") + " } }, \n" - sysCtl = append(sysCtl, text) - } - } -} - -func main() { - // Get the OS (using GOOS_TARGET if it exist) - goos = os.Getenv("GOOS_TARGET") - if goos == "" { - goos = os.Getenv("GOOS") - } - // Get the architecture (using GOARCH_TARGET if it exists) - goarch = os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - // Check if GOOS and GOARCH environment variables are defined - if goarch == "" || goos == "" { - fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n") - os.Exit(1) - } - - mib = make(map[string]nodeElement) - headers := [...]string{ - `sys/sysctl.h`, - `sys/socket.h`, - `sys/tty.h`, - `sys/malloc.h`, - `sys/mount.h`, - `sys/namei.h`, - `sys/sem.h`, - `sys/shm.h`, - `sys/vmmeter.h`, - `uvm/uvmexp.h`, - `uvm/uvm_param.h`, - `uvm/uvm_swap_encrypt.h`, - `ddb/db_var.h`, - `net/if.h`, - `net/if_pfsync.h`, - `net/pipex.h`, - `netinet/in.h`, - `netinet/icmp_var.h`, - `netinet/igmp_var.h`, - `netinet/ip_ah.h`, - `netinet/ip_carp.h`, - `netinet/ip_divert.h`, - `netinet/ip_esp.h`, - `netinet/ip_ether.h`, - `netinet/ip_gre.h`, - `netinet/ip_ipcomp.h`, - `netinet/ip_ipip.h`, - `netinet/pim_var.h`, - `netinet/tcp_var.h`, - `netinet/udp_var.h`, - `netinet6/in6.h`, - `netinet6/ip6_divert.h`, - `netinet6/pim6_var.h`, - `netinet/icmp6.h`, - `netmpls/mpls.h`, - } - - ctls := [...]string{ - `kern`, - `vm`, - `fs`, - `net`, - //debug /* Special handling required */ - `hw`, - //machdep /* Arch specific */ - `user`, - `ddb`, - //vfs /* Special handling required */ - `fs.posix`, - `kern.forkstat`, - `kern.intrcnt`, - `kern.malloc`, - `kern.nchstats`, - `kern.seminfo`, - `kern.shminfo`, - `kern.timecounter`, - `kern.tty`, - `kern.watchdog`, - `net.bpf`, - `net.ifq`, - `net.inet`, - `net.inet.ah`, - `net.inet.carp`, - `net.inet.divert`, - `net.inet.esp`, - `net.inet.etherip`, - `net.inet.gre`, - `net.inet.icmp`, - `net.inet.igmp`, - `net.inet.ip`, - `net.inet.ip.ifq`, - `net.inet.ipcomp`, - `net.inet.ipip`, - `net.inet.mobileip`, - `net.inet.pfsync`, - `net.inet.pim`, - `net.inet.tcp`, - `net.inet.udp`, - `net.inet6`, - `net.inet6.divert`, - `net.inet6.ip6`, - `net.inet6.icmp6`, - `net.inet6.pim6`, - `net.inet6.tcp6`, - `net.inet6.udp6`, - `net.mpls`, - `net.mpls.ifq`, - `net.key`, - `net.pflow`, - `net.pfsync`, - `net.pipex`, - `net.rt`, - `vm.swapencrypt`, - //vfsgenctl /* Special handling required */ - } - - // Node name "fixups" - ctlMap := map[string]string{ - "ipproto": "net.inet", - "net.inet.ipproto": "net.inet", - "net.inet6.ipv6proto": "net.inet6", - "net.inet6.ipv6": "net.inet6.ip6", - "net.inet.icmpv6": "net.inet6.icmp6", - "net.inet6.divert6": "net.inet6.divert", - "net.inet6.tcp6": "net.inet.tcp", - "net.inet6.udp6": "net.inet.udp", - "mpls": "net.mpls", - "swpenc": "vm.swapencrypt", - } - - // Node mappings - nodeMap = map[string]string{ - "net.inet.ip.ifq": "net.ifq", - "net.inet.pfsync": "net.pfsync", - "net.mpls.ifq": "net.ifq", - } - - mCtls := make(map[string]bool) - for _, ctl := range ctls { - mCtls[ctl] = true - } - - for _, header := range headers { - debug("Processing " + header) - file, err := os.Open(filepath.Join("/usr/include", header)) - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) - } - s := bufio.NewScanner(file) - for s.Scan() { - var sub []string - if reMatch(ctlNames1RE, s.Text(), &sub) || - reMatch(ctlNames2RE, s.Text(), &sub) || - reMatch(ctlNames3RE, s.Text(), &sub) { - if sub[1] == `CTL_NAMES` { - // Top level. - node = &mib - } else { - // Node. - nodename := strings.ToLower(sub[2]) - ctlName := "" - if reMatch(netInetRE, header, &sub) { - ctlName = "net.inet." + nodename - } else if reMatch(netInet6RE, header, &sub) { - ctlName = "net.inet6." + nodename - } else if reMatch(netRE, header, &sub) { - ctlName = "net." + nodename - } else { - ctlName = nodename - ctlName = fsNetKernRE.ReplaceAllString(ctlName, `$1.`) - } - - if val, ok := ctlMap[ctlName]; ok { - ctlName = val - } - if _, ok := mCtls[ctlName]; !ok { - debug("Ignoring " + ctlName + "...") - continue - } - - // Walk down from the top of the MIB. - node = &mib - for _, part := range strings.Split(ctlName, ".") { - if _, ok := (*node)[part]; !ok { - debug("Missing node " + part) - (*node)[part] = nodeElement{n: 0, t: "", pE: &map[string]nodeElement{}} - } - node = (*node)[part].pE - } - } - - // Populate current node with entries. - i := -1 - for !strings.HasPrefix(s.Text(), "}") { - s.Scan() - if reMatch(bracesRE, s.Text(), &sub) { - i++ - } - if !reMatch(ctlTypeRE, s.Text(), &sub) { - continue - } - (*node)[sub[1]] = nodeElement{n: i, t: sub[2], pE: &map[string]nodeElement{}} - } - } - } - err = s.Err() - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) - } - file.Close() - } - buildSysctl(&mib, "", []int{}) - - sort.Strings(sysCtl) - text := strings.Join(sysCtl, "") - - fmt.Printf(srcTemplate, cmdLine(), buildTags(), text) -} - -const srcTemplate = `// %s -// Code generated by the command above; DO NOT EDIT. - -// +build %s - -package unix - -type mibentry struct { - ctlname string - ctloid []_C_int -} - -var sysctlMib = []mibentry { -%s -} -` diff --git a/vendor/golang.org/x/sys/unix/mksysnum.go b/vendor/golang.org/x/sys/unix/mksysnum.go deleted file mode 100644 index baa6ecd850..0000000000 --- a/vendor/golang.org/x/sys/unix/mksysnum.go +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Generate system call table for DragonFly, NetBSD, -// FreeBSD, OpenBSD or Darwin from master list -// (for example, /usr/src/sys/kern/syscalls.master or -// sys/syscall.h). -package main - -import ( - "bufio" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "regexp" - "strings" -) - -var ( - goos, goarch string -) - -// cmdLine returns this programs's commandline arguments -func cmdLine() string { - return "go run mksysnum.go " + strings.Join(os.Args[1:], " ") -} - -// buildTags returns build tags -func buildTags() string { - return fmt.Sprintf("%s,%s", goarch, goos) -} - -func checkErr(err error) { - if err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) - } -} - -// source string and substring slice for regexp -type re struct { - str string // source string - sub []string // matched sub-string -} - -// Match performs regular expression match -func (r *re) Match(exp string) bool { - r.sub = regexp.MustCompile(exp).FindStringSubmatch(r.str) - if r.sub != nil { - return true - } - return false -} - -// fetchFile fetches a text file from URL -func fetchFile(URL string) io.Reader { - resp, err := http.Get(URL) - checkErr(err) - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - checkErr(err) - return strings.NewReader(string(body)) -} - -// readFile reads a text file from path -func readFile(path string) io.Reader { - file, err := os.Open(os.Args[1]) - checkErr(err) - return file -} - -func format(name, num, proto string) string { - name = strings.ToUpper(name) - // There are multiple entries for enosys and nosys, so comment them out. - nm := re{str: name} - if nm.Match(`^SYS_E?NOSYS$`) { - name = fmt.Sprintf("// %s", name) - } - if name == `SYS_SYS_EXIT` { - name = `SYS_EXIT` - } - return fmt.Sprintf(" %s = %s; // %s\n", name, num, proto) -} - -func main() { - // Get the OS (using GOOS_TARGET if it exist) - goos = os.Getenv("GOOS_TARGET") - if goos == "" { - goos = os.Getenv("GOOS") - } - // Get the architecture (using GOARCH_TARGET if it exists) - goarch = os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - // Check if GOOS and GOARCH environment variables are defined - if goarch == "" || goos == "" { - fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n") - os.Exit(1) - } - - file := strings.TrimSpace(os.Args[1]) - var syscalls io.Reader - if strings.HasPrefix(file, "https://") || strings.HasPrefix(file, "http://") { - // Download syscalls.master file - syscalls = fetchFile(file) - } else { - syscalls = readFile(file) - } - - var text, line string - s := bufio.NewScanner(syscalls) - for s.Scan() { - t := re{str: line} - if t.Match(`^(.*)\\$`) { - // Handle continuation - line = t.sub[1] - line += strings.TrimLeft(s.Text(), " \t") - } else { - // New line - line = s.Text() - } - t = re{str: line} - if t.Match(`\\$`) { - continue - } - t = re{str: line} - - switch goos { - case "dragonfly": - if t.Match(`^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$`) { - num, proto := t.sub[1], t.sub[2] - name := fmt.Sprintf("SYS_%s", t.sub[3]) - text += format(name, num, proto) - } - case "freebsd": - if t.Match(`^([0-9]+)\s+\S+\s+(?:(?:NO)?STD|COMPAT10)\s+({ \S+\s+(\w+).*)$`) { - num, proto := t.sub[1], t.sub[2] - name := fmt.Sprintf("SYS_%s", t.sub[3]) - text += format(name, num, proto) - } - case "openbsd": - if t.Match(`^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$`) { - num, proto, name := t.sub[1], t.sub[3], t.sub[4] - text += format(name, num, proto) - } - case "netbsd": - if t.Match(`^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$`) { - num, proto, compat := t.sub[1], t.sub[6], t.sub[8] - name := t.sub[7] + "_" + t.sub[9] - if t.sub[11] != "" { - name = t.sub[7] + "_" + t.sub[11] - } - name = strings.ToUpper(name) - if compat == "" || compat == "13" || compat == "30" || compat == "50" { - text += fmt.Sprintf(" %s = %s; // %s\n", name, num, proto) - } - } - case "darwin": - if t.Match(`^#define\s+SYS_(\w+)\s+([0-9]+)`) { - name, num := t.sub[1], t.sub[2] - name = strings.ToUpper(name) - text += fmt.Sprintf(" SYS_%s = %s;\n", name, num) - } - default: - fmt.Fprintf(os.Stderr, "unrecognized GOOS=%s\n", goos) - os.Exit(1) - - } - } - err := s.Err() - checkErr(err) - - fmt.Printf(template, cmdLine(), buildTags(), text) -} - -const template = `// %s -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s - -package unix - -const( -%s)` diff --git a/vendor/golang.org/x/sys/unix/types_aix.go b/vendor/golang.org/x/sys/unix/types_aix.go deleted file mode 100644 index 40d2beede5..0000000000 --- a/vendor/golang.org/x/sys/unix/types_aix.go +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore -// +build aix - -/* -Input to cgo -godefs. See also mkerrors.sh and mkall.sh -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - - -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong - PathMax = C.PATH_MAX -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -type off64 C.off64_t -type off C.off_t -type Mode_t C.mode_t - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -type Timex C.struct_timex - -type Time_t C.time_t - -type Tms C.struct_tms - -type Utimbuf C.struct_utimbuf - -type Timezone C.struct_timezone - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit64 - -type Pid_t C.pid_t - -type _Gid_t C.gid_t - -type dev_t C.dev_t - -// Files - -type Stat_t C.struct_stat - -type StatxTimestamp C.struct_statx_timestamp - -type Statx_t C.struct_statx - -type Dirent C.struct_dirent - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Cmsghdr C.struct_cmsghdr - -type ICMPv6Filter C.struct_icmp6_filter - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type Linger C.struct_linger - -type Msghdr C.struct_msghdr - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr -) - -type IfMsgHdr C.struct_if_msghdr - -// Misc - -type FdSet C.fd_set - -type Utsname C.struct_utsname - -type Ustat_t C.struct_ustat - -type Sigset_t C.sigset_t - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// Terminal handling - -type Termios C.struct_termios - -type Termio C.struct_termio - -type Winsize C.struct_winsize - -//poll - -type PollFd struct { - Fd int32 - Events uint16 - Revents uint16 -} - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -//flock_t - -type Flock_t C.struct_flock64 - -// Statfs - -type Fsid_t C.struct_fsid_t -type Fsid64_t C.struct_fsid64_t - -type Statfs_t C.struct_statfs - -const RNDGETENTCNT = 0x80045200 diff --git a/vendor/golang.org/x/sys/unix/types_darwin.go b/vendor/golang.org/x/sys/unix/types_darwin.go deleted file mode 100644 index 155c2e692b..0000000000 --- a/vendor/golang.org/x/sys/unix/types_darwin.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define __DARWIN_UNIX03 0 -#define KERNEL -#define _DARWIN_USE_64_BIT_INODE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat64 - -type Statfs_t C.struct_statfs64 - -type Flock_t C.struct_flock - -type Fstore_t C.struct_fstore - -type Radvisory_t C.struct_radvisory - -type Fbootstraptransfer_t C.struct_fbootstraptransfer - -type Log2phys_t C.struct_log2phys - -type Fsid C.struct_fsid - -type Dirent C.struct_dirent - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet4Pktinfo C.struct_in_pktinfo - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2 - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfmaMsghdr2 C.struct_ifma_msghdr2 - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// uname - -type Utsname C.struct_utsname - -// Clockinfo - -const SizeofClockinfo = C.sizeof_struct_clockinfo - -type Clockinfo C.struct_clockinfo diff --git a/vendor/golang.org/x/sys/unix/types_dragonfly.go b/vendor/golang.org/x/sys/unix/types_dragonfly.go deleted file mode 100644 index 3365dd79d0..0000000000 --- a/vendor/golang.org/x/sys/unix/types_dragonfly.go +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.struct_fsid - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Uname - -type Utsname C.struct_utsname diff --git a/vendor/golang.org/x/sys/unix/types_freebsd.go b/vendor/golang.org/x/sys/unix/types_freebsd.go deleted file mode 100644 index a121dc3368..0000000000 --- a/vendor/golang.org/x/sys/unix/types_freebsd.go +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define _WANT_FREEBSD11_STAT 1 -#define _WANT_FREEBSD11_STATFS 1 -#define _WANT_FREEBSD11_DIRENT 1 -#define _WANT_FREEBSD11_KEVENT 1 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -// This structure is a duplicate of if_data on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_data8 { - u_char ifi_type; - u_char ifi_physical; - u_char ifi_addrlen; - u_char ifi_hdrlen; - u_char ifi_link_state; - u_char ifi_spare_char1; - u_char ifi_spare_char2; - u_char ifi_datalen; - u_long ifi_mtu; - u_long ifi_metric; - u_long ifi_baudrate; - u_long ifi_ipackets; - u_long ifi_ierrors; - u_long ifi_opackets; - u_long ifi_oerrors; - u_long ifi_collisions; - u_long ifi_ibytes; - u_long ifi_obytes; - u_long ifi_imcasts; - u_long ifi_omcasts; - u_long ifi_iqdrops; - u_long ifi_noproto; - u_long ifi_hwassist; -// FIXME: these are now unions, so maybe need to change definitions? -#undef ifi_epoch - time_t ifi_epoch; -#undef ifi_lastchange - struct timeval ifi_lastchange; -}; - -// This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_msghdr8 { - u_short ifm_msglen; - u_char ifm_version; - u_char ifm_type; - int ifm_addrs; - int ifm_flags; - u_short ifm_index; - struct if_data8 ifm_data; -}; -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( - _statfsVersion = C.STATFS_VERSION - _dirblksiz = C.DIRBLKSIZ -) - -type Stat_t C.struct_stat - -type stat_freebsd11_t C.struct_freebsd11_stat - -type Statfs_t C.struct_statfs - -type statfs_freebsd11_t C.struct_freebsd11_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type dirent_freebsd11 C.struct_freebsd11_dirent - -type Fsid C.struct_fsid - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Advice to Fadvise - -const ( - FADV_NORMAL = C.POSIX_FADV_NORMAL - FADV_RANDOM = C.POSIX_FADV_RANDOM - FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL - FADV_WILLNEED = C.POSIX_FADV_WILLNEED - FADV_DONTNEED = C.POSIX_FADV_DONTNEED - FADV_NOREUSE = C.POSIX_FADV_NOREUSE -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPMreqn C.struct_ip_mreqn - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPMreqn = C.sizeof_struct_ip_mreqn - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_ATTACH = C.PT_ATTACH - PTRACE_CONT = C.PT_CONTINUE - PTRACE_DETACH = C.PT_DETACH - PTRACE_GETFPREGS = C.PT_GETFPREGS - PTRACE_GETFSBASE = C.PT_GETFSBASE - PTRACE_GETLWPLIST = C.PT_GETLWPLIST - PTRACE_GETNUMLWPS = C.PT_GETNUMLWPS - PTRACE_GETREGS = C.PT_GETREGS - PTRACE_GETXSTATE = C.PT_GETXSTATE - PTRACE_IO = C.PT_IO - PTRACE_KILL = C.PT_KILL - PTRACE_LWPEVENTS = C.PT_LWP_EVENTS - PTRACE_LWPINFO = C.PT_LWPINFO - PTRACE_SETFPREGS = C.PT_SETFPREGS - PTRACE_SETREGS = C.PT_SETREGS - PTRACE_SINGLESTEP = C.PT_STEP - PTRACE_TRACEME = C.PT_TRACE_ME -) - -const ( - PIOD_READ_D = C.PIOD_READ_D - PIOD_WRITE_D = C.PIOD_WRITE_D - PIOD_READ_I = C.PIOD_READ_I - PIOD_WRITE_I = C.PIOD_WRITE_I -) - -const ( - PL_FLAG_BORN = C.PL_FLAG_BORN - PL_FLAG_EXITED = C.PL_FLAG_EXITED - PL_FLAG_SI = C.PL_FLAG_SI -) - -const ( - TRAP_BRKPT = C.TRAP_BRKPT - TRAP_TRACE = C.TRAP_TRACE -) - -type PtraceLwpInfoStruct C.struct_ptrace_lwpinfo - -type __Siginfo C.struct___siginfo - -type Sigset_t C.sigset_t - -type Reg C.struct_reg - -type FpReg C.struct_fpreg - -type PtraceIoDesc C.struct_ptrace_io_desc - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent_freebsd11 - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - sizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfMsghdr = C.sizeof_struct_if_msghdr8 - sizeofIfData = C.sizeof_struct_if_data - SizeofIfData = C.sizeof_struct_if_data8 - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type ifMsghdr C.struct_if_msghdr - -type IfMsghdr C.struct_if_msghdr8 - -type ifData C.struct_if_data - -type IfData C.struct_if_data8 - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr - SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfZbuf C.struct_bpf_zbuf - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfZbufHeader C.struct_bpf_zbuf_header - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLINIGNEOF = C.POLLINIGNEOF - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Capabilities - -type CapRights C.struct_cap_rights - -// Uname - -type Utsname C.struct_utsname diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_netbsd.go deleted file mode 100644 index 4a96d72c37..0000000000 --- a/vendor/golang.org/x/sys/unix/types_netbsd.go +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Advice to Fadvise - -const ( - FADV_NORMAL = C.POSIX_FADV_NORMAL - FADV_RANDOM = C.POSIX_FADV_RANDOM - FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL - FADV_WILLNEED = C.POSIX_FADV_WILLNEED - FADV_DONTNEED = C.POSIX_FADV_DONTNEED - FADV_NOREUSE = C.POSIX_FADV_NOREUSE -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -type Ptmget C.struct_ptmget - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Sysctl - -type Sysctlnode C.struct_sysctlnode - -// Uname - -type Utsname C.struct_utsname - -// Clockinfo - -const SizeofClockinfo = C.sizeof_struct_clockinfo - -type Clockinfo C.struct_clockinfo diff --git a/vendor/golang.org/x/sys/unix/types_openbsd.go b/vendor/golang.org/x/sys/unix/types_openbsd.go deleted file mode 100644 index 775cb57dc8..0000000000 --- a/vendor/golang.org/x/sys/unix/types_openbsd.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// File system limits - -const ( - PathMax = C.PATH_MAX -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) - -// Signal Sets - -type Sigset_t C.sigset_t - -// Uname - -type Utsname C.struct_utsname - -// Uvmexp - -const SizeofUvmexp = C.sizeof_struct_uvmexp - -type Uvmexp C.struct_uvmexp - -// Clockinfo - -const SizeofClockinfo = C.sizeof_struct_clockinfo - -type Clockinfo C.struct_clockinfo diff --git a/vendor/golang.org/x/sys/unix/types_solaris.go b/vendor/golang.org/x/sys/unix/types_solaris.go deleted file mode 100644 index 2b716f9348..0000000000 --- a/vendor/golang.org/x/sys/unix/types_solaris.go +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -// These defines ensure that builds done on newer versions of Solaris are -// backwards-compatible with older versions of Solaris and -// OpenSolaris-based derivatives. -#define __USE_SUNOS_SOCKETS__ // msghdr -#define __USE_LEGACY_PROTOTYPES__ // iovec -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics - -const ( - SizeofPtr = C.sizeofPtr - SizeofShort = C.sizeof_short - SizeofInt = C.sizeof_int - SizeofLong = C.sizeof_long - SizeofLongLong = C.sizeof_longlong - PathMax = C.PATH_MAX - MaxHostNameLen = C.MAXHOSTNAMELEN -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -type Tms C.struct_tms - -type Utimbuf C.struct_utimbuf - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -// Filesystems - -type _Fsblkcnt_t C.fsblkcnt_t - -type Statvfs_t C.struct_statvfs - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Select - -type FdSet C.fd_set - -// Misc - -type Utsname C.struct_utsname - -type Ustat_t C.struct_ustat - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_EACCESS = C.AT_EACCESS -) - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfTimeval C.struct_bpf_timeval - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Termio C.struct_termio - -type Winsize C.struct_winsize - -// poll - -type PollFd C.struct_pollfd - -const ( - POLLERR = C.POLLERR - POLLHUP = C.POLLHUP - POLLIN = C.POLLIN - POLLNVAL = C.POLLNVAL - POLLOUT = C.POLLOUT - POLLPRI = C.POLLPRI - POLLRDBAND = C.POLLRDBAND - POLLRDNORM = C.POLLRDNORM - POLLWRBAND = C.POLLWRBAND - POLLWRNORM = C.POLLWRNORM -) diff --git a/vendor/golang.org/x/text/encoding/charmap/maketables.go b/vendor/golang.org/x/text/encoding/charmap/maketables.go deleted file mode 100644 index f7941701e8..0000000000 --- a/vendor/golang.org/x/text/encoding/charmap/maketables.go +++ /dev/null @@ -1,556 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" - "unicode/utf8" - - "golang.org/x/text/encoding" - "golang.org/x/text/internal/gen" -) - -const ascii = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" + - "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" + - ` !"#$%&'()*+,-./0123456789:;<=>?` + - `@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` + - "`abcdefghijklmnopqrstuvwxyz{|}~\u007f" - -var encodings = []struct { - name string - mib string - comment string - varName string - replacement byte - mapping string -}{ - { - "IBM Code Page 037", - "IBM037", - "", - "CodePage037", - 0x3f, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM037-2.1.2.ucm", - }, - { - "IBM Code Page 437", - "PC8CodePage437", - "", - "CodePage437", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM437-2.1.2.ucm", - }, - { - "IBM Code Page 850", - "PC850Multilingual", - "", - "CodePage850", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM850-2.1.2.ucm", - }, - { - "IBM Code Page 852", - "PCp852", - "", - "CodePage852", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM852-2.1.2.ucm", - }, - { - "IBM Code Page 855", - "IBM855", - "", - "CodePage855", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM855-2.1.2.ucm", - }, - { - "Windows Code Page 858", // PC latin1 with Euro - "IBM00858", - "", - "CodePage858", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/windows-858-2000.ucm", - }, - { - "IBM Code Page 860", - "IBM860", - "", - "CodePage860", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM860-2.1.2.ucm", - }, - { - "IBM Code Page 862", - "PC862LatinHebrew", - "", - "CodePage862", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM862-2.1.2.ucm", - }, - { - "IBM Code Page 863", - "IBM863", - "", - "CodePage863", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM863-2.1.2.ucm", - }, - { - "IBM Code Page 865", - "IBM865", - "", - "CodePage865", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM865-2.1.2.ucm", - }, - { - "IBM Code Page 866", - "IBM866", - "", - "CodePage866", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-ibm866.txt", - }, - { - "IBM Code Page 1047", - "IBM1047", - "", - "CodePage1047", - 0x3f, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/glibc-IBM1047-2.1.2.ucm", - }, - { - "IBM Code Page 1140", - "IBM01140", - "", - "CodePage1140", - 0x3f, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/ibm-1140_P100-1997.ucm", - }, - { - "ISO 8859-1", - "ISOLatin1", - "", - "ISO8859_1", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/iso-8859_1-1998.ucm", - }, - { - "ISO 8859-2", - "ISOLatin2", - "", - "ISO8859_2", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-2.txt", - }, - { - "ISO 8859-3", - "ISOLatin3", - "", - "ISO8859_3", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-3.txt", - }, - { - "ISO 8859-4", - "ISOLatin4", - "", - "ISO8859_4", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-4.txt", - }, - { - "ISO 8859-5", - "ISOLatinCyrillic", - "", - "ISO8859_5", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-5.txt", - }, - { - "ISO 8859-6", - "ISOLatinArabic", - "", - "ISO8859_6,ISO8859_6E,ISO8859_6I", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-6.txt", - }, - { - "ISO 8859-7", - "ISOLatinGreek", - "", - "ISO8859_7", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-7.txt", - }, - { - "ISO 8859-8", - "ISOLatinHebrew", - "", - "ISO8859_8,ISO8859_8E,ISO8859_8I", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-8.txt", - }, - { - "ISO 8859-9", - "ISOLatin5", - "", - "ISO8859_9", - encoding.ASCIISub, - "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/iso-8859_9-1999.ucm", - }, - { - "ISO 8859-10", - "ISOLatin6", - "", - "ISO8859_10", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-10.txt", - }, - { - "ISO 8859-13", - "ISO885913", - "", - "ISO8859_13", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-13.txt", - }, - { - "ISO 8859-14", - "ISO885914", - "", - "ISO8859_14", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-14.txt", - }, - { - "ISO 8859-15", - "ISO885915", - "", - "ISO8859_15", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-15.txt", - }, - { - "ISO 8859-16", - "ISO885916", - "", - "ISO8859_16", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-iso-8859-16.txt", - }, - { - "KOI8-R", - "KOI8R", - "", - "KOI8R", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-koi8-r.txt", - }, - { - "KOI8-U", - "KOI8U", - "", - "KOI8U", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-koi8-u.txt", - }, - { - "Macintosh", - "Macintosh", - "", - "Macintosh", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-macintosh.txt", - }, - { - "Macintosh Cyrillic", - "MacintoshCyrillic", - "", - "MacintoshCyrillic", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-x-mac-cyrillic.txt", - }, - { - "Windows 874", - "Windows874", - "", - "Windows874", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-874.txt", - }, - { - "Windows 1250", - "Windows1250", - "", - "Windows1250", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1250.txt", - }, - { - "Windows 1251", - "Windows1251", - "", - "Windows1251", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1251.txt", - }, - { - "Windows 1252", - "Windows1252", - "", - "Windows1252", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1252.txt", - }, - { - "Windows 1253", - "Windows1253", - "", - "Windows1253", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1253.txt", - }, - { - "Windows 1254", - "Windows1254", - "", - "Windows1254", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1254.txt", - }, - { - "Windows 1255", - "Windows1255", - "", - "Windows1255", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1255.txt", - }, - { - "Windows 1256", - "Windows1256", - "", - "Windows1256", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1256.txt", - }, - { - "Windows 1257", - "Windows1257", - "", - "Windows1257", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1257.txt", - }, - { - "Windows 1258", - "Windows1258", - "", - "Windows1258", - encoding.ASCIISub, - "http://encoding.spec.whatwg.org/index-windows-1258.txt", - }, - { - "X-User-Defined", - "XUserDefined", - "It is defined at http://encoding.spec.whatwg.org/#x-user-defined", - "XUserDefined", - encoding.ASCIISub, - ascii + - "\uf780\uf781\uf782\uf783\uf784\uf785\uf786\uf787" + - "\uf788\uf789\uf78a\uf78b\uf78c\uf78d\uf78e\uf78f" + - "\uf790\uf791\uf792\uf793\uf794\uf795\uf796\uf797" + - "\uf798\uf799\uf79a\uf79b\uf79c\uf79d\uf79e\uf79f" + - "\uf7a0\uf7a1\uf7a2\uf7a3\uf7a4\uf7a5\uf7a6\uf7a7" + - "\uf7a8\uf7a9\uf7aa\uf7ab\uf7ac\uf7ad\uf7ae\uf7af" + - "\uf7b0\uf7b1\uf7b2\uf7b3\uf7b4\uf7b5\uf7b6\uf7b7" + - "\uf7b8\uf7b9\uf7ba\uf7bb\uf7bc\uf7bd\uf7be\uf7bf" + - "\uf7c0\uf7c1\uf7c2\uf7c3\uf7c4\uf7c5\uf7c6\uf7c7" + - "\uf7c8\uf7c9\uf7ca\uf7cb\uf7cc\uf7cd\uf7ce\uf7cf" + - "\uf7d0\uf7d1\uf7d2\uf7d3\uf7d4\uf7d5\uf7d6\uf7d7" + - "\uf7d8\uf7d9\uf7da\uf7db\uf7dc\uf7dd\uf7de\uf7df" + - "\uf7e0\uf7e1\uf7e2\uf7e3\uf7e4\uf7e5\uf7e6\uf7e7" + - "\uf7e8\uf7e9\uf7ea\uf7eb\uf7ec\uf7ed\uf7ee\uf7ef" + - "\uf7f0\uf7f1\uf7f2\uf7f3\uf7f4\uf7f5\uf7f6\uf7f7" + - "\uf7f8\uf7f9\uf7fa\uf7fb\uf7fc\uf7fd\uf7fe\uf7ff", - }, -} - -func getWHATWG(url string) string { - res, err := http.Get(url) - if err != nil { - log.Fatalf("%q: Get: %v", url, err) - } - defer res.Body.Close() - - mapping := make([]rune, 128) - for i := range mapping { - mapping[i] = '\ufffd' - } - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := 0, 0 - if _, err := fmt.Sscanf(s, "%d\t0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0 || 128 <= x { - log.Fatalf("code %d is out of range", x) - } - if 0x80 <= y && y < 0xa0 { - // We diverge from the WHATWG spec by mapping control characters - // in the range [0x80, 0xa0) to U+FFFD. - continue - } - mapping[x] = rune(y) - } - return ascii + string(mapping) -} - -func getUCM(url string) string { - res, err := http.Get(url) - if err != nil { - log.Fatalf("%q: Get: %v", url, err) - } - defer res.Body.Close() - - mapping := make([]rune, 256) - for i := range mapping { - mapping[i] = '\ufffd' - } - - charsFound := 0 - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - var c byte - var r rune - if _, err := fmt.Sscanf(s, ` \x%x |0`, &r, &c); err != nil { - continue - } - mapping[c] = r - charsFound++ - } - - if charsFound < 200 { - log.Fatalf("%q: only %d characters found (wrong page format?)", url, charsFound) - } - - return string(mapping) -} - -func main() { - mibs := map[string]bool{} - all := []string{} - - w := gen.NewCodeWriter() - defer w.WriteGoFile("tables.go", "charmap") - - printf := func(s string, a ...interface{}) { fmt.Fprintf(w, s, a...) } - - printf("import (\n") - printf("\t\"golang.org/x/text/encoding\"\n") - printf("\t\"golang.org/x/text/encoding/internal/identifier\"\n") - printf(")\n\n") - for _, e := range encodings { - varNames := strings.Split(e.varName, ",") - all = append(all, varNames...) - varName := varNames[0] - switch { - case strings.HasPrefix(e.mapping, "http://encoding.spec.whatwg.org/"): - e.mapping = getWHATWG(e.mapping) - case strings.HasPrefix(e.mapping, "http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/"): - e.mapping = getUCM(e.mapping) - } - - asciiSuperset, low := strings.HasPrefix(e.mapping, ascii), 0x00 - if asciiSuperset { - low = 0x80 - } - lvn := 1 - if strings.HasPrefix(varName, "ISO") || strings.HasPrefix(varName, "KOI") { - lvn = 3 - } - lowerVarName := strings.ToLower(varName[:lvn]) + varName[lvn:] - printf("// %s is the %s encoding.\n", varName, e.name) - if e.comment != "" { - printf("//\n// %s\n", e.comment) - } - printf("var %s *Charmap = &%s\n\nvar %s = Charmap{\nname: %q,\n", - varName, lowerVarName, lowerVarName, e.name) - if mibs[e.mib] { - log.Fatalf("MIB type %q declared multiple times.", e.mib) - } - printf("mib: identifier.%s,\n", e.mib) - printf("asciiSuperset: %t,\n", asciiSuperset) - printf("low: 0x%02x,\n", low) - printf("replacement: 0x%02x,\n", e.replacement) - - printf("decode: [256]utf8Enc{\n") - i, backMapping := 0, map[rune]byte{} - for _, c := range e.mapping { - if _, ok := backMapping[c]; !ok && c != utf8.RuneError { - backMapping[c] = byte(i) - } - var buf [8]byte - n := utf8.EncodeRune(buf[:], c) - if n > 3 { - panic(fmt.Sprintf("rune %q (%U) is too long", c, c)) - } - printf("{%d,[3]byte{0x%02x,0x%02x,0x%02x}},", n, buf[0], buf[1], buf[2]) - if i%2 == 1 { - printf("\n") - } - i++ - } - printf("},\n") - - printf("encode: [256]uint32{\n") - encode := make([]uint32, 0, 256) - for c, i := range backMapping { - encode = append(encode, uint32(i)<<24|uint32(c)) - } - sort.Sort(byRune(encode)) - for len(encode) < cap(encode) { - encode = append(encode, encode[len(encode)-1]) - } - for i, enc := range encode { - printf("0x%08x,", enc) - if i%8 == 7 { - printf("\n") - } - } - printf("},\n}\n") - - // Add an estimate of the size of a single Charmap{} struct value, which - // includes two 256 elem arrays of 4 bytes and some extra fields, which - // align to 3 uint64s on 64-bit architectures. - w.Size += 2*4*256 + 3*8 - } - // TODO: add proper line breaking. - printf("var listAll = []encoding.Encoding{\n%s,\n}\n\n", strings.Join(all, ",\n")) -} - -type byRune []uint32 - -func (b byRune) Len() int { return len(b) } -func (b byRune) Less(i, j int) bool { return b[i]&0xffffff < b[j]&0xffffff } -func (b byRune) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/encoding/htmlindex/gen.go b/vendor/golang.org/x/text/encoding/htmlindex/gen.go deleted file mode 100644 index ac6b4a77fd..0000000000 --- a/vendor/golang.org/x/text/encoding/htmlindex/gen.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "bytes" - "encoding/json" - "fmt" - "log" - "strings" - - "golang.org/x/text/internal/gen" -) - -type group struct { - Encodings []struct { - Labels []string - Name string - } -} - -func main() { - gen.Init() - - r := gen.Open("https://encoding.spec.whatwg.org", "whatwg", "encodings.json") - var groups []group - if err := json.NewDecoder(r).Decode(&groups); err != nil { - log.Fatalf("Error reading encodings.json: %v", err) - } - - w := &bytes.Buffer{} - fmt.Fprintln(w, "type htmlEncoding byte") - fmt.Fprintln(w, "const (") - for i, g := range groups { - for _, e := range g.Encodings { - key := strings.ToLower(e.Name) - name := consts[key] - if name == "" { - log.Fatalf("No const defined for %s.", key) - } - if i == 0 { - fmt.Fprintf(w, "%s htmlEncoding = iota\n", name) - } else { - fmt.Fprintf(w, "%s\n", name) - } - } - } - fmt.Fprintln(w, "numEncodings") - fmt.Fprint(w, ")\n\n") - - fmt.Fprintln(w, "var canonical = [numEncodings]string{") - for _, g := range groups { - for _, e := range g.Encodings { - fmt.Fprintf(w, "%q,\n", strings.ToLower(e.Name)) - } - } - fmt.Fprint(w, "}\n\n") - - fmt.Fprintln(w, "var nameMap = map[string]htmlEncoding{") - for _, g := range groups { - for _, e := range g.Encodings { - for _, l := range e.Labels { - key := strings.ToLower(e.Name) - name := consts[key] - fmt.Fprintf(w, "%q: %s,\n", l, name) - } - } - } - fmt.Fprint(w, "}\n\n") - - var tags []string - fmt.Fprintln(w, "var localeMap = []htmlEncoding{") - for _, loc := range locales { - tags = append(tags, loc.tag) - fmt.Fprintf(w, "%s, // %s \n", consts[loc.name], loc.tag) - } - fmt.Fprint(w, "}\n\n") - - fmt.Fprintf(w, "const locales = %q\n", strings.Join(tags, " ")) - - gen.WriteGoFile("tables.go", "htmlindex", w.Bytes()) -} - -// consts maps canonical encoding name to internal constant. -var consts = map[string]string{ - "utf-8": "utf8", - "ibm866": "ibm866", - "iso-8859-2": "iso8859_2", - "iso-8859-3": "iso8859_3", - "iso-8859-4": "iso8859_4", - "iso-8859-5": "iso8859_5", - "iso-8859-6": "iso8859_6", - "iso-8859-7": "iso8859_7", - "iso-8859-8": "iso8859_8", - "iso-8859-8-i": "iso8859_8I", - "iso-8859-10": "iso8859_10", - "iso-8859-13": "iso8859_13", - "iso-8859-14": "iso8859_14", - "iso-8859-15": "iso8859_15", - "iso-8859-16": "iso8859_16", - "koi8-r": "koi8r", - "koi8-u": "koi8u", - "macintosh": "macintosh", - "windows-874": "windows874", - "windows-1250": "windows1250", - "windows-1251": "windows1251", - "windows-1252": "windows1252", - "windows-1253": "windows1253", - "windows-1254": "windows1254", - "windows-1255": "windows1255", - "windows-1256": "windows1256", - "windows-1257": "windows1257", - "windows-1258": "windows1258", - "x-mac-cyrillic": "macintoshCyrillic", - "gbk": "gbk", - "gb18030": "gb18030", - // "hz-gb-2312": "hzgb2312", // Was removed from WhatWG - "big5": "big5", - "euc-jp": "eucjp", - "iso-2022-jp": "iso2022jp", - "shift_jis": "shiftJIS", - "euc-kr": "euckr", - "replacement": "replacement", - "utf-16be": "utf16be", - "utf-16le": "utf16le", - "x-user-defined": "xUserDefined", -} - -// locales is taken from -// https://html.spec.whatwg.org/multipage/syntax.html#encoding-sniffing-algorithm. -var locales = []struct{ tag, name string }{ - // The default value. Explicitly state latin to benefit from the exact - // script option, while still making 1252 the default encoding for languages - // written in Latin script. - {"und_Latn", "windows-1252"}, - {"ar", "windows-1256"}, - {"ba", "windows-1251"}, - {"be", "windows-1251"}, - {"bg", "windows-1251"}, - {"cs", "windows-1250"}, - {"el", "iso-8859-7"}, - {"et", "windows-1257"}, - {"fa", "windows-1256"}, - {"he", "windows-1255"}, - {"hr", "windows-1250"}, - {"hu", "iso-8859-2"}, - {"ja", "shift_jis"}, - {"kk", "windows-1251"}, - {"ko", "euc-kr"}, - {"ku", "windows-1254"}, - {"ky", "windows-1251"}, - {"lt", "windows-1257"}, - {"lv", "windows-1257"}, - {"mk", "windows-1251"}, - {"pl", "iso-8859-2"}, - {"ru", "windows-1251"}, - {"sah", "windows-1251"}, - {"sk", "windows-1250"}, - {"sl", "iso-8859-2"}, - {"sr", "windows-1251"}, - {"tg", "windows-1251"}, - {"th", "windows-874"}, - {"tr", "windows-1254"}, - {"tt", "windows-1251"}, - {"uk", "windows-1251"}, - {"vi", "windows-1258"}, - {"zh-hans", "gb18030"}, - {"zh-hant", "big5"}, -} diff --git a/vendor/golang.org/x/text/encoding/internal/identifier/gen.go b/vendor/golang.org/x/text/encoding/internal/identifier/gen.go deleted file mode 100644 index 26cfef9c6b..0000000000 --- a/vendor/golang.org/x/text/encoding/internal/identifier/gen.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "bytes" - "encoding/xml" - "fmt" - "io" - "log" - "strings" - - "golang.org/x/text/internal/gen" -) - -type registry struct { - XMLName xml.Name `xml:"registry"` - Updated string `xml:"updated"` - Registry []struct { - ID string `xml:"id,attr"` - Record []struct { - Name string `xml:"name"` - Xref []struct { - Type string `xml:"type,attr"` - Data string `xml:"data,attr"` - } `xml:"xref"` - Desc struct { - Data string `xml:",innerxml"` - // Any []struct { - // Data string `xml:",chardata"` - // } `xml:",any"` - // Data string `xml:",chardata"` - } `xml:"description,"` - MIB string `xml:"value"` - Alias []string `xml:"alias"` - MIME string `xml:"preferred_alias"` - } `xml:"record"` - } `xml:"registry"` -} - -func main() { - r := gen.OpenIANAFile("assignments/character-sets/character-sets.xml") - reg := ®istry{} - if err := xml.NewDecoder(r).Decode(®); err != nil && err != io.EOF { - log.Fatalf("Error decoding charset registry: %v", err) - } - if len(reg.Registry) == 0 || reg.Registry[0].ID != "character-sets-1" { - log.Fatalf("Unexpected ID %s", reg.Registry[0].ID) - } - - w := &bytes.Buffer{} - fmt.Fprintf(w, "const (\n") - for _, rec := range reg.Registry[0].Record { - constName := "" - for _, a := range rec.Alias { - if strings.HasPrefix(a, "cs") && strings.IndexByte(a, '-') == -1 { - // Some of the constant definitions have comments in them. Strip those. - constName = strings.Title(strings.SplitN(a[2:], "\n", 2)[0]) - } - } - if constName == "" { - switch rec.MIB { - case "2085": - constName = "HZGB2312" // Not listed as alias for some reason. - default: - log.Fatalf("No cs alias defined for %s.", rec.MIB) - } - } - if rec.MIME != "" { - rec.MIME = fmt.Sprintf(" (MIME: %s)", rec.MIME) - } - fmt.Fprintf(w, "// %s is the MIB identifier with IANA name %s%s.\n//\n", constName, rec.Name, rec.MIME) - if len(rec.Desc.Data) > 0 { - fmt.Fprint(w, "// ") - d := xml.NewDecoder(strings.NewReader(rec.Desc.Data)) - inElem := true - attr := "" - for { - t, err := d.Token() - if err != nil { - if err != io.EOF { - log.Fatal(err) - } - break - } - switch x := t.(type) { - case xml.CharData: - attr = "" // Don't need attribute info. - a := bytes.Split([]byte(x), []byte("\n")) - for i, b := range a { - if b = bytes.TrimSpace(b); len(b) != 0 { - if !inElem && i > 0 { - fmt.Fprint(w, "\n// ") - } - inElem = false - fmt.Fprintf(w, "%s ", string(b)) - } - } - case xml.StartElement: - if x.Name.Local == "xref" { - inElem = true - use := false - for _, a := range x.Attr { - if a.Name.Local == "type" { - use = use || a.Value != "person" - } - if a.Name.Local == "data" && use { - // Patch up URLs to use https. From some links, the - // https version is different from the http one. - s := a.Value - s = strings.Replace(s, "http://", "https://", -1) - s = strings.Replace(s, "/unicode/", "/", -1) - attr = s + " " - } - } - } - case xml.EndElement: - inElem = false - fmt.Fprint(w, attr) - } - } - fmt.Fprint(w, "\n") - } - for _, x := range rec.Xref { - switch x.Type { - case "rfc": - fmt.Fprintf(w, "// Reference: %s\n", strings.ToUpper(x.Data)) - case "uri": - fmt.Fprintf(w, "// Reference: %s\n", x.Data) - } - } - fmt.Fprintf(w, "%s MIB = %s\n", constName, rec.MIB) - fmt.Fprintln(w) - } - fmt.Fprintln(w, ")") - - gen.WriteGoFile("mib.go", "identifier", w.Bytes()) -} diff --git a/vendor/golang.org/x/text/encoding/japanese/maketables.go b/vendor/golang.org/x/text/encoding/japanese/maketables.go deleted file mode 100644 index 023957a672..0000000000 --- a/vendor/golang.org/x/text/encoding/japanese/maketables.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This program generates tables.go: -// go run maketables.go | gofmt > tables.go - -// TODO: Emoji extensions? -// https://www.unicode.org/faq/emoji_dingbats.html -// https://www.unicode.org/Public/UNIDATA/EmojiSources.txt - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" -) - -type entry struct { - jisCode, table int -} - -func main() { - fmt.Printf("// generated by go run maketables.go; DO NOT EDIT\n\n") - fmt.Printf("// Package japanese provides Japanese encodings such as EUC-JP and Shift JIS.\n") - fmt.Printf(`package japanese // import "golang.org/x/text/encoding/japanese"` + "\n\n") - - reverse := [65536]entry{} - for i := range reverse { - reverse[i].table = -1 - } - - tables := []struct { - url string - name string - }{ - {"http://encoding.spec.whatwg.org/index-jis0208.txt", "0208"}, - {"http://encoding.spec.whatwg.org/index-jis0212.txt", "0212"}, - } - for i, table := range tables { - res, err := http.Get(table.url) - if err != nil { - log.Fatalf("%q: Get: %v", table.url, err) - } - defer res.Body.Close() - - mapping := [65536]uint16{} - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := 0, uint16(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("%q: could not parse %q", table.url, s) - } - if x < 0 || 120*94 <= x { - log.Fatalf("%q: JIS code %d is out of range", table.url, x) - } - mapping[x] = y - if reverse[y].table == -1 { - reverse[y] = entry{jisCode: x, table: i} - } - } - if err := scanner.Err(); err != nil { - log.Fatalf("%q: scanner error: %v", table.url, err) - } - - fmt.Printf("// jis%sDecode is the decoding table from JIS %s code to Unicode.\n// It is defined at %s\n", - table.name, table.name, table.url) - fmt.Printf("var jis%sDecode = [...]uint16{\n", table.name) - for i, m := range mapping { - if m != 0 { - fmt.Printf("\t%d: 0x%04X,\n", i, m) - } - } - fmt.Printf("}\n\n") - } - - // Any run of at least separation continuous zero entries in the reverse map will - // be a separate encode table. - const separation = 1024 - - intervals := []interval(nil) - low, high := -1, -1 - for i, v := range reverse { - if v.table == -1 { - continue - } - if low < 0 { - low = i - } else if i-high >= separation { - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - low = i - } - high = i + 1 - } - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - sort.Sort(byDecreasingLength(intervals)) - - fmt.Printf("const (\n") - fmt.Printf("\tjis0208 = 1\n") - fmt.Printf("\tjis0212 = 2\n") - fmt.Printf("\tcodeMask = 0x7f\n") - fmt.Printf("\tcodeShift = 7\n") - fmt.Printf("\ttableShift = 14\n") - fmt.Printf(")\n\n") - - fmt.Printf("const numEncodeTables = %d\n\n", len(intervals)) - fmt.Printf("// encodeX are the encoding tables from Unicode to JIS code,\n") - fmt.Printf("// sorted by decreasing length.\n") - for i, v := range intervals { - fmt.Printf("// encode%d: %5d entries for runes in [%5d, %5d).\n", i, v.len(), v.low, v.high) - } - fmt.Printf("//\n") - fmt.Printf("// The high two bits of the value record whether the JIS code comes from the\n") - fmt.Printf("// JIS0208 table (high bits == 1) or the JIS0212 table (high bits == 2).\n") - fmt.Printf("// The low 14 bits are two 7-bit unsigned integers j1 and j2 that form the\n") - fmt.Printf("// JIS code (94*j1 + j2) within that table.\n") - fmt.Printf("\n") - - for i, v := range intervals { - fmt.Printf("const encode%dLow, encode%dHigh = %d, %d\n\n", i, i, v.low, v.high) - fmt.Printf("var encode%d = [...]uint16{\n", i) - for j := v.low; j < v.high; j++ { - x := reverse[j] - if x.table == -1 { - continue - } - fmt.Printf("\t%d - %d: jis%s<<14 | 0x%02X<<7 | 0x%02X,\n", - j, v.low, tables[x.table].name, x.jisCode/94, x.jisCode%94) - } - fmt.Printf("}\n\n") - } -} - -// interval is a half-open interval [low, high). -type interval struct { - low, high int -} - -func (i interval) len() int { return i.high - i.low } - -// byDecreasingLength sorts intervals by decreasing length. -type byDecreasingLength []interval - -func (b byDecreasingLength) Len() int { return len(b) } -func (b byDecreasingLength) Less(i, j int) bool { return b[i].len() > b[j].len() } -func (b byDecreasingLength) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/encoding/korean/maketables.go b/vendor/golang.org/x/text/encoding/korean/maketables.go deleted file mode 100644 index c84034fb67..0000000000 --- a/vendor/golang.org/x/text/encoding/korean/maketables.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This program generates tables.go: -// go run maketables.go | gofmt > tables.go - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" -) - -func main() { - fmt.Printf("// generated by go run maketables.go; DO NOT EDIT\n\n") - fmt.Printf("// Package korean provides Korean encodings such as EUC-KR.\n") - fmt.Printf(`package korean // import "golang.org/x/text/encoding/korean"` + "\n\n") - - res, err := http.Get("http://encoding.spec.whatwg.org/index-euc-kr.txt") - if err != nil { - log.Fatalf("Get: %v", err) - } - defer res.Body.Close() - - mapping := [65536]uint16{} - reverse := [65536]uint16{} - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := uint16(0), uint16(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0 || 178*(0xc7-0x81)+(0xfe-0xc7)*94+(0xff-0xa1) <= x { - log.Fatalf("EUC-KR code %d is out of range", x) - } - mapping[x] = y - if reverse[y] == 0 { - c0, c1 := uint16(0), uint16(0) - if x < 178*(0xc7-0x81) { - c0 = uint16(x/178) + 0x81 - c1 = uint16(x % 178) - switch { - case c1 < 1*26: - c1 += 0x41 - case c1 < 2*26: - c1 += 0x47 - default: - c1 += 0x4d - } - } else { - x -= 178 * (0xc7 - 0x81) - c0 = uint16(x/94) + 0xc7 - c1 = uint16(x%94) + 0xa1 - } - reverse[y] = c0<<8 | c1 - } - } - if err := scanner.Err(); err != nil { - log.Fatalf("scanner error: %v", err) - } - - fmt.Printf("// decode is the decoding table from EUC-KR code to Unicode.\n") - fmt.Printf("// It is defined at http://encoding.spec.whatwg.org/index-euc-kr.txt\n") - fmt.Printf("var decode = [...]uint16{\n") - for i, v := range mapping { - if v != 0 { - fmt.Printf("\t%d: 0x%04X,\n", i, v) - } - } - fmt.Printf("}\n\n") - - // Any run of at least separation continuous zero entries in the reverse map will - // be a separate encode table. - const separation = 1024 - - intervals := []interval(nil) - low, high := -1, -1 - for i, v := range reverse { - if v == 0 { - continue - } - if low < 0 { - low = i - } else if i-high >= separation { - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - low = i - } - high = i + 1 - } - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - sort.Sort(byDecreasingLength(intervals)) - - fmt.Printf("const numEncodeTables = %d\n\n", len(intervals)) - fmt.Printf("// encodeX are the encoding tables from Unicode to EUC-KR code,\n") - fmt.Printf("// sorted by decreasing length.\n") - for i, v := range intervals { - fmt.Printf("// encode%d: %5d entries for runes in [%5d, %5d).\n", i, v.len(), v.low, v.high) - } - fmt.Printf("\n") - - for i, v := range intervals { - fmt.Printf("const encode%dLow, encode%dHigh = %d, %d\n\n", i, i, v.low, v.high) - fmt.Printf("var encode%d = [...]uint16{\n", i) - for j := v.low; j < v.high; j++ { - x := reverse[j] - if x == 0 { - continue - } - fmt.Printf("\t%d-%d: 0x%04X,\n", j, v.low, x) - } - fmt.Printf("}\n\n") - } -} - -// interval is a half-open interval [low, high). -type interval struct { - low, high int -} - -func (i interval) len() int { return i.high - i.low } - -// byDecreasingLength sorts intervals by decreasing length. -type byDecreasingLength []interval - -func (b byDecreasingLength) Len() int { return len(b) } -func (b byDecreasingLength) Less(i, j int) bool { return b[i].len() > b[j].len() } -func (b byDecreasingLength) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go b/vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go deleted file mode 100644 index 55016c7862..0000000000 --- a/vendor/golang.org/x/text/encoding/simplifiedchinese/maketables.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This program generates tables.go: -// go run maketables.go | gofmt > tables.go - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" -) - -func main() { - fmt.Printf("// generated by go run maketables.go; DO NOT EDIT\n\n") - fmt.Printf("// Package simplifiedchinese provides Simplified Chinese encodings such as GBK.\n") - fmt.Printf(`package simplifiedchinese // import "golang.org/x/text/encoding/simplifiedchinese"` + "\n\n") - - printGB18030() - printGBK() -} - -func printGB18030() { - res, err := http.Get("http://encoding.spec.whatwg.org/index-gb18030.txt") - if err != nil { - log.Fatalf("Get: %v", err) - } - defer res.Body.Close() - - fmt.Printf("// gb18030 is the table from http://encoding.spec.whatwg.org/index-gb18030.txt\n") - fmt.Printf("var gb18030 = [...][2]uint16{\n") - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := uint32(0), uint32(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0x10000 && y < 0x10000 { - fmt.Printf("\t{0x%04x, 0x%04x},\n", x, y) - } - } - fmt.Printf("}\n\n") -} - -func printGBK() { - res, err := http.Get("http://encoding.spec.whatwg.org/index-gbk.txt") - if err != nil { - log.Fatalf("Get: %v", err) - } - defer res.Body.Close() - - mapping := [65536]uint16{} - reverse := [65536]uint16{} - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := uint16(0), uint16(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0 || 126*190 <= x { - log.Fatalf("GBK code %d is out of range", x) - } - mapping[x] = y - if reverse[y] == 0 { - c0, c1 := x/190, x%190 - if c1 >= 0x3f { - c1++ - } - reverse[y] = (0x81+c0)<<8 | (0x40 + c1) - } - } - if err := scanner.Err(); err != nil { - log.Fatalf("scanner error: %v", err) - } - - fmt.Printf("// decode is the decoding table from GBK code to Unicode.\n") - fmt.Printf("// It is defined at http://encoding.spec.whatwg.org/index-gbk.txt\n") - fmt.Printf("var decode = [...]uint16{\n") - for i, v := range mapping { - if v != 0 { - fmt.Printf("\t%d: 0x%04X,\n", i, v) - } - } - fmt.Printf("}\n\n") - - // Any run of at least separation continuous zero entries in the reverse map will - // be a separate encode table. - const separation = 1024 - - intervals := []interval(nil) - low, high := -1, -1 - for i, v := range reverse { - if v == 0 { - continue - } - if low < 0 { - low = i - } else if i-high >= separation { - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - low = i - } - high = i + 1 - } - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - sort.Sort(byDecreasingLength(intervals)) - - fmt.Printf("const numEncodeTables = %d\n\n", len(intervals)) - fmt.Printf("// encodeX are the encoding tables from Unicode to GBK code,\n") - fmt.Printf("// sorted by decreasing length.\n") - for i, v := range intervals { - fmt.Printf("// encode%d: %5d entries for runes in [%5d, %5d).\n", i, v.len(), v.low, v.high) - } - fmt.Printf("\n") - - for i, v := range intervals { - fmt.Printf("const encode%dLow, encode%dHigh = %d, %d\n\n", i, i, v.low, v.high) - fmt.Printf("var encode%d = [...]uint16{\n", i) - for j := v.low; j < v.high; j++ { - x := reverse[j] - if x == 0 { - continue - } - fmt.Printf("\t%d-%d: 0x%04X,\n", j, v.low, x) - } - fmt.Printf("}\n\n") - } -} - -// interval is a half-open interval [low, high). -type interval struct { - low, high int -} - -func (i interval) len() int { return i.high - i.low } - -// byDecreasingLength sorts intervals by decreasing length. -type byDecreasingLength []interval - -func (b byDecreasingLength) Len() int { return len(b) } -func (b byDecreasingLength) Less(i, j int) bool { return b[i].len() > b[j].len() } -func (b byDecreasingLength) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go b/vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go deleted file mode 100644 index cf7fdb31a5..0000000000 --- a/vendor/golang.org/x/text/encoding/traditionalchinese/maketables.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This program generates tables.go: -// go run maketables.go | gofmt > tables.go - -import ( - "bufio" - "fmt" - "log" - "net/http" - "sort" - "strings" -) - -func main() { - fmt.Printf("// generated by go run maketables.go; DO NOT EDIT\n\n") - fmt.Printf("// Package traditionalchinese provides Traditional Chinese encodings such as Big5.\n") - fmt.Printf(`package traditionalchinese // import "golang.org/x/text/encoding/traditionalchinese"` + "\n\n") - - res, err := http.Get("http://encoding.spec.whatwg.org/index-big5.txt") - if err != nil { - log.Fatalf("Get: %v", err) - } - defer res.Body.Close() - - mapping := [65536]uint32{} - reverse := [65536 * 4]uint16{} - - scanner := bufio.NewScanner(res.Body) - for scanner.Scan() { - s := strings.TrimSpace(scanner.Text()) - if s == "" || s[0] == '#' { - continue - } - x, y := uint16(0), uint32(0) - if _, err := fmt.Sscanf(s, "%d 0x%x", &x, &y); err != nil { - log.Fatalf("could not parse %q", s) - } - if x < 0 || 126*157 <= x { - log.Fatalf("Big5 code %d is out of range", x) - } - mapping[x] = y - - // The WHATWG spec http://encoding.spec.whatwg.org/#indexes says that - // "The index pointer for code point in index is the first pointer - // corresponding to code point in index", which would normally mean - // that the code below should be guarded by "if reverse[y] == 0", but - // last instead of first seems to match the behavior of - // "iconv -f UTF-8 -t BIG5". For example, U+8005 者 occurs twice in - // http://encoding.spec.whatwg.org/index-big5.txt, as index 2148 - // (encoded as "\x8e\xcd") and index 6543 (encoded as "\xaa\xcc") - // and "echo 者 | iconv -f UTF-8 -t BIG5 | xxd" gives "\xaa\xcc". - c0, c1 := x/157, x%157 - if c1 < 0x3f { - c1 += 0x40 - } else { - c1 += 0x62 - } - reverse[y] = (0x81+c0)<<8 | c1 - } - if err := scanner.Err(); err != nil { - log.Fatalf("scanner error: %v", err) - } - - fmt.Printf("// decode is the decoding table from Big5 code to Unicode.\n") - fmt.Printf("// It is defined at http://encoding.spec.whatwg.org/index-big5.txt\n") - fmt.Printf("var decode = [...]uint32{\n") - for i, v := range mapping { - if v != 0 { - fmt.Printf("\t%d: 0x%08X,\n", i, v) - } - } - fmt.Printf("}\n\n") - - // Any run of at least separation continuous zero entries in the reverse map will - // be a separate encode table. - const separation = 1024 - - intervals := []interval(nil) - low, high := -1, -1 - for i, v := range reverse { - if v == 0 { - continue - } - if low < 0 { - low = i - } else if i-high >= separation { - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - low = i - } - high = i + 1 - } - if high >= 0 { - intervals = append(intervals, interval{low, high}) - } - sort.Sort(byDecreasingLength(intervals)) - - fmt.Printf("const numEncodeTables = %d\n\n", len(intervals)) - fmt.Printf("// encodeX are the encoding tables from Unicode to Big5 code,\n") - fmt.Printf("// sorted by decreasing length.\n") - for i, v := range intervals { - fmt.Printf("// encode%d: %5d entries for runes in [%6d, %6d).\n", i, v.len(), v.low, v.high) - } - fmt.Printf("\n") - - for i, v := range intervals { - fmt.Printf("const encode%dLow, encode%dHigh = %d, %d\n\n", i, i, v.low, v.high) - fmt.Printf("var encode%d = [...]uint16{\n", i) - for j := v.low; j < v.high; j++ { - x := reverse[j] - if x == 0 { - continue - } - fmt.Printf("\t%d-%d: 0x%04X,\n", j, v.low, x) - } - fmt.Printf("}\n\n") - } -} - -// interval is a half-open interval [low, high). -type interval struct { - low, high int -} - -func (i interval) len() int { return i.high - i.low } - -// byDecreasingLength sorts intervals by decreasing length. -type byDecreasingLength []interval - -func (b byDecreasingLength) Len() int { return len(b) } -func (b byDecreasingLength) Less(i, j int) bool { return b[i].len() > b[j].len() } -func (b byDecreasingLength) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/vendor/golang.org/x/text/internal/language/compact/gen.go b/vendor/golang.org/x/text/internal/language/compact/gen.go deleted file mode 100644 index 0c36a052f6..0000000000 --- a/vendor/golang.org/x/text/internal/language/compact/gen.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Language tag table generator. -// Data read from the web. - -package main - -import ( - "flag" - "fmt" - "log" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/unicode/cldr" -) - -var ( - test = flag.Bool("test", - false, - "test existing tables; can be used to compare web data with package data.") - outputFile = flag.String("output", - "tables.go", - "output file for generated tables") -) - -func main() { - gen.Init() - - w := gen.NewCodeWriter() - defer w.WriteGoFile("tables.go", "compact") - - fmt.Fprintln(w, `import "golang.org/x/text/internal/language"`) - - b := newBuilder(w) - gen.WriteCLDRVersion(w) - - b.writeCompactIndex() -} - -type builder struct { - w *gen.CodeWriter - data *cldr.CLDR - supp *cldr.SupplementalData -} - -func newBuilder(w *gen.CodeWriter) *builder { - r := gen.OpenCLDRCoreZip() - defer r.Close() - d := &cldr.Decoder{} - data, err := d.DecodeZip(r) - if err != nil { - log.Fatal(err) - } - b := builder{ - w: w, - data: data, - supp: data.Supplemental(), - } - return &b -} diff --git a/vendor/golang.org/x/text/internal/language/compact/gen_index.go b/vendor/golang.org/x/text/internal/language/compact/gen_index.go deleted file mode 100644 index 136cefaf08..0000000000 --- a/vendor/golang.org/x/text/internal/language/compact/gen_index.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This file generates derivative tables based on the language package itself. - -import ( - "fmt" - "log" - "sort" - "strings" - - "golang.org/x/text/internal/language" -) - -// Compact indices: -// Note -va-X variants only apply to localization variants. -// BCP variants only ever apply to language. -// The only ambiguity between tags is with regions. - -func (b *builder) writeCompactIndex() { - // Collect all language tags for which we have any data in CLDR. - m := map[language.Tag]bool{} - for _, lang := range b.data.Locales() { - // We include all locales unconditionally to be consistent with en_US. - // We want en_US, even though it has no data associated with it. - - // TODO: put any of the languages for which no data exists at the end - // of the index. This allows all components based on ICU to use that - // as the cutoff point. - // if x := data.RawLDML(lang); false || - // x.LocaleDisplayNames != nil || - // x.Characters != nil || - // x.Delimiters != nil || - // x.Measurement != nil || - // x.Dates != nil || - // x.Numbers != nil || - // x.Units != nil || - // x.ListPatterns != nil || - // x.Collations != nil || - // x.Segmentations != nil || - // x.Rbnf != nil || - // x.Annotations != nil || - // x.Metadata != nil { - - // TODO: support POSIX natively, albeit non-standard. - tag := language.Make(strings.Replace(lang, "_POSIX", "-u-va-posix", 1)) - m[tag] = true - // } - } - - // TODO: plural rules are also defined for the deprecated tags: - // iw mo sh tl - // Consider removing these as compact tags. - - // Include locales for plural rules, which uses a different structure. - for _, plurals := range b.supp.Plurals { - for _, rules := range plurals.PluralRules { - for _, lang := range strings.Split(rules.Locales, " ") { - m[language.Make(lang)] = true - } - } - } - - var coreTags []language.CompactCoreInfo - var special []string - - for t := range m { - if x := t.Extensions(); len(x) != 0 && fmt.Sprint(x) != "[u-va-posix]" { - log.Fatalf("Unexpected extension %v in %v", x, t) - } - if len(t.Variants()) == 0 && len(t.Extensions()) == 0 { - cci, ok := language.GetCompactCore(t) - if !ok { - log.Fatalf("Locale for non-basic language %q", t) - } - coreTags = append(coreTags, cci) - } else { - special = append(special, t.String()) - } - } - - w := b.w - - sort.Slice(coreTags, func(i, j int) bool { return coreTags[i] < coreTags[j] }) - sort.Strings(special) - - w.WriteComment(` - NumCompactTags is the number of common tags. The maximum tag is - NumCompactTags-1.`) - w.WriteConst("NumCompactTags", len(m)) - - fmt.Fprintln(w, "const (") - for i, t := range coreTags { - fmt.Fprintf(w, "%s ID = %d\n", ident(t.Tag().String()), i) - } - for i, t := range special { - fmt.Fprintf(w, "%s ID = %d\n", ident(t), i+len(coreTags)) - } - fmt.Fprintln(w, ")") - - w.WriteVar("coreTags", coreTags) - - w.WriteConst("specialTagsStr", strings.Join(special, " ")) -} - -func ident(s string) string { - return strings.Replace(s, "-", "", -1) + "Index" -} diff --git a/vendor/golang.org/x/text/internal/language/compact/gen_parents.go b/vendor/golang.org/x/text/internal/language/compact/gen_parents.go deleted file mode 100644 index 9543d58323..0000000000 --- a/vendor/golang.org/x/text/internal/language/compact/gen_parents.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "log" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/language" - "golang.org/x/text/internal/language/compact" - "golang.org/x/text/unicode/cldr" -) - -func main() { - r := gen.OpenCLDRCoreZip() - defer r.Close() - - d := &cldr.Decoder{} - data, err := d.DecodeZip(r) - if err != nil { - log.Fatalf("DecodeZip: %v", err) - } - - w := gen.NewCodeWriter() - defer w.WriteGoFile("parents.go", "compact") - - // Create parents table. - type ID uint16 - parents := make([]ID, compact.NumCompactTags) - for _, loc := range data.Locales() { - tag := language.MustParse(loc) - index, ok := compact.FromTag(tag) - if !ok { - continue - } - parentIndex := compact.ID(0) // und - for p := tag.Parent(); p != language.Und; p = p.Parent() { - if x, ok := compact.FromTag(p); ok { - parentIndex = x - break - } - } - parents[index] = ID(parentIndex) - } - - w.WriteComment(` - parents maps a compact index of a tag to the compact index of the parent of - this tag.`) - w.WriteVar("parents", parents) -} diff --git a/vendor/golang.org/x/text/internal/language/gen.go b/vendor/golang.org/x/text/internal/language/gen.go deleted file mode 100644 index cdcc7febcb..0000000000 --- a/vendor/golang.org/x/text/internal/language/gen.go +++ /dev/null @@ -1,1520 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Language tag table generator. -// Data read from the web. - -package main - -import ( - "bufio" - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "math" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/tag" - "golang.org/x/text/unicode/cldr" -) - -var ( - test = flag.Bool("test", - false, - "test existing tables; can be used to compare web data with package data.") - outputFile = flag.String("output", - "tables.go", - "output file for generated tables") -) - -var comment = []string{ - ` -lang holds an alphabetically sorted list of ISO-639 language identifiers. -All entries are 4 bytes. The index of the identifier (divided by 4) is the language tag. -For 2-byte language identifiers, the two successive bytes have the following meaning: - - if the first letter of the 2- and 3-letter ISO codes are the same: - the second and third letter of the 3-letter ISO code. - - otherwise: a 0 and a by 2 bits right-shifted index into altLangISO3. -For 3-byte language identifiers the 4th byte is 0.`, - ` -langNoIndex is a bit vector of all 3-letter language codes that are not used as an index -in lookup tables. The language ids for these language codes are derived directly -from the letters and are not consecutive.`, - ` -altLangISO3 holds an alphabetically sorted list of 3-letter language code alternatives -to 2-letter language codes that cannot be derived using the method described above. -Each 3-letter code is followed by its 1-byte langID.`, - ` -altLangIndex is used to convert indexes in altLangISO3 to langIDs.`, - ` -AliasMap maps langIDs to their suggested replacements.`, - ` -script is an alphabetically sorted list of ISO 15924 codes. The index -of the script in the string, divided by 4, is the internal scriptID.`, - ` -isoRegionOffset needs to be added to the index of regionISO to obtain the regionID -for 2-letter ISO codes. (The first isoRegionOffset regionIDs are reserved for -the UN.M49 codes used for groups.)`, - ` -regionISO holds a list of alphabetically sorted 2-letter ISO region codes. -Each 2-letter codes is followed by two bytes with the following meaning: - - [A-Z}{2}: the first letter of the 2-letter code plus these two - letters form the 3-letter ISO code. - - 0, n: index into altRegionISO3.`, - ` -regionTypes defines the status of a region for various standards.`, - ` -m49 maps regionIDs to UN.M49 codes. The first isoRegionOffset entries are -codes indicating collections of regions.`, - ` -m49Index gives indexes into fromM49 based on the three most significant bits -of a 10-bit UN.M49 code. To search an UN.M49 code in fromM49, search in - fromM49[m49Index[msb39(code)]:m49Index[msb3(code)+1]] -for an entry where the first 7 bits match the 7 lsb of the UN.M49 code. -The region code is stored in the 9 lsb of the indexed value.`, - ` -fromM49 contains entries to map UN.M49 codes to regions. See m49Index for details.`, - ` -altRegionISO3 holds a list of 3-letter region codes that cannot be -mapped to 2-letter codes using the default algorithm. This is a short list.`, - ` -altRegionIDs holds a list of regionIDs the positions of which match those -of the 3-letter ISO codes in altRegionISO3.`, - ` -variantNumSpecialized is the number of specialized variants in variants.`, - ` -suppressScript is an index from langID to the dominant script for that language, -if it exists. If a script is given, it should be suppressed from the language tag.`, - ` -likelyLang is a lookup table, indexed by langID, for the most likely -scripts and regions given incomplete information. If more entries exist for a -given language, region and script are the index and size respectively -of the list in likelyLangList.`, - ` -likelyLangList holds lists info associated with likelyLang.`, - ` -likelyRegion is a lookup table, indexed by regionID, for the most likely -languages and scripts given incomplete information. If more entries exist -for a given regionID, lang and script are the index and size respectively -of the list in likelyRegionList. -TODO: exclude containers and user-definable regions from the list.`, - ` -likelyRegionList holds lists info associated with likelyRegion.`, - ` -likelyScript is a lookup table, indexed by scriptID, for the most likely -languages and regions given a script.`, - ` -nRegionGroups is the number of region groups.`, - ` -regionInclusion maps region identifiers to sets of regions in regionInclusionBits, -where each set holds all groupings that are directly connected in a region -containment graph.`, - ` -regionInclusionBits is an array of bit vectors where every vector represents -a set of region groupings. These sets are used to compute the distance -between two regions for the purpose of language matching.`, - ` -regionInclusionNext marks, for each entry in regionInclusionBits, the set of -all groups that are reachable from the groups set in the respective entry.`, -} - -// TODO: consider changing some of these structures to tries. This can reduce -// memory, but may increase the need for memory allocations. This could be -// mitigated if we can piggyback on language tags for common cases. - -func failOnError(e error) { - if e != nil { - log.Panic(e) - } -} - -type setType int - -const ( - Indexed setType = 1 + iota // all elements must be of same size - Linear -) - -type stringSet struct { - s []string - sorted, frozen bool - - // We often need to update values after the creation of an index is completed. - // We include a convenience map for keeping track of this. - update map[string]string - typ setType // used for checking. -} - -func (ss *stringSet) clone() stringSet { - c := *ss - c.s = append([]string(nil), c.s...) - return c -} - -func (ss *stringSet) setType(t setType) { - if ss.typ != t && ss.typ != 0 { - log.Panicf("type %d cannot be assigned as it was already %d", t, ss.typ) - } -} - -// parse parses a whitespace-separated string and initializes ss with its -// components. -func (ss *stringSet) parse(s string) { - scan := bufio.NewScanner(strings.NewReader(s)) - scan.Split(bufio.ScanWords) - for scan.Scan() { - ss.add(scan.Text()) - } -} - -func (ss *stringSet) assertChangeable() { - if ss.frozen { - log.Panic("attempt to modify a frozen stringSet") - } -} - -func (ss *stringSet) add(s string) { - ss.assertChangeable() - ss.s = append(ss.s, s) - ss.sorted = ss.frozen -} - -func (ss *stringSet) freeze() { - ss.compact() - ss.frozen = true -} - -func (ss *stringSet) compact() { - if ss.sorted { - return - } - a := ss.s - sort.Strings(a) - k := 0 - for i := 1; i < len(a); i++ { - if a[k] != a[i] { - a[k+1] = a[i] - k++ - } - } - ss.s = a[:k+1] - ss.sorted = ss.frozen -} - -type funcSorter struct { - fn func(a, b string) bool - sort.StringSlice -} - -func (s funcSorter) Less(i, j int) bool { - return s.fn(s.StringSlice[i], s.StringSlice[j]) -} - -func (ss *stringSet) sortFunc(f func(a, b string) bool) { - ss.compact() - sort.Sort(funcSorter{f, sort.StringSlice(ss.s)}) -} - -func (ss *stringSet) remove(s string) { - ss.assertChangeable() - if i, ok := ss.find(s); ok { - copy(ss.s[i:], ss.s[i+1:]) - ss.s = ss.s[:len(ss.s)-1] - } -} - -func (ss *stringSet) replace(ol, nu string) { - ss.s[ss.index(ol)] = nu - ss.sorted = ss.frozen -} - -func (ss *stringSet) index(s string) int { - ss.setType(Indexed) - i, ok := ss.find(s) - if !ok { - if i < len(ss.s) { - log.Panicf("find: item %q is not in list. Closest match is %q.", s, ss.s[i]) - } - log.Panicf("find: item %q is not in list", s) - - } - return i -} - -func (ss *stringSet) find(s string) (int, bool) { - ss.compact() - i := sort.SearchStrings(ss.s, s) - return i, i != len(ss.s) && ss.s[i] == s -} - -func (ss *stringSet) slice() []string { - ss.compact() - return ss.s -} - -func (ss *stringSet) updateLater(v, key string) { - if ss.update == nil { - ss.update = map[string]string{} - } - ss.update[v] = key -} - -// join joins the string and ensures that all entries are of the same length. -func (ss *stringSet) join() string { - ss.setType(Indexed) - n := len(ss.s[0]) - for _, s := range ss.s { - if len(s) != n { - log.Panicf("join: not all entries are of the same length: %q", s) - } - } - ss.s = append(ss.s, strings.Repeat("\xff", n)) - return strings.Join(ss.s, "") -} - -// ianaEntry holds information for an entry in the IANA Language Subtag Repository. -// All types use the same entry. -// See http://tools.ietf.org/html/bcp47#section-5.1 for a description of the various -// fields. -type ianaEntry struct { - typ string - description []string - scope string - added string - preferred string - deprecated string - suppressScript string - macro string - prefix []string -} - -type builder struct { - w *gen.CodeWriter - hw io.Writer // MultiWriter for w and w.Hash - data *cldr.CLDR - supp *cldr.SupplementalData - - // indices - locale stringSet // common locales - lang stringSet // canonical language ids (2 or 3 letter ISO codes) with data - langNoIndex stringSet // 3-letter ISO codes with no associated data - script stringSet // 4-letter ISO codes - region stringSet // 2-letter ISO or 3-digit UN M49 codes - variant stringSet // 4-8-alphanumeric variant code. - - // Region codes that are groups with their corresponding group IDs. - groups map[int]index - - // langInfo - registry map[string]*ianaEntry -} - -type index uint - -func newBuilder(w *gen.CodeWriter) *builder { - r := gen.OpenCLDRCoreZip() - defer r.Close() - d := &cldr.Decoder{} - data, err := d.DecodeZip(r) - failOnError(err) - b := builder{ - w: w, - hw: io.MultiWriter(w, w.Hash), - data: data, - supp: data.Supplemental(), - } - b.parseRegistry() - return &b -} - -func (b *builder) parseRegistry() { - r := gen.OpenIANAFile("assignments/language-subtag-registry") - defer r.Close() - b.registry = make(map[string]*ianaEntry) - - scan := bufio.NewScanner(r) - scan.Split(bufio.ScanWords) - var record *ianaEntry - for more := scan.Scan(); more; { - key := scan.Text() - more = scan.Scan() - value := scan.Text() - switch key { - case "Type:": - record = &ianaEntry{typ: value} - case "Subtag:", "Tag:": - if s := strings.SplitN(value, "..", 2); len(s) > 1 { - for a := s[0]; a <= s[1]; a = inc(a) { - b.addToRegistry(a, record) - } - } else { - b.addToRegistry(value, record) - } - case "Suppress-Script:": - record.suppressScript = value - case "Added:": - record.added = value - case "Deprecated:": - record.deprecated = value - case "Macrolanguage:": - record.macro = value - case "Preferred-Value:": - record.preferred = value - case "Prefix:": - record.prefix = append(record.prefix, value) - case "Scope:": - record.scope = value - case "Description:": - buf := []byte(value) - for more = scan.Scan(); more; more = scan.Scan() { - b := scan.Bytes() - if b[0] == '%' || b[len(b)-1] == ':' { - break - } - buf = append(buf, ' ') - buf = append(buf, b...) - } - record.description = append(record.description, string(buf)) - continue - default: - continue - } - more = scan.Scan() - } - if scan.Err() != nil { - log.Panic(scan.Err()) - } -} - -func (b *builder) addToRegistry(key string, entry *ianaEntry) { - if info, ok := b.registry[key]; ok { - if info.typ != "language" || entry.typ != "extlang" { - log.Fatalf("parseRegistry: tag %q already exists", key) - } - } else { - b.registry[key] = entry - } -} - -var commentIndex = make(map[string]string) - -func init() { - for _, s := range comment { - key := strings.TrimSpace(strings.SplitN(s, " ", 2)[0]) - commentIndex[key] = s - } -} - -func (b *builder) comment(name string) { - if s := commentIndex[name]; len(s) > 0 { - b.w.WriteComment(s) - } else { - fmt.Fprintln(b.w) - } -} - -func (b *builder) pf(f string, x ...interface{}) { - fmt.Fprintf(b.hw, f, x...) - fmt.Fprint(b.hw, "\n") -} - -func (b *builder) p(x ...interface{}) { - fmt.Fprintln(b.hw, x...) -} - -func (b *builder) addSize(s int) { - b.w.Size += s - b.pf("// Size: %d bytes", s) -} - -func (b *builder) writeConst(name string, x interface{}) { - b.comment(name) - b.w.WriteConst(name, x) -} - -// writeConsts computes f(v) for all v in values and writes the results -// as constants named _v to a single constant block. -func (b *builder) writeConsts(f func(string) int, values ...string) { - b.pf("const (") - for _, v := range values { - b.pf("\t_%s = %v", v, f(v)) - } - b.pf(")") -} - -// writeType writes the type of the given value, which must be a struct. -func (b *builder) writeType(value interface{}) { - b.comment(reflect.TypeOf(value).Name()) - b.w.WriteType(value) -} - -func (b *builder) writeSlice(name string, ss interface{}) { - b.writeSliceAddSize(name, 0, ss) -} - -func (b *builder) writeSliceAddSize(name string, extraSize int, ss interface{}) { - b.comment(name) - b.w.Size += extraSize - v := reflect.ValueOf(ss) - t := v.Type().Elem() - b.pf("// Size: %d bytes, %d elements", v.Len()*int(t.Size())+extraSize, v.Len()) - - fmt.Fprintf(b.w, "var %s = ", name) - b.w.WriteArray(ss) - b.p() -} - -type FromTo struct { - From, To uint16 -} - -func (b *builder) writeSortedMap(name string, ss *stringSet, index func(s string) uint16) { - ss.sortFunc(func(a, b string) bool { - return index(a) < index(b) - }) - m := []FromTo{} - for _, s := range ss.s { - m = append(m, FromTo{index(s), index(ss.update[s])}) - } - b.writeSlice(name, m) -} - -const base = 'z' - 'a' + 1 - -func strToInt(s string) uint { - v := uint(0) - for i := 0; i < len(s); i++ { - v *= base - v += uint(s[i] - 'a') - } - return v -} - -// converts the given integer to the original ASCII string passed to strToInt. -// len(s) must match the number of characters obtained. -func intToStr(v uint, s []byte) { - for i := len(s) - 1; i >= 0; i-- { - s[i] = byte(v%base) + 'a' - v /= base - } -} - -func (b *builder) writeBitVector(name string, ss []string) { - vec := make([]uint8, int(math.Ceil(math.Pow(base, float64(len(ss[0])))/8))) - for _, s := range ss { - v := strToInt(s) - vec[v/8] |= 1 << (v % 8) - } - b.writeSlice(name, vec) -} - -// TODO: convert this type into a list or two-stage trie. -func (b *builder) writeMapFunc(name string, m map[string]string, f func(string) uint16) { - b.comment(name) - v := reflect.ValueOf(m) - sz := v.Len() * (2 + int(v.Type().Key().Size())) - for _, k := range m { - sz += len(k) - } - b.addSize(sz) - keys := []string{} - b.pf(`var %s = map[string]uint16{`, name) - for k := range m { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - b.pf("\t%q: %v,", k, f(m[k])) - } - b.p("}") -} - -func (b *builder) writeMap(name string, m interface{}) { - b.comment(name) - v := reflect.ValueOf(m) - sz := v.Len() * (2 + int(v.Type().Key().Size()) + int(v.Type().Elem().Size())) - b.addSize(sz) - f := strings.FieldsFunc(fmt.Sprintf("%#v", m), func(r rune) bool { - return strings.IndexRune("{}, ", r) != -1 - }) - sort.Strings(f[1:]) - b.pf(`var %s = %s{`, name, f[0]) - for _, kv := range f[1:] { - b.pf("\t%s,", kv) - } - b.p("}") -} - -func (b *builder) langIndex(s string) uint16 { - if s == "und" { - return 0 - } - if i, ok := b.lang.find(s); ok { - return uint16(i) - } - return uint16(strToInt(s)) + uint16(len(b.lang.s)) -} - -// inc advances the string to its lexicographical successor. -func inc(s string) string { - const maxTagLength = 4 - var buf [maxTagLength]byte - intToStr(strToInt(strings.ToLower(s))+1, buf[:len(s)]) - for i := 0; i < len(s); i++ { - if s[i] <= 'Z' { - buf[i] -= 'a' - 'A' - } - } - return string(buf[:len(s)]) -} - -func (b *builder) parseIndices() { - meta := b.supp.Metadata - - for k, v := range b.registry { - var ss *stringSet - switch v.typ { - case "language": - if len(k) == 2 || v.suppressScript != "" || v.scope == "special" { - b.lang.add(k) - continue - } else { - ss = &b.langNoIndex - } - case "region": - ss = &b.region - case "script": - ss = &b.script - case "variant": - ss = &b.variant - default: - continue - } - ss.add(k) - } - // Include any language for which there is data. - for _, lang := range b.data.Locales() { - if x := b.data.RawLDML(lang); false || - x.LocaleDisplayNames != nil || - x.Characters != nil || - x.Delimiters != nil || - x.Measurement != nil || - x.Dates != nil || - x.Numbers != nil || - x.Units != nil || - x.ListPatterns != nil || - x.Collations != nil || - x.Segmentations != nil || - x.Rbnf != nil || - x.Annotations != nil || - x.Metadata != nil { - - from := strings.Split(lang, "_") - if lang := from[0]; lang != "root" { - b.lang.add(lang) - } - } - } - // Include locales for plural rules, which uses a different structure. - for _, plurals := range b.data.Supplemental().Plurals { - for _, rules := range plurals.PluralRules { - for _, lang := range strings.Split(rules.Locales, " ") { - if lang = strings.Split(lang, "_")[0]; lang != "root" { - b.lang.add(lang) - } - } - } - } - // Include languages in likely subtags. - for _, m := range b.supp.LikelySubtags.LikelySubtag { - from := strings.Split(m.From, "_") - b.lang.add(from[0]) - } - // Include ISO-639 alpha-3 bibliographic entries. - for _, a := range meta.Alias.LanguageAlias { - if a.Reason == "bibliographic" { - b.langNoIndex.add(a.Type) - } - } - // Include regions in territoryAlias (not all are in the IANA registry!) - for _, reg := range b.supp.Metadata.Alias.TerritoryAlias { - if len(reg.Type) == 2 { - b.region.add(reg.Type) - } - } - - for _, s := range b.lang.s { - if len(s) == 3 { - b.langNoIndex.remove(s) - } - } - b.writeConst("NumLanguages", len(b.lang.slice())+len(b.langNoIndex.slice())) - b.writeConst("NumScripts", len(b.script.slice())) - b.writeConst("NumRegions", len(b.region.slice())) - - // Add dummy codes at the start of each list to represent "unspecified". - b.lang.add("---") - b.script.add("----") - b.region.add("---") - - // common locales - b.locale.parse(meta.DefaultContent.Locales) -} - -// TODO: region inclusion data will probably not be use used in future matchers. - -func (b *builder) computeRegionGroups() { - b.groups = make(map[int]index) - - // Create group indices. - for i := 1; b.region.s[i][0] < 'A'; i++ { // Base M49 indices on regionID. - b.groups[i] = index(len(b.groups)) - } - for _, g := range b.supp.TerritoryContainment.Group { - // Skip UN and EURO zone as they are flattening the containment - // relationship. - if g.Type == "EZ" || g.Type == "UN" { - continue - } - group := b.region.index(g.Type) - if _, ok := b.groups[group]; !ok { - b.groups[group] = index(len(b.groups)) - } - } - if len(b.groups) > 64 { - log.Fatalf("only 64 groups supported, found %d", len(b.groups)) - } - b.writeConst("nRegionGroups", len(b.groups)) -} - -var langConsts = []string{ - "af", "am", "ar", "az", "bg", "bn", "ca", "cs", "da", "de", "el", "en", "es", - "et", "fa", "fi", "fil", "fr", "gu", "he", "hi", "hr", "hu", "hy", "id", "is", - "it", "ja", "ka", "kk", "km", "kn", "ko", "ky", "lo", "lt", "lv", "mk", "ml", - "mn", "mo", "mr", "ms", "mul", "my", "nb", "ne", "nl", "no", "pa", "pl", "pt", - "ro", "ru", "sh", "si", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", - "tl", "tn", "tr", "uk", "ur", "uz", "vi", "zh", "zu", - - // constants for grandfathered tags (if not already defined) - "jbo", "ami", "bnn", "hak", "tlh", "lb", "nv", "pwn", "tao", "tay", "tsu", - "nn", "sfb", "vgt", "sgg", "cmn", "nan", "hsn", -} - -// writeLanguage generates all tables needed for language canonicalization. -func (b *builder) writeLanguage() { - meta := b.supp.Metadata - - b.writeConst("nonCanonicalUnd", b.lang.index("und")) - b.writeConsts(func(s string) int { return int(b.langIndex(s)) }, langConsts...) - b.writeConst("langPrivateStart", b.langIndex("qaa")) - b.writeConst("langPrivateEnd", b.langIndex("qtz")) - - // Get language codes that need to be mapped (overlong 3-letter codes, - // deprecated 2-letter codes, legacy and grandfathered tags.) - langAliasMap := stringSet{} - aliasTypeMap := map[string]AliasType{} - - // altLangISO3 get the alternative ISO3 names that need to be mapped. - altLangISO3 := stringSet{} - // Add dummy start to avoid the use of index 0. - altLangISO3.add("---") - altLangISO3.updateLater("---", "aa") - - lang := b.lang.clone() - for _, a := range meta.Alias.LanguageAlias { - if a.Replacement == "" { - a.Replacement = "und" - } - // TODO: support mapping to tags - repl := strings.SplitN(a.Replacement, "_", 2)[0] - if a.Reason == "overlong" { - if len(a.Replacement) == 2 && len(a.Type) == 3 { - lang.updateLater(a.Replacement, a.Type) - } - } else if len(a.Type) <= 3 { - switch a.Reason { - case "macrolanguage": - aliasTypeMap[a.Type] = Macro - case "deprecated": - // handled elsewhere - continue - case "bibliographic", "legacy": - if a.Type == "no" { - continue - } - aliasTypeMap[a.Type] = Legacy - default: - log.Fatalf("new %s alias: %s", a.Reason, a.Type) - } - langAliasMap.add(a.Type) - langAliasMap.updateLater(a.Type, repl) - } - } - // Manually add the mapping of "nb" (Norwegian) to its macro language. - // This can be removed if CLDR adopts this change. - langAliasMap.add("nb") - langAliasMap.updateLater("nb", "no") - aliasTypeMap["nb"] = Macro - - for k, v := range b.registry { - // Also add deprecated values for 3-letter ISO codes, which CLDR omits. - if v.typ == "language" && v.deprecated != "" && v.preferred != "" { - langAliasMap.add(k) - langAliasMap.updateLater(k, v.preferred) - aliasTypeMap[k] = Deprecated - } - } - // Fix CLDR mappings. - lang.updateLater("tl", "tgl") - lang.updateLater("sh", "hbs") - lang.updateLater("mo", "mol") - lang.updateLater("no", "nor") - lang.updateLater("tw", "twi") - lang.updateLater("nb", "nob") - lang.updateLater("ak", "aka") - lang.updateLater("bh", "bih") - - // Ensure that each 2-letter code is matched with a 3-letter code. - for _, v := range lang.s[1:] { - s, ok := lang.update[v] - if !ok { - if s, ok = lang.update[langAliasMap.update[v]]; !ok { - continue - } - lang.update[v] = s - } - if v[0] != s[0] { - altLangISO3.add(s) - altLangISO3.updateLater(s, v) - } - } - - // Complete canonicalized language tags. - lang.freeze() - for i, v := range lang.s { - // We can avoid these manual entries by using the IANA registry directly. - // Seems easier to update the list manually, as changes are rare. - // The panic in this loop will trigger if we miss an entry. - add := "" - if s, ok := lang.update[v]; ok { - if s[0] == v[0] { - add = s[1:] - } else { - add = string([]byte{0, byte(altLangISO3.index(s))}) - } - } else if len(v) == 3 { - add = "\x00" - } else { - log.Panicf("no data for long form of %q", v) - } - lang.s[i] += add - } - b.writeConst("lang", tag.Index(lang.join())) - - b.writeConst("langNoIndexOffset", len(b.lang.s)) - - // space of all valid 3-letter language identifiers. - b.writeBitVector("langNoIndex", b.langNoIndex.slice()) - - altLangIndex := []uint16{} - for i, s := range altLangISO3.slice() { - altLangISO3.s[i] += string([]byte{byte(len(altLangIndex))}) - if i > 0 { - idx := b.lang.index(altLangISO3.update[s]) - altLangIndex = append(altLangIndex, uint16(idx)) - } - } - b.writeConst("altLangISO3", tag.Index(altLangISO3.join())) - b.writeSlice("altLangIndex", altLangIndex) - - b.writeSortedMap("AliasMap", &langAliasMap, b.langIndex) - types := make([]AliasType, len(langAliasMap.s)) - for i, s := range langAliasMap.s { - types[i] = aliasTypeMap[s] - } - b.writeSlice("AliasTypes", types) -} - -var scriptConsts = []string{ - "Latn", "Hani", "Hans", "Hant", "Qaaa", "Qaai", "Qabx", "Zinh", "Zyyy", - "Zzzz", -} - -func (b *builder) writeScript() { - b.writeConsts(b.script.index, scriptConsts...) - b.writeConst("script", tag.Index(b.script.join())) - - supp := make([]uint8, len(b.lang.slice())) - for i, v := range b.lang.slice()[1:] { - if sc := b.registry[v].suppressScript; sc != "" { - supp[i+1] = uint8(b.script.index(sc)) - } - } - b.writeSlice("suppressScript", supp) - - // There is only one deprecated script in CLDR. This value is hard-coded. - // We check here if the code must be updated. - for _, a := range b.supp.Metadata.Alias.ScriptAlias { - if a.Type != "Qaai" { - log.Panicf("unexpected deprecated stript %q", a.Type) - } - } -} - -func parseM49(s string) int16 { - if len(s) == 0 { - return 0 - } - v, err := strconv.ParseUint(s, 10, 10) - failOnError(err) - return int16(v) -} - -var regionConsts = []string{ - "001", "419", "BR", "CA", "ES", "GB", "MD", "PT", "UK", "US", - "ZZ", "XA", "XC", "XK", // Unofficial tag for Kosovo. -} - -func (b *builder) writeRegion() { - b.writeConsts(b.region.index, regionConsts...) - - isoOffset := b.region.index("AA") - m49map := make([]int16, len(b.region.slice())) - fromM49map := make(map[int16]int) - altRegionISO3 := "" - altRegionIDs := []uint16{} - - b.writeConst("isoRegionOffset", isoOffset) - - // 2-letter region lookup and mapping to numeric codes. - regionISO := b.region.clone() - regionISO.s = regionISO.s[isoOffset:] - regionISO.sorted = false - - regionTypes := make([]byte, len(b.region.s)) - - // Is the region valid BCP 47? - for s, e := range b.registry { - if len(s) == 2 && s == strings.ToUpper(s) { - i := b.region.index(s) - for _, d := range e.description { - if strings.Contains(d, "Private use") { - regionTypes[i] = iso3166UserAssigned - } - } - regionTypes[i] |= bcp47Region - } - } - - // Is the region a valid ccTLD? - r := gen.OpenIANAFile("domains/root/db") - defer r.Close() - - buf, err := ioutil.ReadAll(r) - failOnError(err) - re := regexp.MustCompile(`"/domains/root/db/([a-z]{2}).html"`) - for _, m := range re.FindAllSubmatch(buf, -1) { - i := b.region.index(strings.ToUpper(string(m[1]))) - regionTypes[i] |= ccTLD - } - - b.writeSlice("regionTypes", regionTypes) - - iso3Set := make(map[string]int) - update := func(iso2, iso3 string) { - i := regionISO.index(iso2) - if j, ok := iso3Set[iso3]; !ok && iso3[0] == iso2[0] { - regionISO.s[i] += iso3[1:] - iso3Set[iso3] = -1 - } else { - if ok && j >= 0 { - regionISO.s[i] += string([]byte{0, byte(j)}) - } else { - iso3Set[iso3] = len(altRegionISO3) - regionISO.s[i] += string([]byte{0, byte(len(altRegionISO3))}) - altRegionISO3 += iso3 - altRegionIDs = append(altRegionIDs, uint16(isoOffset+i)) - } - } - } - for _, tc := range b.supp.CodeMappings.TerritoryCodes { - i := regionISO.index(tc.Type) + isoOffset - if d := m49map[i]; d != 0 { - log.Panicf("%s found as a duplicate UN.M49 code of %03d", tc.Numeric, d) - } - m49 := parseM49(tc.Numeric) - m49map[i] = m49 - if r := fromM49map[m49]; r == 0 { - fromM49map[m49] = i - } else if r != i { - dep := b.registry[regionISO.s[r-isoOffset]].deprecated - if t := b.registry[tc.Type]; t != nil && dep != "" && (t.deprecated == "" || t.deprecated > dep) { - fromM49map[m49] = i - } - } - } - for _, ta := range b.supp.Metadata.Alias.TerritoryAlias { - if len(ta.Type) == 3 && ta.Type[0] <= '9' && len(ta.Replacement) == 2 { - from := parseM49(ta.Type) - if r := fromM49map[from]; r == 0 { - fromM49map[from] = regionISO.index(ta.Replacement) + isoOffset - } - } - } - for _, tc := range b.supp.CodeMappings.TerritoryCodes { - if len(tc.Alpha3) == 3 { - update(tc.Type, tc.Alpha3) - } - } - // This entries are not included in territoryCodes. Mostly 3-letter variants - // of deleted codes and an entry for QU. - for _, m := range []struct{ iso2, iso3 string }{ - {"CT", "CTE"}, - {"DY", "DHY"}, - {"HV", "HVO"}, - {"JT", "JTN"}, - {"MI", "MID"}, - {"NH", "NHB"}, - {"NQ", "ATN"}, - {"PC", "PCI"}, - {"PU", "PUS"}, - {"PZ", "PCZ"}, - {"RH", "RHO"}, - {"VD", "VDR"}, - {"WK", "WAK"}, - // These three-letter codes are used for others as well. - {"FQ", "ATF"}, - } { - update(m.iso2, m.iso3) - } - for i, s := range regionISO.s { - if len(s) != 4 { - regionISO.s[i] = s + " " - } - } - b.writeConst("regionISO", tag.Index(regionISO.join())) - b.writeConst("altRegionISO3", altRegionISO3) - b.writeSlice("altRegionIDs", altRegionIDs) - - // Create list of deprecated regions. - // TODO: consider inserting SF -> FI. Not included by CLDR, but is the only - // Transitionally-reserved mapping not included. - regionOldMap := stringSet{} - // Include regions in territoryAlias (not all are in the IANA registry!) - for _, reg := range b.supp.Metadata.Alias.TerritoryAlias { - if len(reg.Type) == 2 && reg.Reason == "deprecated" && len(reg.Replacement) == 2 { - regionOldMap.add(reg.Type) - regionOldMap.updateLater(reg.Type, reg.Replacement) - i, _ := regionISO.find(reg.Type) - j, _ := regionISO.find(reg.Replacement) - if k := m49map[i+isoOffset]; k == 0 { - m49map[i+isoOffset] = m49map[j+isoOffset] - } - } - } - b.writeSortedMap("regionOldMap", ®ionOldMap, func(s string) uint16 { - return uint16(b.region.index(s)) - }) - // 3-digit region lookup, groupings. - for i := 1; i < isoOffset; i++ { - m := parseM49(b.region.s[i]) - m49map[i] = m - fromM49map[m] = i - } - b.writeSlice("m49", m49map) - - const ( - searchBits = 7 - regionBits = 9 - ) - if len(m49map) >= 1< %d", len(m49map), 1<>searchBits] = int16(len(fromM49)) - } - b.writeSlice("m49Index", m49Index) - b.writeSlice("fromM49", fromM49) -} - -const ( - // TODO: put these lists in regionTypes as user data? Could be used for - // various optimizations and refinements and could be exposed in the API. - iso3166Except = "AC CP DG EA EU FX IC SU TA UK" - iso3166Trans = "AN BU CS NT TP YU ZR" // SF is not in our set of Regions. - // DY and RH are actually not deleted, but indeterminately reserved. - iso3166DelCLDR = "CT DD DY FQ HV JT MI NH NQ PC PU PZ RH VD WK YD" -) - -const ( - iso3166UserAssigned = 1 << iota - ccTLD - bcp47Region -) - -func find(list []string, s string) int { - for i, t := range list { - if t == s { - return i - } - } - return -1 -} - -// writeVariants generates per-variant information and creates a map from variant -// name to index value. We assign index values such that sorting multiple -// variants by index value will result in the correct order. -// There are two types of variants: specialized and general. Specialized variants -// are only applicable to certain language or language-script pairs. Generalized -// variants apply to any language. Generalized variants always sort after -// specialized variants. We will therefore always assign a higher index value -// to a generalized variant than any other variant. Generalized variants are -// sorted alphabetically among themselves. -// Specialized variants may also sort after other specialized variants. Such -// variants will be ordered after any of the variants they may follow. -// We assume that if a variant x is followed by a variant y, then for any prefix -// p of x, p-x is a prefix of y. This allows us to order tags based on the -// maximum of the length of any of its prefixes. -// TODO: it is possible to define a set of Prefix values on variants such that -// a total order cannot be defined to the point that this algorithm breaks. -// In other words, we cannot guarantee the same order of variants for the -// future using the same algorithm or for non-compliant combinations of -// variants. For this reason, consider using simple alphabetic sorting -// of variants and ignore Prefix restrictions altogether. -func (b *builder) writeVariant() { - generalized := stringSet{} - specialized := stringSet{} - specializedExtend := stringSet{} - // Collate the variants by type and check assumptions. - for _, v := range b.variant.slice() { - e := b.registry[v] - if len(e.prefix) == 0 { - generalized.add(v) - continue - } - c := strings.Split(e.prefix[0], "-") - hasScriptOrRegion := false - if len(c) > 1 { - _, hasScriptOrRegion = b.script.find(c[1]) - if !hasScriptOrRegion { - _, hasScriptOrRegion = b.region.find(c[1]) - - } - } - if len(c) == 1 || len(c) == 2 && hasScriptOrRegion { - // Variant is preceded by a language. - specialized.add(v) - continue - } - // Variant is preceded by another variant. - specializedExtend.add(v) - prefix := c[0] + "-" - if hasScriptOrRegion { - prefix += c[1] - } - for _, p := range e.prefix { - // Verify that the prefix minus the last element is a prefix of the - // predecessor element. - i := strings.LastIndex(p, "-") - pred := b.registry[p[i+1:]] - if find(pred.prefix, p[:i]) < 0 { - log.Fatalf("prefix %q for variant %q not consistent with predecessor spec", p, v) - } - // The sorting used below does not work in the general case. It works - // if we assume that variants that may be followed by others only have - // prefixes of the same length. Verify this. - count := strings.Count(p[:i], "-") - for _, q := range pred.prefix { - if c := strings.Count(q, "-"); c != count { - log.Fatalf("variant %q preceding %q has a prefix %q of size %d; want %d", p[i+1:], v, q, c, count) - } - } - if !strings.HasPrefix(p, prefix) { - log.Fatalf("prefix %q of variant %q should start with %q", p, v, prefix) - } - } - } - - // Sort extended variants. - a := specializedExtend.s - less := func(v, w string) bool { - // Sort by the maximum number of elements. - maxCount := func(s string) (max int) { - for _, p := range b.registry[s].prefix { - if c := strings.Count(p, "-"); c > max { - max = c - } - } - return - } - if cv, cw := maxCount(v), maxCount(w); cv != cw { - return cv < cw - } - // Sort by name as tie breaker. - return v < w - } - sort.Sort(funcSorter{less, sort.StringSlice(a)}) - specializedExtend.frozen = true - - // Create index from variant name to index. - variantIndex := make(map[string]uint8) - add := func(s []string) { - for _, v := range s { - variantIndex[v] = uint8(len(variantIndex)) - } - } - add(specialized.slice()) - add(specializedExtend.s) - numSpecialized := len(variantIndex) - add(generalized.slice()) - if n := len(variantIndex); n > 255 { - log.Fatalf("maximum number of variants exceeded: was %d; want <= 255", n) - } - b.writeMap("variantIndex", variantIndex) - b.writeConst("variantNumSpecialized", numSpecialized) -} - -func (b *builder) writeLanguageInfo() { -} - -// writeLikelyData writes tables that are used both for finding parent relations and for -// language matching. Each entry contains additional bits to indicate the status of the -// data to know when it cannot be used for parent relations. -func (b *builder) writeLikelyData() { - const ( - isList = 1 << iota - scriptInFrom - regionInFrom - ) - type ( // generated types - likelyScriptRegion struct { - region uint16 - script uint8 - flags uint8 - } - likelyLangScript struct { - lang uint16 - script uint8 - flags uint8 - } - likelyLangRegion struct { - lang uint16 - region uint16 - } - // likelyTag is used for getting likely tags for group regions, where - // the likely region might be a region contained in the group. - likelyTag struct { - lang uint16 - region uint16 - script uint8 - } - ) - var ( // generated variables - likelyRegionGroup = make([]likelyTag, len(b.groups)) - likelyLang = make([]likelyScriptRegion, len(b.lang.s)) - likelyRegion = make([]likelyLangScript, len(b.region.s)) - likelyScript = make([]likelyLangRegion, len(b.script.s)) - likelyLangList = []likelyScriptRegion{} - likelyRegionList = []likelyLangScript{} - ) - type fromTo struct { - from, to []string - } - langToOther := map[int][]fromTo{} - regionToOther := map[int][]fromTo{} - for _, m := range b.supp.LikelySubtags.LikelySubtag { - from := strings.Split(m.From, "_") - to := strings.Split(m.To, "_") - if len(to) != 3 { - log.Fatalf("invalid number of subtags in %q: found %d, want 3", m.To, len(to)) - } - if len(from) > 3 { - log.Fatalf("invalid number of subtags: found %d, want 1-3", len(from)) - } - if from[0] != to[0] && from[0] != "und" { - log.Fatalf("unexpected language change in expansion: %s -> %s", from, to) - } - if len(from) == 3 { - if from[2] != to[2] { - log.Fatalf("unexpected region change in expansion: %s -> %s", from, to) - } - if from[0] != "und" { - log.Fatalf("unexpected fully specified from tag: %s -> %s", from, to) - } - } - if len(from) == 1 || from[0] != "und" { - id := 0 - if from[0] != "und" { - id = b.lang.index(from[0]) - } - langToOther[id] = append(langToOther[id], fromTo{from, to}) - } else if len(from) == 2 && len(from[1]) == 4 { - sid := b.script.index(from[1]) - likelyScript[sid].lang = uint16(b.langIndex(to[0])) - likelyScript[sid].region = uint16(b.region.index(to[2])) - } else { - r := b.region.index(from[len(from)-1]) - if id, ok := b.groups[r]; ok { - if from[0] != "und" { - log.Fatalf("region changed unexpectedly: %s -> %s", from, to) - } - likelyRegionGroup[id].lang = uint16(b.langIndex(to[0])) - likelyRegionGroup[id].script = uint8(b.script.index(to[1])) - likelyRegionGroup[id].region = uint16(b.region.index(to[2])) - } else { - regionToOther[r] = append(regionToOther[r], fromTo{from, to}) - } - } - } - b.writeType(likelyLangRegion{}) - b.writeSlice("likelyScript", likelyScript) - - for id := range b.lang.s { - list := langToOther[id] - if len(list) == 1 { - likelyLang[id].region = uint16(b.region.index(list[0].to[2])) - likelyLang[id].script = uint8(b.script.index(list[0].to[1])) - } else if len(list) > 1 { - likelyLang[id].flags = isList - likelyLang[id].region = uint16(len(likelyLangList)) - likelyLang[id].script = uint8(len(list)) - for _, x := range list { - flags := uint8(0) - if len(x.from) > 1 { - if x.from[1] == x.to[2] { - flags = regionInFrom - } else { - flags = scriptInFrom - } - } - likelyLangList = append(likelyLangList, likelyScriptRegion{ - region: uint16(b.region.index(x.to[2])), - script: uint8(b.script.index(x.to[1])), - flags: flags, - }) - } - } - } - // TODO: merge suppressScript data with this table. - b.writeType(likelyScriptRegion{}) - b.writeSlice("likelyLang", likelyLang) - b.writeSlice("likelyLangList", likelyLangList) - - for id := range b.region.s { - list := regionToOther[id] - if len(list) == 1 { - likelyRegion[id].lang = uint16(b.langIndex(list[0].to[0])) - likelyRegion[id].script = uint8(b.script.index(list[0].to[1])) - if len(list[0].from) > 2 { - likelyRegion[id].flags = scriptInFrom - } - } else if len(list) > 1 { - likelyRegion[id].flags = isList - likelyRegion[id].lang = uint16(len(likelyRegionList)) - likelyRegion[id].script = uint8(len(list)) - for i, x := range list { - if len(x.from) == 2 && i != 0 || i > 0 && len(x.from) != 3 { - log.Fatalf("unspecified script must be first in list: %v at %d", x.from, i) - } - x := likelyLangScript{ - lang: uint16(b.langIndex(x.to[0])), - script: uint8(b.script.index(x.to[1])), - } - if len(list[0].from) > 2 { - x.flags = scriptInFrom - } - likelyRegionList = append(likelyRegionList, x) - } - } - } - b.writeType(likelyLangScript{}) - b.writeSlice("likelyRegion", likelyRegion) - b.writeSlice("likelyRegionList", likelyRegionList) - - b.writeType(likelyTag{}) - b.writeSlice("likelyRegionGroup", likelyRegionGroup) -} - -func (b *builder) writeRegionInclusionData() { - var ( - // mm holds for each group the set of groups with a distance of 1. - mm = make(map[int][]index) - - // containment holds for each group the transitive closure of - // containment of other groups. - containment = make(map[index][]index) - ) - for _, g := range b.supp.TerritoryContainment.Group { - // Skip UN and EURO zone as they are flattening the containment - // relationship. - if g.Type == "EZ" || g.Type == "UN" { - continue - } - group := b.region.index(g.Type) - groupIdx := b.groups[group] - for _, mem := range strings.Split(g.Contains, " ") { - r := b.region.index(mem) - mm[r] = append(mm[r], groupIdx) - if g, ok := b.groups[r]; ok { - mm[group] = append(mm[group], g) - containment[groupIdx] = append(containment[groupIdx], g) - } - } - } - - regionContainment := make([]uint64, len(b.groups)) - for _, g := range b.groups { - l := containment[g] - - // Compute the transitive closure of containment. - for i := 0; i < len(l); i++ { - l = append(l, containment[l[i]]...) - } - - // Compute the bitmask. - regionContainment[g] = 1 << g - for _, v := range l { - regionContainment[g] |= 1 << v - } - } - b.writeSlice("regionContainment", regionContainment) - - regionInclusion := make([]uint8, len(b.region.s)) - bvs := make(map[uint64]index) - // Make the first bitvector positions correspond with the groups. - for r, i := range b.groups { - bv := uint64(1 << i) - for _, g := range mm[r] { - bv |= 1 << g - } - bvs[bv] = i - regionInclusion[r] = uint8(bvs[bv]) - } - for r := 1; r < len(b.region.s); r++ { - if _, ok := b.groups[r]; !ok { - bv := uint64(0) - for _, g := range mm[r] { - bv |= 1 << g - } - if bv == 0 { - // Pick the world for unspecified regions. - bv = 1 << b.groups[b.region.index("001")] - } - if _, ok := bvs[bv]; !ok { - bvs[bv] = index(len(bvs)) - } - regionInclusion[r] = uint8(bvs[bv]) - } - } - b.writeSlice("regionInclusion", regionInclusion) - regionInclusionBits := make([]uint64, len(bvs)) - for k, v := range bvs { - regionInclusionBits[v] = uint64(k) - } - // Add bit vectors for increasingly large distances until a fixed point is reached. - regionInclusionNext := []uint8{} - for i := 0; i < len(regionInclusionBits); i++ { - bits := regionInclusionBits[i] - next := bits - for i := uint(0); i < uint(len(b.groups)); i++ { - if bits&(1< 6 { - log.Fatalf("Too many groups: %d", i) - } - idToIndex[mv.Id] = uint8(i + 1) - // TODO: also handle '-' - for _, r := range strings.Split(mv.Value, "+") { - todo := []string{r} - for k := 0; k < len(todo); k++ { - r := todo[k] - regionToGroups[b.regionIndex(r)] |= 1 << uint8(i) - todo = append(todo, regionHierarchy[r]...) - } - } - } - b.w.WriteVar("regionToGroups", regionToGroups) - - // maps language id to in- and out-of-group region. - paradigmLocales := [][3]uint16{} - locales := strings.Split(lm[0].ParadigmLocales[0].Locales, " ") - for i := 0; i < len(locales); i += 2 { - x := [3]uint16{} - for j := 0; j < 2; j++ { - pc := strings.SplitN(locales[i+j], "-", 2) - x[0] = b.langIndex(pc[0]) - if len(pc) == 2 { - x[1+j] = uint16(b.regionIndex(pc[1])) - } - } - paradigmLocales = append(paradigmLocales, x) - } - b.w.WriteVar("paradigmLocales", paradigmLocales) - - b.w.WriteType(mutualIntelligibility{}) - b.w.WriteType(scriptIntelligibility{}) - b.w.WriteType(regionIntelligibility{}) - - matchLang := []mutualIntelligibility{} - matchScript := []scriptIntelligibility{} - matchRegion := []regionIntelligibility{} - // Convert the languageMatch entries in lists keyed by desired language. - for _, m := range lm[0].LanguageMatch { - // Different versions of CLDR use different separators. - desired := strings.Replace(m.Desired, "-", "_", -1) - supported := strings.Replace(m.Supported, "-", "_", -1) - d := strings.Split(desired, "_") - s := strings.Split(supported, "_") - if len(d) != len(s) { - log.Fatalf("not supported: desired=%q; supported=%q", desired, supported) - continue - } - distance, _ := strconv.ParseInt(m.Distance, 10, 8) - switch len(d) { - case 2: - if desired == supported && desired == "*_*" { - continue - } - // language-script pair. - matchScript = append(matchScript, scriptIntelligibility{ - wantLang: uint16(b.langIndex(d[0])), - haveLang: uint16(b.langIndex(s[0])), - wantScript: uint8(b.scriptIndex(d[1])), - haveScript: uint8(b.scriptIndex(s[1])), - distance: uint8(distance), - }) - if m.Oneway != "true" { - matchScript = append(matchScript, scriptIntelligibility{ - wantLang: uint16(b.langIndex(s[0])), - haveLang: uint16(b.langIndex(d[0])), - wantScript: uint8(b.scriptIndex(s[1])), - haveScript: uint8(b.scriptIndex(d[1])), - distance: uint8(distance), - }) - } - case 1: - if desired == supported && desired == "*" { - continue - } - if distance == 1 { - // nb == no is already handled by macro mapping. Check there - // really is only this case. - if d[0] != "no" || s[0] != "nb" { - log.Fatalf("unhandled equivalence %s == %s", s[0], d[0]) - } - continue - } - // TODO: consider dropping oneway field and just doubling the entry. - matchLang = append(matchLang, mutualIntelligibility{ - want: uint16(b.langIndex(d[0])), - have: uint16(b.langIndex(s[0])), - distance: uint8(distance), - oneway: m.Oneway == "true", - }) - case 3: - if desired == supported && desired == "*_*_*" { - continue - } - if desired != supported { - // This is now supported by CLDR, but only one case, which - // should already be covered by paradigm locales. For instance, - // test case "und, en, en-GU, en-IN, en-GB ; en-ZA ; en-GB" in - // testdata/CLDRLocaleMatcherTest.txt tests this. - if supported != "en_*_GB" { - log.Fatalf("not supported: desired=%q; supported=%q", desired, supported) - } - continue - } - ri := regionIntelligibility{ - lang: b.langIndex(d[0]), - distance: uint8(distance), - } - if d[1] != "*" { - ri.script = uint8(b.scriptIndex(d[1])) - } - switch { - case d[2] == "*": - ri.group = 0x80 // not contained in anything - case strings.HasPrefix(d[2], "$!"): - ri.group = 0x80 - d[2] = "$" + d[2][len("$!"):] - fallthrough - case strings.HasPrefix(d[2], "$"): - ri.group |= idToIndex[d[2]] - } - matchRegion = append(matchRegion, ri) - default: - log.Fatalf("not supported: desired=%q; supported=%q", desired, supported) - } - } - sort.SliceStable(matchLang, func(i, j int) bool { - return matchLang[i].distance < matchLang[j].distance - }) - b.w.WriteComment(` - matchLang holds pairs of langIDs of base languages that are typically - mutually intelligible. Each pair is associated with a confidence and - whether the intelligibility goes one or both ways.`) - b.w.WriteVar("matchLang", matchLang) - - b.w.WriteComment(` - matchScript holds pairs of scriptIDs where readers of one script - can typically also read the other. Each is associated with a confidence.`) - sort.SliceStable(matchScript, func(i, j int) bool { - return matchScript[i].distance < matchScript[j].distance - }) - b.w.WriteVar("matchScript", matchScript) - - sort.SliceStable(matchRegion, func(i, j int) bool { - return matchRegion[i].distance < matchRegion[j].distance - }) - b.w.WriteVar("matchRegion", matchRegion) -} diff --git a/vendor/golang.org/x/text/unicode/bidi/gen.go b/vendor/golang.org/x/text/unicode/bidi/gen.go deleted file mode 100644 index 987fc169cc..0000000000 --- a/vendor/golang.org/x/text/unicode/bidi/gen.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "flag" - "log" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/triegen" - "golang.org/x/text/internal/ucd" -) - -var outputFile = flag.String("out", "tables.go", "output file") - -func main() { - gen.Init() - gen.Repackage("gen_trieval.go", "trieval.go", "bidi") - gen.Repackage("gen_ranges.go", "ranges_test.go", "bidi") - - genTables() -} - -// bidiClass names and codes taken from class "bc" in -// https://www.unicode.org/Public/8.0.0/ucd/PropertyValueAliases.txt -var bidiClass = map[string]Class{ - "AL": AL, // ArabicLetter - "AN": AN, // ArabicNumber - "B": B, // ParagraphSeparator - "BN": BN, // BoundaryNeutral - "CS": CS, // CommonSeparator - "EN": EN, // EuropeanNumber - "ES": ES, // EuropeanSeparator - "ET": ET, // EuropeanTerminator - "L": L, // LeftToRight - "NSM": NSM, // NonspacingMark - "ON": ON, // OtherNeutral - "R": R, // RightToLeft - "S": S, // SegmentSeparator - "WS": WS, // WhiteSpace - - "FSI": Control, - "PDF": Control, - "PDI": Control, - "LRE": Control, - "LRI": Control, - "LRO": Control, - "RLE": Control, - "RLI": Control, - "RLO": Control, -} - -func genTables() { - if numClass > 0x0F { - log.Fatalf("Too many Class constants (%#x > 0x0F).", numClass) - } - w := gen.NewCodeWriter() - defer w.WriteVersionedGoFile(*outputFile, "bidi") - - gen.WriteUnicodeVersion(w) - - t := triegen.NewTrie("bidi") - - // Build data about bracket mapping. These bits need to be or-ed with - // any other bits. - orMask := map[rune]uint64{} - - xorMap := map[rune]int{} - xorMasks := []rune{0} // First value is no-op. - - ucd.Parse(gen.OpenUCDFile("BidiBrackets.txt"), func(p *ucd.Parser) { - r1 := p.Rune(0) - r2 := p.Rune(1) - xor := r1 ^ r2 - if _, ok := xorMap[xor]; !ok { - xorMap[xor] = len(xorMasks) - xorMasks = append(xorMasks, xor) - } - entry := uint64(xorMap[xor]) << xorMaskShift - switch p.String(2) { - case "o": - entry |= openMask - case "c", "n": - default: - log.Fatalf("Unknown bracket class %q.", p.String(2)) - } - orMask[r1] = entry - }) - - w.WriteComment(` - xorMasks contains masks to be xor-ed with brackets to get the reverse - version.`) - w.WriteVar("xorMasks", xorMasks) - - done := map[rune]bool{} - - insert := func(r rune, c Class) { - if !done[r] { - t.Insert(r, orMask[r]|uint64(c)) - done[r] = true - } - } - - // Insert the derived BiDi properties. - ucd.Parse(gen.OpenUCDFile("extracted/DerivedBidiClass.txt"), func(p *ucd.Parser) { - r := p.Rune(0) - class, ok := bidiClass[p.String(1)] - if !ok { - log.Fatalf("%U: Unknown BiDi class %q", r, p.String(1)) - } - insert(r, class) - }) - visitDefaults(insert) - - // TODO: use sparse blocks. This would reduce table size considerably - // from the looks of it. - - sz, err := t.Gen(w) - if err != nil { - log.Fatal(err) - } - w.Size += sz -} - -// dummy values to make methods in gen_common compile. The real versions -// will be generated by this file to tables.go. -var ( - xorMasks []rune -) diff --git a/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go b/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go deleted file mode 100644 index 02c3b505d6..0000000000 --- a/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "unicode" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/ucd" - "golang.org/x/text/unicode/rangetable" -) - -// These tables are hand-extracted from: -// https://www.unicode.org/Public/8.0.0/ucd/extracted/DerivedBidiClass.txt -func visitDefaults(fn func(r rune, c Class)) { - // first write default values for ranges listed above. - visitRunes(fn, AL, []rune{ - 0x0600, 0x07BF, // Arabic - 0x08A0, 0x08FF, // Arabic Extended-A - 0xFB50, 0xFDCF, // Arabic Presentation Forms - 0xFDF0, 0xFDFF, - 0xFE70, 0xFEFF, - 0x0001EE00, 0x0001EEFF, // Arabic Mathematical Alpha Symbols - }) - visitRunes(fn, R, []rune{ - 0x0590, 0x05FF, // Hebrew - 0x07C0, 0x089F, // Nko et al. - 0xFB1D, 0xFB4F, - 0x00010800, 0x00010FFF, // Cypriot Syllabary et. al. - 0x0001E800, 0x0001EDFF, - 0x0001EF00, 0x0001EFFF, - }) - visitRunes(fn, ET, []rune{ // European Terminator - 0x20A0, 0x20Cf, // Currency symbols - }) - rangetable.Visit(unicode.Noncharacter_Code_Point, func(r rune) { - fn(r, BN) // Boundary Neutral - }) - ucd.Parse(gen.OpenUCDFile("DerivedCoreProperties.txt"), func(p *ucd.Parser) { - if p.String(1) == "Default_Ignorable_Code_Point" { - fn(p.Rune(0), BN) // Boundary Neutral - } - }) -} - -func visitRunes(fn func(r rune, c Class), c Class, runes []rune) { - for i := 0; i < len(runes); i += 2 { - lo, hi := runes[i], runes[i+1] - for j := lo; j <= hi; j++ { - fn(j, c) - } - } -} diff --git a/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go b/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go deleted file mode 100644 index 9cb9942894..0000000000 --- a/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// Class is the Unicode BiDi class. Each rune has a single class. -type Class uint - -const ( - L Class = iota // LeftToRight - R // RightToLeft - EN // EuropeanNumber - ES // EuropeanSeparator - ET // EuropeanTerminator - AN // ArabicNumber - CS // CommonSeparator - B // ParagraphSeparator - S // SegmentSeparator - WS // WhiteSpace - ON // OtherNeutral - BN // BoundaryNeutral - NSM // NonspacingMark - AL // ArabicLetter - Control // Control LRO - PDI - - numClass - - LRO // LeftToRightOverride - RLO // RightToLeftOverride - LRE // LeftToRightEmbedding - RLE // RightToLeftEmbedding - PDF // PopDirectionalFormat - LRI // LeftToRightIsolate - RLI // RightToLeftIsolate - FSI // FirstStrongIsolate - PDI // PopDirectionalIsolate - - unknownClass = ^Class(0) -) - -var controlToClass = map[rune]Class{ - 0x202D: LRO, // LeftToRightOverride, - 0x202E: RLO, // RightToLeftOverride, - 0x202A: LRE, // LeftToRightEmbedding, - 0x202B: RLE, // RightToLeftEmbedding, - 0x202C: PDF, // PopDirectionalFormat, - 0x2066: LRI, // LeftToRightIsolate, - 0x2067: RLI, // RightToLeftIsolate, - 0x2068: FSI, // FirstStrongIsolate, - 0x2069: PDI, // PopDirectionalIsolate, -} - -// A trie entry has the following bits: -// 7..5 XOR mask for brackets -// 4 1: Bracket open, 0: Bracket close -// 3..0 Class type - -const ( - openMask = 0x10 - xorMaskShift = 5 -) diff --git a/vendor/golang.org/x/text/unicode/norm/maketables.go b/vendor/golang.org/x/text/unicode/norm/maketables.go deleted file mode 100644 index 30a3aa9334..0000000000 --- a/vendor/golang.org/x/text/unicode/norm/maketables.go +++ /dev/null @@ -1,986 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Normalization table generator. -// Data read from the web. -// See forminfo.go for a description of the trie values associated with each rune. - -package main - -import ( - "bytes" - "encoding/binary" - "flag" - "fmt" - "io" - "log" - "sort" - "strconv" - "strings" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/triegen" - "golang.org/x/text/internal/ucd" -) - -func main() { - gen.Init() - loadUnicodeData() - compactCCC() - loadCompositionExclusions() - completeCharFields(FCanonical) - completeCharFields(FCompatibility) - computeNonStarterCounts() - verifyComputed() - printChars() - testDerived() - printTestdata() - makeTables() -} - -var ( - tablelist = flag.String("tables", - "all", - "comma-separated list of which tables to generate; "+ - "can be 'decomp', 'recomp', 'info' and 'all'") - test = flag.Bool("test", - false, - "test existing tables against DerivedNormalizationProps and generate test data for regression testing") - verbose = flag.Bool("verbose", - false, - "write data to stdout as it is parsed") -) - -const MaxChar = 0x10FFFF // anything above this shouldn't exist - -// Quick Check properties of runes allow us to quickly -// determine whether a rune may occur in a normal form. -// For a given normal form, a rune may be guaranteed to occur -// verbatim (QC=Yes), may or may not combine with another -// rune (QC=Maybe), or may not occur (QC=No). -type QCResult int - -const ( - QCUnknown QCResult = iota - QCYes - QCNo - QCMaybe -) - -func (r QCResult) String() string { - switch r { - case QCYes: - return "Yes" - case QCNo: - return "No" - case QCMaybe: - return "Maybe" - } - return "***UNKNOWN***" -} - -const ( - FCanonical = iota // NFC or NFD - FCompatibility // NFKC or NFKD - FNumberOfFormTypes -) - -const ( - MComposed = iota // NFC or NFKC - MDecomposed // NFD or NFKD - MNumberOfModes -) - -// This contains only the properties we're interested in. -type Char struct { - name string - codePoint rune // if zero, this index is not a valid code point. - ccc uint8 // canonical combining class - origCCC uint8 - excludeInComp bool // from CompositionExclusions.txt - compatDecomp bool // it has a compatibility expansion - - nTrailingNonStarters uint8 - nLeadingNonStarters uint8 // must be equal to trailing if non-zero - - forms [FNumberOfFormTypes]FormInfo // For FCanonical and FCompatibility - - state State -} - -var chars = make([]Char, MaxChar+1) -var cccMap = make(map[uint8]uint8) - -func (c Char) String() string { - buf := new(bytes.Buffer) - - fmt.Fprintf(buf, "%U [%s]:\n", c.codePoint, c.name) - fmt.Fprintf(buf, " ccc: %v\n", c.ccc) - fmt.Fprintf(buf, " excludeInComp: %v\n", c.excludeInComp) - fmt.Fprintf(buf, " compatDecomp: %v\n", c.compatDecomp) - fmt.Fprintf(buf, " state: %v\n", c.state) - fmt.Fprintf(buf, " NFC:\n") - fmt.Fprint(buf, c.forms[FCanonical]) - fmt.Fprintf(buf, " NFKC:\n") - fmt.Fprint(buf, c.forms[FCompatibility]) - - return buf.String() -} - -// In UnicodeData.txt, some ranges are marked like this: -// 3400;;Lo;0;L;;;;;N;;;;; -// 4DB5;;Lo;0;L;;;;;N;;;;; -// parseCharacter keeps a state variable indicating the weirdness. -type State int - -const ( - SNormal State = iota // known to be zero for the type - SFirst - SLast - SMissing -) - -var lastChar = rune('\u0000') - -func (c Char) isValid() bool { - return c.codePoint != 0 && c.state != SMissing -} - -type FormInfo struct { - quickCheck [MNumberOfModes]QCResult // index: MComposed or MDecomposed - verified [MNumberOfModes]bool // index: MComposed or MDecomposed - - combinesForward bool // May combine with rune on the right - combinesBackward bool // May combine with rune on the left - isOneWay bool // Never appears in result - inDecomp bool // Some decompositions result in this char. - decomp Decomposition - expandedDecomp Decomposition -} - -func (f FormInfo) String() string { - buf := bytes.NewBuffer(make([]byte, 0)) - - fmt.Fprintf(buf, " quickCheck[C]: %v\n", f.quickCheck[MComposed]) - fmt.Fprintf(buf, " quickCheck[D]: %v\n", f.quickCheck[MDecomposed]) - fmt.Fprintf(buf, " cmbForward: %v\n", f.combinesForward) - fmt.Fprintf(buf, " cmbBackward: %v\n", f.combinesBackward) - fmt.Fprintf(buf, " isOneWay: %v\n", f.isOneWay) - fmt.Fprintf(buf, " inDecomp: %v\n", f.inDecomp) - fmt.Fprintf(buf, " decomposition: %X\n", f.decomp) - fmt.Fprintf(buf, " expandedDecomp: %X\n", f.expandedDecomp) - - return buf.String() -} - -type Decomposition []rune - -func parseDecomposition(s string, skipfirst bool) (a []rune, err error) { - decomp := strings.Split(s, " ") - if len(decomp) > 0 && skipfirst { - decomp = decomp[1:] - } - for _, d := range decomp { - point, err := strconv.ParseUint(d, 16, 64) - if err != nil { - return a, err - } - a = append(a, rune(point)) - } - return a, nil -} - -func loadUnicodeData() { - f := gen.OpenUCDFile("UnicodeData.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - r := p.Rune(ucd.CodePoint) - char := &chars[r] - - char.ccc = uint8(p.Uint(ucd.CanonicalCombiningClass)) - decmap := p.String(ucd.DecompMapping) - - exp, err := parseDecomposition(decmap, false) - isCompat := false - if err != nil { - if len(decmap) > 0 { - exp, err = parseDecomposition(decmap, true) - if err != nil { - log.Fatalf(`%U: bad decomp |%v|: "%s"`, r, decmap, err) - } - isCompat = true - } - } - - char.name = p.String(ucd.Name) - char.codePoint = r - char.forms[FCompatibility].decomp = exp - if !isCompat { - char.forms[FCanonical].decomp = exp - } else { - char.compatDecomp = true - } - if len(decmap) > 0 { - char.forms[FCompatibility].decomp = exp - } - } - if err := p.Err(); err != nil { - log.Fatal(err) - } -} - -// compactCCC converts the sparse set of CCC values to a continguous one, -// reducing the number of bits needed from 8 to 6. -func compactCCC() { - m := make(map[uint8]uint8) - for i := range chars { - c := &chars[i] - m[c.ccc] = 0 - } - cccs := []int{} - for v, _ := range m { - cccs = append(cccs, int(v)) - } - sort.Ints(cccs) - for i, c := range cccs { - cccMap[uint8(i)] = uint8(c) - m[uint8(c)] = uint8(i) - } - for i := range chars { - c := &chars[i] - c.origCCC = c.ccc - c.ccc = m[c.ccc] - } - if len(m) >= 1<<6 { - log.Fatalf("too many difference CCC values: %d >= 64", len(m)) - } -} - -// CompositionExclusions.txt has form: -// 0958 # ... -// See https://unicode.org/reports/tr44/ for full explanation -func loadCompositionExclusions() { - f := gen.OpenUCDFile("CompositionExclusions.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - c := &chars[p.Rune(0)] - if c.excludeInComp { - log.Fatalf("%U: Duplicate entry in exclusions.", c.codePoint) - } - c.excludeInComp = true - } - if e := p.Err(); e != nil { - log.Fatal(e) - } -} - -// hasCompatDecomp returns true if any of the recursive -// decompositions contains a compatibility expansion. -// In this case, the character may not occur in NFK*. -func hasCompatDecomp(r rune) bool { - c := &chars[r] - if c.compatDecomp { - return true - } - for _, d := range c.forms[FCompatibility].decomp { - if hasCompatDecomp(d) { - return true - } - } - return false -} - -// Hangul related constants. -const ( - HangulBase = 0xAC00 - HangulEnd = 0xD7A4 // hangulBase + Jamo combinations (19 * 21 * 28) - - JamoLBase = 0x1100 - JamoLEnd = 0x1113 - JamoVBase = 0x1161 - JamoVEnd = 0x1176 - JamoTBase = 0x11A8 - JamoTEnd = 0x11C3 - - JamoLVTCount = 19 * 21 * 28 - JamoTCount = 28 -) - -func isHangul(r rune) bool { - return HangulBase <= r && r < HangulEnd -} - -func isHangulWithoutJamoT(r rune) bool { - if !isHangul(r) { - return false - } - r -= HangulBase - return r < JamoLVTCount && r%JamoTCount == 0 -} - -func ccc(r rune) uint8 { - return chars[r].ccc -} - -// Insert a rune in a buffer, ordered by Canonical Combining Class. -func insertOrdered(b Decomposition, r rune) Decomposition { - n := len(b) - b = append(b, 0) - cc := ccc(r) - if cc > 0 { - // Use bubble sort. - for ; n > 0; n-- { - if ccc(b[n-1]) <= cc { - break - } - b[n] = b[n-1] - } - } - b[n] = r - return b -} - -// Recursively decompose. -func decomposeRecursive(form int, r rune, d Decomposition) Decomposition { - dcomp := chars[r].forms[form].decomp - if len(dcomp) == 0 { - return insertOrdered(d, r) - } - for _, c := range dcomp { - d = decomposeRecursive(form, c, d) - } - return d -} - -func completeCharFields(form int) { - // Phase 0: pre-expand decomposition. - for i := range chars { - f := &chars[i].forms[form] - if len(f.decomp) == 0 { - continue - } - exp := make(Decomposition, 0) - for _, c := range f.decomp { - exp = decomposeRecursive(form, c, exp) - } - f.expandedDecomp = exp - } - - // Phase 1: composition exclusion, mark decomposition. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - // Marks script-specific exclusions and version restricted. - f.isOneWay = c.excludeInComp - - // Singletons - f.isOneWay = f.isOneWay || len(f.decomp) == 1 - - // Non-starter decompositions - if len(f.decomp) > 1 { - chk := c.ccc != 0 || chars[f.decomp[0]].ccc != 0 - f.isOneWay = f.isOneWay || chk - } - - // Runes that decompose into more than two runes. - f.isOneWay = f.isOneWay || len(f.decomp) > 2 - - if form == FCompatibility { - f.isOneWay = f.isOneWay || hasCompatDecomp(c.codePoint) - } - - for _, r := range f.decomp { - chars[r].forms[form].inDecomp = true - } - } - - // Phase 2: forward and backward combining. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - if !f.isOneWay && len(f.decomp) == 2 { - f0 := &chars[f.decomp[0]].forms[form] - f1 := &chars[f.decomp[1]].forms[form] - if !f0.isOneWay { - f0.combinesForward = true - } - if !f1.isOneWay { - f1.combinesBackward = true - } - } - if isHangulWithoutJamoT(rune(i)) { - f.combinesForward = true - } - } - - // Phase 3: quick check values. - for i := range chars { - c := &chars[i] - f := &c.forms[form] - - switch { - case len(f.decomp) > 0: - f.quickCheck[MDecomposed] = QCNo - case isHangul(rune(i)): - f.quickCheck[MDecomposed] = QCNo - default: - f.quickCheck[MDecomposed] = QCYes - } - switch { - case f.isOneWay: - f.quickCheck[MComposed] = QCNo - case (i & 0xffff00) == JamoLBase: - f.quickCheck[MComposed] = QCYes - if JamoLBase <= i && i < JamoLEnd { - f.combinesForward = true - } - if JamoVBase <= i && i < JamoVEnd { - f.quickCheck[MComposed] = QCMaybe - f.combinesBackward = true - f.combinesForward = true - } - if JamoTBase <= i && i < JamoTEnd { - f.quickCheck[MComposed] = QCMaybe - f.combinesBackward = true - } - case !f.combinesBackward: - f.quickCheck[MComposed] = QCYes - default: - f.quickCheck[MComposed] = QCMaybe - } - } -} - -func computeNonStarterCounts() { - // Phase 4: leading and trailing non-starter count - for i := range chars { - c := &chars[i] - - runes := []rune{rune(i)} - // We always use FCompatibility so that the CGJ insertion points do not - // change for repeated normalizations with different forms. - if exp := c.forms[FCompatibility].expandedDecomp; len(exp) > 0 { - runes = exp - } - // We consider runes that combine backwards to be non-starters for the - // purpose of Stream-Safe Text Processing. - for _, r := range runes { - if cr := &chars[r]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward { - break - } - c.nLeadingNonStarters++ - } - for i := len(runes) - 1; i >= 0; i-- { - if cr := &chars[runes[i]]; cr.ccc == 0 && !cr.forms[FCompatibility].combinesBackward { - break - } - c.nTrailingNonStarters++ - } - if c.nTrailingNonStarters > 3 { - log.Fatalf("%U: Decomposition with more than 3 (%d) trailing modifiers (%U)", i, c.nTrailingNonStarters, runes) - } - - if isHangul(rune(i)) { - c.nTrailingNonStarters = 2 - if isHangulWithoutJamoT(rune(i)) { - c.nTrailingNonStarters = 1 - } - } - - if l, t := c.nLeadingNonStarters, c.nTrailingNonStarters; l > 0 && l != t { - log.Fatalf("%U: number of leading and trailing non-starters should be equal (%d vs %d)", i, l, t) - } - if t := c.nTrailingNonStarters; t > 3 { - log.Fatalf("%U: number of trailing non-starters is %d > 3", t) - } - } -} - -func printBytes(w io.Writer, b []byte, name string) { - fmt.Fprintf(w, "// %s: %d bytes\n", name, len(b)) - fmt.Fprintf(w, "var %s = [...]byte {", name) - for i, c := range b { - switch { - case i%64 == 0: - fmt.Fprintf(w, "\n// Bytes %x - %x\n", i, i+63) - case i%8 == 0: - fmt.Fprintf(w, "\n") - } - fmt.Fprintf(w, "0x%.2X, ", c) - } - fmt.Fprint(w, "\n}\n\n") -} - -// See forminfo.go for format. -func makeEntry(f *FormInfo, c *Char) uint16 { - e := uint16(0) - if r := c.codePoint; HangulBase <= r && r < HangulEnd { - e |= 0x40 - } - if f.combinesForward { - e |= 0x20 - } - if f.quickCheck[MDecomposed] == QCNo { - e |= 0x4 - } - switch f.quickCheck[MComposed] { - case QCYes: - case QCNo: - e |= 0x10 - case QCMaybe: - e |= 0x18 - default: - log.Fatalf("Illegal quickcheck value %v.", f.quickCheck[MComposed]) - } - e |= uint16(c.nTrailingNonStarters) - return e -} - -// decompSet keeps track of unique decompositions, grouped by whether -// the decomposition is followed by a trailing and/or leading CCC. -type decompSet [7]map[string]bool - -const ( - normalDecomp = iota - firstMulti - firstCCC - endMulti - firstLeadingCCC - firstCCCZeroExcept - firstStarterWithNLead - lastDecomp -) - -var cname = []string{"firstMulti", "firstCCC", "endMulti", "firstLeadingCCC", "firstCCCZeroExcept", "firstStarterWithNLead", "lastDecomp"} - -func makeDecompSet() decompSet { - m := decompSet{} - for i := range m { - m[i] = make(map[string]bool) - } - return m -} -func (m *decompSet) insert(key int, s string) { - m[key][s] = true -} - -func printCharInfoTables(w io.Writer) int { - mkstr := func(r rune, f *FormInfo) (int, string) { - d := f.expandedDecomp - s := string([]rune(d)) - if max := 1 << 6; len(s) >= max { - const msg = "%U: too many bytes in decomposition: %d >= %d" - log.Fatalf(msg, r, len(s), max) - } - head := uint8(len(s)) - if f.quickCheck[MComposed] != QCYes { - head |= 0x40 - } - if f.combinesForward { - head |= 0x80 - } - s = string([]byte{head}) + s - - lccc := ccc(d[0]) - tccc := ccc(d[len(d)-1]) - cc := ccc(r) - if cc != 0 && lccc == 0 && tccc == 0 { - log.Fatalf("%U: trailing and leading ccc are 0 for non-zero ccc %d", r, cc) - } - if tccc < lccc && lccc != 0 { - const msg = "%U: lccc (%d) must be <= tcc (%d)" - log.Fatalf(msg, r, lccc, tccc) - } - index := normalDecomp - nTrail := chars[r].nTrailingNonStarters - nLead := chars[r].nLeadingNonStarters - if tccc > 0 || lccc > 0 || nTrail > 0 { - tccc <<= 2 - tccc |= nTrail - s += string([]byte{tccc}) - index = endMulti - for _, r := range d[1:] { - if ccc(r) == 0 { - index = firstCCC - } - } - if lccc > 0 || nLead > 0 { - s += string([]byte{lccc}) - if index == firstCCC { - log.Fatalf("%U: multi-segment decomposition not supported for decompositions with leading CCC != 0", r) - } - index = firstLeadingCCC - } - if cc != lccc { - if cc != 0 { - log.Fatalf("%U: for lccc != ccc, expected ccc to be 0; was %d", r, cc) - } - index = firstCCCZeroExcept - } - } else if len(d) > 1 { - index = firstMulti - } - return index, s - } - - decompSet := makeDecompSet() - const nLeadStr = "\x00\x01" // 0-byte length and tccc with nTrail. - decompSet.insert(firstStarterWithNLead, nLeadStr) - - // Store the uniqued decompositions in a byte buffer, - // preceded by their byte length. - for _, c := range chars { - for _, f := range c.forms { - if len(f.expandedDecomp) == 0 { - continue - } - if f.combinesBackward { - log.Fatalf("%U: combinesBackward and decompose", c.codePoint) - } - index, s := mkstr(c.codePoint, &f) - decompSet.insert(index, s) - } - } - - decompositions := bytes.NewBuffer(make([]byte, 0, 10000)) - size := 0 - positionMap := make(map[string]uint16) - decompositions.WriteString("\000") - fmt.Fprintln(w, "const (") - for i, m := range decompSet { - sa := []string{} - for s := range m { - sa = append(sa, s) - } - sort.Strings(sa) - for _, s := range sa { - p := decompositions.Len() - decompositions.WriteString(s) - positionMap[s] = uint16(p) - } - if cname[i] != "" { - fmt.Fprintf(w, "%s = 0x%X\n", cname[i], decompositions.Len()) - } - } - fmt.Fprintln(w, "maxDecomp = 0x8000") - fmt.Fprintln(w, ")") - b := decompositions.Bytes() - printBytes(w, b, "decomps") - size += len(b) - - varnames := []string{"nfc", "nfkc"} - for i := 0; i < FNumberOfFormTypes; i++ { - trie := triegen.NewTrie(varnames[i]) - - for r, c := range chars { - f := c.forms[i] - d := f.expandedDecomp - if len(d) != 0 { - _, key := mkstr(c.codePoint, &f) - trie.Insert(rune(r), uint64(positionMap[key])) - if c.ccc != ccc(d[0]) { - // We assume the lead ccc of a decomposition !=0 in this case. - if ccc(d[0]) == 0 { - log.Fatalf("Expected leading CCC to be non-zero; ccc is %d", c.ccc) - } - } - } else if c.nLeadingNonStarters > 0 && len(f.expandedDecomp) == 0 && c.ccc == 0 && !f.combinesBackward { - // Handle cases where it can't be detected that the nLead should be equal - // to nTrail. - trie.Insert(c.codePoint, uint64(positionMap[nLeadStr])) - } else if v := makeEntry(&f, &c)<<8 | uint16(c.ccc); v != 0 { - trie.Insert(c.codePoint, uint64(0x8000|v)) - } - } - sz, err := trie.Gen(w, triegen.Compact(&normCompacter{name: varnames[i]})) - if err != nil { - log.Fatal(err) - } - size += sz - } - return size -} - -func contains(sa []string, s string) bool { - for _, a := range sa { - if a == s { - return true - } - } - return false -} - -func makeTables() { - w := &bytes.Buffer{} - - size := 0 - if *tablelist == "" { - return - } - list := strings.Split(*tablelist, ",") - if *tablelist == "all" { - list = []string{"recomp", "info"} - } - - // Compute maximum decomposition size. - max := 0 - for _, c := range chars { - if n := len(string(c.forms[FCompatibility].expandedDecomp)); n > max { - max = n - } - } - fmt.Fprintln(w, `import "sync"`) - fmt.Fprintln(w) - - fmt.Fprintln(w, "const (") - fmt.Fprintln(w, "\t// Version is the Unicode edition from which the tables are derived.") - fmt.Fprintf(w, "\tVersion = %q\n", gen.UnicodeVersion()) - fmt.Fprintln(w) - fmt.Fprintln(w, "\t// MaxTransformChunkSize indicates the maximum number of bytes that Transform") - fmt.Fprintln(w, "\t// may need to write atomically for any Form. Making a destination buffer at") - fmt.Fprintln(w, "\t// least this size ensures that Transform can always make progress and that") - fmt.Fprintln(w, "\t// the user does not need to grow the buffer on an ErrShortDst.") - fmt.Fprintf(w, "\tMaxTransformChunkSize = %d+maxNonStarters*4\n", len(string(0x034F))+max) - fmt.Fprintln(w, ")\n") - - // Print the CCC remap table. - size += len(cccMap) - fmt.Fprintf(w, "var ccc = [%d]uint8{", len(cccMap)) - for i := 0; i < len(cccMap); i++ { - if i%8 == 0 { - fmt.Fprintln(w) - } - fmt.Fprintf(w, "%3d, ", cccMap[uint8(i)]) - } - fmt.Fprintln(w, "\n}\n") - - if contains(list, "info") { - size += printCharInfoTables(w) - } - - if contains(list, "recomp") { - // Note that we use 32 bit keys, instead of 64 bit. - // This clips the bits of three entries, but we know - // this won't cause a collision. The compiler will catch - // any changes made to UnicodeData.txt that introduces - // a collision. - // Note that the recomposition map for NFC and NFKC - // are identical. - - // Recomposition map - nrentries := 0 - for _, c := range chars { - f := c.forms[FCanonical] - if !f.isOneWay && len(f.decomp) > 0 { - nrentries++ - } - } - sz := nrentries * 8 - size += sz - fmt.Fprintf(w, "// recompMap: %d bytes (entries only)\n", sz) - fmt.Fprintln(w, "var recompMap map[uint32]rune") - fmt.Fprintln(w, "var recompMapOnce sync.Once\n") - fmt.Fprintln(w, `const recompMapPacked = "" +`) - var buf [8]byte - for i, c := range chars { - f := c.forms[FCanonical] - d := f.decomp - if !f.isOneWay && len(d) > 0 { - key := uint32(uint16(d[0]))<<16 + uint32(uint16(d[1])) - binary.BigEndian.PutUint32(buf[:4], key) - binary.BigEndian.PutUint32(buf[4:], uint32(i)) - fmt.Fprintf(w, "\t\t%q + // 0x%.8X: 0x%.8X\n", string(buf[:]), key, uint32(i)) - } - } - // hack so we don't have to special case the trailing plus sign - fmt.Fprintf(w, ` ""`) - fmt.Fprintln(w) - } - - fmt.Fprintf(w, "// Total size of tables: %dKB (%d bytes)\n", (size+512)/1024, size) - gen.WriteVersionedGoFile("tables.go", "norm", w.Bytes()) -} - -func printChars() { - if *verbose { - for _, c := range chars { - if !c.isValid() || c.state == SMissing { - continue - } - fmt.Println(c) - } - } -} - -// verifyComputed does various consistency tests. -func verifyComputed() { - for i, c := range chars { - for _, f := range c.forms { - isNo := (f.quickCheck[MDecomposed] == QCNo) - if (len(f.decomp) > 0) != isNo && !isHangul(rune(i)) { - log.Fatalf("%U: NF*D QC must be No if rune decomposes", i) - } - - isMaybe := f.quickCheck[MComposed] == QCMaybe - if f.combinesBackward != isMaybe { - log.Fatalf("%U: NF*C QC must be Maybe if combinesBackward", i) - } - if len(f.decomp) > 0 && f.combinesForward && isMaybe { - log.Fatalf("%U: NF*C QC must be Yes or No if combinesForward and decomposes", i) - } - - if len(f.expandedDecomp) != 0 { - continue - } - if a, b := c.nLeadingNonStarters > 0, (c.ccc > 0 || f.combinesBackward); a != b { - // We accept these runes to be treated differently (it only affects - // segment breaking in iteration, most likely on improper use), but - // reconsider if more characters are added. - // U+FF9E HALFWIDTH KATAKANA VOICED SOUND MARK;Lm;0;L; 3099;;;;N;;;;; - // U+FF9F HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK;Lm;0;L; 309A;;;;N;;;;; - // U+3133 HANGUL LETTER KIYEOK-SIOS;Lo;0;L; 11AA;;;;N;HANGUL LETTER GIYEOG SIOS;;;; - // U+318E HANGUL LETTER ARAEAE;Lo;0;L; 11A1;;;;N;HANGUL LETTER ALAE AE;;;; - // U+FFA3 HALFWIDTH HANGUL LETTER KIYEOK-SIOS;Lo;0;L; 3133;;;;N;HALFWIDTH HANGUL LETTER GIYEOG SIOS;;;; - // U+FFDC HALFWIDTH HANGUL LETTER I;Lo;0;L; 3163;;;;N;;;;; - if i != 0xFF9E && i != 0xFF9F && !(0x3133 <= i && i <= 0x318E) && !(0xFFA3 <= i && i <= 0xFFDC) { - log.Fatalf("%U: nLead was %v; want %v", i, a, b) - } - } - } - nfc := c.forms[FCanonical] - nfkc := c.forms[FCompatibility] - if nfc.combinesBackward != nfkc.combinesBackward { - log.Fatalf("%U: Cannot combine combinesBackward\n", c.codePoint) - } - } -} - -// Use values in DerivedNormalizationProps.txt to compare against the -// values we computed. -// DerivedNormalizationProps.txt has form: -// 00C0..00C5 ; NFD_QC; N # ... -// 0374 ; NFD_QC; N # ... -// See https://unicode.org/reports/tr44/ for full explanation -func testDerived() { - f := gen.OpenUCDFile("DerivedNormalizationProps.txt") - defer f.Close() - p := ucd.New(f) - for p.Next() { - r := p.Rune(0) - c := &chars[r] - - var ftype, mode int - qt := p.String(1) - switch qt { - case "NFC_QC": - ftype, mode = FCanonical, MComposed - case "NFD_QC": - ftype, mode = FCanonical, MDecomposed - case "NFKC_QC": - ftype, mode = FCompatibility, MComposed - case "NFKD_QC": - ftype, mode = FCompatibility, MDecomposed - default: - continue - } - var qr QCResult - switch p.String(2) { - case "Y": - qr = QCYes - case "N": - qr = QCNo - case "M": - qr = QCMaybe - default: - log.Fatalf(`Unexpected quick check value "%s"`, p.String(2)) - } - if got := c.forms[ftype].quickCheck[mode]; got != qr { - log.Printf("%U: FAILED %s (was %v need %v)\n", r, qt, got, qr) - } - c.forms[ftype].verified[mode] = true - } - if err := p.Err(); err != nil { - log.Fatal(err) - } - // Any unspecified value must be QCYes. Verify this. - for i, c := range chars { - for j, fd := range c.forms { - for k, qr := range fd.quickCheck { - if !fd.verified[k] && qr != QCYes { - m := "%U: FAIL F:%d M:%d (was %v need Yes) %s\n" - log.Printf(m, i, j, k, qr, c.name) - } - } - } - } -} - -var testHeader = `const ( - Yes = iota - No - Maybe -) - -type formData struct { - qc uint8 - combinesForward bool - decomposition string -} - -type runeData struct { - r rune - ccc uint8 - nLead uint8 - nTrail uint8 - f [2]formData // 0: canonical; 1: compatibility -} - -func f(qc uint8, cf bool, dec string) [2]formData { - return [2]formData{{qc, cf, dec}, {qc, cf, dec}} -} - -func g(qc, qck uint8, cf, cfk bool, d, dk string) [2]formData { - return [2]formData{{qc, cf, d}, {qck, cfk, dk}} -} - -var testData = []runeData{ -` - -func printTestdata() { - type lastInfo struct { - ccc uint8 - nLead uint8 - nTrail uint8 - f string - } - - last := lastInfo{} - w := &bytes.Buffer{} - fmt.Fprintf(w, testHeader) - for r, c := range chars { - f := c.forms[FCanonical] - qc, cf, d := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp) - f = c.forms[FCompatibility] - qck, cfk, dk := f.quickCheck[MComposed], f.combinesForward, string(f.expandedDecomp) - s := "" - if d == dk && qc == qck && cf == cfk { - s = fmt.Sprintf("f(%s, %v, %q)", qc, cf, d) - } else { - s = fmt.Sprintf("g(%s, %s, %v, %v, %q, %q)", qc, qck, cf, cfk, d, dk) - } - current := lastInfo{c.ccc, c.nLeadingNonStarters, c.nTrailingNonStarters, s} - if last != current { - fmt.Fprintf(w, "\t{0x%x, %d, %d, %d, %s},\n", r, c.origCCC, c.nLeadingNonStarters, c.nTrailingNonStarters, s) - last = current - } - } - fmt.Fprintln(w, "}") - gen.WriteVersionedGoFile("data_test.go", "norm", w.Bytes()) -} diff --git a/vendor/golang.org/x/text/unicode/norm/triegen.go b/vendor/golang.org/x/text/unicode/norm/triegen.go deleted file mode 100644 index 45d711900d..0000000000 --- a/vendor/golang.org/x/text/unicode/norm/triegen.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// Trie table generator. -// Used by make*tables tools to generate a go file with trie data structures -// for mapping UTF-8 to a 16-bit value. All but the last byte in a UTF-8 byte -// sequence are used to lookup offsets in the index table to be used for the -// next byte. The last byte is used to index into a table with 16-bit values. - -package main - -import ( - "fmt" - "io" -) - -const maxSparseEntries = 16 - -type normCompacter struct { - sparseBlocks [][]uint64 - sparseOffset []uint16 - sparseCount int - name string -} - -func mostFrequentStride(a []uint64) int { - counts := make(map[int]int) - var v int - for _, x := range a { - if stride := int(x) - v; v != 0 && stride >= 0 { - counts[stride]++ - } - v = int(x) - } - var maxs, maxc int - for stride, cnt := range counts { - if cnt > maxc || (cnt == maxc && stride < maxs) { - maxs, maxc = stride, cnt - } - } - return maxs -} - -func countSparseEntries(a []uint64) int { - stride := mostFrequentStride(a) - var v, count int - for _, tv := range a { - if int(tv)-v != stride { - if tv != 0 { - count++ - } - } - v = int(tv) - } - return count -} - -func (c *normCompacter) Size(v []uint64) (sz int, ok bool) { - if n := countSparseEntries(v); n <= maxSparseEntries { - return (n+1)*4 + 2, true - } - return 0, false -} - -func (c *normCompacter) Store(v []uint64) uint32 { - h := uint32(len(c.sparseOffset)) - c.sparseBlocks = append(c.sparseBlocks, v) - c.sparseOffset = append(c.sparseOffset, uint16(c.sparseCount)) - c.sparseCount += countSparseEntries(v) + 1 - return h -} - -func (c *normCompacter) Handler() string { - return c.name + "Sparse.lookup" -} - -func (c *normCompacter) Print(w io.Writer) (retErr error) { - p := func(f string, x ...interface{}) { - if _, err := fmt.Fprintf(w, f, x...); retErr == nil && err != nil { - retErr = err - } - } - - ls := len(c.sparseBlocks) - p("// %sSparseOffset: %d entries, %d bytes\n", c.name, ls, ls*2) - p("var %sSparseOffset = %#v\n\n", c.name, c.sparseOffset) - - ns := c.sparseCount - p("// %sSparseValues: %d entries, %d bytes\n", c.name, ns, ns*4) - p("var %sSparseValues = [%d]valueRange {", c.name, ns) - for i, b := range c.sparseBlocks { - p("\n// Block %#x, offset %#x", i, c.sparseOffset[i]) - var v int - stride := mostFrequentStride(b) - n := countSparseEntries(b) - p("\n{value:%#04x,lo:%#02x},", stride, uint8(n)) - for i, nv := range b { - if int(nv)-v != stride { - if v != 0 { - p(",hi:%#02x},", 0x80+i-1) - } - if nv != 0 { - p("\n{value:%#04x,lo:%#02x", nv, 0x80+i) - } - } - v = int(nv) - } - if v != 0 { - p(",hi:%#02x},", 0x80+len(b)-1) - } - } - p("\n}\n\n") - return -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 296dfef6bc..b0d30523ed 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -7,8 +7,8 @@ github.com/Azure/azure-pipeline-go/pipeline # github.com/Azure/azure-storage-blob-go v0.0.0-20180712005634-eaae161d9d5e github.com/Azure/azure-storage-blob-go/2018-03-28/azblob # github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 -github.com/Azure/go-ansiterm/winterm github.com/Azure/go-ansiterm +github.com/Azure/go-ansiterm/winterm # github.com/Microsoft/go-winio v0.4.13 github.com/Microsoft/go-winio github.com/Microsoft/go-winio/pkg/guid @@ -33,47 +33,47 @@ github.com/codahale/hdrhistogram github.com/containerd/containerd/errdefs # github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc github.com/containerd/continuity/fs -github.com/containerd/continuity/sysx github.com/containerd/continuity/pathdriver github.com/containerd/continuity/syscallx +github.com/containerd/continuity/sysx # github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew/spew # github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea github.com/deckarep/golang-set # github.com/docker/distribution v2.7.1+incompatible -github.com/docker/distribution/reference github.com/docker/distribution/digestset +github.com/docker/distribution/reference github.com/docker/distribution/registry/api/errcode # github.com/docker/docker v0.7.3-0.20190806133308-ecdb0b22393b -github.com/docker/docker/pkg/reexec +github.com/docker/docker/api github.com/docker/docker/api/types +github.com/docker/docker/api/types/blkiodev github.com/docker/docker/api/types/container -github.com/docker/docker/client -github.com/docker/docker/pkg/archive -github.com/docker/docker/pkg/jsonmessage +github.com/docker/docker/api/types/events github.com/docker/docker/api/types/filters +github.com/docker/docker/api/types/image github.com/docker/docker/api/types/mount github.com/docker/docker/api/types/network github.com/docker/docker/api/types/registry -github.com/docker/docker/api/types/swarm -github.com/docker/docker/api/types/blkiodev github.com/docker/docker/api/types/strslice -github.com/docker/docker/api -github.com/docker/docker/api/types/events -github.com/docker/docker/api/types/image +github.com/docker/docker/api/types/swarm +github.com/docker/docker/api/types/swarm/runtime github.com/docker/docker/api/types/time github.com/docker/docker/api/types/versions github.com/docker/docker/api/types/volume +github.com/docker/docker/client github.com/docker/docker/errdefs +github.com/docker/docker/pkg/archive github.com/docker/docker/pkg/fileutils github.com/docker/docker/pkg/idtools github.com/docker/docker/pkg/ioutils +github.com/docker/docker/pkg/jsonmessage github.com/docker/docker/pkg/longpath +github.com/docker/docker/pkg/mount github.com/docker/docker/pkg/pools +github.com/docker/docker/pkg/reexec github.com/docker/docker/pkg/system github.com/docker/docker/pkg/term -github.com/docker/docker/api/types/swarm/runtime -github.com/docker/docker/pkg/mount github.com/docker/docker/pkg/term/windows # github.com/docker/go-connections v0.4.0 github.com/docker/go-connections/nat @@ -87,100 +87,99 @@ github.com/edsrzf/mmap-go github.com/elastic/gosigar github.com/elastic/gosigar/sys/windows # github.com/ethereum/go-ethereum v1.9.2 -github.com/ethereum/go-ethereum/accounts/abi/bind -github.com/ethereum/go-ethereum/common -github.com/ethereum/go-ethereum/ethclient -github.com/ethereum/go-ethereum/metrics -github.com/ethereum/go-ethereum/p2p -github.com/ethereum/go-ethereum/params -github.com/ethereum/go-ethereum/rpc -github.com/ethereum/go-ethereum/common/hexutil -github.com/ethereum/go-ethereum/core/types -github.com/ethereum/go-ethereum/crypto -github.com/ethereum/go-ethereum/crypto/ecies -github.com/ethereum/go-ethereum/node -github.com/ethereum/go-ethereum/p2p/enode -github.com/ethereum/go-ethereum/log -github.com/ethereum/go-ethereum/accounts -github.com/ethereum/go-ethereum/accounts/keystore -github.com/ethereum/go-ethereum/cmd/utils -github.com/ethereum/go-ethereum/console -github.com/ethereum/go-ethereum/p2p/nat -github.com/ethereum/go-ethereum/rlp -github.com/ethereum/go-ethereum/metrics/influxdb -github.com/ethereum/go-ethereum/p2p/simulations -github.com/ethereum/go-ethereum/p2p/simulations/adapters github.com/ethereum/go-ethereum +github.com/ethereum/go-ethereum/accounts github.com/ethereum/go-ethereum/accounts/abi -github.com/ethereum/go-ethereum/event -github.com/ethereum/go-ethereum/metrics/exp -github.com/ethereum/go-ethereum/p2p/enr -github.com/ethereum/go-ethereum/common/bitutil +github.com/ethereum/go-ethereum/accounts/abi/bind +github.com/ethereum/go-ethereum/accounts/abi/bind/backends github.com/ethereum/go-ethereum/accounts/external -github.com/ethereum/go-ethereum/common/mclock -github.com/ethereum/go-ethereum/p2p/discover -github.com/ethereum/go-ethereum/p2p/discv5 -github.com/ethereum/go-ethereum/p2p/netutil -github.com/ethereum/go-ethereum/trie -github.com/ethereum/go-ethereum/common/math -github.com/ethereum/go-ethereum/crypto/secp256k1 +github.com/ethereum/go-ethereum/accounts/keystore github.com/ethereum/go-ethereum/accounts/scwallet github.com/ethereum/go-ethereum/accounts/usbwallet -github.com/ethereum/go-ethereum/core/rawdb -github.com/ethereum/go-ethereum/ethdb -github.com/ethereum/go-ethereum/internal/debug +github.com/ethereum/go-ethereum/accounts/usbwallet/trezor +github.com/ethereum/go-ethereum/cmd/utils +github.com/ethereum/go-ethereum/common +github.com/ethereum/go-ethereum/common/bitutil github.com/ethereum/go-ethereum/common/fdlimit +github.com/ethereum/go-ethereum/common/hexutil +github.com/ethereum/go-ethereum/common/math +github.com/ethereum/go-ethereum/common/mclock +github.com/ethereum/go-ethereum/common/prque github.com/ethereum/go-ethereum/consensus github.com/ethereum/go-ethereum/consensus/clique github.com/ethereum/go-ethereum/consensus/ethash +github.com/ethereum/go-ethereum/consensus/misc +github.com/ethereum/go-ethereum/console +github.com/ethereum/go-ethereum/contracts/checkpointoracle +github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract github.com/ethereum/go-ethereum/core +github.com/ethereum/go-ethereum/core/bloombits +github.com/ethereum/go-ethereum/core/forkid +github.com/ethereum/go-ethereum/core/rawdb +github.com/ethereum/go-ethereum/core/state +github.com/ethereum/go-ethereum/core/types github.com/ethereum/go-ethereum/core/vm +github.com/ethereum/go-ethereum/crypto +github.com/ethereum/go-ethereum/crypto/bn256 +github.com/ethereum/go-ethereum/crypto/bn256/cloudflare +github.com/ethereum/go-ethereum/crypto/bn256/google +github.com/ethereum/go-ethereum/crypto/ecies +github.com/ethereum/go-ethereum/crypto/secp256k1 github.com/ethereum/go-ethereum/dashboard github.com/ethereum/go-ethereum/eth github.com/ethereum/go-ethereum/eth/downloader +github.com/ethereum/go-ethereum/eth/fetcher +github.com/ethereum/go-ethereum/eth/filters github.com/ethereum/go-ethereum/eth/gasprice +github.com/ethereum/go-ethereum/eth/tracers +github.com/ethereum/go-ethereum/eth/tracers/internal/tracers +github.com/ethereum/go-ethereum/ethclient +github.com/ethereum/go-ethereum/ethdb +github.com/ethereum/go-ethereum/ethdb/leveldb +github.com/ethereum/go-ethereum/ethdb/memorydb github.com/ethereum/go-ethereum/ethstats +github.com/ethereum/go-ethereum/event github.com/ethereum/go-ethereum/graphql -github.com/ethereum/go-ethereum/les -github.com/ethereum/go-ethereum/miner -github.com/ethereum/go-ethereum/whisper/whisperv6 +github.com/ethereum/go-ethereum/internal/debug +github.com/ethereum/go-ethereum/internal/ethapi github.com/ethereum/go-ethereum/internal/jsre +github.com/ethereum/go-ethereum/internal/jsre/deps github.com/ethereum/go-ethereum/internal/web3ext -github.com/ethereum/go-ethereum/p2p/simulations/pipes -github.com/ethereum/go-ethereum/accounts/abi/bind/backends -github.com/ethereum/go-ethereum/metrics/prometheus -github.com/ethereum/go-ethereum/internal/ethapi -github.com/ethereum/go-ethereum/signer/core -github.com/ethereum/go-ethereum/common/prque -github.com/ethereum/go-ethereum/accounts/usbwallet/trezor -github.com/ethereum/go-ethereum/ethdb/leveldb -github.com/ethereum/go-ethereum/ethdb/memorydb -github.com/ethereum/go-ethereum/core/state -github.com/ethereum/go-ethereum/consensus/misc -github.com/ethereum/go-ethereum/crypto/bn256 -github.com/ethereum/go-ethereum/core/bloombits -github.com/ethereum/go-ethereum/core/forkid -github.com/ethereum/go-ethereum/eth/fetcher -github.com/ethereum/go-ethereum/eth/filters -github.com/ethereum/go-ethereum/eth/tracers -github.com/ethereum/go-ethereum/contracts/checkpointoracle +github.com/ethereum/go-ethereum/les github.com/ethereum/go-ethereum/les/flowcontrol github.com/ethereum/go-ethereum/light -github.com/ethereum/go-ethereum/internal/jsre/deps +github.com/ethereum/go-ethereum/log +github.com/ethereum/go-ethereum/metrics +github.com/ethereum/go-ethereum/metrics/exp +github.com/ethereum/go-ethereum/metrics/influxdb +github.com/ethereum/go-ethereum/metrics/prometheus +github.com/ethereum/go-ethereum/miner +github.com/ethereum/go-ethereum/node +github.com/ethereum/go-ethereum/p2p +github.com/ethereum/go-ethereum/p2p/discover +github.com/ethereum/go-ethereum/p2p/discv5 +github.com/ethereum/go-ethereum/p2p/enode +github.com/ethereum/go-ethereum/p2p/enr +github.com/ethereum/go-ethereum/p2p/nat +github.com/ethereum/go-ethereum/p2p/netutil +github.com/ethereum/go-ethereum/p2p/simulations +github.com/ethereum/go-ethereum/p2p/simulations/adapters +github.com/ethereum/go-ethereum/p2p/simulations/pipes +github.com/ethereum/go-ethereum/params +github.com/ethereum/go-ethereum/rlp +github.com/ethereum/go-ethereum/rpc +github.com/ethereum/go-ethereum/signer/core github.com/ethereum/go-ethereum/signer/storage -github.com/ethereum/go-ethereum/crypto/bn256/cloudflare -github.com/ethereum/go-ethereum/crypto/bn256/google -github.com/ethereum/go-ethereum/eth/tracers/internal/tracers -github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract -# github.com/ethersphere/go-sw3 v0.1.1 -github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswap -github.com/ethersphere/go-sw3/contracts-v0-1-1/simpleswapfactory -github.com/ethersphere/go-sw3/contracts-v0-1-0/simpleswap +github.com/ethereum/go-ethereum/trie +github.com/ethereum/go-ethereum/whisper/whisperv6 +# github.com/ethersphere/go-sw3 v0.2.0 +github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap +github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory # github.com/fatih/color v1.7.0 github.com/fatih/color # github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc -github.com/fjl/memsize/memsizeui github.com/fjl/memsize +github.com/fjl/memsize/memsizeui # github.com/gballet/go-libpcsclite v0.0.0-20190528105824-2fd9b619dd3c github.com/gballet/go-libpcsclite # github.com/go-ole/go-ole v1.2.4 @@ -210,10 +209,10 @@ github.com/googleapis/gnostic/extensions github.com/gorilla/websocket # github.com/graph-gophers/graphql-go v0.0.0-20190724201507-010347b5f9e6 github.com/graph-gophers/graphql-go -github.com/graph-gophers/graphql-go/relay github.com/graph-gophers/graphql-go/errors github.com/graph-gophers/graphql-go/internal/common github.com/graph-gophers/graphql-go/internal/exec +github.com/graph-gophers/graphql-go/internal/exec/packer github.com/graph-gophers/graphql-go/internal/exec/resolvable github.com/graph-gophers/graphql-go/internal/exec/selected github.com/graph-gophers/graphql-go/internal/query @@ -221,8 +220,8 @@ github.com/graph-gophers/graphql-go/internal/schema github.com/graph-gophers/graphql-go/internal/validation github.com/graph-gophers/graphql-go/introspection github.com/graph-gophers/graphql-go/log +github.com/graph-gophers/graphql-go/relay github.com/graph-gophers/graphql-go/trace -github.com/graph-gophers/graphql-go/internal/exec/packer # github.com/hashicorp/golang-lru v0.5.3 github.com/hashicorp/golang-lru github.com/hashicorp/golang-lru/simplelru @@ -276,15 +275,15 @@ github.com/olekukonko/tablewriter # github.com/opencontainers/go-digest v1.0.0-rc1 github.com/opencontainers/go-digest # github.com/opencontainers/image-spec v1.0.1 -github.com/opencontainers/image-spec/specs-go/v1 github.com/opencontainers/image-spec/specs-go +github.com/opencontainers/image-spec/specs-go/v1 # github.com/opencontainers/runc v0.1.1 github.com/opencontainers/runc/libcontainer/system github.com/opencontainers/runc/libcontainer/user # github.com/opentracing/opentracing-go v1.1.0 github.com/opentracing/opentracing-go -github.com/opentracing/opentracing-go/log github.com/opentracing/opentracing-go/ext +github.com/opentracing/opentracing-go/log # github.com/oschwald/maxminddb-golang v0.0.0-20180819230143-277d39ecb83e github.com/oschwald/maxminddb-golang # github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 @@ -321,17 +320,17 @@ github.com/steakknife/bloomfilter github.com/steakknife/hamming # github.com/syndtr/goleveldb v0.0.0-20190318030020-c3a204f8e965 github.com/syndtr/goleveldb/leveldb -github.com/syndtr/goleveldb/leveldb/opt -github.com/syndtr/goleveldb/leveldb/iterator -github.com/syndtr/goleveldb/leveldb/storage -github.com/syndtr/goleveldb/leveldb/util -github.com/syndtr/goleveldb/leveldb/errors github.com/syndtr/goleveldb/leveldb/cache github.com/syndtr/goleveldb/leveldb/comparer +github.com/syndtr/goleveldb/leveldb/errors github.com/syndtr/goleveldb/leveldb/filter +github.com/syndtr/goleveldb/leveldb/iterator github.com/syndtr/goleveldb/leveldb/journal github.com/syndtr/goleveldb/leveldb/memdb +github.com/syndtr/goleveldb/leveldb/opt +github.com/syndtr/goleveldb/leveldb/storage github.com/syndtr/goleveldb/leveldb/table +github.com/syndtr/goleveldb/leveldb/util # github.com/tilinna/clock v1.0.2 github.com/tilinna/clock # github.com/tyler-smith/go-bip39 v0.0.0-20181017060643-dbb3b84ba2ef @@ -341,55 +340,55 @@ github.com/tyler-smith/go-bip39/wordlists github.com/uber/jaeger-client-go github.com/uber/jaeger-client-go/config github.com/uber/jaeger-client-go/internal/baggage +github.com/uber/jaeger-client-go/internal/baggage/remote github.com/uber/jaeger-client-go/internal/spanlog github.com/uber/jaeger-client-go/internal/throttler +github.com/uber/jaeger-client-go/internal/throttler/remote github.com/uber/jaeger-client-go/log +github.com/uber/jaeger-client-go/rpcmetrics github.com/uber/jaeger-client-go/thrift +github.com/uber/jaeger-client-go/thrift-gen/agent +github.com/uber/jaeger-client-go/thrift-gen/baggage github.com/uber/jaeger-client-go/thrift-gen/jaeger github.com/uber/jaeger-client-go/thrift-gen/sampling github.com/uber/jaeger-client-go/thrift-gen/zipkincore github.com/uber/jaeger-client-go/utils -github.com/uber/jaeger-client-go/internal/baggage/remote -github.com/uber/jaeger-client-go/internal/throttler/remote -github.com/uber/jaeger-client-go/rpcmetrics -github.com/uber/jaeger-client-go/thrift-gen/agent -github.com/uber/jaeger-client-go/thrift-gen/baggage # github.com/uber/jaeger-lib v0.0.0-20180615202729-a51202d6f4a7 github.com/uber/jaeger-lib/metrics # github.com/vbauerster/mpb v3.4.0+incompatible github.com/vbauerster/mpb -github.com/vbauerster/mpb/decor github.com/vbauerster/mpb/cwriter +github.com/vbauerster/mpb/decor github.com/vbauerster/mpb/internal # github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 github.com/wsddn/go-ecdh # golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 -golang.org/x/crypto/scrypt -golang.org/x/crypto/sha3 +golang.org/x/crypto/cast5 +golang.org/x/crypto/curve25519 golang.org/x/crypto/openpgp -golang.org/x/crypto/pbkdf2 golang.org/x/crypto/openpgp/armor +golang.org/x/crypto/openpgp/elgamal golang.org/x/crypto/openpgp/errors golang.org/x/crypto/openpgp/packet golang.org/x/crypto/openpgp/s2k -golang.org/x/crypto/ssh/terminal +golang.org/x/crypto/pbkdf2 golang.org/x/crypto/ripemd160 -golang.org/x/crypto/cast5 -golang.org/x/crypto/openpgp/elgamal -golang.org/x/crypto/curve25519 +golang.org/x/crypto/scrypt +golang.org/x/crypto/sha3 +golang.org/x/crypto/ssh/terminal # golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 golang.org/x/net/context +golang.org/x/net/context/ctxhttp golang.org/x/net/html -golang.org/x/net/websocket -golang.org/x/net/http2 golang.org/x/net/html/atom golang.org/x/net/html/charset -golang.org/x/net/proxy golang.org/x/net/http/httpguts +golang.org/x/net/http2 golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/socks -golang.org/x/net/context/ctxhttp +golang.org/x/net/proxy +golang.org/x/net/websocket # golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 golang.org/x/oauth2 golang.org/x/oauth2/internal @@ -402,44 +401,44 @@ golang.org/x/sys/cpu golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/text v0.3.2 -golang.org/x/text/unicode/norm -golang.org/x/text/transform golang.org/x/text/encoding golang.org/x/text/encoding/charmap golang.org/x/text/encoding/htmlindex -golang.org/x/text/secure/bidirule -golang.org/x/text/unicode/bidi -golang.org/x/text/encoding/internal/identifier golang.org/x/text/encoding/internal +golang.org/x/text/encoding/internal/identifier golang.org/x/text/encoding/japanese golang.org/x/text/encoding/korean golang.org/x/text/encoding/simplifiedchinese golang.org/x/text/encoding/traditionalchinese golang.org/x/text/encoding/unicode -golang.org/x/text/language -golang.org/x/text/internal/utf8internal -golang.org/x/text/runes golang.org/x/text/internal/language golang.org/x/text/internal/language/compact golang.org/x/text/internal/tag +golang.org/x/text/internal/utf8internal +golang.org/x/text/language +golang.org/x/text/runes +golang.org/x/text/secure/bidirule +golang.org/x/text/transform +golang.org/x/text/unicode/bidi +golang.org/x/text/unicode/norm # golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 golang.org/x/time/rate # google.golang.org/appengine v1.6.1 -google.golang.org/appengine/urlfetch google.golang.org/appengine/internal -google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/internal/base google.golang.org/appengine/internal/datastore google.golang.org/appengine/internal/log google.golang.org/appengine/internal/remote_api +google.golang.org/appengine/internal/urlfetch +google.golang.org/appengine/urlfetch # google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.22.1 google.golang.org/grpc/codes -google.golang.org/grpc/status -google.golang.org/grpc/internal google.golang.org/grpc/connectivity google.golang.org/grpc/grpclog +google.golang.org/grpc/internal +google.golang.org/grpc/status # gopkg.in/inf.v0 v0.9.1 gopkg.in/inf.v0 # gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce @@ -454,10 +453,8 @@ gopkg.in/urfave/cli.v1 # gopkg.in/yaml.v2 v2.2.2 gopkg.in/yaml.v2 # k8s.io/api v0.0.0-20190703205437-39734b2a72fe -k8s.io/api/core/v1 k8s.io/api/admissionregistration/v1beta1 k8s.io/api/apps/v1 -k8s.io/api/autoscaling/v1 k8s.io/api/apps/v1beta1 k8s.io/api/apps/v1beta2 k8s.io/api/auditregistration/v1alpha1 @@ -465,6 +462,7 @@ k8s.io/api/authentication/v1 k8s.io/api/authentication/v1beta1 k8s.io/api/authorization/v1 k8s.io/api/authorization/v1beta1 +k8s.io/api/autoscaling/v1 k8s.io/api/autoscaling/v2beta1 k8s.io/api/autoscaling/v2beta2 k8s.io/api/batch/v1 @@ -473,13 +471,14 @@ k8s.io/api/batch/v2alpha1 k8s.io/api/certificates/v1beta1 k8s.io/api/coordination/v1 k8s.io/api/coordination/v1beta1 -k8s.io/api/policy/v1beta1 +k8s.io/api/core/v1 k8s.io/api/events/v1beta1 k8s.io/api/extensions/v1beta1 k8s.io/api/networking/v1 k8s.io/api/networking/v1beta1 k8s.io/api/node/v1alpha1 k8s.io/api/node/v1beta1 +k8s.io/api/policy/v1beta1 k8s.io/api/rbac/v1 k8s.io/api/rbac/v1alpha1 k8s.io/api/rbac/v1beta1 @@ -491,45 +490,44 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 # k8s.io/apimachinery v0.0.0-20190703205208-4cfb76a8bf76 +k8s.io/apimachinery/pkg/api/errors +k8s.io/apimachinery/pkg/api/meta k8s.io/apimachinery/pkg/api/resource k8s.io/apimachinery/pkg/apis/meta/v1 -k8s.io/apimachinery/pkg/runtime -k8s.io/apimachinery/pkg/runtime/schema -k8s.io/apimachinery/pkg/types -k8s.io/apimachinery/pkg/util/intstr +k8s.io/apimachinery/pkg/apis/meta/v1/unstructured k8s.io/apimachinery/pkg/conversion +k8s.io/apimachinery/pkg/conversion/queryparams k8s.io/apimachinery/pkg/fields k8s.io/apimachinery/pkg/labels -k8s.io/apimachinery/pkg/selection -k8s.io/apimachinery/pkg/util/runtime -k8s.io/apimachinery/pkg/watch -k8s.io/apimachinery/pkg/api/errors -k8s.io/apimachinery/pkg/runtime/serializer/streaming -k8s.io/apimachinery/pkg/util/net -k8s.io/apimachinery/pkg/util/sets -k8s.io/apimachinery/pkg/util/errors -k8s.io/apimachinery/pkg/util/validation -k8s.io/apimachinery/pkg/conversion/queryparams -k8s.io/apimachinery/pkg/util/json -k8s.io/apimachinery/pkg/util/naming -k8s.io/apimachinery/third_party/forked/golang/reflect +k8s.io/apimachinery/pkg/runtime +k8s.io/apimachinery/pkg/runtime/schema k8s.io/apimachinery/pkg/runtime/serializer -k8s.io/apimachinery/pkg/version -k8s.io/apimachinery/pkg/util/clock -k8s.io/apimachinery/pkg/util/validation/field k8s.io/apimachinery/pkg/runtime/serializer/json -k8s.io/apimachinery/pkg/runtime/serializer/versioning k8s.io/apimachinery/pkg/runtime/serializer/protobuf k8s.io/apimachinery/pkg/runtime/serializer/recognizer -k8s.io/apimachinery/pkg/api/meta +k8s.io/apimachinery/pkg/runtime/serializer/streaming +k8s.io/apimachinery/pkg/runtime/serializer/versioning +k8s.io/apimachinery/pkg/selection +k8s.io/apimachinery/pkg/types +k8s.io/apimachinery/pkg/util/clock +k8s.io/apimachinery/pkg/util/errors k8s.io/apimachinery/pkg/util/framer +k8s.io/apimachinery/pkg/util/intstr +k8s.io/apimachinery/pkg/util/json +k8s.io/apimachinery/pkg/util/naming +k8s.io/apimachinery/pkg/util/net +k8s.io/apimachinery/pkg/util/runtime +k8s.io/apimachinery/pkg/util/sets +k8s.io/apimachinery/pkg/util/validation +k8s.io/apimachinery/pkg/util/validation/field k8s.io/apimachinery/pkg/util/yaml -k8s.io/apimachinery/pkg/apis/meta/v1/unstructured +k8s.io/apimachinery/pkg/version +k8s.io/apimachinery/pkg/watch +k8s.io/apimachinery/third_party/forked/golang/reflect # k8s.io/client-go v0.0.0-20190706005506-4ed54556a14a -k8s.io/client-go/kubernetes -k8s.io/client-go/rest -k8s.io/client-go/tools/clientcmd k8s.io/client-go/discovery +k8s.io/client-go/kubernetes +k8s.io/client-go/kubernetes/scheme k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1 k8s.io/client-go/kubernetes/typed/apps/v1 k8s.io/client-go/kubernetes/typed/apps/v1beta1 @@ -566,25 +564,26 @@ k8s.io/client-go/kubernetes/typed/settings/v1alpha1 k8s.io/client-go/kubernetes/typed/storage/v1 k8s.io/client-go/kubernetes/typed/storage/v1alpha1 k8s.io/client-go/kubernetes/typed/storage/v1beta1 -k8s.io/client-go/util/flowcontrol +k8s.io/client-go/pkg/apis/clientauthentication +k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1 +k8s.io/client-go/pkg/apis/clientauthentication/v1beta1 k8s.io/client-go/pkg/version k8s.io/client-go/plugin/pkg/client/auth/exec +k8s.io/client-go/rest k8s.io/client-go/rest/watch +k8s.io/client-go/tools/auth +k8s.io/client-go/tools/clientcmd k8s.io/client-go/tools/clientcmd/api +k8s.io/client-go/tools/clientcmd/api/latest +k8s.io/client-go/tools/clientcmd/api/v1 k8s.io/client-go/tools/metrics +k8s.io/client-go/tools/reference k8s.io/client-go/transport k8s.io/client-go/util/cert -k8s.io/client-go/tools/auth -k8s.io/client-go/tools/clientcmd/api/latest -k8s.io/client-go/util/homedir -k8s.io/client-go/kubernetes/scheme -k8s.io/client-go/tools/reference -k8s.io/client-go/pkg/apis/clientauthentication -k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1 -k8s.io/client-go/pkg/apis/clientauthentication/v1beta1 k8s.io/client-go/util/connrotation +k8s.io/client-go/util/flowcontrol +k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil -k8s.io/client-go/tools/clientcmd/api/v1 # k8s.io/klog v0.3.1 k8s.io/klog # k8s.io/utils v0.0.0-20190607212802-c55fbcfc754a From 9c9a0982bd1da4915d062a9270ff721e3a3c595f Mon Sep 17 00:00:00 2001 From: eknir Date: Wed, 20 Nov 2019 15:50:58 +0100 Subject: [PATCH 02/22] swap, contracts/swap: seperate deposit from deploy, remove deployLoop, remove backend as input parameter --- contracts/swap/swap.go | 17 +++++----- swap/config.go | 3 -- swap/swap.go | 71 +++++++++++++++++++++--------------------- swap/swap_test.go | 10 +++--- 4 files changed, 49 insertions(+), 52 deletions(-) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index fb56a14248..f71049b11f 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -45,9 +45,9 @@ type Backend interface { // Contract interface defines the methods exported from the underlying go-bindings for the smart contract type Contract interface { // Withdraw attempts to withdraw Wei from the chequebook - Withdraw(auth *bind.TransactOpts, backend Backend, amount *big.Int) (*types.Receipt, error) + Withdraw(auth *bind.TransactOpts, amount *big.Int) (*types.Receipt, error) // Deposit sends a raw transaction to the chequebook, triggering the fallback—depositing amount - Deposit(auth *bind.TransactOpts, backend Backend, amout *big.Int) (*types.Receipt, error) + Deposit(auth *bind.TransactOpts, amout *big.Int) (*types.Receipt, error) // CashChequeBeneficiary cashes the cheque by the beneficiary CashChequeBeneficiary(auth *bind.TransactOpts, beneficiary common.Address, cumulativePayout *big.Int, ownerSig []byte) (*CashChequeResult, *types.Receipt, error) // LiquidBalance returns the LiquidBalance (total balance in Wei - total hard deposits in Wei) of the chequebook @@ -97,35 +97,36 @@ func InstanceAt(address common.Address, backend Backend) (Contract, error) { } // Withdraw withdraws amount from the chequebook and blocks until the transaction is mined -func (s simpleContract) Withdraw(auth *bind.TransactOpts, backend Backend, amount *big.Int) (*types.Receipt, error) { +func (s simpleContract) Withdraw(auth *bind.TransactOpts, amount *big.Int) (*types.Receipt, error) { tx, err := s.instance.Withdraw(auth, amount) if err != nil { return nil, err } - return WaitFunc(auth, backend, tx) + return WaitFunc(auth, s.backend, tx) } -// Deposit sends a transaction to the chequebook, which deposits the amount set in Auth.Value and blocks until the transaction is mined -func (s simpleContract) Deposit(auth *bind.TransactOpts, backend Backend, amount *big.Int) (*types.Receipt, error) { +// Deposit sends an amount in ERC20 token to the chequebook and blocks until the transaction is mined +func (s simpleContract) Deposit(auth *bind.TransactOpts, amount *big.Int) (*types.Receipt, error) { if amount == big.NewInt(0) { return nil, fmt.Errorf("Deposit amount cannot be equal to zero") } + // get ERC20Instance at the address of token which is registered in the chequebook tokenAddress, err := s.instance.Token(nil) if err != nil { return nil, err } - token, err := contract.NewERC20(tokenAddress, nil) if err != nil { return nil, err } + // transfer ERC20 to the chequebook tx, err := token.Transfer(auth, s.address, amount) if err != nil { return nil, err } - return WaitFunc(auth, backend, tx) + return WaitFunc(auth, s.backend, tx) } // CashChequeBeneficiary cashes the cheque on the blockchain and blocks until the transaction is mined. diff --git a/swap/config.go b/swap/config.go index ab7aae6e09..b3ab0f36f2 100644 --- a/swap/config.go +++ b/swap/config.go @@ -30,9 +30,6 @@ const ( // DefaultInitialDepositAmount is the default amount to send to the contract when initially deploying // NOTE: deliberate value for now; needs experimentation DefaultInitialDepositAmount = 0 - deployRetries = 5 - // delay between retries - deployDelay = 1 * time.Second // This is the amount of time in seconds which an issuer has to wait to decrease the harddeposit of a beneficiary. // The smart-contract allows for setting this variable differently per beneficiary defaultHarddepositTimeoutDuration = 24 * time.Hour diff --git a/swap/swap.go b/swap/swap.go index d89bc2cb23..efa5b0a2bf 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -26,7 +26,6 @@ import ( "path/filepath" "strconv" "sync" - "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -199,9 +198,19 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par factory, ) // start the chequebook - if swap.contract, err = swap.StartChequebook(chequebookAddressFlag, initialDepositAmountFlag); err != nil { + if swap.contract, err = swap.StartChequebook(chequebookAddressFlag); err != nil { return nil, err } + var toDeposit = big.NewInt(int64(initialDepositAmountFlag)) + if initialDepositAmountFlag == 0 { + toDeposit, err = promptInitialDepositAmount() + if err != nil { + return nil, err + } + } + if err := swap.Deposit(context.TODO(), toDeposit); err != nil { + swapLog.Warn("Could not deposit tokens into the chequebook", "error", err) + } availableBalance, err := swap.AvailableBalance() if err != nil { return nil, err @@ -577,7 +586,7 @@ func (s *Swap) getContractOwner(ctx context.Context, address common.Address) (co return contr.Issuer(nil) } -func promptInitialDepositAmount() (uint64, error) { +func promptInitialDepositAmount() (*big.Int, error) { // need to prompt user for initial deposit amount // if 0, can not cash in cheques prompter := console.Stdin @@ -585,19 +594,19 @@ func promptInitialDepositAmount() (uint64, error) { // ask user for input input, err := prompter.PromptInput("Please provide the amount in Wei which will deposited to your chequebook upon deployment: ") if err != nil { - return 0, err + return big.NewInt(0), err } // check input val, err := strconv.ParseInt(input, 10, 64) if err != nil { // maybe we should provide a fallback here? A bad input results in stopping the boot - return 0, fmt.Errorf("Conversion error while reading user input: %v", err) + return big.NewInt(0), fmt.Errorf("Conversion error while reading user input: %v", err) } - return uint64(val), nil + return big.NewInt(val), nil } // StartChequebook starts the chequebook, taking into account the chequebookAddress passed in by the user and the chequebook addresses saved on the node's database -func (s *Swap) StartChequebook(chequebookAddrFlag common.Address, initialDepositAmount uint64) (contract contract.Contract, err error) { +func (s *Swap) StartChequebook(chequebookAddrFlag common.Address) (contract contract.Contract, err error) { previouslyUsedChequebook, err := s.loadChequebook() // error reading from disk if err != nil && err != state.ErrNotFound { @@ -609,21 +618,14 @@ func (s *Swap) StartChequebook(chequebookAddrFlag common.Address, initialDeposit } // nothing written to state disk before, no flag provided: deploying new chequebook if err == state.ErrNotFound && chequebookAddrFlag == (common.Address{}) { - var toDeposit = initialDepositAmount - if toDeposit == 0 { - toDeposit, err = promptInitialDepositAmount() - if err != nil { - return nil, err - } - } - if contract, err = s.Deploy(context.TODO(), toDeposit); err != nil { + + if contract, err = s.Deploy(context.TODO()); err != nil { return nil, err } if err := s.saveChequebook(contract.ContractParams().ContractAddress); err != nil { return nil, err } - swapLog.Info("Deployed chequebook", "contract address", contract.ContractParams().ContractAddress.Hex(), "deposit", toDeposit, "owner", s.owner.address) - // first time connecting by deploying a new chequebook + swapLog.Info("Deployed chequebook", "contract address", contract.ContractParams().ContractAddress.Hex(), "owner", s.owner.address) return contract, nil } // first time connecting with a chequebookAddress passed in @@ -646,31 +648,28 @@ func (s *Swap) bindToContractAt(address common.Address) (contract.Contract, erro } // Deploy deploys the Swap contract -func (s *Swap) Deploy(ctx context.Context, initialDepositAmount uint64) (contract.Contract, error) { +func (s *Swap) Deploy(ctx context.Context) (contract.Contract, error) { opts := bind.NewKeyedTransactor(s.owner.privateKey) - // initial topup value - opts.Value = big.NewInt(int64(initialDepositAmount)) opts.Context = ctx swapLog.Info("Deploying new swap", "owner", opts.From.Hex(), "deposit", opts.Value) - return s.deployLoop(opts, defaultHarddepositTimeoutDuration) + chequebook, err := s.chequebookFactory.DeploySimpleSwap(opts, s.owner.address, big.NewInt(int64(defaultHarddepositTimeoutDuration))) + if err != nil { + return nil, fmt.Errorf("failed to deploy chequebook: %v", err) + } + return chequebook, nil } -// deployLoop repeatedly tries to deploy the swap contract . -func (s *Swap) deployLoop(opts *bind.TransactOpts, defaultHarddepositTimeoutDuration time.Duration) (instance contract.Contract, err error) { - for try := 0; try < deployRetries; try++ { - if try > 0 { - time.Sleep(deployDelay) - } - - chequebook, err := s.chequebookFactory.DeploySimpleSwap(opts, s.owner.address, big.NewInt(int64(defaultHarddepositTimeoutDuration))) - if err != nil { - swapLog.Warn("chequebook deploy error, retrying...", "try", try, "error", err) - continue - } - - return chequebook, nil +// Deposit deposits ERC20 into the chequebook contract +func (s *Swap) Deposit(ctx context.Context, amount *big.Int) error { + opts := bind.NewKeyedTransactor(s.owner.privateKey) + opts.Context = ctx + swapLog.Info("Depositing ERC20 into chequebook", "amount", amount) + rec, err := s.contract.Deposit(opts, amount) + if err != nil { + return err } - return nil, fmt.Errorf("failed to deploy chequebook: %v", err) + log.Info("Deposited ERC20 into chequebook", "amount", amount, "transaction", rec.TxHash) + return nil } func (s *Swap) loadChequebook() (common.Address, error) { diff --git a/swap/swap_test.go b/swap/swap_test.go index 7b74e3bc21..1e76f051f0 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -470,7 +470,7 @@ func TestStartChequebookFailure(t *testing.T) { t.Fatal(err) } // try to connect with a different address - _, err = swap.StartChequebook(config.passIn, 0) + _, err = swap.StartChequebook(config.passIn) if err.Error() != config.expectedError.Error() { t.Fatal(fmt.Errorf("Expected error not equal to actual error. Expected: %v. Actual: %v", config.expectedError, err)) } @@ -487,7 +487,7 @@ func TestStartChequebookFailure(t *testing.T) { swap, clean := newTestSwap(t, ownerKey, config.testBackend) defer clean() // try to connect with an address not containing a chequebook instance - _, err := swap.StartChequebook(config.passIn, 0) + _, err := swap.StartChequebook(config.passIn) if err.Error() != config.expectedError.Error() { t.Fatal(fmt.Errorf("Expected error not equal to actual error. Expected: %v. Actual: %v", config.expectedError, err)) } @@ -531,7 +531,7 @@ func TestStartChequebookSuccess(t *testing.T) { } // start chequebook with same pass in as deployed - _, err = swap.StartChequebook(swap.GetParams().ContractAddress, 0) + _, err = swap.StartChequebook(swap.GetParams().ContractAddress) if err != nil { t.Fatal(err) } @@ -551,7 +551,7 @@ func TestStartChequebookSuccess(t *testing.T) { } // start chequebook with same pass in as deployed - _, err = swap.StartChequebook(swap.GetParams().ContractAddress, 0) + _, err = swap.StartChequebook(swap.GetParams().ContractAddress) if err != nil { t.Fatal(err) } @@ -1637,7 +1637,7 @@ func TestAvailableBalance(t *testing.T) { netDeposit := depositAmount.Uint64() - withdrawAmount.Uint64() opts := bind.NewKeyedTransactor(swap.owner.privateKey) opts.Context = context.TODO() - rec, err := swap.contract.Withdraw(opts, swap.backend, withdrawAmount) + rec, err := swap.contract.Withdraw(opts, withdrawAmount) if err != nil { t.Fatal(err) } From f596ccfcd2611c3f77ca6bf19af35fc14ed0992b Mon Sep 17 00:00:00 2001 From: eknir Date: Fri, 22 Nov 2019 11:11:43 +0100 Subject: [PATCH 03/22] swap, contracts/swap: attempt to use a new factory with updated bindings --- contracts/swap/factory.go | 10 +++++++--- go.sum | 2 ++ swap/swap_test.go | 14 -------------- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/contracts/swap/factory.go b/contracts/swap/factory.go index 361b0ae225..4066b27e48 100644 --- a/contracts/swap/factory.go +++ b/contracts/swap/factory.go @@ -19,7 +19,7 @@ var ( // Deployments maps from network ids to deployed contract factories Deployments = map[uint64]common.Address{ // Ropsten - 3: common.HexToAddress("0x2e9C43E186eaF4fee10799d67e75f8CFc5BA3a0c"), + 3: common.HexToAddress("0xE17A80727f08258aF0DCec417bF5A15295e66ECC"), } ) @@ -64,12 +64,16 @@ func (sf simpleSwapFactory) VerifySelf() error { if err != nil { return err } - + // copiedCodeTruffle by in build/SimpleSwapFactory.json (deployedBytecode) from swap-swear-swindle + copiedCodeTruffle := "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b611610806101c28339019056fe608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820aa9da0de87402b2baf9fc4371dee670cb8ef20853e79bdede4f0d5d30ceb03ed64736f6c634300050d0032a265627a7a7231582004e2618edf1a8d32811f07167ffed43c0fa6dc0c11aed9d47356dc37b4dcb2bc64736f6c634300050d0032" + // copied from repository go-sw3 + copiedCodeGoBindings := "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b611610806101c28339019056fe608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032a265627a7a7231582074f28023ea8adc36d5f6aac79fa6353a114852f91b58f3e8b0dbf1b481c203e364736f6c634300050d0032" referenceCode := common.FromHex(chequebookFactory.SimpleSwapFactoryDeployedCode) + fmt.Println(bytes.Equal(code, referenceCode), bytes.Equal(common.FromHex(copiedCodeTruffle), referenceCode), bytes.Equal(common.FromHex(copiedCodeTruffle), code), bytes.Equal(common.FromHex(copiedCodeGoBindings), common.FromHex(copiedCodeTruffle))) + fmt.Println(bytes.Equal(common.FromHex(copiedCodeGoBindings), referenceCode)) if !bytes.Equal(code, referenceCode) { return errors.New("not a valid factory contract") } - return nil } diff --git a/go.sum b/go.sum index 60f62c8580..f520fad35b 100644 --- a/go.sum +++ b/go.sum @@ -64,6 +64,8 @@ github.com/elastic/gosigar v0.0.0-20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/ethereum/go-ethereum v1.9.2 h1:RMIHDO/diqXEgORSVzYx8xW9x2+S32PoAX5lQwya0Lw= github.com/ethereum/go-ethereum v1.9.2/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= +github.com/ethersphere/go-sw3 v0.1.1 h1:czLnLSU0/XJLJt/GyPiEAds9YYnIgZZzfy+OQyiYQtk= +github.com/ethersphere/go-sw3 v0.1.1/go.mod h1:HukT0aZ6QdW/d7zuD/0g5xlw6ewu9QeqHojxLDsaERQ= github.com/ethersphere/go-sw3 v0.2.0 h1:o+YtqwsOWBGNr3nO19WU/sokc53ZV3IxZDvRasSdjko= github.com/ethersphere/go-sw3 v0.2.0/go.mod h1:HukT0aZ6QdW/d7zuD/0g5xlw6ewu9QeqHojxLDsaERQ= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= diff --git a/swap/swap_test.go b/swap/swap_test.go index 1e76f051f0..6e84ad1302 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -1117,20 +1117,6 @@ func TestFactoryVerifySelf(t *testing.T) { if factory.VerifySelf() != nil { t.Fatal(err) } - - addr, _, _, err := contractFactory.DeployECDSA(bind.NewKeyedTransactor(ownerKey), testBackend) - if err != nil { - t.Fatal(err) - } - testBackend.Commit() - - if _, err = cswap.FactoryAt(addr, testBackend); err != nil { - t.Fatal(err) - } - - if _, err = cswap.FactoryAt(common.Address{}, testBackend); err != nil { - t.Fatal(err) - } } // TestContractIntegration tests a end-to-end cheque interaction. From f35d25a091bf606f5c193b7477ec755deaec612c Mon Sep 17 00:00:00 2001 From: Ralph Pichler Date: Fri, 22 Nov 2019 11:35:48 +0100 Subject: [PATCH 04/22] swap: update go bindings --- go.mod | 2 +- go.sum | 6 ++---- .../contracts-v0-2-0/erc20simpleswap/code.go | 2 +- .../erc20simpleswap/erc20simpleswap.go | 14 +++++++------- .../contracts-v0-2-0/simpleswapfactory/code.go | 2 +- .../simpleswapfactory/simpleswapfactory.go | 16 ++++++++-------- vendor/modules.txt | 2 +- 7 files changed, 21 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 82631ded63..bcb72e1045 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c // indirect github.com/elastic/gosigar v0.0.0-20180330100440-37f05ff46ffa // indirect github.com/ethereum/go-ethereum v1.9.2 - github.com/ethersphere/go-sw3 v0.2.0 + github.com/ethersphere/go-sw3 v0.2.1 github.com/fatih/color v1.7.0 // indirect github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc github.com/gballet/go-libpcsclite v0.0.0-20190528105824-2fd9b619dd3c // indirect diff --git a/go.sum b/go.sum index f520fad35b..82579aa62f 100644 --- a/go.sum +++ b/go.sum @@ -64,10 +64,8 @@ github.com/elastic/gosigar v0.0.0-20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/ethereum/go-ethereum v1.9.2 h1:RMIHDO/diqXEgORSVzYx8xW9x2+S32PoAX5lQwya0Lw= github.com/ethereum/go-ethereum v1.9.2/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= -github.com/ethersphere/go-sw3 v0.1.1 h1:czLnLSU0/XJLJt/GyPiEAds9YYnIgZZzfy+OQyiYQtk= -github.com/ethersphere/go-sw3 v0.1.1/go.mod h1:HukT0aZ6QdW/d7zuD/0g5xlw6ewu9QeqHojxLDsaERQ= -github.com/ethersphere/go-sw3 v0.2.0 h1:o+YtqwsOWBGNr3nO19WU/sokc53ZV3IxZDvRasSdjko= -github.com/ethersphere/go-sw3 v0.2.0/go.mod h1:HukT0aZ6QdW/d7zuD/0g5xlw6ewu9QeqHojxLDsaERQ= +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/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/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 index 419e2e34ba..7401c1e6a5 100644 --- 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 @@ -19,4 +19,4 @@ package erc20simpleswap // ERC20SimpleSwapDeployedCode is the bytecode ERC20SimpleSwap will have after deployment - const ERC20SimpleSwapDeployedCode = "0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032" + const ERC20SimpleSwapDeployedCode = "0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032" 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-0/erc20simpleswap/erc20simpleswap.go index 8c098a0340..95ec9b2dd7 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-0/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 = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820c087da536b18c4187b7cacb424c2e4c58e707414a9642df27f1db97cccc3b7f464736f6c634300050d0032" +var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820872a175153bafae69ff9a23d9f9bb4a85e5703da816064f5d5ede3ecbb91b56564736f6c634300050d0032" // 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 = "0x6080604052610e3a806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a08231146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e1461032157610088565b8063095ea7b31461008d57806318160ddd146100f357806323b872dd146101115780633950935114610197575b600080fd5b6100d9600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610399565b604051808215151515815260200191505060405180910390f35b6100fb6103b7565b6040518082815260200191505060405180910390f35b61017d6004803603606081101561012757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103c1565b604051808215151515815260200191505060405180910390f35b6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061049a565b604051808215151515815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061054d565b6040518082815260200191505060405180910390f35b6102a16004803603604081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610595565b604051808215151515815260200191505060405180910390f35b610307600480360360408110156102d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610662565b604051808215151515815260200191505060405180910390f35b6103836004803603604081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610680565b6040518082815260200191505060405180910390f35b60006103ad6103a6610707565b848461070f565b6001905092915050565b6000600254905090565b60006103ce848484610906565b61048f846103da610707565b61048a85604051806060016040528060288152602001610d7060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610440610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b600190509392505050565b60006105436104a7610707565b8461053e85600160006104b8610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b61070f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106586105a2610707565b8461065385604051806060016040528060258152602001610de160259139600160006105cc610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b6001905092915050565b600061067661066f610707565b8484610906565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610795576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610dbd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561081b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610d286022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610d986025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610d056023913960400191505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c2e578082015181840152602081019050610c13565b50505050905090810190601f168015610c5b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582053b4b44d2fad2123e25198aa5ed2b9e7b2ed14bfa733eb6d7d64e1cf403ba57964736f6c634300050d0032" +var ERC20Bin = "0x608060405261083b806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a0823114610149578063a457c2d71461016f578063a9059cbb1461019b578063dd62ed3e146101c757610088565b8063095ea7b31461008d57806318160ddd146100cd57806323b872dd146100e7578063395093511461011d575b600080fd5b6100b9600480360360408110156100a357600080fd5b506001600160a01b0381351690602001356101f5565b604080519115158252519081900360200190f35b6100d5610212565b60408051918252519081900360200190f35b6100b9600480360360608110156100fd57600080fd5b506001600160a01b03813581169160208101359091169060400135610218565b6100b96004803603604081101561013357600080fd5b506001600160a01b0381351690602001356102a5565b6100d56004803603602081101561015f57600080fd5b50356001600160a01b03166102f9565b6100b96004803603604081101561018557600080fd5b506001600160a01b038135169060200135610314565b6100b9600480360360408110156101b157600080fd5b506001600160a01b038135169060200135610382565b6100d5600480360360408110156101dd57600080fd5b506001600160a01b0381358116916020013516610396565b60006102096102026103c1565b84846103c5565b50600192915050565b60025490565b60006102258484846104b1565b61029b846102316103c1565b61029685604051806060016040528060288152602001610771602891396001600160a01b038a1660009081526001602052604081209061026f6103c1565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61060d16565b6103c5565b5060019392505050565b60006102096102b26103c1565b8461029685600160006102c36103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6106a416565b6001600160a01b031660009081526020819052604090205490565b60006102096103216103c1565b84610296856040518060600160405280602581526020016107e2602591396001600061034b6103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61060d16565b600061020961038f6103c1565b84846104b1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661040a5760405162461bcd60e51b81526004018080602001828103825260248152602001806107be6024913960400191505060405180910390fd5b6001600160a01b03821661044f5760405162461bcd60e51b81526004018080602001828103825260228152602001806107296022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166104f65760405162461bcd60e51b81526004018080602001828103825260258152602001806107996025913960400191505060405180910390fd5b6001600160a01b03821661053b5760405162461bcd60e51b81526004018080602001828103825260238152602001806107066023913960400191505060405180910390fd5b61057e8160405180606001604052806026815260200161074b602691396001600160a01b038616600090815260208190526040902054919063ffffffff61060d16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105b3908263ffffffff6106a416565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561069c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610661578181015183820152602001610649565b50505050905090810190601f16801561068e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156106fe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820e7920dfefc274a9bba653bb8a8dda9ad48643ad5bcf3e2bac0457e7caf286fe964736f6c634300050d0032" // 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 = "0x608060405262000024620000186200002a60201b60201c565b6200003260201b60201c565b62000257565b600033905090565b6200004d8160036200009360201b620012a81790919060201c565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b620000a582826200017760201b60201c565b1562000119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000200576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180620018506022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6115e980620002676000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146102e7578063986502751461032b578063a457c2d714610335578063a9059cbb1461039b578063aa271e1a14610401578063dd62ed3e1461045d576100b4565b8063095ea7b3146100b957806318160ddd1461011f57806323b872dd1461013d57806339509351146101c357806340c10f191461022957806370a082311461028f575b600080fd5b610105600480360360408110156100cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104d5565b604051808215151515815260200191505060405180910390f35b6101276104f3565b6040518082815260200191505060405180910390f35b6101a96004803603606081101561015357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104fd565b604051808215151515815260200191505060405180910390f35b61020f600480360360408110156101d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105d6565b604051808215151515815260200191505060405180910390f35b6102756004803603604081101561023f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610689565b604051808215151515815260200191505060405180910390f35b6102d1600480360360208110156102a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610704565b6040518082815260200191505060405180910390f35b610329600480360360208110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061074c565b005b6103336107bd565b005b6103816004803603604081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cf565b604051808215151515815260200191505060405180910390f35b6103e7600480360360408110156103b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061089c565b604051808215151515815260200191505060405180910390f35b6104436004803603602081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ba565b604051808215151515815260200191505060405180910390f35b6104bf6004803603604081101561047357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108d7565b6040518082815260200191505060405180910390f35b60006104e96104e261095e565b8484610966565b6001905092915050565b6000600254905090565b600061050a848484610b5d565b6105cb8461051661095e565b6105c6856040518060600160405280602881526020016114fd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061057c61095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b600190509392505050565b600061067f6105e361095e565b8461067a85600160006105f461095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b610966565b6001905092915050565b600061069b61069661095e565b6108ba565b6106f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6106fa8383610f5b565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61075c61075761095e565b6108ba565b6107b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6107ba81611116565b50565b6107cd6107c861095e565b611170565b565b60006108926107dc61095e565b8461088d85604051806060016040528060258152602001611590602591396001600061080661095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b6001905092915050565b60006108b06108a961095e565b8484610b5d565b6001905092915050565b60006108d08260036111ca90919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061156c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806114646022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610be3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806115476025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114416023913960400191505060405180910390fd5b610cd481604051806060016040528060268152602001611486602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d67816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610ec0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e85578082015181840152602081019050610e6a565b50505050905090810190601f168015610eb25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610f51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61101381600254610ed390919063ffffffff16565b60028190555061106a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61112a8160036112a890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b61118481600361138390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806115256022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6112b282826111ca565b15611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61138d82826111ca565b6113e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806114dc6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820d814ae3015d19c38aed909871af148dee0d88a6be96dc04f5c4a57e543a3f83364736f6c634300050d0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" +var ERC20MintableBin = "0x60806040526100266100186001600160e01b0361002b16565b6001600160e01b0361002f16565b6101a3565b3390565b61004781600361007e60201b610a6e1790919060201c565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b61009182826001600160e01b0361012216565b156100fd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b038216610183576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610eb16022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610cff806101b26000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146101c757806398650275146101ef578063a457c2d7146101f7578063a9059cbb14610223578063aa271e1a1461024f578063dd62ed3e14610275576100b4565b8063095ea7b3146100b957806318160ddd146100f957806323b872dd14610113578063395093511461014957806340c10f191461017557806370a08231146101a1575b600080fd5b6100e5600480360360408110156100cf57600080fd5b506001600160a01b0381351690602001356102a3565b604080519115158252519081900360200190f35b6101016102c0565b60408051918252519081900360200190f35b6100e56004803603606081101561012957600080fd5b506001600160a01b038135811691602081013590911690604001356102c6565b6100e56004803603604081101561015f57600080fd5b506001600160a01b038135169060200135610353565b6100e56004803603604081101561018b57600080fd5b506001600160a01b0381351690602001356103a7565b610101600480360360208110156101b757600080fd5b50356001600160a01b03166103fe565b6101ed600480360360208110156101dd57600080fd5b50356001600160a01b0316610419565b005b6101ed61046b565b6100e56004803603604081101561020d57600080fd5b506001600160a01b03813516906020013561047d565b6100e56004803603604081101561023957600080fd5b506001600160a01b0381351690602001356104eb565b6100e56004803603602081101561026557600080fd5b50356001600160a01b03166104ff565b6101016004803603604081101561028b57600080fd5b506001600160a01b0381358116916020013516610518565b60006102b76102b0610543565b8484610547565b50600192915050565b60025490565b60006102d3848484610633565b610349846102df610543565b61034485604051806060016040528060288152602001610c13602891396001600160a01b038a1660009081526001602052604081209061031d610543565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61078f16565b610547565b5060019392505050565b60006102b7610360610543565b846103448560016000610371610543565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61082616565b60006103b96103b4610543565b6104ff565b6103f45760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b6102b78383610887565b6001600160a01b031660009081526020819052604090205490565b6104246103b4610543565b61045f5760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b61046881610977565b50565b61047b610476610543565b6109bf565b565b60006102b761048a610543565b8461034485604051806060016040528060258152602001610ca660259139600160006104b4610543565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61078f16565b60006102b76104f8610543565b8484610633565b600061051260038363ffffffff610a0716565b92915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661058c5760405162461bcd60e51b8152600401808060200182810382526024815260200180610c826024913960400191505060405180910390fd5b6001600160a01b0382166105d15760405162461bcd60e51b8152600401808060200182810382526022815260200180610b7a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106785760405162461bcd60e51b8152600401808060200182810382526025815260200180610c5d6025913960400191505060405180910390fd5b6001600160a01b0382166106bd5760405162461bcd60e51b8152600401808060200182810382526023815260200180610b576023913960400191505060405180910390fd5b61070081604051806060016040528060268152602001610b9c602691396001600160a01b038616600090815260208190526040902054919063ffffffff61078f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610735908263ffffffff61082616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561081e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107e35781810151838201526020016107cb565b50505050905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610880576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166108e2576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6002546108f5908263ffffffff61082616565b6002556001600160a01b038216600090815260208190526040902054610921908263ffffffff61082616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b61098860038263ffffffff610a6e16565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6109d060038263ffffffff610aef16565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60006001600160a01b038216610a4e5760405162461bcd60e51b8152600401808060200182810382526022815260200180610c3b6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610a788282610a07565b15610aca576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b610af98282610a07565b610b345760405162461bcd60e51b8152600401808060200182810382526021815260200180610bf26021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158205d954def161c622e62537fbcd64f678436a7ae5e2c2484dfd0bd5c4448bff59864736f6c634300050d0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" // 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) { @@ -2015,7 +2015,7 @@ func (_ERC20Mintable *ERC20MintableFilterer) ParseTransfer(log types.Log) (*ERC2 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\"}]" // ERC20SimpleSwapBin is the compiled bytecode used for deploying new contracts. -var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b506040516122eb3803806122eb8339818101604052606081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806000819055505050506121f8806100f36000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032" +var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032" // 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) { @@ -4055,7 +4055,7 @@ func (_IERC20 *IERC20Filterer) ParseTransfer(log types.Log) (*IERC20Transfer, er const MathABI = "[]" // MathBin is the compiled bytecode used for deploying new contracts. -var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582000a7fe8f11c52b79f03af2d1ee3eb200d3fd399e2d019af8439d5bba62f64c0964736f6c634300050d0032" +var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820dd27f118e79de85d5f755c5a3bf6bac19388a29bf024ae4a936b3d02ec89c5c764736f6c634300050d0032" // 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 +4716,7 @@ func (_MinterRole *MinterRoleFilterer) ParseMinterRemoved(log types.Log) (*Minte const RolesABI = "[]" // RolesBin is the compiled bytecode used for deploying new contracts. -var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158209a68d01e8b2b237a89fef9b2aa16f6200a28b6f0cb4b41af99c6e125cf59ef1e64736f6c634300050d0032" +var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582093431205522ed7cdc0c6ada062554f81ef4be833793063e8eeaeeaf10fe9b1e664736f6c634300050d0032" // 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 +4878,7 @@ func (_Roles *RolesTransactorRaw) Transact(opts *bind.TransactOpts, method strin const SafeMathABI = "[]" // SafeMathBin is the compiled bytecode used for deploying new contracts. -var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820044a15379c034d2be95cff236f2765160889caff1b82a6d65660cc33f8505af664736f6c634300050d0032" +var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820a40cac344427ea0c4f6bebf4c23c2a56e02a64c63860ffbd55a691451c32385e64736f6c634300050d0032" // 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-0/simpleswapfactory/code.go b/vendor/github.com/ethersphere/go-sw3/contracts-v0-2-0/simpleswapfactory/code.go index fd54247754..f4b154cda1 100644 --- 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 @@ -19,4 +19,4 @@ package simpleswapfactory // SimpleSwapFactoryDeployedCode is the bytecode SimpleSwapFactory will have after deployment - const SimpleSwapFactoryDeployedCode = "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace146100d4578063c70242ad1461011e575b600080fd5b6100926004803603604081101561005c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061017a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100dc610301565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101606004803603602081101561013457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610327565b604051808215151515815260200191505060405180910390f35b60008083600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516101ae90610347565b808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051809103906000f08015801561023a573d6000803e3d6000fd5b50905060016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00481604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18091505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006020528060005260406000206000915054906101000a900460ff1681565b6122eb806103558339019056fe608060405234801561001057600080fd5b506040516122eb3803806122eb8339818101604052606081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806000819055505050506121f8806100f36000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032a265627a7a72315820bfdcb3c4bb558adb9e8c3072b91d763f9e5b62aad72502d95e326660aaa3cbb364736f6c634300050d0032" + const SimpleSwapFactoryDeployedCode = "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b611610806101c28339019056fe608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032a265627a7a7231582074f28023ea8adc36d5f6aac79fa6353a114852f91b58f3e8b0dbf1b481c203e364736f6c634300050d0032" 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-0/simpleswapfactory/simpleswapfactory.go index dca22aa427..817006d4ce 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-0/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 = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820c087da536b18c4187b7cacb424c2e4c58e707414a9642df27f1db97cccc3b7f464736f6c634300050d0032" +var ECDSABin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820872a175153bafae69ff9a23d9f9bb4a85e5703da816064f5d5ede3ecbb91b56564736f6c634300050d0032" // 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 = "0x6080604052610e3a806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a08231146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e1461032157610088565b8063095ea7b31461008d57806318160ddd146100f357806323b872dd146101115780633950935114610197575b600080fd5b6100d9600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610399565b604051808215151515815260200191505060405180910390f35b6100fb6103b7565b6040518082815260200191505060405180910390f35b61017d6004803603606081101561012757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103c1565b604051808215151515815260200191505060405180910390f35b6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061049a565b604051808215151515815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061054d565b6040518082815260200191505060405180910390f35b6102a16004803603604081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610595565b604051808215151515815260200191505060405180910390f35b610307600480360360408110156102d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610662565b604051808215151515815260200191505060405180910390f35b6103836004803603604081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610680565b6040518082815260200191505060405180910390f35b60006103ad6103a6610707565b848461070f565b6001905092915050565b6000600254905090565b60006103ce848484610906565b61048f846103da610707565b61048a85604051806060016040528060288152602001610d7060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610440610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b600190509392505050565b60006105436104a7610707565b8461053e85600160006104b8610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b61070f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106586105a2610707565b8461065385604051806060016040528060258152602001610de160259139600160006105cc610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b6001905092915050565b600061067661066f610707565b8484610906565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610795576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610dbd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561081b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610d286022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610d986025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610d056023913960400191505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c2e578082015181840152602081019050610c13565b50505050905090810190601f168015610c5b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582053b4b44d2fad2123e25198aa5ed2b9e7b2ed14bfa733eb6d7d64e1cf403ba57964736f6c634300050d0032" +var ERC20Bin = "0x608060405261083b806100136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a0823114610149578063a457c2d71461016f578063a9059cbb1461019b578063dd62ed3e146101c757610088565b8063095ea7b31461008d57806318160ddd146100cd57806323b872dd146100e7578063395093511461011d575b600080fd5b6100b9600480360360408110156100a357600080fd5b506001600160a01b0381351690602001356101f5565b604080519115158252519081900360200190f35b6100d5610212565b60408051918252519081900360200190f35b6100b9600480360360608110156100fd57600080fd5b506001600160a01b03813581169160208101359091169060400135610218565b6100b96004803603604081101561013357600080fd5b506001600160a01b0381351690602001356102a5565b6100d56004803603602081101561015f57600080fd5b50356001600160a01b03166102f9565b6100b96004803603604081101561018557600080fd5b506001600160a01b038135169060200135610314565b6100b9600480360360408110156101b157600080fd5b506001600160a01b038135169060200135610382565b6100d5600480360360408110156101dd57600080fd5b506001600160a01b0381358116916020013516610396565b60006102096102026103c1565b84846103c5565b50600192915050565b60025490565b60006102258484846104b1565b61029b846102316103c1565b61029685604051806060016040528060288152602001610771602891396001600160a01b038a1660009081526001602052604081209061026f6103c1565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61060d16565b6103c5565b5060019392505050565b60006102096102b26103c1565b8461029685600160006102c36103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6106a416565b6001600160a01b031660009081526020819052604090205490565b60006102096103216103c1565b84610296856040518060600160405280602581526020016107e2602591396001600061034b6103c1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61060d16565b600061020961038f6103c1565b84846104b1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661040a5760405162461bcd60e51b81526004018080602001828103825260248152602001806107be6024913960400191505060405180910390fd5b6001600160a01b03821661044f5760405162461bcd60e51b81526004018080602001828103825260228152602001806107296022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166104f65760405162461bcd60e51b81526004018080602001828103825260258152602001806107996025913960400191505060405180910390fd5b6001600160a01b03821661053b5760405162461bcd60e51b81526004018080602001828103825260238152602001806107066023913960400191505060405180910390fd5b61057e8160405180606001604052806026815260200161074b602691396001600160a01b038616600090815260208190526040902054919063ffffffff61060d16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546105b3908263ffffffff6106a416565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561069c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610661578181015183820152602001610649565b50505050905090810190601f16801561068e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156106fe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820e7920dfefc274a9bba653bb8a8dda9ad48643ad5bcf3e2bac0457e7caf286fe964736f6c634300050d0032" // 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 = "0x608060405262000024620000186200002a60201b60201c565b6200003260201b60201c565b62000257565b600033905090565b6200004d8160036200009360201b620012a81790919060201c565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b620000a582826200017760201b60201c565b1562000119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000200576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180620018506022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6115e980620002676000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146102e7578063986502751461032b578063a457c2d714610335578063a9059cbb1461039b578063aa271e1a14610401578063dd62ed3e1461045d576100b4565b8063095ea7b3146100b957806318160ddd1461011f57806323b872dd1461013d57806339509351146101c357806340c10f191461022957806370a082311461028f575b600080fd5b610105600480360360408110156100cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104d5565b604051808215151515815260200191505060405180910390f35b6101276104f3565b6040518082815260200191505060405180910390f35b6101a96004803603606081101561015357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104fd565b604051808215151515815260200191505060405180910390f35b61020f600480360360408110156101d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105d6565b604051808215151515815260200191505060405180910390f35b6102756004803603604081101561023f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610689565b604051808215151515815260200191505060405180910390f35b6102d1600480360360208110156102a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610704565b6040518082815260200191505060405180910390f35b610329600480360360208110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061074c565b005b6103336107bd565b005b6103816004803603604081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cf565b604051808215151515815260200191505060405180910390f35b6103e7600480360360408110156103b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061089c565b604051808215151515815260200191505060405180910390f35b6104436004803603602081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ba565b604051808215151515815260200191505060405180910390f35b6104bf6004803603604081101561047357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108d7565b6040518082815260200191505060405180910390f35b60006104e96104e261095e565b8484610966565b6001905092915050565b6000600254905090565b600061050a848484610b5d565b6105cb8461051661095e565b6105c6856040518060600160405280602881526020016114fd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061057c61095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b600190509392505050565b600061067f6105e361095e565b8461067a85600160006105f461095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b610966565b6001905092915050565b600061069b61069661095e565b6108ba565b6106f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6106fa8383610f5b565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61075c61075761095e565b6108ba565b6107b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6107ba81611116565b50565b6107cd6107c861095e565b611170565b565b60006108926107dc61095e565b8461088d85604051806060016040528060258152602001611590602591396001600061080661095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b6001905092915050565b60006108b06108a961095e565b8484610b5d565b6001905092915050565b60006108d08260036111ca90919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061156c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806114646022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610be3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806115476025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114416023913960400191505060405180910390fd5b610cd481604051806060016040528060268152602001611486602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d67816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610ec0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e85578082015181840152602081019050610e6a565b50505050905090810190601f168015610eb25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610f51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61101381600254610ed390919063ffffffff16565b60028190555061106a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61112a8160036112a890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b61118481600361138390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806115256022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6112b282826111ca565b15611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61138d82826111ca565b6113e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806114dc6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820d814ae3015d19c38aed909871af148dee0d88a6be96dc04f5c4a57e543a3f83364736f6c634300050d0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" +var ERC20MintableBin = "0x60806040526100266100186001600160e01b0361002b16565b6001600160e01b0361002f16565b6101a3565b3390565b61004781600361007e60201b610a6e1790919060201c565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b61009182826001600160e01b0361012216565b156100fd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b038216610183576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610eb16022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610cff806101b26000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146101c757806398650275146101ef578063a457c2d7146101f7578063a9059cbb14610223578063aa271e1a1461024f578063dd62ed3e14610275576100b4565b8063095ea7b3146100b957806318160ddd146100f957806323b872dd14610113578063395093511461014957806340c10f191461017557806370a08231146101a1575b600080fd5b6100e5600480360360408110156100cf57600080fd5b506001600160a01b0381351690602001356102a3565b604080519115158252519081900360200190f35b6101016102c0565b60408051918252519081900360200190f35b6100e56004803603606081101561012957600080fd5b506001600160a01b038135811691602081013590911690604001356102c6565b6100e56004803603604081101561015f57600080fd5b506001600160a01b038135169060200135610353565b6100e56004803603604081101561018b57600080fd5b506001600160a01b0381351690602001356103a7565b610101600480360360208110156101b757600080fd5b50356001600160a01b03166103fe565b6101ed600480360360208110156101dd57600080fd5b50356001600160a01b0316610419565b005b6101ed61046b565b6100e56004803603604081101561020d57600080fd5b506001600160a01b03813516906020013561047d565b6100e56004803603604081101561023957600080fd5b506001600160a01b0381351690602001356104eb565b6100e56004803603602081101561026557600080fd5b50356001600160a01b03166104ff565b6101016004803603604081101561028b57600080fd5b506001600160a01b0381358116916020013516610518565b60006102b76102b0610543565b8484610547565b50600192915050565b60025490565b60006102d3848484610633565b610349846102df610543565b61034485604051806060016040528060288152602001610c13602891396001600160a01b038a1660009081526001602052604081209061031d610543565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61078f16565b610547565b5060019392505050565b60006102b7610360610543565b846103448560016000610371610543565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61082616565b60006103b96103b4610543565b6104ff565b6103f45760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b6102b78383610887565b6001600160a01b031660009081526020819052604090205490565b6104246103b4610543565b61045f5760405162461bcd60e51b8152600401808060200182810382526030815260200180610bc26030913960400191505060405180910390fd5b61046881610977565b50565b61047b610476610543565b6109bf565b565b60006102b761048a610543565b8461034485604051806060016040528060258152602001610ca660259139600160006104b4610543565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61078f16565b60006102b76104f8610543565b8484610633565b600061051260038363ffffffff610a0716565b92915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661058c5760405162461bcd60e51b8152600401808060200182810382526024815260200180610c826024913960400191505060405180910390fd5b6001600160a01b0382166105d15760405162461bcd60e51b8152600401808060200182810382526022815260200180610b7a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106785760405162461bcd60e51b8152600401808060200182810382526025815260200180610c5d6025913960400191505060405180910390fd5b6001600160a01b0382166106bd5760405162461bcd60e51b8152600401808060200182810382526023815260200180610b576023913960400191505060405180910390fd5b61070081604051806060016040528060268152602001610b9c602691396001600160a01b038616600090815260208190526040902054919063ffffffff61078f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610735908263ffffffff61082616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561081e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107e35781810151838201526020016107cb565b50505050905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610880576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166108e2576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6002546108f5908263ffffffff61082616565b6002556001600160a01b038216600090815260208190526040902054610921908263ffffffff61082616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b61098860038263ffffffff610a6e16565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b6109d060038263ffffffff610aef16565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60006001600160a01b038216610a4e5760405162461bcd60e51b8152600401808060200182810382526022815260200180610c3b6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610a788282610a07565b15610aca576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b610af98282610a07565b610b345760405162461bcd60e51b8152600401808060200182810382526021815260200180610bf26021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158205d954def161c622e62537fbcd64f678436a7ae5e2c2484dfd0bd5c4448bff59864736f6c634300050d0032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" // 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) { @@ -2015,7 +2015,7 @@ func (_ERC20Mintable *ERC20MintableFilterer) ParseTransfer(log types.Log) (*ERC2 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\"}]" // ERC20SimpleSwapBin is the compiled bytecode used for deploying new contracts. -var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b506040516122eb3803806122eb8339818101604052606081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806000819055505050506121f8806100f36000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032" +var ERC20SimpleSwapBin = "0x608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032" // 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) { @@ -4055,7 +4055,7 @@ func (_IERC20 *IERC20Filterer) ParseTransfer(log types.Log) (*IERC20Transfer, er const MathABI = "[]" // MathBin is the compiled bytecode used for deploying new contracts. -var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582000a7fe8f11c52b79f03af2d1ee3eb200d3fd399e2d019af8439d5bba62f64c0964736f6c634300050d0032" +var MathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820dd27f118e79de85d5f755c5a3bf6bac19388a29bf024ae4a936b3d02ec89c5c764736f6c634300050d0032" // 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 +4716,7 @@ func (_MinterRole *MinterRoleFilterer) ParseMinterRemoved(log types.Log) (*Minte const RolesABI = "[]" // RolesBin is the compiled bytecode used for deploying new contracts. -var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158209a68d01e8b2b237a89fef9b2aa16f6200a28b6f0cb4b41af99c6e125cf59ef1e64736f6c634300050d0032" +var RolesBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582093431205522ed7cdc0c6ada062554f81ef4be833793063e8eeaeeaf10fe9b1e664736f6c634300050d0032" // 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 +4878,7 @@ func (_Roles *RolesTransactorRaw) Transact(opts *bind.TransactOpts, method strin const SafeMathABI = "[]" // SafeMathBin is the compiled bytecode used for deploying new contracts. -var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820044a15379c034d2be95cff236f2765160889caff1b82a6d65660cc33f8505af664736f6c634300050d0032" +var SafeMathBin = "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820a40cac344427ea0c4f6bebf4c23c2a56e02a64c63860ffbd55a691451c32385e64736f6c634300050d0032" // 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 +5040,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 = "0x608060405234801561001057600080fd5b506040516127093803806127098339818101604052602081101561003357600080fd5b810190808051906020019092919050505080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050612674806100956000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace146100d4578063c70242ad1461011e575b600080fd5b6100926004803603604081101561005c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061017a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100dc610301565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101606004803603602081101561013457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610327565b604051808215151515815260200191505060405180910390f35b60008083600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516101ae90610347565b808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051809103906000f08015801561023a573d6000803e3d6000fd5b50905060016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00481604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18091505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006020528060005260406000206000915054906101000a900460ff1681565b6122eb806103558339019056fe608060405234801561001057600080fd5b506040516122eb3803806122eb8339818101604052606081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806000819055505050506121f8806100f36000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610612578063c76a4d3114610630578063d4c9a8e814610688578063e0bcf13a1461076d578063fc0c546a1461078b5761010b565b8063946f46a2146104f5578063b6343b0d14610539578063b69ef8a8146105a6578063b7770350146105c45761010b565b80631d143848116100de5780631d143848146103d75780632e1a7d4d14610421578063338f3fed1461044f57806381f03fcb1461049d5761010b565b80630d5f26591461011057806312101021146101f55780631357e1dc146102135780631633fb1d14610231575b600080fd5b6101f36004803603606081101561012657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561016d57600080fd5b82018360208201111561017f57600080fd5b803590602001918460018302840111640100000000831117156101a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107d5565b005b6101fd6107e8565b6040518082815260200191505060405180910390f35b61021b6107ee565b6040518082815260200191505060405180910390f35b6103d5600480360360c081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102ae57600080fd5b8201836020820111156102c057600080fd5b803590602001918460018302840111640100000000831117156102e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019064010000000081111561034f57600080fd5b82018360208201111561036157600080fd5b8035906020019184600183028401116401000000008311171561038357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506107f4565b005b6103df6108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b81019080803590602001909291905050506108c8565b005b61049b6004803603604081101561046557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b49565b005b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b005b61057b6004803603602081101561054f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6105ae610ef9565b6040518082815260200191505060405180910390f35b610610600480360360408110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fda565b005b61061a6111c2565b6040518082815260200191505060405180910390f35b6106726004803603602081101561064657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61076b6004803603606081101561069e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061124a565b005b61077561143e565b6040518082815260200191505060405180910390f35b610793611444565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107e333848460008561146a565b505050565b60005481565b60035481565b61080a6108043033878987611b8e565b84611c6f565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461088d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b61089a868686858561146a565b505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461098b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6109936111c2565b8111156109eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061219c6028913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6020811015610ae057600080fd5b8101908080519060200190929190505050610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b610c14610ef9565b610c2982600554611c8b90919063ffffffff16565b1115610c80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806120d36034913960400191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610cda828260000154611c8b90919063ffffffff16565b8160000181905550610cf782600554611c8b90919063ffffffff16565b600581905550600081600301819055508273ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a2505050565b60026020528060005260406000206000915090505481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600301544210158015610dd257506000816003015414155b610e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806121296025913960400191505060405180910390fd5b610e4281600101548260000154611d1390919063ffffffff16565b816000018190555060008160030181905550610e6d8160010154600554611d1390919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad82600001546040518082815260200191505060405180910390a25050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b8101908080519060200190929190505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000015482111561113d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121756027913960400191505060405180910390fd5b600080826002015414611154578160020154611158565b6000545b905080420182600301819055508282600101819055508373ffffffffffffffffffffffffffffffffffffffff167fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a846040518082815260200191505060405180910390a250505050565b60006111e06005546111d2610ef9565b611d1390919063ffffffff16565b905090565b6000611243600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546112356111c2565b611c8b90919063ffffffff16565b9050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53696d706c65537761703a206e6f74206973737565720000000000000000000081525060200191505060405180910390fd5b61132161131b308585611d5d565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121076022913960400191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508273ffffffffffffffffffffffffffffffffffffffff167f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf0836040518082815260200191505060405180910390a2505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611596576114d36114cd308786611dfd565b82611c6f565b73ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a20696e76616c69642069737375657253696700000081525060200191505060405180910390fd5b5b60006115ea600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611d1390919063ffffffff16565b90506000611600826115fb896111e5565b611e9d565b9050600061165082600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611e9d565b9050848210156116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f53696d706c65537761703a2063616e6e6f74207061792063616c6c657200000081525060200191505060405180910390fd5b600081146117875761172581600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611d1390919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061178081600554611d1390919063ffffffff16565b6005819055505b6117d982600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183182600354611c8b90919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb886118898886611d1390919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118f257600080fd5b505af1158015611906573d6000803e3d6000fd5b505050506040513d602081101561191c57600080fd5b8101908080519060200190929190505050611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b60008514611ac457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33876040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b505050506040513d6020811015611a5d57600080fd5b8101908080519060200190929190505050611ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061214e6027913960400191505060405180910390fd5b5b3373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a60405180848152602001838152602001828152602001935050505060405180910390a4818314611b84577f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc460405160405180910390a15b5050505050505050565b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120905095945050505050565b6000611c83611c7d84611eb6565b83611f0e565b905092915050565b600080828401905083811015611d09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611d5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612012565b905092915050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090509392505050565b6000818310611eac5781611eae565b825b905092915050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60006041825114611f22576000905061200c565b60008060006020850151925060408501519150606085015160001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115611f76576000935050505061200c565b601b8160ff1614158015611f8e5750601c8160ff1614155b15611f9f576000935050505061200c565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611ffc573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b60008383111582906120bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612084578082015181840152602081019050612069565b50505050905090810190601f1680156120b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820a2829ec1c4ee1a4aa11d90f04bfe854a020b9b07943b7ae56603fb1d301604be64736f6c634300050d0032a265627a7a72315820bfdcb3c4bb558adb9e8c3072b91d763f9e5b62aad72502d95e326660aaa3cbb364736f6c634300050d0032" +var SimpleSwapFactoryBin = "0x608060405234801561001057600080fd5b506040516118693803806118698339818101604052602081101561003357600080fd5b5051600180546001600160a01b0319166001600160a01b03909216919091179055611806806100636000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b611610806101c28339019056fe608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032a265627a7a7231582074f28023ea8adc36d5f6aac79fa6353a114852f91b58f3e8b0dbf1b481c203e364736f6c634300050d0032" // 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 b0d30523ed..5820d30885 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -172,7 +172,7 @@ 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.0 +# 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/fatih/color v1.7.0 From e66bb7b88416894bbed37b11659ed6327b9feed7 Mon Sep 17 00:00:00 2001 From: eknir Date: Fri, 22 Nov 2019 15:53:48 +0100 Subject: [PATCH 05/22] swap, contracts/swap: update prompter --- contracts/swap/factory.go | 8 +------- contracts/swap/swap.go | 22 ++++++++++++++++++---- swap/swap.go | 38 +++++++++++++++++++++++++++----------- 3 files changed, 46 insertions(+), 22 deletions(-) diff --git a/contracts/swap/factory.go b/contracts/swap/factory.go index 4066b27e48..ffd4bfd0bb 100644 --- a/contracts/swap/factory.go +++ b/contracts/swap/factory.go @@ -19,7 +19,7 @@ var ( // Deployments maps from network ids to deployed contract factories Deployments = map[uint64]common.Address{ // Ropsten - 3: common.HexToAddress("0xE17A80727f08258aF0DCec417bF5A15295e66ECC"), + 3: common.HexToAddress("TODO"), } ) @@ -64,13 +64,7 @@ func (sf simpleSwapFactory) VerifySelf() error { if err != nil { return err } - // copiedCodeTruffle by in build/SimpleSwapFactory.json (deployedBytecode) from swap-swear-swindle - copiedCodeTruffle := "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b611610806101c28339019056fe608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a72315820aa9da0de87402b2baf9fc4371dee670cb8ef20853e79bdede4f0d5d30ceb03ed64736f6c634300050d0032a265627a7a7231582004e2618edf1a8d32811f07167ffed43c0fa6dc0c11aed9d47356dc37b4dcb2bc64736f6c634300050d0032" - // copied from repository go-sw3 - copiedCodeGoBindings := "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063576d727114610046578063a6021ace1461008e578063c70242ad14610096575b600080fd5b6100726004803603604081101561005c57600080fd5b506001600160a01b0381351690602001356100d0565b604080516001600160a01b039092168252519081900360200190f35b610072610190565b6100bc600480360360208110156100ac57600080fd5b50356001600160a01b031661019f565b604080519115158252519081900360200190f35b600154604051600091829185916001600160a01b03169085906100f2906101b4565b6001600160a01b039384168152919092166020820152604080820192909252905190819003606001906000f080158015610130573d6000803e3d6000fd5b506001600160a01b03811660008181526020818152604091829020805460ff19166001179055815192835290519293507fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00492918290030190a19392505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b611610806101c28339019056fe608060405234801561001057600080fd5b506040516116103803806116108339818101604052606081101561003357600080fd5b5080516020820151604090920151600680546001600160a01b039384166001600160a01b031991821617909155600180549390941692169190911790915560005561158d806100836000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063946f46a2116100a2578063b7ec1a3311610071578063b7ec1a3314610477578063c76a4d311461047f578063d4c9a8e8146104a5578063e0bcf13a1461055e578063fc0c546a146105665761010b565b8063946f46a2146103d1578063b6343b0d146103f7578063b69ef8a814610443578063b77703501461044b5761010b565b80631d143848116100de5780631d1438481461033e5780632e1a7d4d14610362578063338f3fed1461037f57806381f03fcb146103ab5761010b565b80630d5f26591461011057806312101021146101cb5780631357e1dc146101e55780631633fb1d146101ed575b600080fd5b6101c96004803603606081101561012657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561015557600080fd5b82018360208201111561016757600080fd5b803590602001918460018302840111600160201b8311171561018857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061056e945050505050565b005b6101d3610581565b60408051918252519081900360200190f35b6101d3610587565b6101c9600480360360c081101561020357600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561023d57600080fd5b82018360208201111561024f57600080fd5b803590602001918460018302840111600160201b8311171561027057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156102ca57600080fd5b8201836020820111156102dc57600080fd5b803590602001918460018302840111600160201b831117156102fd57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061058d945050505050565b610346610607565b604080516001600160a01b039092168252519081900360200190f35b6101c96004803603602081101561037857600080fd5b5035610616565b6101c96004803603604081101561039557600080fd5b506001600160a01b038135169060200135610777565b6101d3600480360360208110156103c157600080fd5b50356001600160a01b03166108b5565b6101c9600480360360208110156103e757600080fd5b50356001600160a01b03166108c7565b61041d6004803603602081101561040d57600080fd5b50356001600160a01b03166109ae565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101d36109d5565b6101c96004803603604081101561046157600080fd5b506001600160a01b038135169060200135610a51565b6101d3610b73565b6101d36004803603602081101561049557600080fd5b50356001600160a01b0316610b94565b6101c9600480360360608110156104bb57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ea57600080fd5b8201836020820111156104fc57600080fd5b803590602001918460018302840111600160201b8311171561051d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bcb945050505050565b6101d3610cde565b610346610ce4565b61057c338484600085610cf3565b505050565b60005481565b60035481565b6105a361059d3033878987611112565b84611173565b6001600160a01b0316866001600160a01b0316146105f25760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6105ff8686868585610cf3565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b0316331461066e576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610676610b73565b8111156106b45760405162461bcd60e51b81526004018080602001828103825260288152602001806115316028913960400191505060405180910390fd5b6001546006546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561070d57600080fd5b505af1158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b50516107745760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b50565b6006546001600160a01b031633146107cf576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6107d76109d5565b6005546107ea908363ffffffff61118e16565b11156108275760405162461bcd60e51b81526004018080602001828103825260348152602001806114686034913960400191505060405180910390fd5b6001600160a01b03821660009081526004602052604090208054610851908363ffffffff61118e16565b8155600554610866908363ffffffff61118e16565b60055560006003820155805460408051918252516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a2505050565b60026020526000908152604090205481565b6001600160a01b0381166000908152600460205260409020600381015442108015906108f65750600381015415155b6109315760405162461bcd60e51b81526004018080602001828103825260258152602001806114be6025913960400191505060405180910390fd5b600181015481546109479163ffffffff6111e816565b81556000600382015560018101546005546109679163ffffffff6111e816565b600555805460408051918252516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad919081900360200190a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a2057600080fd5b505afa158015610a34573d6000803e3d6000fd5b505050506040513d6020811015610a4a57600080fd5b5051905090565b6006546001600160a01b03163314610aa9576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b6001600160a01b03821660009081526004602052604090208054821115610b015760405162461bcd60e51b815260040180806020018281038252602781526020018061150a6027913960400191505060405180910390fd5b60008160020154600014610b19578160020154610b1d565b6000545b4281016003840155600183018490556040805185815290519192506001600160a01b038616917fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a9181900360200190a250505050565b6000610b8f600554610b836109d5565b9063ffffffff6111e816565b905090565b6001600160a01b038116600090815260046020526040812054610bc590610bb9610b73565b9063ffffffff61118e16565b92915050565b6006546001600160a01b03163314610c23576040805162461bcd60e51b815260206004820152601660248201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604482015290519081900360640190fd5b610c37610c3130858561122a565b82611173565b6001600160a01b0316836001600160a01b031614610c865760405162461bcd60e51b815260040180806020018281038252602281526020018061149c6022913960400191505060405180910390fd5b6001600160a01b038316600081815260046020908152604091829020600201859055815185815291517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf09281900390910190a2505050565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610d7557610d13610c3130878661122a565b6006546001600160a01b03908116911614610d75576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a20696e76616c696420697373756572536967000000604482015290519081900360640190fd5b6001600160a01b038516600090815260026020526040812054610d9f90859063ffffffff6111e816565b90506000610db582610db089610b94565b61127b565b6001600160a01b03881660009081526004602052604081205491925090610ddd90839061127b565b905084821015610e34576040805162461bcd60e51b815260206004820152601d60248201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604482015290519081900360640190fd5b8015610e93576001600160a01b038816600090815260046020526040902054610e63908263ffffffff6111e816565b6001600160a01b038916600090815260046020526040902055600554610e8f908263ffffffff6111e816565b6005555b6001600160a01b038816600090815260026020526040902054610ebc908363ffffffff61118e16565b6001600160a01b038916600090815260026020526040902055600354610ee8908363ffffffff61118e16565b6003556001546001600160a01b031663a9059cbb88610f0d858963ffffffff6111e816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050506040513d6020811015610f8657600080fd5b5051610fc35760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b8415611084576001546040805163a9059cbb60e01b81523360048201526024810188905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b505050506040513d602081101561104757600080fd5b50516110845760405162461bcd60e51b81526004018080602001828103825260278152602001806114e36027913960400191505060405180910390fd5b6040805183815260208101889052808201879052905133916001600160a01b038a811692908c16917f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f919081900360600190a4818314611108576040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b5050505050505050565b604080516bffffffffffffffffffffffff19606097881b811660208084019190915296881b8116603483015260488201959095529290951b9092166068820152607c8082019290925283518082039092018252609c01909252815191012090565b600061118761118184611291565b836112e2565b9392505050565b600082820183811015611187576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061118783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d0565b604080516bffffffffffffffffffffffff19606095861b81166020808401919091529490951b9094166034850152604880850192909252805180850390920182526068909301909252815191012090565b600081831061128a5781611187565b5090919050565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b600081516041146112f557506000610bc5565b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561133b5760009350505050610bc5565b8060ff16601b1415801561135357508060ff16601c14155b156113645760009350505050610bc5565b6040805160008152602080820180845289905260ff8416828401526060820186905260808201859052915160019260a0808401939192601f1981019281900390910190855afa1580156113bb573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000818484111561145f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561142457818101518382015260200161140c565b50505050905090810190601f1680156114515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe53696d706c65537761703a2068617264206465706f7369742063616e6e6f74206265206d6f7265207468616e2062616c616e636553696d706c65537761703a20696e76616c69642062656e656669636961727953696753696d706c65537761703a206465706f736974206e6f74207965742074696d6564206f757453696d706c65537761703a2053696d706c65537761703a207472616e73666572206661696c656453696d706c65537761703a2068617264206465706f736974206e6f742073756666696369656e7453696d706c65537761703a206c697175696442616c616e6365206e6f742073756666696369656e74a265627a7a7231582095980efb0bf250253e071e182406b23ba29b6a984de46e7b420fb1962f7b2a8b64736f6c634300050d0032a265627a7a7231582074f28023ea8adc36d5f6aac79fa6353a114852f91b58f3e8b0dbf1b481c203e364736f6c634300050d0032" referenceCode := common.FromHex(chequebookFactory.SimpleSwapFactoryDeployedCode) - fmt.Println(bytes.Equal(code, referenceCode), bytes.Equal(common.FromHex(copiedCodeTruffle), referenceCode), bytes.Equal(common.FromHex(copiedCodeTruffle), code), bytes.Equal(common.FromHex(copiedCodeGoBindings), common.FromHex(copiedCodeTruffle))) - fmt.Println(bytes.Equal(common.FromHex(copiedCodeGoBindings), referenceCode)) if !bytes.Equal(code, referenceCode) { return errors.New("not a valid factory contract") } diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index f71049b11f..c3ed53dc29 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -52,6 +52,8 @@ type Contract interface { CashChequeBeneficiary(auth *bind.TransactOpts, beneficiary common.Address, cumulativePayout *big.Int, ownerSig []byte) (*CashChequeResult, *types.Receipt, error) // LiquidBalance returns the LiquidBalance (total balance in Wei - total hard deposits in Wei) of the chequebook LiquidBalance(auth *bind.CallOpts) (*big.Int, error) + //Token returns the address of the ERC20 contract, used by the chequebook + Token(auth *bind.CallOpts) (common.Address, error) // ContractParams returns contract info (e.g. deployed address) ContractParams() *Params // Issuer returns the contract owner from the blockchain @@ -107,20 +109,27 @@ func (s simpleContract) Withdraw(auth *bind.TransactOpts, amount *big.Int) (*typ // Deposit sends an amount in ERC20 token to the chequebook and blocks until the transaction is mined func (s simpleContract) Deposit(auth *bind.TransactOpts, amount *big.Int) (*types.Receipt, error) { - if amount == big.NewInt(0) { + if amount.Cmp(big.NewInt(0)) == 0 { return nil, fmt.Errorf("Deposit amount cannot be equal to zero") } // get ERC20Instance at the address of token which is registered in the chequebook - tokenAddress, err := s.instance.Token(nil) + tokenAddress, err := s.Token(nil) if err != nil { return nil, err } - token, err := contract.NewERC20(tokenAddress, nil) + token, err := contract.NewERC20(tokenAddress, s.backend) if err != nil { return nil, err } - + // Check if we have sufficient balance + balance, err := token.BalanceOf(nil, auth.From) + if err != nil { + return nil, err + } + if balance.Cmp(amount) == -1 { + return nil, fmt.Errorf("Not enough ERC20 balance at %x for account %x", tokenAddress, auth.From) + } // transfer ERC20 to the chequebook tx, err := token.Transfer(auth, s.address, amount) if err != nil { @@ -168,6 +177,11 @@ func (s simpleContract) LiquidBalance(opts *bind.CallOpts) (*big.Int, error) { return s.instance.LiquidBalance(opts) } +//Token returns the address of the ERC20 contract, used by the chequebook +func (s simpleContract) Token(opts *bind.CallOpts) (common.Address, error) { + return s.instance.Token(opts) +} + // ContractParams returns contract information func (s simpleContract) ContractParams() *Params { return &Params{ diff --git a/swap/swap.go b/swap/swap.go index efa5b0a2bf..7e9ed8749a 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -34,8 +34,10 @@ import ( "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap" "github.com/ethersphere/swarm/contracts/swap" contract "github.com/ethersphere/swarm/contracts/swap" + "github.com/ethersphere/swarm/p2p/protocols" "github.com/ethersphere/swarm/state" ) @@ -203,7 +205,7 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par } var toDeposit = big.NewInt(int64(initialDepositAmountFlag)) if initialDepositAmountFlag == 0 { - toDeposit, err = promptInitialDepositAmount() + toDeposit, err = swap.promptDepositAmount() if err != nil { return nil, err } @@ -211,13 +213,6 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par if err := swap.Deposit(context.TODO(), toDeposit); err != nil { swapLog.Warn("Could not deposit tokens into the chequebook", "error", err) } - availableBalance, err := swap.AvailableBalance() - if err != nil { - return nil, err - } - - swapLog.Info("available balance", "balance", availableBalance) - return swap, nil } @@ -586,14 +581,35 @@ func (s *Swap) getContractOwner(ctx context.Context, address common.Address) (co return contr.Issuer(nil) } -func promptInitialDepositAmount() (*big.Int, error) { +func (s *Swap) promptDepositAmount() (*big.Int, error) { + // retrieve available balance + availableBalance, err := s.AvailableBalance() + if err != nil { + return nil, err + } + // retrieve ERC20 balance of owner + tokenAddress, err := s.contract.Token(nil) + if err != nil { + return nil, err + } + token, err := erc20simpleswap.NewERC20(tokenAddress, s.backend) + if err != nil { + return nil, err + } + balance, err := token.BalanceOf(nil, s.owner.address) + if err != nil { + return nil, err + } + // log available balance and ERC20 balance + swapLog.Info("Balance information", "chequebook available balance", availableBalance, "ERC20 balance", balance) + promptMessage := fmt.Sprintf("Please provide the amount in HONEY which will deposited to your chequebook: ") // need to prompt user for initial deposit amount // if 0, can not cash in cheques prompter := console.Stdin - // ask user for input - input, err := prompter.PromptInput("Please provide the amount in Wei which will deposited to your chequebook upon deployment: ") + input, err := prompter.PromptInput(promptMessage) if err != nil { + log.Info("eknir") return big.NewInt(0), err } // check input From edece0ff37b6af6430720a2550d90bb8f900ef82 Mon Sep 17 00:00:00 2001 From: eknir Date: Fri, 22 Nov 2019 16:28:52 +0100 Subject: [PATCH 06/22] swap, contracts/swap: initialDeposit => deposit --- api/config.go | 4 ++-- cmd/swarm/config.go | 4 ++-- cmd/swarm/flags.go | 6 +++--- cmd/swarm/main.go | 2 +- swap/config.go | 2 +- swap/swap.go | 2 +- swarm.go | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/config.go b/api/config.go index 4f0159962f..53a3ffe05b 100644 --- a/api/config.go +++ b/api/config.go @@ -57,7 +57,7 @@ type Config struct { SwapEnabled bool // whether SWAP incentives are enabled SwapPaymentThreshold uint64 // honey amount at which a payment is triggered SwapDisconnectThreshold uint64 // honey amount at which a peer disconnects - SwapInitialDeposit uint64 // initial deposit amount to the chequebook + SwapDeposit uint64 // deposit amount to the chequebook SwapLogPath string // dir to swap related audit logs Contract common.Address // address of the chequebook contract SwapChequebookFactory common.Address // address of the chequebook factory contract @@ -96,7 +96,7 @@ func NewConfig() *Config { FileStoreParams: storage.NewFileStoreParams(), SwapBackendURL: "", SwapEnabled: false, - SwapInitialDeposit: swap.DefaultInitialDepositAmount, + SwapDeposit: swap.DefaultDepositAmount, SwapPaymentThreshold: swap.DefaultPaymentThreshold, SwapDisconnectThreshold: swap.DefaultDisconnectThreshold, SwapLogPath: "", diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index 826d8c3764..6ab348043e 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -212,8 +212,8 @@ func flagsOverride(currentConfig *bzzapi.Config, ctx *cli.Context) *bzzapi.Confi if swapLogPath := ctx.GlobalString(SwarmSwapLogPathFlag.Name); currentConfig.SwapEnabled && swapLogPath != "" { currentConfig.SwapLogPath = swapLogPath } - if initialDepo := ctx.GlobalUint64(SwarmSwapInitialDepositFlag.Name); initialDepo != 0 { - currentConfig.SwapInitialDeposit = initialDepo + if initialDepo := ctx.GlobalUint64(SwarmSwapDepositFlag.Name); initialDepo != 0 { + currentConfig.SwapDeposit = initialDepo } if paymentThreshold := ctx.GlobalUint64(SwarmSwapPaymentThresholdFlag.Name); paymentThreshold != 0 { currentConfig.SwapPaymentThreshold = paymentThreshold diff --git a/cmd/swarm/flags.go b/cmd/swarm/flags.go index 94d77ba9c5..13c0194d1a 100644 --- a/cmd/swarm/flags.go +++ b/cmd/swarm/flags.go @@ -54,9 +54,9 @@ var ( Value: network.DefaultNetworkID, EnvVar: SwarmEnvNetworkID, } - SwarmSwapInitialDepositFlag = cli.StringFlag{ - Name: "swap-initial-deposit", - Usage: "Initial deposit amount for swap chequebook", + SwarmSwapDepositFlag = cli.StringFlag{ + Name: "swap-deposit", + Usage: "Deposit amount for swap chequebook", EnvVar: SwarmEnvInitialDeposit, } SwarmSwapChequebookAddrFlag = cli.StringFlag{ diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 8729e275d8..6d30bf73a4 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -185,7 +185,7 @@ func init() { SwarmSwapLogPathFlag, SwarmSwapChequebookAddrFlag, SwarmSwapChequebookFactoryFlag, - SwarmSwapInitialDepositFlag, + SwarmSwapDepositFlag, // end of swap flags SwarmNoSyncFlag, SwarmSyncUpdateDelay, diff --git a/swap/config.go b/swap/config.go index b3ab0f36f2..a09c71bea7 100644 --- a/swap/config.go +++ b/swap/config.go @@ -29,7 +29,7 @@ const ( DefaultDisconnectThreshold = 20 * DefaultPaymentThreshold // DefaultInitialDepositAmount is the default amount to send to the contract when initially deploying // NOTE: deliberate value for now; needs experimentation - DefaultInitialDepositAmount = 0 + DefaultDepositAmount = 0 // This is the amount of time in seconds which an issuer has to wait to decrease the harddeposit of a beneficiary. // The smart-contract allows for setting this variable differently per beneficiary defaultHarddepositTimeoutDuration = 24 * time.Hour diff --git a/swap/swap.go b/swap/swap.go index 7e9ed8749a..2e02ed6eb7 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -667,7 +667,7 @@ func (s *Swap) bindToContractAt(address common.Address) (contract.Contract, erro func (s *Swap) Deploy(ctx context.Context) (contract.Contract, error) { opts := bind.NewKeyedTransactor(s.owner.privateKey) opts.Context = ctx - swapLog.Info("Deploying new swap", "owner", opts.From.Hex(), "deposit", opts.Value) + swapLog.Info("Deploying new swap", "owner", opts.From.Hex()) chequebook, err := s.chequebookFactory.DeploySimpleSwap(opts, s.owner.address, big.NewInt(int64(defaultHarddepositTimeoutDuration))) if err != nil { return nil, fmt.Errorf("failed to deploy chequebook: %v", err) diff --git a/swarm.go b/swarm.go index 0f98387795..8bbd6fbb91 100644 --- a/swarm.go +++ b/swarm.go @@ -136,7 +136,7 @@ func NewSwarm(config *api.Config, mockStore *mock.NodeStore) (self *Swarm, err e self.config.SwapBackendURL, swapParams, self.config.Contract, - self.config.SwapInitialDeposit, + self.config.SwapDeposit, self.config.SwapChequebookFactory, ) if err != nil { From 4b07c3b9a28f3656420413090aeaa04c197465e5 Mon Sep 17 00:00:00 2001 From: eknir Date: Fri, 22 Nov 2019 16:49:09 +0100 Subject: [PATCH 07/22] contracts/swap balanceOf exported --- contracts/swap/swap.go | 25 ++++++++++++++++++++++--- swap/swap.go | 18 ++++-------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index c3ed53dc29..fbdaabddb2 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -54,6 +54,8 @@ type Contract interface { LiquidBalance(auth *bind.CallOpts) (*big.Int, error) //Token returns the address of the ERC20 contract, used by the chequebook Token(auth *bind.CallOpts) (common.Address, error) + //BalanceOf returns the balance of the account for the underlying ERC20 contract of the chequebook + BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) // ContractParams returns contract info (e.g. deployed address) ContractParams() *Params // Issuer returns the contract owner from the blockchain @@ -112,7 +114,6 @@ func (s simpleContract) Deposit(auth *bind.TransactOpts, amount *big.Int) (*type if amount.Cmp(big.NewInt(0)) == 0 { return nil, fmt.Errorf("Deposit amount cannot be equal to zero") } - // get ERC20Instance at the address of token which is registered in the chequebook tokenAddress, err := s.Token(nil) if err != nil { @@ -122,8 +123,7 @@ func (s simpleContract) Deposit(auth *bind.TransactOpts, amount *big.Int) (*type if err != nil { return nil, err } - // Check if we have sufficient balance - balance, err := token.BalanceOf(nil, auth.From) + balance, err := s.BalanceOf(nil, auth.From) if err != nil { return nil, err } @@ -182,6 +182,25 @@ func (s simpleContract) Token(opts *bind.CallOpts) (common.Address, error) { return s.instance.Token(opts) } +//BalanceOf returns the balance of the account for the underlying ERC20 contract of the chequebook +func (s simpleContract) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + // get ERC20Instance at the address of token which is registered in the chequebook + tokenAddress, err := s.Token(opts) + if err != nil { + return nil, err + } + token, err := contract.NewERC20(tokenAddress, s.backend) + if err != nil { + return nil, err + } + // Check if we have sufficient balance + balance, err := token.BalanceOf(opts, account) + if err != nil { + return nil, err + } + return balance, nil +} + // ContractParams returns contract information func (s simpleContract) ContractParams() *Params { return &Params{ diff --git a/swap/swap.go b/swap/swap.go index 2e02ed6eb7..51d10a2375 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -34,7 +34,6 @@ import ( "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethersphere/go-sw3/contracts-v0-2-0/erc20simpleswap" "github.com/ethersphere/swarm/contracts/swap" contract "github.com/ethersphere/swarm/contracts/swap" @@ -150,7 +149,7 @@ func newSwapInstance(stateStore state.Store, owner *Owner, backend contract.Back // - connects to the blockchain backend; // - verifies that we have not connected SWAP before on a different blockchain backend; // - starts the chequebook; creates the swap instance -func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Params, chequebookAddressFlag common.Address, initialDepositAmountFlag uint64, factoryAddress common.Address) (swap *Swap, err error) { +func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Params, chequebookAddressFlag common.Address, depositAmountFlag uint64, factoryAddress common.Address) (swap *Swap, err error) { // swap log for auditing purposes swapLog = newSwapLogger(params.LogPath, params.OverlayAddr) // verify that backendURL is not empty @@ -203,8 +202,8 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par if swap.contract, err = swap.StartChequebook(chequebookAddressFlag); err != nil { return nil, err } - var toDeposit = big.NewInt(int64(initialDepositAmountFlag)) - if initialDepositAmountFlag == 0 { + var toDeposit = big.NewInt(int64(depositAmountFlag)) + if depositAmountFlag == 0 { toDeposit, err = swap.promptDepositAmount() if err != nil { return nil, err @@ -587,16 +586,7 @@ func (s *Swap) promptDepositAmount() (*big.Int, error) { if err != nil { return nil, err } - // retrieve ERC20 balance of owner - tokenAddress, err := s.contract.Token(nil) - if err != nil { - return nil, err - } - token, err := erc20simpleswap.NewERC20(tokenAddress, s.backend) - if err != nil { - return nil, err - } - balance, err := token.BalanceOf(nil, s.owner.address) + balance, err := s.contract.BalanceOf(nil, s.owner.address) if err != nil { return nil, err } From 470b638827170081e40e57c61fc65ad373496818 Mon Sep 17 00:00:00 2001 From: eknir Date: Fri, 22 Nov 2019 19:18:33 +0100 Subject: [PATCH 08/22] contracts/swap: replace common.HexToAddress(TODO) --- contracts/swap/factory.go | 3 ++- contracts/swap/swap.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contracts/swap/factory.go b/contracts/swap/factory.go index ffd4bfd0bb..bc72fd560f 100644 --- a/contracts/swap/factory.go +++ b/contracts/swap/factory.go @@ -19,7 +19,8 @@ var ( // Deployments maps from network ids to deployed contract factories Deployments = map[uint64]common.Address{ // Ropsten - 3: common.HexToAddress("TODO"), + //TODO: update to point to an address with the new go-bindings + 3: common.HexToAddress("0x2e9C43E186eaF4fee10799d67e75f8CFc5BA3a0c"), } ) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index fbdaabddb2..a20239bc32 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -123,6 +123,7 @@ func (s simpleContract) Deposit(auth *bind.TransactOpts, amount *big.Int) (*type if err != nil { return nil, err } + // check if we have sufficient balance balance, err := s.BalanceOf(nil, auth.From) if err != nil { return nil, err @@ -193,7 +194,6 @@ func (s simpleContract) BalanceOf(opts *bind.CallOpts, account common.Address) ( if err != nil { return nil, err } - // Check if we have sufficient balance balance, err := token.BalanceOf(opts, account) if err != nil { return nil, err From 0c130f52d16b1e315b1ee067ec789a211639c1c2 Mon Sep 17 00:00:00 2001 From: eknir Date: Fri, 22 Nov 2019 19:22:13 +0100 Subject: [PATCH 09/22] contracts/swap: replace Wei with ERC20-token --- contracts/swap/swap.go | 6 +++--- swap/prices.go | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index a20239bc32..21a818d753 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -44,13 +44,13 @@ type Backend interface { // Contract interface defines the methods exported from the underlying go-bindings for the smart contract type Contract interface { - // Withdraw attempts to withdraw Wei from the chequebook + // Withdraw attempts to withdraw ERC20-token from the chequebook Withdraw(auth *bind.TransactOpts, amount *big.Int) (*types.Receipt, error) // Deposit sends a raw transaction to the chequebook, triggering the fallback—depositing amount Deposit(auth *bind.TransactOpts, amout *big.Int) (*types.Receipt, error) // CashChequeBeneficiary cashes the cheque by the beneficiary CashChequeBeneficiary(auth *bind.TransactOpts, beneficiary common.Address, cumulativePayout *big.Int, ownerSig []byte) (*CashChequeResult, *types.Receipt, error) - // LiquidBalance returns the LiquidBalance (total balance in Wei - total hard deposits in Wei) of the chequebook + // LiquidBalance returns the LiquidBalance (total balance in ERC20-token - total hard deposits in ERC20-token) of the chequebook LiquidBalance(auth *bind.CallOpts) (*big.Int, error) //Token returns the address of the ERC20 contract, used by the chequebook Token(auth *bind.CallOpts) (common.Address, error) @@ -173,7 +173,7 @@ func (s simpleContract) CashChequeBeneficiary(opts *bind.TransactOpts, beneficia return result, receipt, nil } -// LiquidBalance returns the LiquidBalance (total balance in Wei - total hard deposits in Wei) of the chequebook +// LiquidBalance returns the LiquidBalance (total balance in ERC20-token - total hard deposits in ERC20-token) of the chequebook func (s simpleContract) LiquidBalance(opts *bind.CallOpts) (*big.Int, error) { return s.instance.LiquidBalance(opts) } diff --git a/swap/prices.go b/swap/prices.go index 7ab7db2ef3..60a1ec2240 100644 --- a/swap/prices.go +++ b/swap/prices.go @@ -32,6 +32,7 @@ but it could potentially be any currency the oracle and Swarm support, allowing for a multi-currency design. */ +//TODO: this calculations make little sense now, after update to ERC20-enabled chequebook // Placeholder prices // Based on a very crude calculation: average monthly cost for bandwidth in the US / average monthly usage of bandwidth in the US // $67 / 190GB = $0.35 / GB From e57aae304209f5f43269d369bd7c678f3ec1382e Mon Sep 17 00:00:00 2001 From: eknir Date: Fri, 22 Nov 2019 19:25:45 +0100 Subject: [PATCH 10/22] swap, contracts/swap: rename BalanceOf to BalanceAtTokenContract --- contracts/swap/swap.go | 10 +++++----- swap/swap.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index 21a818d753..67471fc5f2 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -54,8 +54,8 @@ type Contract interface { LiquidBalance(auth *bind.CallOpts) (*big.Int, error) //Token returns the address of the ERC20 contract, used by the chequebook Token(auth *bind.CallOpts) (common.Address, error) - //BalanceOf returns the balance of the account for the underlying ERC20 contract of the chequebook - BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) + //BalanceAtTokenContract returns the balance of the account for the underlying ERC20 contract of the chequebook + BalanceAtTokenContract(opts *bind.CallOpts, account common.Address) (*big.Int, error) // ContractParams returns contract info (e.g. deployed address) ContractParams() *Params // Issuer returns the contract owner from the blockchain @@ -124,7 +124,7 @@ func (s simpleContract) Deposit(auth *bind.TransactOpts, amount *big.Int) (*type return nil, err } // check if we have sufficient balance - balance, err := s.BalanceOf(nil, auth.From) + balance, err := s.BalanceAtTokenContract(nil, auth.From) if err != nil { return nil, err } @@ -183,8 +183,8 @@ func (s simpleContract) Token(opts *bind.CallOpts) (common.Address, error) { return s.instance.Token(opts) } -//BalanceOf returns the balance of the account for the underlying ERC20 contract of the chequebook -func (s simpleContract) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { +//BalanceAtTokenContract returns the balance of the account for the underlying ERC20 contract of the chequebook +func (s simpleContract) BalanceAtTokenContract(opts *bind.CallOpts, account common.Address) (*big.Int, error) { // get ERC20Instance at the address of token which is registered in the chequebook tokenAddress, err := s.Token(opts) if err != nil { diff --git a/swap/swap.go b/swap/swap.go index 51d10a2375..e5b85e4c67 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -586,7 +586,7 @@ func (s *Swap) promptDepositAmount() (*big.Int, error) { if err != nil { return nil, err } - balance, err := s.contract.BalanceOf(nil, s.owner.address) + balance, err := s.contract.BalanceAtTokenContract(nil, s.owner.address) if err != nil { return nil, err } From 318ed6f6b3a9028b2035d992f8e828d8ca531b88 Mon Sep 17 00:00:00 2001 From: eknir Date: Fri, 22 Nov 2019 19:31:39 +0100 Subject: [PATCH 11/22] swap: remove debug print, replace context.TODO() with context.Background() --- swap/swap.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/swap/swap.go b/swap/swap.go index e5b85e4c67..92070b02d7 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -599,7 +599,6 @@ func (s *Swap) promptDepositAmount() (*big.Int, error) { // ask user for input input, err := prompter.PromptInput(promptMessage) if err != nil { - log.Info("eknir") return big.NewInt(0), err } // check input @@ -625,7 +624,7 @@ func (s *Swap) StartChequebook(chequebookAddrFlag common.Address) (contract cont // nothing written to state disk before, no flag provided: deploying new chequebook if err == state.ErrNotFound && chequebookAddrFlag == (common.Address{}) { - if contract, err = s.Deploy(context.TODO()); err != nil { + if contract, err = s.Deploy(context.Background()); err != nil { return nil, err } if err := s.saveChequebook(contract.ContractParams().ContractAddress); err != nil { From a2269d942dbfafab9f5513c976915589b8daeafd Mon Sep 17 00:00:00 2001 From: eknir Date: Mon, 25 Nov 2019 10:47:51 +0100 Subject: [PATCH 12/22] cmd/swarm, swap: change initialDeposit to deposit --- cmd/swarm/config.go | 2 +- cmd/swarm/flags.go | 2 +- swap/config.go | 2 +- swap/swap.go | 3 +-- swap/swap_test.go | 12 ++++++------ 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index 6ab348043e..a7e44c6eae 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -66,7 +66,7 @@ const ( SwarmEnvNetworkID = "SWARM_NETWORK_ID" SwarmEnvChequebookAddr = "SWARM_CHEQUEBOOK_ADDR" SwarmEnvChequebookFactoryAddr = "SWARM_SWAP_CHEQUEBOOK_FACTORY_ADDR" - SwarmEnvInitialDeposit = "SWARM_INITIAL_DEPOSIT" + SwarmEnvSwapDeposit = "SWARM_SWAP_DEPOSIT" SwarmEnvSwapEnable = "SWARM_SWAP_ENABLE" SwarmEnvSwapBackendURL = "SWARM_SWAP_BACKEND_URL" SwarmEnvSwapPaymentThreshold = "SWARM_SWAP_PAYMENT_THRESHOLD" diff --git a/cmd/swarm/flags.go b/cmd/swarm/flags.go index 13c0194d1a..ed3a259d75 100644 --- a/cmd/swarm/flags.go +++ b/cmd/swarm/flags.go @@ -57,7 +57,7 @@ var ( SwarmSwapDepositFlag = cli.StringFlag{ Name: "swap-deposit", Usage: "Deposit amount for swap chequebook", - EnvVar: SwarmEnvInitialDeposit, + EnvVar: SwarmEnvSwapDeposit, } SwarmSwapChequebookAddrFlag = cli.StringFlag{ Name: "swap-chequebook", diff --git a/swap/config.go b/swap/config.go index a09c71bea7..e465bdbf44 100644 --- a/swap/config.go +++ b/swap/config.go @@ -27,7 +27,7 @@ const ( // DefaultPaymentThreshold is set to be equivalent to requesting and serving 10mb of data (2441 chunks (4096 bytes) = 10 mb, 10^7 bytes = 10 mb) DefaultPaymentThreshold = 2441*RetrieveRequestPrice + (10^7)*ChunkDeliveryPrice // 4096 * 2441 = 10 mb, DefaultDisconnectThreshold = 20 * DefaultPaymentThreshold - // DefaultInitialDepositAmount is the default amount to send to the contract when initially deploying + // DefaultDepositAmount is the default amount to send to the contract when initially deploying // NOTE: deliberate value for now; needs experimentation DefaultDepositAmount = 0 // This is the amount of time in seconds which an issuer has to wait to decrease the harddeposit of a beneficiary. diff --git a/swap/swap.go b/swap/swap.go index 92070b02d7..f9635978c3 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -593,8 +593,7 @@ func (s *Swap) promptDepositAmount() (*big.Int, error) { // log available balance and ERC20 balance swapLog.Info("Balance information", "chequebook available balance", availableBalance, "ERC20 balance", balance) promptMessage := fmt.Sprintf("Please provide the amount in HONEY which will deposited to your chequebook: ") - // need to prompt user for initial deposit amount - // if 0, can not cash in cheques + // need to prompt user for deposit amount prompter := console.Stdin // ask user for input input, err := prompter.PromptInput(promptMessage) diff --git a/swap/swap_test.go b/swap/swap_test.go index 6e84ad1302..7c02c85cdd 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -317,7 +317,7 @@ func TestNewSwapFailure(t *testing.T) { params := newDefaultParams(t) chequebookAddress := testChequeContract - InitialDeposit := uint64(1) + Deposit := uint64(1) type testSwapConfig struct { dbPath string @@ -325,7 +325,7 @@ func TestNewSwapFailure(t *testing.T) { backendURL string params *Params chequebookAddress common.Address - initialDeposit uint64 + deposit uint64 factoryAddress common.Address } @@ -344,7 +344,7 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL = "" config.params = params config.chequebookAddress = chequebookAddress - config.initialDeposit = InitialDeposit + config.deposit = Deposit config.factoryAddress = testBackend.factoryAddress }, check: func(t *testing.T, config *testSwapConfig) { @@ -355,7 +355,7 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL, config.params, config.chequebookAddress, - config.initialDeposit, + config.deposit, config.factoryAddress, ) if !strings.Contains(err.Error(), "no backend URL given") { @@ -379,7 +379,7 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL, config.params, config.chequebookAddress, - config.initialDeposit, + config.deposit, config.factoryAddress, ) if !strings.Contains(err.Error(), "disconnect threshold lower or at payment threshold") { @@ -403,7 +403,7 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL, config.params, config.chequebookAddress, - config.initialDeposit, + config.deposit, config.factoryAddress, ) if !strings.Contains(err.Error(), "error connecting to Ethereum API") { From 9222fcf6982c413755e321d169148999d8a9e1e4 Mon Sep 17 00:00:00 2001 From: eknir Date: Mon, 25 Nov 2019 12:21:15 +0100 Subject: [PATCH 13/22] api/config, cmd/swarm, swap: rename flag swap-deposit to swap-deposit-amount, add flag no-deposit added test --- api/config.go | 6 ++++-- cmd/swarm/config.go | 11 ++++++++--- cmd/swarm/flags.go | 11 ++++++++--- cmd/swarm/main.go | 3 ++- swap/swap.go | 33 ++++++++++++++++++++++++--------- swap/swap_test.go | 32 +++++++++++++++++++++++++++++++- swarm.go | 3 ++- 7 files changed, 79 insertions(+), 20 deletions(-) diff --git a/api/config.go b/api/config.go index 53a3ffe05b..e518d1a1dc 100644 --- a/api/config.go +++ b/api/config.go @@ -57,7 +57,8 @@ type Config struct { SwapEnabled bool // whether SWAP incentives are enabled SwapPaymentThreshold uint64 // honey amount at which a payment is triggered SwapDisconnectThreshold uint64 // honey amount at which a peer disconnects - SwapDeposit uint64 // deposit amount to the chequebook + SwapNoDeposit bool // do not ask the user to deposit during boot sequence + SwapDepositAmount uint64 // deposit amount to the chequebook SwapLogPath string // dir to swap related audit logs Contract common.Address // address of the chequebook contract SwapChequebookFactory common.Address // address of the chequebook factory contract @@ -96,7 +97,8 @@ func NewConfig() *Config { FileStoreParams: storage.NewFileStoreParams(), SwapBackendURL: "", SwapEnabled: false, - SwapDeposit: swap.DefaultDepositAmount, + SwapNoDeposit: false, + SwapDepositAmount: swap.DefaultDepositAmount, SwapPaymentThreshold: swap.DefaultPaymentThreshold, SwapDisconnectThreshold: swap.DefaultDisconnectThreshold, SwapLogPath: "", diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index a7e44c6eae..3ca16bc5de 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -66,7 +66,8 @@ const ( SwarmEnvNetworkID = "SWARM_NETWORK_ID" SwarmEnvChequebookAddr = "SWARM_CHEQUEBOOK_ADDR" SwarmEnvChequebookFactoryAddr = "SWARM_SWAP_CHEQUEBOOK_FACTORY_ADDR" - SwarmEnvSwapDeposit = "SWARM_SWAP_DEPOSIT" + SwarmEnvSwapNoDeposit = "SWARM_SWAP_NO_DEPOSIT" + SwarmEnvSwapDepositAmount = "SWARM_SWAP_DEPOSIT_AMOUNT" SwarmEnvSwapEnable = "SWARM_SWAP_ENABLE" SwarmEnvSwapBackendURL = "SWARM_SWAP_BACKEND_URL" SwarmEnvSwapPaymentThreshold = "SWARM_SWAP_PAYMENT_THRESHOLD" @@ -212,8 +213,12 @@ func flagsOverride(currentConfig *bzzapi.Config, ctx *cli.Context) *bzzapi.Confi if swapLogPath := ctx.GlobalString(SwarmSwapLogPathFlag.Name); currentConfig.SwapEnabled && swapLogPath != "" { currentConfig.SwapLogPath = swapLogPath } - if initialDepo := ctx.GlobalUint64(SwarmSwapDepositFlag.Name); initialDepo != 0 { - currentConfig.SwapDeposit = initialDepo + + if noDeposit := ctx.GlobalBool(SwarmSwapNoDepositFlag.Name); noDeposit { + currentConfig.SwapNoDeposit = true + } + if initialDepo := ctx.GlobalUint64(SwarmSwapDepositAmountFlag.Name); initialDepo != 0 { + currentConfig.SwapDepositAmount = initialDepo } if paymentThreshold := ctx.GlobalUint64(SwarmSwapPaymentThresholdFlag.Name); paymentThreshold != 0 { currentConfig.SwapPaymentThreshold = paymentThreshold diff --git a/cmd/swarm/flags.go b/cmd/swarm/flags.go index ed3a259d75..894ca3ecc2 100644 --- a/cmd/swarm/flags.go +++ b/cmd/swarm/flags.go @@ -54,10 +54,15 @@ var ( Value: network.DefaultNetworkID, EnvVar: SwarmEnvNetworkID, } - SwarmSwapDepositFlag = cli.StringFlag{ - Name: "swap-deposit", + SwarmSwapDepositAmountFlag = cli.StringFlag{ + Name: "swap-deposit-amount", Usage: "Deposit amount for swap chequebook", - EnvVar: SwarmEnvSwapDeposit, + EnvVar: SwarmEnvSwapDepositAmount, + } + SwarmSwapNoDepositFlag = cli.BoolFlag{ + Name: "swap-no-deposit", + Usage: "Don't deposit during boot sequence", + EnvVar: SwarmEnvSwapNoDeposit, } SwarmSwapChequebookAddrFlag = cli.StringFlag{ Name: "swap-chequebook", diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 6d30bf73a4..5d44f3590a 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -185,7 +185,8 @@ func init() { SwarmSwapLogPathFlag, SwarmSwapChequebookAddrFlag, SwarmSwapChequebookFactoryFlag, - SwarmSwapDepositFlag, + SwarmSwapNoDepositFlag, + SwarmSwapDepositAmountFlag, // end of swap flags SwarmNoSyncFlag, SwarmSyncUpdateDelay, diff --git a/swap/swap.go b/swap/swap.go index f9635978c3..ff8341f18a 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -43,6 +43,7 @@ import ( // ErrInvalidChequeSignature indicates the signature on the cheque was invalid var ErrInvalidChequeSignature = errors.New("invalid cheque signature") +var ErrNoDeposit = errors.New("swap-deposit-amount non-zero, but swap-no-deposit true") var swapLog log.Logger // logger for Swap related messages and audit trail const swapLogLevel = 3 // swapLogLevel indicates filter level of log messages @@ -149,13 +150,17 @@ func newSwapInstance(stateStore state.Store, owner *Owner, backend contract.Back // - connects to the blockchain backend; // - verifies that we have not connected SWAP before on a different blockchain backend; // - starts the chequebook; creates the swap instance -func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Params, chequebookAddressFlag common.Address, depositAmountFlag uint64, factoryAddress common.Address) (swap *Swap, err error) { +func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Params, chequebookAddressFlag common.Address, noDepositFlag bool, depositAmountFlag uint64, factoryAddress common.Address) (swap *Swap, err error) { // swap log for auditing purposes swapLog = newSwapLogger(params.LogPath, params.OverlayAddr) // verify that backendURL is not empty if backendURL == "" { return nil, errors.New("no backend URL given") } + // verify that depositAmountFlag and noDeposit are not conflicting + if depositAmountFlag > 0 && noDepositFlag { + return nil, ErrNoDeposit + } swapLog.Info("connecting to SWAP API", "url", backendURL) // initialize the balances store var stateStore state.Store @@ -202,16 +207,26 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par if swap.contract, err = swap.StartChequebook(chequebookAddressFlag); err != nil { return nil, err } - var toDeposit = big.NewInt(int64(depositAmountFlag)) - if depositAmountFlag == 0 { - toDeposit, err = swap.promptDepositAmount() - if err != nil { - return nil, err + + // deposit money in the chequebook if desired + if !noDepositFlag { + // prompt the user for a depositAmount + var toDeposit = big.NewInt(int64(depositAmountFlag)) + if toDeposit.Cmp(big.NewInt(0)) == 0 { + toDeposit, err = swap.promptDepositAmount() + if err != nil { + return nil, err + } } + // deposit if toDeposit is bigger than zero + if toDeposit.Cmp(big.NewInt(0)) > 0 { + if err := swap.Deposit(context.TODO(), toDeposit); err != nil { + return nil, err + } + } + } - if err := swap.Deposit(context.TODO(), toDeposit); err != nil { - swapLog.Warn("Could not deposit tokens into the chequebook", "error", err) - } + return swap, nil } diff --git a/swap/swap_test.go b/swap/swap_test.go index 7c02c85cdd..2003d46405 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -325,6 +325,7 @@ func TestNewSwapFailure(t *testing.T) { backendURL string params *Params chequebookAddress common.Address + noDeposit bool deposit uint64 factoryAddress common.Address } @@ -348,13 +349,13 @@ func TestNewSwapFailure(t *testing.T) { config.factoryAddress = testBackend.factoryAddress }, check: func(t *testing.T, config *testSwapConfig) { - defer os.RemoveAll(config.dbPath) _, err := New( config.dbPath, config.prvkey, config.backendURL, config.params, config.chequebookAddress, + config.noDeposit, config.deposit, config.factoryAddress, ) @@ -379,6 +380,7 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL, config.params, config.chequebookAddress, + config.noDeposit, config.deposit, config.factoryAddress, ) @@ -387,12 +389,39 @@ func TestNewSwapFailure(t *testing.T) { } }, }, + { + name: "no deposit and given deposit amount", + configure: func(config *testSwapConfig) { + config.params = newDefaultParams(t) + config.chequebookAddress = chequebookAddress + config.noDeposit = true + config.deposit = Deposit + config.factoryAddress = testBackend.factoryAddress + }, + check: func(t *testing.T, config *testSwapConfig) { + defer os.RemoveAll(config.dbPath) + _, err := New( + config.dbPath, + config.prvkey, + config.backendURL, + config.params, + config.chequebookAddress, + config.noDeposit, + config.deposit, + config.factoryAddress, + ) + if !strings.Contains(err.Error(), ErrNoDeposit.Error()) { + t.Fatal("NoDeposit true and non-zero depositAmount, but created SWAP", err) + } + }, + }, { name: "invalid backendURL", configure: func(config *testSwapConfig) { config.prvkey = prvKey config.backendURL = "invalid backendURL" params.PaymentThreshold = int64(DefaultPaymentThreshold) + config.noDeposit = false config.factoryAddress = testBackend.factoryAddress }, check: func(t *testing.T, config *testSwapConfig) { @@ -403,6 +432,7 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL, config.params, config.chequebookAddress, + config.noDeposit, config.deposit, config.factoryAddress, ) diff --git a/swarm.go b/swarm.go index 8bbd6fbb91..4cf831c303 100644 --- a/swarm.go +++ b/swarm.go @@ -136,7 +136,8 @@ func NewSwarm(config *api.Config, mockStore *mock.NodeStore) (self *Swarm, err e self.config.SwapBackendURL, swapParams, self.config.Contract, - self.config.SwapDeposit, + self.config.SwapNoDeposit, + self.config.SwapDepositAmount, self.config.SwapChequebookFactory, ) if err != nil { From 64fee909b259e0124df9dfb0eb28ddbe5f3458e4 Mon Sep 17 00:00:00 2001 From: eknir Date: Wed, 27 Nov 2019 16:40:05 +0100 Subject: [PATCH 14/22] swap, contracts/swap: more elaborate comments remove big.NewInt(0) --- contracts/swap/swap.go | 3 ++- swap/swap.go | 12 +++++++----- swap/swap_test.go | 6 ++++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index 67471fc5f2..696f55eed1 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -111,7 +111,8 @@ func (s simpleContract) Withdraw(auth *bind.TransactOpts, amount *big.Int) (*typ // Deposit sends an amount in ERC20 token to the chequebook and blocks until the transaction is mined func (s simpleContract) Deposit(auth *bind.TransactOpts, amount *big.Int) (*types.Receipt, error) { - if amount.Cmp(big.NewInt(0)) == 0 { + var zero big.Int + if amount.Cmp(&zero) == 0 { return nil, fmt.Errorf("Deposit amount cannot be equal to zero") } // get ERC20Instance at the address of token which is registered in the chequebook diff --git a/swap/swap.go b/swap/swap.go index ff8341f18a..70c008033a 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -212,14 +212,15 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par if !noDepositFlag { // prompt the user for a depositAmount var toDeposit = big.NewInt(int64(depositAmountFlag)) - if toDeposit.Cmp(big.NewInt(0)) == 0 { + var zero big.Int + if toDeposit.Cmp(&zero) == 0 { toDeposit, err = swap.promptDepositAmount() if err != nil { return nil, err } } // deposit if toDeposit is bigger than zero - if toDeposit.Cmp(big.NewInt(0)) > 0 { + if toDeposit.Cmp(&zero) > 0 { if err := swap.Deposit(context.TODO(), toDeposit); err != nil { return nil, err } @@ -612,19 +613,20 @@ func (s *Swap) promptDepositAmount() (*big.Int, error) { prompter := console.Stdin // ask user for input input, err := prompter.PromptInput(promptMessage) + var zero big.Int if err != nil { - return big.NewInt(0), err + return &zero, err } // check input val, err := strconv.ParseInt(input, 10, 64) if err != nil { // maybe we should provide a fallback here? A bad input results in stopping the boot - return big.NewInt(0), fmt.Errorf("Conversion error while reading user input: %v", err) + return &zero, fmt.Errorf("Conversion error while reading user input: %v", err) } return big.NewInt(val), nil } -// StartChequebook starts the chequebook, taking into account the chequebookAddress passed in by the user and the chequebook addresses saved on the node's database +// StartChequebook starts the chequebook, takingV into account the chequebookAddress passed in by the user and the chequebook addresses saved on the node's database func (s *Swap) StartChequebook(chequebookAddrFlag common.Address) (contract contract.Contract, err error) { previouslyUsedChequebook, err := s.loadChequebook() // error reading from disk diff --git a/swap/swap_test.go b/swap/swap_test.go index 2003d46405..a3001d2238 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -113,12 +113,16 @@ func newTestBackend() *swapTestBackend { // commit the initial "pre-mined" accounts (issuer and beneficiary addresses) defaultBackend.Commit() + // deploy the ERC20-contract + // ignore receipt because if there is no error, we can assume everything is fine on a simulated backend tokenAddress, _, token, err := contractFactory.DeployERC20Mintable(bind.NewKeyedTransactor(ownerKey), defaultBackend) if err != nil { log.Crit(err.Error()) } defaultBackend.Commit() + // mint 1000000000000000000 ERC20-tokens + // ignore receipt because if there is no error, we can assume everything is fine on a simulated backend _, err = token.Mint(bind.NewKeyedTransactor(ownerKey), ownerAddress, big.NewInt(1000000000000000000)) if err != nil { log.Crit(err.Error()) @@ -126,6 +130,8 @@ func newTestBackend() *swapTestBackend { defaultBackend.Commit() // deploy a SimpleSwapFactoy + // ignore receipt because if there is no error, we can assume everything is fine on a simulated backend + // ignore factory instance, because the address is all we need at this point factoryAddress, _, _, err := contractFactory.DeploySimpleSwapFactory(bind.NewKeyedTransactor(ownerKey), defaultBackend, tokenAddress) if err != nil { log.Crit(err.Error()) From 00995da7d1aa4d74fe36bad9555659f04077cb85 Mon Sep 17 00:00:00 2001 From: eknir Date: Wed, 27 Nov 2019 17:23:41 +0100 Subject: [PATCH 15/22] swap: add t to newTestBackend --- swap/protocol_test.go | 4 ++-- swap/swap_test.go | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/swap/protocol_test.go b/swap/protocol_test.go index 596868ee7c..e9003668e3 100644 --- a/swap/protocol_test.go +++ b/swap/protocol_test.go @@ -220,7 +220,7 @@ func TestHandshakeInvalidContract(t *testing.T) { // A second swap instance is created for easy creation of a chequebook contract which is deployed to the simulated backend // We send a EmitChequeMsg to the creditor which handles the cheque and sends a ConfirmChequeMsg func TestEmitCheque(t *testing.T) { - testBackend := newTestBackend() + testBackend := newTestBackend(t) protocolTester, clean, err := newSwapTester(t, testBackend) defer clean() if err != nil { @@ -326,7 +326,7 @@ func TestEmitCheque(t *testing.T) { // One protocol tester is created and then Add with a value above the payment threshold is called for another node // we expect a EmitChequeMsg to be sent, then we send a ConfirmChequeMsg to the swap instance func TestTriggerPaymentThreshold(t *testing.T) { - testBackend := newTestBackend() + testBackend := newTestBackend(t) log.Debug("create test swap") protocolTester, clean, err := newSwapTester(t, testBackend) defer clean() diff --git a/swap/swap_test.go b/swap/swap_test.go index a3001d2238..68cba25702 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -109,7 +109,8 @@ var defaultBackend = backends.NewSimulatedBackend(core.GenesisAlloc{ }, 8000000) // newTestBackend creates a new test backend instance -func newTestBackend() *swapTestBackend { +func newTestBackend(t *testing.T) *swapTestBackend { + t.Helper() // commit the initial "pre-mined" accounts (issuer and beneficiary addresses) defaultBackend.Commit() @@ -117,7 +118,7 @@ func newTestBackend() *swapTestBackend { // ignore receipt because if there is no error, we can assume everything is fine on a simulated backend tokenAddress, _, token, err := contractFactory.DeployERC20Mintable(bind.NewKeyedTransactor(ownerKey), defaultBackend) if err != nil { - log.Crit(err.Error()) + t.Fatal(err) } defaultBackend.Commit() @@ -125,7 +126,7 @@ func newTestBackend() *swapTestBackend { // ignore receipt because if there is no error, we can assume everything is fine on a simulated backend _, err = token.Mint(bind.NewKeyedTransactor(ownerKey), ownerAddress, big.NewInt(1000000000000000000)) if err != nil { - log.Crit(err.Error()) + t.Fatal(err) } defaultBackend.Commit() @@ -134,7 +135,7 @@ func newTestBackend() *swapTestBackend { // ignore factory instance, because the address is all we need at this point factoryAddress, _, _, err := contractFactory.DeploySimpleSwapFactory(bind.NewKeyedTransactor(ownerKey), defaultBackend, tokenAddress) if err != nil { - log.Crit(err.Error()) + t.Fatal(err) } defaultBackend.Commit() @@ -292,7 +293,7 @@ func TestRepeatedBookings(t *testing.T) { //TestNewSwapFailure attempts to initialze SWAP with (a combination of) parameters which are not allowed. The test checks whether there are indeed failures func TestNewSwapFailure(t *testing.T) { - testBackend := newTestBackend() + testBackend := newTestBackend(t) defer testBackend.Close() dir, err := ioutil.TempDir("", "swarmSwap") if err != nil { @@ -531,7 +532,7 @@ func TestStartChequebookFailure(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - testBackend := newTestBackend() + testBackend := newTestBackend(t) defer testBackend.Close() tc.configure(&config) config.testBackend = testBackend @@ -600,7 +601,7 @@ func TestStartChequebookSuccess(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - testBackend := newTestBackend() + testBackend := newTestBackend(t) defer testBackend.Close() if tc.check != nil { tc.check(t, testBackend) @@ -661,7 +662,7 @@ func TestPaymentThreshold(t *testing.T) { // `handleEmitChequeMsg` in order to simulate a roundtrip // and see that both have reset the balance correctly func TestResetBalance(t *testing.T) { - testBackend := newTestBackend() + testBackend := newTestBackend(t) defer testBackend.Close() // create both test swap accounts creditorSwap, clean1 := newTestSwap(t, beneficiaryKey, testBackend) @@ -816,7 +817,7 @@ func calculateExpectedBalances(swap *Swap, bookings []booking) map[enode.ID]int6 // Then we re-open the state store and check that // the balance is still the same func TestRestoreBalanceFromStateStore(t *testing.T) { - testBackend := newTestBackend() + testBackend := newTestBackend(t) defer testBackend.Close() // create a test swap account @@ -918,7 +919,7 @@ func newTestSwap(t *testing.T, key *ecdsa.PrivateKey, backend *swapTestBackend) t.Helper() usedBackend := backend if backend == nil { - usedBackend = newTestBackend() + usedBackend = newTestBackend(t) } swap, dir := newBaseTestSwap(t, key, usedBackend) clean := func() { @@ -1143,7 +1144,7 @@ func TestFactoryAddressForNetwork(t *testing.T) { // TestFactoryVerifySelf tests that it returns no error for a real factory // and expects errors for a different contract or no contract func TestFactoryVerifySelf(t *testing.T) { - testBackend := newTestBackend() + testBackend := newTestBackend(t) defer testBackend.Close() factory, err := cswap.FactoryAt(testBackend.factoryAddress, testBackend) @@ -1532,7 +1533,7 @@ func TestSwapLogToFile(t *testing.T) { params := newDefaultParams(t) params.LogPath = logDirDebitor - testBackend := newTestBackend() + testBackend := newTestBackend(t) defer testBackend.Close() // create both test swap accounts creditorSwap, storeDirCreditor := newBaseTestSwap(t, beneficiaryKey, testBackend) @@ -1627,7 +1628,7 @@ func TestPeerGetLastSentCumulativePayout(t *testing.T) { } func TestAvailableBalance(t *testing.T) { - testBackend := newTestBackend() + testBackend := newTestBackend(t) defer testBackend.Close() swap, clean := newTestSwap(t, ownerKey, testBackend) defer clean() From a60c2a51300bddb801a690d7d8bfdd1bd3f553f5 Mon Sep 17 00:00:00 2001 From: eknir Date: Wed, 27 Nov 2019 17:29:21 +0100 Subject: [PATCH 16/22] rename noDepsit to skipDeposit --- api/config.go | 4 ++-- cmd/swarm/config.go | 6 +++--- cmd/swarm/flags.go | 6 +++--- cmd/swarm/main.go | 2 +- swap/swap.go | 12 ++++++------ swap/swap_test.go | 18 +++++++++--------- swarm.go | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/api/config.go b/api/config.go index e518d1a1dc..cd3f352e1c 100644 --- a/api/config.go +++ b/api/config.go @@ -57,7 +57,7 @@ type Config struct { SwapEnabled bool // whether SWAP incentives are enabled SwapPaymentThreshold uint64 // honey amount at which a payment is triggered SwapDisconnectThreshold uint64 // honey amount at which a peer disconnects - SwapNoDeposit bool // do not ask the user to deposit during boot sequence + SwapSkipDeposit bool // do not ask the user to deposit during boot sequence SwapDepositAmount uint64 // deposit amount to the chequebook SwapLogPath string // dir to swap related audit logs Contract common.Address // address of the chequebook contract @@ -97,7 +97,7 @@ func NewConfig() *Config { FileStoreParams: storage.NewFileStoreParams(), SwapBackendURL: "", SwapEnabled: false, - SwapNoDeposit: false, + SwapSkipDeposit: false, SwapDepositAmount: swap.DefaultDepositAmount, SwapPaymentThreshold: swap.DefaultPaymentThreshold, SwapDisconnectThreshold: swap.DefaultDisconnectThreshold, diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index 3ca16bc5de..d267804ca6 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -66,7 +66,7 @@ const ( SwarmEnvNetworkID = "SWARM_NETWORK_ID" SwarmEnvChequebookAddr = "SWARM_CHEQUEBOOK_ADDR" SwarmEnvChequebookFactoryAddr = "SWARM_SWAP_CHEQUEBOOK_FACTORY_ADDR" - SwarmEnvSwapNoDeposit = "SWARM_SWAP_NO_DEPOSIT" + SwarmEnvSwapSkipDeposit = "SWARM_SWAP_SKIP_DEPOSIT" SwarmEnvSwapDepositAmount = "SWARM_SWAP_DEPOSIT_AMOUNT" SwarmEnvSwapEnable = "SWARM_SWAP_ENABLE" SwarmEnvSwapBackendURL = "SWARM_SWAP_BACKEND_URL" @@ -214,8 +214,8 @@ func flagsOverride(currentConfig *bzzapi.Config, ctx *cli.Context) *bzzapi.Confi currentConfig.SwapLogPath = swapLogPath } - if noDeposit := ctx.GlobalBool(SwarmSwapNoDepositFlag.Name); noDeposit { - currentConfig.SwapNoDeposit = true + if skipDeposit := ctx.GlobalBool(SwarmSwapSkipDepositFlag.Name); skipDeposit { + currentConfig.SwapSkipDeposit = true } if initialDepo := ctx.GlobalUint64(SwarmSwapDepositAmountFlag.Name); initialDepo != 0 { currentConfig.SwapDepositAmount = initialDepo diff --git a/cmd/swarm/flags.go b/cmd/swarm/flags.go index 894ca3ecc2..d16d2a248b 100644 --- a/cmd/swarm/flags.go +++ b/cmd/swarm/flags.go @@ -59,10 +59,10 @@ var ( Usage: "Deposit amount for swap chequebook", EnvVar: SwarmEnvSwapDepositAmount, } - SwarmSwapNoDepositFlag = cli.BoolFlag{ - Name: "swap-no-deposit", + SwarmSwapSkipDepositFlag = cli.BoolFlag{ + Name: "swap-skip-deposit", Usage: "Don't deposit during boot sequence", - EnvVar: SwarmEnvSwapNoDeposit, + EnvVar: SwarmEnvSwapSkipDeposit, } SwarmSwapChequebookAddrFlag = cli.StringFlag{ Name: "swap-chequebook", diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 5d44f3590a..993d674e8f 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -185,7 +185,7 @@ func init() { SwarmSwapLogPathFlag, SwarmSwapChequebookAddrFlag, SwarmSwapChequebookFactoryFlag, - SwarmSwapNoDepositFlag, + SwarmSwapSkipDepositFlag, SwarmSwapDepositAmountFlag, // end of swap flags SwarmNoSyncFlag, diff --git a/swap/swap.go b/swap/swap.go index 70c008033a..378455baaf 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -43,7 +43,7 @@ import ( // ErrInvalidChequeSignature indicates the signature on the cheque was invalid var ErrInvalidChequeSignature = errors.New("invalid cheque signature") -var ErrNoDeposit = errors.New("swap-deposit-amount non-zero, but swap-no-deposit true") +var ErrskipDeposit = errors.New("swap-deposit-amount non-zero, but swap-skip-deposit true") var swapLog log.Logger // logger for Swap related messages and audit trail const swapLogLevel = 3 // swapLogLevel indicates filter level of log messages @@ -150,16 +150,16 @@ func newSwapInstance(stateStore state.Store, owner *Owner, backend contract.Back // - connects to the blockchain backend; // - verifies that we have not connected SWAP before on a different blockchain backend; // - starts the chequebook; creates the swap instance -func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Params, chequebookAddressFlag common.Address, noDepositFlag bool, depositAmountFlag uint64, factoryAddress common.Address) (swap *Swap, err error) { +func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Params, chequebookAddressFlag common.Address, skipDepositFlag bool, depositAmountFlag uint64, factoryAddress common.Address) (swap *Swap, err error) { // swap log for auditing purposes swapLog = newSwapLogger(params.LogPath, params.OverlayAddr) // verify that backendURL is not empty if backendURL == "" { return nil, errors.New("no backend URL given") } - // verify that depositAmountFlag and noDeposit are not conflicting - if depositAmountFlag > 0 && noDepositFlag { - return nil, ErrNoDeposit + // verify that depositAmountFlag and skipDeposit are not conflicting + if depositAmountFlag > 0 && skipDepositFlag { + return nil, ErrskipDeposit } swapLog.Info("connecting to SWAP API", "url", backendURL) // initialize the balances store @@ -209,7 +209,7 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par } // deposit money in the chequebook if desired - if !noDepositFlag { + if !skipDepositFlag { // prompt the user for a depositAmount var toDeposit = big.NewInt(int64(depositAmountFlag)) var zero big.Int diff --git a/swap/swap_test.go b/swap/swap_test.go index 68cba25702..075af8fa50 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -332,7 +332,7 @@ func TestNewSwapFailure(t *testing.T) { backendURL string params *Params chequebookAddress common.Address - noDeposit bool + skipDeposit bool deposit uint64 factoryAddress common.Address } @@ -362,7 +362,7 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL, config.params, config.chequebookAddress, - config.noDeposit, + config.skipDeposit, config.deposit, config.factoryAddress, ) @@ -387,7 +387,7 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL, config.params, config.chequebookAddress, - config.noDeposit, + config.skipDeposit, config.deposit, config.factoryAddress, ) @@ -401,7 +401,7 @@ func TestNewSwapFailure(t *testing.T) { configure: func(config *testSwapConfig) { config.params = newDefaultParams(t) config.chequebookAddress = chequebookAddress - config.noDeposit = true + config.skipDeposit = true config.deposit = Deposit config.factoryAddress = testBackend.factoryAddress }, @@ -413,12 +413,12 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL, config.params, config.chequebookAddress, - config.noDeposit, + config.skipDeposit, config.deposit, config.factoryAddress, ) - if !strings.Contains(err.Error(), ErrNoDeposit.Error()) { - t.Fatal("NoDeposit true and non-zero depositAmount, but created SWAP", err) + if !strings.Contains(err.Error(), ErrskipDeposit.Error()) { + t.Fatal("skipDeposit true and non-zero depositAmount, but created SWAP", err) } }, }, @@ -428,7 +428,7 @@ func TestNewSwapFailure(t *testing.T) { config.prvkey = prvKey config.backendURL = "invalid backendURL" params.PaymentThreshold = int64(DefaultPaymentThreshold) - config.noDeposit = false + config.skipDeposit = false config.factoryAddress = testBackend.factoryAddress }, check: func(t *testing.T, config *testSwapConfig) { @@ -439,7 +439,7 @@ func TestNewSwapFailure(t *testing.T) { config.backendURL, config.params, config.chequebookAddress, - config.noDeposit, + config.skipDeposit, config.deposit, config.factoryAddress, ) diff --git a/swarm.go b/swarm.go index 4cf831c303..c58261af4e 100644 --- a/swarm.go +++ b/swarm.go @@ -136,7 +136,7 @@ func NewSwarm(config *api.Config, mockStore *mock.NodeStore) (self *Swarm, err e self.config.SwapBackendURL, swapParams, self.config.Contract, - self.config.SwapNoDeposit, + self.config.SwapSkipDeposit, self.config.SwapDepositAmount, self.config.SwapChequebookFactory, ) From 5f037d0fd84977e3ce46b78bc988878e57e0f0eb Mon Sep 17 00:00:00 2001 From: eknir Date: Wed, 27 Nov 2019 18:01:22 +0100 Subject: [PATCH 17/22] contracts/swap: update default factory address for Ropsten --- contracts/swap/factory.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/swap/factory.go b/contracts/swap/factory.go index bc72fd560f..cd029c6449 100644 --- a/contracts/swap/factory.go +++ b/contracts/swap/factory.go @@ -19,8 +19,7 @@ var ( // Deployments maps from network ids to deployed contract factories Deployments = map[uint64]common.Address{ // Ropsten - //TODO: update to point to an address with the new go-bindings - 3: common.HexToAddress("0x2e9C43E186eaF4fee10799d67e75f8CFc5BA3a0c"), + 3: common.HexToAddress("0x878Ccb2e3c2973767e431bAec86D1EFd809480d5"), } ) From 62059de4ae79dfa6f3b05d0fb6d68c7b78b06dfd Mon Sep 17 00:00:00 2001 From: eknir Date: Wed, 27 Nov 2019 18:36:38 +0100 Subject: [PATCH 18/22] swap: documentation to promptDepositAmount, log for skipping deposit, indicating in prompt that 0 means not depositing --- swap/swap.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/swap/swap.go b/swap/swap.go index 378455baaf..60d387b2a5 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -224,8 +224,9 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par if err := swap.Deposit(context.TODO(), toDeposit); err != nil { return nil, err } + } else { + swapLog.Info("Skipping deposit") } - } return swap, nil @@ -596,6 +597,7 @@ func (s *Swap) getContractOwner(ctx context.Context, address common.Address) (co return contr.Issuer(nil) } +// promptDepositAmount blocks and asks the user how much ERC20 he wants to deposit func (s *Swap) promptDepositAmount() (*big.Int, error) { // retrieve available balance availableBalance, err := s.AvailableBalance() @@ -608,7 +610,7 @@ func (s *Swap) promptDepositAmount() (*big.Int, error) { } // log available balance and ERC20 balance swapLog.Info("Balance information", "chequebook available balance", availableBalance, "ERC20 balance", balance) - promptMessage := fmt.Sprintf("Please provide the amount in HONEY which will deposited to your chequebook: ") + promptMessage := fmt.Sprintf("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 d78f18b0977f9eb9e36893c76c3e00c1691da0d6 Mon Sep 17 00:00:00 2001 From: eknir Date: Thu, 28 Nov 2019 10:22:56 +0100 Subject: [PATCH 19/22] swap: capitilization and comment ErrSkipDeposit --- swap/swap.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swap/swap.go b/swap/swap.go index 60d387b2a5..74d886a75c 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -43,7 +43,9 @@ import ( // ErrInvalidChequeSignature indicates the signature on the cheque was invalid var ErrInvalidChequeSignature = errors.New("invalid cheque signature") -var ErrskipDeposit = errors.New("swap-deposit-amount non-zero, but swap-skip-deposit true") + +//ErrSkipDeposit indicates that the users wants to deposit (swap-deposit-amount) and NOT wants to deposit (swap-skip-deposit) +var ErrSkipDeposit = errors.New("swap-deposit-amount non-zero, but swap-skip-deposit true") var swapLog log.Logger // logger for Swap related messages and audit trail const swapLogLevel = 3 // swapLogLevel indicates filter level of log messages From 152674d29d38c1ea4c5ed1338b0ae3c5e6ba4d63 Mon Sep 17 00:00:00 2001 From: eknir Date: Thu, 28 Nov 2019 10:25:39 +0100 Subject: [PATCH 20/22] swap: indentation --- swap/swap_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/swap_test.go b/swap/swap_test.go index 075af8fa50..ba668024f0 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -332,7 +332,7 @@ func TestNewSwapFailure(t *testing.T) { backendURL string params *Params chequebookAddress common.Address - skipDeposit bool + skipDeposit bool deposit uint64 factoryAddress common.Address } From 24855a173fdbb9e43d08333aa9957fca60792292 Mon Sep 17 00:00:00 2001 From: eknir Date: Mon, 2 Dec 2019 22:15:08 +0100 Subject: [PATCH 21/22] swap: small improvements --- cmd/swarm/config.go | 4 ++-- contracts/swap/swap.go | 3 +-- swap/swap.go | 14 ++++++-------- swap/swap_test.go | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index 43e3aaa20f..2b8c4da9ab 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -214,8 +214,8 @@ func flagsOverride(currentConfig *bzzapi.Config, ctx *cli.Context) *bzzapi.Confi if skipDeposit := ctx.GlobalBool(SwarmSwapSkipDepositFlag.Name); skipDeposit { currentConfig.SwapSkipDeposit = true } - if initialDepo := ctx.GlobalUint64(SwarmSwapDepositAmountFlag.Name); initialDepo != 0 { - currentConfig.SwapDepositAmount = initialDepo + if deposit := ctx.GlobalUint64(SwarmSwapDepositAmountFlag.Name); initialDepo != 0 { + currentConfig.SwapDepositAmount = deposit } if paymentThreshold := ctx.GlobalUint64(SwarmSwapPaymentThresholdFlag.Name); paymentThreshold != 0 { currentConfig.SwapPaymentThreshold = paymentThreshold diff --git a/contracts/swap/swap.go b/contracts/swap/swap.go index 696f55eed1..74134ea0eb 100644 --- a/contracts/swap/swap.go +++ b/contracts/swap/swap.go @@ -111,8 +111,7 @@ func (s simpleContract) Withdraw(auth *bind.TransactOpts, amount *big.Int) (*typ // Deposit sends an amount in ERC20 token to the chequebook and blocks until the transaction is mined func (s simpleContract) Deposit(auth *bind.TransactOpts, amount *big.Int) (*types.Receipt, error) { - var zero big.Int - if amount.Cmp(&zero) == 0 { + if amount.Cmp(&big.Int{}) == 0 { return nil, fmt.Errorf("Deposit amount cannot be equal to zero") } // get ERC20Instance at the address of token which is registered in the chequebook diff --git a/swap/swap.go b/swap/swap.go index 74d886a75c..1f6193b1a0 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -44,7 +44,7 @@ import ( // ErrInvalidChequeSignature indicates the signature on the cheque was invalid var ErrInvalidChequeSignature = errors.New("invalid cheque signature") -//ErrSkipDeposit indicates that the users wants to deposit (swap-deposit-amount) and NOT wants to deposit (swap-skip-deposit) +// ErrSkipDeposit indicates that the user has specified an amount to deposit (swap-deposit-amount) but also indicated that depositing should be skipped (swap-skip-deposit) var ErrSkipDeposit = errors.New("swap-deposit-amount non-zero, but swap-skip-deposit true") var swapLog log.Logger // logger for Swap related messages and audit trail @@ -161,7 +161,7 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par } // verify that depositAmountFlag and skipDeposit are not conflicting if depositAmountFlag > 0 && skipDepositFlag { - return nil, ErrskipDeposit + return nil, ErrSkipDeposit } swapLog.Info("connecting to SWAP API", "url", backendURL) // initialize the balances store @@ -214,8 +214,7 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par if !skipDepositFlag { // prompt the user for a depositAmount var toDeposit = big.NewInt(int64(depositAmountFlag)) - var zero big.Int - if toDeposit.Cmp(&zero) == 0 { + if toDeposit.Cmp(&big.Int{}) == 0 { toDeposit, err = swap.promptDepositAmount() if err != nil { return nil, err @@ -617,20 +616,19 @@ func (s *Swap) promptDepositAmount() (*big.Int, error) { prompter := console.Stdin // ask user for input input, err := prompter.PromptInput(promptMessage) - var zero big.Int if err != nil { - return &zero, err + return &big.Int{}, err } // check input val, err := strconv.ParseInt(input, 10, 64) if err != nil { // maybe we should provide a fallback here? A bad input results in stopping the boot - return &zero, fmt.Errorf("Conversion error while reading user input: %v", err) + return &big.Int{}, fmt.Errorf("Conversion error while reading user input: %v", err) } return big.NewInt(val), nil } -// StartChequebook starts the chequebook, takingV into account the chequebookAddress passed in by the user and the chequebook addresses saved on the node's database +// StartChequebook starts the chequebook, taking into account the chequebookAddress passed in by the user and the chequebook addresses saved on the node's database func (s *Swap) StartChequebook(chequebookAddrFlag common.Address) (contract contract.Contract, err error) { previouslyUsedChequebook, err := s.loadChequebook() // error reading from disk diff --git a/swap/swap_test.go b/swap/swap_test.go index ba668024f0..8282b98ba5 100644 --- a/swap/swap_test.go +++ b/swap/swap_test.go @@ -417,7 +417,7 @@ func TestNewSwapFailure(t *testing.T) { config.deposit, config.factoryAddress, ) - if !strings.Contains(err.Error(), ErrskipDeposit.Error()) { + if !strings.Contains(err.Error(), ErrSkipDeposit.Error()) { t.Fatal("skipDeposit true and non-zero depositAmount, but created SWAP", err) } }, From 2acd3b2aeed7d7c8e6285cea23ae923faaa4538a Mon Sep 17 00:00:00 2001 From: eknir Date: Tue, 3 Dec 2019 17:34:09 +0100 Subject: [PATCH 22/22] swap: last review Marcello --- cmd/swarm/config.go | 2 +- swap/swap.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index 99d7bd5ccc..cf1499dadb 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -215,7 +215,7 @@ func flagsOverride(currentConfig *bzzapi.Config, ctx *cli.Context) *bzzapi.Confi if skipDeposit := ctx.GlobalBool(SwarmSwapSkipDepositFlag.Name); skipDeposit { currentConfig.SwapSkipDeposit = true } - if deposit := ctx.GlobalUint64(SwarmSwapDepositAmountFlag.Name); initialDepo != 0 { + if deposit := ctx.GlobalUint64(SwarmSwapDepositAmountFlag.Name); deposit != 0 { currentConfig.SwapDepositAmount = deposit } if paymentThreshold := ctx.GlobalUint64(SwarmSwapPaymentThresholdFlag.Name); paymentThreshold != 0 { diff --git a/swap/swap.go b/swap/swap.go index 1f6193b1a0..d7bf34b346 100644 --- a/swap/swap.go +++ b/swap/swap.go @@ -221,7 +221,7 @@ func New(dbPath string, prvkey *ecdsa.PrivateKey, backendURL string, params *Par } } // deposit if toDeposit is bigger than zero - if toDeposit.Cmp(&zero) > 0 { + if toDeposit.Cmp(&big.Int{}) > 0 { if err := swap.Deposit(context.TODO(), toDeposit); err != nil { return nil, err }