contracts-go/reimbursement/reimbursement.go

929 lines
43 KiB
Go

// 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
}