// Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package contracts 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 ) // FaucetABI is the input ABI used to generate the binding from. const FaucetABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"requestor\",\"type\":\"address\"}],\"name\":\"request\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"money\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"constructor\"}]" // FaucetBin is the compiled bytecode used for deploying new contracts. const FaucetBin = `0x608060405268056bc75e2d63100000600155600280546001600160a01b0319163317905561014d806100326000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806327c78c421461003b5780634ddd108a14610063575b600080fd5b6100616004803603602081101561005157600080fd5b50356001600160a01b031661007d565b005b61006b61011c565b60408051918252519081900360200190f35b6002546001600160a01b0316331461009457600080fd5b600154303110156100a457600080fd5b6001600160a01b03811660009081526020819052604090205460ff16156100ca57600080fd5b6001600160a01b038116600081815260208190526040808220805460ff1916600190811790915554905181156108fc0292818181858888f19350505050158015610118573d6000803e3d6000fd5b5050565b30319056fea165627a7a72305820fff2e3fdb95fb4beeaf0ea0cf53af65742d33136d84f4511dccb95696c1d0c140029` // DeployFaucet deploys a new Ethereum contract, binding an instance of Faucet to it. func DeployFaucet(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Faucet, error) { parsed, err := abi.JSON(strings.NewReader(FaucetABI)) if err != nil { return common.Address{}, nil, nil, err } address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(FaucetBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &Faucet{FaucetCaller: FaucetCaller{contract: contract}, FaucetTransactor: FaucetTransactor{contract: contract}, FaucetFilterer: FaucetFilterer{contract: contract}}, nil } // Faucet is an auto generated Go binding around an Ethereum contract. type Faucet struct { FaucetCaller // Read-only binding to the contract FaucetTransactor // Write-only binding to the contract FaucetFilterer // Log filterer for contract events } // FaucetCaller is an auto generated read-only Go binding around an Ethereum contract. type FaucetCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // FaucetTransactor is an auto generated write-only Go binding around an Ethereum contract. type FaucetTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // FaucetFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type FaucetFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // FaucetSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type FaucetSession struct { Contract *Faucet // 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 } // FaucetCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type FaucetCallerSession struct { Contract *FaucetCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // FaucetTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type FaucetTransactorSession struct { Contract *FaucetTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // FaucetRaw is an auto generated low-level Go binding around an Ethereum contract. type FaucetRaw struct { Contract *Faucet // Generic contract binding to access the raw methods on } // FaucetCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type FaucetCallerRaw struct { Contract *FaucetCaller // Generic read-only contract binding to access the raw methods on } // FaucetTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type FaucetTransactorRaw struct { Contract *FaucetTransactor // Generic write-only contract binding to access the raw methods on } // NewFaucet creates a new instance of Faucet, bound to a specific deployed contract. func NewFaucet(address common.Address, backend bind.ContractBackend) (*Faucet, error) { contract, err := bindFaucet(address, backend, backend, backend) if err != nil { return nil, err } return &Faucet{FaucetCaller: FaucetCaller{contract: contract}, FaucetTransactor: FaucetTransactor{contract: contract}, FaucetFilterer: FaucetFilterer{contract: contract}}, nil } // NewFaucetCaller creates a new read-only instance of Faucet, bound to a specific deployed contract. func NewFaucetCaller(address common.Address, caller bind.ContractCaller) (*FaucetCaller, error) { contract, err := bindFaucet(address, caller, nil, nil) if err != nil { return nil, err } return &FaucetCaller{contract: contract}, nil } // NewFaucetTransactor creates a new write-only instance of Faucet, bound to a specific deployed contract. func NewFaucetTransactor(address common.Address, transactor bind.ContractTransactor) (*FaucetTransactor, error) { contract, err := bindFaucet(address, nil, transactor, nil) if err != nil { return nil, err } return &FaucetTransactor{contract: contract}, nil } // NewFaucetFilterer creates a new log filterer instance of Faucet, bound to a specific deployed contract. func NewFaucetFilterer(address common.Address, filterer bind.ContractFilterer) (*FaucetFilterer, error) { contract, err := bindFaucet(address, nil, nil, filterer) if err != nil { return nil, err } return &FaucetFilterer{contract: contract}, nil } // bindFaucet binds a generic wrapper to an already deployed contract. func bindFaucet(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(FaucetABI)) 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 (_Faucet *FaucetRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { return _Faucet.Contract.FaucetCaller.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 (_Faucet *FaucetRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Faucet.Contract.FaucetTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Faucet *FaucetRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Faucet.Contract.FaucetTransactor.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 (_Faucet *FaucetCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { return _Faucet.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 (_Faucet *FaucetTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Faucet.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Faucet *FaucetTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Faucet.Contract.contract.Transact(opts, method, params...) } // Money is a free data retrieval call binding the contract method 0x4ddd108a. // // Solidity: function money() constant returns(uint256) func (_Faucet *FaucetCaller) Money(opts *bind.CallOpts) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 err := _Faucet.contract.Call(opts, out, "money") return *ret0, err } // Money is a free data retrieval call binding the contract method 0x4ddd108a. // // Solidity: function money() constant returns(uint256) func (_Faucet *FaucetSession) Money() (*big.Int, error) { return _Faucet.Contract.Money(&_Faucet.CallOpts) } // Money is a free data retrieval call binding the contract method 0x4ddd108a. // // Solidity: function money() constant returns(uint256) func (_Faucet *FaucetCallerSession) Money() (*big.Int, error) { return _Faucet.Contract.Money(&_Faucet.CallOpts) } // Request is a paid mutator transaction binding the contract method 0x27c78c42. // // Solidity: function request(address requestor) returns() func (_Faucet *FaucetTransactor) Request(opts *bind.TransactOpts, requestor common.Address) (*types.Transaction, error) { return _Faucet.contract.Transact(opts, "request", requestor) } // Request is a paid mutator transaction binding the contract method 0x27c78c42. // // Solidity: function request(address requestor) returns() func (_Faucet *FaucetSession) Request(requestor common.Address) (*types.Transaction, error) { return _Faucet.Contract.Request(&_Faucet.TransactOpts, requestor) } // Request is a paid mutator transaction binding the contract method 0x27c78c42. // // Solidity: function request(address requestor) returns() func (_Faucet *FaucetTransactorSession) Request(requestor common.Address) (*types.Transaction, error) { return _Faucet.Contract.Request(&_Faucet.TransactOpts, requestor) }