mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
1571 lines
80 KiB
Go
1571 lines
80 KiB
Go
// Code generated - DO NOT EDIT.
|
|
// This file is a generated binding and any manual changes will be lost.
|
|
|
|
package contract
|
|
|
|
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"
|
|
)
|
|
|
|
// SafeMathABI is the input ABI used to generate the binding from.
|
|
const SafeMathABI = "[]"
|
|
|
|
// SafeMathBin is the compiled bytecode used for deploying new contracts.
|
|
const SafeMathBin = `0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146060604052600080fd00a165627a7a72305820b9407d48ebc7efee5c9f08b3b3a957df2939281f5913225e8c1291f069b900490029`
|
|
|
|
// 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...)
|
|
}
|
|
|
|
// TomoValidatorABI is the input ABI used to generate the binding from.
|
|
const TomoValidatorABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"unvote\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCandidates\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getVoters\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getWithdrawBlockNumbers\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"getVoterCap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"candidates\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\"},{\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateCap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_nodeId\",\"type\":\"string\"}],\"name\":\"setNodeId\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"vote\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateNodeId\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"candidateCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"voterWithdrawDelay\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"resign\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"getCandidateOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"maxValidatorNumber\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"candidateWithdrawDelay\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"isCandidate\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"minCandidateCap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_candidate\",\"type\":\"address\"},{\"name\":\"_nodeId\",\"type\":\"string\"}],\"name\":\"propose\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_candidates\",\"type\":\"address[]\"},{\"name\":\"_caps\",\"type\":\"uint256[]\"},{\"name\":\"_firstOwner\",\"type\":\"address\"},{\"name\":\"_minCandidateCap\",\"type\":\"uint256\"},{\"name\":\"_maxValidatorNumber\",\"type\":\"uint256\"},{\"name\":\"_candidateWithdrawDelay\",\"type\":\"uint256\"},{\"name\":\"_voterWithdrawDelay\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_voter\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Vote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_voter\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Unvote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Propose\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"}],\"name\":\"Resign\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_candidate\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_nodeId\",\"type\":\"string\"}],\"name\":\"SetNodeId\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_blockNumber\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"}]"
|
|
|
|
// TomoValidatorBin is the compiled bytecode used for deploying new contracts.
|
|
const TomoValidatorBin = `0x6060604052600360045534156200001557600080fd5b604051620016af380380620016af833981016040528080518201919060200180518201919060200180519190602001805191906020018051919060200180519190602001805160058690556006859055600784905560088190559150600090505b87518110156200028757600380546001810162000094838262000295565b916000526020600020900160008a8481518110620000ae57fe5b90602001906020020151909190916101000a815481600160a060020a030219169083600160a060020a031602179055505060806040519081016040528087600160a060020a03168152602001602060405190810160409081526000825290825260016020830152018883815181106200012357fe5b906020019060200201519052600160008a84815181106200014057fe5b90602001906020020151600160a060020a03168152602081019190915260400160002081518154600160a060020a031916600160a060020a03919091161781556020820151816001019080516200019c929160200190620002c1565b50604082015160028201805460ff191691151591909117905560608201516003909101555060026000898381518110620001d257fe5b90602001906020020151600160a060020a03168152602081019190915260400160002080546001810162000207838262000295565b50600091825260208220018054600160a060020a031916600160a060020a038916179055600554600380549192600192909190859081106200024557fe5b6000918252602080832090910154600160a060020a0390811684528382019490945260409283018220938b168252600490930190925290205560010162000076565b505050505050505062000366565b815481835581811511620002bc57600083815260209020620002bc91810190830162000346565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200030457805160ff191683800117855562000334565b8280016001018555821562000334579182015b828111156200033457825182559160200191906001019062000317565b506200034292915062000346565b5090565b6200036391905b808211156200034257600081556001016200034d565b90565b61133980620003766000396000f3006060604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302aa9be2811461011657806306a49fce1461013a5780632d15cc04146101a05780632f9c4bba146101bf578063302b6872146101d25780633477ee2e14610209578063441a3e701461023b57806358e7525f146102545780636a000d74146102735780636dd7d8ea146102d25780637d40257f146102e6578063a9a981a31461037c578063a9ff959e1461038f578063ae6e43f5146103a2578063b642facd146103c1578063d09f1ab4146103e0578063d161c767146103f3578063d51b9e9314610406578063d55b7dff14610439578063d6f0948c1461044c575b600080fd5b341561012157600080fd5b610138600160a060020a036004351660243561046c565b005b341561014557600080fd5b61014d610634565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561018c578082015183820152602001610174565b505050509050019250505060405180910390f35b34156101ab57600080fd5b61014d600160a060020a036004351661069d565b34156101ca57600080fd5b61014d61072a565b34156101dd57600080fd5b6101f7600160a060020a03600435811690602435166107ac565b60405190815260200160405180910390f35b341561021457600080fd5b61021f6004356107db565b604051600160a060020a03909116815260200160405180910390f35b341561024657600080fd5b610138600435602435610803565b341561025f57600080fd5b6101f7600160a060020a036004351661096a565b341561027e57600080fd5b61013860048035600160a060020a03169060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061098895505050505050565b610138600160a060020a0360043516610a99565b34156102f157600080fd5b610305600160a060020a0360043516610c46565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610341578082015183820152602001610329565b50505050905090810190601f16801561036e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561038757600080fd5b6101f7610d0c565b341561039a57600080fd5b6101f7610d12565b34156103ad57600080fd5b610138600160a060020a0360043516610d18565b34156103cc57600080fd5b61021f600160a060020a0360043516610f8b565b34156103eb57600080fd5b6101f7610fa9565b34156103fe57600080fd5b6101f7610faf565b341561041157600080fd5b610425600160a060020a0360043516610fb5565b604051901515815260200160405180910390f35b341561044457600080fd5b6101f7610fd6565b61013860048035600160a060020a03169060248035908101910135610fdc565b600160a060020a038083166000908152600160209081526040808320339094168352600490930190529081205483908390819010156104aa57600080fd5b600160a060020a0385166000908152600160205260409020600301546104d6908563ffffffff61121216565b600160a060020a0380871660009081526001602090815260408083206003810195909555339093168252600490930190925290205461051b908563ffffffff61121216565b600160a060020a038087166000908152600160209081526040808320339094168352600490930190522055600854610559904363ffffffff61122416565b600160a060020a03331660009081526020818152604080832084845290915290205490935061058e908563ffffffff61122416565b600160a060020a03331660008181526020818152604080832088845280835290832094909455918152905260019081018054909181016105ce838261123a565b5060009182526020909120018390557faa0e554f781c3c3b2be110a0557f260f11af9a8aa2c64bc1e7a31dbb21e32fa2338686604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050505050565b61063c611263565b600380548060200260200160405190810160405280929190818152602001828054801561069257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610674575b505050505090505b90565b6106a5611263565b6002600083600160a060020a0316600160a060020a0316815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561071e57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610700575b50505050509050919050565b610732611263565b60008033600160a060020a0316600160a060020a0316815260200190815260200160002060010180548060200260200160405190810160405280929190818152602001828054801561069257602002820191906000526020600020905b81548152602001906001019080831161078f575050505050905090565b600160a060020a0391821660009081526001602090815260408083209390941682526004909201909152205490565b60038054829081106107e957fe5b600091825260209091200154600160a060020a0316905081565b6000828282821161081357600080fd5b438290101561082157600080fd5b600160a060020a0333166000908152602081815260408083208584529091528120541161084d57600080fd5b600160a060020a033316600090815260208190526040902060010180548391908390811061087757fe5b6000918252602090912001541461088d57600080fd5b600160a060020a033316600081815260208181526040808320898452808352908320805490849055938352919052600101805491945090859081106108ce57fe5b6000918252602082200155600160a060020a03331683156108fc0284604051600060405180830381858888f19350505050151561090a57600080fd5b7ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5683386856040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a15050505050565b600160a060020a031660009081526001602052604090206003015490565b600160a060020a0382811660009081526001602052604090205483913381169116146109b357600080fd5b600160a060020a0383166000908152600160208190526040909120018280516109e0929160200190611275565b507f0e421c04ccd34fafbe77c6b2f9384de8c5c4795114325fedb698a6ce62b2d744338484604051600160a060020a0380851682528316602082015260606040820181815290820183818151815260200191508051906020019080838360005b83811015610a58578082015183820152602001610a40565b50505050905090810190601f168015610a855780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505050565b600160a060020a038116600090815260016020526040902060020154819060ff161515610ac557600080fd5b600160a060020a038216600090815260016020526040902060030154610af1903463ffffffff61122416565b600160a060020a038084166000908152600160209081526040808320600381019590955533909316825260049093019092529020541515610b8757600160a060020a0382166000908152600260205260409020805460018101610b54838261123a565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161790555b600160a060020a038083166000908152600160209081526040808320339094168352600490930190522054610bc2903463ffffffff61122416565b600160a060020a03808416600090815260016020908152604080832033948516845260040190915290819020929092557f66a9138482c99e9baf08860110ef332cc0c23b4a199a53593d8db0fc8f96fbfc918490349051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050565b610c4e611263565b6001600083600160a060020a0316600160a060020a031681526020019081526020016000206001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561071e5780601f10610cdf5761010080835404028352916020019161071e565b820191906000526020600020905b815481529060010190602001808311610ced5750939695505050505050565b60045481565b60085481565b600160a060020a038181166000908152600160205260408120549091829182918591338216911614610d4957600080fd5b600160a060020a038516600090815260016020526040902060020154859060ff161515610d7557600080fd5b600160a060020a0386166000908152600160205260408120600201805460ff191690556004805460001901905594505b600354851015610e275785600160a060020a0316600386815481101515610dc857fe5b600091825260209091200154600160a060020a03161415610e1c576003805486908110610df157fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19169055610e27565b600190940193610da5565b600160a060020a038087166000818152600160208181526040808420339096168452600486018252832054939092529052600390910154909450610e71908563ffffffff61121216565b600160a060020a03808816600090815260016020908152604080832060038101959095553390931682526004909301909252812055600754610eb9904363ffffffff61122416565b600160a060020a033316600090815260208181526040808320848452909152902054909350610eee908563ffffffff61122416565b600160a060020a0333166000818152602081815260408083208884528083529083209490945591815290526001908101805490918101610f2e838261123a565b5060009182526020909120018390557f4edf3e325d0063213a39f9085522994a1c44bea5f39e7d63ef61260a1e58c6d33387604051600160a060020a039283168152911660208201526040908101905180910390a1505050505050565b600160a060020a039081166000908152600160205260409020541690565b60065481565b60075481565b600160a060020a031660009081526001602052604090206002015460ff1690565b60055481565b600554341015610feb57600080fd5b600160a060020a038316600090815260016020526040902060020154839060ff161561101657600080fd5b6003805460018101611028838261123a565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03861617905560806040519081016040528033600160a060020a0316815260200184848080601f016020809104026020016040519081016040528181529291906020840183838082843750505092845250506001602080840182905234604094850152600160a060020a03891660009081529190529190912090508151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101908051611113929160200190611275565b50604082015160028201805460ff1916911515919091179055606082015160039091015550600160a060020a038085166000818152600160208181526040808420339096168452600495860182528084203490558554830190955592825260029092529190912080549091810161118a838261123a565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0386161790557f7635f1d87b47fba9f2b09e56eb4be75cca030e0cb179c1602ac9261d39a8f5c1338534604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a150505050565b60008282111561121e57fe5b50900390565b60008282018381101561123357fe5b9392505050565b81548183558181151161125e5760008381526020902061125e9181019083016112f3565b505050565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106112b657805160ff19168380011785556112e3565b828001600101855582156112e3579182015b828111156112e35782518255916020019190600101906112c8565b506112ef9291506112f3565b5090565b61069a91905b808211156112ef57600081556001016112f95600a165627a7a72305820a422640f0a57494daef9fc6216d5369240b95deaca2773f8c354cdfdecc913940029`
|
|
|
|
// DeployTomoValidator deploys a new Ethereum contract, binding an instance of TomoValidator to it.
|
|
func DeployTomoValidator(auth *bind.TransactOpts, backend bind.ContractBackend, _candidates []common.Address, _caps []*big.Int, _firstOwner common.Address, _minCandidateCap *big.Int, _maxValidatorNumber *big.Int, _candidateWithdrawDelay *big.Int, _voterWithdrawDelay *big.Int) (common.Address, *types.Transaction, *TomoValidator, error) {
|
|
parsed, err := abi.JSON(strings.NewReader(TomoValidatorABI))
|
|
if err != nil {
|
|
return common.Address{}, nil, nil, err
|
|
}
|
|
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(TomoValidatorBin), backend, _candidates, _caps, _firstOwner, _minCandidateCap, _maxValidatorNumber, _candidateWithdrawDelay, _voterWithdrawDelay)
|
|
if err != nil {
|
|
return common.Address{}, nil, nil, err
|
|
}
|
|
return address, tx, &TomoValidator{TomoValidatorCaller: TomoValidatorCaller{contract: contract}, TomoValidatorTransactor: TomoValidatorTransactor{contract: contract}, TomoValidatorFilterer: TomoValidatorFilterer{contract: contract}}, nil
|
|
}
|
|
|
|
// TomoValidator is an auto generated Go binding around an Ethereum contract.
|
|
type TomoValidator struct {
|
|
TomoValidatorCaller // Read-only binding to the contract
|
|
TomoValidatorTransactor // Write-only binding to the contract
|
|
TomoValidatorFilterer // Log filterer for contract events
|
|
}
|
|
|
|
// TomoValidatorCaller is an auto generated read-only Go binding around an Ethereum contract.
|
|
type TomoValidatorCaller struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// TomoValidatorTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
|
type TomoValidatorTransactor struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// TomoValidatorFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
|
type TomoValidatorFilterer struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// TomoValidatorSession is an auto generated Go binding around an Ethereum contract,
|
|
// with pre-set call and transact options.
|
|
type TomoValidatorSession struct {
|
|
Contract *TomoValidator // 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
|
|
}
|
|
|
|
// TomoValidatorCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
|
// with pre-set call options.
|
|
type TomoValidatorCallerSession struct {
|
|
Contract *TomoValidatorCaller // Generic contract caller binding to set the session for
|
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
|
}
|
|
|
|
// TomoValidatorTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
|
// with pre-set transact options.
|
|
type TomoValidatorTransactorSession struct {
|
|
Contract *TomoValidatorTransactor // Generic contract transactor binding to set the session for
|
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
|
}
|
|
|
|
// TomoValidatorRaw is an auto generated low-level Go binding around an Ethereum contract.
|
|
type TomoValidatorRaw struct {
|
|
Contract *TomoValidator // Generic contract binding to access the raw methods on
|
|
}
|
|
|
|
// TomoValidatorCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
|
type TomoValidatorCallerRaw struct {
|
|
Contract *TomoValidatorCaller // Generic read-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// TomoValidatorTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
|
type TomoValidatorTransactorRaw struct {
|
|
Contract *TomoValidatorTransactor // Generic write-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// NewTomoValidator creates a new instance of TomoValidator, bound to a specific deployed contract.
|
|
func NewTomoValidator(address common.Address, backend bind.ContractBackend) (*TomoValidator, error) {
|
|
contract, err := bindTomoValidator(address, backend, backend, backend)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidator{TomoValidatorCaller: TomoValidatorCaller{contract: contract}, TomoValidatorTransactor: TomoValidatorTransactor{contract: contract}, TomoValidatorFilterer: TomoValidatorFilterer{contract: contract}}, nil
|
|
}
|
|
|
|
// NewTomoValidatorCaller creates a new read-only instance of TomoValidator, bound to a specific deployed contract.
|
|
func NewTomoValidatorCaller(address common.Address, caller bind.ContractCaller) (*TomoValidatorCaller, error) {
|
|
contract, err := bindTomoValidator(address, caller, nil, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidatorCaller{contract: contract}, nil
|
|
}
|
|
|
|
// NewTomoValidatorTransactor creates a new write-only instance of TomoValidator, bound to a specific deployed contract.
|
|
func NewTomoValidatorTransactor(address common.Address, transactor bind.ContractTransactor) (*TomoValidatorTransactor, error) {
|
|
contract, err := bindTomoValidator(address, nil, transactor, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidatorTransactor{contract: contract}, nil
|
|
}
|
|
|
|
// NewTomoValidatorFilterer creates a new log filterer instance of TomoValidator, bound to a specific deployed contract.
|
|
func NewTomoValidatorFilterer(address common.Address, filterer bind.ContractFilterer) (*TomoValidatorFilterer, error) {
|
|
contract, err := bindTomoValidator(address, nil, nil, filterer)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidatorFilterer{contract: contract}, nil
|
|
}
|
|
|
|
// bindTomoValidator binds a generic wrapper to an already deployed contract.
|
|
func bindTomoValidator(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
|
parsed, err := abi.JSON(strings.NewReader(TomoValidatorABI))
|
|
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 (_TomoValidator *TomoValidatorRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
|
|
return _TomoValidator.Contract.TomoValidatorCaller.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 (_TomoValidator *TomoValidatorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.TomoValidatorTransactor.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_TomoValidator *TomoValidatorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.TomoValidatorTransactor.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 (_TomoValidator *TomoValidatorCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
|
|
return _TomoValidator.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 (_TomoValidator *TomoValidatorTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_TomoValidator *TomoValidatorTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.contract.Transact(opts, method, params...)
|
|
}
|
|
|
|
// CandidateCount is a free data retrieval call binding the contract method 0xa9a981a3.
|
|
//
|
|
// Solidity: function candidateCount() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCaller) CandidateCount(opts *bind.CallOpts) (*big.Int, error) {
|
|
var (
|
|
ret0 = new(*big.Int)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "candidateCount")
|
|
return *ret0, err
|
|
}
|
|
|
|
// CandidateCount is a free data retrieval call binding the contract method 0xa9a981a3.
|
|
//
|
|
// Solidity: function candidateCount() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorSession) CandidateCount() (*big.Int, error) {
|
|
return _TomoValidator.Contract.CandidateCount(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// CandidateCount is a free data retrieval call binding the contract method 0xa9a981a3.
|
|
//
|
|
// Solidity: function candidateCount() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCallerSession) CandidateCount() (*big.Int, error) {
|
|
return _TomoValidator.Contract.CandidateCount(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// CandidateWithdrawDelay is a free data retrieval call binding the contract method 0xd161c767.
|
|
//
|
|
// Solidity: function candidateWithdrawDelay() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCaller) CandidateWithdrawDelay(opts *bind.CallOpts) (*big.Int, error) {
|
|
var (
|
|
ret0 = new(*big.Int)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "candidateWithdrawDelay")
|
|
return *ret0, err
|
|
}
|
|
|
|
// CandidateWithdrawDelay is a free data retrieval call binding the contract method 0xd161c767.
|
|
//
|
|
// Solidity: function candidateWithdrawDelay() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorSession) CandidateWithdrawDelay() (*big.Int, error) {
|
|
return _TomoValidator.Contract.CandidateWithdrawDelay(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// CandidateWithdrawDelay is a free data retrieval call binding the contract method 0xd161c767.
|
|
//
|
|
// Solidity: function candidateWithdrawDelay() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCallerSession) CandidateWithdrawDelay() (*big.Int, error) {
|
|
return _TomoValidator.Contract.CandidateWithdrawDelay(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// Candidates is a free data retrieval call binding the contract method 0x3477ee2e.
|
|
//
|
|
// Solidity: function candidates( uint256) constant returns(address)
|
|
func (_TomoValidator *TomoValidatorCaller) Candidates(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {
|
|
var (
|
|
ret0 = new(common.Address)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "candidates", arg0)
|
|
return *ret0, err
|
|
}
|
|
|
|
// Candidates is a free data retrieval call binding the contract method 0x3477ee2e.
|
|
//
|
|
// Solidity: function candidates( uint256) constant returns(address)
|
|
func (_TomoValidator *TomoValidatorSession) Candidates(arg0 *big.Int) (common.Address, error) {
|
|
return _TomoValidator.Contract.Candidates(&_TomoValidator.CallOpts, arg0)
|
|
}
|
|
|
|
// Candidates is a free data retrieval call binding the contract method 0x3477ee2e.
|
|
//
|
|
// Solidity: function candidates( uint256) constant returns(address)
|
|
func (_TomoValidator *TomoValidatorCallerSession) Candidates(arg0 *big.Int) (common.Address, error) {
|
|
return _TomoValidator.Contract.Candidates(&_TomoValidator.CallOpts, arg0)
|
|
}
|
|
|
|
// GetCandidateCap is a free data retrieval call binding the contract method 0x58e7525f.
|
|
//
|
|
// Solidity: function getCandidateCap(_candidate address) constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCaller) GetCandidateCap(opts *bind.CallOpts, _candidate common.Address) (*big.Int, error) {
|
|
var (
|
|
ret0 = new(*big.Int)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "getCandidateCap", _candidate)
|
|
return *ret0, err
|
|
}
|
|
|
|
// GetCandidateCap is a free data retrieval call binding the contract method 0x58e7525f.
|
|
//
|
|
// Solidity: function getCandidateCap(_candidate address) constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorSession) GetCandidateCap(_candidate common.Address) (*big.Int, error) {
|
|
return _TomoValidator.Contract.GetCandidateCap(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// GetCandidateCap is a free data retrieval call binding the contract method 0x58e7525f.
|
|
//
|
|
// Solidity: function getCandidateCap(_candidate address) constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCallerSession) GetCandidateCap(_candidate common.Address) (*big.Int, error) {
|
|
return _TomoValidator.Contract.GetCandidateCap(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// GetCandidateNodeId is a free data retrieval call binding the contract method 0x7d40257f.
|
|
//
|
|
// Solidity: function getCandidateNodeId(_candidate address) constant returns(string)
|
|
func (_TomoValidator *TomoValidatorCaller) GetCandidateNodeId(opts *bind.CallOpts, _candidate common.Address) (string, error) {
|
|
var (
|
|
ret0 = new(string)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "getCandidateNodeId", _candidate)
|
|
return *ret0, err
|
|
}
|
|
|
|
// GetCandidateNodeId is a free data retrieval call binding the contract method 0x7d40257f.
|
|
//
|
|
// Solidity: function getCandidateNodeId(_candidate address) constant returns(string)
|
|
func (_TomoValidator *TomoValidatorSession) GetCandidateNodeId(_candidate common.Address) (string, error) {
|
|
return _TomoValidator.Contract.GetCandidateNodeId(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// GetCandidateNodeId is a free data retrieval call binding the contract method 0x7d40257f.
|
|
//
|
|
// Solidity: function getCandidateNodeId(_candidate address) constant returns(string)
|
|
func (_TomoValidator *TomoValidatorCallerSession) GetCandidateNodeId(_candidate common.Address) (string, error) {
|
|
return _TomoValidator.Contract.GetCandidateNodeId(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// GetCandidateOwner is a free data retrieval call binding the contract method 0xb642facd.
|
|
//
|
|
// Solidity: function getCandidateOwner(_candidate address) constant returns(address)
|
|
func (_TomoValidator *TomoValidatorCaller) GetCandidateOwner(opts *bind.CallOpts, _candidate common.Address) (common.Address, error) {
|
|
var (
|
|
ret0 = new(common.Address)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "getCandidateOwner", _candidate)
|
|
return *ret0, err
|
|
}
|
|
|
|
// GetCandidateOwner is a free data retrieval call binding the contract method 0xb642facd.
|
|
//
|
|
// Solidity: function getCandidateOwner(_candidate address) constant returns(address)
|
|
func (_TomoValidator *TomoValidatorSession) GetCandidateOwner(_candidate common.Address) (common.Address, error) {
|
|
return _TomoValidator.Contract.GetCandidateOwner(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// GetCandidateOwner is a free data retrieval call binding the contract method 0xb642facd.
|
|
//
|
|
// Solidity: function getCandidateOwner(_candidate address) constant returns(address)
|
|
func (_TomoValidator *TomoValidatorCallerSession) GetCandidateOwner(_candidate common.Address) (common.Address, error) {
|
|
return _TomoValidator.Contract.GetCandidateOwner(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// GetCandidates is a free data retrieval call binding the contract method 0x06a49fce.
|
|
//
|
|
// Solidity: function getCandidates() constant returns(address[])
|
|
func (_TomoValidator *TomoValidatorCaller) GetCandidates(opts *bind.CallOpts) ([]common.Address, error) {
|
|
var (
|
|
ret0 = new([]common.Address)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "getCandidates")
|
|
return *ret0, err
|
|
}
|
|
|
|
// GetCandidates is a free data retrieval call binding the contract method 0x06a49fce.
|
|
//
|
|
// Solidity: function getCandidates() constant returns(address[])
|
|
func (_TomoValidator *TomoValidatorSession) GetCandidates() ([]common.Address, error) {
|
|
return _TomoValidator.Contract.GetCandidates(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// GetCandidates is a free data retrieval call binding the contract method 0x06a49fce.
|
|
//
|
|
// Solidity: function getCandidates() constant returns(address[])
|
|
func (_TomoValidator *TomoValidatorCallerSession) GetCandidates() ([]common.Address, error) {
|
|
return _TomoValidator.Contract.GetCandidates(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// GetVoterCap is a free data retrieval call binding the contract method 0x302b6872.
|
|
//
|
|
// Solidity: function getVoterCap(_candidate address, _voter address) constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCaller) GetVoterCap(opts *bind.CallOpts, _candidate common.Address, _voter common.Address) (*big.Int, error) {
|
|
var (
|
|
ret0 = new(*big.Int)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "getVoterCap", _candidate, _voter)
|
|
return *ret0, err
|
|
}
|
|
|
|
// GetVoterCap is a free data retrieval call binding the contract method 0x302b6872.
|
|
//
|
|
// Solidity: function getVoterCap(_candidate address, _voter address) constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorSession) GetVoterCap(_candidate common.Address, _voter common.Address) (*big.Int, error) {
|
|
return _TomoValidator.Contract.GetVoterCap(&_TomoValidator.CallOpts, _candidate, _voter)
|
|
}
|
|
|
|
// GetVoterCap is a free data retrieval call binding the contract method 0x302b6872.
|
|
//
|
|
// Solidity: function getVoterCap(_candidate address, _voter address) constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCallerSession) GetVoterCap(_candidate common.Address, _voter common.Address) (*big.Int, error) {
|
|
return _TomoValidator.Contract.GetVoterCap(&_TomoValidator.CallOpts, _candidate, _voter)
|
|
}
|
|
|
|
// GetVoters is a free data retrieval call binding the contract method 0x2d15cc04.
|
|
//
|
|
// Solidity: function getVoters(_candidate address) constant returns(address[])
|
|
func (_TomoValidator *TomoValidatorCaller) GetVoters(opts *bind.CallOpts, _candidate common.Address) ([]common.Address, error) {
|
|
var (
|
|
ret0 = new([]common.Address)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "getVoters", _candidate)
|
|
return *ret0, err
|
|
}
|
|
|
|
// GetVoters is a free data retrieval call binding the contract method 0x2d15cc04.
|
|
//
|
|
// Solidity: function getVoters(_candidate address) constant returns(address[])
|
|
func (_TomoValidator *TomoValidatorSession) GetVoters(_candidate common.Address) ([]common.Address, error) {
|
|
return _TomoValidator.Contract.GetVoters(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// GetVoters is a free data retrieval call binding the contract method 0x2d15cc04.
|
|
//
|
|
// Solidity: function getVoters(_candidate address) constant returns(address[])
|
|
func (_TomoValidator *TomoValidatorCallerSession) GetVoters(_candidate common.Address) ([]common.Address, error) {
|
|
return _TomoValidator.Contract.GetVoters(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// GetWithdrawBlockNumbers is a free data retrieval call binding the contract method 0x2f9c4bba.
|
|
//
|
|
// Solidity: function getWithdrawBlockNumbers() constant returns(uint256[])
|
|
func (_TomoValidator *TomoValidatorCaller) GetWithdrawBlockNumbers(opts *bind.CallOpts) ([]*big.Int, error) {
|
|
var (
|
|
ret0 = new([]*big.Int)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "getWithdrawBlockNumbers")
|
|
return *ret0, err
|
|
}
|
|
|
|
// GetWithdrawBlockNumbers is a free data retrieval call binding the contract method 0x2f9c4bba.
|
|
//
|
|
// Solidity: function getWithdrawBlockNumbers() constant returns(uint256[])
|
|
func (_TomoValidator *TomoValidatorSession) GetWithdrawBlockNumbers() ([]*big.Int, error) {
|
|
return _TomoValidator.Contract.GetWithdrawBlockNumbers(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// GetWithdrawBlockNumbers is a free data retrieval call binding the contract method 0x2f9c4bba.
|
|
//
|
|
// Solidity: function getWithdrawBlockNumbers() constant returns(uint256[])
|
|
func (_TomoValidator *TomoValidatorCallerSession) GetWithdrawBlockNumbers() ([]*big.Int, error) {
|
|
return _TomoValidator.Contract.GetWithdrawBlockNumbers(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// IsCandidate is a free data retrieval call binding the contract method 0xd51b9e93.
|
|
//
|
|
// Solidity: function isCandidate(_candidate address) constant returns(bool)
|
|
func (_TomoValidator *TomoValidatorCaller) IsCandidate(opts *bind.CallOpts, _candidate common.Address) (bool, error) {
|
|
var (
|
|
ret0 = new(bool)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "isCandidate", _candidate)
|
|
return *ret0, err
|
|
}
|
|
|
|
// IsCandidate is a free data retrieval call binding the contract method 0xd51b9e93.
|
|
//
|
|
// Solidity: function isCandidate(_candidate address) constant returns(bool)
|
|
func (_TomoValidator *TomoValidatorSession) IsCandidate(_candidate common.Address) (bool, error) {
|
|
return _TomoValidator.Contract.IsCandidate(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// IsCandidate is a free data retrieval call binding the contract method 0xd51b9e93.
|
|
//
|
|
// Solidity: function isCandidate(_candidate address) constant returns(bool)
|
|
func (_TomoValidator *TomoValidatorCallerSession) IsCandidate(_candidate common.Address) (bool, error) {
|
|
return _TomoValidator.Contract.IsCandidate(&_TomoValidator.CallOpts, _candidate)
|
|
}
|
|
|
|
// MaxValidatorNumber is a free data retrieval call binding the contract method 0xd09f1ab4.
|
|
//
|
|
// Solidity: function maxValidatorNumber() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCaller) MaxValidatorNumber(opts *bind.CallOpts) (*big.Int, error) {
|
|
var (
|
|
ret0 = new(*big.Int)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "maxValidatorNumber")
|
|
return *ret0, err
|
|
}
|
|
|
|
// MaxValidatorNumber is a free data retrieval call binding the contract method 0xd09f1ab4.
|
|
//
|
|
// Solidity: function maxValidatorNumber() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorSession) MaxValidatorNumber() (*big.Int, error) {
|
|
return _TomoValidator.Contract.MaxValidatorNumber(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// MaxValidatorNumber is a free data retrieval call binding the contract method 0xd09f1ab4.
|
|
//
|
|
// Solidity: function maxValidatorNumber() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCallerSession) MaxValidatorNumber() (*big.Int, error) {
|
|
return _TomoValidator.Contract.MaxValidatorNumber(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// MinCandidateCap is a free data retrieval call binding the contract method 0xd55b7dff.
|
|
//
|
|
// Solidity: function minCandidateCap() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCaller) MinCandidateCap(opts *bind.CallOpts) (*big.Int, error) {
|
|
var (
|
|
ret0 = new(*big.Int)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "minCandidateCap")
|
|
return *ret0, err
|
|
}
|
|
|
|
// MinCandidateCap is a free data retrieval call binding the contract method 0xd55b7dff.
|
|
//
|
|
// Solidity: function minCandidateCap() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorSession) MinCandidateCap() (*big.Int, error) {
|
|
return _TomoValidator.Contract.MinCandidateCap(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// MinCandidateCap is a free data retrieval call binding the contract method 0xd55b7dff.
|
|
//
|
|
// Solidity: function minCandidateCap() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCallerSession) MinCandidateCap() (*big.Int, error) {
|
|
return _TomoValidator.Contract.MinCandidateCap(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// VoterWithdrawDelay is a free data retrieval call binding the contract method 0xa9ff959e.
|
|
//
|
|
// Solidity: function voterWithdrawDelay() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCaller) VoterWithdrawDelay(opts *bind.CallOpts) (*big.Int, error) {
|
|
var (
|
|
ret0 = new(*big.Int)
|
|
)
|
|
out := ret0
|
|
err := _TomoValidator.contract.Call(opts, out, "voterWithdrawDelay")
|
|
return *ret0, err
|
|
}
|
|
|
|
// VoterWithdrawDelay is a free data retrieval call binding the contract method 0xa9ff959e.
|
|
//
|
|
// Solidity: function voterWithdrawDelay() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorSession) VoterWithdrawDelay() (*big.Int, error) {
|
|
return _TomoValidator.Contract.VoterWithdrawDelay(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// VoterWithdrawDelay is a free data retrieval call binding the contract method 0xa9ff959e.
|
|
//
|
|
// Solidity: function voterWithdrawDelay() constant returns(uint256)
|
|
func (_TomoValidator *TomoValidatorCallerSession) VoterWithdrawDelay() (*big.Int, error) {
|
|
return _TomoValidator.Contract.VoterWithdrawDelay(&_TomoValidator.CallOpts)
|
|
}
|
|
|
|
// Propose is a paid mutator transaction binding the contract method 0xd6f0948c.
|
|
//
|
|
// Solidity: function propose(_candidate address, _nodeId string) returns()
|
|
func (_TomoValidator *TomoValidatorTransactor) Propose(opts *bind.TransactOpts, _candidate common.Address, _nodeId string) (*types.Transaction, error) {
|
|
return _TomoValidator.contract.Transact(opts, "propose", _candidate, _nodeId)
|
|
}
|
|
|
|
// Propose is a paid mutator transaction binding the contract method 0xd6f0948c.
|
|
//
|
|
// Solidity: function propose(_candidate address, _nodeId string) returns()
|
|
func (_TomoValidator *TomoValidatorSession) Propose(_candidate common.Address, _nodeId string) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Propose(&_TomoValidator.TransactOpts, _candidate, _nodeId)
|
|
}
|
|
|
|
// Propose is a paid mutator transaction binding the contract method 0xd6f0948c.
|
|
//
|
|
// Solidity: function propose(_candidate address, _nodeId string) returns()
|
|
func (_TomoValidator *TomoValidatorTransactorSession) Propose(_candidate common.Address, _nodeId string) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Propose(&_TomoValidator.TransactOpts, _candidate, _nodeId)
|
|
}
|
|
|
|
// Resign is a paid mutator transaction binding the contract method 0xae6e43f5.
|
|
//
|
|
// Solidity: function resign(_candidate address) returns()
|
|
func (_TomoValidator *TomoValidatorTransactor) Resign(opts *bind.TransactOpts, _candidate common.Address) (*types.Transaction, error) {
|
|
return _TomoValidator.contract.Transact(opts, "resign", _candidate)
|
|
}
|
|
|
|
// Resign is a paid mutator transaction binding the contract method 0xae6e43f5.
|
|
//
|
|
// Solidity: function resign(_candidate address) returns()
|
|
func (_TomoValidator *TomoValidatorSession) Resign(_candidate common.Address) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Resign(&_TomoValidator.TransactOpts, _candidate)
|
|
}
|
|
|
|
// Resign is a paid mutator transaction binding the contract method 0xae6e43f5.
|
|
//
|
|
// Solidity: function resign(_candidate address) returns()
|
|
func (_TomoValidator *TomoValidatorTransactorSession) Resign(_candidate common.Address) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Resign(&_TomoValidator.TransactOpts, _candidate)
|
|
}
|
|
|
|
// SetNodeId is a paid mutator transaction binding the contract method 0x6a000d74.
|
|
//
|
|
// Solidity: function setNodeId(_candidate address, _nodeId string) returns()
|
|
func (_TomoValidator *TomoValidatorTransactor) SetNodeId(opts *bind.TransactOpts, _candidate common.Address, _nodeId string) (*types.Transaction, error) {
|
|
return _TomoValidator.contract.Transact(opts, "setNodeId", _candidate, _nodeId)
|
|
}
|
|
|
|
// SetNodeId is a paid mutator transaction binding the contract method 0x6a000d74.
|
|
//
|
|
// Solidity: function setNodeId(_candidate address, _nodeId string) returns()
|
|
func (_TomoValidator *TomoValidatorSession) SetNodeId(_candidate common.Address, _nodeId string) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.SetNodeId(&_TomoValidator.TransactOpts, _candidate, _nodeId)
|
|
}
|
|
|
|
// SetNodeId is a paid mutator transaction binding the contract method 0x6a000d74.
|
|
//
|
|
// Solidity: function setNodeId(_candidate address, _nodeId string) returns()
|
|
func (_TomoValidator *TomoValidatorTransactorSession) SetNodeId(_candidate common.Address, _nodeId string) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.SetNodeId(&_TomoValidator.TransactOpts, _candidate, _nodeId)
|
|
}
|
|
|
|
// Unvote is a paid mutator transaction binding the contract method 0x02aa9be2.
|
|
//
|
|
// Solidity: function unvote(_candidate address, _cap uint256) returns()
|
|
func (_TomoValidator *TomoValidatorTransactor) Unvote(opts *bind.TransactOpts, _candidate common.Address, _cap *big.Int) (*types.Transaction, error) {
|
|
return _TomoValidator.contract.Transact(opts, "unvote", _candidate, _cap)
|
|
}
|
|
|
|
// Unvote is a paid mutator transaction binding the contract method 0x02aa9be2.
|
|
//
|
|
// Solidity: function unvote(_candidate address, _cap uint256) returns()
|
|
func (_TomoValidator *TomoValidatorSession) Unvote(_candidate common.Address, _cap *big.Int) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Unvote(&_TomoValidator.TransactOpts, _candidate, _cap)
|
|
}
|
|
|
|
// Unvote is a paid mutator transaction binding the contract method 0x02aa9be2.
|
|
//
|
|
// Solidity: function unvote(_candidate address, _cap uint256) returns()
|
|
func (_TomoValidator *TomoValidatorTransactorSession) Unvote(_candidate common.Address, _cap *big.Int) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Unvote(&_TomoValidator.TransactOpts, _candidate, _cap)
|
|
}
|
|
|
|
// Vote is a paid mutator transaction binding the contract method 0x6dd7d8ea.
|
|
//
|
|
// Solidity: function vote(_candidate address) returns()
|
|
func (_TomoValidator *TomoValidatorTransactor) Vote(opts *bind.TransactOpts, _candidate common.Address) (*types.Transaction, error) {
|
|
return _TomoValidator.contract.Transact(opts, "vote", _candidate)
|
|
}
|
|
|
|
// Vote is a paid mutator transaction binding the contract method 0x6dd7d8ea.
|
|
//
|
|
// Solidity: function vote(_candidate address) returns()
|
|
func (_TomoValidator *TomoValidatorSession) Vote(_candidate common.Address) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Vote(&_TomoValidator.TransactOpts, _candidate)
|
|
}
|
|
|
|
// Vote is a paid mutator transaction binding the contract method 0x6dd7d8ea.
|
|
//
|
|
// Solidity: function vote(_candidate address) returns()
|
|
func (_TomoValidator *TomoValidatorTransactorSession) Vote(_candidate common.Address) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Vote(&_TomoValidator.TransactOpts, _candidate)
|
|
}
|
|
|
|
// Withdraw is a paid mutator transaction binding the contract method 0x441a3e70.
|
|
//
|
|
// Solidity: function withdraw(_blockNumber uint256, _index uint256) returns()
|
|
func (_TomoValidator *TomoValidatorTransactor) Withdraw(opts *bind.TransactOpts, _blockNumber *big.Int, _index *big.Int) (*types.Transaction, error) {
|
|
return _TomoValidator.contract.Transact(opts, "withdraw", _blockNumber, _index)
|
|
}
|
|
|
|
// Withdraw is a paid mutator transaction binding the contract method 0x441a3e70.
|
|
//
|
|
// Solidity: function withdraw(_blockNumber uint256, _index uint256) returns()
|
|
func (_TomoValidator *TomoValidatorSession) Withdraw(_blockNumber *big.Int, _index *big.Int) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Withdraw(&_TomoValidator.TransactOpts, _blockNumber, _index)
|
|
}
|
|
|
|
// Withdraw is a paid mutator transaction binding the contract method 0x441a3e70.
|
|
//
|
|
// Solidity: function withdraw(_blockNumber uint256, _index uint256) returns()
|
|
func (_TomoValidator *TomoValidatorTransactorSession) Withdraw(_blockNumber *big.Int, _index *big.Int) (*types.Transaction, error) {
|
|
return _TomoValidator.Contract.Withdraw(&_TomoValidator.TransactOpts, _blockNumber, _index)
|
|
}
|
|
|
|
// TomoValidatorProposeIterator is returned from FilterPropose and is used to iterate over the raw logs and unpacked data for Propose events raised by the TomoValidator contract.
|
|
type TomoValidatorProposeIterator struct {
|
|
Event *TomoValidatorPropose // 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 *TomoValidatorProposeIterator) 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(TomoValidatorPropose)
|
|
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(TomoValidatorPropose)
|
|
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 *TomoValidatorProposeIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TomoValidatorProposeIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TomoValidatorPropose represents a Propose event raised by the TomoValidator contract.
|
|
type TomoValidatorPropose struct {
|
|
Owner common.Address
|
|
Candidate common.Address
|
|
Cap *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterPropose is a free log retrieval operation binding the contract event 0x7635f1d87b47fba9f2b09e56eb4be75cca030e0cb179c1602ac9261d39a8f5c1.
|
|
//
|
|
// Solidity: event Propose(_owner address, _candidate address, _cap uint256)
|
|
func (_TomoValidator *TomoValidatorFilterer) FilterPropose(opts *bind.FilterOpts) (*TomoValidatorProposeIterator, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "Propose")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidatorProposeIterator{contract: _TomoValidator.contract, event: "Propose", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchPropose is a free log subscription operation binding the contract event 0x7635f1d87b47fba9f2b09e56eb4be75cca030e0cb179c1602ac9261d39a8f5c1.
|
|
//
|
|
// Solidity: event Propose(_owner address, _candidate address, _cap uint256)
|
|
func (_TomoValidator *TomoValidatorFilterer) WatchPropose(opts *bind.WatchOpts, sink chan<- *TomoValidatorPropose) (event.Subscription, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.WatchLogs(opts, "Propose")
|
|
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(TomoValidatorPropose)
|
|
if err := _TomoValidator.contract.UnpackLog(event, "Propose", 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
|
|
}
|
|
|
|
// TomoValidatorResignIterator is returned from FilterResign and is used to iterate over the raw logs and unpacked data for Resign events raised by the TomoValidator contract.
|
|
type TomoValidatorResignIterator struct {
|
|
Event *TomoValidatorResign // 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 *TomoValidatorResignIterator) 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(TomoValidatorResign)
|
|
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(TomoValidatorResign)
|
|
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 *TomoValidatorResignIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TomoValidatorResignIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TomoValidatorResign represents a Resign event raised by the TomoValidator contract.
|
|
type TomoValidatorResign struct {
|
|
Owner common.Address
|
|
Candidate common.Address
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterResign is a free log retrieval operation binding the contract event 0x4edf3e325d0063213a39f9085522994a1c44bea5f39e7d63ef61260a1e58c6d3.
|
|
//
|
|
// Solidity: event Resign(_owner address, _candidate address)
|
|
func (_TomoValidator *TomoValidatorFilterer) FilterResign(opts *bind.FilterOpts) (*TomoValidatorResignIterator, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "Resign")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidatorResignIterator{contract: _TomoValidator.contract, event: "Resign", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchResign is a free log subscription operation binding the contract event 0x4edf3e325d0063213a39f9085522994a1c44bea5f39e7d63ef61260a1e58c6d3.
|
|
//
|
|
// Solidity: event Resign(_owner address, _candidate address)
|
|
func (_TomoValidator *TomoValidatorFilterer) WatchResign(opts *bind.WatchOpts, sink chan<- *TomoValidatorResign) (event.Subscription, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.WatchLogs(opts, "Resign")
|
|
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(TomoValidatorResign)
|
|
if err := _TomoValidator.contract.UnpackLog(event, "Resign", 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
|
|
}
|
|
|
|
// TomoValidatorSetNodeIdIterator is returned from FilterSetNodeId and is used to iterate over the raw logs and unpacked data for SetNodeId events raised by the TomoValidator contract.
|
|
type TomoValidatorSetNodeIdIterator struct {
|
|
Event *TomoValidatorSetNodeId // 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 *TomoValidatorSetNodeIdIterator) 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(TomoValidatorSetNodeId)
|
|
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(TomoValidatorSetNodeId)
|
|
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 *TomoValidatorSetNodeIdIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TomoValidatorSetNodeIdIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TomoValidatorSetNodeId represents a SetNodeId event raised by the TomoValidator contract.
|
|
type TomoValidatorSetNodeId struct {
|
|
Owner common.Address
|
|
Candidate common.Address
|
|
NodeId string
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterSetNodeId is a free log retrieval operation binding the contract event 0x0e421c04ccd34fafbe77c6b2f9384de8c5c4795114325fedb698a6ce62b2d744.
|
|
//
|
|
// Solidity: event SetNodeId(_owner address, _candidate address, _nodeId string)
|
|
func (_TomoValidator *TomoValidatorFilterer) FilterSetNodeId(opts *bind.FilterOpts) (*TomoValidatorSetNodeIdIterator, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "SetNodeId")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidatorSetNodeIdIterator{contract: _TomoValidator.contract, event: "SetNodeId", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchSetNodeId is a free log subscription operation binding the contract event 0x0e421c04ccd34fafbe77c6b2f9384de8c5c4795114325fedb698a6ce62b2d744.
|
|
//
|
|
// Solidity: event SetNodeId(_owner address, _candidate address, _nodeId string)
|
|
func (_TomoValidator *TomoValidatorFilterer) WatchSetNodeId(opts *bind.WatchOpts, sink chan<- *TomoValidatorSetNodeId) (event.Subscription, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.WatchLogs(opts, "SetNodeId")
|
|
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(TomoValidatorSetNodeId)
|
|
if err := _TomoValidator.contract.UnpackLog(event, "SetNodeId", 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
|
|
}
|
|
|
|
// TomoValidatorUnvoteIterator is returned from FilterUnvote and is used to iterate over the raw logs and unpacked data for Unvote events raised by the TomoValidator contract.
|
|
type TomoValidatorUnvoteIterator struct {
|
|
Event *TomoValidatorUnvote // 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 *TomoValidatorUnvoteIterator) 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(TomoValidatorUnvote)
|
|
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(TomoValidatorUnvote)
|
|
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 *TomoValidatorUnvoteIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TomoValidatorUnvoteIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TomoValidatorUnvote represents a Unvote event raised by the TomoValidator contract.
|
|
type TomoValidatorUnvote struct {
|
|
Voter common.Address
|
|
Candidate common.Address
|
|
Cap *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterUnvote is a free log retrieval operation binding the contract event 0xaa0e554f781c3c3b2be110a0557f260f11af9a8aa2c64bc1e7a31dbb21e32fa2.
|
|
//
|
|
// Solidity: event Unvote(_voter address, _candidate address, _cap uint256)
|
|
func (_TomoValidator *TomoValidatorFilterer) FilterUnvote(opts *bind.FilterOpts) (*TomoValidatorUnvoteIterator, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "Unvote")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidatorUnvoteIterator{contract: _TomoValidator.contract, event: "Unvote", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchUnvote is a free log subscription operation binding the contract event 0xaa0e554f781c3c3b2be110a0557f260f11af9a8aa2c64bc1e7a31dbb21e32fa2.
|
|
//
|
|
// Solidity: event Unvote(_voter address, _candidate address, _cap uint256)
|
|
func (_TomoValidator *TomoValidatorFilterer) WatchUnvote(opts *bind.WatchOpts, sink chan<- *TomoValidatorUnvote) (event.Subscription, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.WatchLogs(opts, "Unvote")
|
|
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(TomoValidatorUnvote)
|
|
if err := _TomoValidator.contract.UnpackLog(event, "Unvote", 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
|
|
}
|
|
|
|
// TomoValidatorVoteIterator is returned from FilterVote and is used to iterate over the raw logs and unpacked data for Vote events raised by the TomoValidator contract.
|
|
type TomoValidatorVoteIterator struct {
|
|
Event *TomoValidatorVote // 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 *TomoValidatorVoteIterator) 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(TomoValidatorVote)
|
|
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(TomoValidatorVote)
|
|
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 *TomoValidatorVoteIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TomoValidatorVoteIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TomoValidatorVote represents a Vote event raised by the TomoValidator contract.
|
|
type TomoValidatorVote struct {
|
|
Voter common.Address
|
|
Candidate common.Address
|
|
Cap *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterVote is a free log retrieval operation binding the contract event 0x66a9138482c99e9baf08860110ef332cc0c23b4a199a53593d8db0fc8f96fbfc.
|
|
//
|
|
// Solidity: event Vote(_voter address, _candidate address, _cap uint256)
|
|
func (_TomoValidator *TomoValidatorFilterer) FilterVote(opts *bind.FilterOpts) (*TomoValidatorVoteIterator, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "Vote")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidatorVoteIterator{contract: _TomoValidator.contract, event: "Vote", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchVote is a free log subscription operation binding the contract event 0x66a9138482c99e9baf08860110ef332cc0c23b4a199a53593d8db0fc8f96fbfc.
|
|
//
|
|
// Solidity: event Vote(_voter address, _candidate address, _cap uint256)
|
|
func (_TomoValidator *TomoValidatorFilterer) WatchVote(opts *bind.WatchOpts, sink chan<- *TomoValidatorVote) (event.Subscription, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.WatchLogs(opts, "Vote")
|
|
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(TomoValidatorVote)
|
|
if err := _TomoValidator.contract.UnpackLog(event, "Vote", 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
|
|
}
|
|
|
|
// TomoValidatorWithdrawIterator is returned from FilterWithdraw and is used to iterate over the raw logs and unpacked data for Withdraw events raised by the TomoValidator contract.
|
|
type TomoValidatorWithdrawIterator struct {
|
|
Event *TomoValidatorWithdraw // 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 *TomoValidatorWithdrawIterator) 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(TomoValidatorWithdraw)
|
|
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(TomoValidatorWithdraw)
|
|
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 *TomoValidatorWithdrawIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TomoValidatorWithdrawIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TomoValidatorWithdraw represents a Withdraw event raised by the TomoValidator contract.
|
|
type TomoValidatorWithdraw struct {
|
|
Owner common.Address
|
|
BlockNumber *big.Int
|
|
Cap *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterWithdraw is a free log retrieval operation binding the contract event 0xf279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568.
|
|
//
|
|
// Solidity: event Withdraw(_owner address, _blockNumber uint256, _cap uint256)
|
|
func (_TomoValidator *TomoValidatorFilterer) FilterWithdraw(opts *bind.FilterOpts) (*TomoValidatorWithdrawIterator, error) {
|
|
|
|
logs, sub, err := _TomoValidator.contract.FilterLogs(opts, "Withdraw")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TomoValidatorWithdrawIterator{contract: _TomoValidator.contract, event: "Withdraw", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchWithdraw is a free log subscription operation binding the contract event 0xf279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568.
|
|
//
|
|
// Solidity: event Withdraw(_owner address, _blockNumber uint256, _cap uint256)
|
|
func (_TomoValidator *TomoValidatorFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *TomoValidatorWithdraw) (event.Subscription, error) {
|
|
|
|
logs, sub, err := _TomoValidator.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(TomoValidatorWithdraw)
|
|
if err := _TomoValidator.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
|
|
}
|