github.com/codingfuture/orig-energi3@v0.8.4/energi/abi/ITreasury.go (about) 1 // Code generated - DO NOT EDIT. 2 // This file is a generated binding and any manual changes will be lost. 3 4 package abi 5 6 import ( 7 "math/big" 8 "strings" 9 10 ethereum "github.com/ethereum/go-ethereum" 11 "github.com/ethereum/go-ethereum/accounts/abi" 12 "github.com/ethereum/go-ethereum/accounts/abi/bind" 13 "github.com/ethereum/go-ethereum/common" 14 "github.com/ethereum/go-ethereum/core/types" 15 "github.com/ethereum/go-ethereum/event" 16 ) 17 18 // Reference imports to suppress errors if they are not otherwise used. 19 var ( 20 _ = big.NewInt 21 _ = strings.NewReader 22 _ = ethereum.NotFound 23 _ = abi.U256 24 _ = bind.Bind 25 _ = common.Big1 26 _ = types.BloomLookup 27 _ = event.NewSubscription 28 ) 29 30 // ITreasuryABI is the input ABI used to generate the binding from. 31 const ITreasuryABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ref_uuid\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"contractIBudgetProposal\",\"name\":\"proposal\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"payout_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"BudgetProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ref_uuid\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"contractIBudgetProposal\",\"name\":\"proposal\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Payout\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"contribute\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"isSuperblock\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"listProposals\",\"outputs\":[{\"internalType\":\"contractIBudgetProposal[]\",\"name\":\"proposals\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"contractIBudgetProposal\",\"name\":\"proposal\",\"type\":\"address\"}],\"name\":\"proposal_uuid\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ref_uuid\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_period\",\"type\":\"uint256\"}],\"name\":\"propose\",\"outputs\":[{\"internalType\":\"contractIBudgetProposal\",\"name\":\"proposal\",\"type\":\"address\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ref_uuid\",\"type\":\"uint256\"}],\"name\":\"uuid_proposal\",\"outputs\":[{\"internalType\":\"contractIBudgetProposal\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" 32 33 // ITreasury is an auto generated Go binding around an Ethereum contract. 34 type ITreasury struct { 35 ITreasuryCaller // Read-only binding to the contract 36 ITreasuryTransactor // Write-only binding to the contract 37 ITreasuryFilterer // Log filterer for contract events 38 } 39 40 // ITreasuryCaller is an auto generated read-only Go binding around an Ethereum contract. 41 type ITreasuryCaller struct { 42 contract *bind.BoundContract // Generic contract wrapper for the low level calls 43 } 44 45 // ITreasuryTransactor is an auto generated write-only Go binding around an Ethereum contract. 46 type ITreasuryTransactor struct { 47 contract *bind.BoundContract // Generic contract wrapper for the low level calls 48 } 49 50 // ITreasuryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 51 type ITreasuryFilterer struct { 52 contract *bind.BoundContract // Generic contract wrapper for the low level calls 53 } 54 55 // ITreasurySession is an auto generated Go binding around an Ethereum contract, 56 // with pre-set call and transact options. 57 type ITreasurySession struct { 58 Contract *ITreasury // Generic contract binding to set the session for 59 CallOpts bind.CallOpts // Call options to use throughout this session 60 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 61 } 62 63 // ITreasuryCallerSession is an auto generated read-only Go binding around an Ethereum contract, 64 // with pre-set call options. 65 type ITreasuryCallerSession struct { 66 Contract *ITreasuryCaller // Generic contract caller binding to set the session for 67 CallOpts bind.CallOpts // Call options to use throughout this session 68 } 69 70 // ITreasuryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 71 // with pre-set transact options. 72 type ITreasuryTransactorSession struct { 73 Contract *ITreasuryTransactor // Generic contract transactor binding to set the session for 74 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 75 } 76 77 // ITreasuryRaw is an auto generated low-level Go binding around an Ethereum contract. 78 type ITreasuryRaw struct { 79 Contract *ITreasury // Generic contract binding to access the raw methods on 80 } 81 82 // ITreasuryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 83 type ITreasuryCallerRaw struct { 84 Contract *ITreasuryCaller // Generic read-only contract binding to access the raw methods on 85 } 86 87 // ITreasuryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 88 type ITreasuryTransactorRaw struct { 89 Contract *ITreasuryTransactor // Generic write-only contract binding to access the raw methods on 90 } 91 92 // NewITreasury creates a new instance of ITreasury, bound to a specific deployed contract. 93 func NewITreasury(address common.Address, backend bind.ContractBackend) (*ITreasury, error) { 94 contract, err := bindITreasury(address, backend, backend, backend) 95 if err != nil { 96 return nil, err 97 } 98 return &ITreasury{ITreasuryCaller: ITreasuryCaller{contract: contract}, ITreasuryTransactor: ITreasuryTransactor{contract: contract}, ITreasuryFilterer: ITreasuryFilterer{contract: contract}}, nil 99 } 100 101 // NewITreasuryCaller creates a new read-only instance of ITreasury, bound to a specific deployed contract. 102 func NewITreasuryCaller(address common.Address, caller bind.ContractCaller) (*ITreasuryCaller, error) { 103 contract, err := bindITreasury(address, caller, nil, nil) 104 if err != nil { 105 return nil, err 106 } 107 return &ITreasuryCaller{contract: contract}, nil 108 } 109 110 // NewITreasuryTransactor creates a new write-only instance of ITreasury, bound to a specific deployed contract. 111 func NewITreasuryTransactor(address common.Address, transactor bind.ContractTransactor) (*ITreasuryTransactor, error) { 112 contract, err := bindITreasury(address, nil, transactor, nil) 113 if err != nil { 114 return nil, err 115 } 116 return &ITreasuryTransactor{contract: contract}, nil 117 } 118 119 // NewITreasuryFilterer creates a new log filterer instance of ITreasury, bound to a specific deployed contract. 120 func NewITreasuryFilterer(address common.Address, filterer bind.ContractFilterer) (*ITreasuryFilterer, error) { 121 contract, err := bindITreasury(address, nil, nil, filterer) 122 if err != nil { 123 return nil, err 124 } 125 return &ITreasuryFilterer{contract: contract}, nil 126 } 127 128 // bindITreasury binds a generic wrapper to an already deployed contract. 129 func bindITreasury(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 130 parsed, err := abi.JSON(strings.NewReader(ITreasuryABI)) 131 if err != nil { 132 return nil, err 133 } 134 return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil 135 } 136 137 // Call invokes the (constant) contract method with params as input values and 138 // sets the output to result. The result type might be a single field for simple 139 // returns, a slice of interfaces for anonymous returns and a struct for named 140 // returns. 141 func (_ITreasury *ITreasuryRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { 142 return _ITreasury.Contract.ITreasuryCaller.contract.Call(opts, result, method, params...) 143 } 144 145 // Transfer initiates a plain transaction to move funds to the contract, calling 146 // its default method if one is available. 147 func (_ITreasury *ITreasuryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 148 return _ITreasury.Contract.ITreasuryTransactor.contract.Transfer(opts) 149 } 150 151 // Transact invokes the (paid) contract method with params as input values. 152 func (_ITreasury *ITreasuryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 153 return _ITreasury.Contract.ITreasuryTransactor.contract.Transact(opts, method, params...) 154 } 155 156 // Call invokes the (constant) contract method with params as input values and 157 // sets the output to result. The result type might be a single field for simple 158 // returns, a slice of interfaces for anonymous returns and a struct for named 159 // returns. 160 func (_ITreasury *ITreasuryCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { 161 return _ITreasury.Contract.contract.Call(opts, result, method, params...) 162 } 163 164 // Transfer initiates a plain transaction to move funds to the contract, calling 165 // its default method if one is available. 166 func (_ITreasury *ITreasuryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 167 return _ITreasury.Contract.contract.Transfer(opts) 168 } 169 170 // Transact invokes the (paid) contract method with params as input values. 171 func (_ITreasury *ITreasuryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 172 return _ITreasury.Contract.contract.Transact(opts, method, params...) 173 } 174 175 // Balance is a free data retrieval call binding the contract method 0xb69ef8a8. 176 // 177 // Solidity: function balance() constant returns(uint256 amount) 178 func (_ITreasury *ITreasuryCaller) Balance(opts *bind.CallOpts) (*big.Int, error) { 179 var ( 180 ret0 = new(*big.Int) 181 ) 182 out := ret0 183 err := _ITreasury.contract.Call(opts, out, "balance") 184 return *ret0, err 185 } 186 187 // Balance is a free data retrieval call binding the contract method 0xb69ef8a8. 188 // 189 // Solidity: function balance() constant returns(uint256 amount) 190 func (_ITreasury *ITreasurySession) Balance() (*big.Int, error) { 191 return _ITreasury.Contract.Balance(&_ITreasury.CallOpts) 192 } 193 194 // Balance is a free data retrieval call binding the contract method 0xb69ef8a8. 195 // 196 // Solidity: function balance() constant returns(uint256 amount) 197 func (_ITreasury *ITreasuryCallerSession) Balance() (*big.Int, error) { 198 return _ITreasury.Contract.Balance(&_ITreasury.CallOpts) 199 } 200 201 // IsSuperblock is a free data retrieval call binding the contract method 0x52782d86. 202 // 203 // Solidity: function isSuperblock(uint256 _blockNumber) constant returns(bool) 204 func (_ITreasury *ITreasuryCaller) IsSuperblock(opts *bind.CallOpts, _blockNumber *big.Int) (bool, error) { 205 var ( 206 ret0 = new(bool) 207 ) 208 out := ret0 209 err := _ITreasury.contract.Call(opts, out, "isSuperblock", _blockNumber) 210 return *ret0, err 211 } 212 213 // IsSuperblock is a free data retrieval call binding the contract method 0x52782d86. 214 // 215 // Solidity: function isSuperblock(uint256 _blockNumber) constant returns(bool) 216 func (_ITreasury *ITreasurySession) IsSuperblock(_blockNumber *big.Int) (bool, error) { 217 return _ITreasury.Contract.IsSuperblock(&_ITreasury.CallOpts, _blockNumber) 218 } 219 220 // IsSuperblock is a free data retrieval call binding the contract method 0x52782d86. 221 // 222 // Solidity: function isSuperblock(uint256 _blockNumber) constant returns(bool) 223 func (_ITreasury *ITreasuryCallerSession) IsSuperblock(_blockNumber *big.Int) (bool, error) { 224 return _ITreasury.Contract.IsSuperblock(&_ITreasury.CallOpts, _blockNumber) 225 } 226 227 // ListProposals is a free data retrieval call binding the contract method 0x26c7eb1c. 228 // 229 // Solidity: function listProposals() constant returns(address[] proposals) 230 func (_ITreasury *ITreasuryCaller) ListProposals(opts *bind.CallOpts) ([]common.Address, error) { 231 var ( 232 ret0 = new([]common.Address) 233 ) 234 out := ret0 235 err := _ITreasury.contract.Call(opts, out, "listProposals") 236 return *ret0, err 237 } 238 239 // ListProposals is a free data retrieval call binding the contract method 0x26c7eb1c. 240 // 241 // Solidity: function listProposals() constant returns(address[] proposals) 242 func (_ITreasury *ITreasurySession) ListProposals() ([]common.Address, error) { 243 return _ITreasury.Contract.ListProposals(&_ITreasury.CallOpts) 244 } 245 246 // ListProposals is a free data retrieval call binding the contract method 0x26c7eb1c. 247 // 248 // Solidity: function listProposals() constant returns(address[] proposals) 249 func (_ITreasury *ITreasuryCallerSession) ListProposals() ([]common.Address, error) { 250 return _ITreasury.Contract.ListProposals(&_ITreasury.CallOpts) 251 } 252 253 // ProposalUuid is a free data retrieval call binding the contract method 0xcaef1d5a. 254 // 255 // Solidity: function proposal_uuid(address proposal) constant returns(uint256) 256 func (_ITreasury *ITreasuryCaller) ProposalUuid(opts *bind.CallOpts, proposal common.Address) (*big.Int, error) { 257 var ( 258 ret0 = new(*big.Int) 259 ) 260 out := ret0 261 err := _ITreasury.contract.Call(opts, out, "proposal_uuid", proposal) 262 return *ret0, err 263 } 264 265 // ProposalUuid is a free data retrieval call binding the contract method 0xcaef1d5a. 266 // 267 // Solidity: function proposal_uuid(address proposal) constant returns(uint256) 268 func (_ITreasury *ITreasurySession) ProposalUuid(proposal common.Address) (*big.Int, error) { 269 return _ITreasury.Contract.ProposalUuid(&_ITreasury.CallOpts, proposal) 270 } 271 272 // ProposalUuid is a free data retrieval call binding the contract method 0xcaef1d5a. 273 // 274 // Solidity: function proposal_uuid(address proposal) constant returns(uint256) 275 func (_ITreasury *ITreasuryCallerSession) ProposalUuid(proposal common.Address) (*big.Int, error) { 276 return _ITreasury.Contract.ProposalUuid(&_ITreasury.CallOpts, proposal) 277 } 278 279 // UuidProposal is a free data retrieval call binding the contract method 0x5c099215. 280 // 281 // Solidity: function uuid_proposal(uint256 _ref_uuid) constant returns(address) 282 func (_ITreasury *ITreasuryCaller) UuidProposal(opts *bind.CallOpts, _ref_uuid *big.Int) (common.Address, error) { 283 var ( 284 ret0 = new(common.Address) 285 ) 286 out := ret0 287 err := _ITreasury.contract.Call(opts, out, "uuid_proposal", _ref_uuid) 288 return *ret0, err 289 } 290 291 // UuidProposal is a free data retrieval call binding the contract method 0x5c099215. 292 // 293 // Solidity: function uuid_proposal(uint256 _ref_uuid) constant returns(address) 294 func (_ITreasury *ITreasurySession) UuidProposal(_ref_uuid *big.Int) (common.Address, error) { 295 return _ITreasury.Contract.UuidProposal(&_ITreasury.CallOpts, _ref_uuid) 296 } 297 298 // UuidProposal is a free data retrieval call binding the contract method 0x5c099215. 299 // 300 // Solidity: function uuid_proposal(uint256 _ref_uuid) constant returns(address) 301 func (_ITreasury *ITreasuryCallerSession) UuidProposal(_ref_uuid *big.Int) (common.Address, error) { 302 return _ITreasury.Contract.UuidProposal(&_ITreasury.CallOpts, _ref_uuid) 303 } 304 305 // Contribute is a paid mutator transaction binding the contract method 0xd7bb99ba. 306 // 307 // Solidity: function contribute() returns() 308 func (_ITreasury *ITreasuryTransactor) Contribute(opts *bind.TransactOpts) (*types.Transaction, error) { 309 return _ITreasury.contract.Transact(opts, "contribute") 310 } 311 312 // Contribute is a paid mutator transaction binding the contract method 0xd7bb99ba. 313 // 314 // Solidity: function contribute() returns() 315 func (_ITreasury *ITreasurySession) Contribute() (*types.Transaction, error) { 316 return _ITreasury.Contract.Contribute(&_ITreasury.TransactOpts) 317 } 318 319 // Contribute is a paid mutator transaction binding the contract method 0xd7bb99ba. 320 // 321 // Solidity: function contribute() returns() 322 func (_ITreasury *ITreasuryTransactorSession) Contribute() (*types.Transaction, error) { 323 return _ITreasury.Contract.Contribute(&_ITreasury.TransactOpts) 324 } 325 326 // Propose is a paid mutator transaction binding the contract method 0x40376d56. 327 // 328 // Solidity: function propose(uint256 _amount, uint256 _ref_uuid, uint256 _period) returns(address proposal) 329 func (_ITreasury *ITreasuryTransactor) Propose(opts *bind.TransactOpts, _amount *big.Int, _ref_uuid *big.Int, _period *big.Int) (*types.Transaction, error) { 330 return _ITreasury.contract.Transact(opts, "propose", _amount, _ref_uuid, _period) 331 } 332 333 // Propose is a paid mutator transaction binding the contract method 0x40376d56. 334 // 335 // Solidity: function propose(uint256 _amount, uint256 _ref_uuid, uint256 _period) returns(address proposal) 336 func (_ITreasury *ITreasurySession) Propose(_amount *big.Int, _ref_uuid *big.Int, _period *big.Int) (*types.Transaction, error) { 337 return _ITreasury.Contract.Propose(&_ITreasury.TransactOpts, _amount, _ref_uuid, _period) 338 } 339 340 // Propose is a paid mutator transaction binding the contract method 0x40376d56. 341 // 342 // Solidity: function propose(uint256 _amount, uint256 _ref_uuid, uint256 _period) returns(address proposal) 343 func (_ITreasury *ITreasuryTransactorSession) Propose(_amount *big.Int, _ref_uuid *big.Int, _period *big.Int) (*types.Transaction, error) { 344 return _ITreasury.Contract.Propose(&_ITreasury.TransactOpts, _amount, _ref_uuid, _period) 345 } 346 347 // ITreasuryBudgetProposalIterator is returned from FilterBudgetProposal and is used to iterate over the raw logs and unpacked data for BudgetProposal events raised by the ITreasury contract. 348 type ITreasuryBudgetProposalIterator struct { 349 Event *ITreasuryBudgetProposal // Event containing the contract specifics and raw log 350 351 contract *bind.BoundContract // Generic contract to use for unpacking event data 352 event string // Event name to use for unpacking event data 353 354 logs chan types.Log // Log channel receiving the found contract events 355 sub ethereum.Subscription // Subscription for errors, completion and termination 356 done bool // Whether the subscription completed delivering logs 357 fail error // Occurred error to stop iteration 358 } 359 360 // Next advances the iterator to the subsequent event, returning whether there 361 // are any more events found. In case of a retrieval or parsing error, false is 362 // returned and Error() can be queried for the exact failure. 363 func (it *ITreasuryBudgetProposalIterator) Next() bool { 364 // If the iterator failed, stop iterating 365 if it.fail != nil { 366 return false 367 } 368 // If the iterator completed, deliver directly whatever's available 369 if it.done { 370 select { 371 case log := <-it.logs: 372 it.Event = new(ITreasuryBudgetProposal) 373 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 374 it.fail = err 375 return false 376 } 377 it.Event.Raw = log 378 return true 379 380 default: 381 return false 382 } 383 } 384 // Iterator still in progress, wait for either a data or an error event 385 select { 386 case log := <-it.logs: 387 it.Event = new(ITreasuryBudgetProposal) 388 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 389 it.fail = err 390 return false 391 } 392 it.Event.Raw = log 393 return true 394 395 case err := <-it.sub.Err(): 396 it.done = true 397 it.fail = err 398 return it.Next() 399 } 400 } 401 402 // Error returns any retrieval or parsing error occurred during filtering. 403 func (it *ITreasuryBudgetProposalIterator) Error() error { 404 return it.fail 405 } 406 407 // Close terminates the iteration process, releasing any pending underlying 408 // resources. 409 func (it *ITreasuryBudgetProposalIterator) Close() error { 410 it.sub.Unsubscribe() 411 return nil 412 } 413 414 // ITreasuryBudgetProposal represents a BudgetProposal event raised by the ITreasury contract. 415 type ITreasuryBudgetProposal struct { 416 RefUuid *big.Int 417 Proposal common.Address 418 PayoutAddress common.Address 419 Amount *big.Int 420 Deadline *big.Int 421 Raw types.Log // Blockchain specific contextual infos 422 } 423 424 // FilterBudgetProposal is a free log retrieval operation binding the contract event 0xa94befa3ce181974130fe36e854a282c70fb75e4decb42bfecdecbd6f88f0f5d. 425 // 426 // Solidity: event BudgetProposal(uint256 indexed ref_uuid, address proposal, address payout_address, uint256 amount, uint256 deadline) 427 func (_ITreasury *ITreasuryFilterer) FilterBudgetProposal(opts *bind.FilterOpts, ref_uuid []*big.Int) (*ITreasuryBudgetProposalIterator, error) { 428 429 var ref_uuidRule []interface{} 430 for _, ref_uuidItem := range ref_uuid { 431 ref_uuidRule = append(ref_uuidRule, ref_uuidItem) 432 } 433 434 logs, sub, err := _ITreasury.contract.FilterLogs(opts, "BudgetProposal", ref_uuidRule) 435 if err != nil { 436 return nil, err 437 } 438 return &ITreasuryBudgetProposalIterator{contract: _ITreasury.contract, event: "BudgetProposal", logs: logs, sub: sub}, nil 439 } 440 441 // WatchBudgetProposal is a free log subscription operation binding the contract event 0xa94befa3ce181974130fe36e854a282c70fb75e4decb42bfecdecbd6f88f0f5d. 442 // 443 // Solidity: event BudgetProposal(uint256 indexed ref_uuid, address proposal, address payout_address, uint256 amount, uint256 deadline) 444 func (_ITreasury *ITreasuryFilterer) WatchBudgetProposal(opts *bind.WatchOpts, sink chan<- *ITreasuryBudgetProposal, ref_uuid []*big.Int) (event.Subscription, error) { 445 446 var ref_uuidRule []interface{} 447 for _, ref_uuidItem := range ref_uuid { 448 ref_uuidRule = append(ref_uuidRule, ref_uuidItem) 449 } 450 451 logs, sub, err := _ITreasury.contract.WatchLogs(opts, "BudgetProposal", ref_uuidRule) 452 if err != nil { 453 return nil, err 454 } 455 return event.NewSubscription(func(quit <-chan struct{}) error { 456 defer sub.Unsubscribe() 457 for { 458 select { 459 case log := <-logs: 460 // New log arrived, parse the event and forward to the user 461 event := new(ITreasuryBudgetProposal) 462 if err := _ITreasury.contract.UnpackLog(event, "BudgetProposal", log); err != nil { 463 return err 464 } 465 event.Raw = log 466 467 select { 468 case sink <- event: 469 case err := <-sub.Err(): 470 return err 471 case <-quit: 472 return nil 473 } 474 case err := <-sub.Err(): 475 return err 476 case <-quit: 477 return nil 478 } 479 } 480 }), nil 481 } 482 483 // ITreasuryContributionIterator is returned from FilterContribution and is used to iterate over the raw logs and unpacked data for Contribution events raised by the ITreasury contract. 484 type ITreasuryContributionIterator struct { 485 Event *ITreasuryContribution // Event containing the contract specifics and raw log 486 487 contract *bind.BoundContract // Generic contract to use for unpacking event data 488 event string // Event name to use for unpacking event data 489 490 logs chan types.Log // Log channel receiving the found contract events 491 sub ethereum.Subscription // Subscription for errors, completion and termination 492 done bool // Whether the subscription completed delivering logs 493 fail error // Occurred error to stop iteration 494 } 495 496 // Next advances the iterator to the subsequent event, returning whether there 497 // are any more events found. In case of a retrieval or parsing error, false is 498 // returned and Error() can be queried for the exact failure. 499 func (it *ITreasuryContributionIterator) Next() bool { 500 // If the iterator failed, stop iterating 501 if it.fail != nil { 502 return false 503 } 504 // If the iterator completed, deliver directly whatever's available 505 if it.done { 506 select { 507 case log := <-it.logs: 508 it.Event = new(ITreasuryContribution) 509 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 510 it.fail = err 511 return false 512 } 513 it.Event.Raw = log 514 return true 515 516 default: 517 return false 518 } 519 } 520 // Iterator still in progress, wait for either a data or an error event 521 select { 522 case log := <-it.logs: 523 it.Event = new(ITreasuryContribution) 524 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 525 it.fail = err 526 return false 527 } 528 it.Event.Raw = log 529 return true 530 531 case err := <-it.sub.Err(): 532 it.done = true 533 it.fail = err 534 return it.Next() 535 } 536 } 537 538 // Error returns any retrieval or parsing error occurred during filtering. 539 func (it *ITreasuryContributionIterator) Error() error { 540 return it.fail 541 } 542 543 // Close terminates the iteration process, releasing any pending underlying 544 // resources. 545 func (it *ITreasuryContributionIterator) Close() error { 546 it.sub.Unsubscribe() 547 return nil 548 } 549 550 // ITreasuryContribution represents a Contribution event raised by the ITreasury contract. 551 type ITreasuryContribution struct { 552 From common.Address 553 Amount *big.Int 554 Raw types.Log // Blockchain specific contextual infos 555 } 556 557 // FilterContribution is a free log retrieval operation binding the contract event 0x4d154d4aae216bed6d0926db77c00df2b57c6b5ba4eee05775de20facede3a7b. 558 // 559 // Solidity: event Contribution(address from, uint256 amount) 560 func (_ITreasury *ITreasuryFilterer) FilterContribution(opts *bind.FilterOpts) (*ITreasuryContributionIterator, error) { 561 562 logs, sub, err := _ITreasury.contract.FilterLogs(opts, "Contribution") 563 if err != nil { 564 return nil, err 565 } 566 return &ITreasuryContributionIterator{contract: _ITreasury.contract, event: "Contribution", logs: logs, sub: sub}, nil 567 } 568 569 // WatchContribution is a free log subscription operation binding the contract event 0x4d154d4aae216bed6d0926db77c00df2b57c6b5ba4eee05775de20facede3a7b. 570 // 571 // Solidity: event Contribution(address from, uint256 amount) 572 func (_ITreasury *ITreasuryFilterer) WatchContribution(opts *bind.WatchOpts, sink chan<- *ITreasuryContribution) (event.Subscription, error) { 573 574 logs, sub, err := _ITreasury.contract.WatchLogs(opts, "Contribution") 575 if err != nil { 576 return nil, err 577 } 578 return event.NewSubscription(func(quit <-chan struct{}) error { 579 defer sub.Unsubscribe() 580 for { 581 select { 582 case log := <-logs: 583 // New log arrived, parse the event and forward to the user 584 event := new(ITreasuryContribution) 585 if err := _ITreasury.contract.UnpackLog(event, "Contribution", log); err != nil { 586 return err 587 } 588 event.Raw = log 589 590 select { 591 case sink <- event: 592 case err := <-sub.Err(): 593 return err 594 case <-quit: 595 return nil 596 } 597 case err := <-sub.Err(): 598 return err 599 case <-quit: 600 return nil 601 } 602 } 603 }), nil 604 } 605 606 // ITreasuryPayoutIterator is returned from FilterPayout and is used to iterate over the raw logs and unpacked data for Payout events raised by the ITreasury contract. 607 type ITreasuryPayoutIterator struct { 608 Event *ITreasuryPayout // Event containing the contract specifics and raw log 609 610 contract *bind.BoundContract // Generic contract to use for unpacking event data 611 event string // Event name to use for unpacking event data 612 613 logs chan types.Log // Log channel receiving the found contract events 614 sub ethereum.Subscription // Subscription for errors, completion and termination 615 done bool // Whether the subscription completed delivering logs 616 fail error // Occurred error to stop iteration 617 } 618 619 // Next advances the iterator to the subsequent event, returning whether there 620 // are any more events found. In case of a retrieval or parsing error, false is 621 // returned and Error() can be queried for the exact failure. 622 func (it *ITreasuryPayoutIterator) Next() bool { 623 // If the iterator failed, stop iterating 624 if it.fail != nil { 625 return false 626 } 627 // If the iterator completed, deliver directly whatever's available 628 if it.done { 629 select { 630 case log := <-it.logs: 631 it.Event = new(ITreasuryPayout) 632 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 633 it.fail = err 634 return false 635 } 636 it.Event.Raw = log 637 return true 638 639 default: 640 return false 641 } 642 } 643 // Iterator still in progress, wait for either a data or an error event 644 select { 645 case log := <-it.logs: 646 it.Event = new(ITreasuryPayout) 647 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 648 it.fail = err 649 return false 650 } 651 it.Event.Raw = log 652 return true 653 654 case err := <-it.sub.Err(): 655 it.done = true 656 it.fail = err 657 return it.Next() 658 } 659 } 660 661 // Error returns any retrieval or parsing error occurred during filtering. 662 func (it *ITreasuryPayoutIterator) Error() error { 663 return it.fail 664 } 665 666 // Close terminates the iteration process, releasing any pending underlying 667 // resources. 668 func (it *ITreasuryPayoutIterator) Close() error { 669 it.sub.Unsubscribe() 670 return nil 671 } 672 673 // ITreasuryPayout represents a Payout event raised by the ITreasury contract. 674 type ITreasuryPayout struct { 675 RefUuid *big.Int 676 Proposal common.Address 677 Amount *big.Int 678 Raw types.Log // Blockchain specific contextual infos 679 } 680 681 // FilterPayout is a free log retrieval operation binding the contract event 0x5f7341a552ae2d452b071917104c05fbac3663936a69be768a05c40605056e7d. 682 // 683 // Solidity: event Payout(uint256 indexed ref_uuid, address proposal, uint256 amount) 684 func (_ITreasury *ITreasuryFilterer) FilterPayout(opts *bind.FilterOpts, ref_uuid []*big.Int) (*ITreasuryPayoutIterator, error) { 685 686 var ref_uuidRule []interface{} 687 for _, ref_uuidItem := range ref_uuid { 688 ref_uuidRule = append(ref_uuidRule, ref_uuidItem) 689 } 690 691 logs, sub, err := _ITreasury.contract.FilterLogs(opts, "Payout", ref_uuidRule) 692 if err != nil { 693 return nil, err 694 } 695 return &ITreasuryPayoutIterator{contract: _ITreasury.contract, event: "Payout", logs: logs, sub: sub}, nil 696 } 697 698 // WatchPayout is a free log subscription operation binding the contract event 0x5f7341a552ae2d452b071917104c05fbac3663936a69be768a05c40605056e7d. 699 // 700 // Solidity: event Payout(uint256 indexed ref_uuid, address proposal, uint256 amount) 701 func (_ITreasury *ITreasuryFilterer) WatchPayout(opts *bind.WatchOpts, sink chan<- *ITreasuryPayout, ref_uuid []*big.Int) (event.Subscription, error) { 702 703 var ref_uuidRule []interface{} 704 for _, ref_uuidItem := range ref_uuid { 705 ref_uuidRule = append(ref_uuidRule, ref_uuidItem) 706 } 707 708 logs, sub, err := _ITreasury.contract.WatchLogs(opts, "Payout", ref_uuidRule) 709 if err != nil { 710 return nil, err 711 } 712 return event.NewSubscription(func(quit <-chan struct{}) error { 713 defer sub.Unsubscribe() 714 for { 715 select { 716 case log := <-logs: 717 // New log arrived, parse the event and forward to the user 718 event := new(ITreasuryPayout) 719 if err := _ITreasury.contract.UnpackLog(event, "Payout", log); err != nil { 720 return err 721 } 722 event.Raw = log 723 724 select { 725 case sink <- event: 726 case err := <-sub.Err(): 727 return err 728 case <-quit: 729 return nil 730 } 731 case err := <-sub.Err(): 732 return err 733 case <-quit: 734 return nil 735 } 736 } 737 }), nil 738 }