Hello Go!

This commit is contained in:
Râu Cao 2022-10-01 11:17:02 +02:00
commit 9b22e8323c
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
6 changed files with 4601 additions and 0 deletions

1285
contribution/contribution.go Normal file

File diff suppressed because one or more lines are too long

1262
contributor/contributor.go Normal file

File diff suppressed because one or more lines are too long

23
go.mod Normal file
View File

@ -0,0 +1,23 @@
module gitea.kosmos.org/kredits/contracts-go
go 1.19
require github.com/ethereum/go-ethereum v1.10.25
require (
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/rjeczalik/notify v0.9.1 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
)

53
go.sum Normal file
View File

@ -0,0 +1,53 @@
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o=
github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k=
github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk=
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4=
github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo=
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw=
github.com/ethereum/go-ethereum v1.10.25 h1:5dFrKJDnYf8L6/5o42abCE6a9yJm9cs4EJVRyYMr55s=
github.com/ethereum/go-ethereum v1.10.25/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA=
github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE=
github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4=
github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI=
github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA=
github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

View File

@ -0,0 +1,928 @@
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package reimbursement
import (
"errors"
"math/big"
"strings"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
)
// Reference imports to suppress errors if they are not otherwise used.
var (
_ = errors.New
_ = big.NewInt
_ = strings.NewReader
_ = ethereum.NotFound
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = event.NewSubscription
)
// ReimbursementMetaData contains all meta data concerning the Reimbursement contract.
var ReimbursementMetaData = &bind.MetaData{
ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addedByAccount\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ReimbursementAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"vetoedByAccount\",\"type\":\"address\"}],\"name\":\"ReimbursementVetoed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"recipientId\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"hashDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"hashFunction\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"hashSize\",\"type\":\"uint8\"}],\"name\":\"add\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blocksToWait\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"contributorContract\",\"outputs\":[{\"internalType\":\"contractContributorInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"reimbursementId\",\"type\":\"uint32\"}],\"name\":\"exists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"reimbursementId\",\"type\":\"uint32\"}],\"name\":\"get\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"recipientId\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"hashDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"hashFunction\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"hashSize\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"confirmedAtBlock\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"exists\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"vetoed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"contributorId\",\"type\":\"uint32\"}],\"name\":\"getContributorAddressById\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contributorAccount\",\"type\":\"address\"}],\"name\":\"getContributorIdByAddress\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"reimbursements\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"recipientId\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"hashDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"hashFunction\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"hashSize\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"confirmedAtBlock\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"vetoed\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"exists\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reimbursementsCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contributor\",\"type\":\"address\"}],\"name\":\"setContributorContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"confirmedOnly\",\"type\":\"bool\"}],\"name\":\"totalAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"reimbursementId\",\"type\":\"uint32\"}],\"name\":\"veto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
}
// ReimbursementABI is the input ABI used to generate the binding from.
// Deprecated: Use ReimbursementMetaData.ABI instead.
var ReimbursementABI = ReimbursementMetaData.ABI
// Reimbursement is an auto generated Go binding around an Ethereum contract.
type Reimbursement struct {
ReimbursementCaller // Read-only binding to the contract
ReimbursementTransactor // Write-only binding to the contract
ReimbursementFilterer // Log filterer for contract events
}
// ReimbursementCaller is an auto generated read-only Go binding around an Ethereum contract.
type ReimbursementCaller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// ReimbursementTransactor is an auto generated write-only Go binding around an Ethereum contract.
type ReimbursementTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// ReimbursementFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type ReimbursementFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// ReimbursementSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type ReimbursementSession struct {
Contract *Reimbursement // 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
}
// ReimbursementCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type ReimbursementCallerSession struct {
Contract *ReimbursementCaller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// ReimbursementTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type ReimbursementTransactorSession struct {
Contract *ReimbursementTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// ReimbursementRaw is an auto generated low-level Go binding around an Ethereum contract.
type ReimbursementRaw struct {
Contract *Reimbursement // Generic contract binding to access the raw methods on
}
// ReimbursementCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type ReimbursementCallerRaw struct {
Contract *ReimbursementCaller // Generic read-only contract binding to access the raw methods on
}
// ReimbursementTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type ReimbursementTransactorRaw struct {
Contract *ReimbursementTransactor // Generic write-only contract binding to access the raw methods on
}
// NewReimbursement creates a new instance of Reimbursement, bound to a specific deployed contract.
func NewReimbursement(address common.Address, backend bind.ContractBackend) (*Reimbursement, error) {
contract, err := bindReimbursement(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &Reimbursement{ReimbursementCaller: ReimbursementCaller{contract: contract}, ReimbursementTransactor: ReimbursementTransactor{contract: contract}, ReimbursementFilterer: ReimbursementFilterer{contract: contract}}, nil
}
// NewReimbursementCaller creates a new read-only instance of Reimbursement, bound to a specific deployed contract.
func NewReimbursementCaller(address common.Address, caller bind.ContractCaller) (*ReimbursementCaller, error) {
contract, err := bindReimbursement(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &ReimbursementCaller{contract: contract}, nil
}
// NewReimbursementTransactor creates a new write-only instance of Reimbursement, bound to a specific deployed contract.
func NewReimbursementTransactor(address common.Address, transactor bind.ContractTransactor) (*ReimbursementTransactor, error) {
contract, err := bindReimbursement(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &ReimbursementTransactor{contract: contract}, nil
}
// NewReimbursementFilterer creates a new log filterer instance of Reimbursement, bound to a specific deployed contract.
func NewReimbursementFilterer(address common.Address, filterer bind.ContractFilterer) (*ReimbursementFilterer, error) {
contract, err := bindReimbursement(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &ReimbursementFilterer{contract: contract}, nil
}
// bindReimbursement binds a generic wrapper to an already deployed contract.
func bindReimbursement(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(ReimbursementABI))
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 (_Reimbursement *ReimbursementRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Reimbursement.Contract.ReimbursementCaller.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 (_Reimbursement *ReimbursementRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Reimbursement.Contract.ReimbursementTransactor.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_Reimbursement *ReimbursementRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _Reimbursement.Contract.ReimbursementTransactor.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 (_Reimbursement *ReimbursementCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _Reimbursement.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 (_Reimbursement *ReimbursementTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Reimbursement.Contract.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_Reimbursement *ReimbursementTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _Reimbursement.Contract.contract.Transact(opts, method, params...)
}
// BlocksToWait is a free data retrieval call binding the contract method 0xd8dcac4f.
//
// Solidity: function blocksToWait() view returns(uint32)
func (_Reimbursement *ReimbursementCaller) BlocksToWait(opts *bind.CallOpts) (uint32, error) {
var out []interface{}
err := _Reimbursement.contract.Call(opts, &out, "blocksToWait")
if err != nil {
return *new(uint32), err
}
out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32)
return out0, err
}
// BlocksToWait is a free data retrieval call binding the contract method 0xd8dcac4f.
//
// Solidity: function blocksToWait() view returns(uint32)
func (_Reimbursement *ReimbursementSession) BlocksToWait() (uint32, error) {
return _Reimbursement.Contract.BlocksToWait(&_Reimbursement.CallOpts)
}
// BlocksToWait is a free data retrieval call binding the contract method 0xd8dcac4f.
//
// Solidity: function blocksToWait() view returns(uint32)
func (_Reimbursement *ReimbursementCallerSession) BlocksToWait() (uint32, error) {
return _Reimbursement.Contract.BlocksToWait(&_Reimbursement.CallOpts)
}
// ContributorContract is a free data retrieval call binding the contract method 0x7b8917d1.
//
// Solidity: function contributorContract() view returns(address)
func (_Reimbursement *ReimbursementCaller) ContributorContract(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _Reimbursement.contract.Call(opts, &out, "contributorContract")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// ContributorContract is a free data retrieval call binding the contract method 0x7b8917d1.
//
// Solidity: function contributorContract() view returns(address)
func (_Reimbursement *ReimbursementSession) ContributorContract() (common.Address, error) {
return _Reimbursement.Contract.ContributorContract(&_Reimbursement.CallOpts)
}
// ContributorContract is a free data retrieval call binding the contract method 0x7b8917d1.
//
// Solidity: function contributorContract() view returns(address)
func (_Reimbursement *ReimbursementCallerSession) ContributorContract() (common.Address, error) {
return _Reimbursement.Contract.ContributorContract(&_Reimbursement.CallOpts)
}
// Exists is a free data retrieval call binding the contract method 0x13c369ed.
//
// Solidity: function exists(uint32 reimbursementId) view returns(bool)
func (_Reimbursement *ReimbursementCaller) Exists(opts *bind.CallOpts, reimbursementId uint32) (bool, error) {
var out []interface{}
err := _Reimbursement.contract.Call(opts, &out, "exists", reimbursementId)
if err != nil {
return *new(bool), err
}
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
return out0, err
}
// Exists is a free data retrieval call binding the contract method 0x13c369ed.
//
// Solidity: function exists(uint32 reimbursementId) view returns(bool)
func (_Reimbursement *ReimbursementSession) Exists(reimbursementId uint32) (bool, error) {
return _Reimbursement.Contract.Exists(&_Reimbursement.CallOpts, reimbursementId)
}
// Exists is a free data retrieval call binding the contract method 0x13c369ed.
//
// Solidity: function exists(uint32 reimbursementId) view returns(bool)
func (_Reimbursement *ReimbursementCallerSession) Exists(reimbursementId uint32) (bool, error) {
return _Reimbursement.Contract.Exists(&_Reimbursement.CallOpts, reimbursementId)
}
// Get is a free data retrieval call binding the contract method 0xd8a26e3a.
//
// Solidity: function get(uint32 reimbursementId) view returns(uint32 id, uint32 recipientId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed)
func (_Reimbursement *ReimbursementCaller) Get(opts *bind.CallOpts, reimbursementId uint32) (struct {
Id uint32
RecipientId uint32
Amount *big.Int
Token common.Address
HashDigest [32]byte
HashFunction uint8
HashSize uint8
ConfirmedAtBlock *big.Int
Exists bool
Vetoed bool
}, error) {
var out []interface{}
err := _Reimbursement.contract.Call(opts, &out, "get", reimbursementId)
outstruct := new(struct {
Id uint32
RecipientId uint32
Amount *big.Int
Token common.Address
HashDigest [32]byte
HashFunction uint8
HashSize uint8
ConfirmedAtBlock *big.Int
Exists bool
Vetoed bool
})
if err != nil {
return *outstruct, err
}
outstruct.Id = *abi.ConvertType(out[0], new(uint32)).(*uint32)
outstruct.RecipientId = *abi.ConvertType(out[1], new(uint32)).(*uint32)
outstruct.Amount = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int)
outstruct.Token = *abi.ConvertType(out[3], new(common.Address)).(*common.Address)
outstruct.HashDigest = *abi.ConvertType(out[4], new([32]byte)).(*[32]byte)
outstruct.HashFunction = *abi.ConvertType(out[5], new(uint8)).(*uint8)
outstruct.HashSize = *abi.ConvertType(out[6], new(uint8)).(*uint8)
outstruct.ConfirmedAtBlock = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int)
outstruct.Exists = *abi.ConvertType(out[8], new(bool)).(*bool)
outstruct.Vetoed = *abi.ConvertType(out[9], new(bool)).(*bool)
return *outstruct, err
}
// Get is a free data retrieval call binding the contract method 0xd8a26e3a.
//
// Solidity: function get(uint32 reimbursementId) view returns(uint32 id, uint32 recipientId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed)
func (_Reimbursement *ReimbursementSession) Get(reimbursementId uint32) (struct {
Id uint32
RecipientId uint32
Amount *big.Int
Token common.Address
HashDigest [32]byte
HashFunction uint8
HashSize uint8
ConfirmedAtBlock *big.Int
Exists bool
Vetoed bool
}, error) {
return _Reimbursement.Contract.Get(&_Reimbursement.CallOpts, reimbursementId)
}
// Get is a free data retrieval call binding the contract method 0xd8a26e3a.
//
// Solidity: function get(uint32 reimbursementId) view returns(uint32 id, uint32 recipientId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed)
func (_Reimbursement *ReimbursementCallerSession) Get(reimbursementId uint32) (struct {
Id uint32
RecipientId uint32
Amount *big.Int
Token common.Address
HashDigest [32]byte
HashFunction uint8
HashSize uint8
ConfirmedAtBlock *big.Int
Exists bool
Vetoed bool
}, error) {
return _Reimbursement.Contract.Get(&_Reimbursement.CallOpts, reimbursementId)
}
// GetContributorAddressById is a free data retrieval call binding the contract method 0x27266309.
//
// Solidity: function getContributorAddressById(uint32 contributorId) view returns(address)
func (_Reimbursement *ReimbursementCaller) GetContributorAddressById(opts *bind.CallOpts, contributorId uint32) (common.Address, error) {
var out []interface{}
err := _Reimbursement.contract.Call(opts, &out, "getContributorAddressById", contributorId)
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// GetContributorAddressById is a free data retrieval call binding the contract method 0x27266309.
//
// Solidity: function getContributorAddressById(uint32 contributorId) view returns(address)
func (_Reimbursement *ReimbursementSession) GetContributorAddressById(contributorId uint32) (common.Address, error) {
return _Reimbursement.Contract.GetContributorAddressById(&_Reimbursement.CallOpts, contributorId)
}
// GetContributorAddressById is a free data retrieval call binding the contract method 0x27266309.
//
// Solidity: function getContributorAddressById(uint32 contributorId) view returns(address)
func (_Reimbursement *ReimbursementCallerSession) GetContributorAddressById(contributorId uint32) (common.Address, error) {
return _Reimbursement.Contract.GetContributorAddressById(&_Reimbursement.CallOpts, contributorId)
}
// GetContributorIdByAddress is a free data retrieval call binding the contract method 0x28dcb8f2.
//
// Solidity: function getContributorIdByAddress(address contributorAccount) view returns(uint32)
func (_Reimbursement *ReimbursementCaller) GetContributorIdByAddress(opts *bind.CallOpts, contributorAccount common.Address) (uint32, error) {
var out []interface{}
err := _Reimbursement.contract.Call(opts, &out, "getContributorIdByAddress", contributorAccount)
if err != nil {
return *new(uint32), err
}
out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32)
return out0, err
}
// GetContributorIdByAddress is a free data retrieval call binding the contract method 0x28dcb8f2.
//
// Solidity: function getContributorIdByAddress(address contributorAccount) view returns(uint32)
func (_Reimbursement *ReimbursementSession) GetContributorIdByAddress(contributorAccount common.Address) (uint32, error) {
return _Reimbursement.Contract.GetContributorIdByAddress(&_Reimbursement.CallOpts, contributorAccount)
}
// GetContributorIdByAddress is a free data retrieval call binding the contract method 0x28dcb8f2.
//
// Solidity: function getContributorIdByAddress(address contributorAccount) view returns(uint32)
func (_Reimbursement *ReimbursementCallerSession) GetContributorIdByAddress(contributorAccount common.Address) (uint32, error) {
return _Reimbursement.Contract.GetContributorIdByAddress(&_Reimbursement.CallOpts, contributorAccount)
}
// Reimbursements is a free data retrieval call binding the contract method 0xcc713638.
//
// Solidity: function reimbursements(uint32 ) view returns(uint32 recipientId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool vetoed, bool exists)
func (_Reimbursement *ReimbursementCaller) Reimbursements(opts *bind.CallOpts, arg0 uint32) (struct {
RecipientId uint32
Amount *big.Int
Token common.Address
HashDigest [32]byte
HashFunction uint8
HashSize uint8
ConfirmedAtBlock *big.Int
Vetoed bool
Exists bool
}, error) {
var out []interface{}
err := _Reimbursement.contract.Call(opts, &out, "reimbursements", arg0)
outstruct := new(struct {
RecipientId uint32
Amount *big.Int
Token common.Address
HashDigest [32]byte
HashFunction uint8
HashSize uint8
ConfirmedAtBlock *big.Int
Vetoed bool
Exists bool
})
if err != nil {
return *outstruct, err
}
outstruct.RecipientId = *abi.ConvertType(out[0], new(uint32)).(*uint32)
outstruct.Amount = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
outstruct.Token = *abi.ConvertType(out[2], new(common.Address)).(*common.Address)
outstruct.HashDigest = *abi.ConvertType(out[3], new([32]byte)).(*[32]byte)
outstruct.HashFunction = *abi.ConvertType(out[4], new(uint8)).(*uint8)
outstruct.HashSize = *abi.ConvertType(out[5], new(uint8)).(*uint8)
outstruct.ConfirmedAtBlock = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int)
outstruct.Vetoed = *abi.ConvertType(out[7], new(bool)).(*bool)
outstruct.Exists = *abi.ConvertType(out[8], new(bool)).(*bool)
return *outstruct, err
}
// Reimbursements is a free data retrieval call binding the contract method 0xcc713638.
//
// Solidity: function reimbursements(uint32 ) view returns(uint32 recipientId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool vetoed, bool exists)
func (_Reimbursement *ReimbursementSession) Reimbursements(arg0 uint32) (struct {
RecipientId uint32
Amount *big.Int
Token common.Address
HashDigest [32]byte
HashFunction uint8
HashSize uint8
ConfirmedAtBlock *big.Int
Vetoed bool
Exists bool
}, error) {
return _Reimbursement.Contract.Reimbursements(&_Reimbursement.CallOpts, arg0)
}
// Reimbursements is a free data retrieval call binding the contract method 0xcc713638.
//
// Solidity: function reimbursements(uint32 ) view returns(uint32 recipientId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool vetoed, bool exists)
func (_Reimbursement *ReimbursementCallerSession) Reimbursements(arg0 uint32) (struct {
RecipientId uint32
Amount *big.Int
Token common.Address
HashDigest [32]byte
HashFunction uint8
HashSize uint8
ConfirmedAtBlock *big.Int
Vetoed bool
Exists bool
}, error) {
return _Reimbursement.Contract.Reimbursements(&_Reimbursement.CallOpts, arg0)
}
// ReimbursementsCount is a free data retrieval call binding the contract method 0x44609822.
//
// Solidity: function reimbursementsCount() view returns(uint32)
func (_Reimbursement *ReimbursementCaller) ReimbursementsCount(opts *bind.CallOpts) (uint32, error) {
var out []interface{}
err := _Reimbursement.contract.Call(opts, &out, "reimbursementsCount")
if err != nil {
return *new(uint32), err
}
out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32)
return out0, err
}
// ReimbursementsCount is a free data retrieval call binding the contract method 0x44609822.
//
// Solidity: function reimbursementsCount() view returns(uint32)
func (_Reimbursement *ReimbursementSession) ReimbursementsCount() (uint32, error) {
return _Reimbursement.Contract.ReimbursementsCount(&_Reimbursement.CallOpts)
}
// ReimbursementsCount is a free data retrieval call binding the contract method 0x44609822.
//
// Solidity: function reimbursementsCount() view returns(uint32)
func (_Reimbursement *ReimbursementCallerSession) ReimbursementsCount() (uint32, error) {
return _Reimbursement.Contract.ReimbursementsCount(&_Reimbursement.CallOpts)
}
// TotalAmount is a free data retrieval call binding the contract method 0xc41357b2.
//
// Solidity: function totalAmount(bool confirmedOnly) view returns(uint256 amount)
func (_Reimbursement *ReimbursementCaller) TotalAmount(opts *bind.CallOpts, confirmedOnly bool) (*big.Int, error) {
var out []interface{}
err := _Reimbursement.contract.Call(opts, &out, "totalAmount", confirmedOnly)
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// TotalAmount is a free data retrieval call binding the contract method 0xc41357b2.
//
// Solidity: function totalAmount(bool confirmedOnly) view returns(uint256 amount)
func (_Reimbursement *ReimbursementSession) TotalAmount(confirmedOnly bool) (*big.Int, error) {
return _Reimbursement.Contract.TotalAmount(&_Reimbursement.CallOpts, confirmedOnly)
}
// TotalAmount is a free data retrieval call binding the contract method 0xc41357b2.
//
// Solidity: function totalAmount(bool confirmedOnly) view returns(uint256 amount)
func (_Reimbursement *ReimbursementCallerSession) TotalAmount(confirmedOnly bool) (*big.Int, error) {
return _Reimbursement.Contract.TotalAmount(&_Reimbursement.CallOpts, confirmedOnly)
}
// Add is a paid mutator transaction binding the contract method 0x5b8a5576.
//
// Solidity: function add(uint256 amount, address token, uint32 recipientId, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) returns()
func (_Reimbursement *ReimbursementTransactor) Add(opts *bind.TransactOpts, amount *big.Int, token common.Address, recipientId uint32, hashDigest [32]byte, hashFunction uint8, hashSize uint8) (*types.Transaction, error) {
return _Reimbursement.contract.Transact(opts, "add", amount, token, recipientId, hashDigest, hashFunction, hashSize)
}
// Add is a paid mutator transaction binding the contract method 0x5b8a5576.
//
// Solidity: function add(uint256 amount, address token, uint32 recipientId, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) returns()
func (_Reimbursement *ReimbursementSession) Add(amount *big.Int, token common.Address, recipientId uint32, hashDigest [32]byte, hashFunction uint8, hashSize uint8) (*types.Transaction, error) {
return _Reimbursement.Contract.Add(&_Reimbursement.TransactOpts, amount, token, recipientId, hashDigest, hashFunction, hashSize)
}
// Add is a paid mutator transaction binding the contract method 0x5b8a5576.
//
// Solidity: function add(uint256 amount, address token, uint32 recipientId, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) returns()
func (_Reimbursement *ReimbursementTransactorSession) Add(amount *big.Int, token common.Address, recipientId uint32, hashDigest [32]byte, hashFunction uint8, hashSize uint8) (*types.Transaction, error) {
return _Reimbursement.Contract.Add(&_Reimbursement.TransactOpts, amount, token, recipientId, hashDigest, hashFunction, hashSize)
}
// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c.
//
// Solidity: function initialize() returns()
func (_Reimbursement *ReimbursementTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) {
return _Reimbursement.contract.Transact(opts, "initialize")
}
// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c.
//
// Solidity: function initialize() returns()
func (_Reimbursement *ReimbursementSession) Initialize() (*types.Transaction, error) {
return _Reimbursement.Contract.Initialize(&_Reimbursement.TransactOpts)
}
// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c.
//
// Solidity: function initialize() returns()
func (_Reimbursement *ReimbursementTransactorSession) Initialize() (*types.Transaction, error) {
return _Reimbursement.Contract.Initialize(&_Reimbursement.TransactOpts)
}
// SetContributorContract is a paid mutator transaction binding the contract method 0xdc08776d.
//
// Solidity: function setContributorContract(address contributor) returns()
func (_Reimbursement *ReimbursementTransactor) SetContributorContract(opts *bind.TransactOpts, contributor common.Address) (*types.Transaction, error) {
return _Reimbursement.contract.Transact(opts, "setContributorContract", contributor)
}
// SetContributorContract is a paid mutator transaction binding the contract method 0xdc08776d.
//
// Solidity: function setContributorContract(address contributor) returns()
func (_Reimbursement *ReimbursementSession) SetContributorContract(contributor common.Address) (*types.Transaction, error) {
return _Reimbursement.Contract.SetContributorContract(&_Reimbursement.TransactOpts, contributor)
}
// SetContributorContract is a paid mutator transaction binding the contract method 0xdc08776d.
//
// Solidity: function setContributorContract(address contributor) returns()
func (_Reimbursement *ReimbursementTransactorSession) SetContributorContract(contributor common.Address) (*types.Transaction, error) {
return _Reimbursement.Contract.SetContributorContract(&_Reimbursement.TransactOpts, contributor)
}
// Veto is a paid mutator transaction binding the contract method 0xae02f94e.
//
// Solidity: function veto(uint32 reimbursementId) returns()
func (_Reimbursement *ReimbursementTransactor) Veto(opts *bind.TransactOpts, reimbursementId uint32) (*types.Transaction, error) {
return _Reimbursement.contract.Transact(opts, "veto", reimbursementId)
}
// Veto is a paid mutator transaction binding the contract method 0xae02f94e.
//
// Solidity: function veto(uint32 reimbursementId) returns()
func (_Reimbursement *ReimbursementSession) Veto(reimbursementId uint32) (*types.Transaction, error) {
return _Reimbursement.Contract.Veto(&_Reimbursement.TransactOpts, reimbursementId)
}
// Veto is a paid mutator transaction binding the contract method 0xae02f94e.
//
// Solidity: function veto(uint32 reimbursementId) returns()
func (_Reimbursement *ReimbursementTransactorSession) Veto(reimbursementId uint32) (*types.Transaction, error) {
return _Reimbursement.Contract.Veto(&_Reimbursement.TransactOpts, reimbursementId)
}
// ReimbursementReimbursementAddedIterator is returned from FilterReimbursementAdded and is used to iterate over the raw logs and unpacked data for ReimbursementAdded events raised by the Reimbursement contract.
type ReimbursementReimbursementAddedIterator struct {
Event *ReimbursementReimbursementAdded // 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 *ReimbursementReimbursementAddedIterator) 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(ReimbursementReimbursementAdded)
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(ReimbursementReimbursementAdded)
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 *ReimbursementReimbursementAddedIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *ReimbursementReimbursementAddedIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// ReimbursementReimbursementAdded represents a ReimbursementAdded event raised by the Reimbursement contract.
type ReimbursementReimbursementAdded struct {
Id uint32
AddedByAccount common.Address
Amount *big.Int
Raw types.Log // Blockchain specific contextual infos
}
// FilterReimbursementAdded is a free log retrieval operation binding the contract event 0xe12ea9f676fb1b644fa79482a1a9bf8d3de1ee2779124baaecc0dd2c1913cc03.
//
// Solidity: event ReimbursementAdded(uint32 id, address indexed addedByAccount, uint256 amount)
func (_Reimbursement *ReimbursementFilterer) FilterReimbursementAdded(opts *bind.FilterOpts, addedByAccount []common.Address) (*ReimbursementReimbursementAddedIterator, error) {
var addedByAccountRule []interface{}
for _, addedByAccountItem := range addedByAccount {
addedByAccountRule = append(addedByAccountRule, addedByAccountItem)
}
logs, sub, err := _Reimbursement.contract.FilterLogs(opts, "ReimbursementAdded", addedByAccountRule)
if err != nil {
return nil, err
}
return &ReimbursementReimbursementAddedIterator{contract: _Reimbursement.contract, event: "ReimbursementAdded", logs: logs, sub: sub}, nil
}
// WatchReimbursementAdded is a free log subscription operation binding the contract event 0xe12ea9f676fb1b644fa79482a1a9bf8d3de1ee2779124baaecc0dd2c1913cc03.
//
// Solidity: event ReimbursementAdded(uint32 id, address indexed addedByAccount, uint256 amount)
func (_Reimbursement *ReimbursementFilterer) WatchReimbursementAdded(opts *bind.WatchOpts, sink chan<- *ReimbursementReimbursementAdded, addedByAccount []common.Address) (event.Subscription, error) {
var addedByAccountRule []interface{}
for _, addedByAccountItem := range addedByAccount {
addedByAccountRule = append(addedByAccountRule, addedByAccountItem)
}
logs, sub, err := _Reimbursement.contract.WatchLogs(opts, "ReimbursementAdded", addedByAccountRule)
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(ReimbursementReimbursementAdded)
if err := _Reimbursement.contract.UnpackLog(event, "ReimbursementAdded", 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
}
// ParseReimbursementAdded is a log parse operation binding the contract event 0xe12ea9f676fb1b644fa79482a1a9bf8d3de1ee2779124baaecc0dd2c1913cc03.
//
// Solidity: event ReimbursementAdded(uint32 id, address indexed addedByAccount, uint256 amount)
func (_Reimbursement *ReimbursementFilterer) ParseReimbursementAdded(log types.Log) (*ReimbursementReimbursementAdded, error) {
event := new(ReimbursementReimbursementAdded)
if err := _Reimbursement.contract.UnpackLog(event, "ReimbursementAdded", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// ReimbursementReimbursementVetoedIterator is returned from FilterReimbursementVetoed and is used to iterate over the raw logs and unpacked data for ReimbursementVetoed events raised by the Reimbursement contract.
type ReimbursementReimbursementVetoedIterator struct {
Event *ReimbursementReimbursementVetoed // 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 *ReimbursementReimbursementVetoedIterator) 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(ReimbursementReimbursementVetoed)
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(ReimbursementReimbursementVetoed)
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 *ReimbursementReimbursementVetoedIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *ReimbursementReimbursementVetoedIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// ReimbursementReimbursementVetoed represents a ReimbursementVetoed event raised by the Reimbursement contract.
type ReimbursementReimbursementVetoed struct {
Id uint32
VetoedByAccount common.Address
Raw types.Log // Blockchain specific contextual infos
}
// FilterReimbursementVetoed is a free log retrieval operation binding the contract event 0xeaab9e360f89b9c6b0b7c847030bcc92a3cbfb585ee9935d3773bb7213d1448f.
//
// Solidity: event ReimbursementVetoed(uint32 id, address vetoedByAccount)
func (_Reimbursement *ReimbursementFilterer) FilterReimbursementVetoed(opts *bind.FilterOpts) (*ReimbursementReimbursementVetoedIterator, error) {
logs, sub, err := _Reimbursement.contract.FilterLogs(opts, "ReimbursementVetoed")
if err != nil {
return nil, err
}
return &ReimbursementReimbursementVetoedIterator{contract: _Reimbursement.contract, event: "ReimbursementVetoed", logs: logs, sub: sub}, nil
}
// WatchReimbursementVetoed is a free log subscription operation binding the contract event 0xeaab9e360f89b9c6b0b7c847030bcc92a3cbfb585ee9935d3773bb7213d1448f.
//
// Solidity: event ReimbursementVetoed(uint32 id, address vetoedByAccount)
func (_Reimbursement *ReimbursementFilterer) WatchReimbursementVetoed(opts *bind.WatchOpts, sink chan<- *ReimbursementReimbursementVetoed) (event.Subscription, error) {
logs, sub, err := _Reimbursement.contract.WatchLogs(opts, "ReimbursementVetoed")
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(ReimbursementReimbursementVetoed)
if err := _Reimbursement.contract.UnpackLog(event, "ReimbursementVetoed", 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
}
// ParseReimbursementVetoed is a log parse operation binding the contract event 0xeaab9e360f89b9c6b0b7c847030bcc92a3cbfb585ee9935d3773bb7213d1448f.
//
// Solidity: event ReimbursementVetoed(uint32 id, address vetoedByAccount)
func (_Reimbursement *ReimbursementFilterer) ParseReimbursementVetoed(log types.Log) (*ReimbursementReimbursementVetoed, error) {
event := new(ReimbursementReimbursementVetoed)
if err := _Reimbursement.contract.UnpackLog(event, "ReimbursementVetoed", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}

1050
token/token.go Normal file

File diff suppressed because it is too large Load Diff