github.com/kivutar/go-ethereum@v1.7.4-0.20180117074026-6fdb126e9630/contracts/chequebook/contract/chequebook.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 contract 5 6 import ( 7 "math/big" 8 "strings" 9 10 "github.com/ethereum/go-ethereum/accounts/abi" 11 "github.com/ethereum/go-ethereum/accounts/abi/bind" 12 "github.com/ethereum/go-ethereum/common" 13 "github.com/ethereum/go-ethereum/core/types" 14 ) 15 16 // ChequebookABI is the input ABI used to generate the binding from. 17 const ChequebookABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"kill\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"sent\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"beneficiary\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"sig_v\",\"type\":\"uint8\"},{\"name\":\"sig_r\",\"type\":\"bytes32\"},{\"name\":\"sig_s\",\"type\":\"bytes32\"}],\"name\":\"cash\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"deadbeat\",\"type\":\"address\"}],\"name\":\"Overdraft\",\"type\":\"event\"}]" 18 19 // ChequebookBin is the compiled bytecode used for deploying new contracts. 20 const ChequebookBin = `0x606060405260008054600160a060020a033316600160a060020a03199091161790556102ec806100306000396000f3006060604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b581146100585780637bf786f81461006b578063fbf788d61461009c575b005b341561006357600080fd5b6100566100ca565b341561007657600080fd5b61008a600160a060020a03600435166100f1565b60405190815260200160405180910390f35b34156100a757600080fd5b610056600160a060020a036004351660243560ff60443516606435608435610103565b60005433600160a060020a03908116911614156100ef57600054600160a060020a0316ff5b565b60016020526000908152604090205481565b600160a060020a0385166000908152600160205260408120548190861161012957600080fd5b3087876040516c01000000000000000000000000600160a060020a03948516810282529290931690910260148301526028820152604801604051809103902091506001828686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156101cf57600080fd5b505060206040510351600054600160a060020a039081169116146101f257600080fd5b50600160a060020a03808716600090815260016020526040902054860390301631811161026257600160a060020a0387166000818152600160205260409081902088905582156108fc0290839051600060405180830381858888f19350505050151561025d57600080fd5b6102b7565b6000547f2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f97890600160a060020a0316604051600160a060020a03909116815260200160405180910390a186600160a060020a0316ff5b505050505050505600a165627a7a7230582014e927522ca5cd8f68529ac4d3b9cdf36d40e09d8a33b70008248d1abebf79680029` 21 22 // DeployChequebook deploys a new Ethereum contract, binding an instance of Chequebook to it. 23 func DeployChequebook(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Chequebook, error) { 24 parsed, err := abi.JSON(strings.NewReader(ChequebookABI)) 25 if err != nil { 26 return common.Address{}, nil, nil, err 27 } 28 address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ChequebookBin), backend) 29 if err != nil { 30 return common.Address{}, nil, nil, err 31 } 32 return address, tx, &Chequebook{ChequebookCaller: ChequebookCaller{contract: contract}, ChequebookTransactor: ChequebookTransactor{contract: contract}}, nil 33 } 34 35 // Chequebook is an auto generated Go binding around an Ethereum contract. 36 type Chequebook struct { 37 ChequebookCaller // Read-only binding to the contract 38 ChequebookTransactor // Write-only binding to the contract 39 } 40 41 // ChequebookCaller is an auto generated read-only Go binding around an Ethereum contract. 42 type ChequebookCaller struct { 43 contract *bind.BoundContract // Generic contract wrapper for the low level calls 44 } 45 46 // ChequebookTransactor is an auto generated write-only Go binding around an Ethereum contract. 47 type ChequebookTransactor struct { 48 contract *bind.BoundContract // Generic contract wrapper for the low level calls 49 } 50 51 // ChequebookSession is an auto generated Go binding around an Ethereum contract, 52 // with pre-set call and transact options. 53 type ChequebookSession struct { 54 Contract *Chequebook // Generic contract binding to set the session for 55 CallOpts bind.CallOpts // Call options to use throughout this session 56 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 57 } 58 59 // ChequebookCallerSession is an auto generated read-only Go binding around an Ethereum contract, 60 // with pre-set call options. 61 type ChequebookCallerSession struct { 62 Contract *ChequebookCaller // Generic contract caller binding to set the session for 63 CallOpts bind.CallOpts // Call options to use throughout this session 64 } 65 66 // ChequebookTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 67 // with pre-set transact options. 68 type ChequebookTransactorSession struct { 69 Contract *ChequebookTransactor // Generic contract transactor binding to set the session for 70 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 71 } 72 73 // ChequebookRaw is an auto generated low-level Go binding around an Ethereum contract. 74 type ChequebookRaw struct { 75 Contract *Chequebook // Generic contract binding to access the raw methods on 76 } 77 78 // ChequebookCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 79 type ChequebookCallerRaw struct { 80 Contract *ChequebookCaller // Generic read-only contract binding to access the raw methods on 81 } 82 83 // ChequebookTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 84 type ChequebookTransactorRaw struct { 85 Contract *ChequebookTransactor // Generic write-only contract binding to access the raw methods on 86 } 87 88 // NewChequebook creates a new instance of Chequebook, bound to a specific deployed contract. 89 func NewChequebook(address common.Address, backend bind.ContractBackend) (*Chequebook, error) { 90 contract, err := bindChequebook(address, backend, backend) 91 if err != nil { 92 return nil, err 93 } 94 return &Chequebook{ChequebookCaller: ChequebookCaller{contract: contract}, ChequebookTransactor: ChequebookTransactor{contract: contract}}, nil 95 } 96 97 // NewChequebookCaller creates a new read-only instance of Chequebook, bound to a specific deployed contract. 98 func NewChequebookCaller(address common.Address, caller bind.ContractCaller) (*ChequebookCaller, error) { 99 contract, err := bindChequebook(address, caller, nil) 100 if err != nil { 101 return nil, err 102 } 103 return &ChequebookCaller{contract: contract}, nil 104 } 105 106 // NewChequebookTransactor creates a new write-only instance of Chequebook, bound to a specific deployed contract. 107 func NewChequebookTransactor(address common.Address, transactor bind.ContractTransactor) (*ChequebookTransactor, error) { 108 contract, err := bindChequebook(address, nil, transactor) 109 if err != nil { 110 return nil, err 111 } 112 return &ChequebookTransactor{contract: contract}, nil 113 } 114 115 // bindChequebook binds a generic wrapper to an already deployed contract. 116 func bindChequebook(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) { 117 parsed, err := abi.JSON(strings.NewReader(ChequebookABI)) 118 if err != nil { 119 return nil, err 120 } 121 return bind.NewBoundContract(address, parsed, caller, transactor), nil 122 } 123 124 // Call invokes the (constant) contract method with params as input values and 125 // sets the output to result. The result type might be a single field for simple 126 // returns, a slice of interfaces for anonymous returns and a struct for named 127 // returns. 128 func (_Chequebook *ChequebookRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { 129 return _Chequebook.Contract.ChequebookCaller.contract.Call(opts, result, method, params...) 130 } 131 132 // Transfer initiates a plain transaction to move funds to the contract, calling 133 // its default method if one is available. 134 func (_Chequebook *ChequebookRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 135 return _Chequebook.Contract.ChequebookTransactor.contract.Transfer(opts) 136 } 137 138 // Transact invokes the (paid) contract method with params as input values. 139 func (_Chequebook *ChequebookRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 140 return _Chequebook.Contract.ChequebookTransactor.contract.Transact(opts, method, params...) 141 } 142 143 // Call invokes the (constant) contract method with params as input values and 144 // sets the output to result. The result type might be a single field for simple 145 // returns, a slice of interfaces for anonymous returns and a struct for named 146 // returns. 147 func (_Chequebook *ChequebookCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { 148 return _Chequebook.Contract.contract.Call(opts, result, method, params...) 149 } 150 151 // Transfer initiates a plain transaction to move funds to the contract, calling 152 // its default method if one is available. 153 func (_Chequebook *ChequebookTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 154 return _Chequebook.Contract.contract.Transfer(opts) 155 } 156 157 // Transact invokes the (paid) contract method with params as input values. 158 func (_Chequebook *ChequebookTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 159 return _Chequebook.Contract.contract.Transact(opts, method, params...) 160 } 161 162 // Sent is a free data retrieval call binding the contract method 0x7bf786f8. 163 // 164 // Solidity: function sent( address) constant returns(uint256) 165 func (_Chequebook *ChequebookCaller) Sent(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 166 var ( 167 ret0 = new(*big.Int) 168 ) 169 out := ret0 170 err := _Chequebook.contract.Call(opts, out, "sent", arg0) 171 return *ret0, err 172 } 173 174 // Sent is a free data retrieval call binding the contract method 0x7bf786f8. 175 // 176 // Solidity: function sent( address) constant returns(uint256) 177 func (_Chequebook *ChequebookSession) Sent(arg0 common.Address) (*big.Int, error) { 178 return _Chequebook.Contract.Sent(&_Chequebook.CallOpts, arg0) 179 } 180 181 // Sent is a free data retrieval call binding the contract method 0x7bf786f8. 182 // 183 // Solidity: function sent( address) constant returns(uint256) 184 func (_Chequebook *ChequebookCallerSession) Sent(arg0 common.Address) (*big.Int, error) { 185 return _Chequebook.Contract.Sent(&_Chequebook.CallOpts, arg0) 186 } 187 188 // Cash is a paid mutator transaction binding the contract method 0xfbf788d6. 189 // 190 // Solidity: function cash(beneficiary address, amount uint256, sig_v uint8, sig_r bytes32, sig_s bytes32) returns() 191 func (_Chequebook *ChequebookTransactor) Cash(opts *bind.TransactOpts, beneficiary common.Address, amount *big.Int, sig_v uint8, sig_r [32]byte, sig_s [32]byte) (*types.Transaction, error) { 192 return _Chequebook.contract.Transact(opts, "cash", beneficiary, amount, sig_v, sig_r, sig_s) 193 } 194 195 // Cash is a paid mutator transaction binding the contract method 0xfbf788d6. 196 // 197 // Solidity: function cash(beneficiary address, amount uint256, sig_v uint8, sig_r bytes32, sig_s bytes32) returns() 198 func (_Chequebook *ChequebookSession) Cash(beneficiary common.Address, amount *big.Int, sig_v uint8, sig_r [32]byte, sig_s [32]byte) (*types.Transaction, error) { 199 return _Chequebook.Contract.Cash(&_Chequebook.TransactOpts, beneficiary, amount, sig_v, sig_r, sig_s) 200 } 201 202 // Cash is a paid mutator transaction binding the contract method 0xfbf788d6. 203 // 204 // Solidity: function cash(beneficiary address, amount uint256, sig_v uint8, sig_r bytes32, sig_s bytes32) returns() 205 func (_Chequebook *ChequebookTransactorSession) Cash(beneficiary common.Address, amount *big.Int, sig_v uint8, sig_r [32]byte, sig_s [32]byte) (*types.Transaction, error) { 206 return _Chequebook.Contract.Cash(&_Chequebook.TransactOpts, beneficiary, amount, sig_v, sig_r, sig_s) 207 } 208 209 // Kill is a paid mutator transaction binding the contract method 0x41c0e1b5. 210 // 211 // Solidity: function kill() returns() 212 func (_Chequebook *ChequebookTransactor) Kill(opts *bind.TransactOpts) (*types.Transaction, error) { 213 return _Chequebook.contract.Transact(opts, "kill") 214 } 215 216 // Kill is a paid mutator transaction binding the contract method 0x41c0e1b5. 217 // 218 // Solidity: function kill() returns() 219 func (_Chequebook *ChequebookSession) Kill() (*types.Transaction, error) { 220 return _Chequebook.Contract.Kill(&_Chequebook.TransactOpts) 221 } 222 223 // Kill is a paid mutator transaction binding the contract method 0x41c0e1b5. 224 // 225 // Solidity: function kill() returns() 226 func (_Chequebook *ChequebookTransactorSession) Kill() (*types.Transaction, error) { 227 return _Chequebook.Contract.Kill(&_Chequebook.TransactOpts) 228 }