Created
May 11, 2018 22:28
-
-
Save natemurthy/50415bdac7bd5a1194c39c10aa4a7c94 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated - DO NOT EDIT. | |
// This file is a generated binding and any manual changes will be lost. | |
package main | |
import ( | |
"strings" | |
"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" | |
) | |
// HelloworldABI is the input ABI used to generate the binding from. | |
const HelloworldABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"say\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}]" | |
// HelloworldBin is the compiled bytecode used for deploying new contracts. | |
const HelloworldBin = `0x608060405234801561001057600080fd5b5061012a806100206000396000f300608060405260043610603e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663954ab4b281146043575b600080fd5b348015604e57600080fd5b50605560c7565b6040805160208082528351818301528351919283929083019185019080838360005b83811015608d5781810151838201526020016077565b50505050905090810190601f16801560b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051808201909152601081527f68656c6c6f206574686572776f726c64000000000000000000000000000000006020820152905600a165627a7a72305820fb8cc2277770bacc669e11a9e01dcd34a1fb7ae7c8e9b6783f0fc0dbcab8f1e30029` | |
// DeployHelloworld deploys a new Ethereum contract, binding an instance of Helloworld to it. | |
func DeployHelloworld(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Helloworld, error) { | |
parsed, err := abi.JSON(strings.NewReader(HelloworldABI)) | |
if err != nil { | |
return common.Address{}, nil, nil, err | |
} | |
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HelloworldBin), backend) | |
if err != nil { | |
return common.Address{}, nil, nil, err | |
} | |
return address, tx, &Helloworld{HelloworldCaller: HelloworldCaller{contract: contract}, HelloworldTransactor: HelloworldTransactor{contract: contract}, HelloworldFilterer: HelloworldFilterer{contract: contract}}, nil | |
} | |
// Helloworld is an auto generated Go binding around an Ethereum contract. | |
type Helloworld struct { | |
HelloworldCaller // Read-only binding to the contract | |
HelloworldTransactor // Write-only binding to the contract | |
HelloworldFilterer // Log filterer for contract events | |
} | |
// HelloworldCaller is an auto generated read-only Go binding around an Ethereum contract. | |
type HelloworldCaller struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// HelloworldTransactor is an auto generated write-only Go binding around an Ethereum contract. | |
type HelloworldTransactor struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// HelloworldFilterer is an auto generated log filtering Go binding around an Ethereum contract events. | |
type HelloworldFilterer struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// HelloworldSession is an auto generated Go binding around an Ethereum contract, | |
// with pre-set call and transact options. | |
type HelloworldSession struct { | |
Contract *Helloworld // 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 | |
} | |
// HelloworldCallerSession is an auto generated read-only Go binding around an Ethereum contract, | |
// with pre-set call options. | |
type HelloworldCallerSession struct { | |
Contract *HelloworldCaller // Generic contract caller binding to set the session for | |
CallOpts bind.CallOpts // Call options to use throughout this session | |
} | |
// HelloworldTransactorSession is an auto generated write-only Go binding around an Ethereum contract, | |
// with pre-set transact options. | |
type HelloworldTransactorSession struct { | |
Contract *HelloworldTransactor // Generic contract transactor binding to set the session for | |
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session | |
} | |
// HelloworldRaw is an auto generated low-level Go binding around an Ethereum contract. | |
type HelloworldRaw struct { | |
Contract *Helloworld // Generic contract binding to access the raw methods on | |
} | |
// HelloworldCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. | |
type HelloworldCallerRaw struct { | |
Contract *HelloworldCaller // Generic read-only contract binding to access the raw methods on | |
} | |
// HelloworldTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. | |
type HelloworldTransactorRaw struct { | |
Contract *HelloworldTransactor // Generic write-only contract binding to access the raw methods on | |
} | |
// NewHelloworld creates a new instance of Helloworld, bound to a specific deployed contract. | |
func NewHelloworld(address common.Address, backend bind.ContractBackend) (*Helloworld, error) { | |
contract, err := bindHelloworld(address, backend, backend, backend) | |
if err != nil { | |
return nil, err | |
} | |
return &Helloworld{HelloworldCaller: HelloworldCaller{contract: contract}, HelloworldTransactor: HelloworldTransactor{contract: contract}, HelloworldFilterer: HelloworldFilterer{contract: contract}}, nil | |
} | |
// NewHelloworldCaller creates a new read-only instance of Helloworld, bound to a specific deployed contract. | |
func NewHelloworldCaller(address common.Address, caller bind.ContractCaller) (*HelloworldCaller, error) { | |
contract, err := bindHelloworld(address, caller, nil, nil) | |
if err != nil { | |
return nil, err | |
} | |
return &HelloworldCaller{contract: contract}, nil | |
} | |
// NewHelloworldTransactor creates a new write-only instance of Helloworld, bound to a specific deployed contract. | |
func NewHelloworldTransactor(address common.Address, transactor bind.ContractTransactor) (*HelloworldTransactor, error) { | |
contract, err := bindHelloworld(address, nil, transactor, nil) | |
if err != nil { | |
return nil, err | |
} | |
return &HelloworldTransactor{contract: contract}, nil | |
} | |
// NewHelloworldFilterer creates a new log filterer instance of Helloworld, bound to a specific deployed contract. | |
func NewHelloworldFilterer(address common.Address, filterer bind.ContractFilterer) (*HelloworldFilterer, error) { | |
contract, err := bindHelloworld(address, nil, nil, filterer) | |
if err != nil { | |
return nil, err | |
} | |
return &HelloworldFilterer{contract: contract}, nil | |
} | |
// bindHelloworld binds a generic wrapper to an already deployed contract. | |
func bindHelloworld(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { | |
parsed, err := abi.JSON(strings.NewReader(HelloworldABI)) | |
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 (_Helloworld *HelloworldRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { | |
return _Helloworld.Contract.HelloworldCaller.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 (_Helloworld *HelloworldRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { | |
return _Helloworld.Contract.HelloworldTransactor.contract.Transfer(opts) | |
} | |
// Transact invokes the (paid) contract method with params as input values. | |
func (_Helloworld *HelloworldRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { | |
return _Helloworld.Contract.HelloworldTransactor.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 (_Helloworld *HelloworldCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { | |
return _Helloworld.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 (_Helloworld *HelloworldTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { | |
return _Helloworld.Contract.contract.Transfer(opts) | |
} | |
// Transact invokes the (paid) contract method with params as input values. | |
func (_Helloworld *HelloworldTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { | |
return _Helloworld.Contract.contract.Transact(opts, method, params...) | |
} | |
// Say is a free data retrieval call binding the contract method 0x954ab4b2. | |
// | |
// Solidity: function say() constant returns(string) | |
func (_Helloworld *HelloworldCaller) Say(opts *bind.CallOpts) (string, error) { | |
var ( | |
ret0 = new(string) | |
) | |
out := ret0 | |
err := _Helloworld.contract.Call(opts, out, "say") | |
return *ret0, err | |
} | |
// Say is a free data retrieval call binding the contract method 0x954ab4b2. | |
// | |
// Solidity: function say() constant returns(string) | |
func (_Helloworld *HelloworldSession) Say() (string, error) { | |
return _Helloworld.Contract.Say(&_Helloworld.CallOpts) | |
} | |
// Say is a free data retrieval call binding the contract method 0x954ab4b2. | |
// | |
// Solidity: function say() constant returns(string) | |
func (_Helloworld *HelloworldCallerSession) Say() (string, error) { | |
return _Helloworld.Contract.Say(&_Helloworld.CallOpts) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment