From 03609feb844a214689d864ceb2d619f2e57a1b10 Mon Sep 17 00:00:00 2001 From: batphonghan Date: Mon, 4 Mar 2024 20:48:07 +0700 Subject: [PATCH] Update ABI --- abis/OperatorRewardsCollector.abi.json | 604 +++-------- .../contracts/operator-rewards-collector.go | 954 ++---------------- stader-lib/node/operator.go | 6 +- 3 files changed, 275 insertions(+), 1289 deletions(-) diff --git a/abis/OperatorRewardsCollector.abi.json b/abis/OperatorRewardsCollector.abi.json index 6fc23cab7..5794e4c04 100644 --- a/abis/OperatorRewardsCollector.abi.json +++ b/abis/OperatorRewardsCollector.abi.json @@ -1,444 +1,166 @@ [ { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "CallerNotStaderContract", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientBalance", - "type": "error" - }, - { - "inputs": [], - "name": "TransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Claimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DepositedFor", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "staderConfig", - "type": "address" - } - ], - "name": "UpdatedStaderConfig", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "balances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "claim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "claimFor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "liquidatorAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "liquidator", - "type": "address" - } - ], - "name": "claimLiquidation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_receiver", - "type": "address" - } - ], - "name": "depositFor", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_admin", - "type": "address" - }, - { - "internalType": "address", - "name": "_staderConfig", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "staderConfig", - "outputs": [ - { - "internalType": "contract IStaderConfig", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_staderConfig", - "type": "address" - } - ], - "name": "updateStaderConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "withdrawableInEth", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "WethTransferFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Claimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DepositedFor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "staderConfig", + "type": "address" + } + ], + "name": "UpdatedStaderConfig", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "weth", + "type": "address" + } + ], + "name": "UpdatedWethAddress", + "type": "event" + }, + { + "inputs": [], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "claimLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "claimWithAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "depositFor", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "withdrawableInEth", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" } -] + ] \ No newline at end of file diff --git a/stader-lib/contracts/operator-rewards-collector.go b/stader-lib/contracts/operator-rewards-collector.go index 50c9bdcad..9ca162677 100644 --- a/stader-lib/contracts/operator-rewards-collector.go +++ b/stader-lib/contracts/operator-rewards-collector.go @@ -31,7 +31,7 @@ var ( // OperatorRewardsCollectorMetaData contains all meta data concerning the OperatorRewardsCollector contract. var OperatorRewardsCollectorMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CallerNotStaderContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Claimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"DepositedFor\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"staderConfig\",\"type\":\"address\"}],\"name\":\"UpdatedStaderConfig\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"claimFor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"liquidatorAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"liquidator\",\"type\":\"address\"}],\"name\":\"claimLiquidation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"}],\"name\":\"depositFor\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_admin\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_staderConfig\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"staderConfig\",\"outputs\":[{\"internalType\":\"contractIStaderConfig\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_staderConfig\",\"type\":\"address\"}],\"name\":\"updateStaderConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"withdrawableInEth\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WethTransferFailed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Claimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"DepositedFor\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"staderConfig\",\"type\":\"address\"}],\"name\":\"UpdatedStaderConfig\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"weth\",\"type\":\"address\"}],\"name\":\"UpdatedWethAddress\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"claimLiquidation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"claimWithAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_receiver\",\"type\":\"address\"}],\"name\":\"depositFor\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"withdrawableInEth\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // OperatorRewardsCollectorABI is the input ABI used to generate the binding from. @@ -180,43 +180,12 @@ func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorRaw) Transact return _OperatorRewardsCollector.Contract.contract.Transact(opts, method, params...) } -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. +// GetBalance is a free data retrieval call binding the contract method 0xf8b2cb4f. // -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCaller) DEFAULTADMINROLE(opts *bind.CallOpts) ([32]byte, error) { +// Solidity: function getBalance(address operator) view returns(uint256) +func (_OperatorRewardsCollector *OperatorRewardsCollectorCaller) GetBalance(opts *bind.CallOpts, operator common.Address) (*big.Int, error) { var out []interface{} - err := _OperatorRewardsCollector.contract.Call(opts, &out, "DEFAULT_ADMIN_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) DEFAULTADMINROLE() ([32]byte, error) { - return _OperatorRewardsCollector.Contract.DEFAULTADMINROLE(&_OperatorRewardsCollector.CallOpts) -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCallerSession) DEFAULTADMINROLE() ([32]byte, error) { - return _OperatorRewardsCollector.Contract.DEFAULTADMINROLE(&_OperatorRewardsCollector.CallOpts) -} - -// Balances is a free data retrieval call binding the contract method 0x27e235e3. -// -// Solidity: function balances(address ) view returns(uint256) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCaller) Balances(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var out []interface{} - err := _OperatorRewardsCollector.contract.Call(opts, &out, "balances", arg0) + err := _OperatorRewardsCollector.contract.Call(opts, &out, "getBalance", operator) if err != nil { return *new(*big.Int), err @@ -228,142 +197,18 @@ func (_OperatorRewardsCollector *OperatorRewardsCollectorCaller) Balances(opts * } -// Balances is a free data retrieval call binding the contract method 0x27e235e3. -// -// Solidity: function balances(address ) view returns(uint256) -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) Balances(arg0 common.Address) (*big.Int, error) { - return _OperatorRewardsCollector.Contract.Balances(&_OperatorRewardsCollector.CallOpts, arg0) -} - -// Balances is a free data retrieval call binding the contract method 0x27e235e3. -// -// Solidity: function balances(address ) view returns(uint256) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCallerSession) Balances(arg0 common.Address) (*big.Int, error) { - return _OperatorRewardsCollector.Contract.Balances(&_OperatorRewardsCollector.CallOpts, arg0) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) { - var out []interface{} - err := _OperatorRewardsCollector.contract.Call(opts, &out, "getRoleAdmin", role) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _OperatorRewardsCollector.Contract.GetRoleAdmin(&_OperatorRewardsCollector.CallOpts, role) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _OperatorRewardsCollector.Contract.GetRoleAdmin(&_OperatorRewardsCollector.CallOpts, role) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCaller) HasRole(opts *bind.CallOpts, role [32]byte, account common.Address) (bool, error) { - var out []interface{} - err := _OperatorRewardsCollector.contract.Call(opts, &out, "hasRole", role, account) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _OperatorRewardsCollector.Contract.HasRole(&_OperatorRewardsCollector.CallOpts, role, account) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCallerSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _OperatorRewardsCollector.Contract.HasRole(&_OperatorRewardsCollector.CallOpts, role, account) -} - -// StaderConfig is a free data retrieval call binding the contract method 0x490ffa35. -// -// Solidity: function staderConfig() view returns(address) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCaller) StaderConfig(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _OperatorRewardsCollector.contract.Call(opts, &out, "staderConfig") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// StaderConfig is a free data retrieval call binding the contract method 0x490ffa35. -// -// Solidity: function staderConfig() view returns(address) -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) StaderConfig() (common.Address, error) { - return _OperatorRewardsCollector.Contract.StaderConfig(&_OperatorRewardsCollector.CallOpts) -} - -// StaderConfig is a free data retrieval call binding the contract method 0x490ffa35. -// -// Solidity: function staderConfig() view returns(address) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCallerSession) StaderConfig() (common.Address, error) { - return _OperatorRewardsCollector.Contract.StaderConfig(&_OperatorRewardsCollector.CallOpts) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _OperatorRewardsCollector.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// GetBalance is a free data retrieval call binding the contract method 0xf8b2cb4f. // -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _OperatorRewardsCollector.Contract.SupportsInterface(&_OperatorRewardsCollector.CallOpts, interfaceId) +// Solidity: function getBalance(address operator) view returns(uint256) +func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) GetBalance(operator common.Address) (*big.Int, error) { + return _OperatorRewardsCollector.Contract.GetBalance(&_OperatorRewardsCollector.CallOpts, operator) } -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// GetBalance is a free data retrieval call binding the contract method 0xf8b2cb4f. // -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_OperatorRewardsCollector *OperatorRewardsCollectorCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _OperatorRewardsCollector.Contract.SupportsInterface(&_OperatorRewardsCollector.CallOpts, interfaceId) +// Solidity: function getBalance(address operator) view returns(uint256) +func (_OperatorRewardsCollector *OperatorRewardsCollectorCallerSession) GetBalance(operator common.Address) (*big.Int, error) { + return _OperatorRewardsCollector.Contract.GetBalance(&_OperatorRewardsCollector.CallOpts, operator) } // WithdrawableInEth is a free data retrieval call binding the contract method 0x96198d0f. @@ -418,46 +263,46 @@ func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) Clai return _OperatorRewardsCollector.Contract.Claim(&_OperatorRewardsCollector.TransactOpts) } -// ClaimFor is a paid mutator transaction binding the contract method 0x0de05659. +// ClaimLiquidation is a paid mutator transaction binding the contract method 0x1cc1c626. // -// Solidity: function claimFor(address operator, uint256 amount) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactor) ClaimFor(opts *bind.TransactOpts, operator common.Address, amount *big.Int) (*types.Transaction, error) { - return _OperatorRewardsCollector.contract.Transact(opts, "claimFor", operator, amount) +// Solidity: function claimLiquidation(address operator) returns() +func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactor) ClaimLiquidation(opts *bind.TransactOpts, operator common.Address) (*types.Transaction, error) { + return _OperatorRewardsCollector.contract.Transact(opts, "claimLiquidation", operator) } -// ClaimFor is a paid mutator transaction binding the contract method 0x0de05659. +// ClaimLiquidation is a paid mutator transaction binding the contract method 0x1cc1c626. // -// Solidity: function claimFor(address operator, uint256 amount) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) ClaimFor(operator common.Address, amount *big.Int) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.ClaimFor(&_OperatorRewardsCollector.TransactOpts, operator, amount) +// Solidity: function claimLiquidation(address operator) returns() +func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) ClaimLiquidation(operator common.Address) (*types.Transaction, error) { + return _OperatorRewardsCollector.Contract.ClaimLiquidation(&_OperatorRewardsCollector.TransactOpts, operator) } -// ClaimFor is a paid mutator transaction binding the contract method 0x0de05659. +// ClaimLiquidation is a paid mutator transaction binding the contract method 0x1cc1c626. // -// Solidity: function claimFor(address operator, uint256 amount) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) ClaimFor(operator common.Address, amount *big.Int) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.ClaimFor(&_OperatorRewardsCollector.TransactOpts, operator, amount) +// Solidity: function claimLiquidation(address operator) returns() +func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) ClaimLiquidation(operator common.Address) (*types.Transaction, error) { + return _OperatorRewardsCollector.Contract.ClaimLiquidation(&_OperatorRewardsCollector.TransactOpts, operator) } -// ClaimLiquidation is a paid mutator transaction binding the contract method 0xb86d3808. +// ClaimWithAmount is a paid mutator transaction binding the contract method 0xa4557a11. // -// Solidity: function claimLiquidation(uint256 liquidatorAmount, uint256 feeAmount, address liquidator) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactor) ClaimLiquidation(opts *bind.TransactOpts, liquidatorAmount *big.Int, feeAmount *big.Int, liquidator common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.contract.Transact(opts, "claimLiquidation", liquidatorAmount, feeAmount, liquidator) +// Solidity: function claimWithAmount(uint256 _amount) returns() +func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactor) ClaimWithAmount(opts *bind.TransactOpts, _amount *big.Int) (*types.Transaction, error) { + return _OperatorRewardsCollector.contract.Transact(opts, "claimWithAmount", _amount) } -// ClaimLiquidation is a paid mutator transaction binding the contract method 0xb86d3808. +// ClaimWithAmount is a paid mutator transaction binding the contract method 0xa4557a11. // -// Solidity: function claimLiquidation(uint256 liquidatorAmount, uint256 feeAmount, address liquidator) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) ClaimLiquidation(liquidatorAmount *big.Int, feeAmount *big.Int, liquidator common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.ClaimLiquidation(&_OperatorRewardsCollector.TransactOpts, liquidatorAmount, feeAmount, liquidator) +// Solidity: function claimWithAmount(uint256 _amount) returns() +func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) ClaimWithAmount(_amount *big.Int) (*types.Transaction, error) { + return _OperatorRewardsCollector.Contract.ClaimWithAmount(&_OperatorRewardsCollector.TransactOpts, _amount) } -// ClaimLiquidation is a paid mutator transaction binding the contract method 0xb86d3808. +// ClaimWithAmount is a paid mutator transaction binding the contract method 0xa4557a11. // -// Solidity: function claimLiquidation(uint256 liquidatorAmount, uint256 feeAmount, address liquidator) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) ClaimLiquidation(liquidatorAmount *big.Int, feeAmount *big.Int, liquidator common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.ClaimLiquidation(&_OperatorRewardsCollector.TransactOpts, liquidatorAmount, feeAmount, liquidator) +// Solidity: function claimWithAmount(uint256 _amount) returns() +func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) ClaimWithAmount(_amount *big.Int) (*types.Transaction, error) { + return _OperatorRewardsCollector.Contract.ClaimWithAmount(&_OperatorRewardsCollector.TransactOpts, _amount) } // DepositFor is a paid mutator transaction binding the contract method 0xaa67c919. @@ -481,111 +326,6 @@ func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) Depo return _OperatorRewardsCollector.Contract.DepositFor(&_OperatorRewardsCollector.TransactOpts, _receiver) } -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactor) GrantRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.contract.Transact(opts, "grantRole", role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.GrantRole(&_OperatorRewardsCollector.TransactOpts, role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.GrantRole(&_OperatorRewardsCollector.TransactOpts, role, account) -} - -// Initialize is a paid mutator transaction binding the contract method 0x485cc955. -// -// Solidity: function initialize(address _admin, address _staderConfig) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactor) Initialize(opts *bind.TransactOpts, _admin common.Address, _staderConfig common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.contract.Transact(opts, "initialize", _admin, _staderConfig) -} - -// Initialize is a paid mutator transaction binding the contract method 0x485cc955. -// -// Solidity: function initialize(address _admin, address _staderConfig) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) Initialize(_admin common.Address, _staderConfig common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.Initialize(&_OperatorRewardsCollector.TransactOpts, _admin, _staderConfig) -} - -// Initialize is a paid mutator transaction binding the contract method 0x485cc955. -// -// Solidity: function initialize(address _admin, address _staderConfig) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) Initialize(_admin common.Address, _staderConfig common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.Initialize(&_OperatorRewardsCollector.TransactOpts, _admin, _staderConfig) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address account) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactor) RenounceRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.contract.Transact(opts, "renounceRole", role, account) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address account) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) RenounceRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.RenounceRole(&_OperatorRewardsCollector.TransactOpts, role, account) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address account) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) RenounceRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.RenounceRole(&_OperatorRewardsCollector.TransactOpts, role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactor) RevokeRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.contract.Transact(opts, "revokeRole", role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.RevokeRole(&_OperatorRewardsCollector.TransactOpts, role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.RevokeRole(&_OperatorRewardsCollector.TransactOpts, role, account) -} - -// UpdateStaderConfig is a paid mutator transaction binding the contract method 0x9ee804cb. -// -// Solidity: function updateStaderConfig(address _staderConfig) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactor) UpdateStaderConfig(opts *bind.TransactOpts, _staderConfig common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.contract.Transact(opts, "updateStaderConfig", _staderConfig) -} - -// UpdateStaderConfig is a paid mutator transaction binding the contract method 0x9ee804cb. -// -// Solidity: function updateStaderConfig(address _staderConfig) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorSession) UpdateStaderConfig(_staderConfig common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.UpdateStaderConfig(&_OperatorRewardsCollector.TransactOpts, _staderConfig) -} - -// UpdateStaderConfig is a paid mutator transaction binding the contract method 0x9ee804cb. -// -// Solidity: function updateStaderConfig(address _staderConfig) returns() -func (_OperatorRewardsCollector *OperatorRewardsCollectorTransactorSession) UpdateStaderConfig(_staderConfig common.Address) (*types.Transaction, error) { - return _OperatorRewardsCollector.Contract.UpdateStaderConfig(&_OperatorRewardsCollector.TransactOpts, _staderConfig) -} - // OperatorRewardsCollectorClaimedIterator is returned from FilterClaimed and is used to iterate over the raw logs and unpacked data for Claimed events raised by the OperatorRewardsCollector contract. type OperatorRewardsCollectorClaimedIterator struct { Event *OperatorRewardsCollectorClaimed // Event containing the contract specifics and raw log @@ -885,9 +625,9 @@ func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) ParseDeposite return event, nil } -// OperatorRewardsCollectorInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorInitializedIterator struct { - Event *OperatorRewardsCollectorInitialized // Event containing the contract specifics and raw log +// OperatorRewardsCollectorUpdatedStaderConfigIterator is returned from FilterUpdatedStaderConfig and is used to iterate over the raw logs and unpacked data for UpdatedStaderConfig events raised by the OperatorRewardsCollector contract. +type OperatorRewardsCollectorUpdatedStaderConfigIterator struct { + Event *OperatorRewardsCollectorUpdatedStaderConfig // 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 @@ -901,7 +641,7 @@ type OperatorRewardsCollectorInitializedIterator struct { // 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 *OperatorRewardsCollectorInitializedIterator) Next() bool { +func (it *OperatorRewardsCollectorUpdatedStaderConfigIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -910,7 +650,7 @@ func (it *OperatorRewardsCollectorInitializedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(OperatorRewardsCollectorInitialized) + it.Event = new(OperatorRewardsCollectorUpdatedStaderConfig) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -925,7 +665,7 @@ func (it *OperatorRewardsCollectorInitializedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(OperatorRewardsCollectorInitialized) + it.Event = new(OperatorRewardsCollectorUpdatedStaderConfig) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -941,41 +681,51 @@ func (it *OperatorRewardsCollectorInitializedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *OperatorRewardsCollectorInitializedIterator) Error() error { +func (it *OperatorRewardsCollectorUpdatedStaderConfigIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *OperatorRewardsCollectorInitializedIterator) Close() error { +func (it *OperatorRewardsCollectorUpdatedStaderConfigIterator) Close() error { it.sub.Unsubscribe() return nil } -// OperatorRewardsCollectorInitialized represents a Initialized event raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos +// OperatorRewardsCollectorUpdatedStaderConfig represents a UpdatedStaderConfig event raised by the OperatorRewardsCollector contract. +type OperatorRewardsCollectorUpdatedStaderConfig struct { + StaderConfig common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// FilterUpdatedStaderConfig is a free log retrieval operation binding the contract event 0xdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b4485. // -// Solidity: event Initialized(uint8 version) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) FilterInitialized(opts *bind.FilterOpts) (*OperatorRewardsCollectorInitializedIterator, error) { +// Solidity: event UpdatedStaderConfig(address indexed staderConfig) +func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) FilterUpdatedStaderConfig(opts *bind.FilterOpts, staderConfig []common.Address) (*OperatorRewardsCollectorUpdatedStaderConfigIterator, error) { + + var staderConfigRule []interface{} + for _, staderConfigItem := range staderConfig { + staderConfigRule = append(staderConfigRule, staderConfigItem) + } - logs, sub, err := _OperatorRewardsCollector.contract.FilterLogs(opts, "Initialized") + logs, sub, err := _OperatorRewardsCollector.contract.FilterLogs(opts, "UpdatedStaderConfig", staderConfigRule) if err != nil { return nil, err } - return &OperatorRewardsCollectorInitializedIterator{contract: _OperatorRewardsCollector.contract, event: "Initialized", logs: logs, sub: sub}, nil + return &OperatorRewardsCollectorUpdatedStaderConfigIterator{contract: _OperatorRewardsCollector.contract, event: "UpdatedStaderConfig", logs: logs, sub: sub}, nil } -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// WatchUpdatedStaderConfig is a free log subscription operation binding the contract event 0xdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b4485. // -// Solidity: event Initialized(uint8 version) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *OperatorRewardsCollectorInitialized) (event.Subscription, error) { +// Solidity: event UpdatedStaderConfig(address indexed staderConfig) +func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchUpdatedStaderConfig(opts *bind.WatchOpts, sink chan<- *OperatorRewardsCollectorUpdatedStaderConfig, staderConfig []common.Address) (event.Subscription, error) { + + var staderConfigRule []interface{} + for _, staderConfigItem := range staderConfig { + staderConfigRule = append(staderConfigRule, staderConfigItem) + } - logs, sub, err := _OperatorRewardsCollector.contract.WatchLogs(opts, "Initialized") + logs, sub, err := _OperatorRewardsCollector.contract.WatchLogs(opts, "UpdatedStaderConfig", staderConfigRule) if err != nil { return nil, err } @@ -985,8 +735,8 @@ func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchInitiali select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(OperatorRewardsCollectorInitialized) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "Initialized", log); err != nil { + event := new(OperatorRewardsCollectorUpdatedStaderConfig) + if err := _OperatorRewardsCollector.contract.UnpackLog(event, "UpdatedStaderConfig", log); err != nil { return err } event.Raw = log @@ -1007,21 +757,21 @@ func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchInitiali }), nil } -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// ParseUpdatedStaderConfig is a log parse operation binding the contract event 0xdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b4485. // -// Solidity: event Initialized(uint8 version) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) ParseInitialized(log types.Log) (*OperatorRewardsCollectorInitialized, error) { - event := new(OperatorRewardsCollectorInitialized) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "Initialized", log); err != nil { +// Solidity: event UpdatedStaderConfig(address indexed staderConfig) +func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) ParseUpdatedStaderConfig(log types.Log) (*OperatorRewardsCollectorUpdatedStaderConfig, error) { + event := new(OperatorRewardsCollectorUpdatedStaderConfig) + if err := _OperatorRewardsCollector.contract.UnpackLog(event, "UpdatedStaderConfig", log); err != nil { return nil, err } event.Raw = log return event, nil } -// OperatorRewardsCollectorRoleAdminChangedIterator is returned from FilterRoleAdminChanged and is used to iterate over the raw logs and unpacked data for RoleAdminChanged events raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorRoleAdminChangedIterator struct { - Event *OperatorRewardsCollectorRoleAdminChanged // Event containing the contract specifics and raw log +// OperatorRewardsCollectorUpdatedWethAddressIterator is returned from FilterUpdatedWethAddress and is used to iterate over the raw logs and unpacked data for UpdatedWethAddress events raised by the OperatorRewardsCollector contract. +type OperatorRewardsCollectorUpdatedWethAddressIterator struct { + Event *OperatorRewardsCollectorUpdatedWethAddress // 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 @@ -1035,7 +785,7 @@ type OperatorRewardsCollectorRoleAdminChangedIterator struct { // 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 *OperatorRewardsCollectorRoleAdminChangedIterator) Next() bool { +func (it *OperatorRewardsCollectorUpdatedWethAddressIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1044,7 +794,7 @@ func (it *OperatorRewardsCollectorRoleAdminChangedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(OperatorRewardsCollectorRoleAdminChanged) + it.Event = new(OperatorRewardsCollectorUpdatedWethAddress) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1059,7 +809,7 @@ func (it *OperatorRewardsCollectorRoleAdminChangedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(OperatorRewardsCollectorRoleAdminChanged) + it.Event = new(OperatorRewardsCollectorUpdatedWethAddress) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1075,69 +825,51 @@ func (it *OperatorRewardsCollectorRoleAdminChangedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *OperatorRewardsCollectorRoleAdminChangedIterator) Error() error { +func (it *OperatorRewardsCollectorUpdatedWethAddressIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *OperatorRewardsCollectorRoleAdminChangedIterator) Close() error { +func (it *OperatorRewardsCollectorUpdatedWethAddressIterator) Close() error { it.sub.Unsubscribe() return nil } -// OperatorRewardsCollectorRoleAdminChanged represents a RoleAdminChanged event raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorRoleAdminChanged struct { - Role [32]byte - PreviousAdminRole [32]byte - NewAdminRole [32]byte - Raw types.Log // Blockchain specific contextual infos +// OperatorRewardsCollectorUpdatedWethAddress represents a UpdatedWethAddress event raised by the OperatorRewardsCollector contract. +type OperatorRewardsCollectorUpdatedWethAddress struct { + Weth common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterRoleAdminChanged is a free log retrieval operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. +// FilterUpdatedWethAddress is a free log retrieval operation binding the contract event 0xa1de212dff029f064e368842c50f600a79a6958de54219159b77f9fa9b84e023. // -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*OperatorRewardsCollectorRoleAdminChangedIterator, error) { +// Solidity: event UpdatedWethAddress(address indexed weth) +func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) FilterUpdatedWethAddress(opts *bind.FilterOpts, weth []common.Address) (*OperatorRewardsCollectorUpdatedWethAddressIterator, error) { - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) + var wethRule []interface{} + for _, wethItem := range weth { + wethRule = append(wethRule, wethItem) } - logs, sub, err := _OperatorRewardsCollector.contract.FilterLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) + logs, sub, err := _OperatorRewardsCollector.contract.FilterLogs(opts, "UpdatedWethAddress", wethRule) if err != nil { return nil, err } - return &OperatorRewardsCollectorRoleAdminChangedIterator{contract: _OperatorRewardsCollector.contract, event: "RoleAdminChanged", logs: logs, sub: sub}, nil + return &OperatorRewardsCollectorUpdatedWethAddressIterator{contract: _OperatorRewardsCollector.contract, event: "UpdatedWethAddress", logs: logs, sub: sub}, nil } -// WatchRoleAdminChanged is a free log subscription operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. +// WatchUpdatedWethAddress is a free log subscription operation binding the contract event 0xa1de212dff029f064e368842c50f600a79a6958de54219159b77f9fa9b84e023. // -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *OperatorRewardsCollectorRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) { +// Solidity: event UpdatedWethAddress(address indexed weth) +func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchUpdatedWethAddress(opts *bind.WatchOpts, sink chan<- *OperatorRewardsCollectorUpdatedWethAddress, weth []common.Address) (event.Subscription, error) { - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) + var wethRule []interface{} + for _, wethItem := range weth { + wethRule = append(wethRule, wethItem) } - logs, sub, err := _OperatorRewardsCollector.contract.WatchLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) + logs, sub, err := _OperatorRewardsCollector.contract.WatchLogs(opts, "UpdatedWethAddress", wethRule) if err != nil { return nil, err } @@ -1147,8 +879,8 @@ func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchRoleAdmi select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(OperatorRewardsCollectorRoleAdminChanged) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { + event := new(OperatorRewardsCollectorUpdatedWethAddress) + if err := _OperatorRewardsCollector.contract.UnpackLog(event, "UpdatedWethAddress", log); err != nil { return err } event.Raw = log @@ -1169,480 +901,12 @@ func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchRoleAdmi }), nil } -// ParseRoleAdminChanged is a log parse operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) ParseRoleAdminChanged(log types.Log) (*OperatorRewardsCollectorRoleAdminChanged, error) { - event := new(OperatorRewardsCollectorRoleAdminChanged) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// OperatorRewardsCollectorRoleGrantedIterator is returned from FilterRoleGranted and is used to iterate over the raw logs and unpacked data for RoleGranted events raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorRoleGrantedIterator struct { - Event *OperatorRewardsCollectorRoleGranted // 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 *OperatorRewardsCollectorRoleGrantedIterator) 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(OperatorRewardsCollectorRoleGranted) - 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(OperatorRewardsCollectorRoleGranted) - 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 *OperatorRewardsCollectorRoleGrantedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *OperatorRewardsCollectorRoleGrantedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// OperatorRewardsCollectorRoleGranted represents a RoleGranted event raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorRoleGranted struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleGranted is a free log retrieval operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. +// ParseUpdatedWethAddress is a log parse operation binding the contract event 0xa1de212dff029f064e368842c50f600a79a6958de54219159b77f9fa9b84e023. // -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*OperatorRewardsCollectorRoleGrantedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _OperatorRewardsCollector.contract.FilterLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &OperatorRewardsCollectorRoleGrantedIterator{contract: _OperatorRewardsCollector.contract, event: "RoleGranted", logs: logs, sub: sub}, nil -} - -// WatchRoleGranted is a free log subscription operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchRoleGranted(opts *bind.WatchOpts, sink chan<- *OperatorRewardsCollectorRoleGranted, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _OperatorRewardsCollector.contract.WatchLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - 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(OperatorRewardsCollectorRoleGranted) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "RoleGranted", 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 -} - -// ParseRoleGranted is a log parse operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) ParseRoleGranted(log types.Log) (*OperatorRewardsCollectorRoleGranted, error) { - event := new(OperatorRewardsCollectorRoleGranted) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// OperatorRewardsCollectorRoleRevokedIterator is returned from FilterRoleRevoked and is used to iterate over the raw logs and unpacked data for RoleRevoked events raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorRoleRevokedIterator struct { - Event *OperatorRewardsCollectorRoleRevoked // 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 *OperatorRewardsCollectorRoleRevokedIterator) 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(OperatorRewardsCollectorRoleRevoked) - 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(OperatorRewardsCollectorRoleRevoked) - 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 *OperatorRewardsCollectorRoleRevokedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *OperatorRewardsCollectorRoleRevokedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// OperatorRewardsCollectorRoleRevoked represents a RoleRevoked event raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorRoleRevoked struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleRevoked is a free log retrieval operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) FilterRoleRevoked(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*OperatorRewardsCollectorRoleRevokedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _OperatorRewardsCollector.contract.FilterLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &OperatorRewardsCollectorRoleRevokedIterator{contract: _OperatorRewardsCollector.contract, event: "RoleRevoked", logs: logs, sub: sub}, nil -} - -// WatchRoleRevoked is a free log subscription operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchRoleRevoked(opts *bind.WatchOpts, sink chan<- *OperatorRewardsCollectorRoleRevoked, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _OperatorRewardsCollector.contract.WatchLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - 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(OperatorRewardsCollectorRoleRevoked) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "RoleRevoked", 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 -} - -// ParseRoleRevoked is a log parse operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) ParseRoleRevoked(log types.Log) (*OperatorRewardsCollectorRoleRevoked, error) { - event := new(OperatorRewardsCollectorRoleRevoked) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// OperatorRewardsCollectorUpdatedStaderConfigIterator is returned from FilterUpdatedStaderConfig and is used to iterate over the raw logs and unpacked data for UpdatedStaderConfig events raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorUpdatedStaderConfigIterator struct { - Event *OperatorRewardsCollectorUpdatedStaderConfig // 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 *OperatorRewardsCollectorUpdatedStaderConfigIterator) 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(OperatorRewardsCollectorUpdatedStaderConfig) - 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(OperatorRewardsCollectorUpdatedStaderConfig) - 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 *OperatorRewardsCollectorUpdatedStaderConfigIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *OperatorRewardsCollectorUpdatedStaderConfigIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// OperatorRewardsCollectorUpdatedStaderConfig represents a UpdatedStaderConfig event raised by the OperatorRewardsCollector contract. -type OperatorRewardsCollectorUpdatedStaderConfig struct { - StaderConfig common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUpdatedStaderConfig is a free log retrieval operation binding the contract event 0xdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b4485. -// -// Solidity: event UpdatedStaderConfig(address indexed staderConfig) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) FilterUpdatedStaderConfig(opts *bind.FilterOpts, staderConfig []common.Address) (*OperatorRewardsCollectorUpdatedStaderConfigIterator, error) { - - var staderConfigRule []interface{} - for _, staderConfigItem := range staderConfig { - staderConfigRule = append(staderConfigRule, staderConfigItem) - } - - logs, sub, err := _OperatorRewardsCollector.contract.FilterLogs(opts, "UpdatedStaderConfig", staderConfigRule) - if err != nil { - return nil, err - } - return &OperatorRewardsCollectorUpdatedStaderConfigIterator{contract: _OperatorRewardsCollector.contract, event: "UpdatedStaderConfig", logs: logs, sub: sub}, nil -} - -// WatchUpdatedStaderConfig is a free log subscription operation binding the contract event 0xdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b4485. -// -// Solidity: event UpdatedStaderConfig(address indexed staderConfig) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) WatchUpdatedStaderConfig(opts *bind.WatchOpts, sink chan<- *OperatorRewardsCollectorUpdatedStaderConfig, staderConfig []common.Address) (event.Subscription, error) { - - var staderConfigRule []interface{} - for _, staderConfigItem := range staderConfig { - staderConfigRule = append(staderConfigRule, staderConfigItem) - } - - logs, sub, err := _OperatorRewardsCollector.contract.WatchLogs(opts, "UpdatedStaderConfig", staderConfigRule) - 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(OperatorRewardsCollectorUpdatedStaderConfig) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "UpdatedStaderConfig", 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 -} - -// ParseUpdatedStaderConfig is a log parse operation binding the contract event 0xdb2219043d7b197cb235f1af0cf6d782d77dee3de19e3f4fb6d39aae633b4485. -// -// Solidity: event UpdatedStaderConfig(address indexed staderConfig) -func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) ParseUpdatedStaderConfig(log types.Log) (*OperatorRewardsCollectorUpdatedStaderConfig, error) { - event := new(OperatorRewardsCollectorUpdatedStaderConfig) - if err := _OperatorRewardsCollector.contract.UnpackLog(event, "UpdatedStaderConfig", log); err != nil { +// Solidity: event UpdatedWethAddress(address indexed weth) +func (_OperatorRewardsCollector *OperatorRewardsCollectorFilterer) ParseUpdatedWethAddress(log types.Log) (*OperatorRewardsCollectorUpdatedWethAddress, error) { + event := new(OperatorRewardsCollectorUpdatedWethAddress) + if err := _OperatorRewardsCollector.contract.UnpackLog(event, "UpdatedWethAddress", log); err != nil { return nil, err } event.Raw = log diff --git a/stader-lib/node/operator.go b/stader-lib/node/operator.go index fe7a73925..5d095ec44 100644 --- a/stader-lib/node/operator.go +++ b/stader-lib/node/operator.go @@ -38,8 +38,8 @@ func ClaimOperatorRewards(orc *stader.OperatorRewardsCollectorContractManager, o return tx, nil } -func ClaimOperatorRewardsWithAmount(orc *stader.OperatorRewardsCollectorContractManager, operatorAddress common.Address, amount *big.Int, opts *bind.TransactOpts) (*types.Transaction, error) { - tx, err := orc.OperatorRewardsCollector.ClaimFor(opts, operatorAddress, amount) +func ClaimOperatorRewardsWithAmount(orc *stader.OperatorRewardsCollectorContractManager, amount *big.Int, opts *bind.TransactOpts) (*types.Transaction, error) { + tx, err := orc.OperatorRewardsCollector.ClaimWithAmount(opts, amount) if err != nil { return nil, fmt.Errorf("Could not claim operator rewards: %w", err) } @@ -152,7 +152,7 @@ func GetNextOperatorId(pnr *stader.PermissionlessNodeRegistryContractManager, op } func GetOperatorRewardsCollectorBalance(orc *stader.OperatorRewardsCollectorContractManager, operatorRewardAddress common.Address, opts *bind.CallOpts) (*big.Int, error) { - return orc.OperatorRewardsCollector.Balances(opts, operatorRewardAddress) + return orc.OperatorRewardsCollector.GetBalance(opts, operatorRewardAddress) } func GetValidatorInfosByOperator(pnr *stader.PermissionlessNodeRegistryContractManager, operatorAddress common.Address, pageNumber *big.Int, pageSize *big.Int, opts *bind.CallOpts) ([]contracts.Validator, error) {