commit 9b22e8323c55a57071dd9d0dc5f12ff8d758d0d2 Author: Râu Cao Date: Sat Oct 1 11:17:02 2022 +0200 Hello Go! diff --git a/contribution/contribution.go b/contribution/contribution.go new file mode 100644 index 0000000..d009352 --- /dev/null +++ b/contribution/contribution.go @@ -0,0 +1,1285 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contribution + +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 +) + +// ContributionMetaData contains all meta data concerning the Contribution contract. +var ContributionMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"contributorId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"amount\",\"type\":\"uint32\"}],\"name\":\"ContributionAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"vetoedByAccount\",\"type\":\"address\"}],\"name\":\"ContributionVetoed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"amount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"contributorId\",\"type\":\"uint32\"},{\"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\"}],\"name\":\"add\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blocksToWait\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"contributionOwner\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"contributions\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"contributorId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"amount\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"hashDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"hashFunction\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"hashSize\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"tokenMetadataURL\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"confirmedAtBlock\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"vetoed\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"exists\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"contributionsCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"contributorContract\",\"outputs\":[{\"internalType\":\"contractContributorInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"contributionId\",\"type\":\"uint32\"}],\"name\":\"exists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finishMigration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"contributionId\",\"type\":\"uint32\"}],\"name\":\"getContribution\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"contributorId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"amount\",\"type\":\"uint32\"},{\"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\":[{\"internalType\":\"uint32\",\"name\":\"blocksToWait_\",\"type\":\"uint32\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"migrationDone\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"ownedContributions\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"contributionId\",\"type\":\"uint32\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contributor\",\"type\":\"address\"}],\"name\":\"setContributorContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"contributionId\",\"type\":\"uint32\"}],\"name\":\"tokenMetadata\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"index\",\"type\":\"uint32\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"confirmedOnly\",\"type\":\"bool\"}],\"name\":\"totalKreditsEarned\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"amount\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"contributorId\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"confirmedOnly\",\"type\":\"bool\"}],\"name\":\"totalKreditsEarnedByContributor\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"amount\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"contributionId\",\"type\":\"uint32\"}],\"name\":\"veto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// ContributionABI is the input ABI used to generate the binding from. +// Deprecated: Use ContributionMetaData.ABI instead. +var ContributionABI = ContributionMetaData.ABI + +// Contribution is an auto generated Go binding around an Ethereum contract. +type Contribution struct { + ContributionCaller // Read-only binding to the contract + ContributionTransactor // Write-only binding to the contract + ContributionFilterer // Log filterer for contract events +} + +// ContributionCaller is an auto generated read-only Go binding around an Ethereum contract. +type ContributionCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContributionTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ContributionTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContributionFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ContributionFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContributionSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ContributionSession struct { + Contract *Contribution // 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 +} + +// ContributionCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ContributionCallerSession struct { + Contract *ContributionCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ContributionTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ContributionTransactorSession struct { + Contract *ContributionTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ContributionRaw is an auto generated low-level Go binding around an Ethereum contract. +type ContributionRaw struct { + Contract *Contribution // Generic contract binding to access the raw methods on +} + +// ContributionCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ContributionCallerRaw struct { + Contract *ContributionCaller // Generic read-only contract binding to access the raw methods on +} + +// ContributionTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ContributionTransactorRaw struct { + Contract *ContributionTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewContribution creates a new instance of Contribution, bound to a specific deployed contract. +func NewContribution(address common.Address, backend bind.ContractBackend) (*Contribution, error) { + contract, err := bindContribution(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Contribution{ContributionCaller: ContributionCaller{contract: contract}, ContributionTransactor: ContributionTransactor{contract: contract}, ContributionFilterer: ContributionFilterer{contract: contract}}, nil +} + +// NewContributionCaller creates a new read-only instance of Contribution, bound to a specific deployed contract. +func NewContributionCaller(address common.Address, caller bind.ContractCaller) (*ContributionCaller, error) { + contract, err := bindContribution(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ContributionCaller{contract: contract}, nil +} + +// NewContributionTransactor creates a new write-only instance of Contribution, bound to a specific deployed contract. +func NewContributionTransactor(address common.Address, transactor bind.ContractTransactor) (*ContributionTransactor, error) { + contract, err := bindContribution(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ContributionTransactor{contract: contract}, nil +} + +// NewContributionFilterer creates a new log filterer instance of Contribution, bound to a specific deployed contract. +func NewContributionFilterer(address common.Address, filterer bind.ContractFilterer) (*ContributionFilterer, error) { + contract, err := bindContribution(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ContributionFilterer{contract: contract}, nil +} + +// bindContribution binds a generic wrapper to an already deployed contract. +func bindContribution(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ContributionABI)) + 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 (_Contribution *ContributionRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Contribution.Contract.ContributionCaller.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 (_Contribution *ContributionRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Contribution.Contract.ContributionTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Contribution *ContributionRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Contribution.Contract.ContributionTransactor.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 (_Contribution *ContributionCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Contribution.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 (_Contribution *ContributionTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Contribution.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Contribution *ContributionTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Contribution.Contract.contract.Transact(opts, method, params...) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address owner) view returns(uint256) +func (_Contribution *ContributionCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "balanceOf", owner) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address owner) view returns(uint256) +func (_Contribution *ContributionSession) BalanceOf(owner common.Address) (*big.Int, error) { + return _Contribution.Contract.BalanceOf(&_Contribution.CallOpts, owner) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address owner) view returns(uint256) +func (_Contribution *ContributionCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { + return _Contribution.Contract.BalanceOf(&_Contribution.CallOpts, owner) +} + +// BlocksToWait is a free data retrieval call binding the contract method 0xd8dcac4f. +// +// Solidity: function blocksToWait() view returns(uint32) +func (_Contribution *ContributionCaller) BlocksToWait(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _Contribution.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 (_Contribution *ContributionSession) BlocksToWait() (uint32, error) { + return _Contribution.Contract.BlocksToWait(&_Contribution.CallOpts) +} + +// BlocksToWait is a free data retrieval call binding the contract method 0xd8dcac4f. +// +// Solidity: function blocksToWait() view returns(uint32) +func (_Contribution *ContributionCallerSession) BlocksToWait() (uint32, error) { + return _Contribution.Contract.BlocksToWait(&_Contribution.CallOpts) +} + +// ContributionOwner is a free data retrieval call binding the contract method 0xb6c5883f. +// +// Solidity: function contributionOwner(uint32 ) view returns(uint32) +func (_Contribution *ContributionCaller) ContributionOwner(opts *bind.CallOpts, arg0 uint32) (uint32, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "contributionOwner", arg0) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// ContributionOwner is a free data retrieval call binding the contract method 0xb6c5883f. +// +// Solidity: function contributionOwner(uint32 ) view returns(uint32) +func (_Contribution *ContributionSession) ContributionOwner(arg0 uint32) (uint32, error) { + return _Contribution.Contract.ContributionOwner(&_Contribution.CallOpts, arg0) +} + +// ContributionOwner is a free data retrieval call binding the contract method 0xb6c5883f. +// +// Solidity: function contributionOwner(uint32 ) view returns(uint32) +func (_Contribution *ContributionCallerSession) ContributionOwner(arg0 uint32) (uint32, error) { + return _Contribution.Contract.ContributionOwner(&_Contribution.CallOpts, arg0) +} + +// Contributions is a free data retrieval call binding the contract method 0xc4ff91bd. +// +// Solidity: function contributions(uint32 ) view returns(uint32 contributorId, uint32 amount, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, string tokenMetadataURL, uint256 confirmedAtBlock, bool vetoed, bool exists) +func (_Contribution *ContributionCaller) Contributions(opts *bind.CallOpts, arg0 uint32) (struct { + ContributorId uint32 + Amount uint32 + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + TokenMetadataURL string + ConfirmedAtBlock *big.Int + Vetoed bool + Exists bool +}, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "contributions", arg0) + + outstruct := new(struct { + ContributorId uint32 + Amount uint32 + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + TokenMetadataURL string + ConfirmedAtBlock *big.Int + Vetoed bool + Exists bool + }) + if err != nil { + return *outstruct, err + } + + outstruct.ContributorId = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.Amount = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.HashDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + outstruct.HashFunction = *abi.ConvertType(out[3], new(uint8)).(*uint8) + outstruct.HashSize = *abi.ConvertType(out[4], new(uint8)).(*uint8) + outstruct.TokenMetadataURL = *abi.ConvertType(out[5], new(string)).(*string) + 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 + +} + +// Contributions is a free data retrieval call binding the contract method 0xc4ff91bd. +// +// Solidity: function contributions(uint32 ) view returns(uint32 contributorId, uint32 amount, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, string tokenMetadataURL, uint256 confirmedAtBlock, bool vetoed, bool exists) +func (_Contribution *ContributionSession) Contributions(arg0 uint32) (struct { + ContributorId uint32 + Amount uint32 + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + TokenMetadataURL string + ConfirmedAtBlock *big.Int + Vetoed bool + Exists bool +}, error) { + return _Contribution.Contract.Contributions(&_Contribution.CallOpts, arg0) +} + +// Contributions is a free data retrieval call binding the contract method 0xc4ff91bd. +// +// Solidity: function contributions(uint32 ) view returns(uint32 contributorId, uint32 amount, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, string tokenMetadataURL, uint256 confirmedAtBlock, bool vetoed, bool exists) +func (_Contribution *ContributionCallerSession) Contributions(arg0 uint32) (struct { + ContributorId uint32 + Amount uint32 + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + TokenMetadataURL string + ConfirmedAtBlock *big.Int + Vetoed bool + Exists bool +}, error) { + return _Contribution.Contract.Contributions(&_Contribution.CallOpts, arg0) +} + +// ContributionsCount is a free data retrieval call binding the contract method 0x38658175. +// +// Solidity: function contributionsCount() view returns(uint32) +func (_Contribution *ContributionCaller) ContributionsCount(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "contributionsCount") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// ContributionsCount is a free data retrieval call binding the contract method 0x38658175. +// +// Solidity: function contributionsCount() view returns(uint32) +func (_Contribution *ContributionSession) ContributionsCount() (uint32, error) { + return _Contribution.Contract.ContributionsCount(&_Contribution.CallOpts) +} + +// ContributionsCount is a free data retrieval call binding the contract method 0x38658175. +// +// Solidity: function contributionsCount() view returns(uint32) +func (_Contribution *ContributionCallerSession) ContributionsCount() (uint32, error) { + return _Contribution.Contract.ContributionsCount(&_Contribution.CallOpts) +} + +// ContributorContract is a free data retrieval call binding the contract method 0x7b8917d1. +// +// Solidity: function contributorContract() view returns(address) +func (_Contribution *ContributionCaller) ContributorContract(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Contribution.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 (_Contribution *ContributionSession) ContributorContract() (common.Address, error) { + return _Contribution.Contract.ContributorContract(&_Contribution.CallOpts) +} + +// ContributorContract is a free data retrieval call binding the contract method 0x7b8917d1. +// +// Solidity: function contributorContract() view returns(address) +func (_Contribution *ContributionCallerSession) ContributorContract() (common.Address, error) { + return _Contribution.Contract.ContributorContract(&_Contribution.CallOpts) +} + +// Deployer is a free data retrieval call binding the contract method 0xd5f39488. +// +// Solidity: function deployer() view returns(address) +func (_Contribution *ContributionCaller) Deployer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "deployer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Deployer is a free data retrieval call binding the contract method 0xd5f39488. +// +// Solidity: function deployer() view returns(address) +func (_Contribution *ContributionSession) Deployer() (common.Address, error) { + return _Contribution.Contract.Deployer(&_Contribution.CallOpts) +} + +// Deployer is a free data retrieval call binding the contract method 0xd5f39488. +// +// Solidity: function deployer() view returns(address) +func (_Contribution *ContributionCallerSession) Deployer() (common.Address, error) { + return _Contribution.Contract.Deployer(&_Contribution.CallOpts) +} + +// Exists is a free data retrieval call binding the contract method 0x13c369ed. +// +// Solidity: function exists(uint32 contributionId) view returns(bool) +func (_Contribution *ContributionCaller) Exists(opts *bind.CallOpts, contributionId uint32) (bool, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "exists", contributionId) + + 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 contributionId) view returns(bool) +func (_Contribution *ContributionSession) Exists(contributionId uint32) (bool, error) { + return _Contribution.Contract.Exists(&_Contribution.CallOpts, contributionId) +} + +// Exists is a free data retrieval call binding the contract method 0x13c369ed. +// +// Solidity: function exists(uint32 contributionId) view returns(bool) +func (_Contribution *ContributionCallerSession) Exists(contributionId uint32) (bool, error) { + return _Contribution.Contract.Exists(&_Contribution.CallOpts, contributionId) +} + +// GetContribution is a free data retrieval call binding the contract method 0x9eb20b86. +// +// Solidity: function getContribution(uint32 contributionId) view returns(uint32 id, uint32 contributorId, uint32 amount, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed) +func (_Contribution *ContributionCaller) GetContribution(opts *bind.CallOpts, contributionId uint32) (struct { + Id uint32 + ContributorId uint32 + Amount uint32 + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + ConfirmedAtBlock *big.Int + Exists bool + Vetoed bool +}, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "getContribution", contributionId) + + outstruct := new(struct { + Id uint32 + ContributorId uint32 + Amount uint32 + 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.ContributorId = *abi.ConvertType(out[1], new(uint32)).(*uint32) + outstruct.Amount = *abi.ConvertType(out[2], new(uint32)).(*uint32) + 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.Exists = *abi.ConvertType(out[7], new(bool)).(*bool) + outstruct.Vetoed = *abi.ConvertType(out[8], new(bool)).(*bool) + + return *outstruct, err + +} + +// GetContribution is a free data retrieval call binding the contract method 0x9eb20b86. +// +// Solidity: function getContribution(uint32 contributionId) view returns(uint32 id, uint32 contributorId, uint32 amount, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed) +func (_Contribution *ContributionSession) GetContribution(contributionId uint32) (struct { + Id uint32 + ContributorId uint32 + Amount uint32 + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + ConfirmedAtBlock *big.Int + Exists bool + Vetoed bool +}, error) { + return _Contribution.Contract.GetContribution(&_Contribution.CallOpts, contributionId) +} + +// GetContribution is a free data retrieval call binding the contract method 0x9eb20b86. +// +// Solidity: function getContribution(uint32 contributionId) view returns(uint32 id, uint32 contributorId, uint32 amount, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed) +func (_Contribution *ContributionCallerSession) GetContribution(contributionId uint32) (struct { + Id uint32 + ContributorId uint32 + Amount uint32 + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + ConfirmedAtBlock *big.Int + Exists bool + Vetoed bool +}, error) { + return _Contribution.Contract.GetContribution(&_Contribution.CallOpts, contributionId) +} + +// GetContributorAddressById is a free data retrieval call binding the contract method 0x27266309. +// +// Solidity: function getContributorAddressById(uint32 contributorId) view returns(address) +func (_Contribution *ContributionCaller) GetContributorAddressById(opts *bind.CallOpts, contributorId uint32) (common.Address, error) { + var out []interface{} + err := _Contribution.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 (_Contribution *ContributionSession) GetContributorAddressById(contributorId uint32) (common.Address, error) { + return _Contribution.Contract.GetContributorAddressById(&_Contribution.CallOpts, contributorId) +} + +// GetContributorAddressById is a free data retrieval call binding the contract method 0x27266309. +// +// Solidity: function getContributorAddressById(uint32 contributorId) view returns(address) +func (_Contribution *ContributionCallerSession) GetContributorAddressById(contributorId uint32) (common.Address, error) { + return _Contribution.Contract.GetContributorAddressById(&_Contribution.CallOpts, contributorId) +} + +// GetContributorIdByAddress is a free data retrieval call binding the contract method 0x28dcb8f2. +// +// Solidity: function getContributorIdByAddress(address contributorAccount) view returns(uint32) +func (_Contribution *ContributionCaller) GetContributorIdByAddress(opts *bind.CallOpts, contributorAccount common.Address) (uint32, error) { + var out []interface{} + err := _Contribution.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 (_Contribution *ContributionSession) GetContributorIdByAddress(contributorAccount common.Address) (uint32, error) { + return _Contribution.Contract.GetContributorIdByAddress(&_Contribution.CallOpts, contributorAccount) +} + +// GetContributorIdByAddress is a free data retrieval call binding the contract method 0x28dcb8f2. +// +// Solidity: function getContributorIdByAddress(address contributorAccount) view returns(uint32) +func (_Contribution *ContributionCallerSession) GetContributorIdByAddress(contributorAccount common.Address) (uint32, error) { + return _Contribution.Contract.GetContributorIdByAddress(&_Contribution.CallOpts, contributorAccount) +} + +// MigrationDone is a free data retrieval call binding the contract method 0x0d81a570. +// +// Solidity: function migrationDone() view returns(bool) +func (_Contribution *ContributionCaller) MigrationDone(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "migrationDone") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// MigrationDone is a free data retrieval call binding the contract method 0x0d81a570. +// +// Solidity: function migrationDone() view returns(bool) +func (_Contribution *ContributionSession) MigrationDone() (bool, error) { + return _Contribution.Contract.MigrationDone(&_Contribution.CallOpts) +} + +// MigrationDone is a free data retrieval call binding the contract method 0x0d81a570. +// +// Solidity: function migrationDone() view returns(bool) +func (_Contribution *ContributionCallerSession) MigrationDone() (bool, error) { + return _Contribution.Contract.MigrationDone(&_Contribution.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Contribution *ContributionCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Contribution *ContributionSession) Name() (string, error) { + return _Contribution.Contract.Name(&_Contribution.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Contribution *ContributionCallerSession) Name() (string, error) { + return _Contribution.Contract.Name(&_Contribution.CallOpts) +} + +// OwnedContributions is a free data retrieval call binding the contract method 0xca38968f. +// +// Solidity: function ownedContributions(uint32 , uint256 ) view returns(uint32) +func (_Contribution *ContributionCaller) OwnedContributions(opts *bind.CallOpts, arg0 uint32, arg1 *big.Int) (uint32, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "ownedContributions", arg0, arg1) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// OwnedContributions is a free data retrieval call binding the contract method 0xca38968f. +// +// Solidity: function ownedContributions(uint32 , uint256 ) view returns(uint32) +func (_Contribution *ContributionSession) OwnedContributions(arg0 uint32, arg1 *big.Int) (uint32, error) { + return _Contribution.Contract.OwnedContributions(&_Contribution.CallOpts, arg0, arg1) +} + +// OwnedContributions is a free data retrieval call binding the contract method 0xca38968f. +// +// Solidity: function ownedContributions(uint32 , uint256 ) view returns(uint32) +func (_Contribution *ContributionCallerSession) OwnedContributions(arg0 uint32, arg1 *big.Int) (uint32, error) { + return _Contribution.Contract.OwnedContributions(&_Contribution.CallOpts, arg0, arg1) +} + +// OwnerOf is a free data retrieval call binding the contract method 0x23b7ec3b. +// +// Solidity: function ownerOf(uint32 contributionId) view returns(address) +func (_Contribution *ContributionCaller) OwnerOf(opts *bind.CallOpts, contributionId uint32) (common.Address, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "ownerOf", contributionId) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OwnerOf is a free data retrieval call binding the contract method 0x23b7ec3b. +// +// Solidity: function ownerOf(uint32 contributionId) view returns(address) +func (_Contribution *ContributionSession) OwnerOf(contributionId uint32) (common.Address, error) { + return _Contribution.Contract.OwnerOf(&_Contribution.CallOpts, contributionId) +} + +// OwnerOf is a free data retrieval call binding the contract method 0x23b7ec3b. +// +// Solidity: function ownerOf(uint32 contributionId) view returns(address) +func (_Contribution *ContributionCallerSession) OwnerOf(contributionId uint32) (common.Address, error) { + return _Contribution.Contract.OwnerOf(&_Contribution.CallOpts, contributionId) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Contribution *ContributionCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Contribution *ContributionSession) Symbol() (string, error) { + return _Contribution.Contract.Symbol(&_Contribution.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Contribution *ContributionCallerSession) Symbol() (string, error) { + return _Contribution.Contract.Symbol(&_Contribution.CallOpts) +} + +// TokenMetadata is a free data retrieval call binding the contract method 0x884a5b00. +// +// Solidity: function tokenMetadata(uint32 contributionId) view returns(string) +func (_Contribution *ContributionCaller) TokenMetadata(opts *bind.CallOpts, contributionId uint32) (string, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "tokenMetadata", contributionId) + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// TokenMetadata is a free data retrieval call binding the contract method 0x884a5b00. +// +// Solidity: function tokenMetadata(uint32 contributionId) view returns(string) +func (_Contribution *ContributionSession) TokenMetadata(contributionId uint32) (string, error) { + return _Contribution.Contract.TokenMetadata(&_Contribution.CallOpts, contributionId) +} + +// TokenMetadata is a free data retrieval call binding the contract method 0x884a5b00. +// +// Solidity: function tokenMetadata(uint32 contributionId) view returns(string) +func (_Contribution *ContributionCallerSession) TokenMetadata(contributionId uint32) (string, error) { + return _Contribution.Contract.TokenMetadata(&_Contribution.CallOpts, contributionId) +} + +// TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x690942d2. +// +// Solidity: function tokenOfOwnerByIndex(address owner, uint32 index) view returns(uint32) +func (_Contribution *ContributionCaller) TokenOfOwnerByIndex(opts *bind.CallOpts, owner common.Address, index uint32) (uint32, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "tokenOfOwnerByIndex", owner, index) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x690942d2. +// +// Solidity: function tokenOfOwnerByIndex(address owner, uint32 index) view returns(uint32) +func (_Contribution *ContributionSession) TokenOfOwnerByIndex(owner common.Address, index uint32) (uint32, error) { + return _Contribution.Contract.TokenOfOwnerByIndex(&_Contribution.CallOpts, owner, index) +} + +// TokenOfOwnerByIndex is a free data retrieval call binding the contract method 0x690942d2. +// +// Solidity: function tokenOfOwnerByIndex(address owner, uint32 index) view returns(uint32) +func (_Contribution *ContributionCallerSession) TokenOfOwnerByIndex(owner common.Address, index uint32) (uint32, error) { + return _Contribution.Contract.TokenOfOwnerByIndex(&_Contribution.CallOpts, owner, index) +} + +// TotalKreditsEarned is a free data retrieval call binding the contract method 0x15864c3d. +// +// Solidity: function totalKreditsEarned(bool confirmedOnly) view returns(uint32 amount) +func (_Contribution *ContributionCaller) TotalKreditsEarned(opts *bind.CallOpts, confirmedOnly bool) (uint32, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "totalKreditsEarned", confirmedOnly) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// TotalKreditsEarned is a free data retrieval call binding the contract method 0x15864c3d. +// +// Solidity: function totalKreditsEarned(bool confirmedOnly) view returns(uint32 amount) +func (_Contribution *ContributionSession) TotalKreditsEarned(confirmedOnly bool) (uint32, error) { + return _Contribution.Contract.TotalKreditsEarned(&_Contribution.CallOpts, confirmedOnly) +} + +// TotalKreditsEarned is a free data retrieval call binding the contract method 0x15864c3d. +// +// Solidity: function totalKreditsEarned(bool confirmedOnly) view returns(uint32 amount) +func (_Contribution *ContributionCallerSession) TotalKreditsEarned(confirmedOnly bool) (uint32, error) { + return _Contribution.Contract.TotalKreditsEarned(&_Contribution.CallOpts, confirmedOnly) +} + +// TotalKreditsEarnedByContributor is a free data retrieval call binding the contract method 0x02cc3cfa. +// +// Solidity: function totalKreditsEarnedByContributor(uint32 contributorId, bool confirmedOnly) view returns(uint32 amount) +func (_Contribution *ContributionCaller) TotalKreditsEarnedByContributor(opts *bind.CallOpts, contributorId uint32, confirmedOnly bool) (uint32, error) { + var out []interface{} + err := _Contribution.contract.Call(opts, &out, "totalKreditsEarnedByContributor", contributorId, confirmedOnly) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// TotalKreditsEarnedByContributor is a free data retrieval call binding the contract method 0x02cc3cfa. +// +// Solidity: function totalKreditsEarnedByContributor(uint32 contributorId, bool confirmedOnly) view returns(uint32 amount) +func (_Contribution *ContributionSession) TotalKreditsEarnedByContributor(contributorId uint32, confirmedOnly bool) (uint32, error) { + return _Contribution.Contract.TotalKreditsEarnedByContributor(&_Contribution.CallOpts, contributorId, confirmedOnly) +} + +// TotalKreditsEarnedByContributor is a free data retrieval call binding the contract method 0x02cc3cfa. +// +// Solidity: function totalKreditsEarnedByContributor(uint32 contributorId, bool confirmedOnly) view returns(uint32 amount) +func (_Contribution *ContributionCallerSession) TotalKreditsEarnedByContributor(contributorId uint32, confirmedOnly bool) (uint32, error) { + return _Contribution.Contract.TotalKreditsEarnedByContributor(&_Contribution.CallOpts, contributorId, confirmedOnly) +} + +// Add is a paid mutator transaction binding the contract method 0x565075ce. +// +// Solidity: function add(uint32 amount, uint32 contributorId, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool vetoed) returns() +func (_Contribution *ContributionTransactor) Add(opts *bind.TransactOpts, amount uint32, contributorId uint32, hashDigest [32]byte, hashFunction uint8, hashSize uint8, confirmedAtBlock *big.Int, vetoed bool) (*types.Transaction, error) { + return _Contribution.contract.Transact(opts, "add", amount, contributorId, hashDigest, hashFunction, hashSize, confirmedAtBlock, vetoed) +} + +// Add is a paid mutator transaction binding the contract method 0x565075ce. +// +// Solidity: function add(uint32 amount, uint32 contributorId, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool vetoed) returns() +func (_Contribution *ContributionSession) Add(amount uint32, contributorId uint32, hashDigest [32]byte, hashFunction uint8, hashSize uint8, confirmedAtBlock *big.Int, vetoed bool) (*types.Transaction, error) { + return _Contribution.Contract.Add(&_Contribution.TransactOpts, amount, contributorId, hashDigest, hashFunction, hashSize, confirmedAtBlock, vetoed) +} + +// Add is a paid mutator transaction binding the contract method 0x565075ce. +// +// Solidity: function add(uint32 amount, uint32 contributorId, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool vetoed) returns() +func (_Contribution *ContributionTransactorSession) Add(amount uint32, contributorId uint32, hashDigest [32]byte, hashFunction uint8, hashSize uint8, confirmedAtBlock *big.Int, vetoed bool) (*types.Transaction, error) { + return _Contribution.Contract.Add(&_Contribution.TransactOpts, amount, contributorId, hashDigest, hashFunction, hashSize, confirmedAtBlock, vetoed) +} + +// FinishMigration is a paid mutator transaction binding the contract method 0x88d761f2. +// +// Solidity: function finishMigration() returns() +func (_Contribution *ContributionTransactor) FinishMigration(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Contribution.contract.Transact(opts, "finishMigration") +} + +// FinishMigration is a paid mutator transaction binding the contract method 0x88d761f2. +// +// Solidity: function finishMigration() returns() +func (_Contribution *ContributionSession) FinishMigration() (*types.Transaction, error) { + return _Contribution.Contract.FinishMigration(&_Contribution.TransactOpts) +} + +// FinishMigration is a paid mutator transaction binding the contract method 0x88d761f2. +// +// Solidity: function finishMigration() returns() +func (_Contribution *ContributionTransactorSession) FinishMigration() (*types.Transaction, error) { + return _Contribution.Contract.FinishMigration(&_Contribution.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8d8965bd. +// +// Solidity: function initialize(uint32 blocksToWait_) returns() +func (_Contribution *ContributionTransactor) Initialize(opts *bind.TransactOpts, blocksToWait_ uint32) (*types.Transaction, error) { + return _Contribution.contract.Transact(opts, "initialize", blocksToWait_) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8d8965bd. +// +// Solidity: function initialize(uint32 blocksToWait_) returns() +func (_Contribution *ContributionSession) Initialize(blocksToWait_ uint32) (*types.Transaction, error) { + return _Contribution.Contract.Initialize(&_Contribution.TransactOpts, blocksToWait_) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8d8965bd. +// +// Solidity: function initialize(uint32 blocksToWait_) returns() +func (_Contribution *ContributionTransactorSession) Initialize(blocksToWait_ uint32) (*types.Transaction, error) { + return _Contribution.Contract.Initialize(&_Contribution.TransactOpts, blocksToWait_) +} + +// SetContributorContract is a paid mutator transaction binding the contract method 0xdc08776d. +// +// Solidity: function setContributorContract(address contributor) returns() +func (_Contribution *ContributionTransactor) SetContributorContract(opts *bind.TransactOpts, contributor common.Address) (*types.Transaction, error) { + return _Contribution.contract.Transact(opts, "setContributorContract", contributor) +} + +// SetContributorContract is a paid mutator transaction binding the contract method 0xdc08776d. +// +// Solidity: function setContributorContract(address contributor) returns() +func (_Contribution *ContributionSession) SetContributorContract(contributor common.Address) (*types.Transaction, error) { + return _Contribution.Contract.SetContributorContract(&_Contribution.TransactOpts, contributor) +} + +// SetContributorContract is a paid mutator transaction binding the contract method 0xdc08776d. +// +// Solidity: function setContributorContract(address contributor) returns() +func (_Contribution *ContributionTransactorSession) SetContributorContract(contributor common.Address) (*types.Transaction, error) { + return _Contribution.Contract.SetContributorContract(&_Contribution.TransactOpts, contributor) +} + +// Veto is a paid mutator transaction binding the contract method 0xae02f94e. +// +// Solidity: function veto(uint32 contributionId) returns() +func (_Contribution *ContributionTransactor) Veto(opts *bind.TransactOpts, contributionId uint32) (*types.Transaction, error) { + return _Contribution.contract.Transact(opts, "veto", contributionId) +} + +// Veto is a paid mutator transaction binding the contract method 0xae02f94e. +// +// Solidity: function veto(uint32 contributionId) returns() +func (_Contribution *ContributionSession) Veto(contributionId uint32) (*types.Transaction, error) { + return _Contribution.Contract.Veto(&_Contribution.TransactOpts, contributionId) +} + +// Veto is a paid mutator transaction binding the contract method 0xae02f94e. +// +// Solidity: function veto(uint32 contributionId) returns() +func (_Contribution *ContributionTransactorSession) Veto(contributionId uint32) (*types.Transaction, error) { + return _Contribution.Contract.Veto(&_Contribution.TransactOpts, contributionId) +} + +// ContributionContributionAddedIterator is returned from FilterContributionAdded and is used to iterate over the raw logs and unpacked data for ContributionAdded events raised by the Contribution contract. +type ContributionContributionAddedIterator struct { + Event *ContributionContributionAdded // 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 *ContributionContributionAddedIterator) 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(ContributionContributionAdded) + 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(ContributionContributionAdded) + 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 *ContributionContributionAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ContributionContributionAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ContributionContributionAdded represents a ContributionAdded event raised by the Contribution contract. +type ContributionContributionAdded struct { + Id uint32 + ContributorId uint32 + Amount uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterContributionAdded is a free log retrieval operation binding the contract event 0x2c823389cf5f7448115ce6507d185cb6ce8390e3433f5fe31aace1199aba8481. +// +// Solidity: event ContributionAdded(uint32 id, uint32 indexed contributorId, uint32 amount) +func (_Contribution *ContributionFilterer) FilterContributionAdded(opts *bind.FilterOpts, contributorId []uint32) (*ContributionContributionAddedIterator, error) { + + var contributorIdRule []interface{} + for _, contributorIdItem := range contributorId { + contributorIdRule = append(contributorIdRule, contributorIdItem) + } + + logs, sub, err := _Contribution.contract.FilterLogs(opts, "ContributionAdded", contributorIdRule) + if err != nil { + return nil, err + } + return &ContributionContributionAddedIterator{contract: _Contribution.contract, event: "ContributionAdded", logs: logs, sub: sub}, nil +} + +// WatchContributionAdded is a free log subscription operation binding the contract event 0x2c823389cf5f7448115ce6507d185cb6ce8390e3433f5fe31aace1199aba8481. +// +// Solidity: event ContributionAdded(uint32 id, uint32 indexed contributorId, uint32 amount) +func (_Contribution *ContributionFilterer) WatchContributionAdded(opts *bind.WatchOpts, sink chan<- *ContributionContributionAdded, contributorId []uint32) (event.Subscription, error) { + + var contributorIdRule []interface{} + for _, contributorIdItem := range contributorId { + contributorIdRule = append(contributorIdRule, contributorIdItem) + } + + logs, sub, err := _Contribution.contract.WatchLogs(opts, "ContributionAdded", contributorIdRule) + 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(ContributionContributionAdded) + if err := _Contribution.contract.UnpackLog(event, "ContributionAdded", 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 +} + +// ParseContributionAdded is a log parse operation binding the contract event 0x2c823389cf5f7448115ce6507d185cb6ce8390e3433f5fe31aace1199aba8481. +// +// Solidity: event ContributionAdded(uint32 id, uint32 indexed contributorId, uint32 amount) +func (_Contribution *ContributionFilterer) ParseContributionAdded(log types.Log) (*ContributionContributionAdded, error) { + event := new(ContributionContributionAdded) + if err := _Contribution.contract.UnpackLog(event, "ContributionAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ContributionContributionVetoedIterator is returned from FilterContributionVetoed and is used to iterate over the raw logs and unpacked data for ContributionVetoed events raised by the Contribution contract. +type ContributionContributionVetoedIterator struct { + Event *ContributionContributionVetoed // 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 *ContributionContributionVetoedIterator) 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(ContributionContributionVetoed) + 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(ContributionContributionVetoed) + 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 *ContributionContributionVetoedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ContributionContributionVetoedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ContributionContributionVetoed represents a ContributionVetoed event raised by the Contribution contract. +type ContributionContributionVetoed struct { + Id uint32 + VetoedByAccount common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterContributionVetoed is a free log retrieval operation binding the contract event 0x44ada7c00d44a7df790a576f0e6037c634def2424163246d5492ecb734cc214e. +// +// Solidity: event ContributionVetoed(uint32 id, address vetoedByAccount) +func (_Contribution *ContributionFilterer) FilterContributionVetoed(opts *bind.FilterOpts) (*ContributionContributionVetoedIterator, error) { + + logs, sub, err := _Contribution.contract.FilterLogs(opts, "ContributionVetoed") + if err != nil { + return nil, err + } + return &ContributionContributionVetoedIterator{contract: _Contribution.contract, event: "ContributionVetoed", logs: logs, sub: sub}, nil +} + +// WatchContributionVetoed is a free log subscription operation binding the contract event 0x44ada7c00d44a7df790a576f0e6037c634def2424163246d5492ecb734cc214e. +// +// Solidity: event ContributionVetoed(uint32 id, address vetoedByAccount) +func (_Contribution *ContributionFilterer) WatchContributionVetoed(opts *bind.WatchOpts, sink chan<- *ContributionContributionVetoed) (event.Subscription, error) { + + logs, sub, err := _Contribution.contract.WatchLogs(opts, "ContributionVetoed") + 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(ContributionContributionVetoed) + if err := _Contribution.contract.UnpackLog(event, "ContributionVetoed", 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 +} + +// ParseContributionVetoed is a log parse operation binding the contract event 0x44ada7c00d44a7df790a576f0e6037c634def2424163246d5492ecb734cc214e. +// +// Solidity: event ContributionVetoed(uint32 id, address vetoedByAccount) +func (_Contribution *ContributionFilterer) ParseContributionVetoed(log types.Log) (*ContributionContributionVetoed, error) { + event := new(ContributionContributionVetoed) + if err := _Contribution.contract.UnpackLog(event, "ContributionVetoed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + diff --git a/contributor/contributor.go b/contributor/contributor.go new file mode 100644 index 0000000..052b3dd --- /dev/null +++ b/contributor/contributor.go @@ -0,0 +1,1262 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contributor + +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 +) + +// ContributorMetaData contains all meta data concerning the Contributor contract. +var ContributorMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccount\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccount\",\"type\":\"address\"}],\"name\":\"ContributorAccountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"ContributorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"oldHashDigest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newHashDigest\",\"type\":\"bytes32\"}],\"name\":\"ContributorProfileUpdated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"hashDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"hashFunction\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"hashSize\",\"type\":\"uint8\"}],\"name\":\"addContributor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addressExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addressIsCore\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"contributionContract\",\"outputs\":[{\"internalType\":\"contractIContributionBalance\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"contributorIds\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"contributors\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"hashDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"hashFunction\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"hashSize\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"exists\",\"type\":\"bool\"},{\"internalType\":\"uint32\",\"name\":\"kreditsWithdrawn\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"contributorsCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"coreContributorsCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"exists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"getContributorAddressById\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_id\",\"type\":\"uint32\"}],\"name\":\"getContributorById\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"hashDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"hashFunction\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"hashSize\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"isCore\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"totalKreditsEarned\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"contributionsCount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"exists\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"kreditsWithdrawn\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"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\":\"id\",\"type\":\"uint32\"}],\"name\":\"isCoreTeam\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contribution\",\"type\":\"address\"}],\"name\":\"setContributionContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"setTokenContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenContract\",\"outputs\":[{\"internalType\":\"contractIToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"oldAccount\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newAccount\",\"type\":\"address\"}],\"name\":\"updateContributorAccount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"hashDigest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"hashFunction\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"hashSize\",\"type\":\"uint8\"}],\"name\":\"updateContributorProfileHash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// ContributorABI is the input ABI used to generate the binding from. +// Deprecated: Use ContributorMetaData.ABI instead. +var ContributorABI = ContributorMetaData.ABI + +// Contributor is an auto generated Go binding around an Ethereum contract. +type Contributor struct { + ContributorCaller // Read-only binding to the contract + ContributorTransactor // Write-only binding to the contract + ContributorFilterer // Log filterer for contract events +} + +// ContributorCaller is an auto generated read-only Go binding around an Ethereum contract. +type ContributorCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContributorTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ContributorTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContributorFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ContributorFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ContributorSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ContributorSession struct { + Contract *Contributor // 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 +} + +// ContributorCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ContributorCallerSession struct { + Contract *ContributorCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ContributorTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ContributorTransactorSession struct { + Contract *ContributorTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ContributorRaw is an auto generated low-level Go binding around an Ethereum contract. +type ContributorRaw struct { + Contract *Contributor // Generic contract binding to access the raw methods on +} + +// ContributorCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ContributorCallerRaw struct { + Contract *ContributorCaller // Generic read-only contract binding to access the raw methods on +} + +// ContributorTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ContributorTransactorRaw struct { + Contract *ContributorTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewContributor creates a new instance of Contributor, bound to a specific deployed contract. +func NewContributor(address common.Address, backend bind.ContractBackend) (*Contributor, error) { + contract, err := bindContributor(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Contributor{ContributorCaller: ContributorCaller{contract: contract}, ContributorTransactor: ContributorTransactor{contract: contract}, ContributorFilterer: ContributorFilterer{contract: contract}}, nil +} + +// NewContributorCaller creates a new read-only instance of Contributor, bound to a specific deployed contract. +func NewContributorCaller(address common.Address, caller bind.ContractCaller) (*ContributorCaller, error) { + contract, err := bindContributor(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ContributorCaller{contract: contract}, nil +} + +// NewContributorTransactor creates a new write-only instance of Contributor, bound to a specific deployed contract. +func NewContributorTransactor(address common.Address, transactor bind.ContractTransactor) (*ContributorTransactor, error) { + contract, err := bindContributor(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ContributorTransactor{contract: contract}, nil +} + +// NewContributorFilterer creates a new log filterer instance of Contributor, bound to a specific deployed contract. +func NewContributorFilterer(address common.Address, filterer bind.ContractFilterer) (*ContributorFilterer, error) { + contract, err := bindContributor(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ContributorFilterer{contract: contract}, nil +} + +// bindContributor binds a generic wrapper to an already deployed contract. +func bindContributor(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ContributorABI)) + 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 (_Contributor *ContributorRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Contributor.Contract.ContributorCaller.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 (_Contributor *ContributorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Contributor.Contract.ContributorTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Contributor *ContributorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Contributor.Contract.ContributorTransactor.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 (_Contributor *ContributorCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Contributor.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 (_Contributor *ContributorTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Contributor.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Contributor *ContributorTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Contributor.Contract.contract.Transact(opts, method, params...) +} + +// AddressExists is a free data retrieval call binding the contract method 0xa5025222. +// +// Solidity: function addressExists(address account) view returns(bool) +func (_Contributor *ContributorCaller) AddressExists(opts *bind.CallOpts, account common.Address) (bool, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "addressExists", account) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// AddressExists is a free data retrieval call binding the contract method 0xa5025222. +// +// Solidity: function addressExists(address account) view returns(bool) +func (_Contributor *ContributorSession) AddressExists(account common.Address) (bool, error) { + return _Contributor.Contract.AddressExists(&_Contributor.CallOpts, account) +} + +// AddressExists is a free data retrieval call binding the contract method 0xa5025222. +// +// Solidity: function addressExists(address account) view returns(bool) +func (_Contributor *ContributorCallerSession) AddressExists(account common.Address) (bool, error) { + return _Contributor.Contract.AddressExists(&_Contributor.CallOpts, account) +} + +// AddressIsCore is a free data retrieval call binding the contract method 0x5c2707de. +// +// Solidity: function addressIsCore(address account) view returns(bool) +func (_Contributor *ContributorCaller) AddressIsCore(opts *bind.CallOpts, account common.Address) (bool, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "addressIsCore", account) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// AddressIsCore is a free data retrieval call binding the contract method 0x5c2707de. +// +// Solidity: function addressIsCore(address account) view returns(bool) +func (_Contributor *ContributorSession) AddressIsCore(account common.Address) (bool, error) { + return _Contributor.Contract.AddressIsCore(&_Contributor.CallOpts, account) +} + +// AddressIsCore is a free data retrieval call binding the contract method 0x5c2707de. +// +// Solidity: function addressIsCore(address account) view returns(bool) +func (_Contributor *ContributorCallerSession) AddressIsCore(account common.Address) (bool, error) { + return _Contributor.Contract.AddressIsCore(&_Contributor.CallOpts, account) +} + +// ContributionContract is a free data retrieval call binding the contract method 0xddfdec60. +// +// Solidity: function contributionContract() view returns(address) +func (_Contributor *ContributorCaller) ContributionContract(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "contributionContract") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ContributionContract is a free data retrieval call binding the contract method 0xddfdec60. +// +// Solidity: function contributionContract() view returns(address) +func (_Contributor *ContributorSession) ContributionContract() (common.Address, error) { + return _Contributor.Contract.ContributionContract(&_Contributor.CallOpts) +} + +// ContributionContract is a free data retrieval call binding the contract method 0xddfdec60. +// +// Solidity: function contributionContract() view returns(address) +func (_Contributor *ContributorCallerSession) ContributionContract() (common.Address, error) { + return _Contributor.Contract.ContributionContract(&_Contributor.CallOpts) +} + +// ContributorIds is a free data retrieval call binding the contract method 0x8bfbe466. +// +// Solidity: function contributorIds(address ) view returns(uint32) +func (_Contributor *ContributorCaller) ContributorIds(opts *bind.CallOpts, arg0 common.Address) (uint32, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "contributorIds", arg0) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// ContributorIds is a free data retrieval call binding the contract method 0x8bfbe466. +// +// Solidity: function contributorIds(address ) view returns(uint32) +func (_Contributor *ContributorSession) ContributorIds(arg0 common.Address) (uint32, error) { + return _Contributor.Contract.ContributorIds(&_Contributor.CallOpts, arg0) +} + +// ContributorIds is a free data retrieval call binding the contract method 0x8bfbe466. +// +// Solidity: function contributorIds(address ) view returns(uint32) +func (_Contributor *ContributorCallerSession) ContributorIds(arg0 common.Address) (uint32, error) { + return _Contributor.Contract.ContributorIds(&_Contributor.CallOpts, arg0) +} + +// Contributors is a free data retrieval call binding the contract method 0xa04f68b2. +// +// Solidity: function contributors(uint32 ) view returns(address account, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, bool exists, uint32 kreditsWithdrawn) +func (_Contributor *ContributorCaller) Contributors(opts *bind.CallOpts, arg0 uint32) (struct { + Account common.Address + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + Exists bool + KreditsWithdrawn uint32 +}, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "contributors", arg0) + + outstruct := new(struct { + Account common.Address + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + Exists bool + KreditsWithdrawn uint32 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Account = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.HashDigest = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + outstruct.HashFunction = *abi.ConvertType(out[2], new(uint8)).(*uint8) + outstruct.HashSize = *abi.ConvertType(out[3], new(uint8)).(*uint8) + outstruct.Exists = *abi.ConvertType(out[4], new(bool)).(*bool) + outstruct.KreditsWithdrawn = *abi.ConvertType(out[5], new(uint32)).(*uint32) + + return *outstruct, err + +} + +// Contributors is a free data retrieval call binding the contract method 0xa04f68b2. +// +// Solidity: function contributors(uint32 ) view returns(address account, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, bool exists, uint32 kreditsWithdrawn) +func (_Contributor *ContributorSession) Contributors(arg0 uint32) (struct { + Account common.Address + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + Exists bool + KreditsWithdrawn uint32 +}, error) { + return _Contributor.Contract.Contributors(&_Contributor.CallOpts, arg0) +} + +// Contributors is a free data retrieval call binding the contract method 0xa04f68b2. +// +// Solidity: function contributors(uint32 ) view returns(address account, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, bool exists, uint32 kreditsWithdrawn) +func (_Contributor *ContributorCallerSession) Contributors(arg0 uint32) (struct { + Account common.Address + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + Exists bool + KreditsWithdrawn uint32 +}, error) { + return _Contributor.Contract.Contributors(&_Contributor.CallOpts, arg0) +} + +// ContributorsCount is a free data retrieval call binding the contract method 0x7569b3d7. +// +// Solidity: function contributorsCount() view returns(uint32) +func (_Contributor *ContributorCaller) ContributorsCount(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "contributorsCount") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// ContributorsCount is a free data retrieval call binding the contract method 0x7569b3d7. +// +// Solidity: function contributorsCount() view returns(uint32) +func (_Contributor *ContributorSession) ContributorsCount() (uint32, error) { + return _Contributor.Contract.ContributorsCount(&_Contributor.CallOpts) +} + +// ContributorsCount is a free data retrieval call binding the contract method 0x7569b3d7. +// +// Solidity: function contributorsCount() view returns(uint32) +func (_Contributor *ContributorCallerSession) ContributorsCount() (uint32, error) { + return _Contributor.Contract.ContributorsCount(&_Contributor.CallOpts) +} + +// CoreContributorsCount is a free data retrieval call binding the contract method 0x44fb4596. +// +// Solidity: function coreContributorsCount() view returns(uint32) +func (_Contributor *ContributorCaller) CoreContributorsCount(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "coreContributorsCount") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// CoreContributorsCount is a free data retrieval call binding the contract method 0x44fb4596. +// +// Solidity: function coreContributorsCount() view returns(uint32) +func (_Contributor *ContributorSession) CoreContributorsCount() (uint32, error) { + return _Contributor.Contract.CoreContributorsCount(&_Contributor.CallOpts) +} + +// CoreContributorsCount is a free data retrieval call binding the contract method 0x44fb4596. +// +// Solidity: function coreContributorsCount() view returns(uint32) +func (_Contributor *ContributorCallerSession) CoreContributorsCount() (uint32, error) { + return _Contributor.Contract.CoreContributorsCount(&_Contributor.CallOpts) +} + +// Deployer is a free data retrieval call binding the contract method 0xd5f39488. +// +// Solidity: function deployer() view returns(address) +func (_Contributor *ContributorCaller) Deployer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "deployer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Deployer is a free data retrieval call binding the contract method 0xd5f39488. +// +// Solidity: function deployer() view returns(address) +func (_Contributor *ContributorSession) Deployer() (common.Address, error) { + return _Contributor.Contract.Deployer(&_Contributor.CallOpts) +} + +// Deployer is a free data retrieval call binding the contract method 0xd5f39488. +// +// Solidity: function deployer() view returns(address) +func (_Contributor *ContributorCallerSession) Deployer() (common.Address, error) { + return _Contributor.Contract.Deployer(&_Contributor.CallOpts) +} + +// Exists is a free data retrieval call binding the contract method 0x13c369ed. +// +// Solidity: function exists(uint32 id) view returns(bool) +func (_Contributor *ContributorCaller) Exists(opts *bind.CallOpts, id uint32) (bool, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "exists", id) + + 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 id) view returns(bool) +func (_Contributor *ContributorSession) Exists(id uint32) (bool, error) { + return _Contributor.Contract.Exists(&_Contributor.CallOpts, id) +} + +// Exists is a free data retrieval call binding the contract method 0x13c369ed. +// +// Solidity: function exists(uint32 id) view returns(bool) +func (_Contributor *ContributorCallerSession) Exists(id uint32) (bool, error) { + return _Contributor.Contract.Exists(&_Contributor.CallOpts, id) +} + +// GetContributorAddressById is a free data retrieval call binding the contract method 0x27266309. +// +// Solidity: function getContributorAddressById(uint32 id) view returns(address) +func (_Contributor *ContributorCaller) GetContributorAddressById(opts *bind.CallOpts, id uint32) (common.Address, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "getContributorAddressById", id) + + 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 id) view returns(address) +func (_Contributor *ContributorSession) GetContributorAddressById(id uint32) (common.Address, error) { + return _Contributor.Contract.GetContributorAddressById(&_Contributor.CallOpts, id) +} + +// GetContributorAddressById is a free data retrieval call binding the contract method 0x27266309. +// +// Solidity: function getContributorAddressById(uint32 id) view returns(address) +func (_Contributor *ContributorCallerSession) GetContributorAddressById(id uint32) (common.Address, error) { + return _Contributor.Contract.GetContributorAddressById(&_Contributor.CallOpts, id) +} + +// GetContributorById is a free data retrieval call binding the contract method 0x7234fd67. +// +// Solidity: function getContributorById(uint32 _id) view returns(uint32 id, address account, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, bool isCore, uint256 balance, uint32 totalKreditsEarned, uint256 contributionsCount, bool exists, uint256 kreditsWithdrawn) +func (_Contributor *ContributorCaller) GetContributorById(opts *bind.CallOpts, _id uint32) (struct { + Id uint32 + Account common.Address + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + IsCore bool + Balance *big.Int + TotalKreditsEarned uint32 + ContributionsCount *big.Int + Exists bool + KreditsWithdrawn *big.Int +}, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "getContributorById", _id) + + outstruct := new(struct { + Id uint32 + Account common.Address + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + IsCore bool + Balance *big.Int + TotalKreditsEarned uint32 + ContributionsCount *big.Int + Exists bool + KreditsWithdrawn *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Id = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.Account = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + outstruct.HashDigest = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + outstruct.HashFunction = *abi.ConvertType(out[3], new(uint8)).(*uint8) + outstruct.HashSize = *abi.ConvertType(out[4], new(uint8)).(*uint8) + outstruct.IsCore = *abi.ConvertType(out[5], new(bool)).(*bool) + outstruct.Balance = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) + outstruct.TotalKreditsEarned = *abi.ConvertType(out[7], new(uint32)).(*uint32) + outstruct.ContributionsCount = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) + outstruct.Exists = *abi.ConvertType(out[9], new(bool)).(*bool) + outstruct.KreditsWithdrawn = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetContributorById is a free data retrieval call binding the contract method 0x7234fd67. +// +// Solidity: function getContributorById(uint32 _id) view returns(uint32 id, address account, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, bool isCore, uint256 balance, uint32 totalKreditsEarned, uint256 contributionsCount, bool exists, uint256 kreditsWithdrawn) +func (_Contributor *ContributorSession) GetContributorById(_id uint32) (struct { + Id uint32 + Account common.Address + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + IsCore bool + Balance *big.Int + TotalKreditsEarned uint32 + ContributionsCount *big.Int + Exists bool + KreditsWithdrawn *big.Int +}, error) { + return _Contributor.Contract.GetContributorById(&_Contributor.CallOpts, _id) +} + +// GetContributorById is a free data retrieval call binding the contract method 0x7234fd67. +// +// Solidity: function getContributorById(uint32 _id) view returns(uint32 id, address account, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, bool isCore, uint256 balance, uint32 totalKreditsEarned, uint256 contributionsCount, bool exists, uint256 kreditsWithdrawn) +func (_Contributor *ContributorCallerSession) GetContributorById(_id uint32) (struct { + Id uint32 + Account common.Address + HashDigest [32]byte + HashFunction uint8 + HashSize uint8 + IsCore bool + Balance *big.Int + TotalKreditsEarned uint32 + ContributionsCount *big.Int + Exists bool + KreditsWithdrawn *big.Int +}, error) { + return _Contributor.Contract.GetContributorById(&_Contributor.CallOpts, _id) +} + +// GetContributorIdByAddress is a free data retrieval call binding the contract method 0x28dcb8f2. +// +// Solidity: function getContributorIdByAddress(address account) view returns(uint32) +func (_Contributor *ContributorCaller) GetContributorIdByAddress(opts *bind.CallOpts, account common.Address) (uint32, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "getContributorIdByAddress", account) + + 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 account) view returns(uint32) +func (_Contributor *ContributorSession) GetContributorIdByAddress(account common.Address) (uint32, error) { + return _Contributor.Contract.GetContributorIdByAddress(&_Contributor.CallOpts, account) +} + +// GetContributorIdByAddress is a free data retrieval call binding the contract method 0x28dcb8f2. +// +// Solidity: function getContributorIdByAddress(address account) view returns(uint32) +func (_Contributor *ContributorCallerSession) GetContributorIdByAddress(account common.Address) (uint32, error) { + return _Contributor.Contract.GetContributorIdByAddress(&_Contributor.CallOpts, account) +} + +// IsCoreTeam is a free data retrieval call binding the contract method 0xf192ebea. +// +// Solidity: function isCoreTeam(uint32 id) view returns(bool) +func (_Contributor *ContributorCaller) IsCoreTeam(opts *bind.CallOpts, id uint32) (bool, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "isCoreTeam", id) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsCoreTeam is a free data retrieval call binding the contract method 0xf192ebea. +// +// Solidity: function isCoreTeam(uint32 id) view returns(bool) +func (_Contributor *ContributorSession) IsCoreTeam(id uint32) (bool, error) { + return _Contributor.Contract.IsCoreTeam(&_Contributor.CallOpts, id) +} + +// IsCoreTeam is a free data retrieval call binding the contract method 0xf192ebea. +// +// Solidity: function isCoreTeam(uint32 id) view returns(bool) +func (_Contributor *ContributorCallerSession) IsCoreTeam(id uint32) (bool, error) { + return _Contributor.Contract.IsCoreTeam(&_Contributor.CallOpts, id) +} + +// TokenContract is a free data retrieval call binding the contract method 0x55a373d6. +// +// Solidity: function tokenContract() view returns(address) +func (_Contributor *ContributorCaller) TokenContract(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Contributor.contract.Call(opts, &out, "tokenContract") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// TokenContract is a free data retrieval call binding the contract method 0x55a373d6. +// +// Solidity: function tokenContract() view returns(address) +func (_Contributor *ContributorSession) TokenContract() (common.Address, error) { + return _Contributor.Contract.TokenContract(&_Contributor.CallOpts) +} + +// TokenContract is a free data retrieval call binding the contract method 0x55a373d6. +// +// Solidity: function tokenContract() view returns(address) +func (_Contributor *ContributorCallerSession) TokenContract() (common.Address, error) { + return _Contributor.Contract.TokenContract(&_Contributor.CallOpts) +} + +// AddContributor is a paid mutator transaction binding the contract method 0x16572ba7. +// +// Solidity: function addContributor(address account, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) returns() +func (_Contributor *ContributorTransactor) AddContributor(opts *bind.TransactOpts, account common.Address, hashDigest [32]byte, hashFunction uint8, hashSize uint8) (*types.Transaction, error) { + return _Contributor.contract.Transact(opts, "addContributor", account, hashDigest, hashFunction, hashSize) +} + +// AddContributor is a paid mutator transaction binding the contract method 0x16572ba7. +// +// Solidity: function addContributor(address account, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) returns() +func (_Contributor *ContributorSession) AddContributor(account common.Address, hashDigest [32]byte, hashFunction uint8, hashSize uint8) (*types.Transaction, error) { + return _Contributor.Contract.AddContributor(&_Contributor.TransactOpts, account, hashDigest, hashFunction, hashSize) +} + +// AddContributor is a paid mutator transaction binding the contract method 0x16572ba7. +// +// Solidity: function addContributor(address account, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) returns() +func (_Contributor *ContributorTransactorSession) AddContributor(account common.Address, hashDigest [32]byte, hashFunction uint8, hashSize uint8) (*types.Transaction, error) { + return _Contributor.Contract.AddContributor(&_Contributor.TransactOpts, account, hashDigest, hashFunction, hashSize) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Contributor *ContributorTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Contributor.contract.Transact(opts, "initialize") +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Contributor *ContributorSession) Initialize() (*types.Transaction, error) { + return _Contributor.Contract.Initialize(&_Contributor.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Contributor *ContributorTransactorSession) Initialize() (*types.Transaction, error) { + return _Contributor.Contract.Initialize(&_Contributor.TransactOpts) +} + +// SetContributionContract is a paid mutator transaction binding the contract method 0x85480556. +// +// Solidity: function setContributionContract(address contribution) returns() +func (_Contributor *ContributorTransactor) SetContributionContract(opts *bind.TransactOpts, contribution common.Address) (*types.Transaction, error) { + return _Contributor.contract.Transact(opts, "setContributionContract", contribution) +} + +// SetContributionContract is a paid mutator transaction binding the contract method 0x85480556. +// +// Solidity: function setContributionContract(address contribution) returns() +func (_Contributor *ContributorSession) SetContributionContract(contribution common.Address) (*types.Transaction, error) { + return _Contributor.Contract.SetContributionContract(&_Contributor.TransactOpts, contribution) +} + +// SetContributionContract is a paid mutator transaction binding the contract method 0x85480556. +// +// Solidity: function setContributionContract(address contribution) returns() +func (_Contributor *ContributorTransactorSession) SetContributionContract(contribution common.Address) (*types.Transaction, error) { + return _Contributor.Contract.SetContributionContract(&_Contributor.TransactOpts, contribution) +} + +// SetTokenContract is a paid mutator transaction binding the contract method 0xbbcd5bbe. +// +// Solidity: function setTokenContract(address token) returns() +func (_Contributor *ContributorTransactor) SetTokenContract(opts *bind.TransactOpts, token common.Address) (*types.Transaction, error) { + return _Contributor.contract.Transact(opts, "setTokenContract", token) +} + +// SetTokenContract is a paid mutator transaction binding the contract method 0xbbcd5bbe. +// +// Solidity: function setTokenContract(address token) returns() +func (_Contributor *ContributorSession) SetTokenContract(token common.Address) (*types.Transaction, error) { + return _Contributor.Contract.SetTokenContract(&_Contributor.TransactOpts, token) +} + +// SetTokenContract is a paid mutator transaction binding the contract method 0xbbcd5bbe. +// +// Solidity: function setTokenContract(address token) returns() +func (_Contributor *ContributorTransactorSession) SetTokenContract(token common.Address) (*types.Transaction, error) { + return _Contributor.Contract.SetTokenContract(&_Contributor.TransactOpts, token) +} + +// UpdateContributorAccount is a paid mutator transaction binding the contract method 0x0d2bcbc0. +// +// Solidity: function updateContributorAccount(uint32 id, address oldAccount, address newAccount) returns() +func (_Contributor *ContributorTransactor) UpdateContributorAccount(opts *bind.TransactOpts, id uint32, oldAccount common.Address, newAccount common.Address) (*types.Transaction, error) { + return _Contributor.contract.Transact(opts, "updateContributorAccount", id, oldAccount, newAccount) +} + +// UpdateContributorAccount is a paid mutator transaction binding the contract method 0x0d2bcbc0. +// +// Solidity: function updateContributorAccount(uint32 id, address oldAccount, address newAccount) returns() +func (_Contributor *ContributorSession) UpdateContributorAccount(id uint32, oldAccount common.Address, newAccount common.Address) (*types.Transaction, error) { + return _Contributor.Contract.UpdateContributorAccount(&_Contributor.TransactOpts, id, oldAccount, newAccount) +} + +// UpdateContributorAccount is a paid mutator transaction binding the contract method 0x0d2bcbc0. +// +// Solidity: function updateContributorAccount(uint32 id, address oldAccount, address newAccount) returns() +func (_Contributor *ContributorTransactorSession) UpdateContributorAccount(id uint32, oldAccount common.Address, newAccount common.Address) (*types.Transaction, error) { + return _Contributor.Contract.UpdateContributorAccount(&_Contributor.TransactOpts, id, oldAccount, newAccount) +} + +// UpdateContributorProfileHash is a paid mutator transaction binding the contract method 0xb2b16dc0. +// +// Solidity: function updateContributorProfileHash(uint32 id, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) returns() +func (_Contributor *ContributorTransactor) UpdateContributorProfileHash(opts *bind.TransactOpts, id uint32, hashDigest [32]byte, hashFunction uint8, hashSize uint8) (*types.Transaction, error) { + return _Contributor.contract.Transact(opts, "updateContributorProfileHash", id, hashDigest, hashFunction, hashSize) +} + +// UpdateContributorProfileHash is a paid mutator transaction binding the contract method 0xb2b16dc0. +// +// Solidity: function updateContributorProfileHash(uint32 id, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) returns() +func (_Contributor *ContributorSession) UpdateContributorProfileHash(id uint32, hashDigest [32]byte, hashFunction uint8, hashSize uint8) (*types.Transaction, error) { + return _Contributor.Contract.UpdateContributorProfileHash(&_Contributor.TransactOpts, id, hashDigest, hashFunction, hashSize) +} + +// UpdateContributorProfileHash is a paid mutator transaction binding the contract method 0xb2b16dc0. +// +// Solidity: function updateContributorProfileHash(uint32 id, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) returns() +func (_Contributor *ContributorTransactorSession) UpdateContributorProfileHash(id uint32, hashDigest [32]byte, hashFunction uint8, hashSize uint8) (*types.Transaction, error) { + return _Contributor.Contract.UpdateContributorProfileHash(&_Contributor.TransactOpts, id, hashDigest, hashFunction, hashSize) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_Contributor *ContributorTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Contributor.contract.Transact(opts, "withdraw") +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_Contributor *ContributorSession) Withdraw() (*types.Transaction, error) { + return _Contributor.Contract.Withdraw(&_Contributor.TransactOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_Contributor *ContributorTransactorSession) Withdraw() (*types.Transaction, error) { + return _Contributor.Contract.Withdraw(&_Contributor.TransactOpts) +} + +// ContributorContributorAccountUpdatedIterator is returned from FilterContributorAccountUpdated and is used to iterate over the raw logs and unpacked data for ContributorAccountUpdated events raised by the Contributor contract. +type ContributorContributorAccountUpdatedIterator struct { + Event *ContributorContributorAccountUpdated // 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 *ContributorContributorAccountUpdatedIterator) 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(ContributorContributorAccountUpdated) + 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(ContributorContributorAccountUpdated) + 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 *ContributorContributorAccountUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ContributorContributorAccountUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ContributorContributorAccountUpdated represents a ContributorAccountUpdated event raised by the Contributor contract. +type ContributorContributorAccountUpdated struct { + Id uint32 + OldAccount common.Address + NewAccount common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterContributorAccountUpdated is a free log retrieval operation binding the contract event 0x3ac4f1ef6607b971c009b0cd01c93eac3e87abd9626b0197b553fd4edba5f9c5. +// +// Solidity: event ContributorAccountUpdated(uint32 id, address oldAccount, address newAccount) +func (_Contributor *ContributorFilterer) FilterContributorAccountUpdated(opts *bind.FilterOpts) (*ContributorContributorAccountUpdatedIterator, error) { + + logs, sub, err := _Contributor.contract.FilterLogs(opts, "ContributorAccountUpdated") + if err != nil { + return nil, err + } + return &ContributorContributorAccountUpdatedIterator{contract: _Contributor.contract, event: "ContributorAccountUpdated", logs: logs, sub: sub}, nil +} + +// WatchContributorAccountUpdated is a free log subscription operation binding the contract event 0x3ac4f1ef6607b971c009b0cd01c93eac3e87abd9626b0197b553fd4edba5f9c5. +// +// Solidity: event ContributorAccountUpdated(uint32 id, address oldAccount, address newAccount) +func (_Contributor *ContributorFilterer) WatchContributorAccountUpdated(opts *bind.WatchOpts, sink chan<- *ContributorContributorAccountUpdated) (event.Subscription, error) { + + logs, sub, err := _Contributor.contract.WatchLogs(opts, "ContributorAccountUpdated") + 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(ContributorContributorAccountUpdated) + if err := _Contributor.contract.UnpackLog(event, "ContributorAccountUpdated", 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 +} + +// ParseContributorAccountUpdated is a log parse operation binding the contract event 0x3ac4f1ef6607b971c009b0cd01c93eac3e87abd9626b0197b553fd4edba5f9c5. +// +// Solidity: event ContributorAccountUpdated(uint32 id, address oldAccount, address newAccount) +func (_Contributor *ContributorFilterer) ParseContributorAccountUpdated(log types.Log) (*ContributorContributorAccountUpdated, error) { + event := new(ContributorContributorAccountUpdated) + if err := _Contributor.contract.UnpackLog(event, "ContributorAccountUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ContributorContributorAddedIterator is returned from FilterContributorAdded and is used to iterate over the raw logs and unpacked data for ContributorAdded events raised by the Contributor contract. +type ContributorContributorAddedIterator struct { + Event *ContributorContributorAdded // 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 *ContributorContributorAddedIterator) 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(ContributorContributorAdded) + 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(ContributorContributorAdded) + 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 *ContributorContributorAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ContributorContributorAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ContributorContributorAdded represents a ContributorAdded event raised by the Contributor contract. +type ContributorContributorAdded struct { + Id uint32 + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterContributorAdded is a free log retrieval operation binding the contract event 0x72ad9d5c569f04611365a4b438e5136dfc467e00ca73b88f24034b45e0cb54bc. +// +// Solidity: event ContributorAdded(uint32 id, address account) +func (_Contributor *ContributorFilterer) FilterContributorAdded(opts *bind.FilterOpts) (*ContributorContributorAddedIterator, error) { + + logs, sub, err := _Contributor.contract.FilterLogs(opts, "ContributorAdded") + if err != nil { + return nil, err + } + return &ContributorContributorAddedIterator{contract: _Contributor.contract, event: "ContributorAdded", logs: logs, sub: sub}, nil +} + +// WatchContributorAdded is a free log subscription operation binding the contract event 0x72ad9d5c569f04611365a4b438e5136dfc467e00ca73b88f24034b45e0cb54bc. +// +// Solidity: event ContributorAdded(uint32 id, address account) +func (_Contributor *ContributorFilterer) WatchContributorAdded(opts *bind.WatchOpts, sink chan<- *ContributorContributorAdded) (event.Subscription, error) { + + logs, sub, err := _Contributor.contract.WatchLogs(opts, "ContributorAdded") + 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(ContributorContributorAdded) + if err := _Contributor.contract.UnpackLog(event, "ContributorAdded", 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 +} + +// ParseContributorAdded is a log parse operation binding the contract event 0x72ad9d5c569f04611365a4b438e5136dfc467e00ca73b88f24034b45e0cb54bc. +// +// Solidity: event ContributorAdded(uint32 id, address account) +func (_Contributor *ContributorFilterer) ParseContributorAdded(log types.Log) (*ContributorContributorAdded, error) { + event := new(ContributorContributorAdded) + if err := _Contributor.contract.UnpackLog(event, "ContributorAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ContributorContributorProfileUpdatedIterator is returned from FilterContributorProfileUpdated and is used to iterate over the raw logs and unpacked data for ContributorProfileUpdated events raised by the Contributor contract. +type ContributorContributorProfileUpdatedIterator struct { + Event *ContributorContributorProfileUpdated // 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 *ContributorContributorProfileUpdatedIterator) 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(ContributorContributorProfileUpdated) + 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(ContributorContributorProfileUpdated) + 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 *ContributorContributorProfileUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ContributorContributorProfileUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ContributorContributorProfileUpdated represents a ContributorProfileUpdated event raised by the Contributor contract. +type ContributorContributorProfileUpdated struct { + Id uint32 + OldHashDigest [32]byte + NewHashDigest [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterContributorProfileUpdated is a free log retrieval operation binding the contract event 0xbf4649cac1c0dd79f552070f545de45adfbbde96ef8b717b6ee4e9b476f1b878. +// +// Solidity: event ContributorProfileUpdated(uint32 id, bytes32 oldHashDigest, bytes32 newHashDigest) +func (_Contributor *ContributorFilterer) FilterContributorProfileUpdated(opts *bind.FilterOpts) (*ContributorContributorProfileUpdatedIterator, error) { + + logs, sub, err := _Contributor.contract.FilterLogs(opts, "ContributorProfileUpdated") + if err != nil { + return nil, err + } + return &ContributorContributorProfileUpdatedIterator{contract: _Contributor.contract, event: "ContributorProfileUpdated", logs: logs, sub: sub}, nil +} + +// WatchContributorProfileUpdated is a free log subscription operation binding the contract event 0xbf4649cac1c0dd79f552070f545de45adfbbde96ef8b717b6ee4e9b476f1b878. +// +// Solidity: event ContributorProfileUpdated(uint32 id, bytes32 oldHashDigest, bytes32 newHashDigest) +func (_Contributor *ContributorFilterer) WatchContributorProfileUpdated(opts *bind.WatchOpts, sink chan<- *ContributorContributorProfileUpdated) (event.Subscription, error) { + + logs, sub, err := _Contributor.contract.WatchLogs(opts, "ContributorProfileUpdated") + 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(ContributorContributorProfileUpdated) + if err := _Contributor.contract.UnpackLog(event, "ContributorProfileUpdated", 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 +} + +// ParseContributorProfileUpdated is a log parse operation binding the contract event 0xbf4649cac1c0dd79f552070f545de45adfbbde96ef8b717b6ee4e9b476f1b878. +// +// Solidity: event ContributorProfileUpdated(uint32 id, bytes32 oldHashDigest, bytes32 newHashDigest) +func (_Contributor *ContributorFilterer) ParseContributorProfileUpdated(log types.Log) (*ContributorContributorProfileUpdated, error) { + event := new(ContributorContributorProfileUpdated) + if err := _Contributor.contract.UnpackLog(event, "ContributorProfileUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..35dd2ae --- /dev/null +++ b/go.mod @@ -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 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..ef5e98a --- /dev/null +++ b/go.sum @@ -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= diff --git a/reimbursement/reimbursement.go b/reimbursement/reimbursement.go new file mode 100644 index 0000000..feaa8c1 --- /dev/null +++ b/reimbursement/reimbursement.go @@ -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 +} + diff --git a/token/token.go b/token/token.go new file mode 100644 index 0000000..3b18a8e --- /dev/null +++ b/token/token.go @@ -0,0 +1,1050 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package token + +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 +) + +// TokenMetaData contains all meta data concerning the Token contract. +var TokenMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"KreditsMinted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"contributorContract\",\"outputs\":[{\"internalType\":\"contractContributorInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"contributorContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contributorAccount\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintFor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contributor\",\"type\":\"address\"}],\"name\":\"setContributorContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// TokenABI is the input ABI used to generate the binding from. +// Deprecated: Use TokenMetaData.ABI instead. +var TokenABI = TokenMetaData.ABI + +// Token is an auto generated Go binding around an Ethereum contract. +type Token struct { + TokenCaller // Read-only binding to the contract + TokenTransactor // Write-only binding to the contract + TokenFilterer // Log filterer for contract events +} + +// TokenCaller is an auto generated read-only Go binding around an Ethereum contract. +type TokenCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TokenTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TokenTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TokenFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TokenSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TokenSession struct { + Contract *Token // 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 +} + +// TokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TokenCallerSession struct { + Contract *TokenCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TokenTransactorSession struct { + Contract *TokenTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TokenRaw is an auto generated low-level Go binding around an Ethereum contract. +type TokenRaw struct { + Contract *Token // Generic contract binding to access the raw methods on +} + +// TokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TokenCallerRaw struct { + Contract *TokenCaller // Generic read-only contract binding to access the raw methods on +} + +// TokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TokenTransactorRaw struct { + Contract *TokenTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewToken creates a new instance of Token, bound to a specific deployed contract. +func NewToken(address common.Address, backend bind.ContractBackend) (*Token, error) { + contract, err := bindToken(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Token{TokenCaller: TokenCaller{contract: contract}, TokenTransactor: TokenTransactor{contract: contract}, TokenFilterer: TokenFilterer{contract: contract}}, nil +} + +// NewTokenCaller creates a new read-only instance of Token, bound to a specific deployed contract. +func NewTokenCaller(address common.Address, caller bind.ContractCaller) (*TokenCaller, error) { + contract, err := bindToken(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TokenCaller{contract: contract}, nil +} + +// NewTokenTransactor creates a new write-only instance of Token, bound to a specific deployed contract. +func NewTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenTransactor, error) { + contract, err := bindToken(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TokenTransactor{contract: contract}, nil +} + +// NewTokenFilterer creates a new log filterer instance of Token, bound to a specific deployed contract. +func NewTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*TokenFilterer, error) { + contract, err := bindToken(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TokenFilterer{contract: contract}, nil +} + +// bindToken binds a generic wrapper to an already deployed contract. +func bindToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(TokenABI)) + 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 (_Token *TokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Token.Contract.TokenCaller.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 (_Token *TokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Token.Contract.TokenTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Token *TokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Token.Contract.TokenTransactor.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 (_Token *TokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Token.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 (_Token *TokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Token.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Token *TokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Token.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_Token *TokenCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _Token.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_Token *TokenSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _Token.Contract.Allowance(&_Token.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_Token *TokenCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _Token.Contract.Allowance(&_Token.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _Token.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_Token *TokenSession) BalanceOf(account common.Address) (*big.Int, error) { + return _Token.Contract.BalanceOf(&_Token.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_Token *TokenCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _Token.Contract.BalanceOf(&_Token.CallOpts, account) +} + +// ContributorContract is a free data retrieval call binding the contract method 0x7b8917d1. +// +// Solidity: function contributorContract() view returns(address) +func (_Token *TokenCaller) ContributorContract(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Token.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 (_Token *TokenSession) ContributorContract() (common.Address, error) { + return _Token.Contract.ContributorContract(&_Token.CallOpts) +} + +// ContributorContract is a free data retrieval call binding the contract method 0x7b8917d1. +// +// Solidity: function contributorContract() view returns(address) +func (_Token *TokenCallerSession) ContributorContract() (common.Address, error) { + return _Token.Contract.ContributorContract(&_Token.CallOpts) +} + +// ContributorContractAddress is a free data retrieval call binding the contract method 0x2d5fa841. +// +// Solidity: function contributorContractAddress() view returns(address) +func (_Token *TokenCaller) ContributorContractAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Token.contract.Call(opts, &out, "contributorContractAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ContributorContractAddress is a free data retrieval call binding the contract method 0x2d5fa841. +// +// Solidity: function contributorContractAddress() view returns(address) +func (_Token *TokenSession) ContributorContractAddress() (common.Address, error) { + return _Token.Contract.ContributorContractAddress(&_Token.CallOpts) +} + +// ContributorContractAddress is a free data retrieval call binding the contract method 0x2d5fa841. +// +// Solidity: function contributorContractAddress() view returns(address) +func (_Token *TokenCallerSession) ContributorContractAddress() (common.Address, error) { + return _Token.Contract.ContributorContractAddress(&_Token.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Token *TokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _Token.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Token *TokenSession) Decimals() (uint8, error) { + return _Token.Contract.Decimals(&_Token.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Token *TokenCallerSession) Decimals() (uint8, error) { + return _Token.Contract.Decimals(&_Token.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Token *TokenCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Token.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Token *TokenSession) Name() (string, error) { + return _Token.Contract.Name(&_Token.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Token *TokenCallerSession) Name() (string, error) { + return _Token.Contract.Name(&_Token.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Token *TokenCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Token.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Token *TokenSession) Symbol() (string, error) { + return _Token.Contract.Symbol(&_Token.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Token *TokenCallerSession) Symbol() (string, error) { + return _Token.Contract.Symbol(&_Token.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Token *TokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Token.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Token *TokenSession) TotalSupply() (*big.Int, error) { + return _Token.Contract.TotalSupply(&_Token.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Token *TokenCallerSession) TotalSupply() (*big.Int, error) { + return _Token.Contract.TotalSupply(&_Token.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_Token *TokenTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_Token *TokenSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.Contract.Approve(&_Token.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_Token *TokenTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.Contract.Approve(&_Token.TransactOpts, spender, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_Token *TokenTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _Token.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_Token *TokenSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _Token.Contract.DecreaseAllowance(&_Token.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_Token *TokenTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _Token.Contract.DecreaseAllowance(&_Token.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_Token *TokenTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _Token.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_Token *TokenSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _Token.Contract.IncreaseAllowance(&_Token.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_Token *TokenTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _Token.Contract.IncreaseAllowance(&_Token.TransactOpts, spender, addedValue) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Token *TokenTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Token.contract.Transact(opts, "initialize") +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Token *TokenSession) Initialize() (*types.Transaction, error) { + return _Token.Contract.Initialize(&_Token.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Token *TokenTransactorSession) Initialize() (*types.Transaction, error) { + return _Token.Contract.Initialize(&_Token.TransactOpts) +} + +// MintFor is a paid mutator transaction binding the contract method 0xda1919b3. +// +// Solidity: function mintFor(address contributorAccount, uint256 amount) returns() +func (_Token *TokenTransactor) MintFor(opts *bind.TransactOpts, contributorAccount common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.contract.Transact(opts, "mintFor", contributorAccount, amount) +} + +// MintFor is a paid mutator transaction binding the contract method 0xda1919b3. +// +// Solidity: function mintFor(address contributorAccount, uint256 amount) returns() +func (_Token *TokenSession) MintFor(contributorAccount common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.Contract.MintFor(&_Token.TransactOpts, contributorAccount, amount) +} + +// MintFor is a paid mutator transaction binding the contract method 0xda1919b3. +// +// Solidity: function mintFor(address contributorAccount, uint256 amount) returns() +func (_Token *TokenTransactorSession) MintFor(contributorAccount common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.Contract.MintFor(&_Token.TransactOpts, contributorAccount, amount) +} + +// SetContributorContract is a paid mutator transaction binding the contract method 0xdc08776d. +// +// Solidity: function setContributorContract(address contributor) returns() +func (_Token *TokenTransactor) SetContributorContract(opts *bind.TransactOpts, contributor common.Address) (*types.Transaction, error) { + return _Token.contract.Transact(opts, "setContributorContract", contributor) +} + +// SetContributorContract is a paid mutator transaction binding the contract method 0xdc08776d. +// +// Solidity: function setContributorContract(address contributor) returns() +func (_Token *TokenSession) SetContributorContract(contributor common.Address) (*types.Transaction, error) { + return _Token.Contract.SetContributorContract(&_Token.TransactOpts, contributor) +} + +// SetContributorContract is a paid mutator transaction binding the contract method 0xdc08776d. +// +// Solidity: function setContributorContract(address contributor) returns() +func (_Token *TokenTransactorSession) SetContributorContract(contributor common.Address) (*types.Transaction, error) { + return _Token.Contract.SetContributorContract(&_Token.TransactOpts, contributor) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_Token *TokenTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.contract.Transact(opts, "transfer", to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_Token *TokenSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.Contract.Transfer(&_Token.TransactOpts, to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_Token *TokenTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.Contract.Transfer(&_Token.TransactOpts, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_Token *TokenTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.contract.Transact(opts, "transferFrom", from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_Token *TokenSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.Contract.TransferFrom(&_Token.TransactOpts, from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_Token *TokenTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Token.Contract.TransferFrom(&_Token.TransactOpts, from, to, amount) +} + +// TokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Token contract. +type TokenApprovalIterator struct { + Event *TokenApproval // 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 *TokenApprovalIterator) 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(TokenApproval) + 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(TokenApproval) + 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 *TokenApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenApproval represents a Approval event raised by the Token contract. +type TokenApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_Token *TokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*TokenApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Token.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &TokenApprovalIterator{contract: _Token.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_Token *TokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *TokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Token.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + 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(TokenApproval) + if err := _Token.contract.UnpackLog(event, "Approval", 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 +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_Token *TokenFilterer) ParseApproval(log types.Log) (*TokenApproval, error) { + event := new(TokenApproval) + if err := _Token.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenKreditsMintedIterator is returned from FilterKreditsMinted and is used to iterate over the raw logs and unpacked data for KreditsMinted events raised by the Token contract. +type TokenKreditsMintedIterator struct { + Event *TokenKreditsMinted // 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 *TokenKreditsMintedIterator) 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(TokenKreditsMinted) + 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(TokenKreditsMinted) + 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 *TokenKreditsMintedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenKreditsMintedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenKreditsMinted represents a KreditsMinted event raised by the Token contract. +type TokenKreditsMinted struct { + Recipient common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterKreditsMinted is a free log retrieval operation binding the contract event 0xd5f3d67ee271d40efe9d40a0156048cca5981defcf15bcdb9ee7d256f2c01007. +// +// Solidity: event KreditsMinted(address indexed recipient, uint256 amount) +func (_Token *TokenFilterer) FilterKreditsMinted(opts *bind.FilterOpts, recipient []common.Address) (*TokenKreditsMintedIterator, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Token.contract.FilterLogs(opts, "KreditsMinted", recipientRule) + if err != nil { + return nil, err + } + return &TokenKreditsMintedIterator{contract: _Token.contract, event: "KreditsMinted", logs: logs, sub: sub}, nil +} + +// WatchKreditsMinted is a free log subscription operation binding the contract event 0xd5f3d67ee271d40efe9d40a0156048cca5981defcf15bcdb9ee7d256f2c01007. +// +// Solidity: event KreditsMinted(address indexed recipient, uint256 amount) +func (_Token *TokenFilterer) WatchKreditsMinted(opts *bind.WatchOpts, sink chan<- *TokenKreditsMinted, recipient []common.Address) (event.Subscription, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Token.contract.WatchLogs(opts, "KreditsMinted", recipientRule) + 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(TokenKreditsMinted) + if err := _Token.contract.UnpackLog(event, "KreditsMinted", 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 +} + +// ParseKreditsMinted is a log parse operation binding the contract event 0xd5f3d67ee271d40efe9d40a0156048cca5981defcf15bcdb9ee7d256f2c01007. +// +// Solidity: event KreditsMinted(address indexed recipient, uint256 amount) +func (_Token *TokenFilterer) ParseKreditsMinted(log types.Log) (*TokenKreditsMinted, error) { + event := new(TokenKreditsMinted) + if err := _Token.contract.UnpackLog(event, "KreditsMinted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Token contract. +type TokenTransferIterator struct { + Event *TokenTransfer // 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 *TokenTransferIterator) 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(TokenTransfer) + 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(TokenTransfer) + 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 *TokenTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenTransfer represents a Transfer event raised by the Token contract. +type TokenTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_Token *TokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Token.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &TokenTransferIterator{contract: _Token.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_Token *TokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *TokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Token.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + 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(TokenTransfer) + if err := _Token.contract.UnpackLog(event, "Transfer", 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 +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_Token *TokenFilterer) ParseTransfer(log types.Log) (*TokenTransfer, error) { + event := new(TokenTransfer) + if err := _Token.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} +