github.com/diadata-org/diadata@v1.4.593/pkg/dia/scraper/blockchain-scrapers/blockchains/ethereum/diaDefi100OracleService/diaDefi100OracleService.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 diaDefi100OracleService 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 _ = bind.Bind 24 _ = common.Big1 25 _ = types.BloomLookup 26 _ = event.NewSubscription 27 ) 28 29 // DIADefi100OracleABI is the input ABI used to generate the binding from. 30 const DIADefi100OracleABI = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"value\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"timestamp\",\"type\":\"uint128\"}],\"name\":\"OracleUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newUpdater\",\"type\":\"address\"}],\"name\":\"UpdaterAddressChange\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"}],\"name\":\"getValue\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"internalType\":\"uint128\",\"name\":\"value\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"timestamp\",\"type\":\"uint128\"}],\"name\":\"setValue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOracleUpdaterAddress\",\"type\":\"address\"}],\"name\":\"updateOracleUpdaterAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"values\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" 31 32 // DIADefi100OracleFuncSigs maps the 4-byte function signature to its string representation. 33 var DIADefi100OracleFuncSigs = map[string]string{ 34 "960384a0": "getValue(string)", 35 "7898e0c2": "setValue(string,uint128,uint128)", 36 "6aa45efc": "updateOracleUpdaterAddress(address)", 37 "5a9ade8b": "values(string)", 38 } 39 40 // DIADefi100OracleBin is the compiled bytecode used for deploying new contracts. 41 var DIADefi100OracleBin = "0x608060405234801561001057600080fd5b50600180546001600160a01b0319163317905561054d806100326000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80635a9ade8b146100515780636aa45efc146101095780637898e0c214610131578063960384a0146101ed575b600080fd5b6100f76004803603602081101561006757600080fd5b81019060208101813564010000000081111561008257600080fd5b82018360208201111561009457600080fd5b803590602001918460018302840111640100000000831117156100b657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506102c2945050505050565b60408051918252519081900360200190f35b61012f6004803603602081101561011f57600080fd5b50356001600160a01b03166102df565b005b61012f6004803603606081101561014757600080fd5b81019060208101813564010000000081111561016257600080fd5b82018360208201111561017457600080fd5b8035906020019184600183028401116401000000008311171561019657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550506001600160801b03833581169450602090930135909216915061034a9050565b6102936004803603602081101561020357600080fd5b81019060208101813564010000000081111561021e57600080fd5b82018360208201111561023057600080fd5b8035906020019184600183028401116401000000008311171561025257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061049a945050505050565b60405180836001600160801b03168152602001826001600160801b031681526020019250505060405180910390f35b805160208183018101805160008252928201919093012091525481565b6001546001600160a01b031633146102f657600080fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f121e958a4cadf7f8dadefa22cc019700365240223668418faebed197da07089f9181900360200190a150565b6001546001600160a01b0316331461036157600080fd5b6000816001600160801b03166080846001600160801b0316901b019050806000856040518082805190602001908083835b602083106103b15780518252601f199092019160209182019101610392565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382018520959095556001600160801b03888116858301528716948401949094525050606080825286519082015285517fa7fc99ed7617309ee23f63ae90196a1e490d362e6f6a547a59bc809ee2291782928792879287928291608083019187019080838360005b83811015610458578181015183820152602001610440565b50505050905090810190601f1680156104855780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a150505050565b600080600080846040518082805190602001908083835b602083106104d05780518252601f1990920191602091820191016104b1565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054608081901c976001600160801b03909116965094505050505056fea2646970667358221220fd104dd9519d4ad99fa5aade41a88177ef1d7b78de857ba5c536fd2b936723f464736f6c63430007040033" 42 43 // DeployDIADefi100Oracle deploys a new Ethereum contract, binding an instance of DIADefi100Oracle to it. 44 func DeployDIADefi100Oracle(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *DIADefi100Oracle, error) { 45 parsed, err := abi.JSON(strings.NewReader(DIADefi100OracleABI)) 46 if err != nil { 47 return common.Address{}, nil, nil, err 48 } 49 50 address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(DIADefi100OracleBin), backend) 51 if err != nil { 52 return common.Address{}, nil, nil, err 53 } 54 return address, tx, &DIADefi100Oracle{DIADefi100OracleCaller: DIADefi100OracleCaller{contract: contract}, DIADefi100OracleTransactor: DIADefi100OracleTransactor{contract: contract}, DIADefi100OracleFilterer: DIADefi100OracleFilterer{contract: contract}}, nil 55 } 56 57 // DIADefi100Oracle is an auto generated Go binding around an Ethereum contract. 58 type DIADefi100Oracle struct { 59 DIADefi100OracleCaller // Read-only binding to the contract 60 DIADefi100OracleTransactor // Write-only binding to the contract 61 DIADefi100OracleFilterer // Log filterer for contract events 62 } 63 64 // DIADefi100OracleCaller is an auto generated read-only Go binding around an Ethereum contract. 65 type DIADefi100OracleCaller struct { 66 contract *bind.BoundContract // Generic contract wrapper for the low level calls 67 } 68 69 // DIADefi100OracleTransactor is an auto generated write-only Go binding around an Ethereum contract. 70 type DIADefi100OracleTransactor struct { 71 contract *bind.BoundContract // Generic contract wrapper for the low level calls 72 } 73 74 // DIADefi100OracleFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 75 type DIADefi100OracleFilterer struct { 76 contract *bind.BoundContract // Generic contract wrapper for the low level calls 77 } 78 79 // DIADefi100OracleSession is an auto generated Go binding around an Ethereum contract, 80 // with pre-set call and transact options. 81 type DIADefi100OracleSession struct { 82 Contract *DIADefi100Oracle // Generic contract binding to set the session for 83 CallOpts bind.CallOpts // Call options to use throughout this session 84 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 85 } 86 87 // DIADefi100OracleCallerSession is an auto generated read-only Go binding around an Ethereum contract, 88 // with pre-set call options. 89 type DIADefi100OracleCallerSession struct { 90 Contract *DIADefi100OracleCaller // Generic contract caller binding to set the session for 91 CallOpts bind.CallOpts // Call options to use throughout this session 92 } 93 94 // DIADefi100OracleTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 95 // with pre-set transact options. 96 type DIADefi100OracleTransactorSession struct { 97 Contract *DIADefi100OracleTransactor // Generic contract transactor binding to set the session for 98 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 99 } 100 101 // DIADefi100OracleRaw is an auto generated low-level Go binding around an Ethereum contract. 102 type DIADefi100OracleRaw struct { 103 Contract *DIADefi100Oracle // Generic contract binding to access the raw methods on 104 } 105 106 // DIADefi100OracleCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 107 type DIADefi100OracleCallerRaw struct { 108 Contract *DIADefi100OracleCaller // Generic read-only contract binding to access the raw methods on 109 } 110 111 // DIADefi100OracleTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 112 type DIADefi100OracleTransactorRaw struct { 113 Contract *DIADefi100OracleTransactor // Generic write-only contract binding to access the raw methods on 114 } 115 116 // NewDIADefi100Oracle creates a new instance of DIADefi100Oracle, bound to a specific deployed contract. 117 func NewDIADefi100Oracle(address common.Address, backend bind.ContractBackend) (*DIADefi100Oracle, error) { 118 contract, err := bindDIADefi100Oracle(address, backend, backend, backend) 119 if err != nil { 120 return nil, err 121 } 122 return &DIADefi100Oracle{DIADefi100OracleCaller: DIADefi100OracleCaller{contract: contract}, DIADefi100OracleTransactor: DIADefi100OracleTransactor{contract: contract}, DIADefi100OracleFilterer: DIADefi100OracleFilterer{contract: contract}}, nil 123 } 124 125 // NewDIADefi100OracleCaller creates a new read-only instance of DIADefi100Oracle, bound to a specific deployed contract. 126 func NewDIADefi100OracleCaller(address common.Address, caller bind.ContractCaller) (*DIADefi100OracleCaller, error) { 127 contract, err := bindDIADefi100Oracle(address, caller, nil, nil) 128 if err != nil { 129 return nil, err 130 } 131 return &DIADefi100OracleCaller{contract: contract}, nil 132 } 133 134 // NewDIADefi100OracleTransactor creates a new write-only instance of DIADefi100Oracle, bound to a specific deployed contract. 135 func NewDIADefi100OracleTransactor(address common.Address, transactor bind.ContractTransactor) (*DIADefi100OracleTransactor, error) { 136 contract, err := bindDIADefi100Oracle(address, nil, transactor, nil) 137 if err != nil { 138 return nil, err 139 } 140 return &DIADefi100OracleTransactor{contract: contract}, nil 141 } 142 143 // NewDIADefi100OracleFilterer creates a new log filterer instance of DIADefi100Oracle, bound to a specific deployed contract. 144 func NewDIADefi100OracleFilterer(address common.Address, filterer bind.ContractFilterer) (*DIADefi100OracleFilterer, error) { 145 contract, err := bindDIADefi100Oracle(address, nil, nil, filterer) 146 if err != nil { 147 return nil, err 148 } 149 return &DIADefi100OracleFilterer{contract: contract}, nil 150 } 151 152 // bindDIADefi100Oracle binds a generic wrapper to an already deployed contract. 153 func bindDIADefi100Oracle(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 154 parsed, err := abi.JSON(strings.NewReader(DIADefi100OracleABI)) 155 if err != nil { 156 return nil, err 157 } 158 return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil 159 } 160 161 // Call invokes the (constant) contract method with params as input values and 162 // sets the output to result. The result type might be a single field for simple 163 // returns, a slice of interfaces for anonymous returns and a struct for named 164 // returns. 165 func (_DIADefi100Oracle *DIADefi100OracleRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 166 return _DIADefi100Oracle.Contract.DIADefi100OracleCaller.contract.Call(opts, result, method, params...) 167 } 168 169 // Transfer initiates a plain transaction to move funds to the contract, calling 170 // its default method if one is available. 171 func (_DIADefi100Oracle *DIADefi100OracleRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 172 return _DIADefi100Oracle.Contract.DIADefi100OracleTransactor.contract.Transfer(opts) 173 } 174 175 // Transact invokes the (paid) contract method with params as input values. 176 func (_DIADefi100Oracle *DIADefi100OracleRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 177 return _DIADefi100Oracle.Contract.DIADefi100OracleTransactor.contract.Transact(opts, method, params...) 178 } 179 180 // Call invokes the (constant) contract method with params as input values and 181 // sets the output to result. The result type might be a single field for simple 182 // returns, a slice of interfaces for anonymous returns and a struct for named 183 // returns. 184 func (_DIADefi100Oracle *DIADefi100OracleCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 185 return _DIADefi100Oracle.Contract.contract.Call(opts, result, method, params...) 186 } 187 188 // Transfer initiates a plain transaction to move funds to the contract, calling 189 // its default method if one is available. 190 func (_DIADefi100Oracle *DIADefi100OracleTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 191 return _DIADefi100Oracle.Contract.contract.Transfer(opts) 192 } 193 194 // Transact invokes the (paid) contract method with params as input values. 195 func (_DIADefi100Oracle *DIADefi100OracleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 196 return _DIADefi100Oracle.Contract.contract.Transact(opts, method, params...) 197 } 198 199 // GetValue is a free data retrieval call binding the contract method 0x960384a0. 200 // 201 // Solidity: function getValue(string key) view returns(uint128, uint128) 202 func (_DIADefi100Oracle *DIADefi100OracleCaller) GetValue(opts *bind.CallOpts, key string) (*big.Int, *big.Int, error) { 203 var out []interface{} 204 err := _DIADefi100Oracle.contract.Call(opts, &out, "getValue", key) 205 206 if err != nil { 207 return *new(*big.Int), *new(*big.Int), err 208 } 209 210 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 211 out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) 212 213 return out0, out1, err 214 215 } 216 217 // GetValue is a free data retrieval call binding the contract method 0x960384a0. 218 // 219 // Solidity: function getValue(string key) view returns(uint128, uint128) 220 func (_DIADefi100Oracle *DIADefi100OracleSession) GetValue(key string) (*big.Int, *big.Int, error) { 221 return _DIADefi100Oracle.Contract.GetValue(&_DIADefi100Oracle.CallOpts, key) 222 } 223 224 // GetValue is a free data retrieval call binding the contract method 0x960384a0. 225 // 226 // Solidity: function getValue(string key) view returns(uint128, uint128) 227 func (_DIADefi100Oracle *DIADefi100OracleCallerSession) GetValue(key string) (*big.Int, *big.Int, error) { 228 return _DIADefi100Oracle.Contract.GetValue(&_DIADefi100Oracle.CallOpts, key) 229 } 230 231 // Values is a free data retrieval call binding the contract method 0x5a9ade8b. 232 // 233 // Solidity: function values(string ) view returns(uint256) 234 func (_DIADefi100Oracle *DIADefi100OracleCaller) Values(opts *bind.CallOpts, arg0 string) (*big.Int, error) { 235 var out []interface{} 236 err := _DIADefi100Oracle.contract.Call(opts, &out, "values", arg0) 237 238 if err != nil { 239 return *new(*big.Int), err 240 } 241 242 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 243 244 return out0, err 245 246 } 247 248 // Values is a free data retrieval call binding the contract method 0x5a9ade8b. 249 // 250 // Solidity: function values(string ) view returns(uint256) 251 func (_DIADefi100Oracle *DIADefi100OracleSession) Values(arg0 string) (*big.Int, error) { 252 return _DIADefi100Oracle.Contract.Values(&_DIADefi100Oracle.CallOpts, arg0) 253 } 254 255 // Values is a free data retrieval call binding the contract method 0x5a9ade8b. 256 // 257 // Solidity: function values(string ) view returns(uint256) 258 func (_DIADefi100Oracle *DIADefi100OracleCallerSession) Values(arg0 string) (*big.Int, error) { 259 return _DIADefi100Oracle.Contract.Values(&_DIADefi100Oracle.CallOpts, arg0) 260 } 261 262 // SetValue is a paid mutator transaction binding the contract method 0x7898e0c2. 263 // 264 // Solidity: function setValue(string key, uint128 value, uint128 timestamp) returns() 265 func (_DIADefi100Oracle *DIADefi100OracleTransactor) SetValue(opts *bind.TransactOpts, key string, value *big.Int, timestamp *big.Int) (*types.Transaction, error) { 266 return _DIADefi100Oracle.contract.Transact(opts, "setValue", key, value, timestamp) 267 } 268 269 // SetValue is a paid mutator transaction binding the contract method 0x7898e0c2. 270 // 271 // Solidity: function setValue(string key, uint128 value, uint128 timestamp) returns() 272 func (_DIADefi100Oracle *DIADefi100OracleSession) SetValue(key string, value *big.Int, timestamp *big.Int) (*types.Transaction, error) { 273 return _DIADefi100Oracle.Contract.SetValue(&_DIADefi100Oracle.TransactOpts, key, value, timestamp) 274 } 275 276 // SetValue is a paid mutator transaction binding the contract method 0x7898e0c2. 277 // 278 // Solidity: function setValue(string key, uint128 value, uint128 timestamp) returns() 279 func (_DIADefi100Oracle *DIADefi100OracleTransactorSession) SetValue(key string, value *big.Int, timestamp *big.Int) (*types.Transaction, error) { 280 return _DIADefi100Oracle.Contract.SetValue(&_DIADefi100Oracle.TransactOpts, key, value, timestamp) 281 } 282 283 // UpdateOracleUpdaterAddress is a paid mutator transaction binding the contract method 0x6aa45efc. 284 // 285 // Solidity: function updateOracleUpdaterAddress(address newOracleUpdaterAddress) returns() 286 func (_DIADefi100Oracle *DIADefi100OracleTransactor) UpdateOracleUpdaterAddress(opts *bind.TransactOpts, newOracleUpdaterAddress common.Address) (*types.Transaction, error) { 287 return _DIADefi100Oracle.contract.Transact(opts, "updateOracleUpdaterAddress", newOracleUpdaterAddress) 288 } 289 290 // UpdateOracleUpdaterAddress is a paid mutator transaction binding the contract method 0x6aa45efc. 291 // 292 // Solidity: function updateOracleUpdaterAddress(address newOracleUpdaterAddress) returns() 293 func (_DIADefi100Oracle *DIADefi100OracleSession) UpdateOracleUpdaterAddress(newOracleUpdaterAddress common.Address) (*types.Transaction, error) { 294 return _DIADefi100Oracle.Contract.UpdateOracleUpdaterAddress(&_DIADefi100Oracle.TransactOpts, newOracleUpdaterAddress) 295 } 296 297 // UpdateOracleUpdaterAddress is a paid mutator transaction binding the contract method 0x6aa45efc. 298 // 299 // Solidity: function updateOracleUpdaterAddress(address newOracleUpdaterAddress) returns() 300 func (_DIADefi100Oracle *DIADefi100OracleTransactorSession) UpdateOracleUpdaterAddress(newOracleUpdaterAddress common.Address) (*types.Transaction, error) { 301 return _DIADefi100Oracle.Contract.UpdateOracleUpdaterAddress(&_DIADefi100Oracle.TransactOpts, newOracleUpdaterAddress) 302 } 303 304 // DIADefi100OracleOracleUpdateIterator is returned from FilterOracleUpdate and is used to iterate over the raw logs and unpacked data for OracleUpdate events raised by the DIADefi100Oracle contract. 305 type DIADefi100OracleOracleUpdateIterator struct { 306 Event *DIADefi100OracleOracleUpdate // Event containing the contract specifics and raw log 307 308 contract *bind.BoundContract // Generic contract to use for unpacking event data 309 event string // Event name to use for unpacking event data 310 311 logs chan types.Log // Log channel receiving the found contract events 312 sub ethereum.Subscription // Subscription for errors, completion and termination 313 done bool // Whether the subscription completed delivering logs 314 fail error // Occurred error to stop iteration 315 } 316 317 // Next advances the iterator to the subsequent event, returning whether there 318 // are any more events found. In case of a retrieval or parsing error, false is 319 // returned and Error() can be queried for the exact failure. 320 func (it *DIADefi100OracleOracleUpdateIterator) Next() bool { 321 // If the iterator failed, stop iterating 322 if it.fail != nil { 323 return false 324 } 325 // If the iterator completed, deliver directly whatever's available 326 if it.done { 327 select { 328 case log := <-it.logs: 329 it.Event = new(DIADefi100OracleOracleUpdate) 330 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 331 it.fail = err 332 return false 333 } 334 it.Event.Raw = log 335 return true 336 337 default: 338 return false 339 } 340 } 341 // Iterator still in progress, wait for either a data or an error event 342 select { 343 case log := <-it.logs: 344 it.Event = new(DIADefi100OracleOracleUpdate) 345 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 346 it.fail = err 347 return false 348 } 349 it.Event.Raw = log 350 return true 351 352 case err := <-it.sub.Err(): 353 it.done = true 354 it.fail = err 355 return it.Next() 356 } 357 } 358 359 // Error returns any retrieval or parsing error occurred during filtering. 360 func (it *DIADefi100OracleOracleUpdateIterator) Error() error { 361 return it.fail 362 } 363 364 // Close terminates the iteration process, releasing any pending underlying 365 // resources. 366 func (it *DIADefi100OracleOracleUpdateIterator) Close() error { 367 it.sub.Unsubscribe() 368 return nil 369 } 370 371 // DIADefi100OracleOracleUpdate represents a OracleUpdate event raised by the DIADefi100Oracle contract. 372 type DIADefi100OracleOracleUpdate struct { 373 Key string 374 Value *big.Int 375 Timestamp *big.Int 376 Raw types.Log // Blockchain specific contextual infos 377 } 378 379 // FilterOracleUpdate is a free log retrieval operation binding the contract event 0xa7fc99ed7617309ee23f63ae90196a1e490d362e6f6a547a59bc809ee2291782. 380 // 381 // Solidity: event OracleUpdate(string key, uint128 value, uint128 timestamp) 382 func (_DIADefi100Oracle *DIADefi100OracleFilterer) FilterOracleUpdate(opts *bind.FilterOpts) (*DIADefi100OracleOracleUpdateIterator, error) { 383 384 logs, sub, err := _DIADefi100Oracle.contract.FilterLogs(opts, "OracleUpdate") 385 if err != nil { 386 return nil, err 387 } 388 return &DIADefi100OracleOracleUpdateIterator{contract: _DIADefi100Oracle.contract, event: "OracleUpdate", logs: logs, sub: sub}, nil 389 } 390 391 // WatchOracleUpdate is a free log subscription operation binding the contract event 0xa7fc99ed7617309ee23f63ae90196a1e490d362e6f6a547a59bc809ee2291782. 392 // 393 // Solidity: event OracleUpdate(string key, uint128 value, uint128 timestamp) 394 func (_DIADefi100Oracle *DIADefi100OracleFilterer) WatchOracleUpdate(opts *bind.WatchOpts, sink chan<- *DIADefi100OracleOracleUpdate) (event.Subscription, error) { 395 396 logs, sub, err := _DIADefi100Oracle.contract.WatchLogs(opts, "OracleUpdate") 397 if err != nil { 398 return nil, err 399 } 400 return event.NewSubscription(func(quit <-chan struct{}) error { 401 defer sub.Unsubscribe() 402 for { 403 select { 404 case log := <-logs: 405 // New log arrived, parse the event and forward to the user 406 event := new(DIADefi100OracleOracleUpdate) 407 if err := _DIADefi100Oracle.contract.UnpackLog(event, "OracleUpdate", log); err != nil { 408 return err 409 } 410 event.Raw = log 411 412 select { 413 case sink <- event: 414 case err := <-sub.Err(): 415 return err 416 case <-quit: 417 return nil 418 } 419 case err := <-sub.Err(): 420 return err 421 case <-quit: 422 return nil 423 } 424 } 425 }), nil 426 } 427 428 // ParseOracleUpdate is a log parse operation binding the contract event 0xa7fc99ed7617309ee23f63ae90196a1e490d362e6f6a547a59bc809ee2291782. 429 // 430 // Solidity: event OracleUpdate(string key, uint128 value, uint128 timestamp) 431 func (_DIADefi100Oracle *DIADefi100OracleFilterer) ParseOracleUpdate(log types.Log) (*DIADefi100OracleOracleUpdate, error) { 432 event := new(DIADefi100OracleOracleUpdate) 433 if err := _DIADefi100Oracle.contract.UnpackLog(event, "OracleUpdate", log); err != nil { 434 return nil, err 435 } 436 event.Raw = log 437 return event, nil 438 } 439 440 // DIADefi100OracleUpdaterAddressChangeIterator is returned from FilterUpdaterAddressChange and is used to iterate over the raw logs and unpacked data for UpdaterAddressChange events raised by the DIADefi100Oracle contract. 441 type DIADefi100OracleUpdaterAddressChangeIterator struct { 442 Event *DIADefi100OracleUpdaterAddressChange // Event containing the contract specifics and raw log 443 444 contract *bind.BoundContract // Generic contract to use for unpacking event data 445 event string // Event name to use for unpacking event data 446 447 logs chan types.Log // Log channel receiving the found contract events 448 sub ethereum.Subscription // Subscription for errors, completion and termination 449 done bool // Whether the subscription completed delivering logs 450 fail error // Occurred error to stop iteration 451 } 452 453 // Next advances the iterator to the subsequent event, returning whether there 454 // are any more events found. In case of a retrieval or parsing error, false is 455 // returned and Error() can be queried for the exact failure. 456 func (it *DIADefi100OracleUpdaterAddressChangeIterator) Next() bool { 457 // If the iterator failed, stop iterating 458 if it.fail != nil { 459 return false 460 } 461 // If the iterator completed, deliver directly whatever's available 462 if it.done { 463 select { 464 case log := <-it.logs: 465 it.Event = new(DIADefi100OracleUpdaterAddressChange) 466 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 467 it.fail = err 468 return false 469 } 470 it.Event.Raw = log 471 return true 472 473 default: 474 return false 475 } 476 } 477 // Iterator still in progress, wait for either a data or an error event 478 select { 479 case log := <-it.logs: 480 it.Event = new(DIADefi100OracleUpdaterAddressChange) 481 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 482 it.fail = err 483 return false 484 } 485 it.Event.Raw = log 486 return true 487 488 case err := <-it.sub.Err(): 489 it.done = true 490 it.fail = err 491 return it.Next() 492 } 493 } 494 495 // Error returns any retrieval or parsing error occurred during filtering. 496 func (it *DIADefi100OracleUpdaterAddressChangeIterator) Error() error { 497 return it.fail 498 } 499 500 // Close terminates the iteration process, releasing any pending underlying 501 // resources. 502 func (it *DIADefi100OracleUpdaterAddressChangeIterator) Close() error { 503 it.sub.Unsubscribe() 504 return nil 505 } 506 507 // DIADefi100OracleUpdaterAddressChange represents a UpdaterAddressChange event raised by the DIADefi100Oracle contract. 508 type DIADefi100OracleUpdaterAddressChange struct { 509 NewUpdater common.Address 510 Raw types.Log // Blockchain specific contextual infos 511 } 512 513 // FilterUpdaterAddressChange is a free log retrieval operation binding the contract event 0x121e958a4cadf7f8dadefa22cc019700365240223668418faebed197da07089f. 514 // 515 // Solidity: event UpdaterAddressChange(address newUpdater) 516 func (_DIADefi100Oracle *DIADefi100OracleFilterer) FilterUpdaterAddressChange(opts *bind.FilterOpts) (*DIADefi100OracleUpdaterAddressChangeIterator, error) { 517 518 logs, sub, err := _DIADefi100Oracle.contract.FilterLogs(opts, "UpdaterAddressChange") 519 if err != nil { 520 return nil, err 521 } 522 return &DIADefi100OracleUpdaterAddressChangeIterator{contract: _DIADefi100Oracle.contract, event: "UpdaterAddressChange", logs: logs, sub: sub}, nil 523 } 524 525 // WatchUpdaterAddressChange is a free log subscription operation binding the contract event 0x121e958a4cadf7f8dadefa22cc019700365240223668418faebed197da07089f. 526 // 527 // Solidity: event UpdaterAddressChange(address newUpdater) 528 func (_DIADefi100Oracle *DIADefi100OracleFilterer) WatchUpdaterAddressChange(opts *bind.WatchOpts, sink chan<- *DIADefi100OracleUpdaterAddressChange) (event.Subscription, error) { 529 530 logs, sub, err := _DIADefi100Oracle.contract.WatchLogs(opts, "UpdaterAddressChange") 531 if err != nil { 532 return nil, err 533 } 534 return event.NewSubscription(func(quit <-chan struct{}) error { 535 defer sub.Unsubscribe() 536 for { 537 select { 538 case log := <-logs: 539 // New log arrived, parse the event and forward to the user 540 event := new(DIADefi100OracleUpdaterAddressChange) 541 if err := _DIADefi100Oracle.contract.UnpackLog(event, "UpdaterAddressChange", log); err != nil { 542 return err 543 } 544 event.Raw = log 545 546 select { 547 case sink <- event: 548 case err := <-sub.Err(): 549 return err 550 case <-quit: 551 return nil 552 } 553 case err := <-sub.Err(): 554 return err 555 case <-quit: 556 return nil 557 } 558 } 559 }), nil 560 } 561 562 // ParseUpdaterAddressChange is a log parse operation binding the contract event 0x121e958a4cadf7f8dadefa22cc019700365240223668418faebed197da07089f. 563 // 564 // Solidity: event UpdaterAddressChange(address newUpdater) 565 func (_DIADefi100Oracle *DIADefi100OracleFilterer) ParseUpdaterAddressChange(log types.Log) (*DIADefi100OracleUpdaterAddressChange, error) { 566 event := new(DIADefi100OracleUpdaterAddressChange) 567 if err := _DIADefi100Oracle.contract.UnpackLog(event, "UpdaterAddressChange", log); err != nil { 568 return nil, err 569 } 570 event.Raw = log 571 return event, nil 572 }