decred.org/dcrdex@v1.0.3/dex/networks/erc20/contracts/v0/contract.go (about) 1 // Code generated - DO NOT EDIT. 2 // This file is a generated binding and any manual changes will be lost. 3 4 package v0 5 6 import ( 7 "errors" 8 "math/big" 9 "strings" 10 11 ethv0 "decred.org/dcrdex/dex/networks/eth/contracts/v0" 12 ethereum "github.com/ethereum/go-ethereum" 13 "github.com/ethereum/go-ethereum/accounts/abi" 14 "github.com/ethereum/go-ethereum/accounts/abi/bind" 15 "github.com/ethereum/go-ethereum/common" 16 "github.com/ethereum/go-ethereum/core/types" 17 "github.com/ethereum/go-ethereum/event" 18 ) 19 20 // Reference imports to suppress errors if they are not otherwise used. 21 var ( 22 _ = errors.New 23 _ = big.NewInt 24 _ = strings.NewReader 25 _ = ethereum.NotFound 26 _ = bind.Bind 27 _ = common.Big1 28 _ = types.BloomLookup 29 _ = event.NewSubscription 30 _ = abi.ConvertType 31 ) 32 33 // ERC20SwapMetaData contains all meta data concerning the ERC20Swap contract. 34 var ERC20SwapMetaData = &bind.MetaData{ 35 ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"refundTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"participant\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"internalType\":\"structERC20Swap.Initiation[]\",\"name\":\"initiations\",\"type\":\"tuple[]\"}],\"name\":\"initiate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"}],\"name\":\"isRefundable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"secret\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"}],\"internalType\":\"structERC20Swap.Redemption[]\",\"name\":\"redemptions\",\"type\":\"tuple[]\"}],\"name\":\"redeem\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"}],\"name\":\"refund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"secretHash\",\"type\":\"bytes32\"}],\"name\":\"swap\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"secret\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"refundBlockTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initiator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"participant\",\"type\":\"address\"},{\"internalType\":\"enumERC20Swap.State\",\"name\":\"state\",\"type\":\"uint8\"}],\"internalType\":\"structERC20Swap.Swap\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"swaps\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"secret\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"refundBlockTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initiator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"participant\",\"type\":\"address\"},{\"internalType\":\"enumERC20Swap.State\",\"name\":\"state\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token_address\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", 36 Bin: "0x60a060405234801561001057600080fd5b50604051610e92380380610e9283398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b608051610df361009f6000396000818160c50152818161029b0152818161066b01526109f30152610df36000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063a8793f941161005b578063a8793f94146100ff578063d0f761c014610112578063eb84e7f214610135578063f4fd17f9146101a457600080fd5b80637249fbb61461008257806376467cbd146100975780638c8e8fee146100c0575b600080fd5b610095610090366004610ac8565b6101b7565b005b6100aa6100a5366004610ac8565b610376565b6040516100b79190610b19565b60405180910390f35b6100e77f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100b7565b61009561010d366004610b7e565b610451565b610125610120366004610ac8565b61074c565b60405190151581526020016100b7565b610191610143366004610ac8565b60006020819052908152604090208054600182015460028301546003840154600485015460059095015493949293919290916001600160a01b0391821691811690600160a01b900460ff1687565b6040516100b79796959493929190610bf3565b6100956101b2366004610c3f565b6107ac565b3233146101df5760405162461bcd60e51b81526004016101d690610ca2565b60405180910390fd5b6101e88161074c565b6102255760405162461bcd60e51b815260206004820152600e60248201526d6e6f7420726566756e6461626c6560901b60448201526064016101d6565b60008181526020818152604080832060058101805460ff60a01b1916600360a01b17905560018101548251336024820152604480820192909252835180820390920182526064018352928301805163a9059cbb60e01b6001600160e01b0390911617905290519092916060916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916102c591610ccc565b6000604051808303816000865af19150503d8060008114610302576040519150601f19603f3d011682016040523d82523d6000602084013e610307565b606091505b5090925090508180156103325750805115806103325750808060200190518101906103329190610cfb565b6103705760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b60448201526064016101d6565b50505050565b6103b36040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529060c082015290565b60008281526020818152604091829020825160e08101845281548152600182015492810192909252600281015492820192909252600380830154606083015260048301546001600160a01b039081166080840152600584015490811660a084015291929160c0840191600160a01b90910460ff169081111561043757610437610ae1565b600381111561044857610448610ae1565b90525092915050565b3233146104705760405162461bcd60e51b81526004016101d690610ca2565b6000805b82811015610615573684848381811061048f5761048f610d1d565b9050608002019050600080600083602001358152602001908152602001600020905060008260600135116104ed5760405162461bcd60e51b81526020600482015260056024820152640c081d985b60da1b60448201526064016101d6565b813561052f5760405162461bcd60e51b815260206004820152601160248201527003020726566756e6454696d657374616d7607c1b60448201526064016101d6565b60006005820154600160a01b900460ff16600381111561055157610551610ae1565b146105905760405162461bcd60e51b815260206004820152600f60248201526e0c8eae040e6cac6e4cae840d0c2e6d608b1b60448201526064016101d6565b436002820155813560038201556004810180546001600160a01b031916331790556105c16060830160408401610d33565b6005820180546060850135600185018190556001600160a01b03939093166001600160a81b031990911617600160a01b1790556105fe9085610d72565b93505050808061060d90610d8b565b915050610474565b5060408051336024820152306044820152606480820184905282518083039091018152608490910182526020810180516001600160e01b03166323b872dd60e01b17905290516000916060916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169161069591610ccc565b6000604051808303816000865af19150503d80600081146106d2576040519150601f19603f3d011682016040523d82523d6000602084013e6106d7565b606091505b5090925090508180156107025750805115806107025750808060200190518101906107029190610cfb565b6107455760405162461bcd60e51b81526020600482015260146024820152731d1c985b9cd9995c88199c9bdb4819985a5b195960621b60448201526064016101d6565b5050505050565b600081815260208190526040812060016005820154600160a01b900460ff16600381111561077c5761077c610ae1565b148015610795575060048101546001600160a01b031633145b80156107a5575080600301544210155b9392505050565b3233146107cb5760405162461bcd60e51b81526004016101d690610ca2565b6000805b828110156109a357368484838181106107ea576107ea610d1d565b6020604091820293909301838101356000908152938490529220919250600190506005820154600160a01b900460ff16600381111561082b5761082b610ae1565b146108645760405162461bcd60e51b815260206004820152600960248201526862616420737461746560b81b60448201526064016101d6565b60058101546001600160a01b031633146108b25760405162461bcd60e51b815260206004820152600f60248201526e189859081c185c9d1a58da5c185b9d608a1b60448201526064016101d6565b8160200135600283600001356040516020016108d091815260200190565b60408051601f19818403018152908290526108ea91610ccc565b602060405180830381855afa158015610907573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061092a9190610da4565b146109645760405162461bcd60e51b815260206004820152600a602482015269189859081cd958dc995d60b21b60448201526064016101d6565b60058101805460ff60a01b1916600160a11b17905581358155600181015461098c9085610d72565b93505050808061099b90610d8b565b9150506107cf565b5060408051336024820152604480820184905282518083039091018152606490910182526020810180516001600160e01b031663a9059cbb60e01b17905290516000916060916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691610a1d91610ccc565b6000604051808303816000865af19150503d8060008114610a5a576040519150601f19603f3d011682016040523d82523d6000602084013e610a5f565b606091505b509092509050818015610a8a575080511580610a8a575080806020019051810190610a8a9190610cfb565b6107455760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b60448201526064016101d6565b600060208284031215610ada57600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60048110610b1557634e487b7160e01b600052602160045260246000fd5b9052565b600060e08201905082518252602083015160208301526040830151604083015260608301516060830152608083015160018060a01b0380821660808501528060a08601511660a0850152505060c0830151610b7760c0840182610af7565b5092915050565b60008060208385031215610b9157600080fd5b823567ffffffffffffffff80821115610ba957600080fd5b818501915085601f830112610bbd57600080fd5b813581811115610bcc57600080fd5b8660208260071b8501011115610be157600080fd5b60209290920196919550909350505050565b8781526020810187905260408101869052606081018590526001600160a01b038481166080830152831660a082015260e08101610c3360c0830184610af7565b98975050505050505050565b60008060208385031215610c5257600080fd5b823567ffffffffffffffff80821115610c6a57600080fd5b818501915085601f830112610c7e57600080fd5b813581811115610c8d57600080fd5b8660208260061b8501011115610be157600080fd5b60208082526010908201526f39b2b73232b910109e9037b934b3b4b760811b604082015260600190565b6000825160005b81811015610ced5760208186018101518583015201610cd3565b506000920191825250919050565b600060208284031215610d0d57600080fd5b815180151581146107a557600080fd5b634e487b7160e01b600052603260045260246000fd5b600060208284031215610d4557600080fd5b81356001600160a01b03811681146107a557600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610d8557610d85610d5c565b92915050565b600060018201610d9d57610d9d610d5c565b5060010190565b600060208284031215610db657600080fd5b505191905056fea2646970667358221220a055a4890a5ecf3876dbee91dfbeb46ba11b5f7c09b6d935173932d93f8fb92264736f6c63430008120033", 37 } 38 39 // ERC20SwapABI is the input ABI used to generate the binding from. 40 // Deprecated: Use ERC20SwapMetaData.ABI instead. 41 var ERC20SwapABI = ERC20SwapMetaData.ABI 42 43 // ERC20SwapBin is the compiled bytecode used for deploying new contracts. 44 // Deprecated: Use ERC20SwapMetaData.Bin instead. 45 var ERC20SwapBin = ERC20SwapMetaData.Bin 46 47 // DeployERC20Swap deploys a new Ethereum contract, binding an instance of ERC20Swap to it. 48 func DeployERC20Swap(auth *bind.TransactOpts, backend bind.ContractBackend, token common.Address) (common.Address, *types.Transaction, *ERC20Swap, error) { 49 parsed, err := ERC20SwapMetaData.GetAbi() 50 if err != nil { 51 return common.Address{}, nil, nil, err 52 } 53 if parsed == nil { 54 return common.Address{}, nil, nil, errors.New("GetABI returned nil") 55 } 56 57 address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC20SwapBin), backend, token) 58 if err != nil { 59 return common.Address{}, nil, nil, err 60 } 61 return address, tx, &ERC20Swap{ERC20SwapCaller: ERC20SwapCaller{contract: contract}, ERC20SwapTransactor: ERC20SwapTransactor{contract: contract}, ERC20SwapFilterer: ERC20SwapFilterer{contract: contract}}, nil 62 } 63 64 // ERC20Swap is an auto generated Go binding around an Ethereum contract. 65 type ERC20Swap struct { 66 ERC20SwapCaller // Read-only binding to the contract 67 ERC20SwapTransactor // Write-only binding to the contract 68 ERC20SwapFilterer // Log filterer for contract events 69 } 70 71 // ERC20SwapCaller is an auto generated read-only Go binding around an Ethereum contract. 72 type ERC20SwapCaller struct { 73 contract *bind.BoundContract // Generic contract wrapper for the low level calls 74 } 75 76 // ERC20SwapTransactor is an auto generated write-only Go binding around an Ethereum contract. 77 type ERC20SwapTransactor struct { 78 contract *bind.BoundContract // Generic contract wrapper for the low level calls 79 } 80 81 // ERC20SwapFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 82 type ERC20SwapFilterer struct { 83 contract *bind.BoundContract // Generic contract wrapper for the low level calls 84 } 85 86 // ERC20SwapSession is an auto generated Go binding around an Ethereum contract, 87 // with pre-set call and transact options. 88 type ERC20SwapSession struct { 89 Contract *ERC20Swap // Generic contract binding to set the session for 90 CallOpts bind.CallOpts // Call options to use throughout this session 91 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 92 } 93 94 // ERC20SwapCallerSession is an auto generated read-only Go binding around an Ethereum contract, 95 // with pre-set call options. 96 type ERC20SwapCallerSession struct { 97 Contract *ERC20SwapCaller // Generic contract caller binding to set the session for 98 CallOpts bind.CallOpts // Call options to use throughout this session 99 } 100 101 // ERC20SwapTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 102 // with pre-set transact options. 103 type ERC20SwapTransactorSession struct { 104 Contract *ERC20SwapTransactor // Generic contract transactor binding to set the session for 105 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 106 } 107 108 // ERC20SwapRaw is an auto generated low-level Go binding around an Ethereum contract. 109 type ERC20SwapRaw struct { 110 Contract *ERC20Swap // Generic contract binding to access the raw methods on 111 } 112 113 // ERC20SwapCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 114 type ERC20SwapCallerRaw struct { 115 Contract *ERC20SwapCaller // Generic read-only contract binding to access the raw methods on 116 } 117 118 // ERC20SwapTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 119 type ERC20SwapTransactorRaw struct { 120 Contract *ERC20SwapTransactor // Generic write-only contract binding to access the raw methods on 121 } 122 123 // NewERC20Swap creates a new instance of ERC20Swap, bound to a specific deployed contract. 124 func NewERC20Swap(address common.Address, backend bind.ContractBackend) (*ERC20Swap, error) { 125 contract, err := bindERC20Swap(address, backend, backend, backend) 126 if err != nil { 127 return nil, err 128 } 129 return &ERC20Swap{ERC20SwapCaller: ERC20SwapCaller{contract: contract}, ERC20SwapTransactor: ERC20SwapTransactor{contract: contract}, ERC20SwapFilterer: ERC20SwapFilterer{contract: contract}}, nil 130 } 131 132 // NewERC20SwapCaller creates a new read-only instance of ERC20Swap, bound to a specific deployed contract. 133 func NewERC20SwapCaller(address common.Address, caller bind.ContractCaller) (*ERC20SwapCaller, error) { 134 contract, err := bindERC20Swap(address, caller, nil, nil) 135 if err != nil { 136 return nil, err 137 } 138 return &ERC20SwapCaller{contract: contract}, nil 139 } 140 141 // NewERC20SwapTransactor creates a new write-only instance of ERC20Swap, bound to a specific deployed contract. 142 func NewERC20SwapTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC20SwapTransactor, error) { 143 contract, err := bindERC20Swap(address, nil, transactor, nil) 144 if err != nil { 145 return nil, err 146 } 147 return &ERC20SwapTransactor{contract: contract}, nil 148 } 149 150 // NewERC20SwapFilterer creates a new log filterer instance of ERC20Swap, bound to a specific deployed contract. 151 func NewERC20SwapFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC20SwapFilterer, error) { 152 contract, err := bindERC20Swap(address, nil, nil, filterer) 153 if err != nil { 154 return nil, err 155 } 156 return &ERC20SwapFilterer{contract: contract}, nil 157 } 158 159 // bindERC20Swap binds a generic wrapper to an already deployed contract. 160 func bindERC20Swap(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 161 parsed, err := ERC20SwapMetaData.GetAbi() 162 if err != nil { 163 return nil, err 164 } 165 return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil 166 } 167 168 // Call invokes the (constant) contract method with params as input values and 169 // sets the output to result. The result type might be a single field for simple 170 // returns, a slice of interfaces for anonymous returns and a struct for named 171 // returns. 172 func (_ERC20Swap *ERC20SwapRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 173 return _ERC20Swap.Contract.ERC20SwapCaller.contract.Call(opts, result, method, params...) 174 } 175 176 // Transfer initiates a plain transaction to move funds to the contract, calling 177 // its default method if one is available. 178 func (_ERC20Swap *ERC20SwapRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 179 return _ERC20Swap.Contract.ERC20SwapTransactor.contract.Transfer(opts) 180 } 181 182 // Transact invokes the (paid) contract method with params as input values. 183 func (_ERC20Swap *ERC20SwapRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 184 return _ERC20Swap.Contract.ERC20SwapTransactor.contract.Transact(opts, method, params...) 185 } 186 187 // Call invokes the (constant) contract method with params as input values and 188 // sets the output to result. The result type might be a single field for simple 189 // returns, a slice of interfaces for anonymous returns and a struct for named 190 // returns. 191 func (_ERC20Swap *ERC20SwapCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 192 return _ERC20Swap.Contract.contract.Call(opts, result, method, params...) 193 } 194 195 // Transfer initiates a plain transaction to move funds to the contract, calling 196 // its default method if one is available. 197 func (_ERC20Swap *ERC20SwapTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 198 return _ERC20Swap.Contract.contract.Transfer(opts) 199 } 200 201 // Transact invokes the (paid) contract method with params as input values. 202 func (_ERC20Swap *ERC20SwapTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 203 return _ERC20Swap.Contract.contract.Transact(opts, method, params...) 204 } 205 206 // IsRefundable is a free data retrieval call binding the contract method 0xd0f761c0. 207 // 208 // Solidity: function isRefundable(bytes32 secretHash) view returns(bool) 209 func (_ERC20Swap *ERC20SwapCaller) IsRefundable(opts *bind.CallOpts, secretHash [32]byte) (bool, error) { 210 var out []interface{} 211 err := _ERC20Swap.contract.Call(opts, &out, "isRefundable", secretHash) 212 213 if err != nil { 214 return *new(bool), err 215 } 216 217 out0 := *abi.ConvertType(out[0], new(bool)).(*bool) 218 219 return out0, err 220 221 } 222 223 // IsRefundable is a free data retrieval call binding the contract method 0xd0f761c0. 224 // 225 // Solidity: function isRefundable(bytes32 secretHash) view returns(bool) 226 func (_ERC20Swap *ERC20SwapSession) IsRefundable(secretHash [32]byte) (bool, error) { 227 return _ERC20Swap.Contract.IsRefundable(&_ERC20Swap.CallOpts, secretHash) 228 } 229 230 // IsRefundable is a free data retrieval call binding the contract method 0xd0f761c0. 231 // 232 // Solidity: function isRefundable(bytes32 secretHash) view returns(bool) 233 func (_ERC20Swap *ERC20SwapCallerSession) IsRefundable(secretHash [32]byte) (bool, error) { 234 return _ERC20Swap.Contract.IsRefundable(&_ERC20Swap.CallOpts, secretHash) 235 } 236 237 // Swap is a free data retrieval call binding the contract method 0x76467cbd. 238 // 239 // Solidity: function swap(bytes32 secretHash) view returns((bytes32,uint256,uint256,uint256,address,address,uint8)) 240 func (_ERC20Swap *ERC20SwapCaller) Swap(opts *bind.CallOpts, secretHash [32]byte) (ethv0.ETHSwapSwap, error) { 241 var out []interface{} 242 err := _ERC20Swap.contract.Call(opts, &out, "swap", secretHash) 243 244 if err != nil { 245 return *new(ethv0.ETHSwapSwap), err 246 } 247 248 out0 := *abi.ConvertType(out[0], new(ethv0.ETHSwapSwap)).(*ethv0.ETHSwapSwap) 249 250 return out0, err 251 252 } 253 254 // Swap is a free data retrieval call binding the contract method 0x76467cbd. 255 // 256 // Solidity: function swap(bytes32 secretHash) view returns((bytes32,uint256,uint256,uint256,address,address,uint8)) 257 func (_ERC20Swap *ERC20SwapSession) Swap(secretHash [32]byte) (ethv0.ETHSwapSwap, error) { 258 return _ERC20Swap.Contract.Swap(&_ERC20Swap.CallOpts, secretHash) 259 } 260 261 // Swap is a free data retrieval call binding the contract method 0x76467cbd. 262 // 263 // Solidity: function swap(bytes32 secretHash) view returns((bytes32,uint256,uint256,uint256,address,address,uint8)) 264 func (_ERC20Swap *ERC20SwapCallerSession) Swap(secretHash [32]byte) (ethv0.ETHSwapSwap, error) { 265 return _ERC20Swap.Contract.Swap(&_ERC20Swap.CallOpts, secretHash) 266 } 267 268 // Swaps is a free data retrieval call binding the contract method 0xeb84e7f2. 269 // 270 // Solidity: function swaps(bytes32 ) view returns(bytes32 secret, uint256 value, uint256 initBlockNumber, uint256 refundBlockTimestamp, address initiator, address participant, uint8 state) 271 func (_ERC20Swap *ERC20SwapCaller) Swaps(opts *bind.CallOpts, arg0 [32]byte) (struct { 272 Secret [32]byte 273 Value *big.Int 274 InitBlockNumber *big.Int 275 RefundBlockTimestamp *big.Int 276 Initiator common.Address 277 Participant common.Address 278 State uint8 279 }, error) { 280 var out []interface{} 281 err := _ERC20Swap.contract.Call(opts, &out, "swaps", arg0) 282 283 outstruct := new(struct { 284 Secret [32]byte 285 Value *big.Int 286 InitBlockNumber *big.Int 287 RefundBlockTimestamp *big.Int 288 Initiator common.Address 289 Participant common.Address 290 State uint8 291 }) 292 if err != nil { 293 return *outstruct, err 294 } 295 296 outstruct.Secret = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) 297 outstruct.Value = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) 298 outstruct.InitBlockNumber = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) 299 outstruct.RefundBlockTimestamp = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) 300 outstruct.Initiator = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) 301 outstruct.Participant = *abi.ConvertType(out[5], new(common.Address)).(*common.Address) 302 outstruct.State = *abi.ConvertType(out[6], new(uint8)).(*uint8) 303 304 return *outstruct, err 305 306 } 307 308 // Swaps is a free data retrieval call binding the contract method 0xeb84e7f2. 309 // 310 // Solidity: function swaps(bytes32 ) view returns(bytes32 secret, uint256 value, uint256 initBlockNumber, uint256 refundBlockTimestamp, address initiator, address participant, uint8 state) 311 func (_ERC20Swap *ERC20SwapSession) Swaps(arg0 [32]byte) (struct { 312 Secret [32]byte 313 Value *big.Int 314 InitBlockNumber *big.Int 315 RefundBlockTimestamp *big.Int 316 Initiator common.Address 317 Participant common.Address 318 State uint8 319 }, error) { 320 return _ERC20Swap.Contract.Swaps(&_ERC20Swap.CallOpts, arg0) 321 } 322 323 // Swaps is a free data retrieval call binding the contract method 0xeb84e7f2. 324 // 325 // Solidity: function swaps(bytes32 ) view returns(bytes32 secret, uint256 value, uint256 initBlockNumber, uint256 refundBlockTimestamp, address initiator, address participant, uint8 state) 326 func (_ERC20Swap *ERC20SwapCallerSession) Swaps(arg0 [32]byte) (struct { 327 Secret [32]byte 328 Value *big.Int 329 InitBlockNumber *big.Int 330 RefundBlockTimestamp *big.Int 331 Initiator common.Address 332 Participant common.Address 333 State uint8 334 }, error) { 335 return _ERC20Swap.Contract.Swaps(&_ERC20Swap.CallOpts, arg0) 336 } 337 338 // TokenAddress is a free data retrieval call binding the contract method 0x8c8e8fee. 339 // 340 // Solidity: function token_address() view returns(address) 341 func (_ERC20Swap *ERC20SwapCaller) TokenAddress(opts *bind.CallOpts) (common.Address, error) { 342 var out []interface{} 343 err := _ERC20Swap.contract.Call(opts, &out, "token_address") 344 345 if err != nil { 346 return *new(common.Address), err 347 } 348 349 out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) 350 351 return out0, err 352 353 } 354 355 // TokenAddress is a free data retrieval call binding the contract method 0x8c8e8fee. 356 // 357 // Solidity: function token_address() view returns(address) 358 func (_ERC20Swap *ERC20SwapSession) TokenAddress() (common.Address, error) { 359 return _ERC20Swap.Contract.TokenAddress(&_ERC20Swap.CallOpts) 360 } 361 362 // TokenAddress is a free data retrieval call binding the contract method 0x8c8e8fee. 363 // 364 // Solidity: function token_address() view returns(address) 365 func (_ERC20Swap *ERC20SwapCallerSession) TokenAddress() (common.Address, error) { 366 return _ERC20Swap.Contract.TokenAddress(&_ERC20Swap.CallOpts) 367 } 368 369 // Initiate is a paid mutator transaction binding the contract method 0xa8793f94. 370 // 371 // Solidity: function initiate((uint256,bytes32,address,uint256)[] initiations) returns() 372 func (_ERC20Swap *ERC20SwapTransactor) Initiate(opts *bind.TransactOpts, initiations []ethv0.ETHSwapInitiation) (*types.Transaction, error) { 373 return _ERC20Swap.contract.Transact(opts, "initiate", initiations) 374 } 375 376 // Initiate is a paid mutator transaction binding the contract method 0xa8793f94. 377 // 378 // Solidity: function initiate((uint256,bytes32,address,uint256)[] initiations) returns() 379 func (_ERC20Swap *ERC20SwapSession) Initiate(initiations []ethv0.ETHSwapInitiation) (*types.Transaction, error) { 380 return _ERC20Swap.Contract.Initiate(&_ERC20Swap.TransactOpts, initiations) 381 } 382 383 // Initiate is a paid mutator transaction binding the contract method 0xa8793f94. 384 // 385 // Solidity: function initiate((uint256,bytes32,address,uint256)[] initiations) returns() 386 func (_ERC20Swap *ERC20SwapTransactorSession) Initiate(initiations []ethv0.ETHSwapInitiation) (*types.Transaction, error) { 387 return _ERC20Swap.Contract.Initiate(&_ERC20Swap.TransactOpts, initiations) 388 } 389 390 // Redeem is a paid mutator transaction binding the contract method 0xf4fd17f9. 391 // 392 // Solidity: function redeem((bytes32,bytes32)[] redemptions) returns() 393 func (_ERC20Swap *ERC20SwapTransactor) Redeem(opts *bind.TransactOpts, redemptions []ethv0.ETHSwapRedemption) (*types.Transaction, error) { 394 return _ERC20Swap.contract.Transact(opts, "redeem", redemptions) 395 } 396 397 // Redeem is a paid mutator transaction binding the contract method 0xf4fd17f9. 398 // 399 // Solidity: function redeem((bytes32,bytes32)[] redemptions) returns() 400 func (_ERC20Swap *ERC20SwapSession) Redeem(redemptions []ethv0.ETHSwapRedemption) (*types.Transaction, error) { 401 return _ERC20Swap.Contract.Redeem(&_ERC20Swap.TransactOpts, redemptions) 402 } 403 404 // Redeem is a paid mutator transaction binding the contract method 0xf4fd17f9. 405 // 406 // Solidity: function redeem((bytes32,bytes32)[] redemptions) returns() 407 func (_ERC20Swap *ERC20SwapTransactorSession) Redeem(redemptions []ethv0.ETHSwapRedemption) (*types.Transaction, error) { 408 return _ERC20Swap.Contract.Redeem(&_ERC20Swap.TransactOpts, redemptions) 409 } 410 411 // Refund is a paid mutator transaction binding the contract method 0x7249fbb6. 412 // 413 // Solidity: function refund(bytes32 secretHash) returns() 414 func (_ERC20Swap *ERC20SwapTransactor) Refund(opts *bind.TransactOpts, secretHash [32]byte) (*types.Transaction, error) { 415 return _ERC20Swap.contract.Transact(opts, "refund", secretHash) 416 } 417 418 // Refund is a paid mutator transaction binding the contract method 0x7249fbb6. 419 // 420 // Solidity: function refund(bytes32 secretHash) returns() 421 func (_ERC20Swap *ERC20SwapSession) Refund(secretHash [32]byte) (*types.Transaction, error) { 422 return _ERC20Swap.Contract.Refund(&_ERC20Swap.TransactOpts, secretHash) 423 } 424 425 // Refund is a paid mutator transaction binding the contract method 0x7249fbb6. 426 // 427 // Solidity: function refund(bytes32 secretHash) returns() 428 func (_ERC20Swap *ERC20SwapTransactorSession) Refund(secretHash [32]byte) (*types.Transaction, error) { 429 return _ERC20Swap.Contract.Refund(&_ERC20Swap.TransactOpts, secretHash) 430 }