diff --git a/certora/scripts/libraries/verifyStructuredLinkedList.sh b/certora/scripts/libraries/verifyStructuredLinkedList.sh new file mode 100644 index 000000000..25615e4e0 --- /dev/null +++ b/certora/scripts/libraries/verifyStructuredLinkedList.sh @@ -0,0 +1,18 @@ +if [[ "$2" ]] +then + RULE="--rule $2" +fi + +solc-select use 0.8.27 + +certoraRun certora/harnesses/StructuredLinkedListHarness.sol \ + --verify StructuredLinkedListHarness:certora/specs/libraries/StructuredLinkedList.spec \ + --solc_via_ir \ + --solc_optimize 1 \ + --optimistic_loop \ + --optimistic_fallback \ + --parametric_contracts StructuredLinkedListHarness \ + $RULE \ + --rule_sanity \ + --loop_iter 3 \ + --msg "StructuredLinkedList $1 $2" \ \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index d3bc79b26..c1d0a8299 100644 --- a/foundry.toml +++ b/foundry.toml @@ -7,7 +7,10 @@ show_progress=true gas_reports = ["*"] # ignore upgrade testing in scripts by default no_match_test = "queueUpgrade" +<<<<<<< HEAD no_match_path = "script/releases/**/*.sol" +======= +>>>>>>> b0193bfe (feat: alm tests) remappings = [ "@openzeppelin/=lib/openzeppelin-contracts-v4.9.0/", "@openzeppelin-upgrades/=lib/openzeppelin-contracts-upgradeable-v4.9.0/", diff --git a/pkg/bindings/Checkpoints/binding.go b/pkg/bindings/Checkpoints/binding.go new file mode 100644 index 000000000..41a27afa8 --- /dev/null +++ b/pkg/bindings/Checkpoints/binding.go @@ -0,0 +1,203 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package Checkpoints + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// CheckpointsMetaData contains all meta data concerning the Checkpoints contract. +var CheckpointsMetaData = &bind.MetaData{ + ABI: "[]", + Bin: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122033cd598fba8494d1a6958a8af518adce5917043f9d96f1543c5e5350d9ce39b364736f6c634300080c0033", +} + +// CheckpointsABI is the input ABI used to generate the binding from. +// Deprecated: Use CheckpointsMetaData.ABI instead. +var CheckpointsABI = CheckpointsMetaData.ABI + +// CheckpointsBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use CheckpointsMetaData.Bin instead. +var CheckpointsBin = CheckpointsMetaData.Bin + +// DeployCheckpoints deploys a new Ethereum contract, binding an instance of Checkpoints to it. +func DeployCheckpoints(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Checkpoints, error) { + parsed, err := CheckpointsMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(CheckpointsBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Checkpoints{CheckpointsCaller: CheckpointsCaller{contract: contract}, CheckpointsTransactor: CheckpointsTransactor{contract: contract}, CheckpointsFilterer: CheckpointsFilterer{contract: contract}}, nil +} + +// Checkpoints is an auto generated Go binding around an Ethereum contract. +type Checkpoints struct { + CheckpointsCaller // Read-only binding to the contract + CheckpointsTransactor // Write-only binding to the contract + CheckpointsFilterer // Log filterer for contract events +} + +// CheckpointsCaller is an auto generated read-only Go binding around an Ethereum contract. +type CheckpointsCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CheckpointsTransactor is an auto generated write-only Go binding around an Ethereum contract. +type CheckpointsTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CheckpointsFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type CheckpointsFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CheckpointsSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type CheckpointsSession struct { + Contract *Checkpoints // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// CheckpointsCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type CheckpointsCallerSession struct { + Contract *CheckpointsCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// CheckpointsTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type CheckpointsTransactorSession struct { + Contract *CheckpointsTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// CheckpointsRaw is an auto generated low-level Go binding around an Ethereum contract. +type CheckpointsRaw struct { + Contract *Checkpoints // Generic contract binding to access the raw methods on +} + +// CheckpointsCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type CheckpointsCallerRaw struct { + Contract *CheckpointsCaller // Generic read-only contract binding to access the raw methods on +} + +// CheckpointsTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type CheckpointsTransactorRaw struct { + Contract *CheckpointsTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewCheckpoints creates a new instance of Checkpoints, bound to a specific deployed contract. +func NewCheckpoints(address common.Address, backend bind.ContractBackend) (*Checkpoints, error) { + contract, err := bindCheckpoints(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Checkpoints{CheckpointsCaller: CheckpointsCaller{contract: contract}, CheckpointsTransactor: CheckpointsTransactor{contract: contract}, CheckpointsFilterer: CheckpointsFilterer{contract: contract}}, nil +} + +// NewCheckpointsCaller creates a new read-only instance of Checkpoints, bound to a specific deployed contract. +func NewCheckpointsCaller(address common.Address, caller bind.ContractCaller) (*CheckpointsCaller, error) { + contract, err := bindCheckpoints(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CheckpointsCaller{contract: contract}, nil +} + +// NewCheckpointsTransactor creates a new write-only instance of Checkpoints, bound to a specific deployed contract. +func NewCheckpointsTransactor(address common.Address, transactor bind.ContractTransactor) (*CheckpointsTransactor, error) { + contract, err := bindCheckpoints(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CheckpointsTransactor{contract: contract}, nil +} + +// NewCheckpointsFilterer creates a new log filterer instance of Checkpoints, bound to a specific deployed contract. +func NewCheckpointsFilterer(address common.Address, filterer bind.ContractFilterer) (*CheckpointsFilterer, error) { + contract, err := bindCheckpoints(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CheckpointsFilterer{contract: contract}, nil +} + +// bindCheckpoints binds a generic wrapper to an already deployed contract. +func bindCheckpoints(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := CheckpointsMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Checkpoints *CheckpointsRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Checkpoints.Contract.CheckpointsCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Checkpoints *CheckpointsRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Checkpoints.Contract.CheckpointsTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Checkpoints *CheckpointsRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Checkpoints.Contract.CheckpointsTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Checkpoints *CheckpointsCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Checkpoints.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Checkpoints *CheckpointsTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Checkpoints.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Checkpoints *CheckpointsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Checkpoints.Contract.contract.Transact(opts, method, params...) +} diff --git a/pkg/bindings/DelayedWithdrawalRouter/binding.go b/pkg/bindings/DelayedWithdrawalRouter/binding.go new file mode 100644 index 000000000..4943de658 --- /dev/null +++ b/pkg/bindings/DelayedWithdrawalRouter/binding.go @@ -0,0 +1,1969 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package DelayedWithdrawalRouter + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// IDelayedWithdrawalRouterDelayedWithdrawal is an auto generated low-level Go binding around an user-defined struct. +type IDelayedWithdrawalRouterDelayedWithdrawal struct { + Amount *big.Int + BlockCreated uint32 +} + +// IDelayedWithdrawalRouterUserDelayedWithdrawals is an auto generated low-level Go binding around an user-defined struct. +type IDelayedWithdrawalRouterUserDelayedWithdrawals struct { + DelayedWithdrawalsCompleted *big.Int + DelayedWithdrawals []IDelayedWithdrawalRouterDelayedWithdrawal +} + +// DelayedWithdrawalRouterMetaData contains all meta data concerning the DelayedWithdrawalRouter contract. +var DelayedWithdrawalRouterMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_eigenPodManager\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MAX_WITHDRAWAL_DELAY_BLOCKS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"canClaimDelayedWithdrawal\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimDelayedWithdrawals\",\"inputs\":[{\"name\":\"maxNumberOfDelayedWithdrawalsToClaim\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"claimDelayedWithdrawals\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxNumberOfDelayedWithdrawalsToClaim\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createDelayedWithdrawal\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"eigenPodManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getClaimableUserDelayedWithdrawals\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIDelayedWithdrawalRouter.DelayedWithdrawal[]\",\"components\":[{\"name\":\"amount\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"blockCreated\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getUserDelayedWithdrawals\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIDelayedWithdrawalRouter.DelayedWithdrawal[]\",\"components\":[{\"name\":\"amount\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"blockCreated\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"initPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_withdrawalDelayBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"pauseAll\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pauserRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"newValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"userDelayedWithdrawalByIndex\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelayedWithdrawalRouter.DelayedWithdrawal\",\"components\":[{\"name\":\"amount\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"blockCreated\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"userWithdrawals\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelayedWithdrawalRouter.UserDelayedWithdrawals\",\"components\":[{\"name\":\"delayedWithdrawalsCompleted\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"delayedWithdrawals\",\"type\":\"tuple[]\",\"internalType\":\"structIDelayedWithdrawalRouter.DelayedWithdrawal[]\",\"components\":[{\"name\":\"amount\",\"type\":\"uint224\",\"internalType\":\"uint224\"},{\"name\":\"blockCreated\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"userWithdrawalsLength\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawalDelayBlocks\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"DelayedWithdrawalCreated\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"index\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelayedWithdrawalsClaimed\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amountClaimed\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"delayedWithdrawalsCompleted\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PauserRegistrySet\",\"inputs\":[{\"name\":\"pauserRegistry\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIPauserRegistry\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", + Bin: "0x60a06040523480156200001157600080fd5b5060405162001f0e38038062001f0e8339810160408190526200003491620001a8565b6001600160a01b038116620000cb5760405162461bcd60e51b815260206004820152604c60248201527f44656c617965645769746864726177616c526f757465722e636f6e737472756360448201527f746f723a205f656967656e506f644d616e616765722063616e6e6f742062652060648201526b7a65726f206164647265737360a01b608482015260a4015b60405180910390fd5b6001600160a01b038116608052620000e2620000e9565b50620001da565b600054610100900460ff1615620001535760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401620000c2565b60005460ff9081161015620001a6576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b600060208284031215620001bb57600080fd5b81516001600160a01b0381168114620001d357600080fd5b9392505050565b608051611d11620001fd600039600081816101fa0152610c000152611d116000f3fe60806040526004361061014b5760003560e01c806385594e58116100b6578063e4f4f8871161006f578063e4f4f887146103cc578063e5db06c014610405578063eb990c5914610425578063ecb7cb1b14610445578063f2fde38b14610472578063fabc1cbc1461049257600080fd5b806385594e5814610317578063886f1195146103445780638da5cb5b14610364578063c0db354c14610382578063ca661c0414610395578063d44e1b76146103ac57600080fd5b806350f73e7c1161010857806350f73e7c14610254578063595c6a67146102785780635ac86ab71461028d5780635c975abb146102cd578063715018a6146102e257806375608896146102f757600080fd5b806310d67a2f14610150578063136439dd146101725780631f39d87f146101925780633e1de008146101c85780634665bcda146101e85780634d50f9a414610234575b600080fd5b34801561015c57600080fd5b5061017061016b36600461196d565b6104b2565b005b34801561017e57600080fd5b5061017061018d366004611991565b61056e565b34801561019e57600080fd5b506101b26101ad36600461196d565b6106ad565b6040516101bf91906119c8565b60405180910390f35b3480156101d457600080fd5b506101b26101e336600461196d565b6108a8565b3480156101f457600080fd5b5061021c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101bf565b34801561024057600080fd5b5061017061024f366004611991565b6109ee565b34801561026057600080fd5b5061026a60c95481565b6040519081526020016101bf565b34801561028457600080fd5b506101706109ff565b34801561029957600080fd5b506102bd6102a8366004611a15565b609854600160ff9092169190911b9081161490565b60405190151581526020016101bf565b3480156102d957600080fd5b5060985461026a565b3480156102ee57600080fd5b50610170610ac6565b34801561030357600080fd5b506102bd610312366004611a38565b610ada565b34801561032357600080fd5b50610337610332366004611a38565b610b5d565b6040516101bf9190611a64565b34801561035057600080fd5b5060975461021c906001600160a01b031681565b34801561037057600080fd5b506033546001600160a01b031661021c565b610170610390366004611a72565b610bdd565b3480156103a157600080fd5b5061026a62034bc081565b3480156103b857600080fd5b506101706103c7366004611991565b610e9d565b3480156103d857600080fd5b5061026a6103e736600461196d565b6001600160a01b0316600090815260ca602052604090206001015490565b34801561041157600080fd5b50610170610420366004611a38565b610f31565b34801561043157600080fd5b50610170610440366004611aab565b610fc6565b34801561045157600080fd5b5061046561046036600461196d565b6110ee565b6040516101bf9190611af1565b34801561047e57600080fd5b5061017061048d36600461196d565b6111a8565b34801561049e57600080fd5b506101706104ad366004611991565b61121e565b609760009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610505573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105299190611b47565b6001600160a01b0316336001600160a01b0316146105625760405162461bcd60e51b815260040161055990611b64565b60405180910390fd5b61056b8161137a565b50565b60975460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156105b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105da9190611bae565b6105f65760405162461bcd60e51b815260040161055990611bd0565b6098548181161461066f5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610559565b609881905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b6001600160a01b038116600090815260ca6020526040812080546001909101546060926106da8383611c2e565b90508060005b82811015610786576001600160a01b038716600090815260ca6020526040812060010161070d8388611c45565b8154811061071d5761071d611c5d565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff1691810182905260c95490925061076391611c45565b4310156107735781925050610786565b508061077e81611c73565b9150506106e0565b508060008167ffffffffffffffff8111156107a3576107a3611c8e565b6040519080825280602002602001820160405280156107e857816020015b60408051808201909152600080825260208201528152602001906001900390816107c15790505b509050811561089d5760005b8281101561089b576001600160a01b038916600090815260ca602052604090206001016108218289611c45565b8154811061083157610831611c5d565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff1691810191909152825183908390811061087d5761087d611c5d565b6020026020010181905250808061089390611c73565b9150506107f4565b505b979650505050505050565b6001600160a01b038116600090815260ca6020526040812080546001909101546060926108d58383611c2e565b905060008167ffffffffffffffff8111156108f2576108f2611c8e565b60405190808252806020026020018201604052801561093757816020015b60408051808201909152600080825260208201528152602001906001900390816109105790505b50905060005b828110156109e4576001600160a01b038716600090815260ca6020526040902060010161096a8287611c45565b8154811061097a5761097a611c5d565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff169181019190915282518390839081106109c6576109c6611c5d565b602002602001018190525080806109dc90611c73565b91505061093d565b5095945050505050565b6109f6611471565b61056b816114cb565b60975460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190611bae565b610a875760405162461bcd60e51b815260040161055990611bd0565b600019609881905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b610ace611471565b610ad86000611593565b565b6001600160a01b038216600090815260ca60205260408120548210801590610b54575060c9546001600160a01b038416600090815260ca60205260409020600101805484908110610b2d57610b2d611c5d565b600091825260209091200154610b509190600160e01b900463ffffffff16611c45565b4310155b90505b92915050565b60408051808201909152600080825260208201526001600160a01b038316600090815260ca60205260409020600101805483908110610b9e57610b9e611c5d565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff16918101919091529392505050565b60405163a38406a360e01b81526001600160a01b038084166004830152839133917f0000000000000000000000000000000000000000000000000000000000000000169063a38406a390602401602060405180830381865afa158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611b47565b6001600160a01b031614610ce75760405162461bcd60e51b815260206004820152603d60248201527f44656c617965645769746864726177616c526f757465722e6f6e6c794569676560448201527f6e506f643a206e6f7420706f644f776e6572277320456967656e506f640000006064820152608401610559565b60985460009060019081161415610d105760405162461bcd60e51b815260040161055990611ca4565b6001600160a01b038316610da65760405162461bcd60e51b815260206004820152605160248201527f44656c617965645769746864726177616c526f757465722e637265617465446560448201527f6c617965645769746864726177616c3a20726563697069656e742063616e6e6f60648201527074206265207a65726f206164647265737360781b608482015260a401610559565b346001600160e01b03811615610e96576040805180820182526001600160e01b03808416825263ffffffff43811660208085019182526001600160a01b038a16600081815260ca8352968720600190810180548083018255818a5293892088519551909616600160e01b029490961693909317939091019290925593525490917fb8f1b14c7caf74150801dcc9bc18d575cbeaf5b421943497e409df92c92e0f5991889188918691610e5791611c2e565b604080516001600160a01b0395861681529490931660208501526001600160e01b039091169183019190915260608201526080015b60405180910390a1505b5050505050565b60026065541415610ef05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610559565b600260655560985460009060019081161415610f1e5760405162461bcd60e51b815260040161055990611ca4565b610f2833836115e5565b50506001606555565b60026065541415610f845760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610559565b600260655560985460009060019081161415610fb25760405162461bcd60e51b815260040161055990611ca4565b610fbc83836115e5565b5050600160655550565b600054610100900460ff1615808015610fe65750600054600160ff909116105b806110005750303b158015611000575060005460ff166001145b6110635760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610559565b6000805460ff191660011790558015611086576000805461ff0019166101001790555b61108f85611593565b6110998484611750565b6110a2826114cb565b8015610e96576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6040805180820190915260008152606060208201526001600160a01b038216600090815260ca6020908152604080832081518083018352815481526001820180548451818702810187019095528085529195929486810194939192919084015b8282101561119a57600084815260209081902060408051808201909152908401546001600160e01b0381168252600160e01b900463ffffffff168183015282526001909201910161114e565b505050915250909392505050565b6111b0611471565b6001600160a01b0381166112155760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610559565b61056b81611593565b609760009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611271573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112959190611b47565b6001600160a01b0316336001600160a01b0316146112c55760405162461bcd60e51b815260040161055990611b64565b6098541981196098541916146113435760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610559565b609881905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c906020016106a2565b6001600160a01b0381166114085760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610559565b609754604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1609780546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b03163314610ad85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610559565b62034bc08111156115525760405162461bcd60e51b815260206004820152604560248201527f44656c617965645769746864726177616c526f757465722e5f7365745769746860448201527f64726177616c44656c6179426c6f636b733a206e657756616c756520746f6f206064820152646c6172676560d81b608482015260a401610559565b60c95460408051918252602082018390527f4ffb00400574147429ee377a5633386321e66d45d8b14676014b5fa393e61e9e910160405180910390a160c955565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216600090815260ca602052604081208054600190910154825b848110801561161e57508161161c8285611c45565b105b156116cb576001600160a01b038616600090815260ca602052604081206001016116488386611c45565b8154811061165857611658611c5d565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff1691810182905260c95490925061169e91611c45565b4310156116ab57506116cb565b80516116c0906001600160e01b031686611c45565b945050600101611607565b6116d58184611c45565b6001600160a01b038716600090815260ca602052604090205583156116fe576116fe868561183a565b7f6b7151500bd0b5cc211bcc47b3029831b769004df4549e8e1c9a69da05bb0943868561172b8487611c45565b604080516001600160a01b039094168452602084019290925290820152606001610e8c565b6097546001600160a01b031615801561177157506001600160a01b03821615155b6117f35760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610559565b609881905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a26118368261137a565b5050565b8047101561188a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610559565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146118d7576040519150601f19603f3d011682016040523d82523d6000602084013e6118dc565b606091505b50509050806119535760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610559565b505050565b6001600160a01b038116811461056b57600080fd5b60006020828403121561197f57600080fd5b813561198a81611958565b9392505050565b6000602082840312156119a357600080fd5b5035919050565b80516001600160e01b0316825260209081015163ffffffff16910152565b602080825282518282018190526000919060409081850190868401855b82811015611a08576119f88483516119aa565b92840192908501906001016119e5565b5091979650505050505050565b600060208284031215611a2757600080fd5b813560ff8116811461198a57600080fd5b60008060408385031215611a4b57600080fd5b8235611a5681611958565b946020939093013593505050565b60408101610b5782846119aa565b60008060408385031215611a8557600080fd5b8235611a9081611958565b91506020830135611aa081611958565b809150509250929050565b60008060008060808587031215611ac157600080fd5b8435611acc81611958565b93506020850135611adc81611958565b93969395505050506040820135916060013590565b602080825282518282015282810151604080840181905281516060850181905260009392830191849160808701905b8084101561089b57611b338286516119aa565b938501936001939093019290820190611b20565b600060208284031215611b5957600080fd5b815161198a81611958565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b600060208284031215611bc057600080fd5b8151801515811461198a57600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600082821015611c4057611c40611c18565b500390565b60008219821115611c5857611c58611c18565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611c8757611c87611c18565b5060010190565b634e487b7160e01b600052604160045260246000fd5b60208082526019908201527f5061757361626c653a20696e646578206973207061757365640000000000000060408201526060019056fea264697066735822122005b0ecc66b0468e43c0d5b0ff9c7b1e449b7556e61ae26d108ff696ed83f730364736f6c634300080c0033", +} + +// DelayedWithdrawalRouterABI is the input ABI used to generate the binding from. +// Deprecated: Use DelayedWithdrawalRouterMetaData.ABI instead. +var DelayedWithdrawalRouterABI = DelayedWithdrawalRouterMetaData.ABI + +// DelayedWithdrawalRouterBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use DelayedWithdrawalRouterMetaData.Bin instead. +var DelayedWithdrawalRouterBin = DelayedWithdrawalRouterMetaData.Bin + +// DeployDelayedWithdrawalRouter deploys a new Ethereum contract, binding an instance of DelayedWithdrawalRouter to it. +func DeployDelayedWithdrawalRouter(auth *bind.TransactOpts, backend bind.ContractBackend, _eigenPodManager common.Address) (common.Address, *types.Transaction, *DelayedWithdrawalRouter, error) { + parsed, err := DelayedWithdrawalRouterMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DelayedWithdrawalRouterBin), backend, _eigenPodManager) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &DelayedWithdrawalRouter{DelayedWithdrawalRouterCaller: DelayedWithdrawalRouterCaller{contract: contract}, DelayedWithdrawalRouterTransactor: DelayedWithdrawalRouterTransactor{contract: contract}, DelayedWithdrawalRouterFilterer: DelayedWithdrawalRouterFilterer{contract: contract}}, nil +} + +// DelayedWithdrawalRouter is an auto generated Go binding around an Ethereum contract. +type DelayedWithdrawalRouter struct { + DelayedWithdrawalRouterCaller // Read-only binding to the contract + DelayedWithdrawalRouterTransactor // Write-only binding to the contract + DelayedWithdrawalRouterFilterer // Log filterer for contract events +} + +// DelayedWithdrawalRouterCaller is an auto generated read-only Go binding around an Ethereum contract. +type DelayedWithdrawalRouterCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DelayedWithdrawalRouterTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DelayedWithdrawalRouterTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DelayedWithdrawalRouterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DelayedWithdrawalRouterFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DelayedWithdrawalRouterSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DelayedWithdrawalRouterSession struct { + Contract *DelayedWithdrawalRouter // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DelayedWithdrawalRouterCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DelayedWithdrawalRouterCallerSession struct { + Contract *DelayedWithdrawalRouterCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DelayedWithdrawalRouterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DelayedWithdrawalRouterTransactorSession struct { + Contract *DelayedWithdrawalRouterTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DelayedWithdrawalRouterRaw is an auto generated low-level Go binding around an Ethereum contract. +type DelayedWithdrawalRouterRaw struct { + Contract *DelayedWithdrawalRouter // Generic contract binding to access the raw methods on +} + +// DelayedWithdrawalRouterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DelayedWithdrawalRouterCallerRaw struct { + Contract *DelayedWithdrawalRouterCaller // Generic read-only contract binding to access the raw methods on +} + +// DelayedWithdrawalRouterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DelayedWithdrawalRouterTransactorRaw struct { + Contract *DelayedWithdrawalRouterTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDelayedWithdrawalRouter creates a new instance of DelayedWithdrawalRouter, bound to a specific deployed contract. +func NewDelayedWithdrawalRouter(address common.Address, backend bind.ContractBackend) (*DelayedWithdrawalRouter, error) { + contract, err := bindDelayedWithdrawalRouter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouter{DelayedWithdrawalRouterCaller: DelayedWithdrawalRouterCaller{contract: contract}, DelayedWithdrawalRouterTransactor: DelayedWithdrawalRouterTransactor{contract: contract}, DelayedWithdrawalRouterFilterer: DelayedWithdrawalRouterFilterer{contract: contract}}, nil +} + +// NewDelayedWithdrawalRouterCaller creates a new read-only instance of DelayedWithdrawalRouter, bound to a specific deployed contract. +func NewDelayedWithdrawalRouterCaller(address common.Address, caller bind.ContractCaller) (*DelayedWithdrawalRouterCaller, error) { + contract, err := bindDelayedWithdrawalRouter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterCaller{contract: contract}, nil +} + +// NewDelayedWithdrawalRouterTransactor creates a new write-only instance of DelayedWithdrawalRouter, bound to a specific deployed contract. +func NewDelayedWithdrawalRouterTransactor(address common.Address, transactor bind.ContractTransactor) (*DelayedWithdrawalRouterTransactor, error) { + contract, err := bindDelayedWithdrawalRouter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterTransactor{contract: contract}, nil +} + +// NewDelayedWithdrawalRouterFilterer creates a new log filterer instance of DelayedWithdrawalRouter, bound to a specific deployed contract. +func NewDelayedWithdrawalRouterFilterer(address common.Address, filterer bind.ContractFilterer) (*DelayedWithdrawalRouterFilterer, error) { + contract, err := bindDelayedWithdrawalRouter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterFilterer{contract: contract}, nil +} + +// bindDelayedWithdrawalRouter binds a generic wrapper to an already deployed contract. +func bindDelayedWithdrawalRouter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := DelayedWithdrawalRouterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DelayedWithdrawalRouter.Contract.DelayedWithdrawalRouterCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.DelayedWithdrawalRouterTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.DelayedWithdrawalRouterTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DelayedWithdrawalRouter.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.contract.Transact(opts, method, params...) +} + +// MAXWITHDRAWALDELAYBLOCKS is a free data retrieval call binding the contract method 0xca661c04. +// +// Solidity: function MAX_WITHDRAWAL_DELAY_BLOCKS() view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) MAXWITHDRAWALDELAYBLOCKS(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "MAX_WITHDRAWAL_DELAY_BLOCKS") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MAXWITHDRAWALDELAYBLOCKS is a free data retrieval call binding the contract method 0xca661c04. +// +// Solidity: function MAX_WITHDRAWAL_DELAY_BLOCKS() view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) MAXWITHDRAWALDELAYBLOCKS() (*big.Int, error) { + return _DelayedWithdrawalRouter.Contract.MAXWITHDRAWALDELAYBLOCKS(&_DelayedWithdrawalRouter.CallOpts) +} + +// MAXWITHDRAWALDELAYBLOCKS is a free data retrieval call binding the contract method 0xca661c04. +// +// Solidity: function MAX_WITHDRAWAL_DELAY_BLOCKS() view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) MAXWITHDRAWALDELAYBLOCKS() (*big.Int, error) { + return _DelayedWithdrawalRouter.Contract.MAXWITHDRAWALDELAYBLOCKS(&_DelayedWithdrawalRouter.CallOpts) +} + +// CanClaimDelayedWithdrawal is a free data retrieval call binding the contract method 0x75608896. +// +// Solidity: function canClaimDelayedWithdrawal(address user, uint256 index) view returns(bool) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) CanClaimDelayedWithdrawal(opts *bind.CallOpts, user common.Address, index *big.Int) (bool, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "canClaimDelayedWithdrawal", user, index) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// CanClaimDelayedWithdrawal is a free data retrieval call binding the contract method 0x75608896. +// +// Solidity: function canClaimDelayedWithdrawal(address user, uint256 index) view returns(bool) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) CanClaimDelayedWithdrawal(user common.Address, index *big.Int) (bool, error) { + return _DelayedWithdrawalRouter.Contract.CanClaimDelayedWithdrawal(&_DelayedWithdrawalRouter.CallOpts, user, index) +} + +// CanClaimDelayedWithdrawal is a free data retrieval call binding the contract method 0x75608896. +// +// Solidity: function canClaimDelayedWithdrawal(address user, uint256 index) view returns(bool) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) CanClaimDelayedWithdrawal(user common.Address, index *big.Int) (bool, error) { + return _DelayedWithdrawalRouter.Contract.CanClaimDelayedWithdrawal(&_DelayedWithdrawalRouter.CallOpts, user, index) +} + +// EigenPodManager is a free data retrieval call binding the contract method 0x4665bcda. +// +// Solidity: function eigenPodManager() view returns(address) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) EigenPodManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "eigenPodManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// EigenPodManager is a free data retrieval call binding the contract method 0x4665bcda. +// +// Solidity: function eigenPodManager() view returns(address) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) EigenPodManager() (common.Address, error) { + return _DelayedWithdrawalRouter.Contract.EigenPodManager(&_DelayedWithdrawalRouter.CallOpts) +} + +// EigenPodManager is a free data retrieval call binding the contract method 0x4665bcda. +// +// Solidity: function eigenPodManager() view returns(address) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) EigenPodManager() (common.Address, error) { + return _DelayedWithdrawalRouter.Contract.EigenPodManager(&_DelayedWithdrawalRouter.CallOpts) +} + +// GetClaimableUserDelayedWithdrawals is a free data retrieval call binding the contract method 0x1f39d87f. +// +// Solidity: function getClaimableUserDelayedWithdrawals(address user) view returns((uint224,uint32)[]) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) GetClaimableUserDelayedWithdrawals(opts *bind.CallOpts, user common.Address) ([]IDelayedWithdrawalRouterDelayedWithdrawal, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "getClaimableUserDelayedWithdrawals", user) + + if err != nil { + return *new([]IDelayedWithdrawalRouterDelayedWithdrawal), err + } + + out0 := *abi.ConvertType(out[0], new([]IDelayedWithdrawalRouterDelayedWithdrawal)).(*[]IDelayedWithdrawalRouterDelayedWithdrawal) + + return out0, err + +} + +// GetClaimableUserDelayedWithdrawals is a free data retrieval call binding the contract method 0x1f39d87f. +// +// Solidity: function getClaimableUserDelayedWithdrawals(address user) view returns((uint224,uint32)[]) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) GetClaimableUserDelayedWithdrawals(user common.Address) ([]IDelayedWithdrawalRouterDelayedWithdrawal, error) { + return _DelayedWithdrawalRouter.Contract.GetClaimableUserDelayedWithdrawals(&_DelayedWithdrawalRouter.CallOpts, user) +} + +// GetClaimableUserDelayedWithdrawals is a free data retrieval call binding the contract method 0x1f39d87f. +// +// Solidity: function getClaimableUserDelayedWithdrawals(address user) view returns((uint224,uint32)[]) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) GetClaimableUserDelayedWithdrawals(user common.Address) ([]IDelayedWithdrawalRouterDelayedWithdrawal, error) { + return _DelayedWithdrawalRouter.Contract.GetClaimableUserDelayedWithdrawals(&_DelayedWithdrawalRouter.CallOpts, user) +} + +// GetUserDelayedWithdrawals is a free data retrieval call binding the contract method 0x3e1de008. +// +// Solidity: function getUserDelayedWithdrawals(address user) view returns((uint224,uint32)[]) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) GetUserDelayedWithdrawals(opts *bind.CallOpts, user common.Address) ([]IDelayedWithdrawalRouterDelayedWithdrawal, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "getUserDelayedWithdrawals", user) + + if err != nil { + return *new([]IDelayedWithdrawalRouterDelayedWithdrawal), err + } + + out0 := *abi.ConvertType(out[0], new([]IDelayedWithdrawalRouterDelayedWithdrawal)).(*[]IDelayedWithdrawalRouterDelayedWithdrawal) + + return out0, err + +} + +// GetUserDelayedWithdrawals is a free data retrieval call binding the contract method 0x3e1de008. +// +// Solidity: function getUserDelayedWithdrawals(address user) view returns((uint224,uint32)[]) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) GetUserDelayedWithdrawals(user common.Address) ([]IDelayedWithdrawalRouterDelayedWithdrawal, error) { + return _DelayedWithdrawalRouter.Contract.GetUserDelayedWithdrawals(&_DelayedWithdrawalRouter.CallOpts, user) +} + +// GetUserDelayedWithdrawals is a free data retrieval call binding the contract method 0x3e1de008. +// +// Solidity: function getUserDelayedWithdrawals(address user) view returns((uint224,uint32)[]) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) GetUserDelayedWithdrawals(user common.Address) ([]IDelayedWithdrawalRouterDelayedWithdrawal, error) { + return _DelayedWithdrawalRouter.Contract.GetUserDelayedWithdrawals(&_DelayedWithdrawalRouter.CallOpts, user) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) Owner() (common.Address, error) { + return _DelayedWithdrawalRouter.Contract.Owner(&_DelayedWithdrawalRouter.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) Owner() (common.Address, error) { + return _DelayedWithdrawalRouter.Contract.Owner(&_DelayedWithdrawalRouter.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// +// Solidity: function paused(uint8 index) view returns(bool) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) Paused(opts *bind.CallOpts, index uint8) (bool, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "paused", index) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// +// Solidity: function paused(uint8 index) view returns(bool) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) Paused(index uint8) (bool, error) { + return _DelayedWithdrawalRouter.Contract.Paused(&_DelayedWithdrawalRouter.CallOpts, index) +} + +// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// +// Solidity: function paused(uint8 index) view returns(bool) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) Paused(index uint8) (bool, error) { + return _DelayedWithdrawalRouter.Contract.Paused(&_DelayedWithdrawalRouter.CallOpts, index) +} + +// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) Paused0(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "paused0") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) Paused0() (*big.Int, error) { + return _DelayedWithdrawalRouter.Contract.Paused0(&_DelayedWithdrawalRouter.CallOpts) +} + +// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) Paused0() (*big.Int, error) { + return _DelayedWithdrawalRouter.Contract.Paused0(&_DelayedWithdrawalRouter.CallOpts) +} + +// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// +// Solidity: function pauserRegistry() view returns(address) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) PauserRegistry(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "pauserRegistry") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// +// Solidity: function pauserRegistry() view returns(address) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) PauserRegistry() (common.Address, error) { + return _DelayedWithdrawalRouter.Contract.PauserRegistry(&_DelayedWithdrawalRouter.CallOpts) +} + +// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// +// Solidity: function pauserRegistry() view returns(address) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) PauserRegistry() (common.Address, error) { + return _DelayedWithdrawalRouter.Contract.PauserRegistry(&_DelayedWithdrawalRouter.CallOpts) +} + +// UserDelayedWithdrawalByIndex is a free data retrieval call binding the contract method 0x85594e58. +// +// Solidity: function userDelayedWithdrawalByIndex(address user, uint256 index) view returns((uint224,uint32)) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) UserDelayedWithdrawalByIndex(opts *bind.CallOpts, user common.Address, index *big.Int) (IDelayedWithdrawalRouterDelayedWithdrawal, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "userDelayedWithdrawalByIndex", user, index) + + if err != nil { + return *new(IDelayedWithdrawalRouterDelayedWithdrawal), err + } + + out0 := *abi.ConvertType(out[0], new(IDelayedWithdrawalRouterDelayedWithdrawal)).(*IDelayedWithdrawalRouterDelayedWithdrawal) + + return out0, err + +} + +// UserDelayedWithdrawalByIndex is a free data retrieval call binding the contract method 0x85594e58. +// +// Solidity: function userDelayedWithdrawalByIndex(address user, uint256 index) view returns((uint224,uint32)) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) UserDelayedWithdrawalByIndex(user common.Address, index *big.Int) (IDelayedWithdrawalRouterDelayedWithdrawal, error) { + return _DelayedWithdrawalRouter.Contract.UserDelayedWithdrawalByIndex(&_DelayedWithdrawalRouter.CallOpts, user, index) +} + +// UserDelayedWithdrawalByIndex is a free data retrieval call binding the contract method 0x85594e58. +// +// Solidity: function userDelayedWithdrawalByIndex(address user, uint256 index) view returns((uint224,uint32)) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) UserDelayedWithdrawalByIndex(user common.Address, index *big.Int) (IDelayedWithdrawalRouterDelayedWithdrawal, error) { + return _DelayedWithdrawalRouter.Contract.UserDelayedWithdrawalByIndex(&_DelayedWithdrawalRouter.CallOpts, user, index) +} + +// UserWithdrawals is a free data retrieval call binding the contract method 0xecb7cb1b. +// +// Solidity: function userWithdrawals(address user) view returns((uint256,(uint224,uint32)[])) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) UserWithdrawals(opts *bind.CallOpts, user common.Address) (IDelayedWithdrawalRouterUserDelayedWithdrawals, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "userWithdrawals", user) + + if err != nil { + return *new(IDelayedWithdrawalRouterUserDelayedWithdrawals), err + } + + out0 := *abi.ConvertType(out[0], new(IDelayedWithdrawalRouterUserDelayedWithdrawals)).(*IDelayedWithdrawalRouterUserDelayedWithdrawals) + + return out0, err + +} + +// UserWithdrawals is a free data retrieval call binding the contract method 0xecb7cb1b. +// +// Solidity: function userWithdrawals(address user) view returns((uint256,(uint224,uint32)[])) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) UserWithdrawals(user common.Address) (IDelayedWithdrawalRouterUserDelayedWithdrawals, error) { + return _DelayedWithdrawalRouter.Contract.UserWithdrawals(&_DelayedWithdrawalRouter.CallOpts, user) +} + +// UserWithdrawals is a free data retrieval call binding the contract method 0xecb7cb1b. +// +// Solidity: function userWithdrawals(address user) view returns((uint256,(uint224,uint32)[])) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) UserWithdrawals(user common.Address) (IDelayedWithdrawalRouterUserDelayedWithdrawals, error) { + return _DelayedWithdrawalRouter.Contract.UserWithdrawals(&_DelayedWithdrawalRouter.CallOpts, user) +} + +// UserWithdrawalsLength is a free data retrieval call binding the contract method 0xe4f4f887. +// +// Solidity: function userWithdrawalsLength(address user) view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) UserWithdrawalsLength(opts *bind.CallOpts, user common.Address) (*big.Int, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "userWithdrawalsLength", user) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// UserWithdrawalsLength is a free data retrieval call binding the contract method 0xe4f4f887. +// +// Solidity: function userWithdrawalsLength(address user) view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) UserWithdrawalsLength(user common.Address) (*big.Int, error) { + return _DelayedWithdrawalRouter.Contract.UserWithdrawalsLength(&_DelayedWithdrawalRouter.CallOpts, user) +} + +// UserWithdrawalsLength is a free data retrieval call binding the contract method 0xe4f4f887. +// +// Solidity: function userWithdrawalsLength(address user) view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) UserWithdrawalsLength(user common.Address) (*big.Int, error) { + return _DelayedWithdrawalRouter.Contract.UserWithdrawalsLength(&_DelayedWithdrawalRouter.CallOpts, user) +} + +// WithdrawalDelayBlocks is a free data retrieval call binding the contract method 0x50f73e7c. +// +// Solidity: function withdrawalDelayBlocks() view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCaller) WithdrawalDelayBlocks(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DelayedWithdrawalRouter.contract.Call(opts, &out, "withdrawalDelayBlocks") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// WithdrawalDelayBlocks is a free data retrieval call binding the contract method 0x50f73e7c. +// +// Solidity: function withdrawalDelayBlocks() view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) WithdrawalDelayBlocks() (*big.Int, error) { + return _DelayedWithdrawalRouter.Contract.WithdrawalDelayBlocks(&_DelayedWithdrawalRouter.CallOpts) +} + +// WithdrawalDelayBlocks is a free data retrieval call binding the contract method 0x50f73e7c. +// +// Solidity: function withdrawalDelayBlocks() view returns(uint256) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterCallerSession) WithdrawalDelayBlocks() (*big.Int, error) { + return _DelayedWithdrawalRouter.Contract.WithdrawalDelayBlocks(&_DelayedWithdrawalRouter.CallOpts) +} + +// ClaimDelayedWithdrawals is a paid mutator transaction binding the contract method 0xd44e1b76. +// +// Solidity: function claimDelayedWithdrawals(uint256 maxNumberOfDelayedWithdrawalsToClaim) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) ClaimDelayedWithdrawals(opts *bind.TransactOpts, maxNumberOfDelayedWithdrawalsToClaim *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "claimDelayedWithdrawals", maxNumberOfDelayedWithdrawalsToClaim) +} + +// ClaimDelayedWithdrawals is a paid mutator transaction binding the contract method 0xd44e1b76. +// +// Solidity: function claimDelayedWithdrawals(uint256 maxNumberOfDelayedWithdrawalsToClaim) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) ClaimDelayedWithdrawals(maxNumberOfDelayedWithdrawalsToClaim *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.ClaimDelayedWithdrawals(&_DelayedWithdrawalRouter.TransactOpts, maxNumberOfDelayedWithdrawalsToClaim) +} + +// ClaimDelayedWithdrawals is a paid mutator transaction binding the contract method 0xd44e1b76. +// +// Solidity: function claimDelayedWithdrawals(uint256 maxNumberOfDelayedWithdrawalsToClaim) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) ClaimDelayedWithdrawals(maxNumberOfDelayedWithdrawalsToClaim *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.ClaimDelayedWithdrawals(&_DelayedWithdrawalRouter.TransactOpts, maxNumberOfDelayedWithdrawalsToClaim) +} + +// ClaimDelayedWithdrawals0 is a paid mutator transaction binding the contract method 0xe5db06c0. +// +// Solidity: function claimDelayedWithdrawals(address recipient, uint256 maxNumberOfDelayedWithdrawalsToClaim) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) ClaimDelayedWithdrawals0(opts *bind.TransactOpts, recipient common.Address, maxNumberOfDelayedWithdrawalsToClaim *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "claimDelayedWithdrawals0", recipient, maxNumberOfDelayedWithdrawalsToClaim) +} + +// ClaimDelayedWithdrawals0 is a paid mutator transaction binding the contract method 0xe5db06c0. +// +// Solidity: function claimDelayedWithdrawals(address recipient, uint256 maxNumberOfDelayedWithdrawalsToClaim) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) ClaimDelayedWithdrawals0(recipient common.Address, maxNumberOfDelayedWithdrawalsToClaim *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.ClaimDelayedWithdrawals0(&_DelayedWithdrawalRouter.TransactOpts, recipient, maxNumberOfDelayedWithdrawalsToClaim) +} + +// ClaimDelayedWithdrawals0 is a paid mutator transaction binding the contract method 0xe5db06c0. +// +// Solidity: function claimDelayedWithdrawals(address recipient, uint256 maxNumberOfDelayedWithdrawalsToClaim) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) ClaimDelayedWithdrawals0(recipient common.Address, maxNumberOfDelayedWithdrawalsToClaim *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.ClaimDelayedWithdrawals0(&_DelayedWithdrawalRouter.TransactOpts, recipient, maxNumberOfDelayedWithdrawalsToClaim) +} + +// CreateDelayedWithdrawal is a paid mutator transaction binding the contract method 0xc0db354c. +// +// Solidity: function createDelayedWithdrawal(address podOwner, address recipient) payable returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) CreateDelayedWithdrawal(opts *bind.TransactOpts, podOwner common.Address, recipient common.Address) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "createDelayedWithdrawal", podOwner, recipient) +} + +// CreateDelayedWithdrawal is a paid mutator transaction binding the contract method 0xc0db354c. +// +// Solidity: function createDelayedWithdrawal(address podOwner, address recipient) payable returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) CreateDelayedWithdrawal(podOwner common.Address, recipient common.Address) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.CreateDelayedWithdrawal(&_DelayedWithdrawalRouter.TransactOpts, podOwner, recipient) +} + +// CreateDelayedWithdrawal is a paid mutator transaction binding the contract method 0xc0db354c. +// +// Solidity: function createDelayedWithdrawal(address podOwner, address recipient) payable returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) CreateDelayedWithdrawal(podOwner common.Address, recipient common.Address) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.CreateDelayedWithdrawal(&_DelayedWithdrawalRouter.TransactOpts, podOwner, recipient) +} + +// Initialize is a paid mutator transaction binding the contract method 0xeb990c59. +// +// Solidity: function initialize(address initOwner, address _pauserRegistry, uint256 initPausedStatus, uint256 _withdrawalDelayBlocks) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) Initialize(opts *bind.TransactOpts, initOwner common.Address, _pauserRegistry common.Address, initPausedStatus *big.Int, _withdrawalDelayBlocks *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "initialize", initOwner, _pauserRegistry, initPausedStatus, _withdrawalDelayBlocks) +} + +// Initialize is a paid mutator transaction binding the contract method 0xeb990c59. +// +// Solidity: function initialize(address initOwner, address _pauserRegistry, uint256 initPausedStatus, uint256 _withdrawalDelayBlocks) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) Initialize(initOwner common.Address, _pauserRegistry common.Address, initPausedStatus *big.Int, _withdrawalDelayBlocks *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.Initialize(&_DelayedWithdrawalRouter.TransactOpts, initOwner, _pauserRegistry, initPausedStatus, _withdrawalDelayBlocks) +} + +// Initialize is a paid mutator transaction binding the contract method 0xeb990c59. +// +// Solidity: function initialize(address initOwner, address _pauserRegistry, uint256 initPausedStatus, uint256 _withdrawalDelayBlocks) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) Initialize(initOwner common.Address, _pauserRegistry common.Address, initPausedStatus *big.Int, _withdrawalDelayBlocks *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.Initialize(&_DelayedWithdrawalRouter.TransactOpts, initOwner, _pauserRegistry, initPausedStatus, _withdrawalDelayBlocks) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 newPausedStatus) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) Pause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "pause", newPausedStatus) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 newPausedStatus) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.Pause(&_DelayedWithdrawalRouter.TransactOpts, newPausedStatus) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 newPausedStatus) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.Pause(&_DelayedWithdrawalRouter.TransactOpts, newPausedStatus) +} + +// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// +// Solidity: function pauseAll() returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) PauseAll(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "pauseAll") +} + +// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// +// Solidity: function pauseAll() returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) PauseAll() (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.PauseAll(&_DelayedWithdrawalRouter.TransactOpts) +} + +// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// +// Solidity: function pauseAll() returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) PauseAll() (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.PauseAll(&_DelayedWithdrawalRouter.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) RenounceOwnership() (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.RenounceOwnership(&_DelayedWithdrawalRouter.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.RenounceOwnership(&_DelayedWithdrawalRouter.TransactOpts) +} + +// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. +// +// Solidity: function setPauserRegistry(address newPauserRegistry) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) SetPauserRegistry(opts *bind.TransactOpts, newPauserRegistry common.Address) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "setPauserRegistry", newPauserRegistry) +} + +// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. +// +// Solidity: function setPauserRegistry(address newPauserRegistry) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.SetPauserRegistry(&_DelayedWithdrawalRouter.TransactOpts, newPauserRegistry) +} + +// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. +// +// Solidity: function setPauserRegistry(address newPauserRegistry) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.SetPauserRegistry(&_DelayedWithdrawalRouter.TransactOpts, newPauserRegistry) +} + +// SetWithdrawalDelayBlocks is a paid mutator transaction binding the contract method 0x4d50f9a4. +// +// Solidity: function setWithdrawalDelayBlocks(uint256 newValue) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) SetWithdrawalDelayBlocks(opts *bind.TransactOpts, newValue *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "setWithdrawalDelayBlocks", newValue) +} + +// SetWithdrawalDelayBlocks is a paid mutator transaction binding the contract method 0x4d50f9a4. +// +// Solidity: function setWithdrawalDelayBlocks(uint256 newValue) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) SetWithdrawalDelayBlocks(newValue *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.SetWithdrawalDelayBlocks(&_DelayedWithdrawalRouter.TransactOpts, newValue) +} + +// SetWithdrawalDelayBlocks is a paid mutator transaction binding the contract method 0x4d50f9a4. +// +// Solidity: function setWithdrawalDelayBlocks(uint256 newValue) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) SetWithdrawalDelayBlocks(newValue *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.SetWithdrawalDelayBlocks(&_DelayedWithdrawalRouter.TransactOpts, newValue) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.TransferOwnership(&_DelayedWithdrawalRouter.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.TransferOwnership(&_DelayedWithdrawalRouter.TransactOpts, newOwner) +} + +// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// +// Solidity: function unpause(uint256 newPausedStatus) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactor) Unpause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.contract.Transact(opts, "unpause", newPausedStatus) +} + +// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// +// Solidity: function unpause(uint256 newPausedStatus) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterSession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.Unpause(&_DelayedWithdrawalRouter.TransactOpts, newPausedStatus) +} + +// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// +// Solidity: function unpause(uint256 newPausedStatus) returns() +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterTransactorSession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _DelayedWithdrawalRouter.Contract.Unpause(&_DelayedWithdrawalRouter.TransactOpts, newPausedStatus) +} + +// DelayedWithdrawalRouterDelayedWithdrawalCreatedIterator is returned from FilterDelayedWithdrawalCreated and is used to iterate over the raw logs and unpacked data for DelayedWithdrawalCreated events raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterDelayedWithdrawalCreatedIterator struct { + Event *DelayedWithdrawalRouterDelayedWithdrawalCreated // 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 *DelayedWithdrawalRouterDelayedWithdrawalCreatedIterator) 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(DelayedWithdrawalRouterDelayedWithdrawalCreated) + 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(DelayedWithdrawalRouterDelayedWithdrawalCreated) + 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 *DelayedWithdrawalRouterDelayedWithdrawalCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWithdrawalRouterDelayedWithdrawalCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWithdrawalRouterDelayedWithdrawalCreated represents a DelayedWithdrawalCreated event raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterDelayedWithdrawalCreated struct { + PodOwner common.Address + Recipient common.Address + Amount *big.Int + Index *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelayedWithdrawalCreated is a free log retrieval operation binding the contract event 0xb8f1b14c7caf74150801dcc9bc18d575cbeaf5b421943497e409df92c92e0f59. +// +// Solidity: event DelayedWithdrawalCreated(address podOwner, address recipient, uint256 amount, uint256 index) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) FilterDelayedWithdrawalCreated(opts *bind.FilterOpts) (*DelayedWithdrawalRouterDelayedWithdrawalCreatedIterator, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.FilterLogs(opts, "DelayedWithdrawalCreated") + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterDelayedWithdrawalCreatedIterator{contract: _DelayedWithdrawalRouter.contract, event: "DelayedWithdrawalCreated", logs: logs, sub: sub}, nil +} + +// WatchDelayedWithdrawalCreated is a free log subscription operation binding the contract event 0xb8f1b14c7caf74150801dcc9bc18d575cbeaf5b421943497e409df92c92e0f59. +// +// Solidity: event DelayedWithdrawalCreated(address podOwner, address recipient, uint256 amount, uint256 index) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) WatchDelayedWithdrawalCreated(opts *bind.WatchOpts, sink chan<- *DelayedWithdrawalRouterDelayedWithdrawalCreated) (event.Subscription, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.WatchLogs(opts, "DelayedWithdrawalCreated") + 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(DelayedWithdrawalRouterDelayedWithdrawalCreated) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "DelayedWithdrawalCreated", 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 +} + +// ParseDelayedWithdrawalCreated is a log parse operation binding the contract event 0xb8f1b14c7caf74150801dcc9bc18d575cbeaf5b421943497e409df92c92e0f59. +// +// Solidity: event DelayedWithdrawalCreated(address podOwner, address recipient, uint256 amount, uint256 index) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) ParseDelayedWithdrawalCreated(log types.Log) (*DelayedWithdrawalRouterDelayedWithdrawalCreated, error) { + event := new(DelayedWithdrawalRouterDelayedWithdrawalCreated) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "DelayedWithdrawalCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWithdrawalRouterDelayedWithdrawalsClaimedIterator is returned from FilterDelayedWithdrawalsClaimed and is used to iterate over the raw logs and unpacked data for DelayedWithdrawalsClaimed events raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterDelayedWithdrawalsClaimedIterator struct { + Event *DelayedWithdrawalRouterDelayedWithdrawalsClaimed // 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 *DelayedWithdrawalRouterDelayedWithdrawalsClaimedIterator) 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(DelayedWithdrawalRouterDelayedWithdrawalsClaimed) + 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(DelayedWithdrawalRouterDelayedWithdrawalsClaimed) + 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 *DelayedWithdrawalRouterDelayedWithdrawalsClaimedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWithdrawalRouterDelayedWithdrawalsClaimedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWithdrawalRouterDelayedWithdrawalsClaimed represents a DelayedWithdrawalsClaimed event raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterDelayedWithdrawalsClaimed struct { + Recipient common.Address + AmountClaimed *big.Int + DelayedWithdrawalsCompleted *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelayedWithdrawalsClaimed is a free log retrieval operation binding the contract event 0x6b7151500bd0b5cc211bcc47b3029831b769004df4549e8e1c9a69da05bb0943. +// +// Solidity: event DelayedWithdrawalsClaimed(address recipient, uint256 amountClaimed, uint256 delayedWithdrawalsCompleted) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) FilterDelayedWithdrawalsClaimed(opts *bind.FilterOpts) (*DelayedWithdrawalRouterDelayedWithdrawalsClaimedIterator, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.FilterLogs(opts, "DelayedWithdrawalsClaimed") + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterDelayedWithdrawalsClaimedIterator{contract: _DelayedWithdrawalRouter.contract, event: "DelayedWithdrawalsClaimed", logs: logs, sub: sub}, nil +} + +// WatchDelayedWithdrawalsClaimed is a free log subscription operation binding the contract event 0x6b7151500bd0b5cc211bcc47b3029831b769004df4549e8e1c9a69da05bb0943. +// +// Solidity: event DelayedWithdrawalsClaimed(address recipient, uint256 amountClaimed, uint256 delayedWithdrawalsCompleted) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) WatchDelayedWithdrawalsClaimed(opts *bind.WatchOpts, sink chan<- *DelayedWithdrawalRouterDelayedWithdrawalsClaimed) (event.Subscription, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.WatchLogs(opts, "DelayedWithdrawalsClaimed") + 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(DelayedWithdrawalRouterDelayedWithdrawalsClaimed) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "DelayedWithdrawalsClaimed", 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 +} + +// ParseDelayedWithdrawalsClaimed is a log parse operation binding the contract event 0x6b7151500bd0b5cc211bcc47b3029831b769004df4549e8e1c9a69da05bb0943. +// +// Solidity: event DelayedWithdrawalsClaimed(address recipient, uint256 amountClaimed, uint256 delayedWithdrawalsCompleted) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) ParseDelayedWithdrawalsClaimed(log types.Log) (*DelayedWithdrawalRouterDelayedWithdrawalsClaimed, error) { + event := new(DelayedWithdrawalRouterDelayedWithdrawalsClaimed) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "DelayedWithdrawalsClaimed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWithdrawalRouterInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterInitializedIterator struct { + Event *DelayedWithdrawalRouterInitialized // 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 *DelayedWithdrawalRouterInitializedIterator) 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(DelayedWithdrawalRouterInitialized) + 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(DelayedWithdrawalRouterInitialized) + 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 *DelayedWithdrawalRouterInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWithdrawalRouterInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWithdrawalRouterInitialized represents a Initialized event raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) FilterInitialized(opts *bind.FilterOpts) (*DelayedWithdrawalRouterInitializedIterator, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterInitializedIterator{contract: _DelayedWithdrawalRouter.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *DelayedWithdrawalRouterInitialized) (event.Subscription, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.WatchLogs(opts, "Initialized") + 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(DelayedWithdrawalRouterInitialized) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "Initialized", 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 +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) ParseInitialized(log types.Log) (*DelayedWithdrawalRouterInitialized, error) { + event := new(DelayedWithdrawalRouterInitialized) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWithdrawalRouterOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterOwnershipTransferredIterator struct { + Event *DelayedWithdrawalRouterOwnershipTransferred // 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 *DelayedWithdrawalRouterOwnershipTransferredIterator) 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(DelayedWithdrawalRouterOwnershipTransferred) + 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(DelayedWithdrawalRouterOwnershipTransferred) + 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 *DelayedWithdrawalRouterOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWithdrawalRouterOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWithdrawalRouterOwnershipTransferred represents a OwnershipTransferred event raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*DelayedWithdrawalRouterOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _DelayedWithdrawalRouter.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterOwnershipTransferredIterator{contract: _DelayedWithdrawalRouter.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DelayedWithdrawalRouterOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _DelayedWithdrawalRouter.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + 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(DelayedWithdrawalRouterOwnershipTransferred) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "OwnershipTransferred", 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 +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) ParseOwnershipTransferred(log types.Log) (*DelayedWithdrawalRouterOwnershipTransferred, error) { + event := new(DelayedWithdrawalRouterOwnershipTransferred) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWithdrawalRouterPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterPausedIterator struct { + Event *DelayedWithdrawalRouterPaused // 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 *DelayedWithdrawalRouterPausedIterator) 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(DelayedWithdrawalRouterPaused) + 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(DelayedWithdrawalRouterPaused) + 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 *DelayedWithdrawalRouterPausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWithdrawalRouterPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWithdrawalRouterPaused represents a Paused event raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterPaused struct { + Account common.Address + NewPausedStatus *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPaused is a free log retrieval operation binding the contract event 0xab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d. +// +// Solidity: event Paused(address indexed account, uint256 newPausedStatus) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) FilterPaused(opts *bind.FilterOpts, account []common.Address) (*DelayedWithdrawalRouterPausedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _DelayedWithdrawalRouter.contract.FilterLogs(opts, "Paused", accountRule) + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterPausedIterator{contract: _DelayedWithdrawalRouter.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +// WatchPaused is a free log subscription operation binding the contract event 0xab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d. +// +// Solidity: event Paused(address indexed account, uint256 newPausedStatus) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *DelayedWithdrawalRouterPaused, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _DelayedWithdrawalRouter.contract.WatchLogs(opts, "Paused", accountRule) + 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(DelayedWithdrawalRouterPaused) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "Paused", 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 +} + +// ParsePaused is a log parse operation binding the contract event 0xab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d. +// +// Solidity: event Paused(address indexed account, uint256 newPausedStatus) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) ParsePaused(log types.Log) (*DelayedWithdrawalRouterPaused, error) { + event := new(DelayedWithdrawalRouterPaused) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWithdrawalRouterPauserRegistrySetIterator is returned from FilterPauserRegistrySet and is used to iterate over the raw logs and unpacked data for PauserRegistrySet events raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterPauserRegistrySetIterator struct { + Event *DelayedWithdrawalRouterPauserRegistrySet // 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 *DelayedWithdrawalRouterPauserRegistrySetIterator) 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(DelayedWithdrawalRouterPauserRegistrySet) + 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(DelayedWithdrawalRouterPauserRegistrySet) + 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 *DelayedWithdrawalRouterPauserRegistrySetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWithdrawalRouterPauserRegistrySetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWithdrawalRouterPauserRegistrySet represents a PauserRegistrySet event raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterPauserRegistrySet struct { + PauserRegistry common.Address + NewPauserRegistry common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPauserRegistrySet is a free log retrieval operation binding the contract event 0x6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6. +// +// Solidity: event PauserRegistrySet(address pauserRegistry, address newPauserRegistry) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) FilterPauserRegistrySet(opts *bind.FilterOpts) (*DelayedWithdrawalRouterPauserRegistrySetIterator, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.FilterLogs(opts, "PauserRegistrySet") + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterPauserRegistrySetIterator{contract: _DelayedWithdrawalRouter.contract, event: "PauserRegistrySet", logs: logs, sub: sub}, nil +} + +// WatchPauserRegistrySet is a free log subscription operation binding the contract event 0x6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6. +// +// Solidity: event PauserRegistrySet(address pauserRegistry, address newPauserRegistry) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) WatchPauserRegistrySet(opts *bind.WatchOpts, sink chan<- *DelayedWithdrawalRouterPauserRegistrySet) (event.Subscription, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.WatchLogs(opts, "PauserRegistrySet") + 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(DelayedWithdrawalRouterPauserRegistrySet) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "PauserRegistrySet", 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 +} + +// ParsePauserRegistrySet is a log parse operation binding the contract event 0x6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6. +// +// Solidity: event PauserRegistrySet(address pauserRegistry, address newPauserRegistry) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) ParsePauserRegistrySet(log types.Log) (*DelayedWithdrawalRouterPauserRegistrySet, error) { + event := new(DelayedWithdrawalRouterPauserRegistrySet) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "PauserRegistrySet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWithdrawalRouterUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterUnpausedIterator struct { + Event *DelayedWithdrawalRouterUnpaused // 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 *DelayedWithdrawalRouterUnpausedIterator) 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(DelayedWithdrawalRouterUnpaused) + 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(DelayedWithdrawalRouterUnpaused) + 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 *DelayedWithdrawalRouterUnpausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWithdrawalRouterUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWithdrawalRouterUnpaused represents a Unpaused event raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterUnpaused struct { + Account common.Address + NewPausedStatus *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnpaused is a free log retrieval operation binding the contract event 0x3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c. +// +// Solidity: event Unpaused(address indexed account, uint256 newPausedStatus) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) FilterUnpaused(opts *bind.FilterOpts, account []common.Address) (*DelayedWithdrawalRouterUnpausedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _DelayedWithdrawalRouter.contract.FilterLogs(opts, "Unpaused", accountRule) + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterUnpausedIterator{contract: _DelayedWithdrawalRouter.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +// WatchUnpaused is a free log subscription operation binding the contract event 0x3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c. +// +// Solidity: event Unpaused(address indexed account, uint256 newPausedStatus) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *DelayedWithdrawalRouterUnpaused, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _DelayedWithdrawalRouter.contract.WatchLogs(opts, "Unpaused", accountRule) + 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(DelayedWithdrawalRouterUnpaused) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "Unpaused", 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 +} + +// ParseUnpaused is a log parse operation binding the contract event 0x3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c. +// +// Solidity: event Unpaused(address indexed account, uint256 newPausedStatus) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) ParseUnpaused(log types.Log) (*DelayedWithdrawalRouterUnpaused, error) { + event := new(DelayedWithdrawalRouterUnpaused) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DelayedWithdrawalRouterWithdrawalDelayBlocksSetIterator is returned from FilterWithdrawalDelayBlocksSet and is used to iterate over the raw logs and unpacked data for WithdrawalDelayBlocksSet events raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterWithdrawalDelayBlocksSetIterator struct { + Event *DelayedWithdrawalRouterWithdrawalDelayBlocksSet // 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 *DelayedWithdrawalRouterWithdrawalDelayBlocksSetIterator) 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(DelayedWithdrawalRouterWithdrawalDelayBlocksSet) + 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(DelayedWithdrawalRouterWithdrawalDelayBlocksSet) + 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 *DelayedWithdrawalRouterWithdrawalDelayBlocksSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelayedWithdrawalRouterWithdrawalDelayBlocksSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelayedWithdrawalRouterWithdrawalDelayBlocksSet represents a WithdrawalDelayBlocksSet event raised by the DelayedWithdrawalRouter contract. +type DelayedWithdrawalRouterWithdrawalDelayBlocksSet struct { + PreviousValue *big.Int + NewValue *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawalDelayBlocksSet is a free log retrieval operation binding the contract event 0x4ffb00400574147429ee377a5633386321e66d45d8b14676014b5fa393e61e9e. +// +// Solidity: event WithdrawalDelayBlocksSet(uint256 previousValue, uint256 newValue) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) FilterWithdrawalDelayBlocksSet(opts *bind.FilterOpts) (*DelayedWithdrawalRouterWithdrawalDelayBlocksSetIterator, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.FilterLogs(opts, "WithdrawalDelayBlocksSet") + if err != nil { + return nil, err + } + return &DelayedWithdrawalRouterWithdrawalDelayBlocksSetIterator{contract: _DelayedWithdrawalRouter.contract, event: "WithdrawalDelayBlocksSet", logs: logs, sub: sub}, nil +} + +// WatchWithdrawalDelayBlocksSet is a free log subscription operation binding the contract event 0x4ffb00400574147429ee377a5633386321e66d45d8b14676014b5fa393e61e9e. +// +// Solidity: event WithdrawalDelayBlocksSet(uint256 previousValue, uint256 newValue) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) WatchWithdrawalDelayBlocksSet(opts *bind.WatchOpts, sink chan<- *DelayedWithdrawalRouterWithdrawalDelayBlocksSet) (event.Subscription, error) { + + logs, sub, err := _DelayedWithdrawalRouter.contract.WatchLogs(opts, "WithdrawalDelayBlocksSet") + 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(DelayedWithdrawalRouterWithdrawalDelayBlocksSet) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "WithdrawalDelayBlocksSet", 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 +} + +// ParseWithdrawalDelayBlocksSet is a log parse operation binding the contract event 0x4ffb00400574147429ee377a5633386321e66d45d8b14676014b5fa393e61e9e. +// +// Solidity: event WithdrawalDelayBlocksSet(uint256 previousValue, uint256 newValue) +func (_DelayedWithdrawalRouter *DelayedWithdrawalRouterFilterer) ParseWithdrawalDelayBlocksSet(log types.Log) (*DelayedWithdrawalRouterWithdrawalDelayBlocksSet, error) { + event := new(DelayedWithdrawalRouterWithdrawalDelayBlocksSet) + if err := _DelayedWithdrawalRouter.contract.UnpackLog(event, "WithdrawalDelayBlocksSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/pkg/bindings/EIP1271SignatureUtils/binding.go b/pkg/bindings/EIP1271SignatureUtils/binding.go new file mode 100644 index 000000000..63ec28665 --- /dev/null +++ b/pkg/bindings/EIP1271SignatureUtils/binding.go @@ -0,0 +1,203 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package EIP1271SignatureUtils + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// EIP1271SignatureUtilsMetaData contains all meta data concerning the EIP1271SignatureUtils contract. +var EIP1271SignatureUtilsMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"error\",\"name\":\"InvalidSignatureEIP1271\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignatureEOA\",\"inputs\":[]}]", + Bin: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212209c5fdbaf7c0f38f6979f9c98f90e58d8a565b39580e2f87466ca63aa80f59b6764736f6c634300081b0033", +} + +// EIP1271SignatureUtilsABI is the input ABI used to generate the binding from. +// Deprecated: Use EIP1271SignatureUtilsMetaData.ABI instead. +var EIP1271SignatureUtilsABI = EIP1271SignatureUtilsMetaData.ABI + +// EIP1271SignatureUtilsBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use EIP1271SignatureUtilsMetaData.Bin instead. +var EIP1271SignatureUtilsBin = EIP1271SignatureUtilsMetaData.Bin + +// DeployEIP1271SignatureUtils deploys a new Ethereum contract, binding an instance of EIP1271SignatureUtils to it. +func DeployEIP1271SignatureUtils(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *EIP1271SignatureUtils, error) { + parsed, err := EIP1271SignatureUtilsMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(EIP1271SignatureUtilsBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EIP1271SignatureUtils{EIP1271SignatureUtilsCaller: EIP1271SignatureUtilsCaller{contract: contract}, EIP1271SignatureUtilsTransactor: EIP1271SignatureUtilsTransactor{contract: contract}, EIP1271SignatureUtilsFilterer: EIP1271SignatureUtilsFilterer{contract: contract}}, nil +} + +// EIP1271SignatureUtils is an auto generated Go binding around an Ethereum contract. +type EIP1271SignatureUtils struct { + EIP1271SignatureUtilsCaller // Read-only binding to the contract + EIP1271SignatureUtilsTransactor // Write-only binding to the contract + EIP1271SignatureUtilsFilterer // Log filterer for contract events +} + +// EIP1271SignatureUtilsCaller is an auto generated read-only Go binding around an Ethereum contract. +type EIP1271SignatureUtilsCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EIP1271SignatureUtilsTransactor is an auto generated write-only Go binding around an Ethereum contract. +type EIP1271SignatureUtilsTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EIP1271SignatureUtilsFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type EIP1271SignatureUtilsFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EIP1271SignatureUtilsSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type EIP1271SignatureUtilsSession struct { + Contract *EIP1271SignatureUtils // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EIP1271SignatureUtilsCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type EIP1271SignatureUtilsCallerSession struct { + Contract *EIP1271SignatureUtilsCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// EIP1271SignatureUtilsTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type EIP1271SignatureUtilsTransactorSession struct { + Contract *EIP1271SignatureUtilsTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EIP1271SignatureUtilsRaw is an auto generated low-level Go binding around an Ethereum contract. +type EIP1271SignatureUtilsRaw struct { + Contract *EIP1271SignatureUtils // Generic contract binding to access the raw methods on +} + +// EIP1271SignatureUtilsCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type EIP1271SignatureUtilsCallerRaw struct { + Contract *EIP1271SignatureUtilsCaller // Generic read-only contract binding to access the raw methods on +} + +// EIP1271SignatureUtilsTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type EIP1271SignatureUtilsTransactorRaw struct { + Contract *EIP1271SignatureUtilsTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewEIP1271SignatureUtils creates a new instance of EIP1271SignatureUtils, bound to a specific deployed contract. +func NewEIP1271SignatureUtils(address common.Address, backend bind.ContractBackend) (*EIP1271SignatureUtils, error) { + contract, err := bindEIP1271SignatureUtils(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EIP1271SignatureUtils{EIP1271SignatureUtilsCaller: EIP1271SignatureUtilsCaller{contract: contract}, EIP1271SignatureUtilsTransactor: EIP1271SignatureUtilsTransactor{contract: contract}, EIP1271SignatureUtilsFilterer: EIP1271SignatureUtilsFilterer{contract: contract}}, nil +} + +// NewEIP1271SignatureUtilsCaller creates a new read-only instance of EIP1271SignatureUtils, bound to a specific deployed contract. +func NewEIP1271SignatureUtilsCaller(address common.Address, caller bind.ContractCaller) (*EIP1271SignatureUtilsCaller, error) { + contract, err := bindEIP1271SignatureUtils(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EIP1271SignatureUtilsCaller{contract: contract}, nil +} + +// NewEIP1271SignatureUtilsTransactor creates a new write-only instance of EIP1271SignatureUtils, bound to a specific deployed contract. +func NewEIP1271SignatureUtilsTransactor(address common.Address, transactor bind.ContractTransactor) (*EIP1271SignatureUtilsTransactor, error) { + contract, err := bindEIP1271SignatureUtils(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EIP1271SignatureUtilsTransactor{contract: contract}, nil +} + +// NewEIP1271SignatureUtilsFilterer creates a new log filterer instance of EIP1271SignatureUtils, bound to a specific deployed contract. +func NewEIP1271SignatureUtilsFilterer(address common.Address, filterer bind.ContractFilterer) (*EIP1271SignatureUtilsFilterer, error) { + contract, err := bindEIP1271SignatureUtils(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EIP1271SignatureUtilsFilterer{contract: contract}, nil +} + +// bindEIP1271SignatureUtils binds a generic wrapper to an already deployed contract. +func bindEIP1271SignatureUtils(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EIP1271SignatureUtilsMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_EIP1271SignatureUtils *EIP1271SignatureUtilsRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EIP1271SignatureUtils.Contract.EIP1271SignatureUtilsCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_EIP1271SignatureUtils *EIP1271SignatureUtilsRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EIP1271SignatureUtils.Contract.EIP1271SignatureUtilsTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EIP1271SignatureUtils *EIP1271SignatureUtilsRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EIP1271SignatureUtils.Contract.EIP1271SignatureUtilsTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_EIP1271SignatureUtils *EIP1271SignatureUtilsCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EIP1271SignatureUtils.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_EIP1271SignatureUtils *EIP1271SignatureUtilsTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EIP1271SignatureUtils.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EIP1271SignatureUtils *EIP1271SignatureUtilsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EIP1271SignatureUtils.Contract.contract.Transact(opts, method, params...) +} diff --git a/pkg/bindings/MagnitudeCheckpoints/binding.go b/pkg/bindings/MagnitudeCheckpoints/binding.go new file mode 100644 index 000000000..9a5a2ef52 --- /dev/null +++ b/pkg/bindings/MagnitudeCheckpoints/binding.go @@ -0,0 +1,203 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package MagnitudeCheckpoints + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// MagnitudeCheckpointsMetaData contains all meta data concerning the MagnitudeCheckpoints contract. +var MagnitudeCheckpointsMetaData = &bind.MetaData{ + ABI: "[]", + Bin: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220d403c7152d652d1a100c83daf55d72392c025180800bf29f79d386c0af19a05d64736f6c634300080c0033", +} + +// MagnitudeCheckpointsABI is the input ABI used to generate the binding from. +// Deprecated: Use MagnitudeCheckpointsMetaData.ABI instead. +var MagnitudeCheckpointsABI = MagnitudeCheckpointsMetaData.ABI + +// MagnitudeCheckpointsBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use MagnitudeCheckpointsMetaData.Bin instead. +var MagnitudeCheckpointsBin = MagnitudeCheckpointsMetaData.Bin + +// DeployMagnitudeCheckpoints deploys a new Ethereum contract, binding an instance of MagnitudeCheckpoints to it. +func DeployMagnitudeCheckpoints(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MagnitudeCheckpoints, error) { + parsed, err := MagnitudeCheckpointsMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(MagnitudeCheckpointsBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &MagnitudeCheckpoints{MagnitudeCheckpointsCaller: MagnitudeCheckpointsCaller{contract: contract}, MagnitudeCheckpointsTransactor: MagnitudeCheckpointsTransactor{contract: contract}, MagnitudeCheckpointsFilterer: MagnitudeCheckpointsFilterer{contract: contract}}, nil +} + +// MagnitudeCheckpoints is an auto generated Go binding around an Ethereum contract. +type MagnitudeCheckpoints struct { + MagnitudeCheckpointsCaller // Read-only binding to the contract + MagnitudeCheckpointsTransactor // Write-only binding to the contract + MagnitudeCheckpointsFilterer // Log filterer for contract events +} + +// MagnitudeCheckpointsCaller is an auto generated read-only Go binding around an Ethereum contract. +type MagnitudeCheckpointsCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MagnitudeCheckpointsTransactor is an auto generated write-only Go binding around an Ethereum contract. +type MagnitudeCheckpointsTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MagnitudeCheckpointsFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MagnitudeCheckpointsFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MagnitudeCheckpointsSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MagnitudeCheckpointsSession struct { + Contract *MagnitudeCheckpoints // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MagnitudeCheckpointsCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MagnitudeCheckpointsCallerSession struct { + Contract *MagnitudeCheckpointsCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MagnitudeCheckpointsTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MagnitudeCheckpointsTransactorSession struct { + Contract *MagnitudeCheckpointsTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MagnitudeCheckpointsRaw is an auto generated low-level Go binding around an Ethereum contract. +type MagnitudeCheckpointsRaw struct { + Contract *MagnitudeCheckpoints // Generic contract binding to access the raw methods on +} + +// MagnitudeCheckpointsCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MagnitudeCheckpointsCallerRaw struct { + Contract *MagnitudeCheckpointsCaller // Generic read-only contract binding to access the raw methods on +} + +// MagnitudeCheckpointsTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MagnitudeCheckpointsTransactorRaw struct { + Contract *MagnitudeCheckpointsTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewMagnitudeCheckpoints creates a new instance of MagnitudeCheckpoints, bound to a specific deployed contract. +func NewMagnitudeCheckpoints(address common.Address, backend bind.ContractBackend) (*MagnitudeCheckpoints, error) { + contract, err := bindMagnitudeCheckpoints(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MagnitudeCheckpoints{MagnitudeCheckpointsCaller: MagnitudeCheckpointsCaller{contract: contract}, MagnitudeCheckpointsTransactor: MagnitudeCheckpointsTransactor{contract: contract}, MagnitudeCheckpointsFilterer: MagnitudeCheckpointsFilterer{contract: contract}}, nil +} + +// NewMagnitudeCheckpointsCaller creates a new read-only instance of MagnitudeCheckpoints, bound to a specific deployed contract. +func NewMagnitudeCheckpointsCaller(address common.Address, caller bind.ContractCaller) (*MagnitudeCheckpointsCaller, error) { + contract, err := bindMagnitudeCheckpoints(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MagnitudeCheckpointsCaller{contract: contract}, nil +} + +// NewMagnitudeCheckpointsTransactor creates a new write-only instance of MagnitudeCheckpoints, bound to a specific deployed contract. +func NewMagnitudeCheckpointsTransactor(address common.Address, transactor bind.ContractTransactor) (*MagnitudeCheckpointsTransactor, error) { + contract, err := bindMagnitudeCheckpoints(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MagnitudeCheckpointsTransactor{contract: contract}, nil +} + +// NewMagnitudeCheckpointsFilterer creates a new log filterer instance of MagnitudeCheckpoints, bound to a specific deployed contract. +func NewMagnitudeCheckpointsFilterer(address common.Address, filterer bind.ContractFilterer) (*MagnitudeCheckpointsFilterer, error) { + contract, err := bindMagnitudeCheckpoints(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MagnitudeCheckpointsFilterer{contract: contract}, nil +} + +// bindMagnitudeCheckpoints binds a generic wrapper to an already deployed contract. +func bindMagnitudeCheckpoints(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MagnitudeCheckpointsMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MagnitudeCheckpoints *MagnitudeCheckpointsRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MagnitudeCheckpoints.Contract.MagnitudeCheckpointsCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MagnitudeCheckpoints *MagnitudeCheckpointsRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MagnitudeCheckpoints.Contract.MagnitudeCheckpointsTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MagnitudeCheckpoints *MagnitudeCheckpointsRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MagnitudeCheckpoints.Contract.MagnitudeCheckpointsTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MagnitudeCheckpoints *MagnitudeCheckpointsCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MagnitudeCheckpoints.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MagnitudeCheckpoints *MagnitudeCheckpointsTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MagnitudeCheckpoints.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MagnitudeCheckpoints *MagnitudeCheckpointsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MagnitudeCheckpoints.Contract.contract.Transact(opts, method, params...) +} diff --git a/pkg/bindings/RewardsCoordinator/binding.go b/pkg/bindings/RewardsCoordinator/binding.go index 277b14c7c..8691207bb 100644 --- a/pkg/bindings/RewardsCoordinator/binding.go +++ b/pkg/bindings/RewardsCoordinator/binding.go @@ -93,8 +93,13 @@ type IRewardsCoordinatorTypesTokenTreeMerkleLeaf struct { // RewardsCoordinatorMetaData contains all meta data concerning the RewardsCoordinator contract. var RewardsCoordinatorMetaData = &bind.MetaData{ +<<<<<<< HEAD ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_delegationManager\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"},{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"},{\"name\":\"_allocationManager\",\"type\":\"address\",\"internalType\":\"contractIAllocationManager\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"_permissionController\",\"type\":\"address\",\"internalType\":\"contractIPermissionController\"},{\"name\":\"_CALCULATION_INTERVAL_SECONDS\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_MAX_REWARDS_DURATION\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_MAX_RETROACTIVE_LENGTH\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_MAX_FUTURE_LENGTH\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_GENESIS_REWARDS_TIMESTAMP\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"CALCULATION_INTERVAL_SECONDS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"GENESIS_REWARDS_TIMESTAMP\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_FUTURE_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_RETROACTIVE_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_REWARDS_DURATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"activationDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"allocationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIAllocationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateEarnerLeafHash\",\"inputs\":[{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"calculateTokenLeafHash\",\"inputs\":[{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.TokenTreeMerkleLeaf\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"checkClaim\",\"inputs\":[{\"name\":\"claim\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsMerkleClaim\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimerFor\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createAVSRewardsSubmission\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createOperatorDirectedAVSRewardsSubmission\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorDirectedRewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.OperatorDirectedRewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"operatorRewards\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.OperatorReward[]\",\"components\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"description\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createRewardsForAllEarners\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createRewardsForAllSubmission\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeClaimed\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[{\"name\":\"totalClaimed\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currRewardsCalculationEndTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"defaultOperatorSplitBips\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disableRoot\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getCurrentClaimableDistributionRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentDistributionRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDistributionRootAtIndex\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDistributionRootsLength\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorAVSSplit\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorPISplit\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRootIndexFromHash\",\"inputs\":[{\"name\":\"rootHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_rewardsUpdater\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_activationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_defaultSplitBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isAVSRewardsSubmissionHash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorDirectedAVSRewardsSubmissionHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsForAllSubmitter\",\"inputs\":[{\"name\":\"submitter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsSubmissionForAllEarnersHash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsSubmissionForAllHash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"pauseAll\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pauserRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"permissionController\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIPermissionController\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processClaim\",\"inputs\":[{\"name\":\"claim\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsMerkleClaim\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"processClaims\",\"inputs\":[{\"name\":\"claims\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsMerkleClaim[]\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"rewardsUpdater\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setActivationDelay\",\"inputs\":[{\"name\":\"_activationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setClaimerFor\",\"inputs\":[{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setClaimerFor\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setDefaultOperatorSplit\",\"inputs\":[{\"name\":\"split\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setOperatorAVSSplit\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"split\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setOperatorPISplit\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"split\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRewardsForAllSubmitter\",\"inputs\":[{\"name\":\"_submitter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_newValue\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRewardsUpdater\",\"inputs\":[{\"name\":\"_rewardsUpdater\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submissionNonce\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submitRoot\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSRewardsSubmissionCreated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ActivationDelaySet\",\"inputs\":[{\"name\":\"oldActivationDelay\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"newActivationDelay\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ClaimerForSet\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"oldClaimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DefaultOperatorSplitBipsSet\",\"inputs\":[{\"name\":\"oldDefaultOperatorSplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"newDefaultOperatorSplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DistributionRootDisabled\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DistributionRootSubmitted\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"},{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAVSSplitBipsSet\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"oldOperatorAVSSplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"newOperatorAVSSplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorDirectedAVSRewardsSubmissionCreated\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorDirectedRewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"operatorDirectedRewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinatorTypes.OperatorDirectedRewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"operatorRewards\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.OperatorReward[]\",\"components\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"description\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorPISplitBipsSet\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"oldOperatorPISplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"newOperatorPISplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsClaimed\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"earner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"claimedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsForAllSubmitterSet\",\"inputs\":[{\"name\":\"rewardsForAllSubmitter\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"oldValue\",\"type\":\"bool\",\"indexed\":true,\"internalType\":\"bool\"},{\"name\":\"newValue\",\"type\":\"bool\",\"indexed\":true,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsSubmissionForAllCreated\",\"inputs\":[{\"name\":\"submitter\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsSubmissionForAllEarnersCreated\",\"inputs\":[{\"name\":\"tokenHopper\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsUpdaterSet\",\"inputs\":[{\"name\":\"oldRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AmountExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AmountIsZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CurrentlyPaused\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DurationExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EarningsNotGreaterThanClaimed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputAddressZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputArrayLengthZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidAddressZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCalculationIntervalSecondsRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidClaimProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDurationRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidEarner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidEarnerLeafIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidGenesisRewardsTimestampRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidNewPausedStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidPermissions\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidProofLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRootIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidStartTimestampRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidTokenLeafIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NewRootMustBeForNewCalculatedPeriod\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyPauser\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyUnpauser\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OperatorsNotInAscendingOrder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RewardsEndTimestampNotElapsed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootAlreadyActivated\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootDisabled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootNotActivated\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SplitExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StartTimestampTooFarInFuture\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StartTimestampTooFarInPast\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategiesNotInAscendingOrder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategyNotWhitelisted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SubmissionNotRetroactive\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedCaller\",\"inputs\":[]}]", Bin: "0x6101c060405234801561001157600080fd5b5060405161443938038061443983398101604081905261003091610217565b858a8a8a88888888888f6001600160a01b038116610061576040516339b190bb60e11b815260040160405180910390fd5b6001600160a01b031660805261007785826102df565b63ffffffff161561009b57604051630e06bd3160e01b815260040160405180910390fd5b6100a862015180866102df565b63ffffffff16156100cc5760405163223c7b3960e11b815260040160405180910390fd5b6001600160a01b0397881660a05295871660c05293861660e05263ffffffff9283166101005290821661012052811661014052908116610160521661018052166101a052610118610127565b50505050505050505050610315565b600054610100900460ff16156101935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116146101e4576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146101fb57600080fd5b50565b805163ffffffff8116811461021257600080fd5b919050565b6000806000806000806000806000806101408b8d03121561023757600080fd5b8a51610242816101e6565b60208c0151909a50610253816101e6565b60408c0151909950610264816101e6565b60608c0151909850610275816101e6565b60808c0151909750610286816101e6565b955061029460a08c016101fe565b94506102a260c08c016101fe565b93506102b060e08c016101fe565b92506102bf6101008c016101fe565b91506102ce6101208c016101fe565b90509295989b9194979a5092959850565b600063ffffffff83168061030357634e487b7160e01b600052601260045260246000fd5b8063ffffffff84160691505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a05161404e6103eb600039600081816105ce01526127a601526000818161046e0152612fd00152600081816103cf015261240f01526000818161051d0152612f8e0152600081816108380152612e9e01526000818161078a01528181612eee0152612f3c01526000818161088d0152611c3d015260008181610544015261306d0152600081816109000152611baa01526000818161071c01528181610b830152818161132f0152611fef015261404e6000f3fe608060405234801561001057600080fd5b506004361061038d5760003560e01c8063865c6953116101de578063ca8aa7c71161010f578063f22cef85116100ad578063f96abf2e1161007c578063f96abf2e1461099c578063fabc1cbc146109af578063fbf1e2c1146109c2578063ff9f6cce146109d557600080fd5b8063f22cef8514610950578063f2fde38b14610963578063f6efbb5914610976578063f8cd84481461098957600080fd5b8063e063f81f116100e9578063e063f81f146108d5578063e810ce21146108e8578063ea4d3c9b146108fb578063ed71e6a21461092257600080fd5b8063ca8aa7c714610888578063dcbb03b3146108af578063de02e503146108c257600080fd5b8063a0169ddd1161017c578063b3dbb0e011610156578063b3dbb0e014610800578063bb7e451f14610813578063bf21a8aa14610833578063c46db6061461085a57600080fd5b8063a0169ddd146107ac578063a50a1d9c146107bf578063aebd8bae146107d257600080fd5b80639104c319116101b85780639104c3191461074f5780639be3d4e41461076a5780639cb9a5fa146107725780639d45c2811461078557600080fd5b8063865c6953146106ec578063886f1195146107175780638da5cb5b1461073e57600080fd5b806343ea4476116102c35780635ac86ab7116102615780636d21117e116102305780636d21117e1461069b578063715018a6146106c95780637b8f8b05146106d1578063863cb9a9146106d957600080fd5b80635ac86ab7146106485780635c975abb1461066b5780635e9d83481461067357806363f6a7981461068657600080fd5b80634b9439601161029d5780634b943960146105f05780634d18cc351461061657806358baaa3e1461062d578063595c6a671461064057600080fd5b806343ea4476146105a35780634596021c146105b65780634657e26a146105c957600080fd5b80632b9f64a41161033057806339b70e381161030a57806339b70e381461053f5780633a8c0786146105665780633ccc861d1461057d5780633efe1db61461059057600080fd5b80632b9f64a4146104c457806336af41fa1461050557806337838ed01461051857600080fd5b80630eb383451161036c5780630eb3834514610454578063131433b414610469578063136439dd14610490578063149bc872146104a357600080fd5b806218572c1461039257806304a0c502146103ca5780630e9a53cf14610406575b600080fd5b6103b56103a036600461359e565b60d16020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6103f17f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020016103c1565b61040e6109e8565b6040516103c1919060006080820190508251825263ffffffff602084015116602083015263ffffffff604084015116604083015260608301511515606083015292915050565b6104676104623660046135c9565b610aec565b005b6103f17f000000000000000000000000000000000000000000000000000000000000000081565b61046761049e366004613602565b610b6e565b6104b66104b1366004613633565b610c45565b6040519081526020016103c1565b6104ed6104d236600461359e565b60cc602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016103c1565b61046761051336600461369b565b610cbb565b6103f17f000000000000000000000000000000000000000000000000000000000000000081565b6104ed7f000000000000000000000000000000000000000000000000000000000000000081565b60cb546103f190600160a01b900463ffffffff1681565b61046761058b3660046136f0565b610e60565b61046761059e36600461374b565b610ea5565b6104676105b1366004613777565b61109b565b6104676105c43660046137cc565b611228565b6104ed7f000000000000000000000000000000000000000000000000000000000000000081565b6106036105fe36600461359e565b6112aa565b60405161ffff90911681526020016103c1565b60cb546103f190600160c01b900463ffffffff1681565b61046761063b366004613823565b611306565b61046761131a565b6103b561065636600461383e565b606654600160ff9092169190911b9081161490565b6066546104b6565b6103b5610681366004613861565b6113cc565b60cb5461060390600160e01b900461ffff1681565b6103b56106a9366004613896565b60cf60209081526000928352604080842090915290825290205460ff1681565b610467611459565b60ca546104b6565b6104676106e736600461359e565b61146b565b6104b66106fa3660046138c2565b60cd60209081526000928352604080842090915290825290205481565b6104ed7f000000000000000000000000000000000000000000000000000000000000000081565b6033546001600160a01b03166104ed565b6104ed73beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac081565b61040e61147c565b610467610780366004613777565b61151a565b6103f17f000000000000000000000000000000000000000000000000000000000000000081565b6104676107ba36600461359e565b6116ba565b6104676107cd366004613902565b6116c5565b6103b56107e0366004613896565b60d260209081526000928352604080842090915290825290205460ff1681565b61046761080e36600461391d565b6116d6565b6104b661082136600461359e565b60ce6020526000908152604090205481565b6103f17f000000000000000000000000000000000000000000000000000000000000000081565b6103b5610868366004613896565b60d060209081526000928352604080842090915290825290205460ff1681565b6104ed7f000000000000000000000000000000000000000000000000000000000000000081565b6104676108bd366004613949565b61184a565b61040e6108d0366004613602565b6119e0565b6106036108e33660046138c2565b611a72565b6103f16108f6366004613602565b611adf565b6104ed7f000000000000000000000000000000000000000000000000000000000000000081565b6103b5610930366004613896565b60d360209081526000928352604080842090915290825290205460ff1681565b61046761095e3660046138c2565b611b64565b61046761097136600461359e565b611cd3565b610467610984366004613990565b611d4e565b6104b6610997366004613633565b611e89565b6104676109aa366004613823565b611e9a565b6104676109bd366004613602565b611fed565b60cb546104ed906001600160a01b031681565b6104676109e336600461369b565b612105565b60408051608081018252600080825260208201819052918101829052606081019190915260ca545b8015610ac357600060ca610a25600184613a08565b81548110610a3557610a35613a1b565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff161580156060830181905291925090610aa55750806040015163ffffffff164210155b15610ab05792915050565b5080610abb81613a31565b915050610a10565b505060408051608081018252600080825260208201819052918101829052606081019190915290565b610af4612289565b6001600160a01b038216600081815260d1602052604080822054905160ff9091169284151592841515927f4de6293e668df1398422e1def12118052c1539a03cbfedc145895d48d7685f1c9190a4506001600160a01b0391909116600090815260d160205260409020805460ff1916911515919091179055565b60405163237dfb4760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906346fbf68e90602401602060405180830381865afa158015610bd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf69190613a48565b610c1357604051631d77d47760e21b815260040160405180910390fd5b6066548181168114610c385760405163c61dca5d60e01b815260040160405180910390fd5b610c41826122e3565b5050565b600080610c55602084018461359e565b8360200135604051602001610c9e9392919060f89390931b6001600160f81b031916835260609190911b6bffffffffffffffffffffffff19166001830152601582015260350190565b604051602081830303815290604052805190602001209050919050565b606654600190600290811603610ce45760405163840a48d560e01b815260040160405180910390fd5b33600090815260d1602052604090205460ff16610d1457604051635c427cd960e01b815260040160405180910390fd5b610d1c612320565b60005b82811015610e505736848483818110610d3a57610d3a613a1b565b9050602002810190610d4c9190613a65565b33600081815260ce60209081526040808320549051949550939192610d779290918591879101613bbd565b604051602081830303815290604052805190602001209050610d9883612379565b33600090815260d0602090815260408083208484529091529020805460ff19166001908117909155610dcb908390613bed565b33600081815260ce602052604090819020929092559051829184917f51088b8c89628df3a8174002c2a034d0152fce6af8415d651b2a4734bf27048290610e13908890613c00565b60405180910390a4610e45333060408601803590610e34906020890161359e565b6001600160a01b031692919061246a565b505050600101610d1f565b50610e5b6001609755565b505050565b606654600290600490811603610e895760405163840a48d560e01b815260040160405180910390fd5b610e91612320565b610e9b83836124d5565b610e5b6001609755565b606654600390600890811603610ece5760405163840a48d560e01b815260040160405180910390fd5b60cb546001600160a01b03163314610ef957604051635c427cd960e01b815260040160405180910390fd5b60cb5463ffffffff600160c01b909104811690831611610f2c57604051631ca7e50b60e21b815260040160405180910390fd5b428263ffffffff1610610f52576040516306957c9160e11b815260040160405180910390fd5b60ca5460cb54600090610f7290600160a01b900463ffffffff1642613c13565b6040805160808101825287815263ffffffff878116602080840182815286841685870181815260006060880181815260ca8054600181018255925297517f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee160029092029182015592517f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee290930180549151975193871667ffffffffffffffff1990921691909117600160201b978716979097029690961760ff60401b1916600160401b921515929092029190911790945560cb805463ffffffff60c01b1916600160c01b840217905593519283529394508892908616917fecd866c3c158fa00bf34d803d5f6023000b57080bcb48af004c2b4b46b3afd08910160405180910390a45050505050565b6066546000906001908116036110c45760405163840a48d560e01b815260040160405180910390fd5b836110ce81612767565b6110eb5760405163932d94f760e01b815260040160405180910390fd5b6110f3612320565b60005b83811015611216573685858381811061111157611111613a1b565b90506020028101906111239190613a65565b33600081815260ce6020908152604080832054905194955093919261114e9290918591879101613bbd565b60405160208183030381529060405280519060200120905061116f83612379565b33600090815260cf602090815260408083208484529091529020805460ff191660019081179091556111a2908390613bed565b33600081815260ce602052604090819020929092559051829184917f450a367a380c4e339e5ae7340c8464ef27af7781ad9945cfe8abd828f89e6281906111ea908890613c00565b60405180910390a461120b333060408601803590610e34906020890161359e565b5050506001016110f6565b506112216001609755565b5050505050565b6066546002906004908116036112515760405163840a48d560e01b815260040160405180910390fd5b611259612320565b60005b838110156112995761129185858381811061127957611279613a1b565b905060200281019061128b9190613c2f565b846124d5565b60010161125c565b506112a46001609755565b50505050565b6001600160a01b038116600090815260d5602090815260408083208151606081018352905461ffff80821683526201000082041693820193909352600160201b90920463ffffffff169082015261130090612815565b92915050565b61130e612289565b61131781612862565b50565b60405163237dfb4760e11b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906346fbf68e90602401602060405180830381865afa15801561137e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a29190613a48565b6113bf57604051631d77d47760e21b815260040160405180910390fd5b6113ca6000196122e3565b565b60006114518260ca6113e16020830183613823565b63ffffffff16815481106113f7576113f7613a1b565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff16151560608201526128d3565b506001919050565b611461612289565b6113ca6000612a77565b611473612289565b61131781612ac9565b60408051608081018252600080825260208201819052918101829052606081019190915260ca80546114b090600190613a08565b815481106114c0576114c0613a1b565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff1615156060820152919050565b6066546005906020908116036115435760405163840a48d560e01b815260040160405180910390fd5b61154b612320565b336001600160a01b0385161461157457604051635c427cd960e01b815260040160405180910390fd5b60005b82811015611299573684848381811061159257611592613a1b565b90506020028101906115a49190613c45565b6001600160a01b038716600090815260ce60209081526040808320549051939450926115d6918a918591879101613dbc565b60405160208183030381529060405280519060200120905060006115f984612b25565b6001600160a01b038a16600090815260d3602090815260408083208684529091529020805460ff19166001908117909155909150611638908490613bed565b6001600160a01b038a16600081815260ce60205260409081902092909255905183919033907ffc8888bffd711da60bc5092b33f677d81896fe80ecc677b84cfab8184462b6e09061168c9088908a90613de3565b60405180910390a46116aa333083610e346040890160208a0161359e565b5050600190920191506115779050565b33610c418183612d11565b6116cd612289565b61131781612d75565b6066546007906080908116036116ff5760405163840a48d560e01b815260040160405180910390fd5b336001600160a01b0384161461172857604051635c427cd960e01b815260040160405180910390fd5b61271061ffff8316111561174f5760405163891c63df60e01b815260040160405180910390fd5b60cb5460009061176c90600160a01b900463ffffffff1642613c13565b6001600160a01b038516600090815260d5602090815260408083208151606081018352905461ffff80821683526201000082041693820193909352600160201b90920463ffffffff1690820152919250906117c690612815565b6001600160a01b038616600090815260d5602052604090209091506117ec908584612de0565b6040805163ffffffff8416815261ffff838116602083015286168183015290516001600160a01b0387169133917fd1e028bd664486a46ad26040e999cd2d22e1e9a094ee6afe19fcf64678f16f749181900360600190a35050505050565b6066546006906040908116036118735760405163840a48d560e01b815260040160405180910390fd5b336001600160a01b0385161461189c57604051635c427cd960e01b815260040160405180910390fd5b61271061ffff831611156118c35760405163891c63df60e01b815260040160405180910390fd5b60cb546000906118e090600160a01b900463ffffffff1642613c13565b6001600160a01b03868116600090815260d46020908152604080832093891683529281528282208351606081018552905461ffff80821683526201000082041692820192909252600160201b90910463ffffffff169281019290925291925061194890612815565b6001600160a01b03808816600090815260d460209081526040808320938a1683529290522090915061197b908584612de0565b6040805163ffffffff8416815261ffff838116602083015286168183015290516001600160a01b03878116929089169133917f48e198b6ae357e529204ee53a8e514c470ff77d9cc8e4f7207f8b5d490ae6934919081900360600190a4505050505050565b60408051608081018252600080825260208201819052918101829052606081019190915260ca8281548110611a1757611a17613a1b565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff161515606082015292915050565b6001600160a01b03828116600090815260d46020908152604080832093851683529281528282208351606081018552905461ffff80821683526201000082041692820192909252600160201b90910463ffffffff169281019290925290611ad890612815565b9392505050565b60ca546000905b63ffffffff811615611b4a578260ca611b00600184613dfc565b63ffffffff1681548110611b1657611b16613a1b565b90600052602060002090600202016000015403611b3857611ad8600182613dfc565b80611b4281613e18565b915050611ae6565b5060405163504570e360e01b815260040160405180910390fd5b81611b6e81612767565b611b8b5760405163932d94f760e01b815260040160405180910390fd5b6040516336b87bd760e11b81526001600160a01b0384811660048301527f00000000000000000000000000000000000000000000000000000000000000001690636d70f7ae90602401602060405180830381865afa158015611bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c159190613a48565b80611cac575060405163ba1a84e560e01b81526001600160a01b0384811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063ba1a84e590602401602060405180830381865afa158015611c86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611caa9190613e38565b115b611cc95760405163fb494ea160e01b815260040160405180910390fd5b610e5b8383612d11565b611cdb612289565b6001600160a01b038116611d455760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61131781612a77565b600054610100900460ff1615808015611d6e5750600054600160ff909116105b80611d885750303b158015611d88575060005460ff166001145b611deb5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401611d3c565b6000805460ff191660011790558015611e0e576000805461ff0019166101001790555b611e17856122e3565b611e2086612a77565b611e2984612ac9565b611e3283612862565b611e3b82612d75565b8015611e81576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b60006001610c55602084018461359e565b606654600390600890811603611ec35760405163840a48d560e01b815260040160405180910390fd5b60cb546001600160a01b03163314611eee57604051635c427cd960e01b815260040160405180910390fd5b60ca5463ffffffff831610611f16576040516394a8d38960e01b815260040160405180910390fd5b600060ca8363ffffffff1681548110611f3157611f31613a1b565b906000526020600020906002020190508060010160089054906101000a900460ff1615611f7157604051631b14174b60e01b815260040160405180910390fd5b6001810154600160201b900463ffffffff164210611fa257604051630c36f66560e21b815260040160405180910390fd5b60018101805460ff60401b1916600160401b17905560405163ffffffff8416907fd850e6e5dfa497b72661fa73df2923464eaed9dc2ff1d3cb82bccbfeabe5c41e90600090a2505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561204b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061206f9190613e51565b6001600160a01b0316336001600160a01b0316146120a05760405163794821ff60e01b815260040160405180910390fd5b606654801982198116146120c75760405163c61dca5d60e01b815260040160405180910390fd5b606682905560405182815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c9060200160405180910390a25050565b60665460049060109081160361212e5760405163840a48d560e01b815260040160405180910390fd5b33600090815260d1602052604090205460ff1661215e57604051635c427cd960e01b815260040160405180910390fd5b612166612320565b60005b82811015610e50573684848381811061218457612184613a1b565b90506020028101906121969190613a65565b33600081815260ce602090815260408083205490519495509391926121c19290918591879101613bbd565b6040516020818303038152906040528051906020012090506121e283612379565b33600090815260d2602090815260408083208484529091529020805460ff19166001908117909155612215908390613bed565b33600081815260ce602052604090819020929092559051829184917f5251b6fdefcb5d81144e735f69ea4c695fd43b0289ca53dc075033f5fc80068b9061225d908890613c00565b60405180910390a461227e333060408601803590610e34906020890161359e565b505050600101612169565b6033546001600160a01b031633146113ca5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611d3c565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a250565b6002609754036123725760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611d3c565b6002609755565b6123ab6123868280613e6e565b6123966080850160608601613823565b6123a660a0860160808701613823565b612e7e565b60008160400135116123d0576040516310eb483f60e21b815260040160405180910390fd5b6f4b3b4ca85a86c47a098a223fffffffff816040013511156124055760405163070b5a6f60e21b815260040160405180910390fd5b61243563ffffffff7f00000000000000000000000000000000000000000000000000000000000000001642613bed565b6124456080830160608401613823565b63ffffffff16111561131757604051637ee2b44360e01b815260040160405180910390fd5b6040516001600160a01b03808516602483015283166044820152606481018290526112a49085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261315a565b600060ca6124e66020850185613823565b63ffffffff16815481106124fc576124fc613a1b565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff1615156060820152905061255d83826128d3565b600061256f608085016060860161359e565b6001600160a01b03808216600090815260cc602052604090205491925016806125955750805b336001600160a01b038216146125be57604051635c427cd960e01b815260040160405180910390fd5b60005b6125ce60a0870187613eb8565b9050811015611e8157366125e560e0880188613e6e565b838181106125f5576125f5613a1b565b6001600160a01b038716600090815260cd60209081526040808320930294909401945092909150829061262a9085018561359e565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050808260200135116126715760405163aa385e8160e01b815260040160405180910390fd5b6000612681826020850135613a08565b6001600160a01b038716600090815260cd602090815260408220929350850180359291906126af908761359e565b6001600160a01b03168152602080820192909252604001600020919091556126f190899083906126e19087018761359e565b6001600160a01b0316919061322f565b86516001600160a01b03808a1691878216918916907f9543dbd55580842586a951f0386e24d68a5df99ae29e3b216588b45fd684ce3190612735602089018961359e565b604080519283526001600160a01b039091166020830152810186905260600160405180910390a45050506001016125c1565b604051631beb2b9760e31b81526001600160a01b038281166004830152336024830152306044830152600080356001600160e01b0319166064840152917f00000000000000000000000000000000000000000000000000000000000000009091169063df595cb8906084016020604051808303816000875af11580156127f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113009190613a48565b6000816040015163ffffffff1660000361283c57505060cb54600160e01b900461ffff1690565b816040015163ffffffff16421015612855578151611300565b506020015190565b919050565b60cb546040805163ffffffff600160a01b9093048316815291831660208301527faf557c6c02c208794817a705609cfa935f827312a1adfdd26494b6b95dd2b4b3910160405180910390a160cb805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b8060600151156128f657604051631b14174b60e01b815260040160405180910390fd5b806040015163ffffffff1642101561292157604051631437a2bb60e31b815260040160405180910390fd5b61292e60c0830183613eb8565b905061293d60a0840184613eb8565b90501461295d576040516343714afd60e01b815260040160405180910390fd5b61296a60e0830183613e6e565b905061297960c0840184613eb8565b905014612999576040516343714afd60e01b815260040160405180910390fd5b80516129c5906129af6040850160208601613823565b6129bc6040860186613f02565b8660600161325f565b60005b6129d560a0840184613eb8565b9050811015610e5b57612a6f60808401356129f360a0860186613eb8565b84818110612a0357612a03613a1b565b9050602002016020810190612a189190613823565b612a2560c0870187613eb8565b85818110612a3557612a35613a1b565b9050602002810190612a479190613f02565b612a5460e0890189613e6e565b87818110612a6457612a64613a1b565b905060400201613305565b6001016129c8565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60cb546040516001600160a01b038084169216907f237b82f438d75fc568ebab484b75b01d9287b9e98b490b7c23221623b6705dbb90600090a360cb80546001600160a01b0319166001600160a01b0392909216919091179055565b6000612b54612b348380613e6e565b612b446080860160608701613823565b6123a660a0870160808801613823565b6000612b636040840184613e6e565b905011612b835760405163796cc52560e01b815260040160405180910390fd5b42612b9460a0840160808501613823565b612ba46080850160608601613823565b612bae9190613c13565b63ffffffff1610612bd25760405163150358a160e21b815260040160405180910390fd5b60008060005b612be56040860186613e6e565b9050811015612cd85736612bfc6040870187613e6e565b83818110612c0c57612c0c613a1b565b60400291909101915060009050612c26602083018361359e565b6001600160a01b031603612c4d57604051630863a45360e11b815260040160405180910390fd5b612c5a602082018261359e565b6001600160a01b0316836001600160a01b031610612c8b576040516310fb47f160e31b815260040160405180910390fd5b6000816020013511612cb0576040516310eb483f60e21b815260040160405180910390fd5b612cbd602082018261359e565b9250612ccd602082013585613bed565b935050600101612bd8565b506f4b3b4ca85a86c47a098a223fffffffff821115612d0a5760405163070b5a6f60e21b815260040160405180910390fd5b5092915050565b6001600160a01b03808316600081815260cc602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917fbab947934d42e0ad206f25c9cab18b5bb6ae144acfb00f40b4e3aa59590ca3129190a4505050565b60cb546040805161ffff600160e01b9093048316815291831660208301527fe6cd4edfdcc1f6d130ab35f73d72378f3a642944fb4ee5bd84b7807a81ea1c4e910160405180910390a160cb805461ffff909216600160e01b0261ffff60e01b19909216919091179055565b8254600160201b900463ffffffff164210612e42578254600160201b900463ffffffff16600003612e2b5760cb548354600160e01b90910461ffff1661ffff19909116178355612e42565b825462010000810461ffff1661ffff199091161783555b825463ffffffff909116600160201b0267ffffffff000000001961ffff90931662010000029290921667ffffffffffff00001990911617179055565b82612e9c5760405163796cc52560e01b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168163ffffffff161115612ee957604051630dd0b9f560e21b815260040160405180910390fd5b612f137f000000000000000000000000000000000000000000000000000000000000000082613f5f565b63ffffffff1615612f375760405163ee66470560e01b815260040160405180910390fd5b612f617f000000000000000000000000000000000000000000000000000000000000000083613f5f565b63ffffffff1615612f8557604051633c1a94f160e21b815260040160405180910390fd5b8163ffffffff167f000000000000000000000000000000000000000000000000000000000000000063ffffffff1642612fbe9190613a08565b11158015612ff857508163ffffffff167f000000000000000000000000000000000000000000000000000000000000000063ffffffff1611155b6130155760405163041aa75760e11b815260040160405180910390fd5b6000805b84811015611e8157600086868381811061303557613035613a1b565b61304b926020604090920201908101915061359e565b60405163198f077960e21b81526001600160a01b0380831660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063663c1de490602401602060405180830381865afa1580156130b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130da9190613a48565b8061310157506001600160a01b03811673beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0145b61311e57604051632efd965160e11b815260040160405180910390fd5b806001600160a01b0316836001600160a01b0316106131505760405163dfad9ca160e01b815260040160405180910390fd5b9150600101613019565b60006131af826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166133449092919063ffffffff16565b90508051600014806131d05750808060200190518101906131d09190613a48565b610e5b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611d3c565b6040516001600160a01b038316602482015260448101829052610e5b90849063a9059cbb60e01b9060640161249e565b61326a602083613f87565b6001901b8463ffffffff16106132925760405162c6c39d60e71b815260040160405180910390fd5b600061329d82610c45565b90506132e884848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92508591505063ffffffff891661335b565b611e81576040516369ca16c960e01b815260040160405180910390fd5b613310602083613f87565b6001901b8463ffffffff16106133395760405163054ff4df60e51b815260040160405180910390fd5b600061329d82611e89565b60606133538484600085613373565b949350505050565b60008361336986858561344e565b1495945050505050565b6060824710156133d45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611d3c565b600080866001600160a01b031685876040516133f09190613fbf565b60006040518083038185875af1925050503d806000811461342d576040519150601f19603f3d011682016040523d82523d6000602084013e613432565b606091505b5091509150613443878383876134eb565b979650505050505050565b60006020845161345e9190613fd1565b1561347c576040516313717da960e21b815260040160405180910390fd5b8260205b855181116134e257613493600285613fd1565b6000036134b7578160005280860151602052604060002091506002840493506134d0565b8086015160005281602052604060002091506002840493505b6134db602082613bed565b9050613480565b50949350505050565b6060831561355a578251600003613553576001600160a01b0385163b6135535760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611d3c565b5081613353565b613353838381511561356f5781518083602001fd5b8060405162461bcd60e51b8152600401611d3c9190613fe5565b6001600160a01b038116811461131757600080fd5b6000602082840312156135b057600080fd5b8135611ad881613589565b801515811461131757600080fd5b600080604083850312156135dc57600080fd5b82356135e781613589565b915060208301356135f7816135bb565b809150509250929050565b60006020828403121561361457600080fd5b5035919050565b60006040828403121561362d57600080fd5b50919050565b60006040828403121561364557600080fd5b611ad8838361361b565b60008083601f84011261366157600080fd5b50813567ffffffffffffffff81111561367957600080fd5b6020830191508360208260051b850101111561369457600080fd5b9250929050565b600080602083850312156136ae57600080fd5b823567ffffffffffffffff8111156136c557600080fd5b6136d18582860161364f565b90969095509350505050565b6000610100828403121561362d57600080fd5b6000806040838503121561370357600080fd5b823567ffffffffffffffff81111561371a57600080fd5b613726858286016136dd565b92505060208301356135f781613589565b803563ffffffff8116811461285d57600080fd5b6000806040838503121561375e57600080fd5b8235915061376e60208401613737565b90509250929050565b60008060006040848603121561378c57600080fd5b833561379781613589565b9250602084013567ffffffffffffffff8111156137b357600080fd5b6137bf8682870161364f565b9497909650939450505050565b6000806000604084860312156137e157600080fd5b833567ffffffffffffffff8111156137f857600080fd5b6138048682870161364f565b909450925050602084013561381881613589565b809150509250925092565b60006020828403121561383557600080fd5b611ad882613737565b60006020828403121561385057600080fd5b813560ff81168114611ad857600080fd5b60006020828403121561387357600080fd5b813567ffffffffffffffff81111561388a57600080fd5b613353848285016136dd565b600080604083850312156138a957600080fd5b82356138b481613589565b946020939093013593505050565b600080604083850312156138d557600080fd5b82356138e081613589565b915060208301356135f781613589565b803561ffff8116811461285d57600080fd5b60006020828403121561391457600080fd5b611ad8826138f0565b6000806040838503121561393057600080fd5b823561393b81613589565b915061376e602084016138f0565b60008060006060848603121561395e57600080fd5b833561396981613589565b9250602084013561397981613589565b9150613987604085016138f0565b90509250925092565b600080600080600060a086880312156139a857600080fd5b85356139b381613589565b94506020860135935060408601356139ca81613589565b92506139d860608701613737565b91506139e6608087016138f0565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b81810381811115611300576113006139f2565b634e487b7160e01b600052603260045260246000fd5b600081613a4057613a406139f2565b506000190190565b600060208284031215613a5a57600080fd5b8151611ad8816135bb565b60008235609e19833603018112613a7b57600080fd5b9190910192915050565b6000808335601e19843603018112613a9c57600080fd5b830160208101925035905067ffffffffffffffff811115613abc57600080fd5b8060061b360382131561369457600080fd5b81835260208301925060008160005b84811015613b34578135613af081613589565b6001600160a01b0316865260208201356bffffffffffffffffffffffff8116808214613b1b57600080fd5b6020880152506040958601959190910190600101613add565b5093949350505050565b6000613b4a8283613a85565b60a08552613b5c60a086018284613ace565b9150506020830135613b6d81613589565b6001600160a01b031660208501526040838101359085015263ffffffff613b9660608501613737565b16606085015263ffffffff613bad60808501613737565b1660808501528091505092915050565b60018060a01b0384168152826020820152606060408201526000613be46060830184613b3e565b95945050505050565b80820180821115611300576113006139f2565b602081526000611ad86020830184613b3e565b63ffffffff8181168382160190811115611300576113006139f2565b6000823560fe19833603018112613a7b57600080fd5b6000823560be19833603018112613a7b57600080fd5b6000808335601e19843603018112613c7257600080fd5b830160208101925035905067ffffffffffffffff811115613c9257600080fd5b80360382131561369457600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000613cd68283613a85565b60c08552613ce860c086018284613ace565b9150506020830135613cf981613589565b6001600160a01b03166020850152613d146040840184613a85565b85830360408701528083529091600091906020015b81831015613d64578335613d3c81613589565b6001600160a01b03168152602084810135908201526040938401936001939093019201613d29565b613d7060608701613737565b63ffffffff811660608901529350613d8a60808701613737565b63ffffffff811660808901529350613da560a0870187613c5b565b9450925086810360a0880152613443818585613ca1565b60018060a01b0384168152826020820152606060408201526000613be46060830184613cca565b8281526040602082015260006133536040830184613cca565b63ffffffff8281168282160390811115611300576113006139f2565b600063ffffffff821680613e2e57613e2e6139f2565b6000190192915050565b600060208284031215613e4a57600080fd5b5051919050565b600060208284031215613e6357600080fd5b8151611ad881613589565b6000808335601e19843603018112613e8557600080fd5b83018035915067ffffffffffffffff821115613ea057600080fd5b6020019150600681901b360382131561369457600080fd5b6000808335601e19843603018112613ecf57600080fd5b83018035915067ffffffffffffffff821115613eea57600080fd5b6020019150600581901b360382131561369457600080fd5b6000808335601e19843603018112613f1957600080fd5b83018035915067ffffffffffffffff821115613f3457600080fd5b60200191503681900382131561369457600080fd5b634e487b7160e01b600052601260045260246000fd5b600063ffffffff831680613f7557613f75613f49565b8063ffffffff84160691505092915050565b600082613f9657613f96613f49565b500490565b60005b83811015613fb6578181015183820152602001613f9e565b50506000910152565b60008251613a7b818460208701613f9b565b600082613fe057613fe0613f49565b500690565b6020815260008251806020840152614004816040850160208701613f9b565b601f01601f1916919091016040019291505056fea26469706673582212203025c70c86ab05abcdb0b60fadba5ce26cccfce7b1aeb16257cc978e19e7485764736f6c634300081b0033", +======= + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_delegationManager\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"},{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"},{\"name\":\"_CALCULATION_INTERVAL_SECONDS\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_MAX_REWARDS_DURATION\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_MAX_RETROACTIVE_LENGTH\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_MAX_FUTURE_LENGTH\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"__GENESIS_REWARDS_TIMESTAMP\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"CALCULATION_INTERVAL_SECONDS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"GENESIS_REWARDS_TIMESTAMP\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_FUTURE_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_RETROACTIVE_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_REWARDS_DURATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"activationDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateEarnerLeafHash\",\"inputs\":[{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"calculateTokenLeafHash\",\"inputs\":[{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.TokenTreeMerkleLeaf\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"checkClaim\",\"inputs\":[{\"name\":\"claim\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.RewardsMerkleClaim\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimerFor\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createAVSRewardsSubmission\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createRewardsForAllEarners\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createRewardsForAllSubmission\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeClaimed\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currRewardsCalculationEndTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disableRoot\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentClaimableDistributionRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentDistributionRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDistributionRootAtIndex\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDistributionRootsLength\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRootIndexFromHash\",\"inputs\":[{\"name\":\"rootHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"globalOperatorCommissionBips\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"initialPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_rewardsUpdater\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_activationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_globalCommissionBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isAVSRewardsSubmissionHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsForAllSubmitter\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsSubmissionForAllEarnersHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsSubmissionForAllHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorCommissionBips\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"pauseAll\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pauserRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processClaim\",\"inputs\":[{\"name\":\"claim\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.RewardsMerkleClaim\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"rewardsUpdater\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setActivationDelay\",\"inputs\":[{\"name\":\"_activationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setClaimerFor\",\"inputs\":[{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setGlobalOperatorCommission\",\"inputs\":[{\"name\":\"_globalCommissionBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRewardsForAllSubmitter\",\"inputs\":[{\"name\":\"_submitter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_newValue\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRewardsUpdater\",\"inputs\":[{\"name\":\"_rewardsUpdater\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submissionNonce\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submitRoot\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSRewardsSubmissionCreated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinator.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ActivationDelaySet\",\"inputs\":[{\"name\":\"oldActivationDelay\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"newActivationDelay\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ClaimerForSet\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"oldClaimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DistributionRootDisabled\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DistributionRootSubmitted\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"},{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GlobalCommissionBipsSet\",\"inputs\":[{\"name\":\"oldGlobalCommissionBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"newGlobalCommissionBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PauserRegistrySet\",\"inputs\":[{\"name\":\"pauserRegistry\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIPauserRegistry\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsClaimed\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"earner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"claimedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsForAllSubmitterSet\",\"inputs\":[{\"name\":\"rewardsForAllSubmitter\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"oldValue\",\"type\":\"bool\",\"indexed\":true,\"internalType\":\"bool\"},{\"name\":\"newValue\",\"type\":\"bool\",\"indexed\":true,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsSubmissionForAllCreated\",\"inputs\":[{\"name\":\"submitter\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinator.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsSubmissionForAllEarnersCreated\",\"inputs\":[{\"name\":\"tokenHopper\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinator.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsUpdaterSet\",\"inputs\":[{\"name\":\"oldRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AmountExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AmountIsZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CurrentlyPaused\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DurationExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EarningsNotGreaterThanClaimed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputAddressZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputArrayLengthZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidClaimProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDurationRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidEarnerLeafIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidNewPausedStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidProofLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRootIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidStartTimestampRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidTokenLeafIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NewRootMustBeForNewCalculatedPeriod\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyPauser\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyUnpauser\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RewardsEndTimestampNotElapsed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootAlreadyActivated\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootDisabled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootNotActivated\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StartTimestampTooFarInFuture\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StartTimestampTooFarInPast\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategiesNotInAscendingOrder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategyNotWhitelisted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedCaller\",\"inputs\":[]}]", + Bin: "0x61018060405234801561001157600080fd5b5060405161377a38038061377a833981016040819052610030916102cf565b86868686868686610041858261035a565b63ffffffff16156100e55760405162461bcd60e51b815260206004820152606060248201527f52657761726473436f6f7264696e61746f723a2047454e455349535f5245574160448201527f5244535f54494d455354414d50206d7573742062652061206d756c7469706c6560648201527f206f662043414c43554c4154494f4e5f494e54455256414c5f5345434f4e4453608482015260a4015b60405180910390fd5b6100f2620151808661035a565b63ffffffff16156101915760405162461bcd60e51b815260206004820152605760248201527f52657761726473436f6f7264696e61746f723a2043414c43554c4154494f4e5f60448201527f494e54455256414c5f5345434f4e4453206d7573742062652061206d756c746960648201527f706c65206f6620534e415053484f545f434144454e4345000000000000000000608482015260a4016100dc565b6001600160a01b0396871661012052949095166101405263ffffffff92831660805290821660a052811660c05291821660e05216610100526101d16101e3565b50504661016052506103909350505050565b600054610100900460ff161561024b5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b60648201526084016100dc565b60005460ff9081161461029c576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146102b357600080fd5b50565b805163ffffffff811681146102ca57600080fd5b919050565b600080600080600080600060e0888a0312156102ea57600080fd5b87516102f58161029e565b60208901519097506103068161029e565b9550610314604089016102b6565b9450610322606089016102b6565b9350610330608089016102b6565b925061033e60a089016102b6565b915061034c60c089016102b6565b905092959891949750929550565b600063ffffffff83168061037e57634e487b7160e01b600052601260045260246000fd5b8063ffffffff84160691505092915050565b60805160a05160c05160e0516101005161012051610140516101605161335461042660003960006117d90152600081816104f501526121b7015260006107b501526000818161040c01526120a201526000818161033201526120f10152600081816104ce01526120510152600081816107140152611f2601526000818161068c01528181611f7d0152611fdc01526133546000f3fe608060405234801561001057600080fd5b50600436106102f05760003560e01c80637b8f8b051161019d578063d4540a55116100e9578063f698da25116100a2578063fabc1cbc1161007c578063fabc1cbc14610818578063fbf1e2c11461082b578063fce36c7d1461083e578063ff9f6cce1461085157600080fd5b8063f698da25146107ea578063f8cd8448146107f2578063f96abf2e1461080557600080fd5b8063d4540a5514610764578063de02e50314610777578063e221b2451461078a578063e810ce211461079d578063ea4d3c9b146107b0578063f2fde38b146107d757600080fd5b80639be3d4e411610156578063aebd8bae11610130578063aebd8bae146106c1578063bb7e451f146106ef578063bf21a8aa1461070f578063c46db6061461073657600080fd5b80639be3d4e41461067f5780639d45c28114610687578063a0169ddd146106ae57600080fd5b80637b8f8b05146105fa578063863cb9a914610602578063865c695314610615578063886f1195146106405780638da5cb5b146106535780639104c3191461066457600080fd5b806337838ed01161025c57806358baaa3e116102155780635c975abb116101ef5780635c975abb146105a95780635e9d8348146105b15780636d21117e146105c4578063715018a6146105f257600080fd5b806358baaa3e1461056b578063595c6a671461057e5780635ac86ab71461058657600080fd5b806337838ed0146104c957806339b70e38146104f05780633a8c0786146105175780633ccc861d1461052e5780633efe1db6146105415780634d18cc351461055457600080fd5b8063131433b4116102ae578063131433b414610407578063136439dd1461042e578063149bc8721461044157806322f19a64146104625780632b9f64a41461047557806336af41fa146104b657600080fd5b806218572c146102f557806304a0c5021461032d578063092db007146103695780630e9a53cf146103915780630eb38345146103df57806310d67a2f146103f4575b600080fd5b610318610303366004612bab565b60d16020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6103547f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610324565b60cb5461037e90600160e01b900461ffff1681565b60405161ffff9091168152602001610324565b610399610864565b604051610324919060006080820190508251825263ffffffff602084015116602083015263ffffffff604084015116604083015260608301511515606083015292915050565b6103f26103ed366004612bd6565b610943565b005b6103f2610402366004612bab565b6109c5565b6103547f000000000000000000000000000000000000000000000000000000000000000081565b6103f261043c366004612c0f565b610a79565b61045461044f366004612c40565b610b64565b604051908152602001610324565b61037e610470366004612c5c565b610bda565b61049e610483366004612bab565b60cc602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610324565b6103f26104c4366004612c8a565b610bef565b6103547f000000000000000000000000000000000000000000000000000000000000000081565b61049e7f000000000000000000000000000000000000000000000000000000000000000081565b60cb5461035490600160a01b900463ffffffff1681565b6103f261053c366004612d14565b610d94565b6103f261054f366004612d74565b611065565b60cb5461035490600160c01b900463ffffffff1681565b6103f2610579366004612da0565b61125b565b6103f261126c565b610318610594366004612dbb565b606654600160ff9092169190911b9081161490565b606654610454565b6103186105bf366004612dde565b611334565b6103186105d2366004612e13565b60cf60209081526000928352604080842090915290825290205460ff1681565b6103f26113c1565b60ca54610454565b6103f2610610366004612bab565b6113d5565b610454610623366004612c5c565b60cd60209081526000928352604080842090915290825290205481565b60655461049e906001600160a01b031681565b6033546001600160a01b031661049e565b61049e73beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac081565b6103996113e6565b6103547f000000000000000000000000000000000000000000000000000000000000000081565b6103f26106bc366004612bab565b611484565b6103186106cf366004612e13565b60d260209081526000928352604080842090915290825290205460ff1681565b6104546106fd366004612bab565b60ce6020526000908152604090205481565b6103547f000000000000000000000000000000000000000000000000000000000000000081565b610318610744366004612e13565b60d060209081526000928352604080842090915290825290205460ff1681565b6103f2610772366004612e5c565b6114e3565b610399610785366004612c0f565b611630565b6103f2610798366004612ecf565b6116c2565b6103546107ab366004612c0f565b6116d3565b61049e7f000000000000000000000000000000000000000000000000000000000000000081565b6103f26107e5366004612bab565b61175f565b6104546117d5565b610454610800366004612c40565b611812565b6103f2610813366004612da0565b611823565b6103f2610826366004612c0f565b611976565b60cb5461049e906001600160a01b031681565b6103f261084c366004612c8a565b611a7e565b6103f261085f366004612c8a565b611bd2565b60408051608081018252600080825260208201819052918101829052606081019190915260ca545b801561093f57600060ca6108a1600184612f00565b815481106108b1576108b1612f13565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff1615801560608301819052919250906109215750806040015163ffffffff164210155b1561092c5792915050565b508061093781612f29565b91505061088c565b5090565b61094b611d56565b6001600160a01b038216600081815260d1602052604080822054905160ff9091169284151592841515927f4de6293e668df1398422e1def12118052c1539a03cbfedc145895d48d7685f1c9190a4506001600160a01b0391909116600090815260d160205260409020805460ff1916911515919091179055565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3c9190612f40565b6001600160a01b0316336001600160a01b031614610a6d5760405163794821ff60e01b815260040160405180910390fd5b610a7681611db0565b50565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae59190612f5d565b610b0257604051631d77d47760e21b815260040160405180910390fd5b60665481811614610b265760405163c61dca5d60e01b815260040160405180910390fd5b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600080610b746020840184612bab565b8360200135604051602001610bbd9392919060f89390931b6001600160f81b031916835260609190911b6bffffffffffffffffffffffff19166001830152601582015260350190565b604051602081830303815290604052805190602001209050919050565b60cb54600160e01b900461ffff165b92915050565b606654600190600290811603610c185760405163840a48d560e01b815260040160405180910390fd5b33600090815260d1602052604090205460ff16610c4857604051635c427cd960e01b815260040160405180910390fd5b610c50611e40565b60005b82811015610d845736848483818110610c6e57610c6e612f13565b9050602002810190610c809190612f7a565b33600081815260ce60209081526040808320549051949550939192610cab92909185918791016130bf565b604051602081830303815290604052805190602001209050610ccc83611e99565b33600090815260d0602090815260408083208484529091529020805460ff19166001908117909155610cff9083906130ef565b33600081815260ce602052604090819020929092559051829184917f51088b8c89628df3a8174002c2a034d0152fce6af8415d651b2a4734bf27048290610d47908890613102565b60405180910390a4610d79333060408601803590610d689060208901612bab565b6001600160a01b03169291906122a4565b505050600101610c53565b50610d8f6001609755565b505050565b606654600290600490811603610dbd5760405163840a48d560e01b815260040160405180910390fd5b610dc5611e40565b600060ca610dd66020860186612da0565b63ffffffff1681548110610dec57610dec612f13565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff16151560608201529050610e4d8482612315565b6000610e5f6080860160608701612bab565b6001600160a01b03808216600090815260cc60205260409020549192501680610e855750805b336001600160a01b03821614610eae57604051635c427cd960e01b815260040160405180910390fd5b60005b610ebe60a0880188613115565b90508110156110575736610ed560e0890189613166565b83818110610ee557610ee5612f13565b6001600160a01b038716600090815260cd602090815260408083209302949094019450929091508290610f1a90850185612bab565b6001600160a01b03166001600160a01b0316815260200190815260200160002054905080826020013511610f615760405163aa385e8160e01b815260040160405180910390fd5b6000610f71826020850135612f00565b6001600160a01b038716600090815260cd60209081526040822092935085018035929190610f9f9087612bab565b6001600160a01b0316815260208082019290925260400160002091909155610fe1908a908390610fd190870187612bab565b6001600160a01b031691906124b9565b86516001600160a01b03808b1691878216918916907f9543dbd55580842586a951f0386e24d68a5df99ae29e3b216588b45fd684ce31906110256020890189612bab565b604080519283526001600160a01b039091166020830152810186905260600160405180910390a4505050600101610eb1565b50505050610d8f6001609755565b60665460039060089081160361108e5760405163840a48d560e01b815260040160405180910390fd5b60cb546001600160a01b031633146110b957604051635c427cd960e01b815260040160405180910390fd5b60cb5463ffffffff600160c01b9091048116908316116110ec57604051631ca7e50b60e21b815260040160405180910390fd5b428263ffffffff1610611112576040516306957c9160e11b815260040160405180910390fd5b60ca5460cb5460009061113290600160a01b900463ffffffff16426131b0565b6040805160808101825287815263ffffffff878116602080840182815286841685870181815260006060880181815260ca8054600181018255925297517f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee160029092029182015592517f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee290930180549151975193871667ffffffffffffffff1990921691909117600160201b978716979097029690961760ff60401b1916600160401b921515929092029190911790945560cb805463ffffffff60c01b1916600160c01b840217905593519283529394508892908616917fecd866c3c158fa00bf34d803d5f6023000b57080bcb48af004c2b4b46b3afd08910160405180910390a45050505050565b611263611d56565b610a76816124e9565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156112b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d89190612f5d565b6112f557604051631d77d47760e21b815260040160405180910390fd5b600019606681905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b60006113b98260ca6113496020830183612da0565b63ffffffff168154811061135f5761135f612f13565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff1615156060820152612315565b506001919050565b6113c9611d56565b6113d3600061255a565b565b6113dd611d56565b610a76816125ac565b60408051608081018252600080825260208201819052918101829052606081019190915260ca805461141a90600190612f00565b8154811061142a5761142a612f13565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff1615156060820152919050565b33600081815260cc602052604080822080546001600160a01b031981166001600160a01b038781169182179093559251911692839185917fbab947934d42e0ad206f25c9cab18b5bb6ae144acfb00f40b4e3aa59590ca31291a4505050565b600054610100900460ff16158080156115035750600054600160ff909116105b8061151d5750303b15801561151d575060005460ff166001145b6115855760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156115a8576000805461ff0019166101001790555b6115b0612608565b60c9556115bd868661269f565b6115c68761255a565b6115cf846125ac565b6115d8836124e9565b6115e182612724565b8015611627576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b60408051608081018252600080825260208201819052918101829052606081019190915260ca828154811061166757611667612f13565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff161515606082015292915050565b6116ca611d56565b610a7681612724565b60ca546000905b63ffffffff811615611745578260ca6116f46001846131cc565b63ffffffff168154811061170a5761170a612f13565b906000526020600020906002020160000154036117335761172c6001826131cc565b9392505050565b8061173d816131e8565b9150506116da565b5060405163504570e360e01b815260040160405180910390fd5b611767611d56565b6001600160a01b0381166117cc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161157c565b610a768161255a565b60007f00000000000000000000000000000000000000000000000000000000000000004603611805575060c95490565b61180d612608565b905090565b60006001610b746020840184612bab565b60665460039060089081160361184c5760405163840a48d560e01b815260040160405180910390fd5b60cb546001600160a01b0316331461187757604051635c427cd960e01b815260040160405180910390fd5b60ca5463ffffffff83161061189f576040516394a8d38960e01b815260040160405180910390fd5b600060ca8363ffffffff16815481106118ba576118ba612f13565b906000526020600020906002020190508060010160089054906101000a900460ff16156118fa57604051631b14174b60e01b815260040160405180910390fd5b6001810154600160201b900463ffffffff16421061192b57604051630c36f66560e21b815260040160405180910390fd5b60018101805460ff60401b1916600160401b17905560405163ffffffff8416907fd850e6e5dfa497b72661fa73df2923464eaed9dc2ff1d3cb82bccbfeabe5c41e90600090a2505050565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ed9190612f40565b6001600160a01b0316336001600160a01b031614611a1e5760405163794821ff60e01b815260040160405180910390fd5b606654198119606654191614611a475760405163c61dca5d60e01b815260040160405180910390fd5b606681905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610b59565b606654600090600190811603611aa75760405163840a48d560e01b815260040160405180910390fd5b611aaf611e40565b60005b82811015610d845736848483818110611acd57611acd612f13565b9050602002810190611adf9190612f7a565b33600081815260ce60209081526040808320549051949550939192611b0a92909185918791016130bf565b604051602081830303815290604052805190602001209050611b2b83611e99565b33600090815260cf602090815260408083208484529091529020805460ff19166001908117909155611b5e9083906130ef565b33600081815260ce602052604090819020929092559051829184917f450a367a380c4e339e5ae7340c8464ef27af7781ad9945cfe8abd828f89e628190611ba6908890613102565b60405180910390a4611bc7333060408601803590610d689060208901612bab565b505050600101611ab2565b606654600490601090811603611bfb5760405163840a48d560e01b815260040160405180910390fd5b33600090815260d1602052604090205460ff16611c2b57604051635c427cd960e01b815260040160405180910390fd5b611c33611e40565b60005b82811015610d845736848483818110611c5157611c51612f13565b9050602002810190611c639190612f7a565b33600081815260ce60209081526040808320549051949550939192611c8e92909185918791016130bf565b604051602081830303815290604052805190602001209050611caf83611e99565b33600090815260d2602090815260408083208484529091529020805460ff19166001908117909155611ce29083906130ef565b33600081815260ce602052604090819020929092559051829184917f5251b6fdefcb5d81144e735f69ea4c695fd43b0289ca53dc075033f5fc80068b90611d2a908890613102565b60405180910390a4611d4b333060408601803590610d689060208901612bab565b505050600101611c36565b6033546001600160a01b031633146113d35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161157c565b6001600160a01b038116611dd7576040516339b190bb60e11b815260040160405180910390fd5b606554604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b600260975403611e925760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161157c565b6002609755565b6000611ea58280613166565b905011611ec55760405163796cc52560e01b815260040160405180910390fd5b6000816040013511611eea576040516310eb483f60e21b815260040160405180910390fd5b6f4b3b4ca85a86c47a098a223fffffffff81604001351115611f1f5760405163070b5a6f60e21b815260040160405180910390fd5b63ffffffff7f000000000000000000000000000000000000000000000000000000000000000016611f5660a0830160808401612da0565b63ffffffff161115611f7b57604051630dd0b9f560e21b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000611fac60a0830160808401612da0565b611fb6919061321e565b63ffffffff1615611fda5760405163ee66470560e01b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000061200b6080830160608401612da0565b612015919061321e565b63ffffffff161561203957604051633c1a94f160e21b815260040160405180910390fd5b6120496080820160608301612da0565b63ffffffff167f000000000000000000000000000000000000000000000000000000000000000063ffffffff16426120819190612f00565b111580156120ca575061209a6080820160608301612da0565b63ffffffff167f000000000000000000000000000000000000000000000000000000000000000063ffffffff1611155b6120e75760405163041aa75760e11b815260040160405180910390fd5b61211763ffffffff7f000000000000000000000000000000000000000000000000000000000000000016426130ef565b6121276080830160608401612da0565b63ffffffff16111561214c57604051637ee2b44360e01b815260040160405180910390fd5b6000805b61215a8380613166565b9050811015610d8f57600061216f8480613166565b8381811061217f5761217f612f13565b6121959260206040909202019081019150612bab565b60405163198f077960e21b81526001600160a01b0380831660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063663c1de490602401602060405180830381865afa158015612200573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122249190612f5d565b8061224b57506001600160a01b03811673beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0145b61226857604051632efd965160e11b815260040160405180910390fd5b806001600160a01b0316836001600160a01b03161061229a5760405163dfad9ca160e01b815260040160405180910390fd5b9150600101612150565b6040516001600160a01b038085166024830152831660448201526064810182905261230f9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261278f565b50505050565b80606001511561233857604051631b14174b60e01b815260040160405180910390fd5b806040015163ffffffff1642101561236357604051631437a2bb60e31b815260040160405180910390fd5b61237060c0830183613115565b905061237f60a0840184613115565b90501461239f576040516343714afd60e01b815260040160405180910390fd5b6123ac60e0830183613166565b90506123bb60c0840184613115565b9050146123db576040516343714afd60e01b815260040160405180910390fd5b8051612407906123f16040850160208601612da0565b6123fe6040860186613246565b86606001612864565b60005b61241760a0840184613115565b9050811015610d8f576124b1608084013561243560a0860186613115565b8481811061244557612445612f13565b905060200201602081019061245a9190612da0565b61246760c0870187613115565b8581811061247757612477612f13565b90506020028101906124899190613246565b61249660e0890189613166565b878181106124a6576124a6612f13565b905060400201612912565b60010161240a565b6040516001600160a01b038316602482015260448101829052610d8f90849063a9059cbb60e01b906064016122d8565b60cb546040805163ffffffff600160a01b9093048316815291831660208301527faf557c6c02c208794817a705609cfa935f827312a1adfdd26494b6b95dd2b4b3910160405180910390a160cb805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60cb546040516001600160a01b038084169216907f237b82f438d75fc568ebab484b75b01d9287b9e98b490b7c23221623b6705dbb90600090a360cb80546001600160a01b0319166001600160a01b0392909216919091179055565b604080518082018252600a81526922b4b3b2b72630bcb2b960b11b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea81840152466060820152306080808301919091528351808303909101815260a0909101909252815191012090565b6065546001600160a01b03161580156126c057506001600160a01b03821615155b6126dd576040516339b190bb60e11b815260040160405180910390fd5b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a261272082611db0565b5050565b60cb546040805161ffff600160e01b9093048316815291831660208301527f8cdc428b0431b82d1619763f443a48197db344ba96905f3949643acd1c863a06910160405180910390a160cb805461ffff909216600160e01b0261ffff60e01b19909216919091179055565b60006127e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129519092919063ffffffff16565b90508051600014806128055750808060200190518101906128059190612f5d565b610d8f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161157c565b61286f60208361328d565b6001901b8463ffffffff16106128975760405162c6c39d60e71b815260040160405180910390fd5b60006128a282610b64565b90506128ed84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92508591505063ffffffff8916612968565b61290a576040516369ca16c960e01b815260040160405180910390fd5b505050505050565b61291d60208361328d565b6001901b8463ffffffff16106129465760405163054ff4df60e51b815260040160405180910390fd5b60006128a282611812565b60606129608484600085612980565b949350505050565b600083612976868585612a5b565b1495945050505050565b6060824710156129e15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161157c565b600080866001600160a01b031685876040516129fd91906132c5565b60006040518083038185875af1925050503d8060008114612a3a576040519150601f19603f3d011682016040523d82523d6000602084013e612a3f565b606091505b5091509150612a5087838387612af8565b979650505050505050565b600060208451612a6b91906132d7565b15612a89576040516313717da960e21b815260040160405180910390fd5b8260205b85518111612aef57612aa06002856132d7565b600003612ac457816000528086015160205260406000209150600284049350612add565b8086015160005281602052604060002091506002840493505b612ae86020826130ef565b9050612a8d565b50949350505050565b60608315612b67578251600003612b60576001600160a01b0385163b612b605760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161157c565b5081612960565b6129608383815115612b7c5781518083602001fd5b8060405162461bcd60e51b815260040161157c91906132eb565b6001600160a01b0381168114610a7657600080fd5b600060208284031215612bbd57600080fd5b813561172c81612b96565b8015158114610a7657600080fd5b60008060408385031215612be957600080fd5b8235612bf481612b96565b91506020830135612c0481612bc8565b809150509250929050565b600060208284031215612c2157600080fd5b5035919050565b600060408284031215612c3a57600080fd5b50919050565b600060408284031215612c5257600080fd5b61172c8383612c28565b60008060408385031215612c6f57600080fd5b8235612c7a81612b96565b91506020830135612c0481612b96565b60008060208385031215612c9d57600080fd5b823567ffffffffffffffff811115612cb457600080fd5b8301601f81018513612cc557600080fd5b803567ffffffffffffffff811115612cdc57600080fd5b8560208260051b8401011115612cf157600080fd5b6020919091019590945092505050565b60006101008284031215612c3a57600080fd5b60008060408385031215612d2757600080fd5b823567ffffffffffffffff811115612d3e57600080fd5b612d4a85828601612d01565b9250506020830135612c0481612b96565b803563ffffffff81168114612d6f57600080fd5b919050565b60008060408385031215612d8757600080fd5b82359150612d9760208401612d5b565b90509250929050565b600060208284031215612db257600080fd5b61172c82612d5b565b600060208284031215612dcd57600080fd5b813560ff8116811461172c57600080fd5b600060208284031215612df057600080fd5b813567ffffffffffffffff811115612e0757600080fd5b61296084828501612d01565b60008060408385031215612e2657600080fd5b8235612e3181612b96565b946020939093013593505050565b8035612d6f81612b96565b803561ffff81168114612d6f57600080fd5b60008060008060008060c08789031215612e7557600080fd5b8635612e8081612b96565b95506020870135612e9081612b96565b9450604087013593506060870135612ea781612b96565b9250612eb560808801612d5b565b9150612ec360a08801612e4a565b90509295509295509295565b600060208284031215612ee157600080fd5b61172c82612e4a565b634e487b7160e01b600052601160045260246000fd5b81810381811115610be957610be9612eea565b634e487b7160e01b600052603260045260246000fd5b600081612f3857612f38612eea565b506000190190565b600060208284031215612f5257600080fd5b815161172c81612b96565b600060208284031215612f6f57600080fd5b815161172c81612bc8565b60008235609e19833603018112612f9057600080fd5b9190910192915050565b81835260208301925060008160005b84811015613000578135612fbc81612b96565b6001600160a01b0316865260208201356bffffffffffffffffffffffff8116808214612fe757600080fd5b6020880152506040958601959190910190600101612fa9565b5093949350505050565b60008135601e1983360301811261302057600080fd5b820160208101903567ffffffffffffffff81111561303d57600080fd5b8060061b360382131561304f57600080fd5b60a0855261306160a086018284612f9a565b91505061307060208401612e3f565b6001600160a01b031660208501526040838101359085015261309460608401612d5b565b63ffffffff1660608501526130ab60808401612d5b565b63ffffffff81166080860152509392505050565b60018060a01b03841681528260208201526060604082015260006130e6606083018461300a565b95945050505050565b80820180821115610be957610be9612eea565b60208152600061172c602083018461300a565b6000808335601e1984360301811261312c57600080fd5b83018035915067ffffffffffffffff82111561314757600080fd5b6020019150600581901b360382131561315f57600080fd5b9250929050565b6000808335601e1984360301811261317d57600080fd5b83018035915067ffffffffffffffff82111561319857600080fd5b6020019150600681901b360382131561315f57600080fd5b63ffffffff8181168382160190811115610be957610be9612eea565b63ffffffff8281168282160390811115610be957610be9612eea565b600063ffffffff8216806131fe576131fe612eea565b6000190192915050565b634e487b7160e01b600052601260045260246000fd5b600063ffffffff83168061323457613234613208565b8063ffffffff84160691505092915050565b6000808335601e1984360301811261325d57600080fd5b83018035915067ffffffffffffffff82111561327857600080fd5b60200191503681900382131561315f57600080fd5b60008261329c5761329c613208565b500490565b60005b838110156132bc5781810151838201526020016132a4565b50506000910152565b60008251612f908184602087016132a1565b6000826132e6576132e6613208565b500690565b602081526000825180602084015261330a8160408501602087016132a1565b601f01601f1916919091016040019291505056fea26469706673582212202bee8412ee374b8fa10c52a69ba7784c634c77526b99fd1d5298b6f30d2802b764736f6c634300081b0033", +>>>>>>> b0193bfe (feat: alm tests) } // RewardsCoordinatorABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/RewardsCoordinatorStorage/binding.go b/pkg/bindings/RewardsCoordinatorStorage/binding.go index eefd529d1..9ed878ff6 100644 --- a/pkg/bindings/RewardsCoordinatorStorage/binding.go +++ b/pkg/bindings/RewardsCoordinatorStorage/binding.go @@ -93,7 +93,11 @@ type IRewardsCoordinatorTypesTokenTreeMerkleLeaf struct { // RewardsCoordinatorStorageMetaData contains all meta data concerning the RewardsCoordinatorStorage contract. var RewardsCoordinatorStorageMetaData = &bind.MetaData{ +<<<<<<< HEAD ABI: "[{\"type\":\"function\",\"name\":\"CALCULATION_INTERVAL_SECONDS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"GENESIS_REWARDS_TIMESTAMP\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_FUTURE_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_RETROACTIVE_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_REWARDS_DURATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"activationDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"allocationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIAllocationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateEarnerLeafHash\",\"inputs\":[{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"calculateTokenLeafHash\",\"inputs\":[{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.TokenTreeMerkleLeaf\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"checkClaim\",\"inputs\":[{\"name\":\"claim\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsMerkleClaim\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimerFor\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createAVSRewardsSubmission\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createOperatorDirectedAVSRewardsSubmission\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorDirectedRewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.OperatorDirectedRewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"operatorRewards\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.OperatorReward[]\",\"components\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"description\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createRewardsForAllEarners\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createRewardsForAllSubmission\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeClaimed\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[{\"name\":\"totalClaimed\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currRewardsCalculationEndTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"defaultOperatorSplitBips\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disableRoot\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getCurrentClaimableDistributionRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentDistributionRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDistributionRootAtIndex\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDistributionRootsLength\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorAVSSplit\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorPISplit\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRootIndexFromHash\",\"inputs\":[{\"name\":\"rootHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_rewardsUpdater\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_activationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_defaultSplitBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isAVSRewardsSubmissionHash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorDirectedAVSRewardsSubmissionHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsForAllSubmitter\",\"inputs\":[{\"name\":\"submitter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsSubmissionForAllEarnersHash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsSubmissionForAllHash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"valid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processClaim\",\"inputs\":[{\"name\":\"claim\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsMerkleClaim\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"processClaims\",\"inputs\":[{\"name\":\"claims\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.RewardsMerkleClaim[]\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinatorTypes.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"rewardsUpdater\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setActivationDelay\",\"inputs\":[{\"name\":\"_activationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setClaimerFor\",\"inputs\":[{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setClaimerFor\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setDefaultOperatorSplit\",\"inputs\":[{\"name\":\"split\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setOperatorAVSSplit\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"split\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setOperatorPISplit\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"split\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRewardsForAllSubmitter\",\"inputs\":[{\"name\":\"_submitter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_newValue\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRewardsUpdater\",\"inputs\":[{\"name\":\"_rewardsUpdater\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submissionNonce\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submitRoot\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSRewardsSubmissionCreated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ActivationDelaySet\",\"inputs\":[{\"name\":\"oldActivationDelay\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"newActivationDelay\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ClaimerForSet\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"oldClaimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DefaultOperatorSplitBipsSet\",\"inputs\":[{\"name\":\"oldDefaultOperatorSplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"newDefaultOperatorSplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DistributionRootDisabled\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DistributionRootSubmitted\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"},{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAVSSplitBipsSet\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"oldOperatorAVSSplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"newOperatorAVSSplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorDirectedAVSRewardsSubmissionCreated\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorDirectedRewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"operatorDirectedRewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinatorTypes.OperatorDirectedRewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"operatorRewards\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.OperatorReward[]\",\"components\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"description\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorPISplitBipsSet\",\"inputs\":[{\"name\":\"caller\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"oldOperatorPISplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"newOperatorPISplitBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsClaimed\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"earner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"claimedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsForAllSubmitterSet\",\"inputs\":[{\"name\":\"rewardsForAllSubmitter\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"oldValue\",\"type\":\"bool\",\"indexed\":true,\"internalType\":\"bool\"},{\"name\":\"newValue\",\"type\":\"bool\",\"indexed\":true,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsSubmissionForAllCreated\",\"inputs\":[{\"name\":\"submitter\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsSubmissionForAllEarnersCreated\",\"inputs\":[{\"name\":\"tokenHopper\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinatorTypes.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinatorTypes.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsUpdaterSet\",\"inputs\":[{\"name\":\"oldRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AmountExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AmountIsZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DurationExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EarningsNotGreaterThanClaimed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputArrayLengthZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidAddressZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCalculationIntervalSecondsRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidClaimProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDurationRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidEarner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidEarnerLeafIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidGenesisRewardsTimestampRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRootIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidStartTimestampRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidTokenLeafIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NewRootMustBeForNewCalculatedPeriod\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OperatorsNotInAscendingOrder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RewardsEndTimestampNotElapsed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootAlreadyActivated\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootDisabled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootNotActivated\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SplitExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StartTimestampTooFarInFuture\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StartTimestampTooFarInPast\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategiesNotInAscendingOrder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategyNotWhitelisted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SubmissionNotRetroactive\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedCaller\",\"inputs\":[]}]", +======= + ABI: "[{\"type\":\"function\",\"name\":\"CALCULATION_INTERVAL_SECONDS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"GENESIS_REWARDS_TIMESTAMP\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_FUTURE_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_RETROACTIVE_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_REWARDS_DURATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"activationDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateEarnerLeafHash\",\"inputs\":[{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"calculateTokenLeafHash\",\"inputs\":[{\"name\":\"leaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.TokenTreeMerkleLeaf\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"checkClaim\",\"inputs\":[{\"name\":\"claim\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.RewardsMerkleClaim\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimerFor\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createAVSRewardsSubmission\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createRewardsForAllEarners\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createRewardsForAllSubmission\",\"inputs\":[{\"name\":\"rewardsSubmission\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.RewardsSubmission[]\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeClaimed\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currRewardsCalculationEndTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disableRoot\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getCurrentClaimableDistributionRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentDistributionRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDistributionRootAtIndex\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.DistributionRoot\",\"components\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"disabled\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDistributionRootsLength\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRootIndexFromHash\",\"inputs\":[{\"name\":\"rootHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"globalOperatorCommissionBips\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isAVSRewardsSubmissionHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsForAllSubmitter\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsSubmissionForAllEarnersHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isRewardsSubmissionForAllHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorCommissionBips\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"processClaim\",\"inputs\":[{\"name\":\"claim\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.RewardsMerkleClaim\",\"components\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"earnerTreeProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"earnerLeaf\",\"type\":\"tuple\",\"internalType\":\"structIRewardsCoordinator.EarnerTreeMerkleLeaf\",\"components\":[{\"name\":\"earner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"earnerTokenRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"tokenIndices\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"tokenTreeProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"tokenLeaves\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.TokenTreeMerkleLeaf[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"cumulativeEarnings\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"rewardsUpdater\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setActivationDelay\",\"inputs\":[{\"name\":\"_activationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setClaimerFor\",\"inputs\":[{\"name\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setGlobalOperatorCommission\",\"inputs\":[{\"name\":\"_globalCommissionBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRewardsForAllSubmitter\",\"inputs\":[{\"name\":\"_submitter\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_newValue\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setRewardsUpdater\",\"inputs\":[{\"name\":\"_rewardsUpdater\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submissionNonce\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"submitRoot\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSRewardsSubmissionCreated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinator.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ActivationDelaySet\",\"inputs\":[{\"name\":\"oldActivationDelay\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"newActivationDelay\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ClaimerForSet\",\"inputs\":[{\"name\":\"earner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"oldClaimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DistributionRootDisabled\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DistributionRootSubmitted\",\"inputs\":[{\"name\":\"rootIndex\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"},{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsCalculationEndTimestamp\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"},{\"name\":\"activatedAt\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GlobalCommissionBipsSet\",\"inputs\":[{\"name\":\"oldGlobalCommissionBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"newGlobalCommissionBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsClaimed\",\"inputs\":[{\"name\":\"root\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"earner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"claimer\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"claimedAmount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsForAllSubmitterSet\",\"inputs\":[{\"name\":\"rewardsForAllSubmitter\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"oldValue\",\"type\":\"bool\",\"indexed\":true,\"internalType\":\"bool\"},{\"name\":\"newValue\",\"type\":\"bool\",\"indexed\":true,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsSubmissionForAllCreated\",\"inputs\":[{\"name\":\"submitter\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinator.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsSubmissionForAllEarnersCreated\",\"inputs\":[{\"name\":\"tokenHopper\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"submissionNonce\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"rewardsSubmissionHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewardsSubmission\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIRewardsCoordinator.RewardsSubmission\",\"components\":[{\"name\":\"strategiesAndMultipliers\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.StrategyAndMultiplier[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"multiplier\",\"type\":\"uint96\",\"internalType\":\"uint96\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"duration\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RewardsUpdaterSet\",\"inputs\":[{\"name\":\"oldRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AmountExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AmountIsZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DurationExceedsMax\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"EarningsNotGreaterThanClaimed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InputArrayLengthZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidClaimProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDurationRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidEarnerLeafIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRootIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidStartTimestampRemainder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidTokenLeafIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NewRootMustBeForNewCalculatedPeriod\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RewardsEndTimestampNotElapsed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootAlreadyActivated\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootDisabled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"RootNotActivated\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StartTimestampTooFarInFuture\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StartTimestampTooFarInPast\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategiesNotInAscendingOrder\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategyNotWhitelisted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedCaller\",\"inputs\":[]}]", +>>>>>>> b0193bfe (feat: alm tests) } // RewardsCoordinatorStorageABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/SlashingConstants/binding.go b/pkg/bindings/SlashingConstants/binding.go new file mode 100644 index 000000000..0a9cb4c71 --- /dev/null +++ b/pkg/bindings/SlashingConstants/binding.go @@ -0,0 +1,327 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package SlashingConstants + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// SlashingConstantsMetaData contains all meta data concerning the SlashingConstants contract. +var SlashingConstantsMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"DEALLOCATION_DELAY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"INITIAL_TOTAL_MAGNITUDE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PRECISION_FACTOR\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PRECISION_FACTOR_SQUARED\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"}]", + Bin: "0x61010561003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060515760003560e01c806321afdf8e1460565780632981eb7714607e5780639a543ca414609b578063ccd34cd51460c1575b600080fd5b606b6ec097ce7bc90715b34b9f100000000081565b6040519081526020015b60405180910390f35b60876217124081565b60405163ffffffff90911681526020016075565b60a9670de0b6b3a764000081565b60405167ffffffffffffffff90911681526020016075565b606b670de0b6b3a76400008156fea264697066735822122051573b877db53ce7fd9202510ed740ac5b29774096c961210de6c69c249f537264736f6c634300080c0033", +} + +// SlashingConstantsABI is the input ABI used to generate the binding from. +// Deprecated: Use SlashingConstantsMetaData.ABI instead. +var SlashingConstantsABI = SlashingConstantsMetaData.ABI + +// SlashingConstantsBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use SlashingConstantsMetaData.Bin instead. +var SlashingConstantsBin = SlashingConstantsMetaData.Bin + +// DeploySlashingConstants deploys a new Ethereum contract, binding an instance of SlashingConstants to it. +func DeploySlashingConstants(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SlashingConstants, error) { + parsed, err := SlashingConstantsMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SlashingConstantsBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &SlashingConstants{SlashingConstantsCaller: SlashingConstantsCaller{contract: contract}, SlashingConstantsTransactor: SlashingConstantsTransactor{contract: contract}, SlashingConstantsFilterer: SlashingConstantsFilterer{contract: contract}}, nil +} + +// SlashingConstants is an auto generated Go binding around an Ethereum contract. +type SlashingConstants struct { + SlashingConstantsCaller // Read-only binding to the contract + SlashingConstantsTransactor // Write-only binding to the contract + SlashingConstantsFilterer // Log filterer for contract events +} + +// SlashingConstantsCaller is an auto generated read-only Go binding around an Ethereum contract. +type SlashingConstantsCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SlashingConstantsTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SlashingConstantsTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SlashingConstantsFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SlashingConstantsFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SlashingConstantsSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SlashingConstantsSession struct { + Contract *SlashingConstants // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SlashingConstantsCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SlashingConstantsCallerSession struct { + Contract *SlashingConstantsCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SlashingConstantsTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SlashingConstantsTransactorSession struct { + Contract *SlashingConstantsTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SlashingConstantsRaw is an auto generated low-level Go binding around an Ethereum contract. +type SlashingConstantsRaw struct { + Contract *SlashingConstants // Generic contract binding to access the raw methods on +} + +// SlashingConstantsCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SlashingConstantsCallerRaw struct { + Contract *SlashingConstantsCaller // Generic read-only contract binding to access the raw methods on +} + +// SlashingConstantsTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SlashingConstantsTransactorRaw struct { + Contract *SlashingConstantsTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSlashingConstants creates a new instance of SlashingConstants, bound to a specific deployed contract. +func NewSlashingConstants(address common.Address, backend bind.ContractBackend) (*SlashingConstants, error) { + contract, err := bindSlashingConstants(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SlashingConstants{SlashingConstantsCaller: SlashingConstantsCaller{contract: contract}, SlashingConstantsTransactor: SlashingConstantsTransactor{contract: contract}, SlashingConstantsFilterer: SlashingConstantsFilterer{contract: contract}}, nil +} + +// NewSlashingConstantsCaller creates a new read-only instance of SlashingConstants, bound to a specific deployed contract. +func NewSlashingConstantsCaller(address common.Address, caller bind.ContractCaller) (*SlashingConstantsCaller, error) { + contract, err := bindSlashingConstants(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SlashingConstantsCaller{contract: contract}, nil +} + +// NewSlashingConstantsTransactor creates a new write-only instance of SlashingConstants, bound to a specific deployed contract. +func NewSlashingConstantsTransactor(address common.Address, transactor bind.ContractTransactor) (*SlashingConstantsTransactor, error) { + contract, err := bindSlashingConstants(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SlashingConstantsTransactor{contract: contract}, nil +} + +// NewSlashingConstantsFilterer creates a new log filterer instance of SlashingConstants, bound to a specific deployed contract. +func NewSlashingConstantsFilterer(address common.Address, filterer bind.ContractFilterer) (*SlashingConstantsFilterer, error) { + contract, err := bindSlashingConstants(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SlashingConstantsFilterer{contract: contract}, nil +} + +// bindSlashingConstants binds a generic wrapper to an already deployed contract. +func bindSlashingConstants(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := SlashingConstantsMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SlashingConstants *SlashingConstantsRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SlashingConstants.Contract.SlashingConstantsCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SlashingConstants *SlashingConstantsRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SlashingConstants.Contract.SlashingConstantsTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SlashingConstants *SlashingConstantsRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SlashingConstants.Contract.SlashingConstantsTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SlashingConstants *SlashingConstantsCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SlashingConstants.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SlashingConstants *SlashingConstantsTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SlashingConstants.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SlashingConstants *SlashingConstantsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SlashingConstants.Contract.contract.Transact(opts, method, params...) +} + +// DEALLOCATIONDELAY is a free data retrieval call binding the contract method 0x2981eb77. +// +// Solidity: function DEALLOCATION_DELAY() view returns(uint32) +func (_SlashingConstants *SlashingConstantsCaller) DEALLOCATIONDELAY(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _SlashingConstants.contract.Call(opts, &out, "DEALLOCATION_DELAY") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// DEALLOCATIONDELAY is a free data retrieval call binding the contract method 0x2981eb77. +// +// Solidity: function DEALLOCATION_DELAY() view returns(uint32) +func (_SlashingConstants *SlashingConstantsSession) DEALLOCATIONDELAY() (uint32, error) { + return _SlashingConstants.Contract.DEALLOCATIONDELAY(&_SlashingConstants.CallOpts) +} + +// DEALLOCATIONDELAY is a free data retrieval call binding the contract method 0x2981eb77. +// +// Solidity: function DEALLOCATION_DELAY() view returns(uint32) +func (_SlashingConstants *SlashingConstantsCallerSession) DEALLOCATIONDELAY() (uint32, error) { + return _SlashingConstants.Contract.DEALLOCATIONDELAY(&_SlashingConstants.CallOpts) +} + +// INITIALTOTALMAGNITUDE is a free data retrieval call binding the contract method 0x9a543ca4. +// +// Solidity: function INITIAL_TOTAL_MAGNITUDE() view returns(uint64) +func (_SlashingConstants *SlashingConstantsCaller) INITIALTOTALMAGNITUDE(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _SlashingConstants.contract.Call(opts, &out, "INITIAL_TOTAL_MAGNITUDE") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// INITIALTOTALMAGNITUDE is a free data retrieval call binding the contract method 0x9a543ca4. +// +// Solidity: function INITIAL_TOTAL_MAGNITUDE() view returns(uint64) +func (_SlashingConstants *SlashingConstantsSession) INITIALTOTALMAGNITUDE() (uint64, error) { + return _SlashingConstants.Contract.INITIALTOTALMAGNITUDE(&_SlashingConstants.CallOpts) +} + +// INITIALTOTALMAGNITUDE is a free data retrieval call binding the contract method 0x9a543ca4. +// +// Solidity: function INITIAL_TOTAL_MAGNITUDE() view returns(uint64) +func (_SlashingConstants *SlashingConstantsCallerSession) INITIALTOTALMAGNITUDE() (uint64, error) { + return _SlashingConstants.Contract.INITIALTOTALMAGNITUDE(&_SlashingConstants.CallOpts) +} + +// PRECISIONFACTOR is a free data retrieval call binding the contract method 0xccd34cd5. +// +// Solidity: function PRECISION_FACTOR() view returns(uint256) +func (_SlashingConstants *SlashingConstantsCaller) PRECISIONFACTOR(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SlashingConstants.contract.Call(opts, &out, "PRECISION_FACTOR") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PRECISIONFACTOR is a free data retrieval call binding the contract method 0xccd34cd5. +// +// Solidity: function PRECISION_FACTOR() view returns(uint256) +func (_SlashingConstants *SlashingConstantsSession) PRECISIONFACTOR() (*big.Int, error) { + return _SlashingConstants.Contract.PRECISIONFACTOR(&_SlashingConstants.CallOpts) +} + +// PRECISIONFACTOR is a free data retrieval call binding the contract method 0xccd34cd5. +// +// Solidity: function PRECISION_FACTOR() view returns(uint256) +func (_SlashingConstants *SlashingConstantsCallerSession) PRECISIONFACTOR() (*big.Int, error) { + return _SlashingConstants.Contract.PRECISIONFACTOR(&_SlashingConstants.CallOpts) +} + +// PRECISIONFACTORSQUARED is a free data retrieval call binding the contract method 0x21afdf8e. +// +// Solidity: function PRECISION_FACTOR_SQUARED() view returns(uint256) +func (_SlashingConstants *SlashingConstantsCaller) PRECISIONFACTORSQUARED(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SlashingConstants.contract.Call(opts, &out, "PRECISION_FACTOR_SQUARED") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PRECISIONFACTORSQUARED is a free data retrieval call binding the contract method 0x21afdf8e. +// +// Solidity: function PRECISION_FACTOR_SQUARED() view returns(uint256) +func (_SlashingConstants *SlashingConstantsSession) PRECISIONFACTORSQUARED() (*big.Int, error) { + return _SlashingConstants.Contract.PRECISIONFACTORSQUARED(&_SlashingConstants.CallOpts) +} + +// PRECISIONFACTORSQUARED is a free data retrieval call binding the contract method 0x21afdf8e. +// +// Solidity: function PRECISION_FACTOR_SQUARED() view returns(uint256) +func (_SlashingConstants *SlashingConstantsCallerSession) PRECISIONFACTORSQUARED() (*big.Int, error) { + return _SlashingConstants.Contract.PRECISIONFACTORSQUARED(&_SlashingConstants.CallOpts) +} diff --git a/pkg/bindings/StrategyManagerStorage/binding.go b/pkg/bindings/StrategyManagerStorage/binding.go index e2ab6c6ca..fc0198585 100644 --- a/pkg/bindings/StrategyManagerStorage/binding.go +++ b/pkg/bindings/StrategyManagerStorage/binding.go @@ -31,7 +31,11 @@ var ( // StrategyManagerStorageMetaData contains all meta data concerning the StrategyManagerStorage contract. var StrategyManagerStorageMetaData = &bind.MetaData{ +<<<<<<< HEAD ABI: "[{\"type\":\"function\",\"name\":\"DEFAULT_BURN_ADDRESS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DEPOSIT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addStrategiesToDepositWhitelist\",\"inputs\":[{\"name\":\"strategiesToWhitelist\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"burnShares\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"sharesToBurn\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"calculateStrategyDepositDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositIntoStrategy\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositIntoStrategyWithSignature\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getDeposits\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getStakerStrategyList\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialStrategyWhitelister\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"nonces\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"removeDepositShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"depositSharesToRemove\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeStrategiesFromDepositWhitelist\",\"inputs\":[{\"name\":\"strategiesToRemoveFromWhitelist\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setStrategyWhitelister\",\"inputs\":[{\"name\":\"newStrategyWhitelister\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"stakerDepositShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerStrategyList\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"strategies\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerStrategyListLength\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyIsWhitelistedForDeposit\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"whitelisted\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWhitelister\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Deposit\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyAddedToDepositWhitelist\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyRemovedFromDepositWhitelist\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWhitelisterChanged\",\"inputs\":[{\"name\":\"previousAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InputArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MaxStrategiesExceeded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyDelegationManager\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyStrategyWhitelister\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SharesAmountTooHigh\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SharesAmountZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StakerAddressZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategyNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategyNotWhitelisted\",\"inputs\":[]}]", +======= + ABI: "[{\"type\":\"function\",\"name\":\"DEPOSIT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addStrategiesToDepositWhitelist\",\"inputs\":[{\"name\":\"strategiesToWhitelist\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"thirdPartyTransfersForbiddenValues\",\"type\":\"bool[]\",\"internalType\":\"bool[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositIntoStrategy\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositIntoStrategyWithSignature\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"eigenPodManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDeposits\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonces\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"removeShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeStrategiesFromDepositWhitelist\",\"inputs\":[{\"name\":\"strategiesToRemoveFromWhitelist\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setThirdPartyTransfersForbidden\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"value\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerStrategyList\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerStrategyListLength\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerStrategyShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyIsWhitelistedForDeposit\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWhitelister\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"thirdPartyTransfersForbidden\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Deposit\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyAddedToDepositWhitelist\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyRemovedFromDepositWhitelist\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWhitelisterChanged\",\"inputs\":[{\"name\":\"previousAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UpdatedThirdPartyTransfersForbidden\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"value\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InputArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InsufficientShares\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MaxStrategiesExceeded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SharesAmountZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SignatureExpired\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StakerAddressZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategyNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StrategyNotWhitelisted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ThirdPartyTransfersDisabled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedCaller\",\"inputs\":[]}]", +>>>>>>> b0193bfe (feat: alm tests) } // StrategyManagerStorageABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/StructuredLinkedList/binding.go b/pkg/bindings/StructuredLinkedList/binding.go new file mode 100644 index 000000000..5de10dd1b --- /dev/null +++ b/pkg/bindings/StructuredLinkedList/binding.go @@ -0,0 +1,203 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package StructuredLinkedList + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// StructuredLinkedListMetaData contains all meta data concerning the StructuredLinkedList contract. +var StructuredLinkedListMetaData = &bind.MetaData{ + ABI: "[]", + Bin: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b3d8cd97ef52a473687961fd194936f54822b92a1bc319ace882ae14dd29ccfc64736f6c634300081b0033", +} + +// StructuredLinkedListABI is the input ABI used to generate the binding from. +// Deprecated: Use StructuredLinkedListMetaData.ABI instead. +var StructuredLinkedListABI = StructuredLinkedListMetaData.ABI + +// StructuredLinkedListBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use StructuredLinkedListMetaData.Bin instead. +var StructuredLinkedListBin = StructuredLinkedListMetaData.Bin + +// DeployStructuredLinkedList deploys a new Ethereum contract, binding an instance of StructuredLinkedList to it. +func DeployStructuredLinkedList(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *StructuredLinkedList, error) { + parsed, err := StructuredLinkedListMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(StructuredLinkedListBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &StructuredLinkedList{StructuredLinkedListCaller: StructuredLinkedListCaller{contract: contract}, StructuredLinkedListTransactor: StructuredLinkedListTransactor{contract: contract}, StructuredLinkedListFilterer: StructuredLinkedListFilterer{contract: contract}}, nil +} + +// StructuredLinkedList is an auto generated Go binding around an Ethereum contract. +type StructuredLinkedList struct { + StructuredLinkedListCaller // Read-only binding to the contract + StructuredLinkedListTransactor // Write-only binding to the contract + StructuredLinkedListFilterer // Log filterer for contract events +} + +// StructuredLinkedListCaller is an auto generated read-only Go binding around an Ethereum contract. +type StructuredLinkedListCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StructuredLinkedListTransactor is an auto generated write-only Go binding around an Ethereum contract. +type StructuredLinkedListTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StructuredLinkedListFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type StructuredLinkedListFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StructuredLinkedListSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type StructuredLinkedListSession struct { + Contract *StructuredLinkedList // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StructuredLinkedListCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type StructuredLinkedListCallerSession struct { + Contract *StructuredLinkedListCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// StructuredLinkedListTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type StructuredLinkedListTransactorSession struct { + Contract *StructuredLinkedListTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StructuredLinkedListRaw is an auto generated low-level Go binding around an Ethereum contract. +type StructuredLinkedListRaw struct { + Contract *StructuredLinkedList // Generic contract binding to access the raw methods on +} + +// StructuredLinkedListCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type StructuredLinkedListCallerRaw struct { + Contract *StructuredLinkedListCaller // Generic read-only contract binding to access the raw methods on +} + +// StructuredLinkedListTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type StructuredLinkedListTransactorRaw struct { + Contract *StructuredLinkedListTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewStructuredLinkedList creates a new instance of StructuredLinkedList, bound to a specific deployed contract. +func NewStructuredLinkedList(address common.Address, backend bind.ContractBackend) (*StructuredLinkedList, error) { + contract, err := bindStructuredLinkedList(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &StructuredLinkedList{StructuredLinkedListCaller: StructuredLinkedListCaller{contract: contract}, StructuredLinkedListTransactor: StructuredLinkedListTransactor{contract: contract}, StructuredLinkedListFilterer: StructuredLinkedListFilterer{contract: contract}}, nil +} + +// NewStructuredLinkedListCaller creates a new read-only instance of StructuredLinkedList, bound to a specific deployed contract. +func NewStructuredLinkedListCaller(address common.Address, caller bind.ContractCaller) (*StructuredLinkedListCaller, error) { + contract, err := bindStructuredLinkedList(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &StructuredLinkedListCaller{contract: contract}, nil +} + +// NewStructuredLinkedListTransactor creates a new write-only instance of StructuredLinkedList, bound to a specific deployed contract. +func NewStructuredLinkedListTransactor(address common.Address, transactor bind.ContractTransactor) (*StructuredLinkedListTransactor, error) { + contract, err := bindStructuredLinkedList(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &StructuredLinkedListTransactor{contract: contract}, nil +} + +// NewStructuredLinkedListFilterer creates a new log filterer instance of StructuredLinkedList, bound to a specific deployed contract. +func NewStructuredLinkedListFilterer(address common.Address, filterer bind.ContractFilterer) (*StructuredLinkedListFilterer, error) { + contract, err := bindStructuredLinkedList(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &StructuredLinkedListFilterer{contract: contract}, nil +} + +// bindStructuredLinkedList binds a generic wrapper to an already deployed contract. +func bindStructuredLinkedList(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := StructuredLinkedListMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_StructuredLinkedList *StructuredLinkedListRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StructuredLinkedList.Contract.StructuredLinkedListCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_StructuredLinkedList *StructuredLinkedListRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StructuredLinkedList.Contract.StructuredLinkedListTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StructuredLinkedList *StructuredLinkedListRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StructuredLinkedList.Contract.StructuredLinkedListTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_StructuredLinkedList *StructuredLinkedListCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StructuredLinkedList.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_StructuredLinkedList *StructuredLinkedListTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StructuredLinkedList.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StructuredLinkedList *StructuredLinkedListTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StructuredLinkedList.Contract.contract.Transact(opts, method, params...) +} diff --git a/script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol b/script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol new file mode 100644 index 000000000..832556c57 --- /dev/null +++ b/script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "../../utils/ExistingDeploymentParser.sol"; +import "../../utils/TimelockEncoding.sol"; + +// forge script script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol:Mainnet_Unpause_Deposits --fork-url $RPC_MAINNET -vvvv +contract Mainnet_Unpause_Deposits is ExistingDeploymentParser, TimelockEncoding { + Vm cheats = Vm(VM_ADDRESS); + + // Tues Apr 16 2024 12:00:00 GMT-0700 (Pacific Daylight Time) + uint256 timelockEta = 1713250800; + + function run() external virtual { + _parseDeployedContracts("script/output/mainnet/M1_deployment_mainnet_2023_6_9.json"); + + bytes memory final_calldata_to_executor_multisig = encodeForExecutor({ + // call to executor will be from the timelock + from: timelock, + // performing single pause operation + to: address(strategyManager), + // value to send in tx + value: 0, + // calldata for the operation + data: abi.encodeWithSelector(Pausable.unpause.selector, 0), + // operation type (for performing single operation) + operation: ISafe.Operation.Call + }); + + (bytes memory calldata_to_timelock_queuing_action, bytes memory calldata_to_timelock_executing_action) = encodeForTimelock({ + // address to be called from the timelock + to: executorMultisig, + // value to send in tx + value: 0, + // calldata for the operation + data: final_calldata_to_executor_multisig, + // time at which the tx will become executable + timelockEta: timelockEta + }); + + bytes32 expectedTxHash = getTxHash({ + target: executorMultisig, + _value: 0, + _data: final_calldata_to_executor_multisig, + eta: timelockEta + }); + emit log_named_bytes32("expectedTxHash", expectedTxHash); + + cheats.prank(operationsMultisig); + (bool success, ) = timelock.call(calldata_to_timelock_queuing_action); + require(success, "call to timelock queuing action failed"); + + require(ITimelock(timelock).queuedTransactions(expectedTxHash), "expectedTxHash not queued"); + + // test performing the upgrade + cheats.warp(timelockEta); + cheats.prank(operationsMultisig); + (success, ) = timelock.call(calldata_to_timelock_executing_action); + require(success, "call to timelock executing action failed"); + + // Check correctness after upgrade + require(strategyManager.paused() == 0, "unpausing was not completed correctly"); + } + + function getTxHash(address target, uint256 _value, bytes memory _data, uint256 eta) public pure returns (bytes32) { + // empty bytes + bytes memory signature; + bytes32 txHash = keccak256(abi.encode(target, _value, signature, _data, eta)); + return txHash; + } +} \ No newline at end of file diff --git a/script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json b/script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json new file mode 100644 index 000000000..ecd86e029 --- /dev/null +++ b/script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json @@ -0,0 +1,60 @@ +{ + "chainInfo": { + "chainId": 17000 + }, + "multisig_addresses": { + "pauserMultisig": "0x53410249ec7d3a3F9F1ba3912D50D6A3Df6d10A7", + "communityMultisig": "0xCb8d2f9e55Bc7B1FA9d089f9aC80C583D2BDD5F7", + "operationsMultisig": "0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d", + "executorMultisig": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", + "timelock": "0xcF19CE0561052a7A7Ff21156730285997B350A7D" + }, + "strategies": { + "numStrategies": 0, + "MAX_PER_DEPOSIT": 115792089237316195423570985008687907853269984665640564039457584007913129639935, + "MAX_TOTAL_DEPOSITS": 115792089237316195423570985008687907853269984665640564039457584007913129639935, + "strategiesToDeploy": [] + }, + "strategyManager": { + "init_strategy_whitelister": "0x28Ade60640fdBDb2609D8d8734D1b5cBeFc0C348", + "init_paused_status": 0 + }, + "delegationManager": { + "init_paused_status": 0, + "init_minWithdrawalDelayBlocks": 10 + }, + "rewardsCoordinator": { + "init_paused_status": 0, + "CALCULATION_INTERVAL_SECONDS": 604800, + "MAX_REWARDS_DURATION": 6048000, + "MAX_RETROACTIVE_LENGTH": 7776000, + "MAX_FUTURE_LENGTH": 2592000, + "GENESIS_REWARDS_TIMESTAMP": 1710979200, + "rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4", + "activation_delay": 7200, + "calculation_interval_seconds": 604800, + "global_operator_commission_bips": 1000, + "OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000, + "OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000 + }, + "avsDirectory": { + "init_paused_status": 0 + }, + "slasher": { + "init_paused_status": 0 + }, + "eigenPod": { + "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": 32000000000, + "GENESIS_TIME": 1695902400 + }, + "eigenPodManager": { + "init_paused_status": 0, + "deneb_fork_timestamp": "1707305664" + }, + "delayedWithdrawalRouter": { + "init_paused_status": 0, + "init_withdrawalDelayBlocks": 10 + }, + "ethPOSDepositAddress": "0x4242424242424242424242424242424242424242", + "beaconOracleAddress": "0x4C116BB629bff7A8373c2378bBd919f8349B8f25" +} \ No newline at end of file diff --git a/script/configs/local/deploy_from_scratch.anvil.config.json b/script/configs/local/deploy_from_scratch.anvil.config.json index f8b15599d..02a31dccb 100644 --- a/script/configs/local/deploy_from_scratch.anvil.config.json +++ b/script/configs/local/deploy_from_scratch.anvil.config.json @@ -14,6 +14,7 @@ "max_per_deposit": 115792089237316195423570985008687907853269984665640564039457584007913129639935, "max_deposits": 115792089237316195423570985008687907853269984665640564039457584007913129639935 } +<<<<<<< HEAD ], "strategyManager": { "init_paused_status": 0, @@ -58,4 +59,49 @@ "ALLOCATION_CONFIGURATION_DELAY": 1200 }, "ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa" +======= + ], + "strategyManager": { + "init_paused_status": 0, + "init_withdrawal_delay_blocks": 1 + }, + "eigenPod": { + "PARTIAL_WITHDRAWAL_FRAUD_PROOF_PERIOD_BLOCKS": 1, + "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": "32000000000" + }, + "eigenPodManager": { + "init_paused_status": 30 + }, + "delayedWithdrawalRouter": { + "init_paused_status": 0, + "init_withdrawal_delay_blocks": 1 + }, + "slasher": { + "init_paused_status": 0 + }, + "delegation": { + "init_paused_status": 0, + "init_withdrawal_delay_blocks": 1 + }, + "rewardsCoordinator": { + "init_paused_status": 0, + "CALCULATION_INTERVAL_SECONDS": 604800, + "MAX_REWARDS_DURATION": 6048000, + "MAX_RETROACTIVE_LENGTH": 7776000, + "MAX_FUTURE_LENGTH": 2592000, + "GENESIS_REWARDS_TIMESTAMP": 1710979200, + "rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4", + "activation_delay": 7200, + "calculation_interval_seconds": 604800, + "global_operator_commission_bips": 1000, + "OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000, + "OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000 + }, + "allocationManager": { + "init_paused_status": 0, + "DEALLOCATION_DELAY": 900, + "ALLOCATION_CONFIGURATION_DELAY": 1200 + }, + "ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa" +>>>>>>> b0193bfe (feat: alm tests) } \ No newline at end of file diff --git a/script/deploy/devnet/Upgrade.s.sol b/script/deploy/devnet/Upgrade.s.sol new file mode 100644 index 000000000..b9b430512 --- /dev/null +++ b/script/deploy/devnet/Upgrade.s.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; +import "../../utils/ExistingDeploymentParser.sol"; + +// # To load the variables in the .env file +// source .env + +// Generic upgrade script, DOES NOT UPDATE IMPLEMENTATION IN OUTPUT FILE +// forge script script/deploy/devnet/Upgrade.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY +contract Upgrade is ExistingDeploymentParser { + + function run() external { + // EDIT this for your script + _parseDeployedContracts("script/output/holesky/pre_preprod_slashing.holesky.json"); + + vm.startBroadcast(); + AVSDirectory newAVSDirectoryImplementation = new AVSDirectory(delegationManager, eigenLayerPauserReg); + eigenLayerProxyAdmin.upgrade(ITransparentUpgradeableProxy(payable(address(avsDirectory))), address(newAVSDirectoryImplementation)); + vm.stopBroadcast(); + + } +} \ No newline at end of file diff --git a/script/deploy/devnet/deploy_from_scratch.s.sol b/script/deploy/devnet/deploy_from_scratch.s.sol index 33bb92320..a09974b87 100644 --- a/script/deploy/devnet/deploy_from_scratch.s.sol +++ b/script/deploy/devnet/deploy_from_scratch.s.sol @@ -318,9 +318,18 @@ contract DeployFromScratch is Script, Test { ) ); +<<<<<<< HEAD eigenLayerProxyAdmin.upgrade( ITransparentUpgradeableProxy(payable(address(permissionController))), address(permissionControllerImplementation) +======= + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(permissionController))), + address(permissionControllerImplementation), + abi.encodeWithSelector( + PermissionController.initialize.selector + ) +>>>>>>> b0193bfe (feat: alm tests) ); // Deploy strategyFactory & base @@ -403,8 +412,11 @@ contract DeployFromScratch is Script, Test { vm.serializeAddress(deployed_addresses, "avsDirectoryImplementation", address(avsDirectoryImplementation)); vm.serializeAddress(deployed_addresses, "allocationManager", address(allocationManager)); vm.serializeAddress(deployed_addresses, "allocationManagerImplementation", address(allocationManagerImplementation)); +<<<<<<< HEAD vm.serializeAddress(deployed_addresses, "permissionController", address(permissionController)); vm.serializeAddress(deployed_addresses, "permissionControllerImplementation", address(permissionControllerImplementation)); +======= +>>>>>>> b0193bfe (feat: alm tests) vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); vm.serializeAddress( deployed_addresses, diff --git a/script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol b/script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol new file mode 100644 index 000000000..61c504c94 --- /dev/null +++ b/script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "./Deploy_Test_RewardsCoordinator.s.sol"; + +/** + * @notice Script used for the first deployment of EigenLayer core contracts to Holesky + * anvil --fork-url $RPC_HOLESKY + * Local Fork: Deploy/Upgrade RewardsCoordinator + * forge script script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv --sig "run(string memory deployArg)" deploy + * forge script script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv --sig "run(string memory deployArg)" upgrade + * + * Holesky testnet: Deploy/Upgrade RewardsCoordinator + * forge script script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv --sig "run(string memory deployArg)" deploy + * forge script script/deploy/holesky/Deploy_Preprod_RewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv --sig "run(string memory deployArg)" upgrade + * + */ +contract Deploy_Preprod_RewardsCoordinator is Deploy_Test_RewardsCoordinator { + function run(string memory deployArg) external virtual { + _parseInitialDeploymentParams("script/configs/holesky/eigenlayer_preprod.config.json"); + _parseDeployedContracts("script/output/holesky/M2_deploy_preprod.output.json"); + + // Overwrite testAddress and multisigs to be EOAowner + testAddress = msg.sender; + executorMultisig = testAddress; + operationsMultisig = testAddress; + pauserMultisig = testAddress; + communityMultisig = testAddress; + STRATEGY_MANAGER_WHITELISTER = testAddress; + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + emit log_named_address("Deployer Address", msg.sender); + + if (keccak256(abi.encode(deployArg)) == keccak256(abi.encode("upgrade"))) { + _upgradeRewardsCoordinator(); + } else if (keccak256(abi.encode(deployArg)) == keccak256(abi.encode("deploy"))) { + _deployRewardsCoordinator(); + } + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + // Sanity Checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(true); + _verifyInitializationParams(); + + logAndOutputContractAddresses("script/output/holesky/Deploy_RewardsCoordinator_Preprod.holesky.config.json"); + } +} diff --git a/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol b/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol new file mode 100644 index 000000000..402007876 --- /dev/null +++ b/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "../../utils/ExistingDeploymentParser.sol"; + +/** + * @notice Script used for the first deployment of EigenLayer core contracts to Holesky + * anvil --fork-url $RPC_HOLESKY + * forge script script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * forge script script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --verify --broadcast -vvvv + * + */ +contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser { + + address testAddress = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; + address initOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; + + function run() external virtual { + _parseInitialDeploymentParams("script/configs/holesky/eigenlayer_testnet.config.json"); + _parseDeployedContracts("script/configs/holesky/eigenlayer_addresses.config.json"); + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + emit log_named_address("Deployer Address", msg.sender); + + _deployImplementation(); + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + // Sanity Checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(true); + _verifyInitializationParams(); + + logAndOutputContractAddresses("script/output/holesky/Deploy_RewardsCoordinator.holesky.config.json"); + } + + /** + * @notice Deploy RewardsCoordinator for Holesky + */ + function _deployRewardsCoordinator() internal { + // Deploy RewardsCoordinator proxy and implementation + rewardsCoordinatorImplementation = new RewardsCoordinator( + delegationManager, + strategyManager, + allocationManager, + eigenLayerPauserReg, + permissionController, + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS, + REWARDS_COORDINATOR_MAX_REWARDS_DURATION, + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH, + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH, + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP + ); + rewardsCoordinator = RewardsCoordinator( + address( + new TransparentUpgradeableProxy( + address(rewardsCoordinatorImplementation), + address(eigenLayerProxyAdmin), + abi.encodeWithSelector( + RewardsCoordinator.initialize.selector, + executorMultisig, + REWARDS_COORDINATOR_INIT_PAUSED_STATUS, + REWARDS_COORDINATOR_UPDATER, + REWARDS_COORDINATOR_ACTIVATION_DELAY, + REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS + ) + ) + ) + ); + } + + /** + * @notice Deploy RewardsCoordinator Implementation for Holesky and upgrade the proxy + */ + function _upgradeRewardsCoordinator() internal { + // Deploy RewardsCoordinator proxy and implementation + rewardsCoordinatorImplementation = new RewardsCoordinator( + delegationManager, + strategyManager, + allocationManager, + eigenLayerPauserReg, + permissionController, + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS, + REWARDS_COORDINATOR_MAX_REWARDS_DURATION, + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH, + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH, + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP + ); + + eigenLayerProxyAdmin.upgrade( + ITransparentUpgradeableProxy(payable(address(rewardsCoordinator))), + address(rewardsCoordinatorImplementation) + ); + } + + function _deployImplementation() internal { + // Existing values for current RewardsCoordinator implementationt on holesky + require( + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS == 604800, + "REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS must be 604800" + ); + require( + REWARDS_COORDINATOR_MAX_REWARDS_DURATION == 6048000, + "REWARDS_COORDINATOR_MAX_REWARDS_DURATION must be 6048000" + ); + require( + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH == 7776000, + "REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH must be 7776000" + ); + require( + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH == 2592000, + "REWARDS_COORDINATOR_MAX_FUTURE_LENGTH must be 2592000" + ); + require( + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP == 1710979200, + "REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP must be 1710979200" + ); + + // Deploy RewardsCoordinator implementation + rewardsCoordinatorImplementation = new RewardsCoordinator( + delegationManager, + strategyManager, + allocationManager, + eigenLayerPauserReg, + permissionController, + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS, + REWARDS_COORDINATOR_MAX_REWARDS_DURATION, + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH, + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH, + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP + ); + } +} diff --git a/script/deploy/holesky/Eigen_Strategy_Deploy.s.sol b/script/deploy/holesky/Eigen_Strategy_Deploy.s.sol new file mode 100644 index 000000000..a33a50381 --- /dev/null +++ b/script/deploy/holesky/Eigen_Strategy_Deploy.s.sol @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "../../utils/ExistingDeploymentParser.sol"; + +/** + * @notice Script used for the first deployment of Eigen token strategy contracts on Holesky + * forge script script/deploy/holesky/Eigen_Strategy_Deploy.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * forge script script/deploy/holesky/Eigen_Strategy_Deploy.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv + */ +contract Eigen_Strategy_Deploy is ExistingDeploymentParser { + + function run() external virtual { + _parseDeployedContracts("script/configs/holesky/Holesky_current_deployment.config.json"); + + vm.startBroadcast(); + + _deployStrategy(); + + _setTransferRestrictions(); + + vm.stopBroadcast(); + + _verifyDeployment(); + + emit log_string("====Deployed Contracts===="); + + emit log_named_address("EigenStrategy", address(eigenStrategy)); + emit log_named_address("EigenStrategyImpl", address(eigenStrategyImpl)); + } + + function _deployStrategy() internal { + eigenStrategyImpl = new EigenStrategy(strategyManager, eigenLayerPauserReg); + + eigenStrategy = EigenStrategy( + address( + new TransparentUpgradeableProxy( + address(eigenStrategyImpl), + address(eigenLayerProxyAdmin), + abi.encodeWithSelector( + EigenStrategy.initialize.selector, + EIGEN, + bEIGEN + ) + ) + ) + ); + } + + function _setTransferRestrictions() internal { + EIGEN.setAllowedFrom(address(eigenStrategy), true); + EIGEN.setAllowedTo(address(eigenStrategy), true); + bEIGEN.setAllowedFrom(address(eigenStrategy), true); + bEIGEN.setAllowedTo(address(eigenStrategy), true); + } + + function _verifyDeployment() internal { + IStrategy[] memory strategies = new IStrategy[](1); + strategies[0] = eigenStrategy; + + vm.prank(executorMultisig); + strategyManager.addStrategiesToDepositWhitelist(strategies); + + vm.startPrank(msg.sender); + EIGEN.approve(address(strategyManager), type(uint256).max); + strategyManager.depositIntoStrategy(eigenStrategy, EIGEN, 1 ether); + } +} diff --git a/script/deploy/holesky/Eigen_Token_Deploy.s.sol b/script/deploy/holesky/Eigen_Token_Deploy.s.sol new file mode 100644 index 000000000..6f5e78878 --- /dev/null +++ b/script/deploy/holesky/Eigen_Token_Deploy.s.sol @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "../../../src/contracts/token/Eigen.sol"; +import "../../../src/contracts/token/BackingEigen.sol"; +import "../../../src/test/mocks/EmptyContract.sol"; + +import "forge-std/Script.sol"; +import "forge-std/Test.sol"; + +/** + * @notice Script used for the first deployment of Eigen token on Holesky + * forge script script/deploy/holesky/Eigen_Token_Deploy.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * forge script script/deploy/holesky/Eigen_Token_Deploy.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv + */ +contract Eigen_Token_Deploy is Script, Test { + address operationsMultisig = 0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d; + EmptyContract public emptyContract = EmptyContract(0x9690d52B1Ce155DB2ec5eCbF5a262ccCc7B3A6D2); + + ProxyAdmin public tokenProxyAdmin; + Eigen public EIGENImpl; + Eigen public EIGEN; + BackingEigen public bEIGENImpl; + BackingEigen public bEIGEN; + + uint256 constant TOTAL_SUPPLY = 1673646668284660000000000000; + + function run() external virtual { + vm.startBroadcast(); + + _deployToken(); + + vm.stopBroadcast(); + + _verifyDeployment(); + + emit log_string("====Deployed Contracts===="); + + emit log_named_address("ProxyAdmin", address(tokenProxyAdmin)); + emit log_named_address("EIGEN", address(EIGEN)); + emit log_named_address("bEIGEN", address(bEIGEN)); + emit log_named_address("EIGENImpl", address(EIGENImpl)); + emit log_named_address("bEIGENImpl", address(bEIGENImpl)); + } + + function _deployToken() internal { + // Deploy ProxyAdmin, later set admins for all proxies to be executorMultisig + tokenProxyAdmin = new ProxyAdmin(); + + EIGEN = Eigen( + address(new TransparentUpgradeableProxy(address(emptyContract), address(tokenProxyAdmin), "")) + ); + + bEIGEN = BackingEigen( + address(new TransparentUpgradeableProxy(address(emptyContract), address(tokenProxyAdmin), "")) + ); + + // deploy impls + EIGENImpl = new Eigen(IERC20(address(bEIGEN))); + bEIGENImpl = new BackingEigen(IERC20(address(EIGEN))); + + address[] memory minters = new address[](1); + minters[0] = msg.sender; + + uint256[] memory mintingAllowances = new uint256[](1); + mintingAllowances[0] = TOTAL_SUPPLY; + + uint256[] memory mintAllowedAfters = new uint256[](1); + + // upgrade and initialize proxies + tokenProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(EIGEN))), + address(EIGENImpl), + abi.encodeWithSelector( + Eigen.initialize.selector, + msg.sender, + minters, + mintingAllowances, + mintAllowedAfters + ) + ); + + EIGEN.mint(); + + tokenProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(bEIGEN))), + address(bEIGENImpl), + abi.encodeWithSelector( + BackingEigen.initialize.selector, + msg.sender + ) + ); + + tokenProxyAdmin.transferOwnership(operationsMultisig); + } + + function _verifyDeployment() internal view { + require(EIGEN.totalSupply() == TOTAL_SUPPLY, "Eigen_Token_Deploy: total supply mismatch"); + require(bEIGEN.totalSupply() == TOTAL_SUPPLY, "Eigen_Token_Deploy: total supply mismatch"); + + require(bEIGEN.balanceOf(address(EIGEN)) == TOTAL_SUPPLY, "Eigen_Token_Deploy: bEIGEN balance mismatch"); + require(EIGEN.balanceOf(msg.sender) == TOTAL_SUPPLY, "Eigen_Token_Deploy: EIGEN balance mismatch"); + + require(EIGEN.owner() == msg.sender, "Eigen_Token_Deploy: EIGEN owner mismatch"); + require(bEIGEN.owner() == msg.sender, "Eigen_Token_Deploy: bEIGEN owner mismatch"); + + require(tokenProxyAdmin.getProxyImplementation(ITransparentUpgradeableProxy(payable(address(EIGEN)))) == address(EIGENImpl), "Eigen_Token_Deploy: EIGEN implementation mismatch"); + require(tokenProxyAdmin.getProxyImplementation(ITransparentUpgradeableProxy(payable(address(bEIGEN)))) == address(bEIGENImpl), "Eigen_Token_Deploy: bEIGEN implementation mismatch"); + + require(tokenProxyAdmin.owner() == operationsMultisig, "Eigen_Token_Deploy: ProxyAdmin owner mismatch"); + } +} diff --git a/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol b/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol new file mode 100644 index 000000000..6d90221c5 --- /dev/null +++ b/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol @@ -0,0 +1,202 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "../../utils/ExistingDeploymentParser.sol"; + +/** + * @notice Script used for the first deployment of EigenLayer core contracts to Holesky + * forge script script/deploy/holesky/M2_Deploy_From_Scratch.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * forge script script/deploy/holesky/M2_Deploy_From_Scratch.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv + * + */ +contract M2_Deploy_Holesky_From_Scratch is ExistingDeploymentParser { + function run() external virtual { + _parseInitialDeploymentParams("script/configs/holesky/M2_deploy_from_scratch.holesky.config.json"); + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + emit log_named_address("Deployer Address", msg.sender); + + _deployFromScratch(); + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + // Sanity Checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(true); + _verifyInitializationParams(); + + logAndOutputContractAddresses("script/output/holesky/M2_deploy_from_scratch.holesky.config.json"); + } + + /** + * @notice Deploy EigenLayer contracts from scratch for Holesky + */ + function _deployFromScratch() internal { + // Deploy ProxyAdmin, later set admins for all proxies to be executorMultisig + eigenLayerProxyAdmin = new ProxyAdmin(); + + // Set multisigs as pausers, executorMultisig as unpauser + address[] memory pausers = new address[](3); + pausers[0] = executorMultisig; + pausers[1] = operationsMultisig; + pausers[2] = pauserMultisig; + address unpauser = executorMultisig; + eigenLayerPauserReg = new PauserRegistry(pausers, unpauser); + + /** + * First, deploy upgradeable proxy contracts that **will point** to the implementations. Since the implementation contracts are + * not yet deployed, we give these proxies an empty contract as the initial implementation, to act as if they have no code. + */ + emptyContract = new EmptyContract(); + avsDirectory = AVSDirectory( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + delegationManager = DelegationManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + strategyManager = StrategyManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + eigenPodManager = EigenPodManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + allocationManager = AllocationManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + + // Deploy EigenPod Contracts + eigenPodImplementation = new EigenPod( + IETHPOSDeposit(ETHPOSDepositAddress), + eigenPodManager, + EIGENPOD_GENESIS_TIME + ); + + eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation)); + avsDirectoryImplementation = new AVSDirectory(delegationManager, eigenLayerPauserReg); + delegationManagerImplementation = new DelegationManager(avsDirectory, strategyManager, eigenPodManager, allocationManager, eigenLayerPauserReg, permissionController, MIN_WITHDRAWAL_DELAY); + strategyManagerImplementation = new StrategyManager(delegationManager, eigenLayerPauserReg); + eigenPodManagerImplementation = new EigenPodManager( + IETHPOSDeposit(ETHPOSDepositAddress), + eigenPodBeacon, + strategyManager, + delegationManager, + eigenLayerPauserReg + ); + allocationManagerImplementation = new AllocationManager(delegationManager, eigenLayerPauserReg, permissionController, DEALLOCATION_DELAY, ALLOCATION_CONFIGURATION_DELAY); + permissionControllerImplementation = new PermissionController(); + + // Third, upgrade the proxy contracts to point to the implementations + IStrategy[] memory initializeStrategiesToSetDelayBlocks = new IStrategy[](0); + uint256[] memory initializeWithdrawalDelayBlocks = new uint256[](0); + // AVSDirectory + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(avsDirectory))), + address(avsDirectoryImplementation), + abi.encodeWithSelector( + AVSDirectory.initialize.selector, + executorMultisig, // initialOwner + eigenLayerPauserReg, + AVS_DIRECTORY_INIT_PAUSED_STATUS + ) + ); + // DelegationManager + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(delegationManager))), + address(delegationManagerImplementation), + abi.encodeWithSelector( + DelegationManager.initialize.selector, + executorMultisig, // initialOwner + eigenLayerPauserReg, + DELEGATION_MANAGER_INIT_PAUSED_STATUS, + DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS, + initializeStrategiesToSetDelayBlocks, + initializeWithdrawalDelayBlocks + ) + ); + // StrategyManager + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(strategyManager))), + address(strategyManagerImplementation), + abi.encodeWithSelector( + StrategyManager.initialize.selector, + msg.sender, //initialOwner, set to executorMultisig later after whitelisting strategies + msg.sender, //initial whitelister, set to STRATEGY_MANAGER_WHITELISTER later + eigenLayerPauserReg, + STRATEGY_MANAGER_INIT_PAUSED_STATUS + ) + ); + // EigenPodManager + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(eigenPodManager))), + address(eigenPodManagerImplementation), + abi.encodeWithSelector( + EigenPodManager.initialize.selector, + msg.sender, // initialOwner is msg.sender for now to set forktimestamp later + eigenLayerPauserReg, + EIGENPOD_MANAGER_INIT_PAUSED_STATUS + ) + ); + // AllocationManager + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(allocationManager))), + address(allocationManagerImplementation), + abi.encodeWithSelector( + AllocationManager.initialize.selector, + msg.sender, // initialOwner is msg.sender for now to set forktimestamp later + eigenLayerPauserReg, + ALLOCATION_MANAGER_INIT_PAUSED_STATUS + ) + ); + // PermissionController + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(permissionController))), + address(permissionControllerImplementation), + abi.encodeWithSelector( + PermissionController.initialize.selector + ) + ); + + // Deploy Strategies + baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager, eigenLayerPauserReg); + uint256 numStrategiesToDeploy = strategiesToDeploy.length; + // whitelist params + IStrategy[] memory strategiesToWhitelist = new IStrategy[](numStrategiesToDeploy); + + for (uint256 i = 0; i < numStrategiesToDeploy; i++) { + StrategyUnderlyingTokenConfig memory strategyConfig = strategiesToDeploy[i]; + + // Deploy and upgrade strategy + StrategyBaseTVLLimits strategy = StrategyBaseTVLLimits( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(strategy))), + address(baseStrategyImplementation), + abi.encodeWithSelector( + StrategyBaseTVLLimits.initialize.selector, + STRATEGY_MAX_PER_DEPOSIT, + STRATEGY_MAX_TOTAL_DEPOSITS, + IERC20(strategyConfig.tokenAddress) + ) + ); + + strategiesToWhitelist[i] = strategy; + + deployedStrategyArray.push(strategy); + } + + // Add strategies to whitelist and set whitelister to STRATEGY_MANAGER_WHITELISTER + strategyManager.addStrategiesToDepositWhitelist(strategiesToWhitelist); + strategyManager.setStrategyWhitelister(STRATEGY_MANAGER_WHITELISTER); + + // Transfer ownership + strategyManager.transferOwnership(executorMultisig); + eigenLayerProxyAdmin.transferOwnership(executorMultisig); + eigenPodManager.transferOwnership(executorMultisig); + eigenPodBeacon.transferOwnership(executorMultisig); + } +} diff --git a/script/deploy/holesky/M2_Deploy_Preprod.s.sol b/script/deploy/holesky/M2_Deploy_Preprod.s.sol new file mode 100644 index 000000000..349de9b1b --- /dev/null +++ b/script/deploy/holesky/M2_Deploy_Preprod.s.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "./M2_Deploy_From_Scratch.s.sol"; + +/** + * @notice Script used for the first deployment of EigenLayer core contracts to Holesky + * forge script script/deploy/holesky/M2_Deploy_Preprod.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * forge script script/deploy/holesky/M2_Deploy_Preprod.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv + * + * Script for dev environment, exact same as M2_Deploy_From_Scratch.s.sol but with an EOAowner + * instead of multisig addresses for permissions. + * Unused config fields: + * - init_strategy_whitelister + * - multisig_addresses(operations, pauser, executor, community) + */ +contract M2_Deploy_Holesky_Preprod is M2_Deploy_Holesky_From_Scratch { + /// @dev EOAowner is the deployer and owner of the contracts + address EOAowner; + + function run() external virtual override { + _parseInitialDeploymentParams("script/configs/holesky/M2_deploy_preprod.holesky.config.json"); + + // Overwrite multisig to be EOAowner + EOAowner = msg.sender; + executorMultisig = EOAowner; + operationsMultisig = EOAowner; + pauserMultisig = EOAowner; + communityMultisig = EOAowner; + STRATEGY_MANAGER_WHITELISTER = EOAowner; + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + emit log_named_address("Deployer and EOAowner Address", EOAowner); + + _deployFromScratch(); + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + // Sanity Checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(true); + _verifyInitializationParams(); // override to check contract.owner() is EOAowner instead + + logAndOutputContractAddresses("script/output/holesky/M2_deploy_preprod.holesky.config.json"); + } +} diff --git a/script/deploy/holesky/Preprod_Upgrade_bEIGEN_and_EIGEN.s.sol b/script/deploy/holesky/Preprod_Upgrade_bEIGEN_and_EIGEN.s.sol new file mode 100644 index 000000000..097cac3b1 --- /dev/null +++ b/script/deploy/holesky/Preprod_Upgrade_bEIGEN_and_EIGEN.s.sol @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@openzeppelin/contracts/governance/TimelockController.sol"; + +import "forge-std/Script.sol"; +import "forge-std/Test.sol"; + +import "../../../src/contracts/token/BackingEigen.sol"; +import "../../../src/contracts/token/Eigen.sol"; + +// forge script script/deploy/holesky/Preprod_Upgrade_bEIGEN_and_EIGEN.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv --verify --etherscan-api-key $ETHERSCAN_API_KEY +contract Preprod_Upgrade_bEIGEN_and_EIGEN is Script, Test { + Vm cheats = Vm(VM_ADDRESS); + + BackingEigen public bEIGEN_proxy = BackingEigen(0xA72942289a043874249E60469F68f08B8c6ECCe8); + BackingEigen public bEIGEN_implementation; + Eigen public EIGEN_proxy = Eigen(0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926); + Eigen public EIGEN_implementation; + ProxyAdmin public EIGEN_ProxyAdmin = ProxyAdmin(0x1BEF05C7303d44e0E2FCD2A19d993eDEd4c51b5B); + address public proxyAdminOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; + + IERC20 public bEIGEN_addressBefore; + IERC20 public EIGEN_addressBefore; + + function run() external { + // Read and log the chain ID + uint256 chainId = block.chainid; + emit log_named_uint("You are deploying on ChainID", chainId); + + if (chainId != 17000) { + revert("Chain not supported"); + } + + bEIGEN_addressBefore = EIGEN_proxy.bEIGEN(); + require(bEIGEN_addressBefore == IERC20(0xA72942289a043874249E60469F68f08B8c6ECCe8), + "something horribly wrong"); + + EIGEN_addressBefore = bEIGEN_proxy.EIGEN(); + require(EIGEN_addressBefore == IERC20(0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926), + "something horribly wrong"); + + // Begin deployment + vm.startBroadcast(); + + // Deploy new implmementation contracts + EIGEN_implementation = new Eigen({ + _bEIGEN: bEIGEN_addressBefore + }); + bEIGEN_implementation = new BackingEigen({ + _EIGEN: EIGEN_addressBefore + }); + + vm.stopBroadcast(); + + emit log_named_address("EIGEN_implementation", address(EIGEN_implementation)); + emit log_named_address("bEIGEN_implementation", address(bEIGEN_implementation)); + + // Perform upgrade + vm.startBroadcast(); + EIGEN_ProxyAdmin.upgrade( + ITransparentUpgradeableProxy(payable(address(bEIGEN_proxy))), + address(bEIGEN_implementation) + ); + EIGEN_ProxyAdmin.upgrade( + ITransparentUpgradeableProxy(payable(address(EIGEN_proxy))), + address(EIGEN_implementation) + ); + vm.stopBroadcast(); + + // Perform post-upgrade tests + checkUpgradeCorrectness(); + simulateWrapAndUnwrap(); + } + + function checkUpgradeCorrectness() public { + cheats.startPrank(address(proxyAdminOwner)); + require(EIGEN_ProxyAdmin.getProxyImplementation(ITransparentUpgradeableProxy(payable(address(EIGEN_proxy)))) == address(EIGEN_implementation), + "implementation set incorrectly"); + require(EIGEN_proxy.bEIGEN() == bEIGEN_addressBefore, + "bEIGEN address changed unexpectedly"); + require(EIGEN_ProxyAdmin.getProxyImplementation(ITransparentUpgradeableProxy(payable(address(bEIGEN_proxy)))) == address(bEIGEN_implementation), + "implementation set incorrectly"); + require(bEIGEN_proxy.EIGEN() == EIGEN_addressBefore, + "EIGEN address changed unexpectedly"); + cheats.stopPrank(); + } + + function simulateWrapAndUnwrap() public { + uint256 amount = 1e18; + cheats.prank(address(EIGEN_proxy)); + bEIGEN_proxy.transfer(address(this), amount); + + bEIGEN_proxy.approve(address(EIGEN_proxy), amount); + uint256 bEIGEN_balanceStart = bEIGEN_proxy.balanceOf(address(this)); + uint256 EIGEN_balanceStart = EIGEN_proxy.balanceOf(address(this)); + EIGEN_proxy.wrap(amount); + uint256 bEIGEN_balanceMiddle = bEIGEN_proxy.balanceOf(address(this)); + uint256 EIGEN_balanceMiddle = EIGEN_proxy.balanceOf(address(this)); + EIGEN_proxy.unwrap(amount); + uint256 bEIGEN_balanceAfter = bEIGEN_proxy.balanceOf(address(this)); + uint256 EIGEN_balanceAfter = EIGEN_proxy.balanceOf(address(this)); + + require(bEIGEN_balanceMiddle + amount == bEIGEN_balanceStart, "wrapping did not transfer out bEIGEN"); + require(EIGEN_balanceMiddle == EIGEN_balanceStart + amount, "wrapping did not transfer in EIGEN"); + + require(bEIGEN_balanceAfter == bEIGEN_balanceStart, "unwrapping did not transfer in bEIGEN"); + require(EIGEN_balanceAfter == EIGEN_balanceStart, "unwrapping did not transfer out EIGEN"); + } +} diff --git a/script/deploy/holesky/bEIGEN_and_EIGEN_upgrade.s.sol b/script/deploy/holesky/bEIGEN_and_EIGEN_upgrade.s.sol new file mode 100644 index 000000000..c8e1184a2 --- /dev/null +++ b/script/deploy/holesky/bEIGEN_and_EIGEN_upgrade.s.sol @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@openzeppelin/contracts/governance/TimelockController.sol"; + +import "../../../src/contracts/token/BackingEigen.sol"; +import "../../../src/contracts/token/Eigen.sol"; + +import "forge-std/Script.sol"; +import "forge-std/Test.sol"; + +// # To load the variables in the .env file +// source .env + +// # To deploy and verify our contract +// forge script script/deploy/holesky/bEIGEN_and_EIGEN_upgrade.s.sol:bEIGEN_and_EIGEN_upgrade -vvv --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast +contract bEIGEN_and_EIGEN_upgrade is Script, Test { + Vm cheats = Vm(VM_ADDRESS); + + BackingEigen public bEIGEN_proxy = BackingEigen(0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27); + BackingEigen public bEIGEN_implementation; + Eigen public EIGEN_proxy = Eigen(0x3B78576F7D6837500bA3De27A60c7f594934027E); + Eigen public EIGEN_implementation; + ProxyAdmin public token_ProxyAdmin = ProxyAdmin(0x67482666771e82C9a73BB9e9A22B2B597f448BBf); + address public opsMultisig = 0xfaEF7338b7490b9E272d80A1a39f4657cAf2b97d; + + IERC20 public bEIGEN_addressBefore; + IERC20 public EIGEN_addressBefore; + + function run() external { + // Read and log the chain ID + uint256 chainId = block.chainid; + emit log_named_uint("You are deploying on ChainID", chainId); + + if (chainId != 17000) { + revert("Chain not supported"); + } + + bEIGEN_addressBefore = EIGEN_proxy.bEIGEN(); + EIGEN_addressBefore = bEIGEN_proxy.EIGEN(); + + require(bEIGEN_addressBefore == IERC20(0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27), + "something horribly wrong"); + require(EIGEN_addressBefore == IERC20(0x3B78576F7D6837500bA3De27A60c7f594934027E), + "something horribly wrong"); + + // Begin deployment + vm.startBroadcast(); + + // Deploy new implementation contracts + EIGEN_implementation = new Eigen({ + _bEIGEN: bEIGEN_addressBefore + }); + bEIGEN_implementation = new BackingEigen({ + _EIGEN: EIGEN_addressBefore + }); + vm.stopBroadcast(); + + emit log_named_address("EIGEN_implementation", address(EIGEN_implementation)); + emit log_named_address("bEIGEN_implementation", address(bEIGEN_implementation)); + + // Perform post-upgrade tests + simulatePerformingUpgrade(); + checkUpgradeCorrectness(); + simulateWrapAndUnwrap(); + } + + function simulatePerformingUpgrade() public { + cheats.startPrank(opsMultisig); + // Upgrade contracts + token_ProxyAdmin.upgrade(ITransparentUpgradeableProxy(payable(address(EIGEN_proxy))), address(EIGEN_implementation)); + token_ProxyAdmin.upgrade(ITransparentUpgradeableProxy(payable(address(bEIGEN_proxy))), address(bEIGEN_implementation)); + cheats.stopPrank(); + } + + function checkUpgradeCorrectness() public { + vm.startPrank(opsMultisig); + require(token_ProxyAdmin.getProxyImplementation(ITransparentUpgradeableProxy(payable(address(EIGEN_proxy)))) == address(EIGEN_implementation), + "implementation set incorrectly"); + require(EIGEN_proxy.bEIGEN() == bEIGEN_addressBefore, + "bEIGEN address changed unexpectedly"); + require(token_ProxyAdmin.getProxyImplementation(ITransparentUpgradeableProxy(payable(address(bEIGEN_proxy)))) == address(bEIGEN_implementation), + "implementation set incorrectly"); + require(bEIGEN_proxy.EIGEN() == EIGEN_addressBefore, + "EIGEN address changed unexpectedly"); + cheats.stopPrank(); + } + + function simulateWrapAndUnwrap() public { + uint256 amount = 1e18; + cheats.prank(address(EIGEN_proxy)); + bEIGEN_proxy.transfer(address(this), amount); + + bEIGEN_proxy.approve(address(EIGEN_proxy), amount); + uint256 bEIGEN_balanceStart = bEIGEN_proxy.balanceOf(address(this)); + uint256 EIGEN_balanceStart = EIGEN_proxy.balanceOf(address(this)); + EIGEN_proxy.wrap(amount); + uint256 bEIGEN_balanceMiddle = bEIGEN_proxy.balanceOf(address(this)); + uint256 EIGEN_balanceMiddle = EIGEN_proxy.balanceOf(address(this)); + EIGEN_proxy.unwrap(amount); + uint256 bEIGEN_balanceAfter = bEIGEN_proxy.balanceOf(address(this)); + uint256 EIGEN_balanceAfter = EIGEN_proxy.balanceOf(address(this)); + + require(bEIGEN_balanceMiddle + amount == bEIGEN_balanceStart, "wrapping did not transfer out bEIGEN"); + require(EIGEN_balanceMiddle == EIGEN_balanceStart + amount, "wrapping did not transfer in EIGEN"); + + require(bEIGEN_balanceAfter == bEIGEN_balanceStart, "unwrapping did not transfer in bEIGEN"); + require(EIGEN_balanceAfter == EIGEN_balanceStart, "unwrapping did not transfer out EIGEN"); + } +} \ No newline at end of file diff --git a/script/deploy/holesky/longtail-preprod-upgrade.s.sol b/script/deploy/holesky/longtail-preprod-upgrade.s.sol new file mode 100644 index 000000000..ba833e7b2 --- /dev/null +++ b/script/deploy/holesky/longtail-preprod-upgrade.s.sol @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "../../utils/ExistingDeploymentParser.sol"; + +/** + * anvil --fork-url $RPC_HOLESKY + * forge script script/deploy/holesky/longtail-preprod-upgrade.s.sol:Longtail_Upgrade_Preprod --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * forge script script/deploy/holesky/longtail-preprod-upgrade.s.sol:Longtail_Upgrade_Preprod --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --verify --broadcast -vvvv + */ +contract Longtail_Upgrade_Preprod is ExistingDeploymentParser { + + address testAddress = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; + address initOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; + + function run() external virtual { + _parseInitialDeploymentParams( + "script/configs/holesky/eigenlayer_preprod.config.json" + ); + _parseDeployedContracts( + "script/configs/holesky/eigenlayer_addresses_preprod.config.json" + ); + + emit log_named_address("Deployer Address", msg.sender); + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + _deployLongtail(); + _upgradeLongtail(); + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + _sanityChecks(); + + logAndOutputContractAddresses("script/output/holesky/longtail-preprod.output.json"); + } + + function _deployLongtail() internal { + // Deploy implementations + strategyFactoryImplementation = new StrategyFactory(strategyManager, eigenLayerPauserReg); + strategyFactoryBeaconImplementation = new StrategyBase(strategyManager, eigenLayerPauserReg); + + // Deploy and initialize proxies + strategyBeacon = new UpgradeableBeacon(address(strategyFactoryBeaconImplementation)); + strategyFactory = StrategyFactory(address(new TransparentUpgradeableProxy( + address(strategyFactoryImplementation), + address(eigenLayerProxyAdmin), + abi.encodeWithSelector( + StrategyFactory.initialize.selector, + initOwner, + eigenLayerPauserReg, + 0, + strategyBeacon + ) + ))); + } + + function _tokensToBlacklist() internal pure returns (IERC20[] memory) { + // pulled from preprod strategy manager events, filtering by topic: + // 0x0c35b17d91c96eb2751cd456e1252f42a386e524ef9ff26ecc9950859fdc04fe + // (https://holesky.etherscan.io/address/0xF9fbF2e35D8803273E214c99BF15174139f4E67a#events) + IERC20[] memory t = new IERC20[](12); + t[0] = IERC20(0x1aea86558d3FF59176Fe7D5BE48B59B09c96bbf7); // WETHQ2 + t[1] = IERC20(0xa63f56985F9C7F3bc9fFc5685535649e0C1a55f3); // sfrxETH + t[2] = IERC20(0x8783C9C904e1bdC87d9168AE703c8481E8a477Fd); // ankrETH + t[3] = IERC20(0xe3C063B1BEe9de02eb28352b55D49D85514C67FF); // mETH + t[4] = IERC20(0xF603c5A3F774F05d4D848A9bB139809790890864); // osETH + t[5] = IERC20(0x1d8b30cC38Dba8aBce1ac29Ea27d9cFd05379A09); // lsETH + t[6] = IERC20(0x17845EA6a9BfD2caF1b9E558948BB4999dF2656e); // frxETH + t[7] = IERC20(0x8720095Fa5739Ab051799211B146a2EEE4Dd8B37); // cbETH + t[8] = IERC20(0xB4F5fc289a778B80392b86fa70A7111E5bE0F859); // ETHx + t[9] = IERC20(0x7322c24752f79c05FFD1E2a6FCB97020C1C264F1); // rETH + t[10] = IERC20(0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034); // stETH + t[11] = IERC20(0x94373a4919B3240D86eA41593D5eBa789FEF3848); // WETH + + return t; + } + + function _upgradeLongtail() internal { + IERC20[] memory tokensToBlacklist = _tokensToBlacklist(); + + strategyFactory.blacklistTokens(tokensToBlacklist); + strategyManager.setStrategyWhitelister(address(strategyFactory)); + } + + function _sanityChecks() internal { + // Sanity checks + + require(eigenLayerProxyAdmin.getProxyAdmin(ITransparentUpgradeableProxy(payable(address(strategyFactory)))) == address(eigenLayerProxyAdmin), "proxy admin not set correctly"); + require(eigenLayerProxyAdmin.getProxyImplementation(ITransparentUpgradeableProxy(payable(address(strategyFactory)))) == address(strategyFactoryImplementation), "proxy impl not set correctly"); + + require(strategyFactory.owner() == initOwner, "owner not set correctly"); + require(strategyFactory.pauserRegistry() == eigenLayerPauserReg, "pauser not set correctly"); + require(strategyFactory.strategyBeacon() == strategyBeacon, "beacon not set correctly"); + require(strategyFactory.strategyManager() == strategyManager, "strategy manager not set correctly"); + + require(strategyManager.strategyWhitelister() == address(strategyFactory), "whitelist role not set correctly"); + + IERC20[] memory tokensToBlacklist = _tokensToBlacklist(); + for (uint i = 0; i < tokensToBlacklist.length; i++) { + require(strategyFactory.isBlacklisted(tokensToBlacklist[i]), "token not blacklisted"); + } + + // Deploy a strategy and check that it's whitelisted + IERC20 dummy = IERC20(0x89Aa2dE0beC1b85c1A73111aee7E9A3EE3CBb593); + IStrategy newStrategy = strategyFactory.deployNewStrategy(dummy); + + require(newStrategy.underlyingToken() == dummy, "underlying not set correctly"); + require(strategyManager.strategyIsWhitelistedForDeposit(newStrategy), "did not whitelist in strategymanager"); + } +} diff --git a/script/deploy/holesky/v0.4.3-upgrade_testnet_rewardsCoordinator.s.sol b/script/deploy/holesky/v0.4.3-upgrade_testnet_rewardsCoordinator.s.sol new file mode 100644 index 000000000..fa21699b7 --- /dev/null +++ b/script/deploy/holesky/v0.4.3-upgrade_testnet_rewardsCoordinator.s.sol @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "./Deploy_Test_RewardsCoordinator.s.sol"; +import "script/utils/TimelockEncoding.sol"; + +/** + * @notice Script used for the first deployment of EigenLayer core contracts to Holesky + * anvil --fork-url $RPC_HOLESKY + * + * Holesky testnet: Deploy/Upgrade RewardsCoordinator + * forge script script/deploy/holesky/v042-upgrade_testnet_rewardsCoordinator.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --broadcast -vvvv --verify --etherscan-api-key $ETHERSCAN_API_KEY + * + */ +contract Upgrade_Testnet_RewardsCoordinator is Deploy_Test_RewardsCoordinator, TimelockEncoding { + function run() external virtual override { + _parseInitialDeploymentParams("script/configs/holesky/eigenlayer_testnet.config.json"); + _parseDeployedContracts("script/configs/holesky/eigenlayer_addresses_testnet.config.json"); + + RewardsCoordinator oldRewardsCoordinator = rewardsCoordinatorImplementation; + + // Deploy Rewards Coordinator + vm.startBroadcast(); + rewardsCoordinatorImplementation = new RewardsCoordinator( + delegationManager, + strategyManager, + allocationManager, + eigenLayerPauserReg, + permissionController, + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS, + REWARDS_COORDINATOR_MAX_REWARDS_DURATION, + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH, + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH, + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP + ); + vm.stopBroadcast(); + + _sanityCheckImplementations(oldRewardsCoordinator, rewardsCoordinatorImplementation); + + emit log_named_address("Rewards Coordinator Implementation", address(rewardsCoordinatorImplementation)); + + // Create Upgrade Tx via Community Multisig + bytes memory calldata_to_proxy_admin = abi.encodeWithSelector( + ProxyAdmin.upgrade.selector, + ITransparentUpgradeableProxy(payable(address(rewardsCoordinator))), + rewardsCoordinatorImplementation + ); + + bytes memory final_calldata_to_executor_multisig = encodeForExecutor( + communityMultisig, //from + address(eigenLayerProxyAdmin), //to + 0, // value + calldata_to_proxy_admin, // data + ISafe.Operation.Call // operation + ); + + // Simulate Transaction + vm.prank(communityMultisig); + (bool success, ) = address(executorMultisig).call(final_calldata_to_executor_multisig); + require(success, "Transaction failed"); + + // Sanity Checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(false); + _verifyInitializationParams(); + } + + function _sanityCheckImplementations(RewardsCoordinator oldRc, RewardsCoordinator newRc) internal view { + // Verify configs between both rewardsCoordinatorImplementations + assertEq( + address(oldRc.delegationManager()), + address(newRc.delegationManager()), + "DM mismatch" + ); + assertEq( + address(oldRc.strategyManager()), + address(newRc.strategyManager()), + "SM mismatch" + ); + assertEq( + oldRc.CALCULATION_INTERVAL_SECONDS(), + newRc.CALCULATION_INTERVAL_SECONDS(), + "CALCULATION_INTERVAL_SECONDS mismatch" + ); + assertEq( + oldRc.MAX_REWARDS_DURATION(), + newRc.MAX_REWARDS_DURATION(), + "MAX_REWARDS_DURATION mismatch" + ); + assertEq( + oldRc.MAX_RETROACTIVE_LENGTH(), + newRc.MAX_RETROACTIVE_LENGTH(), + "MAX_RETROACTIVE_LENGTH mismatch" + ); + assertEq( + oldRc.MAX_FUTURE_LENGTH(), + newRc.MAX_FUTURE_LENGTH(), + "MAX_FUTURE_LENGTH mismatch" + ); + assertEq( + oldRc.GENESIS_REWARDS_TIMESTAMP(), + newRc.GENESIS_REWARDS_TIMESTAMP(), + "GENESIS_REWARDS_TIMESTAMP mismatch" + ); + } + + function setRewardForAllSubmitter() external { + address hopper; + + require(hopper != address(0), "Hopper address is not set"); + + // Set reward for all submitters + vm.startBroadcast(); + rewardsCoordinator.setRewardsForAllSubmitter(hopper, true); + vm.stopBroadcast(); + + require(rewardsCoordinator.isRewardsForAllSubmitter(hopper), "Hopper is not set as rewards for all submitter"); + } +} \ No newline at end of file diff --git a/script/deploy/holesky/v040-holesky-pepe.s.sol b/script/deploy/holesky/v040-holesky-pepe.s.sol new file mode 100644 index 000000000..4b8d0cf5b --- /dev/null +++ b/script/deploy/holesky/v040-holesky-pepe.s.sol @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "../../utils/ExistingDeploymentParser.sol"; + +/** + * @notice Script used for upgrading EigenPod and EPM Implementation for Holesky preprod + * anvil --fork-url $RPC_HOLESKY + * forge script script/deploy/holesky/v040-holesky-pepe.s.sol --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * forge script script/deploy/holesky/v040-holesky-pepe.s.sol --rpc-url $RPC_HOLESKY --private-key $PRIVATE_KEY --verify --broadcast -vvvv + */ +contract PEPE_Deploy_Preprod is ExistingDeploymentParser { + + address testAddress = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; + address initOwner = 0xDA29BB71669f46F2a779b4b62f03644A84eE3479; + + function run() external virtual { + _parseInitialDeploymentParams( + "script/configs/holesky/eigenlayer_preprod.config.json" + ); + _parseDeployedContracts( + "script/configs/holesky/eigenlayer_addresses.config.json" + ); + + emit log_named_address("Deployer Address", msg.sender); + + emit log("PRIOR IMPLEMENTATION"); + emit log_named_address("current pod impl", address(eigenPodImplementation)); + emit log_named_address("- pod.ethPOS", address(eigenPodImplementation.ethPOS())); + emit log_named_address("- pod.eigenPodManager", address(eigenPodImplementation.eigenPodManager())); + emit log_named_uint("- pod.GENESIS_TIME", eigenPodImplementation.GENESIS_TIME()); + emit log_named_address("current manager impl", address(eigenPodManagerImplementation)); + emit log_named_address("- epm.ethPOS", address(eigenPodManagerImplementation.ethPOS())); + emit log_named_address("- epm.eigenPodBeacon", address(eigenPodManagerImplementation.eigenPodBeacon())); + emit log_named_address("- epm.strategyManager", address(eigenPodManagerImplementation.strategyManager())); + emit log_named_address("- epm.delegationManager", address(eigenPodManagerImplementation.delegationManager())); + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + _deployPEPE(); + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + logAndOutputContractAddresses("script/output/holesky/v040.output.json"); + } + + function _deployPEPE() internal { + // Deploy EigenPod + eigenPodImplementation = new EigenPod( + IETHPOSDeposit(ETHPOSDepositAddress), + eigenPodManager, + EIGENPOD_GENESIS_TIME + ); + + // Deploy EigenPodManager + eigenPodManagerImplementation = new EigenPodManager( + IETHPOSDeposit(ETHPOSDepositAddress), + eigenPodBeacon, + strategyManager, + delegationManager, + eigenLayerPauserReg + ); + } + + function _upgradePEPE() internal { + // upgrade UpgradeableBeacon + eigenPodBeacon.upgradeTo(address(eigenPodImplementation)); + + // upgrade TUPS + eigenLayerProxyAdmin.upgrade( + ITransparentUpgradeableProxy(payable(address(eigenPodManager))), + address(eigenPodManagerImplementation) + ); + } +} diff --git a/script/deploy/local/Deploy_From_Scratch.s.sol b/script/deploy/local/Deploy_From_Scratch.s.sol index 8987c680e..b68af0764 100644 --- a/script/deploy/local/Deploy_From_Scratch.s.sol +++ b/script/deploy/local/Deploy_From_Scratch.s.sol @@ -334,9 +334,18 @@ contract DeployFromScratch is Script, Test { ) ); +<<<<<<< HEAD eigenLayerProxyAdmin.upgrade( ITransparentUpgradeableProxy(payable(address(permissionController))), address(permissionControllerImplementation) +======= + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(permissionController))), + address(permissionControllerImplementation), + abi.encodeWithSelector( + PermissionController.initialize.selector + ) +>>>>>>> b0193bfe (feat: alm tests) ); // deploy StrategyBaseTVLLimits contract implementation @@ -417,8 +426,11 @@ contract DeployFromScratch is Script, Test { vm.serializeAddress(deployed_addresses, "avsDirectoryImplementation", address(avsDirectoryImplementation)); vm.serializeAddress(deployed_addresses, "allocationManager", address(allocationManager)); vm.serializeAddress(deployed_addresses, "allocationManagerImplementation", address(allocationManagerImplementation)); +<<<<<<< HEAD vm.serializeAddress(deployed_addresses, "permissionController", address(permissionController)); vm.serializeAddress(deployed_addresses, "permissionControllerImplementation", address(permissionControllerImplementation)); +======= +>>>>>>> b0193bfe (feat: alm tests) vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); vm.serializeAddress( deployed_addresses, diff --git a/script/deploy/local/deploy_from_scratch.slashing.s.sol b/script/deploy/local/deploy_from_scratch.slashing.s.sol index 38ba01b7d..ec070ce90 100644 --- a/script/deploy/local/deploy_from_scratch.slashing.s.sol +++ b/script/deploy/local/deploy_from_scratch.slashing.s.sol @@ -329,9 +329,16 @@ contract DeployFromScratch is Script, Test { ) ); +<<<<<<< HEAD eigenLayerProxyAdmin.upgrade( ITransparentUpgradeableProxy(payable(address(permissionController))), address(permissionControllerImplementation) +======= + eigenLayerProxyAdmin.upgradeAndCall( + ITransparentUpgradeableProxy(payable(address(permissionController))), + address(permissionControllerImplementation), + abi.encodeWithSelector(PermissionController.initialize.selector) +>>>>>>> b0193bfe (feat: alm tests) ); // deploy StrategyBaseTVLLimits contract implementation @@ -414,8 +421,11 @@ contract DeployFromScratch is Script, Test { vm.serializeAddress(deployed_addresses, "avsDirectoryImplementation", address(avsDirectoryImplementation)); vm.serializeAddress(deployed_addresses, "allocationManager", address(allocationManager)); vm.serializeAddress(deployed_addresses, "allocationManagerImplementation", address(allocationManagerImplementation)); +<<<<<<< HEAD vm.serializeAddress(deployed_addresses, "permissionController", address(permissionController)); vm.serializeAddress(deployed_addresses, "permissionControllerImplementation", address(permissionControllerImplementation)); +======= +>>>>>>> b0193bfe (feat: alm tests) vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); vm.serializeAddress( deployed_addresses, diff --git a/script/deploy/local/operatorSets/DeployStrategies.s.sol b/script/deploy/local/operatorSets/DeployStrategies.s.sol new file mode 100644 index 000000000..e2f05e806 --- /dev/null +++ b/script/deploy/local/operatorSets/DeployStrategies.s.sol @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; +import "../../../utils/ExistingDeploymentParser.sol"; + +// # To load the variables in the .env file +// source .env + +// # To deploy and verify our contract +contract DeployStrategies is ExistingDeploymentParser { + + function run() external { + _parseDeployedContracts("script/output/devnet/M2_from_scratch_deployment_data.json"); + + vm.startBroadcast(); + StrategyDeployer strategyDeployer = new StrategyDeployer( + executorMultisig, + address(baseStrategyImplementation) + ); + uint256 batches = 1; + uint256 batchSize = 100; + + IStrategy[] memory strategies = new IStrategy[](batchSize * batches); + + for (uint256 i = 0; i < batches; i++) { + IStrategy[] memory strategiesJustDeployed = strategyDeployer.createManyStrategies(batchSize); + for (uint256 j = 0; j < batchSize; j++) { + strategies[i * batchSize + j] = strategiesJustDeployed[j]; + } + strategyManager.addStrategiesToDepositWhitelist(strategiesJustDeployed); + } + + vm.stopBroadcast(); + + address[] memory strategyAddresses; + assembly { + strategyAddresses := strategies + } + string memory deployed_strategies = vm.serializeAddress("", "strategies", strategyAddresses); + + vm.writeJson(deployed_strategies, "script/output/devnet/deployed_strategies.json"); + } +} + + +contract StrategyDeployer { + address immutable beneficiary; + address immutable baseStrategyImplementation; + + constructor(address _beneficiary, address _baseStrategyImplementation) { + beneficiary = _beneficiary; + baseStrategyImplementation = _baseStrategyImplementation; + } + + function createManyStrategies(uint256 numStrategies) external returns(IStrategy[] memory) { + IStrategy[] memory strategies = new IStrategy[](numStrategies); + for (uint256 i = 0; i < numStrategies; i++) { + // create a strategy + strategies[i] = + StrategyBaseTVLLimits( + address( + new TransparentUpgradeableProxy( + address(baseStrategyImplementation), + address(1), + abi.encodeWithSelector( + StrategyBaseTVLLimits.initialize.selector, + type(uint256).max, + type(uint256).max, + new ERC20PresetFixedSupply("Test", "TST", uint256(type(uint128).max), beneficiary), + address(1) + ) + ) + ) + ); + } + return strategies; + } +} \ No newline at end of file diff --git a/script/deploy/mainnet/Deploy_Strategy_Factory.s.sol b/script/deploy/mainnet/Deploy_Strategy_Factory.s.sol new file mode 100644 index 000000000..027d7ecdc --- /dev/null +++ b/script/deploy/mainnet/Deploy_Strategy_Factory.s.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "@openzeppelin/contracts/utils/Create2.sol"; +import "../../utils/ExistingDeploymentParser.sol"; + +import "../../../src/contracts/strategies/StrategyFactory.sol"; + +/** + * @notice Script used for the first deployment of EigenLayer core contracts to Holesky + * FORK LOCAL + * anvil --fork-url $RPC_MAINNET + * forge script script/deploy/mainnet/Deploy_Strategy_Factory.s.sol:MainnetStrategyFactoryDeploy --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * + * MAINNET + * forge script script/deploy/mainnet/Deploy_Strategy_Factory.s.sol:MainnetStrategyFactoryDeploy --rpc-url $RPC_MAINNET --private-key $PRIVATE_KEY --verify --broadcast -vvvv + * + */ + +contract MainnetStrategyFactoryDeploy is ExistingDeploymentParser { + function run() external virtual { + // Use rewards config + _parseInitialDeploymentParams( + "script/configs/mainnet/v0.3.0-mainnet-rewards.config.json" + ); + _parseDeployedContracts( + "script/configs/mainnet/Mainnet_curent_deployment.config.json" + ); + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + emit log_named_address("Deployer Address", msg.sender); + + _deployStrategyFactory(); + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + // Sanity Checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(false); + _verifyInitializationParams(); + + logAndOutputContractAddresses("script/output/mainnet/v0.3.2-mainnet-strategy-factory.output.json"); + } + + /** + * @notice Deploy StrategyFactory for Mainnet + */ + + function _deployStrategyFactory() internal { + strategyFactoryImplementation = new StrategyFactory( + strategyManager, eigenLayerPauserReg + ); + + + + } +} \ No newline at end of file diff --git a/script/deploy/mainnet/EIGEN_upgrade.s.sol b/script/deploy/mainnet/EIGEN_upgrade.s.sol new file mode 100644 index 000000000..54f4e8155 --- /dev/null +++ b/script/deploy/mainnet/EIGEN_upgrade.s.sol @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@openzeppelin/contracts/governance/TimelockController.sol"; + +import "../../../src/contracts/token/BackingEigen.sol"; +import "../../../src/contracts/token/Eigen.sol"; + +import "forge-std/Script.sol"; +import "forge-std/Test.sol"; + +// # To load the variables in the .env file +// source .env + +// # To deploy and verify our contract +// forge script script/deploy/mainnet/EIGEN_upgrade.s.sol:EIGEN_upgrade -vvvv --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast +contract EIGEN_upgrade is Script, Test { + Vm cheats = Vm(VM_ADDRESS); + + BackingEigen public bEIGEN_proxy = BackingEigen(0x83E9115d334D248Ce39a6f36144aEaB5b3456e75); + BackingEigen public bEIGEN_implementation; + Eigen public EIGEN_proxy = Eigen(0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83); + Eigen public EIGEN_implementation; + ProxyAdmin public EIGEN_ProxyAdmin = ProxyAdmin(0xB8915E195121f2B5D989Ec5727fd47a5259F1CEC); + TimelockController public EIGEN_TimelockController = TimelockController(payable(0x2520C6b2C1FBE1813AB5c7c1018CDa39529e9FF2)); + address public EIGEN_TimelockAdmin = 0xbb00DDa2832850a43840A3A86515E3Fe226865F2; + + IERC20 public bEIGEN_addressBefore; + + function run() external { + // Read and log the chain ID + uint256 chainId = block.chainid; + emit log_named_uint("You are deploying on ChainID", chainId); + + if (chainId == 1) { + // rpcUrl = "RPC_MAINNET"; + } else { + revert("Chain not supported"); + } + + bEIGEN_addressBefore = EIGEN_proxy.bEIGEN(); + + require(bEIGEN_addressBefore == IERC20(0x83E9115d334D248Ce39a6f36144aEaB5b3456e75), + "something horribly wrong"); + + // Begin deployment + vm.startBroadcast(); + + // Deploy new implmementation contract + EIGEN_implementation = new Eigen({ + _bEIGEN: bEIGEN_addressBefore + }); + + vm.stopBroadcast(); + + emit log_named_address("EIGEN_implementation", address(EIGEN_implementation)); + + // Perform post-upgrade tests + simulatePerformingUpgrade(); + checkUpgradeCorrectness(); + simulateWrapAndUnwrap(); + } + + function simulatePerformingUpgrade() public { + // Upgrade beacon + uint256 delay = EIGEN_TimelockController.getMinDelay(); + bytes memory data = abi.encodeWithSelector( + ProxyAdmin.upgrade.selector, + TransparentUpgradeableProxy(payable(address(EIGEN_proxy))), + EIGEN_implementation + ); + emit log_named_bytes("data", data); + + vm.startPrank(EIGEN_TimelockAdmin); + EIGEN_TimelockController.schedule({ + target: address(EIGEN_ProxyAdmin), + value: 0, + data: data, + predecessor: bytes32(0), + salt: bytes32(0), + delay: delay + }); + + vm.warp(block.timestamp + delay); + EIGEN_TimelockController.execute({ + target: address(EIGEN_ProxyAdmin), + value: 0, + payload: data, + predecessor: bytes32(0), + salt: bytes32(0) + }); + + cheats.stopPrank(); + } + + function checkUpgradeCorrectness() public { + vm.prank(address(EIGEN_TimelockController)); + require(EIGEN_ProxyAdmin.getProxyImplementation(ITransparentUpgradeableProxy(payable(address(EIGEN_proxy)))) == address(EIGEN_implementation), + "implementation set incorrectly"); + require(EIGEN_proxy.bEIGEN() == bEIGEN_addressBefore, + "bEIGEN address changed unexpectedly"); + } + + function simulateWrapAndUnwrap() public { + uint256 amount = 1e18; + cheats.prank(address(EIGEN_proxy)); + bEIGEN_proxy.transfer(address(this), amount); + + bEIGEN_proxy.approve(address(EIGEN_proxy), amount); + uint256 bEIGEN_balanceStart = bEIGEN_proxy.balanceOf(address(this)); + uint256 EIGEN_balanceStart = EIGEN_proxy.balanceOf(address(this)); + EIGEN_proxy.wrap(amount); + uint256 bEIGEN_balanceMiddle = bEIGEN_proxy.balanceOf(address(this)); + uint256 EIGEN_balanceMiddle = EIGEN_proxy.balanceOf(address(this)); + EIGEN_proxy.unwrap(amount); + uint256 bEIGEN_balanceAfter = bEIGEN_proxy.balanceOf(address(this)); + uint256 EIGEN_balanceAfter = EIGEN_proxy.balanceOf(address(this)); + + require(bEIGEN_balanceMiddle + amount == bEIGEN_balanceStart, "wrapping did not transfer out bEIGEN"); + require(EIGEN_balanceMiddle == EIGEN_balanceStart + amount, "wrapping did not transfer in EIGEN"); + + require(bEIGEN_balanceAfter == bEIGEN_balanceStart, "unwrapping did not transfer in bEIGEN"); + require(EIGEN_balanceAfter == EIGEN_balanceStart, "unwrapping did not transfer out EIGEN"); + } +} \ No newline at end of file diff --git a/script/deploy/mainnet/EigenPod_Minor_Upgrade_Deploy.s.sol b/script/deploy/mainnet/EigenPod_Minor_Upgrade_Deploy.s.sol new file mode 100644 index 000000000..33723678b --- /dev/null +++ b/script/deploy/mainnet/EigenPod_Minor_Upgrade_Deploy.s.sol @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; + +import "../../../src/contracts/interfaces/IETHPOSDeposit.sol"; + +import "../../../src/contracts/core/StrategyManager.sol"; +import "../../../src/contracts/core/DelegationManager.sol"; + +import "../../../src/contracts/pods/EigenPod.sol"; +import "../../../src/contracts/pods/EigenPodManager.sol"; + +import "../../../src/contracts/permissions/PauserRegistry.sol"; + +import "forge-std/Script.sol"; +import "forge-std/Test.sol"; + +// # To load the variables in the .env file +// source .env + +// # To deploy and verify our contract +// forge script script/deploy/mainnet/EigenPod_Minor_Upgrade_Deploy.s.sol:EigenPod_Minor_Upgrade_Deploy --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv +contract EigenPod_Minor_Upgrade_Deploy is Script, Test { + Vm cheats = Vm(VM_ADDRESS); + + string public m2DeploymentOutputPath; + string public freshOutputPath; + + // EigenLayer core contracts + IDelegationManager public delegation; + DelegationManager public delegationImplementation; + IStrategyManager public strategyManager; + StrategyManager public strategyManagerImplementation; + IEigenPodManager public eigenPodManager; + EigenPodManager public eigenPodManagerImplementation; + IBeacon public eigenPodBeacon; + EigenPod public eigenPodImplementation; + + // Eigenlayer Proxy Admin + ProxyAdmin public eigenLayerProxyAdmin; + + // BeaconChain deposit contract + IETHPOSDeposit public ethPOS; + + // RPC url to fork from for pre-upgrade state change tests + string public rpcUrl; + + uint64 public genesisTimeBefore; + uint64 public maxRestakedBalanceBefore; + + function run() external { + // Read and log the chain ID + uint256 chainId = block.chainid; + emit log_named_uint("You are deploying on ChainID", chainId); + + // Update deployment path addresses if on mainnet + if (chainId == 1) { + m2DeploymentOutputPath = "script/output/mainnet/M2_mainnet_upgrade.output.json"; + freshOutputPath = "script/output/mainnet/eigenpod_minor_upgrade_deploy.json"; + rpcUrl = "RPC_MAINNET"; + } else { + revert("Chain not supported"); + } + + // Read json data + string memory deployment_data = vm.readFile(m2DeploymentOutputPath); + delegation = DelegationManager(stdJson.readAddress(deployment_data, ".addresses.delegationManager")); + strategyManager = DelegationManager(address(delegation)).strategyManager(); + eigenPodManager = DelegationManager(address(delegation)).eigenPodManager(); + eigenPodBeacon = eigenPodManager.eigenPodBeacon(); + ethPOS = eigenPodManager.ethPOS(); + + eigenLayerProxyAdmin = ProxyAdmin(stdJson.readAddress(deployment_data, ".addresses.eigenLayerProxyAdmin")); + + genesisTimeBefore = EigenPod(payable(eigenPodBeacon.implementation())).GENESIS_TIME(); + // maxRestakedBalanceBefore = EigenPod(payable(eigenPodBeacon.implementation())).MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR(); + + // Begin deployment + vm.startBroadcast(); + + // Deploy new implmementation contracts + eigenPodImplementation = new EigenPod({ + _ethPOS: ethPOS, + _eigenPodManager: eigenPodManager, + // _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR: maxRestakedBalanceBefore, + _GENESIS_TIME: genesisTimeBefore + }); + + vm.stopBroadcast(); + + // Write json data out + string memory parent_object = "parent object"; + string memory deployed_addresses = "addresses"; + + // Add chain info + string memory chain_info = "chainInfo"; + vm.serializeUint(chain_info, "deploymentBlock", block.number); + string memory chain_info_output = vm.serializeUint(chain_info, "chainId", chainId); + + // Serialize new implementation addresses + string memory deployed_addresses_output = vm.serializeAddress( + deployed_addresses, + "eigenPodImplementation", + address(eigenPodImplementation) + ); + + // Save addresses + vm.serializeString(parent_object, deployed_addresses, deployed_addresses_output); + string memory finalJson = vm.serializeString(parent_object, chain_info, chain_info_output); + + // Write output to file + vm.writeJson(finalJson, freshOutputPath); + + // Perform post-upgrade tests + simulatePerformingUpgrade(); + checkUpgradeCorrectness(); + } + + function simulatePerformingUpgrade() public { + // Upgrade beacon + cheats.prank(UpgradeableBeacon(address(eigenPodBeacon)).owner()); + UpgradeableBeacon(address(eigenPodBeacon)).upgradeTo(address(eigenPodImplementation)); + } + + function checkUpgradeCorrectness() public view { + _verifyEigenPodCorrectness(); + } + + function _verifyEigenPodCorrectness() public view { + // Check that state is correct + require(eigenPodBeacon.implementation() == address(eigenPodImplementation), + "implementation set incorrectly"); + require(eigenPodImplementation.ethPOS() == ethPOS, + "ethPOS set incorrectly"); + require(eigenPodImplementation.eigenPodManager() == eigenPodManager, + "eigenPodManager set incorrectly"); + // check that values are unchanged + // require(eigenPodImplementation.MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR() == maxRestakedBalanceBefore, + // "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR set incorrectly"); + require(eigenPodImplementation.GENESIS_TIME() == genesisTimeBefore, + "GENESIS_TIME set incorrectly"); + // redundant checks on correct values + // require(eigenPodImplementation.MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR() == 32 gwei, + // "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR set incorrectly"); + require(eigenPodImplementation.GENESIS_TIME() == 1606824023, + "GENESIS_TIME set incorrectly"); + + + require(address(EigenPod(payable(eigenPodBeacon.implementation())).eigenPodManager()) == 0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338); + require(address(EigenPod(payable(eigenPodBeacon.implementation())).ethPOS()) == 0x00000000219ab540356cBB839Cbe05303d7705Fa); + } +} \ No newline at end of file diff --git a/script/deploy/mainnet/bEIGEN_upgrade.s.sol b/script/deploy/mainnet/bEIGEN_upgrade.s.sol new file mode 100644 index 000000000..4a7c40aa2 --- /dev/null +++ b/script/deploy/mainnet/bEIGEN_upgrade.s.sol @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@openzeppelin/contracts/governance/TimelockController.sol"; + +import "../../../src/contracts/token/BackingEigen.sol"; + +import "forge-std/Script.sol"; +import "forge-std/Test.sol"; + +// # To load the variables in the .env file +// source .env + +// # To deploy and verify our contract +// forge script script/deploy/mainnet/bEIGEN_upgrade.s.sol:bEIGEN_upgrade -vvvv --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast +contract bEIGEN_upgrade is Script, Test { + Vm cheats = Vm(VM_ADDRESS); + + BackingEigen public bEIGEN_proxy = BackingEigen(0x83E9115d334D248Ce39a6f36144aEaB5b3456e75); + BackingEigen public bEIGEN_implementation; + ProxyAdmin public bEIGEN_ProxyAdmin = ProxyAdmin(0x3f5Ab2D4418d38568705bFd6672630fCC3435CC9); + TimelockController public bEIGEN_TimelockController = TimelockController(payable(0xd6EC41E453C5E7dA5494f4d51A053Ab571712E6f)); + address public bEIGEN_TimelockAdmin = 0xbb00DDa2832850a43840A3A86515E3Fe226865F2; + + // // RPC url to fork from for pre-upgrade state change tests + // string public rpcUrl; + + IERC20 public EIGEN_addressBefore; + + function run() external { + // Read and log the chain ID + uint256 chainId = block.chainid; + emit log_named_uint("You are deploying on ChainID", chainId); + + if (chainId == 1) { + // rpcUrl = "RPC_MAINNET"; + } else { + revert("Chain not supported"); + } + + EIGEN_addressBefore = bEIGEN_proxy.EIGEN(); + + require(EIGEN_addressBefore == IERC20(0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83), + "something horribly wrong"); + + // Begin deployment + vm.startBroadcast(); + + // Deploy new implmementation contract + bEIGEN_implementation = new BackingEigen({ + _EIGEN: EIGEN_addressBefore + }); + + vm.stopBroadcast(); + + emit log_named_address("bEIGEN_implementation", address(bEIGEN_implementation)); + + // Perform post-upgrade tests + simulatePerformingUpgrade(); + checkUpgradeCorrectness(); + } + + function simulatePerformingUpgrade() public { + // Upgrade beacon + uint256 delay = bEIGEN_TimelockController.getMinDelay(); + bytes memory data = abi.encodeWithSelector( + ProxyAdmin.upgrade.selector, + TransparentUpgradeableProxy(payable(address(bEIGEN_proxy))), + bEIGEN_implementation + ); + emit log_named_bytes("data", data); + + vm.startPrank(bEIGEN_TimelockAdmin); + bEIGEN_TimelockController.schedule({ + target: address(bEIGEN_ProxyAdmin), + value: 0, + data: data, + predecessor: bytes32(0), + salt: bytes32(0), + delay: delay + }); + + vm.warp(block.timestamp + delay); + bEIGEN_TimelockController.execute({ + target: address(bEIGEN_ProxyAdmin), + value: 0, + payload: data, + predecessor: bytes32(0), + salt: bytes32(0) + }); + + cheats.stopPrank(); + } + + function checkUpgradeCorrectness() public { + vm.prank(address(bEIGEN_TimelockController)); + require(bEIGEN_ProxyAdmin.getProxyImplementation(ITransparentUpgradeableProxy(payable(address(bEIGEN_proxy)))) == address(bEIGEN_implementation), + "implementation set incorrectly"); + require(bEIGEN_proxy.EIGEN() == EIGEN_addressBefore, + "EIGEN address changed unexpectedly"); + } +} \ No newline at end of file diff --git a/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol b/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol new file mode 100644 index 000000000..916003908 --- /dev/null +++ b/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "@openzeppelin/contracts/utils/Create2.sol"; +import "../../utils/ExistingDeploymentParser.sol"; + +/** + * @notice Script used for the first deployment of EigenLayer core contracts to Holesky + * FORK LOCAL + * anvil --fork-url $RPC_MAINNET + * forge script script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol:MainnetRewardsCoordinatorDeploy --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * + * MAINNET + * forge script script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol:MainnetRewardsCoordinatorDeploy --rpc-url $RPC_MAINNET --private-key $PRIVATE_KEY --verify --broadcast -vvvv + * + */ +contract MainnetRewardsCoordinatorDeploy is ExistingDeploymentParser { + function run() external virtual { + _parseInitialDeploymentParams( + "script/configs/mainnet/v0.3.0-mainnet-rewards.config.json" + ); + _parseDeployedContracts( + "script/configs/mainnet/v0.3.0-eigenlayer-addresses.config.json" + ); + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + emit log_named_address("Deployer Address", msg.sender); + + _deployRewardsCoordinator(); + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + // Sanity Checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(true); + _verifyInitializationParams(); + + logAndOutputContractAddresses("script/output/mainnet/v0.3.0-mainnet-rewards.output.json"); + } + + /** + * @notice Deploy RewardsCoordinator for Holesky + */ + function _deployRewardsCoordinator() internal { + + + // Deploy RewardsCoordinator proxy and implementation + rewardsCoordinatorImplementation = new RewardsCoordinator( + delegationManager, + strategyManager, + allocationManager, + eigenLayerPauserReg, + permissionController, + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS, + REWARDS_COORDINATOR_MAX_REWARDS_DURATION, + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH, + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH, + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP + ); + rewardsCoordinator = RewardsCoordinator( + address( + new TransparentUpgradeableProxy( + address(rewardsCoordinatorImplementation), + address(eigenLayerProxyAdmin), + abi.encodeWithSelector( + RewardsCoordinator.initialize.selector, + executorMultisig, + REWARDS_COORDINATOR_INIT_PAUSED_STATUS, + REWARDS_COORDINATOR_UPDATER, + REWARDS_COORDINATOR_ACTIVATION_DELAY, + REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS + ) + ) + ) + ); + } + + /** + * @notice Deploy RewardsCoordinator Implementation for Holesky and upgrade the proxy + */ + function _upgradeRewardsCoordinator() internal { + // Deploy RewardsCoordinator proxy and implementation + rewardsCoordinatorImplementation = new RewardsCoordinator( + delegationManager, + strategyManager, + allocationManager, + eigenLayerPauserReg, + permissionController, + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS, + REWARDS_COORDINATOR_MAX_REWARDS_DURATION, + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH, + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH, + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP + ); + + eigenLayerProxyAdmin.upgrade( + ITransparentUpgradeableProxy(payable(address(rewardsCoordinator))), + address(rewardsCoordinatorImplementation) + ); + } +} diff --git a/script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol b/script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol new file mode 100644 index 000000000..14d2dbc29 --- /dev/null +++ b/script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "@openzeppelin/contracts/utils/Create2.sol"; +import "../../utils/ExistingDeploymentParser.sol"; + +/** + * FORK LOCAL + * anvil --fork-url $RPC_MAINNET + * forge script script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol:MainnetPEPEDeploy --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv + * + * MAINNET + * forge script script/deploy/mainnet/v0.4.2-mainnet-pepe.s.sol:MainnetPEPEDeploy --rpc-url $RPC_MAINNET --private-key $PRIVATE_KEY --verify --broadcast -vvvv + * + */ +contract MainnetPEPEDeploy is ExistingDeploymentParser { + function run() external virtual { + _parseInitialDeploymentParams( + "script/configs/mainnet/mainnet-config.config.json" + ); + _parseDeployedContracts( + "script/configs/mainnet/mainnet-addresses.config.json" + ); + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + emit log_named_address("Deployer Address", msg.sender); + + _deployPEPE(); + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + _upgradePEPE(); + + _testDeploy(); + + // Post-upgrade sanity checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(false); + _verifyInitializationParams(); + + logAndOutputContractAddresses("script/output/mainnet/v0.4.2-mainnet-pepe.output.json"); + } + + function _deployPEPE() internal { + // Deploy EigenPod + eigenPodImplementation = new EigenPod( + IETHPOSDeposit(ETHPOSDepositAddress), + eigenPodManager, + EIGENPOD_GENESIS_TIME + ); + + // Deploy EigenPodManager + eigenPodManagerImplementation = new EigenPodManager( + IETHPOSDeposit(ETHPOSDepositAddress), + eigenPodBeacon, + strategyManager, + delegationManager, + eigenLayerPauserReg + ); + } + + function _upgradePEPE() internal { + vm.startPrank(address(executorMultisig)); + + // upgrade UpgradeableBeacon + eigenPodBeacon.upgradeTo(address(eigenPodImplementation)); + + // upgrade TUPS + eigenLayerProxyAdmin.upgrade( + ITransparentUpgradeableProxy(payable(address(eigenPodManager))), + address(eigenPodManagerImplementation) + ); + + vm.stopPrank(); + } + + function _testDeploy() internal view { + require(eigenPodImplementation.activeValidatorCount() == 0, "unable to fetch activeValidatorCount"); + } +} diff --git a/script/deploy/mainnet/v0.4.3-upgrade_rewardsCoordinator.s.sol b/script/deploy/mainnet/v0.4.3-upgrade_rewardsCoordinator.s.sol new file mode 100644 index 000000000..688b98b7a --- /dev/null +++ b/script/deploy/mainnet/v0.4.3-upgrade_rewardsCoordinator.s.sol @@ -0,0 +1,200 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "../../utils/ExistingDeploymentParser.sol"; +import "../../utils/Multisend.sol"; +import "script/utils/TimelockEncoding.sol"; + +/** + * + * Mainnet: Deploy/Upgrade RewardsCoordinator + * forge script script/deploy/mainnet/v0.4.3-upgrade-rewardsCoordinator.s.sol --rpc-url $MAINNET_RPC --private-key $PRIVATE_KEY --broadcast -vvvv --verify --etherscan-api-key $ETHERSCAN_API_KEY + * + * Test: forge test --mc Upgrade_Mainnet_RewardsCoordinator --mt test_set_reward_for_all_submitter --rpc-url $MAINNET_RPC -vv + */ +contract Upgrade_Mainnet_RewardsCoordinator is ExistingDeploymentParser, TimelockEncoding { + + // CALLDATA FOR CALL TO TIMELOCK + // TUESDAY, SEPTEMBER 27 2024 22:00:00 GMT (6pm EST/3pm PST) + uint256 timelockEta = 1727474400; + + uint256 dayToQueueAction = 1726610400; + + // Calldatas for upgrading RC + bytes final_calldata_to_executor_multisig; + bytes calldata_to_timelock_queuing_action; + bytes calldata_to_timelock_executing_action; + + // Calldatas for setting reward for all submitter + bytes hopper_setter_final_calldata_to_ops_multisig; + + modifier parseState() { + _parseInitialDeploymentParams("script/configs/mainnet/mainnet-config.config.json"); + _parseDeployedContracts("script/configs/mainnet/mainnet-addresses.config.json"); + _; + } + + function run() public parseState { + uint256 chainId = block.chainid; + emit log_named_uint("You are deploying on ChainID", chainId); + + if (chainId != 1) { + revert("Chain not supported"); + } + + RewardsCoordinator oldRewardsCoordinator = rewardsCoordinatorImplementation; + + // Deploy Rewards Coordinator + vm.startBroadcast(); + rewardsCoordinatorImplementation = new RewardsCoordinator( + delegationManager, + strategyManager, + allocationManager, + eigenLayerPauserReg, + permissionController, + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS, + REWARDS_COORDINATOR_MAX_REWARDS_DURATION, + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH, + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH, + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP + ); + vm.stopBroadcast(); + + _sanityCheckImplementations(oldRewardsCoordinator, rewardsCoordinatorImplementation); + + emit log_named_address("Rewards Coordinator Implementation", address(rewardsCoordinatorImplementation)); + + // Create Upgrade Txs via Operations Multisig to Timelock to: + // 1. Upgrade RewardsCoordinator + // 2. Set owner of RewardsCoordinator to OperationsMultisig + Tx[] memory txs = new Tx[](2); + address timelockTarget = executorMultisig; + + // 1. Upgrade Rewards Coordiantor + txs[0] = Tx({ + to: address(eigenLayerProxyAdmin), + value: 0, + data: abi.encodeWithSelector( + ProxyAdmin.upgrade.selector, + TransparentUpgradeableProxy(payable(address(rewardsCoordinator))), + rewardsCoordinatorImplementation + ) + }); + + // 2. Set owner of RewardsCoordinator to OperationsMultisig + txs[1] = Tx({ + to: address(rewardsCoordinator), + value: 0, + data: abi.encodeWithSelector( + Ownable.transferOwnership.selector, + address(operationsMultisig) + ) + }); + + bytes memory calldata_to_multisend_contract = abi.encodeWithSelector(MultiSendCallOnly.multiSend.selector, encodeMultisendTxs(txs)); + emit log_named_bytes("calldata_to_multisend_contract", calldata_to_multisend_contract); + + final_calldata_to_executor_multisig = encodeForExecutor({ + from: timelock, + to: multiSendCallOnly, + value: 0, + data: calldata_to_multisend_contract, + operation: ISafe.Operation.DelegateCall + }); + + calldata_to_timelock_queuing_action = abi.encodeWithSelector(ITimelock.queueTransaction.selector, + timelockTarget, + timelockValue, + timelockSignature, + final_calldata_to_executor_multisig, + timelockEta + ); + + emit log_named_bytes("calldata_to_timelock_queuing_action", calldata_to_timelock_queuing_action); + + calldata_to_timelock_executing_action = abi.encodeWithSelector(ITimelock.executeTransaction.selector, + timelockTarget, + timelockValue, + timelockSignature, + final_calldata_to_executor_multisig, + timelockEta + ); + + emit log_named_bytes("calldata_to_timelock_executing_action", calldata_to_timelock_executing_action); + } + + function run_mainnet_rc_upgrade() public { + run(); + + vm.warp(dayToQueueAction); + + // Queue Transaction + vm.prank(operationsMultisig); + (bool success, ) = address(timelock).call(calldata_to_timelock_queuing_action); + require(success, "Timelock queueTransaction failed"); + + // Fast forwart to after ETA + vm.warp(timelockEta + 1); + vm.prank(operationsMultisig); + (success, ) = address(timelock).call(calldata_to_timelock_executing_action); + require(success, "Timelock executeTransaction failed"); + + // Assert owner + assertEq(address(rewardsCoordinator.owner()), address(operationsMultisig), "RewardsCoordinator owner is not OperationsMultisig"); + + // Sanity Checks + _verifyContractPointers(); + _verifyImplementations(); + _verifyContractsInitialized(false); + _verifyInitializationParams(); + } + + function _sanityCheckImplementations(RewardsCoordinator oldRc, RewardsCoordinator newRc) internal view { + // Verify configs between both rewardsCoordinatorImplementations + assertEq( + address(oldRc.delegationManager()), + address(newRc.delegationManager()), + "DM mismatch" + ); + assertEq( + address(oldRc.strategyManager()), + address(newRc.strategyManager()), + "SM mismatch" + ); + assertEq( + oldRc.CALCULATION_INTERVAL_SECONDS(), + newRc.CALCULATION_INTERVAL_SECONDS(), + "CALCULATION_INTERVAL_SECONDS mismatch" + ); + assertEq( + oldRc.MAX_REWARDS_DURATION(), + newRc.MAX_REWARDS_DURATION(), + "MAX_REWARDS_DURATION mismatch" + ); + assertEq( + oldRc.MAX_RETROACTIVE_LENGTH(), + newRc.MAX_RETROACTIVE_LENGTH(), + "MAX_RETROACTIVE_LENGTH mismatch" + ); + assertEq( + oldRc.MAX_FUTURE_LENGTH(), + newRc.MAX_FUTURE_LENGTH(), + "MAX_FUTURE_LENGTH mismatch" + ); + assertEq( + oldRc.GENESIS_REWARDS_TIMESTAMP(), + newRc.GENESIS_REWARDS_TIMESTAMP(), + "GENESIS_REWARDS_TIMESTAMP mismatch" + ); + } + + function run_set_reward_for_all_submitter(address hopper) public { + run_mainnet_rc_upgrade(); + + // Set reward for all submitters + vm.prank(operationsMultisig); + rewardsCoordinator.setRewardsForAllSubmitter(hopper, true); + + assertTrue(rewardsCoordinator.isRewardsForAllSubmitter(hopper), "Hopper not set for all submitters"); + } +} \ No newline at end of file diff --git a/script/tasks/slash_operatorSet.s.sol b/script/tasks/slash_operatorSet.s.sol index 4b078c263..43d00b2ee 100644 --- a/script/tasks/slash_operatorSet.s.sol +++ b/script/tasks/slash_operatorSet.s.sol @@ -9,6 +9,7 @@ import "forge-std/Test.sol"; // use forge: // RUST_LOG=forge,foundry=trace forge script script/tasks/slash_operatorSet.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --sig "run(string memory configFile,address operator,uint32 operatorSetId,uint256 wadToSlash)" -- // RUST_LOG=forge,foundry=trace forge script script/tasks/slash_operatorSet.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --sig "run(string memory configFile,address operator,uint32 operatorSetId,uint256 wadToSlash)" -- local/slashing_output.json 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 00000001 05000000 +<<<<<<< HEAD contract SlashOperatorSet is Script, Test, IAllocationManagerTypes { Vm cheats = Vm(VM_ADDRESS); @@ -19,6 +20,12 @@ contract SlashOperatorSet is Script, Test, IAllocationManagerTypes { IStrategy[] memory strategies, uint256[] memory wadsToSlash ) public { +======= +contract SlashOperatorSet is Script, Test { + Vm cheats = Vm(VM_ADDRESS); + + function run(string memory configFile, address operator, uint32 operatorSetId, uint256 wadToSlash) public { +>>>>>>> b0193bfe (feat: alm tests) // Load config string memory deployConfigPath = string(bytes(string.concat("script/output/", configFile))); string memory config_data = vm.readFile(deployConfigPath); @@ -33,11 +40,18 @@ contract SlashOperatorSet is Script, Test, IAllocationManagerTypes { AllocationManager am = AllocationManager(allocationManager); // Define SlashingParams struct instance with correct array initialization +<<<<<<< HEAD SlashingParams memory slashing = SlashingParams({ operator: operator, operatorSetId: operatorSetId, strategies: strategies, wadsToSlash: wadsToSlash, +======= + IAllocationManagerTypes.SlashingParams memory slashing = IAllocationManagerTypes.SlashingParams({ + operator: operator, + operatorSetId: operatorSetId, + wadToSlash: wadToSlash, +>>>>>>> b0193bfe (feat: alm tests) description: "slashed" }); diff --git a/script/utils/ExistingDeploymentParser.sol b/script/utils/ExistingDeploymentParser.sol index fcad17071..e0d75c73d 100644 --- a/script/utils/ExistingDeploymentParser.sol +++ b/script/utils/ExistingDeploymentParser.sol @@ -346,6 +346,12 @@ contract ExistingDeploymentParser is Script, Test { REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH = uint32( stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.OPERATOR_SET_MAX_RETROACTIVE_LENGTH") ); + REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP = uint32( + stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP") + ); + REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH = uint32( + stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.OPERATOR_SET_MAX_RETROACTIVE_LENGTH") + ); // AVSDirectory AVS_DIRECTORY_INIT_PAUSED_STATUS = stdJson.readUint(initialDeploymentData, ".avsDirectory.init_paused_status"); // EigenPodManager diff --git a/script/utils/TimelockEncoding.sol b/script/utils/TimelockEncoding.sol new file mode 100644 index 000000000..c2eaad396 --- /dev/null +++ b/script/utils/TimelockEncoding.sol @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "forge-std/Script.sol"; +import "forge-std/Test.sol"; + +import "./TxEncodingInterfaces.sol"; + +contract TimelockEncoding is Test { + // CALLDATA FOR CALL FROM TIMELOCK TO EXECUTOR MULTISIG + uint256 safeTxGas = 0; + uint256 baseGas = 0; + uint256 gasPrice = 0; + address gasToken = address(uint160(0)); + address payable refundReceiver = payable(address(uint160(0))); + + // CALDATA FOR CALL TO TIMELOCK + uint256 timelockValue = 0; + // empty string, just encode all the data in 'timelockData' + string timelockSignature; + + // appropriate address on mainnet, Holesky, and many other chains + address multiSendCallOnly = 0x40A2aCCbd92BCA938b02010E17A5b8929b49130D; + + function encodeForTimelock( + address to, + uint256 value, + bytes memory data, + uint256 timelockEta + ) public returns (bytes memory calldata_to_timelock_queuing_action, bytes memory calldata_to_timelock_executing_action) { + calldata_to_timelock_queuing_action = abi.encodeWithSelector(ITimelock.queueTransaction.selector, + to, + value, + timelockSignature, + data, + timelockEta + ); + + emit log_named_bytes("calldata_to_timelock_queuing_action", calldata_to_timelock_queuing_action); + + calldata_to_timelock_executing_action = abi.encodeWithSelector(ITimelock.executeTransaction.selector, + to, + value, + timelockSignature, + data, + timelockEta + ); + + emit log_named_bytes("calldata_to_timelock_executing_action", calldata_to_timelock_executing_action); + + return (calldata_to_timelock_queuing_action, calldata_to_timelock_executing_action); + } + + function encodeForExecutor( + address from, + address to, + uint256 value, + bytes memory data, + ISafe.Operation operation + ) public returns (bytes memory) { + // encode the "signature" required by the Safe + bytes1 v = bytes1(uint8(1)); + bytes32 r = bytes32(uint256(uint160(from))); + bytes32 s; + bytes memory sig = abi.encodePacked(r,s,v); + emit log_named_bytes("sig", sig); + + bytes memory final_calldata_to_executor_multisig = abi.encodeWithSelector(ISafe.execTransaction.selector, + to, + value, + data, + operation, + safeTxGas, + baseGas, + gasPrice, + gasToken, + refundReceiver, + sig + ); + + emit log_named_bytes("final_calldata_to_executor_multisig", final_calldata_to_executor_multisig); + + return final_calldata_to_executor_multisig; + } + + struct Tx { + address to; + uint256 value; + bytes data; + } + + function encodeMultisendTxs(Tx[] memory txs) public pure returns (bytes memory) { + bytes memory ret = new bytes(0); + for (uint256 i = 0; i < txs.length; i++) { + ret = abi.encodePacked( + ret, + abi.encodePacked( + uint8(0), + txs[i].to, + txs[i].value, + uint256(txs[i].data.length), + txs[i].data + ) + ); + } + return ret; + } +} diff --git a/script/whitelist/Staker.sol b/script/whitelist/Staker.sol new file mode 100644 index 000000000..c2ec20af1 --- /dev/null +++ b/script/whitelist/Staker.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "../../src/contracts/interfaces/IStrategyManager.sol"; +import "../../src/contracts/interfaces/IStrategy.sol"; +import "../../src/contracts/interfaces/IDelegationManager.sol"; +import "../../src/contracts/interfaces/ISignatureUtils.sol"; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; +import "forge-std/Test.sol"; + +contract Staker is Ownable { + + constructor( + IStrategy strategy, + IStrategyManager strategyManager, + IDelegationManager delegation, + IERC20 token, + uint256 amount, + address operator + ) Ownable() { + token.approve(address(strategyManager), type(uint256).max); + strategyManager.depositIntoStrategy(strategy, token, amount); + ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; + delegation.delegateTo(operator, signatureWithExpiry, bytes32(0)); + } + + function callAddress(address implementation, bytes memory data) external onlyOwner returns(bytes memory) { + uint256 length = data.length; + bytes memory returndata; + assembly{ + let result := call( + gas(), + implementation, + callvalue(), + add(data, 32), + length, + 0, + 0 + ) + mstore(returndata, returndatasize()) + returndatacopy(add(returndata, 32), 0, returndatasize()) + } + + + return returndata; + + } + +} diff --git a/src/contracts/core/AllocationManager.sol b/src/contracts/core/AllocationManager.sol index 8e8fb2ac8..a5f7c7f20 100644 --- a/src/contracts/core/AllocationManager.sol +++ b/src/contracts/core/AllocationManager.sol @@ -59,7 +59,11 @@ contract AllocationManager is function slashOperator( address avs, SlashingParams calldata params - ) external onlyWhenNotPaused(PAUSED_OPERATOR_SLASHING) checkCanCall(avs) { + ) external onlyWhenNotPaused(PAUSED_OPERATOR_SLASHING) { + // Check that the msg.sender can call - we don't use a modifier to avoid `stack too deep` errors + require(_checkCanCall(avs), InvalidCaller()); + require(0 < params.wadToSlash && params.wadToSlash <= WAD, InvalidWadToSlash()); + // Check that the operator set exists and the operator is registered to it OperatorSet memory operatorSet = OperatorSet(avs, params.operatorSetId); bool isOperatorSlashable = _isOperatorSlashable(params.operator, operatorSet); @@ -123,6 +127,12 @@ contract AllocationManager is // 5. Update state _updateAllocationInfo(params.operator, operatorSet.key(), params.strategies[i], info, allocation); + + // Emit an event for the updated allocation + emit AllocationUpdated( + params.operator, operatorSet, params.strategies[i], allocation.currentMagnitude, uint32(block.number) + ); + _updateMaxMagnitude(params.operator, params.strategies[i], info.maxMagnitude); // 6. Decrease and burn operators shares in the DelegationManager @@ -134,7 +144,7 @@ contract AllocationManager is }); } - emit OperatorSlashed(params.operator, operatorSet, params.strategies, wadSlashed, params.description); + emit OperatorSlashed(params.operator, operatorSet, strategiesSlashed, wadSlashed, params.description); } /// @inheritdoc IAllocationManager @@ -201,6 +211,7 @@ contract AllocationManager is allocation.currentMagnitude = params[i].newMagnitudes[j]; allocation.pendingDiff = 0; + allocation.effectBlock = uint32(block.number); } } else if (allocation.pendingDiff > 0) { // Allocation immediately consumes available magnitude, but the additional @@ -213,6 +224,15 @@ contract AllocationManager is // 5. Update state _updateAllocationInfo(operator, operatorSet.key(), strategy, info, allocation); + + // 6. Emit an event for the updated allocation + emit AllocationUpdated( + operator, + OperatorSetLib.decode(operatorSet.key()), + strategy, + _addInt128(allocation.currentMagnitude, allocation.pendingDiff), + allocation.effectBlock + ); } } } @@ -292,7 +312,7 @@ contract AllocationManager is function setAllocationDelay(address operator, uint32 delay) external { if (msg.sender != address(delegation)) { require(_checkCanCall(operator), InvalidCaller()); - require(delegation.isOperator(operator), OperatorNotRegistered()); + require(delegation.isOperator(operator), InvalidOperator()); } _setAllocationDelay(operator, delay); } @@ -321,7 +341,6 @@ contract AllocationManager is // Add strategies to the operator set bytes32 operatorSetKey = operatorSet.key(); - for (uint256 j = 0; j < params[i].strategies.length; j++) { _operatorSetStrategies[operatorSetKey].add(address(params[i].strategies[j])); emit StrategyAddedToOperatorSet(operatorSet, params[i].strategies[j]); @@ -497,15 +516,18 @@ contract AllocationManager is StrategyInfo memory info, Allocation memory allocation ) internal { - // Update encumbered magnitude - encumberedMagnitude[operator][strategy] = info.encumberedMagnitude; - emit EncumberedMagnitudeUpdated(operator, strategy, info.encumberedMagnitude); + // Update encumbered magnitude if it has changed + // The mapping should NOT be updated when there is a deallocation on a delay + if (encumberedMagnitude[operator][strategy] != info.encumberedMagnitude) { + encumberedMagnitude[operator][strategy] = info.encumberedMagnitude; + emit EncumberedMagnitudeUpdated(operator, strategy, info.encumberedMagnitude); + } // Update allocation for this operator set from the strategy + // We emit an `AllocationUpdated` from the `modifyAllocations` and `slashOperator` functions. + // `clearDeallocationQueue` does not emit an `AllocationUpdated` event since it was + // emitted when the deallocation was queued allocations[operator][operatorSetKey][strategy] = allocation; - emit AllocationUpdated( - operator, OperatorSetLib.decode(operatorSetKey), strategy, allocation.currentMagnitude, uint32(block.number) - ); // Note: these no-op if the sets already contain the added values (or do not contain removed ones) if (allocation.pendingDiff != 0) { @@ -639,7 +661,7 @@ contract AllocationManager is Allocation memory allocation = allocations[operator][operatorSetKey][strategy]; // If we've reached a pending deallocation that isn't completable yet, - // we can stop. Any subsequent modificaitons will also be uncompletable. + // we can stop. Any subsequent modifications will also be uncompletable. if (block.number < allocation.effectBlock) { break; } diff --git a/src/contracts/core/AllocationManagerStorage.sol b/src/contracts/core/AllocationManagerStorage.sol index f86d975cd..c5d397ec8 100644 --- a/src/contracts/core/AllocationManagerStorage.sol +++ b/src/contracts/core/AllocationManagerStorage.sol @@ -87,6 +87,8 @@ abstract contract AllocationManagerStorage is IAllocationManager { _maxMagnitudeHistory; /// @dev For a strategy, contains the amount of magnitude an operator has allocated to operator sets + /// @dev This value should be read with caution, as deallocations that are completable but not + /// popped off the queue are still included in the encumbered magnitude mapping(address operator => mapping(IStrategy strategy => uint64)) public encumberedMagnitude; /// @dev For a strategy, keeps an ordered queue of operator sets that have pending deallocations diff --git a/src/contracts/core/DelegationManager.sol b/src/contracts/core/DelegationManager.sol index b8747f3d2..333764d40 100644 --- a/src/contracts/core/DelegationManager.sol +++ b/src/contracts/core/DelegationManager.sol @@ -680,6 +680,15 @@ contract DelegationManager is } } + /// @dev Depending on the strategy used, determine which ShareManager contract to make external calls to + function _getShareManager( + IStrategy strategy + ) internal view returns (IShareManager) { + return strategy == beaconChainETHStrategy + ? IShareManager(address(eigenPodManager)) + : IShareManager(address(strategyManager)); + } + /** * @notice Decreases `operator`s shares in `strategy` based on staker's removed shares * @param operator The operator to decrease the delegated delegated shares for diff --git a/src/contracts/core/RewardsCoordinator.sol b/src/contracts/core/RewardsCoordinator.sol index 0b74a9bfb..d5fcaa96b 100644 --- a/src/contracts/core/RewardsCoordinator.sol +++ b/src/contracts/core/RewardsCoordinator.sol @@ -426,6 +426,7 @@ contract RewardsCoordinator is block.timestamp - MAX_RETROACTIVE_LENGTH <= startTimestamp && GENESIS_REWARDS_TIMESTAMP <= startTimestamp, StartTimestampTooFarInPast() ); + require(rewardsSubmission.startTimestamp <= block.timestamp + MAX_FUTURE_LENGTH, StartTimestampTooFarInFuture()); // Require reward submission is for whitelisted strategy or beaconChainETHStrategy address currAddress = address(0); diff --git a/src/contracts/interfaces/IRewardsCoordinator.sol b/src/contracts/interfaces/IRewardsCoordinator.sol index 2bc4eb2b4..03e0f9d75 100644 --- a/src/contracts/interfaces/IRewardsCoordinator.sol +++ b/src/contracts/interfaces/IRewardsCoordinator.sol @@ -535,6 +535,16 @@ interface IRewardsCoordinator is IRewardsCoordinatorErrors, IRewardsCoordinatorE */ function setRewardsForAllSubmitter(address _submitter, bool _newValue) external; +/** + * @title Interface for the `IRewardsCoordinator` contract. + * @author Layr Labs, Inc. + * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service + * @notice Allows AVSs to make "Rewards Submissions", which get distributed amongst the AVSs' confirmed + * Operators and the Stakers delegated to those Operators. + * Calculations are performed based on the completed RewardsSubmission, with the results posted in + * a Merkle root against which Stakers & Operators can make claims. + */ +interface IRewardsCoordinator is IRewardsCoordinatorErrors, IRewardsCoordinatorEvents { /** * * VIEW FUNCTIONS diff --git a/src/contracts/interfaces/IWhitelister.sol b/src/contracts/interfaces/IWhitelister.sol new file mode 100644 index 000000000..b68f50eec --- /dev/null +++ b/src/contracts/interfaces/IWhitelister.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity >=0.5.0; + +import "../../contracts/interfaces/IStrategyManager.sol"; +import "../../contracts/interfaces/IStrategy.sol"; +import "../../contracts/interfaces/IDelegationManager.sol"; +import "../../../script/whitelist/Staker.sol"; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts/utils/Create2.sol"; + +interface IWhitelister { + function whitelist( + address operator + ) external; + + function getStaker( + address operator + ) external returns (address); + + function depositIntoStrategy( + address staker, + IStrategy strategy, + IERC20 token, + uint256 amount + ) external returns (bytes memory); + + function queueWithdrawal( + address staker, + IDelegationManagerTypes.QueuedWithdrawalParams[] calldata queuedWithdrawalParams + ) external returns (bytes memory); + + function completeQueuedWithdrawal( + address staker, + IDelegationManagerTypes.Withdrawal calldata queuedWithdrawal, + IERC20[] calldata tokens, + uint256 middlewareTimesIndex, + bool receiveAsTokens + ) external returns (bytes memory); + + function transfer(address staker, address token, address to, uint256 amount) external returns (bytes memory); + + function callAddress(address to, bytes memory data) external payable returns (bytes memory); +} diff --git a/src/contracts/permissions/PermissionController.sol b/src/contracts/permissions/PermissionController.sol index 46bdea5bd..566f69921 100644 --- a/src/contracts/permissions/PermissionController.sol +++ b/src/contracts/permissions/PermissionController.sol @@ -212,8 +212,15 @@ contract PermissionController is Initializable, PermissionControllerStorage { address[] memory targets = new address[](length); bytes4[] memory selectors = new bytes4[](length); +<<<<<<< HEAD for (uint256 i = 0; i < length; ++i) { (targets[i], selectors[i]) = _decodeTargetSelector(appointeePermissions.at(i)); +======= + for (uint256 i = 0; i < length; i++) { + (address target, bytes4 selector) = _decodeTargetSelector(appointeePermissions.at(i)); + targets[i] = target; + selectors[i] = selector; +>>>>>>> b0193bfe (feat: alm tests) } return (targets, selectors); diff --git a/src/test/DevnetLifecycle.t.sol b/src/test/DevnetLifecycle.t.sol index 2c67a6854..91d81a331 100644 --- a/src/test/DevnetLifecycle.t.sol +++ b/src/test/DevnetLifecycle.t.sol @@ -8,15 +8,22 @@ import "../../src/contracts/core/AVSDirectory.sol"; import "../../src/contracts/core/AllocationManager.sol"; import "../../src/contracts/strategies/StrategyBase.sol"; +<<<<<<< HEAD import "src/test/utils/ArrayLib.sol"; +======= +>>>>>>> b0193bfe (feat: alm tests) // Test import "forge-std/Test.sol"; /// @notice Tests deployed contracts as part of the public devnet /// Run with: forge test --mc Devnet_Lifecycle_Test --rpc-url $RPC_HOLESKY +<<<<<<< HEAD contract Devnet_Lifecycle_Test is Test, IAllocationManagerTypes { using ArrayLib for *; +======= +contract Devnet_Lifecycle_Test is Test { +>>>>>>> b0193bfe (feat: alm tests) // Contracts DelegationManager public delegationManager; @@ -56,11 +63,23 @@ contract Devnet_Lifecycle_Test is Test, IAllocationManagerTypes { } function _getOperatorSetArray() internal view returns (uint32[] memory) { +<<<<<<< HEAD return operatorSetId.toArrayU32(); } function _getOperatorSetsArray() internal view returns (OperatorSet[] memory) { return OperatorSet({avs: avs, id: operatorSetId}).toArray(); +======= + uint32[] memory operatorSets = new uint32[](1); + operatorSets[0] = operatorSetId; + return operatorSets; + } + + function _getOperatorSetsArray() internal view returns (OperatorSet[] memory) { + OperatorSet[] memory operatorSets = new OperatorSet[](1); + operatorSets[0] = OperatorSet({avs: avs, id: operatorSetId}); + return operatorSets; +>>>>>>> b0193bfe (feat: alm tests) } function test() public { @@ -133,6 +152,7 @@ contract Devnet_Lifecycle_Test is Test, IAllocationManagerTypes { function _registerAVS() internal { cheats.startPrank(avs); +<<<<<<< HEAD CreateSetParams memory createSetParams =CreateSetParams({ operatorSetId: operatorSetId, @@ -140,28 +160,69 @@ contract Devnet_Lifecycle_Test is Test, IAllocationManagerTypes { }); allocationManager.createOperatorSets(avs, createSetParams.toArray()); +======= + IStrategy[] memory strategies = new IStrategy[](1); + strategies[0] = wethStrategy; + + IAllocationManagerTypes.CreateSetParams memory createSetParams = IAllocationManagerTypes.CreateSetParams({ + operatorSetId: operatorSetId, + strategies: strategies + }); + + IAllocationManagerTypes.CreateSetParams[] memory array = new IAllocationManagerTypes.CreateSetParams[](1); + array[0] = createSetParams; + + allocationManager.createOperatorSets(avs, array); +>>>>>>> b0193bfe (feat: alm tests) cheats.stopPrank(); } function _registerOperatorToAVS() public { cheats.prank(operator); +<<<<<<< HEAD allocationManager.registerForOperatorSets(operator,RegisterParams(avs, operatorSetId.toArrayU32(), "")); +======= + + uint32[] memory operatorSetIds = new uint32[](1); + operatorSetIds[0] = operatorSetId; + + allocationManager.registerForOperatorSets(operator, IAllocationManagerTypes.RegisterParams(avs, operatorSetIds, "")); + +>>>>>>> b0193bfe (feat: alm tests) assertEq(allocationManager.getMembers(OperatorSet(avs, operatorSetId))[0], operator); } function _setMagnitude() public { +<<<<<<< HEAD AllocateParams[] memory allocations = new AllocateParams[](1); allocations[0] = AllocateParams({ operatorSet: operatorSet, strategies: wethStrategy.toArray(), newMagnitudes: magnitudeToSet.toArrayU64() +======= + IStrategy[] memory strategies = new IStrategy[](1); + strategies[0] = wethStrategy; + + uint64[] memory magnitudes = new uint64[](1); + magnitudes[0] = magnitudeToSet; + + IAllocationManagerTypes.AllocateParams[] memory allocations = new IAllocationManagerTypes.AllocateParams[](1); + allocations[0] = IAllocationManagerTypes.AllocateParams({ + operatorSet: operatorSet, + strategies: strategies, + newMagnitudes: magnitudes +>>>>>>> b0193bfe (feat: alm tests) }); cheats.prank(operator); allocationManager.modifyAllocations(operator, allocations); // Assert storage +<<<<<<< HEAD Allocation memory info = allocationManager.getAllocation(operator, operatorSet, wethStrategy); +======= + IAllocationManagerTypes.Allocation memory info = allocationManager.getAllocation(operator, operatorSet, wethStrategy); +>>>>>>> b0193bfe (feat: alm tests) assertEq(info.currentMagnitude, 0); assertEq(info.pendingDiff, int128(uint128(magnitudeToSet))); assertEq(info.effectBlock, block.number + 1); @@ -176,11 +237,20 @@ contract Devnet_Lifecycle_Test is Test, IAllocationManagerTypes { function _slashOperator() public { // Get slashing params +<<<<<<< HEAD SlashingParams memory slashingParams = SlashingParams({ operator: operator, operatorSetId: 1, strategies: wethStrategy.toArray(), wadsToSlash: 5e17.toArrayU256(), +======= + IStrategy[] memory strategies = new IStrategy[](1); + strategies[0] = wethStrategy; + IAllocationManagerTypes.SlashingParams memory slashingParams = IAllocationManagerTypes.SlashingParams({ + operator: operator, + operatorSetId: 1, + wadToSlash: 5e17, +>>>>>>> b0193bfe (feat: alm tests) description: "test" }); @@ -189,13 +259,22 @@ contract Devnet_Lifecycle_Test is Test, IAllocationManagerTypes { allocationManager.slashOperator(avs, slashingParams); // Assert storage +<<<<<<< HEAD Allocation memory info = allocationManager.getAllocation(operator, operatorSet, wethStrategy); +======= + IAllocationManagerTypes.Allocation memory info = allocationManager.getAllocation(operator, operatorSet, wethStrategy); +>>>>>>> b0193bfe (feat: alm tests) assertEq(info.currentMagnitude, magnitudeToSet - 5e17); } function _withdrawStaker() public { // Generate queued withdrawal params +<<<<<<< HEAD IStrategy[] memory strategies = wethStrategy.toArray(); +======= + IStrategy[] memory strategies = new IStrategy[](1); + strategies[0] = wethStrategy; +>>>>>>> b0193bfe (feat: alm tests) (uint256[] memory withdrawableShares, ) = delegationManager.getWithdrawableShares(staker, strategies); IDelegationManagerTypes.QueuedWithdrawalParams[] memory queuedWithdrawals = new IDelegationManagerTypes.QueuedWithdrawalParams[](1); queuedWithdrawals[0] = IDelegationManagerTypes.QueuedWithdrawalParams({ @@ -205,6 +284,11 @@ contract Devnet_Lifecycle_Test is Test, IAllocationManagerTypes { }); // Generate withdrawal params +<<<<<<< HEAD +======= + uint256[] memory scaledShares = new uint256[](1); + scaledShares[0] = 100e18; +>>>>>>> b0193bfe (feat: alm tests) IDelegationManagerTypes.Withdrawal memory withdrawal = IDelegationManagerTypes.Withdrawal({ staker: staker, delegatedTo: operator, @@ -212,7 +296,11 @@ contract Devnet_Lifecycle_Test is Test, IAllocationManagerTypes { nonce: delegationManager.cumulativeWithdrawalsQueued(staker), startBlock: uint32(block.number), strategies: strategies, +<<<<<<< HEAD scaledShares: 100e18.toArrayU256() +======= + scaledShares: scaledShares +>>>>>>> b0193bfe (feat: alm tests) }); // bytes32 withdrawalRoot = delegationManager.calculateWithdrawalRoot(withdrawal); // Generate complete withdrawal params diff --git a/src/test/integration/IntegrationBase.t.sol b/src/test/integration/IntegrationBase.t.sol index 62eedb6e8..9ad302019 100644 --- a/src/test/integration/IntegrationBase.t.sol +++ b/src/test/integration/IntegrationBase.t.sol @@ -20,8 +20,6 @@ abstract contract IntegrationBase is IntegrationDeployer { using Strings for *; using print for *; - using ArrayLib for IStrategy[]; - uint numStakers = 0; uint numOperators = 0; uint numAVSs = 0; diff --git a/src/test/integration/IntegrationDeployer.t.sol b/src/test/integration/IntegrationDeployer.t.sol index 0f6a36909..dc40b6fee 100644 --- a/src/test/integration/IntegrationDeployer.t.sol +++ b/src/test/integration/IntegrationDeployer.t.sol @@ -46,8 +46,6 @@ uint8 constant PAUSED_NON_PROOF_WITHDRAWALS = 5; abstract contract IntegrationDeployer is ExistingDeploymentParser, Logger { using StdStyle for *; - using ArrayLib for *; - using ArrayLib for IStrategy[]; // Fork ids for specific fork tests bool isUpgraded; @@ -263,9 +261,12 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser, Logger { ) ); //PermissionController - eigenLayerProxyAdmin.upgrade( + eigenLayerProxyAdmin.upgradeAndCall( ITransparentUpgradeableProxy(payable(address(permissionController))), - address(permissionControllerImplementation) + address(permissionControllerImplementation), + abi.encodeWithSelector( + PermissionController.initialize.selector + ) ); // Create base strategy implementation and deploy a few strategies baseStrategyImplementation = new StrategyBase(strategyManager, eigenLayerPauserReg); diff --git a/src/test/integration/tests/Deposit_Delegate_Allocate.t.sol b/src/test/integration/tests/Deposit_Delegate_Allocate.t.sol index f9964c67a..ee3958dcf 100644 --- a/src/test/integration/tests/Deposit_Delegate_Allocate.t.sol +++ b/src/test/integration/tests/Deposit_Delegate_Allocate.t.sol @@ -38,8 +38,7 @@ contract Integration_Deposit_Delegate_Allocate is IntegrationCheckUtils { for (uint i; i < operatorSets.length; ++i) { uint256 len = allocationManager.getStrategiesInOperatorSet(operatorSets[i]).length; operator.modifyAllocations(operatorSets[i], _randMagnitudes({ sum: 1 ether / uint64(operatorSets.length), len: len })); - (IStrategy[] memory strategiesToSlash, uint[] memory wadsToSlash) = _randStrategiesAndWadsToSlash(operatorSets[i]); - avs.slashOperator(operator, operatorSets[i].id, strategiesToSlash, wadsToSlash); + avs.slashOperator(operator, operatorSets[i].id, _randWadToSlash()); } // TODO: write checks for slashing... diff --git a/src/test/integration/users/AVS.t.sol b/src/test/integration/users/AVS.t.sol index 643a0693f..395f5f5ac 100644 --- a/src/test/integration/users/AVS.t.sol +++ b/src/test/integration/users/AVS.t.sol @@ -11,7 +11,7 @@ import "src/test/integration/users/User.t.sol"; import "src/test/integration/TimeMachine.t.sol"; import "src/test/utils/Logger.t.sol"; -import "src/test/utils/ArrayLib.sol"; +import "src/test/utils/SingleItemArrayLib.sol"; import "src/contracts/interfaces/IAVSRegistrar.sol"; interface IAVSDeployer { @@ -22,9 +22,7 @@ interface IAVSDeployer { contract AVS is Logger, IAllocationManagerTypes, IAVSRegistrar { using print for *; - using ArrayLib for *; - - IStrategy constant beaconChainETHStrategy = IStrategy(0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0); + using SingleItemArrayLib for *; AllocationManager immutable allocationManager; StrategyFactory immutable strategyFactory; @@ -90,6 +88,7 @@ contract AVS is Logger, IAllocationManagerTypes, IAVSRegistrar { allocationManager.createOperatorSets(address(this), p); } +<<<<<<< HEAD function slashOperator(User operator, uint32 operatorSetId, IStrategy[] memory strategies, uint256[] memory wadsToSlash) public createSnapshot { SlashingParams memory p = SlashingParams({ operator: address(operator), @@ -120,6 +119,29 @@ contract AVS is Logger, IAllocationManagerTypes, IAVSRegistrar { ); } +======= + function slashOperator(User operator, uint32 operatorSetId, uint256 wadToSlash) public createSnapshot { + print.method( + "slashOperator", + string.concat( + "{operator: ", + operator.NAME_COLORED(), + ", operatorSetId: ", + cheats.toString(operatorSetId), + ", wadToSlash: ", + wadToSlash.asWad(), + "}" + ) + ); + + SlashingParams memory p = SlashingParams({ + operator: address(operator), + operatorSetId: operatorSetId, + wadToSlash: wadToSlash, + description: "bad operator" + }); + +>>>>>>> b0193bfe (feat: alm tests) allocationManager.slashOperator(address(this), p); } diff --git a/src/test/integration/users/User.t.sol b/src/test/integration/users/User.t.sol index 205553010..c7c8d02a8 100644 --- a/src/test/integration/users/User.t.sol +++ b/src/test/integration/users/User.t.sol @@ -12,7 +12,7 @@ import "src/contracts/pods/EigenPod.sol"; import "src/test/integration/TimeMachine.t.sol"; import "src/test/integration/mocks/BeaconChainMock.t.sol"; import "src/test/utils/Logger.t.sol"; -import "src/test/utils/ArrayLib.sol"; +import "src/test/utils/SingleItemArrayLib.sol"; struct Validator { uint40 index; @@ -28,7 +28,11 @@ interface IUserDeployer { } contract User is Logger, IDelegationManagerTypes, IAllocationManagerTypes { +<<<<<<< HEAD using ArrayLib for *; +======= + using SingleItemArrayLib for *; +>>>>>>> b0193bfe (feat: alm tests) using print for *; AllocationManager allocationManager; diff --git a/src/test/unit/AllocationManagerUnit.t.sol b/src/test/unit/AllocationManagerUnit.t.sol index edf7f8c43..404c972f8 100644 --- a/src/test/unit/AllocationManagerUnit.t.sol +++ b/src/test/unit/AllocationManagerUnit.t.sol @@ -7,7 +7,7 @@ import "src/test/mocks/MockAVSRegistrar.sol"; contract AllocationManagerUnitTests is EigenLayerUnitTestSetup, IAllocationManagerErrors, IAllocationManagerEvents { using StdStyle for *; - using ArrayLib for *; + using SingleItemArrayLib for *; /// ----------------------------------------------------------------------- /// Constants @@ -18,8 +18,6 @@ contract AllocationManagerUnitTests is EigenLayerUnitTestSetup, IAllocationManag uint256 internal constant FUZZ_MAX_STRATS = 8; uint256 internal constant FUZZ_MAX_OP_SETS = 8; - uint8 internal constant MAX_OPERATOR_SET_STRATEGY_LIST_LENGTH = 33; - uint8 internal constant PAUSED_MODIFY_ALLOCATIONS = 0; uint8 internal constant PAUSED_OPERATOR_SLASHING = 1; uint8 internal constant PAUSED_OPERATOR_SET_REGISTRATION_AND_DEREGISTRATION = 2; @@ -48,6 +46,11 @@ contract AllocationManagerUnitTests is EigenLayerUnitTestSetup, IAllocationManag address defaultOperator = address(this); address defaultAVS = address(new MockAVSRegistrar()); + /// ----------------------------------------------------------------------- + /// Internal Storage Helpers + /// ----------------------------------------------------------------------- + mapping(IStrategy => uint64) _encumberedMagnitudes; + /// ----------------------------------------------------------------------- /// Setup /// ----------------------------------------------------------------------- @@ -65,7 +68,6 @@ contract AllocationManagerUnitTests is EigenLayerUnitTestSetup, IAllocationManag ) ) ); - defaultStrategies = strategyMock.toArray(); defaultOperatorSet = OperatorSet(defaultAVS, 0); @@ -122,7 +124,8 @@ contract AllocationManagerUnitTests is EigenLayerUnitTestSetup, IAllocationManag ) internal returns (OperatorSet memory) { cheats.prank(operatorSet.avs); allocationManager.createOperatorSets( - operatorSet.avs, CreateSetParams({operatorSetId: operatorSet.id, strategies: strategies}).toArray() + operatorSet.avs, + CreateSetParams({operatorSetId: operatorSet.id, strategies: strategies}).toArray() ); return operatorSet; } @@ -141,7 +144,8 @@ contract AllocationManagerUnitTests is EigenLayerUnitTestSetup, IAllocationManag function _registerForOperatorSet(address operator, OperatorSet memory operatorSet) internal { cheats.prank(operator); allocationManager.registerForOperatorSets( - operator, RegisterParams({avs: operatorSet.avs, operatorSetIds: operatorSet.id.toArrayU32(), data: ""}) + operator, + RegisterParams({avs: operatorSet.avs, operatorSetIds: operatorSet.id.toArrayU32(), data: ""}) ); } @@ -161,37 +165,98 @@ contract AllocationManagerUnitTests is EigenLayerUnitTestSetup, IAllocationManag cheats.stopPrank(); } - function _checkAllocationStorage( - Allocation memory allocation, - uint256 expectedCurrentMagnitude, - int256 expectedPendingDiff, - uint256 expectedEffectBlock - ) internal view { - console.log("Check Allocation Storage:".yellow()); - console.log(" currentMagnitude = %d", allocation.currentMagnitude); - console.log(" pendingDiff = %d", allocation.pendingDiff); - console.log(" effectBlock = %d", allocation.effectBlock); - console.log(" currentBlock = %d", block.number); - console.log("\n"); + struct Magnitudes { + uint256 encumbered; + uint256 max; + uint256 allocatable; + } - assertApproxEqAbs(expectedCurrentMagnitude, allocation.currentMagnitude, 1, "currentMagnitude != expected"); - assertEq(expectedPendingDiff, allocation.pendingDiff, "pendingDiff != expected"); - assertEq(expectedEffectBlock, allocation.effectBlock, "effectBlock != expected"); + /** + * Get expected post slash storage values + * Assumes that: + * 1. WAD is max before slash + * 2. encumbered is equal to magnitude before slash + */ + function _getExpectedSlashVals( + uint256 wadToSlash, + uint64 magBeforeSlash + ) internal pure returns (uint256 wadSlashed, uint64 newCurrentMag, uint64 newMaxMag, uint64 newEncumberedMag) { + return _getExpectedSlashVals(wadToSlash, magBeforeSlash, magBeforeSlash); + } + /** + * Get expected post slash storage values + * Assumes that: + * 1. WAD is max before slash + */ + function _getExpectedSlashVals( + uint256 wadToSlash, + uint64 magBeforeSlash, + uint64 encumberedMagBeforeSlash + ) internal pure returns (uint256 wadSlashed, uint64 newCurrentMag, uint64 newMaxMag, uint64 newEncumberedMag) { + // Get slippage to apply to returned values - we basically recreate mulWadRoundUp here + uint64 slippage = _calculateSlippage(magBeforeSlash, wadToSlash); + // Get the magnitude to slash - this value is rounded UP in the implementation + uint64 slashedMag = uint64((uint256(magBeforeSlash) * wadToSlash / WAD + slippage)); + wadSlashed = slashedMag; + newCurrentMag = magBeforeSlash - slashedMag; + newMaxMag = WAD - slashedMag; + newEncumberedMag = encumberedMagBeforeSlash - slashedMag; + } + + /// @dev Returns 0 or 1, depending on the remainder of the division + function _calculateSlippage(uint64 magnitude, uint256 wadToSlash) internal pure returns (uint64) { + return mulmod(magnitude, wadToSlash, WAD) > 0 ? 1 : 0; } function _checkAllocationStorage( address operator, OperatorSet memory operatorSet, IStrategy strategy, - uint256 expectedCurrentMagnitude, - int256 expectedPendingDiff, - uint256 expectedEffectBlock + Allocation memory expectedAllocation, + Magnitudes memory expectedMagnitudes ) internal view { - Allocation memory getAllocation = allocationManager.getAllocation(operator, operatorSet, strategy); + Allocation memory allocation = allocationManager.getAllocation(operator, operatorSet, strategy); + + console.log("\nChecking Allocation Storage:".yellow()); + console.log(" currentMagnitude: %d", allocation.currentMagnitude); + console.log(" pendingDiff: %d", allocation.pendingDiff); + console.log(" effectBlock: %d", allocation.effectBlock); + + assertEq( + expectedAllocation.currentMagnitude, allocation.currentMagnitude, "currentMagnitude != expected" + ); + assertEq(expectedAllocation.pendingDiff, allocation.pendingDiff, "pendingDiff != expected"); + assertEq(expectedAllocation.effectBlock, allocation.effectBlock, "effectBlock != expected"); + + uint256 encumberedMagnitude = allocationManager.encumberedMagnitude(operator, strategy); + uint256 maxMagnitude = allocationManager.getMaxMagnitudes(operator, strategy.toArray())[0]; + uint256 allocatableMagnitude = allocationManager.getAllocatableMagnitude(operator, strategy); + + console.log(" encumberedMagnitude: %d", encumberedMagnitude); + console.log(" maxMagnitude: %d", maxMagnitude); + console.log(" allocatableMagnitude: %d", allocatableMagnitude); + + assertEq(expectedMagnitudes.encumbered, encumberedMagnitude, "encumberedMagnitude != expected"); + assertEq(expectedMagnitudes.max, maxMagnitude, "maxMagnitude != expected"); + assertEq(expectedMagnitudes.allocatable, allocatableMagnitude, "allocatableMagnitude != expected"); + + // Check `getMaxMagnitudes` alias for coverage. + assertEq( + expectedMagnitudes.max, + allocationManager.getMaxMagnitudes(operator.toArray(), strategy)[0], + "maxMagnitude != expected" + ); + + // Check `getAllocations` alias for coverage. Allocation memory getAllocations = allocationManager.getAllocations(operator.toArray(), operatorSet, strategy)[0]; - _checkAllocationStorage(getAllocation, expectedCurrentMagnitude, expectedPendingDiff, expectedEffectBlock); - _checkAllocationStorage(getAllocations, expectedCurrentMagnitude, expectedPendingDiff, expectedEffectBlock); + assertEq( + expectedAllocation.currentMagnitude, getAllocations.currentMagnitude, "currentMagnitude != expected" + ); + assertEq(expectedAllocation.pendingDiff, getAllocations.pendingDiff, "pendingDiff != expected"); + assertEq(expectedAllocation.effectBlock, getAllocations.effectBlock, "effectBlock != expected"); + + console.log("Success!".green().bold()); } function _checkSlashableStake( @@ -218,36 +283,94 @@ contract AllocationManagerUnitTests is EigenLayerUnitTestSetup, IAllocationManag })[0]; for (uint256 i = 0; i < strategies.length; i++) { - console.log(StdStyle.yellow("Check Slashable Stake:")); + console.log("\nChecking Slashable Stake:".yellow()); console.log(" slashableStake[%d] = %d", i, slashableStake[i]); - console.log("\n"); - assertApproxEqAbs(slashableStake[i], expectedStake, 1, "slashableStake != expected"); + assertEq(slashableStake[i], expectedStake, "slashableStake != expected"); } + + console.log("Success!".green().bold()); } function _checkAllocationEvents( address operator, OperatorSet memory operatorSet, IStrategy strategy, - uint64 currentMagnitude, + uint64 magnitude, uint64 encumberedMagnitude, uint32 effectBlock ) internal { - cheats.expectEmit(true, false, false, false, address(allocationManager)); + cheats.expectEmit(true, true, true, true, address(allocationManager)); emit EncumberedMagnitudeUpdated(operator, strategy, encumberedMagnitude); - cheats.expectEmit(true, false, false, false, address(allocationManager)); - emit AllocationUpdated(operator, operatorSet, strategy, currentMagnitude, effectBlock); + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit AllocationUpdated(operator, operatorSet, strategy, magnitude, effectBlock); + } + + function _checkDeallocationEvent( + address operator, + OperatorSet memory operatorSet, + IStrategy strategy, + uint64 magnitude, + uint32 effectBlock + ) internal { + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit AllocationUpdated(operator, operatorSet, strategy, magnitude, effectBlock); + } + + function _checkClearDeallocationQueueEvents( + address operator, + IStrategy strategy, + uint64 encumberedMagnitude + ) internal { + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit EncumberedMagnitudeUpdated(operator, strategy, encumberedMagnitude); + } + + function _checkSlashEvents( + address operator, + OperatorSet memory operatorSet, + IStrategy strategy, + uint256 wadToSlash, + string memory description, + uint64 currentMag, + uint64 maxMag, + uint64 encumberedMag + ) internal { + return _checkSlashEvents( + operator, + operatorSet, + strategy.toArray(), + wadToSlash.toArrayU256(), + description, + currentMag.toArrayU64(), + maxMag.toArrayU64(), + encumberedMag.toArrayU64() + ); } function _checkSlashEvents( address operator, OperatorSet memory operatorSet, IStrategy[] memory strategies, - uint256[] memory wadsToSlash, - string memory description + uint256[] memory wadToSlash, + string memory description, + uint64[] memory currentMags, + uint64[] memory maxMags, + uint64[] memory encumberedMags ) internal { - cheats.expectEmit(true, false, false, false, address(allocationManager)); - emit OperatorSlashed(operator, operatorSet, strategies, wadsToSlash, description); + for(uint256 i = 0; i < strategies.length; i++) { + // If there is nothing slashed, we don't emit events for encumbered magnitude + if (wadToSlash[i] == 0) { + continue; + } + cheats.expectEmit(true, true, true, false, address(allocationManager)); + emit EncumberedMagnitudeUpdated(operator, strategies[i], encumberedMags[i]); + cheats.expectEmit(true, true, true, false, address(allocationManager)); + emit AllocationUpdated(operator, operatorSet, strategies[i], currentMags[i], uint32(block.number)); + cheats.expectEmit(true, true, true, false, address(allocationManager)); + emit MaxMagnitudeUpdated(operator, strategies[i], maxMags[i]); + } + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit OperatorSlashed(operator, operatorSet, strategies, wadToSlash, description); } /// ----------------------------------------------------------------------- @@ -394,6 +517,10 @@ contract AllocationManagerUnitTests is EigenLayerUnitTestSetup, IAllocationManag numToClear[0] = type(uint16).max; return numToClear; } + + function _defaultAllocEffectBlock() internal view returns (uint32) { + return uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + } } contract AllocationManagerUnitTests_Initialization_Setters is AllocationManagerUnitTests { @@ -432,7 +559,7 @@ contract AllocationManagerUnitTests_Initialization_Setters is AllocationManagerU } contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; using SlashingLib for *; /// ----------------------------------------------------------------------- @@ -443,8 +570,7 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests return SlashingParams({ operator: operator, operatorSetId: operatorSetId, - strategies: defaultStrategies, - wadsToSlash: random().Uint256(1, WAD).toArrayU256(), + wadToSlash: random().Uint256(1, WAD), description: "test" }); } @@ -457,7 +583,7 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests function test_revert_slashZero() public { SlashingParams memory slashingParams = _randSlashingParams(defaultOperator, 0); - slashingParams.wadsToSlash[0] = 0; + slashingParams.wadToSlash = 0; cheats.prank(defaultAVS); cheats.expectRevert(InvalidWadToSlash.selector); @@ -466,116 +592,84 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests function test_revert_slashGreaterThanWAD() public { SlashingParams memory slashingParams = _randSlashingParams(defaultOperator, 0); - slashingParams.wadsToSlash[0] = WAD + 1; + slashingParams.wadToSlash = WAD + 1; cheats.prank(defaultAVS); cheats.expectRevert(InvalidWadToSlash.selector); allocationManager.slashOperator(defaultAVS, slashingParams); } - function test_revert_NotMemberOfSet() public { + function test_revert_NotRegisteredToSet() public { cheats.prank(defaultAVS); cheats.expectRevert(OperatorNotSlashable.selector); allocationManager.slashOperator(defaultAVS, _randSlashingParams(random().Address(), 0)); } - - function test_revert_StrategiesMustBeInAscendingOrder() public { - IStrategy[] memory strategies = new IStrategy[](3); - strategies[0] = IStrategy(address(3)); - strategies[1] = IStrategy(address(2)); - strategies[2] = IStrategy(address(1)); - - _createOperatorSet(OperatorSet(defaultAVS, 1), strategies); - _registerForOperatorSet(defaultOperator, OperatorSet(defaultAVS, 1)); - - cheats.prank(defaultAVS); - cheats.expectRevert(StrategiesMustBeInAscendingOrder.selector); - allocationManager.slashOperator( - defaultAVS, - SlashingParams({ - operator: defaultOperator, - operatorSetId: 1, - strategies: strategies, - wadsToSlash: uint256(0.5 ether).toArrayU256(3), - description: "test" - }) - ); - } - - function test_revert_StrategyNotInOperatorSet() public { - IStrategy[] memory strategies = new IStrategy[](3); - strategies[0] = IStrategy(address(1)); - strategies[1] = IStrategy(address(2)); - strategies[2] = IStrategy(address(3)); - - _createOperatorSet(OperatorSet(defaultAVS, 1), strategies); - _registerForOperatorSet(defaultOperator, OperatorSet(defaultAVS, 1)); - - strategies = strategies.setLength(4); - strategies[3] = IStrategy(address(4)); - - cheats.prank(defaultAVS); - cheats.expectRevert(StrategyNotInOperatorSet.selector); - allocationManager.slashOperator( - defaultAVS, - SlashingParams({ - operator: defaultOperator, - operatorSetId: 1, - strategies: defaultStrategies, - wadsToSlash: uint256(0.5 ether).toArrayU256(), - description: "test" - }) - ); - } - - function test_revert_operatorAllocated_notActive() public { + + /** + * Attempts to slash an operator before the allocation is active + * Validates: + * 1. The events of the slash indicate nothing was slashed + * 2. Storage is not mutated post slash + * 3. The operator's allocation takes effect as normal post slash + */ + function test_operatorAllocated_notActive() public { AllocateParams[] memory allocateParams = _newAllocateParams(defaultOperatorSet, WAD); cheats.prank(defaultOperator); - allocationManager.modifyAllocations(defaultOperator, allocateParams); + allocationManager.modifyAllocations(defaultOperator, allocateParams); + + uint64 encumberedMagnitudeBefore = allocationManager.encumberedMagnitude(defaultOperator, strategyMock); + uint64 maxMagnitudeBefore = allocationManager.getMaxMagnitudes(defaultOperator, strategyMock.toArray())[0]; + + // The only slash event we expect is the OperatorSlashed. There isn't a way to validate + // an event is NOT emitted, but we've manually validated that + cheats.expectEmit(true, true, true, false, address(allocationManager)); + emit OperatorSlashed(defaultOperator, defaultOperatorSet, defaultStrategies, uint256(0).toArrayU256(), "test"); cheats.prank(defaultAVS); allocationManager.slashOperator( - defaultAVS, + defaultAVS, SlashingParams({ operator: defaultOperator, operatorSetId: allocateParams[0].operatorSet.id, - strategies: defaultStrategies, - wadsToSlash: WAD.toArrayU256(), + wadToSlash: WAD, description: "test" }) ); - uint256 effectBlock = block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY; + // Assert encumberedMagnitude and maxMagnitude are unchanged + assertEq( + encumberedMagnitudeBefore, + allocationManager.encumberedMagnitude(defaultOperator, strategyMock), + "encumberedMagnitude mutated" + ); - _checkAllocationStorage({ - operator: defaultOperator, - operatorSet: defaultOperatorSet, - strategy: strategyMock, - expectedCurrentMagnitude: 0, - expectedPendingDiff: int64(allocateParams[0].newMagnitudes[0]), - expectedEffectBlock: effectBlock - }); + assertEq( + maxMagnitudeBefore, + allocationManager.getMaxMagnitudes(defaultOperator, strategyMock.toArray())[0], + "maxMagnitude mutated" + ); + // Roll to effect block and validate allocation + uint32 effectBlock = uint32(block.number) + DEFAULT_OPERATOR_ALLOCATION_DELAY; + uint64 pendingIncrease = allocateParams[0].newMagnitudes[0]; cheats.roll(effectBlock); _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: allocateParams[0].newMagnitudes[0], - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: pendingIncrease, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: pendingIncrease, max: WAD, allocatable: WAD - pendingIncrease}) }); } /** * Allocates all magnitude to for a single strategy to an operatorSet. Slashes 25% - * Asserts that: + * Validates: * 1. Events are emitted - * 2. Encumbered mag is updated - * 3. Max mag is updated - * 4. Calculations for `getAllocatableMagnitude` and `getAllocation` are correct + * 2. Allocation & info introspection + * 3. Slashable stake introspection */ function test_slashPostAllocation() public { // Generate allocation for this operator set, we allocate max @@ -585,7 +679,16 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests allocationManager.modifyAllocations(defaultOperator, allocateParams); cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); - _checkSlashEvents(defaultOperator, defaultOperatorSet, defaultStrategies, uint256(25e16).toArrayU256(), "test"); + _checkSlashEvents({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + wadToSlash: uint256(25e16), + description: "test", + currentMag: uint64(75e16), + maxMag: uint64(75e16), + encumberedMag: uint64(75e16) + }); // Slash operator for 25% cheats.prank(defaultAVS); @@ -594,34 +697,20 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests SlashingParams({ operator: defaultOperator, operatorSetId: defaultOperatorSet.id, - strategies: defaultStrategies, - wadsToSlash: 25e16.toArrayU256(), + wadToSlash: 25e16, description: "test" }) ); // Check storage - assertEq( - 75e16, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - assertEq( - 75e16, allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0], "maxMagnitude not updated" - ); - assertEq( - 0, - allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock), - "allocatableMagnitude shoudl be 0" - ); _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: 75e16, - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: 75e16, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: 75e16, max: 75e16, allocatable: 0}) }); + _checkSlashableStake({ operatorSet: defaultOperatorSet, operator: defaultOperator, @@ -643,50 +732,44 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests SlashingParams memory slashingParams = _randSlashingParams(defaultOperator, defaultOperatorSet.id); - uint64 allocatedMagnitude = allocateParams[0].newMagnitudes[0]; - uint64 expectedSlashedMagnitude = - uint64(SlashingLib.mulWadRoundUp(allocatedMagnitude, slashingParams.wadsToSlash[0])); - uint64 expectedEncumberedMagnitude = allocatedMagnitude - expectedSlashedMagnitude; - uint64 maxMagnitudeAfterSlash = WAD - expectedSlashedMagnitude; - uint256 slashedStake = DEFAULT_OPERATOR_SHARES.mulWad(expectedSlashedMagnitude); - uint256 newSlashableMagnitude = uint256(expectedEncumberedMagnitude).divWad(maxMagnitudeAfterSlash); + (uint256 expectedWadSlashed, uint64 expectedCurrentMag, uint64 expectedMaxMag, uint64 expectedEncumberedMag) = _getExpectedSlashVals({ + magBeforeSlash: allocateParams[0].newMagnitudes[0], + wadToSlash: slashingParams.wadToSlash + }); _checkSlashEvents({ operator: defaultOperator, operatorSet: defaultOperatorSet, - strategies: defaultStrategies, - wadsToSlash: uint256(expectedSlashedMagnitude).toArrayU256(), - description: "test" + strategy: strategyMock, + wadToSlash: expectedWadSlashed, + description: "test", + currentMag: expectedCurrentMag, + maxMag: expectedMaxMag, + encumberedMag: expectedEncumberedMag }); // Slash Operator cheats.prank(defaultAVS); allocationManager.slashOperator(defaultAVS, slashingParams); - // Check storage - assertEq( - expectedEncumberedMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - assertEq( - maxMagnitudeAfterSlash, - allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0], - "maxMagnitude not updated" - ); _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: expectedEncumberedMagnitude, - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: expectedCurrentMag, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMag, + max: expectedMaxMag, + allocatable: expectedMaxMag - expectedEncumberedMag + }) }); + + uint256 slashedStake = DEFAULT_OPERATOR_SHARES.mulWad(expectedWadSlashed); // Wad is same as slashed mag since we start with max mag _checkSlashableStake({ operatorSet: defaultOperatorSet, operator: defaultOperator, strategies: defaultStrategies, - expectedStake: (DEFAULT_OPERATOR_SHARES - slashedStake).mulWad(newSlashableMagnitude) + expectedStake: (DEFAULT_OPERATOR_SHARES - slashedStake).mulWad(expectedCurrentMag.divWad(expectedMaxMag)) }); } @@ -697,7 +780,7 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests * 2. Encumbered mag is updated * 3. Max mag is updated * 4. Calculations for `getAllocatableMagnitude` and `getAllocation` are correct - * 5. The second magnitude allocation is not slashed from + * 5. The second allocation is not slashed from */ function testFuzz_slash_oneCompletedAlloc_onePendingAlloc( Randomness r @@ -705,95 +788,65 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests uint64 wadToSlash = r.Uint64(0.01 ether, WAD); // Generate allocation for `strategyMock`, we allocate half - AllocateParams[] memory allocateParams = _newAllocateParams(defaultOperatorSet, 5e17); - cheats.prank(defaultOperator); - allocationManager.modifyAllocations(defaultOperator, allocateParams); - cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); - - // Check slashable stake after the first allocation - _checkSlashableStake({ - operatorSet: defaultOperatorSet, - operator: defaultOperator, - strategies: defaultStrategies, - expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(5e17) - }); + { + AllocateParams[] memory allocateParams = _newAllocateParams(defaultOperatorSet, 5e17); + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, allocateParams); + cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + } // Allocate the other half AllocateParams[] memory allocateParams2 = _newAllocateParams(defaultOperatorSet, WAD); cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams2); - uint32 secondAllocEffectBlock = uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); - - // Check slashable stake hasn't changed after the second allocation - _checkSlashableStake({ - operatorSet: defaultOperatorSet, - operator: defaultOperator, - strategies: defaultStrategies, - expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(5e17) - }); - - // Check minimum slashable stake would not change even after the second allocation becomes effective - _checkSlashableStake({ - operatorSet: defaultOperatorSet, - operator: defaultOperator, - strategies: defaultStrategies, - expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(5e17), - futureBlock: secondAllocEffectBlock - }); + uint32 secondAllocEffectBlock = _defaultAllocEffectBlock(); // Slash operator for 50% SlashingParams memory slashingParams = SlashingParams({ operator: defaultOperator, operatorSetId: defaultOperatorSet.id, - strategies: defaultStrategies, - wadsToSlash: wadToSlash.toArrayU256(), + wadToSlash: wadToSlash, description: "test" }); - uint64 totalAllocated = 0.5 ether; - uint64 expectedEncumberedMagnitude = (WAD - uint64(uint256(totalAllocated) * uint256(wadToSlash) / WAD)); - uint64 magnitudeAfterSlash = totalAllocated - uint64(uint256(totalAllocated) * uint256(wadToSlash) / WAD); - uint64 maxMagnitudeAfterSlash = expectedEncumberedMagnitude; + (uint256 expectedWadSlashed, uint64 expectedCurrentMag, uint64 expectedMaxMag, uint64 expectedEncumberedMag) = _getExpectedSlashVals({ + magBeforeSlash: 5e17, + encumberedMagBeforeSlash: WAD, + wadToSlash: wadToSlash + }); - uint64 expectedSlashedMagnitude = uint64(totalAllocated.mulWadRoundUp(slashingParams.wadsToSlash[0])); - uint256 newSlashableMagnitude = uint256(magnitudeAfterSlash).divWad(maxMagnitudeAfterSlash); - uint256 slashedStake = DEFAULT_OPERATOR_SHARES.mulWad(expectedSlashedMagnitude); + uint256 slashedStake = DEFAULT_OPERATOR_SHARES.mulWad(expectedWadSlashed); // Wad is same as slashed mag since we start with max mag uint256 newTotalStake = DEFAULT_OPERATOR_SHARES - slashedStake; - // // STACK TOO DEEP - // // _checkSlashEvents({ - // // operator: defaultOperator, - // // operatorSet: defaultOperatorSet, - // // strategies: defaultStrategies, - // // wadsToSlash: uint256(wadToSlash).toArrayU256(), - // // description: "test" - // // }); + _checkSlashEvents({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + wadToSlash: expectedWadSlashed, + description: "test", + currentMag: expectedCurrentMag, + maxMag: expectedMaxMag, + encumberedMag: expectedEncumberedMag + }); // Slash Operator cheats.prank(defaultAVS); allocationManager.slashOperator(defaultAVS, slashingParams); - // Check storage - assertApproxEqAbs( - expectedEncumberedMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - 1, - "encumberedMagnitude not updated" - ); - assertApproxEqAbs( - maxMagnitudeAfterSlash, - allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0], - 1, - "maxMagnitude not updated" - ); - _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: magnitudeAfterSlash, - expectedPendingDiff: 5e17, - expectedEffectBlock: secondAllocEffectBlock + expectedAllocation: Allocation({ + currentMagnitude: expectedCurrentMag, + pendingDiff: 5e17, + effectBlock: secondAllocEffectBlock + }), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMag, + max: expectedMaxMag, + allocatable: 0 + }) }); // Slashable stake should include first allocation and slashed magnitude @@ -801,32 +854,29 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests operatorSet: defaultOperatorSet, operator: defaultOperator, strategies: defaultStrategies, - expectedStake: newTotalStake.mulWad(newSlashableMagnitude) + expectedStake: newTotalStake.mulWad(expectedCurrentMag.divWad(expectedMaxMag)) }); cheats.roll(secondAllocEffectBlock); - assertEq( - 0, - allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock), - "allocatableMagnitude should be 0" - ); - + uint64 newSlashableMagnitude = expectedCurrentMag + 5e17; _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: magnitudeAfterSlash + 0.5 ether, - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: newSlashableMagnitude, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMag, + max: expectedMaxMag, + allocatable: 0 + }) }); - newSlashableMagnitude = allocateParams2[0].newMagnitudes[0]; _checkSlashableStake({ operatorSet: defaultOperatorSet, operator: defaultOperator, strategies: defaultStrategies, - expectedStake: newTotalStake.mulWad(newSlashableMagnitude) + expectedStake: newTotalStake.mulWad(newSlashableMagnitude.divWad(expectedMaxMag)) }); } @@ -838,10 +888,8 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests * * Asserts that: * 1. Events are emitted - * 2. Encumbered mag is updated - * 3. Max mag is updated - * 4. Calculations for `getAllocatableMagnitude` and `getAllocation` are correct - * 5. Slashed amounts are rounded up to ensure magnitude is always slashed + * 2. Storage properly updated after each slash + * 3. Slashed amounts are rounded up to ensure magnitude is always slashed */ function test_repeatUntilFullSlash() public { // Generate allocation for `strategyMock`, we allocate 100% to opSet 0 @@ -851,20 +899,11 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests allocationManager.modifyAllocations(defaultOperator, allocateParams); cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); - // Check slashable amount after initial allocation - _checkSlashableStake({ - operatorSet: defaultOperatorSet, - operator: defaultOperator, - strategies: defaultStrategies, - expectedStake: DEFAULT_OPERATOR_SHARES - }); - // 1. Slash operator for 99% in opSet 0 bringing their magnitude to 1e16 SlashingParams memory slashingParams = SlashingParams({ operator: defaultOperator, operatorSetId: defaultOperatorSet.id, - strategies: defaultStrategies, - wadsToSlash: 99e16.toArrayU256(), + wadToSlash: 99e16, description: "test" }); @@ -875,9 +914,12 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests _checkSlashEvents({ operator: defaultOperator, operatorSet: defaultOperatorSet, - strategies: defaultStrategies, - wadsToSlash: uint256(99e16).toArrayU256(), - description: "test" + strategy: strategyMock, + wadToSlash: uint256(99e16), + description: "test", + currentMag: magnitudeAfterSlash, + maxMag: maxMagnitudeAfterSlash, + encumberedMag: expectedEncumberedMagnitude }); // Slash Operator @@ -885,36 +927,27 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests allocationManager.slashOperator(defaultAVS, slashingParams); // Check storage - assertEq( - expectedEncumberedMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - assertEq( - maxMagnitudeAfterSlash, - allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0], - "maxMagnitude not updated" - ); - Allocation memory allocation = - allocationManager.getAllocation(defaultOperator, defaultOperatorSet, strategyMock); - assertEq(magnitudeAfterSlash, allocation.currentMagnitude, "currentMagnitude not updated"); - - // Check slashable amount after first slash - _checkSlashableStake({ - operatorSet: defaultOperatorSet, + _checkAllocationStorage({ operator: defaultOperator, - strategies: defaultStrategies, - expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(1e16) + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: magnitudeAfterSlash, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMagnitude, + max: maxMagnitudeAfterSlash, + allocatable: maxMagnitudeAfterSlash - expectedEncumberedMagnitude + }) }); + // 2. Slash operator again for 99.99% in opSet 0 bringing their magnitude to 1e14 slashingParams = SlashingParams({ operator: defaultOperator, operatorSetId: defaultOperatorSet.id, - strategies: defaultStrategies, - wadsToSlash: 9999e14.toArrayU256(), + wadToSlash: 9999e14, description: "test" }); + expectedEncumberedMagnitude = 1e12; // After slashing 99.99%, only 0.01% expected encumberedMagnitude magnitudeAfterSlash = 1e12; maxMagnitudeAfterSlash = 1e12; @@ -922,42 +955,35 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests _checkSlashEvents({ operator: defaultOperator, operatorSet: defaultOperatorSet, - strategies: defaultStrategies, - wadsToSlash: uint256(9999e14).toArrayU256(), - description: "test" + strategy: strategyMock, + wadToSlash: uint256(9999e14), + description: "test", + currentMag: magnitudeAfterSlash, + maxMag: maxMagnitudeAfterSlash, + encumberedMag: expectedEncumberedMagnitude }); cheats.prank(defaultAVS); allocationManager.slashOperator(defaultAVS, slashingParams); // Check storage - assertEq( - expectedEncumberedMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - assertEq( - maxMagnitudeAfterSlash, - allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0], - "maxMagnitude not updated" - ); - allocation = allocationManager.getAllocation(defaultOperator, defaultOperatorSet, strategyMock); - assertEq(magnitudeAfterSlash, allocation.currentMagnitude, "currentMagnitude not updated"); - - // Check slashable amount after second slash - _checkSlashableStake({ - operatorSet: defaultOperatorSet, + _checkAllocationStorage({ operator: defaultOperator, - strategies: defaultStrategies, - expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(1e12) + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: magnitudeAfterSlash, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMagnitude, + max: maxMagnitudeAfterSlash, + allocatable: maxMagnitudeAfterSlash - expectedEncumberedMagnitude + }) }); // 3. Slash operator again for 99.9999999999999% in opSet 0 slashingParams = SlashingParams({ operator: defaultOperator, operatorSetId: defaultOperatorSet.id, - strategies: defaultStrategies, - wadsToSlash: (WAD - 1e3).toArrayU256(), + wadToSlash: WAD - 1e3, description: "test" }); // Should technically be 1e3 remaining but with rounding error and rounding up slashed amounts @@ -969,9 +995,12 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests _checkSlashEvents({ operator: defaultOperator, operatorSet: defaultOperatorSet, - strategies: defaultStrategies, - wadsToSlash: uint256(WAD - 1e3).toArrayU256(), - description: "test" + strategy: strategyMock, + wadToSlash: WAD, + description: "test", + currentMag: magnitudeAfterSlash, + maxMag: maxMagnitudeAfterSlash, + encumberedMag: expectedEncumberedMagnitude }); // Slash Operator @@ -979,18 +1008,17 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests allocationManager.slashOperator(defaultAVS, slashingParams); // Check storage - assertEq( - expectedEncumberedMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - assertEq( - maxMagnitudeAfterSlash, - allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0], - "maxMagnitude not updated" - ); - allocation = allocationManager.getAllocation(defaultOperator, defaultOperatorSet, strategyMock); - assertEq(magnitudeAfterSlash, allocation.currentMagnitude, "currentMagnitude not updated"); + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: 0, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: 0, + max: 0, + allocatable: 0 + }) + }); // Check slashable amount after final slash _checkSlashableStake({ @@ -1014,14 +1042,13 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests function testFuzz_SlashWhileDeallocationPending( Randomness r ) public rand(r) { + // Initialize state AllocateParams[] memory allocateParams = r.AllocateParams(defaultAVS, 1, 1); AllocateParams[] memory deallocateParams = r.DeallocateParams(allocateParams); CreateSetParams[] memory createSetParams = r.CreateSetParams(allocateParams); RegisterParams memory registerParams = r.RegisterParams(allocateParams); SlashingParams memory slashingParams = r.SlashingParams(defaultOperator, allocateParams[0]); - console.log("wadsToSlash: %d", slashingParams.wadsToSlash[0]); - delegationManagerMock.setOperatorShares( defaultOperator, allocateParams[0].strategies[0], DEFAULT_OPERATOR_SHARES ); @@ -1030,43 +1057,35 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests allocationManager.createOperatorSets(defaultAVS, createSetParams); cheats.startPrank(defaultOperator); allocationManager.registerForOperatorSets(defaultOperator, registerParams); + + // Allocate allocationManager.modifyAllocations(defaultOperator, allocateParams); cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + + // Deallocate allocationManager.modifyAllocations(defaultOperator, deallocateParams); uint32 deallocationEffectBlock = uint32(block.number + DEALLOCATION_DELAY); cheats.stopPrank(); - // Check slashable stake after deallocation (still pending; no change) - _checkSlashableStake({ - operatorSet: allocateParams[0].operatorSet, - operator: defaultOperator, - strategies: allocateParams[0].strategies, - expectedStake: allocateParams[0].newMagnitudes[0] - }); - - // Check slashable stake after deallocation takes effect, before slashing - _checkSlashableStake({ - operatorSet: allocateParams[0].operatorSet, - operator: defaultOperator, - strategies: allocateParams[0].strategies, - expectedStake: deallocateParams[0].newMagnitudes[0], - futureBlock: deallocationEffectBlock - }); - uint256 magnitudeAllocated = allocateParams[0].newMagnitudes[0]; uint256 magnitudeDeallocated = magnitudeAllocated - deallocateParams[0].newMagnitudes[0]; - uint256 magnitudeSlashed = magnitudeAllocated.mulWad(slashingParams.wadsToSlash[0]); + uint256 magnitudeSlashed = (magnitudeAllocated * slashingParams.wadToSlash / WAD) + _calculateSlippage(uint64(magnitudeAllocated), slashingParams.wadToSlash); uint256 expectedCurrentMagnitude = magnitudeAllocated - magnitudeSlashed; int128 expectedPendingDiff = - -int128(uint128(magnitudeDeallocated - magnitudeDeallocated.mulWadRoundUp(slashingParams.wadsToSlash[0]))); + -int128(uint128(magnitudeDeallocated - magnitudeDeallocated.mulWadRoundUp(slashingParams.wadToSlash))); - _checkSlashEvents({ - operator: defaultOperator, - operatorSet: allocateParams[0].operatorSet, - strategies: allocateParams[0].strategies, - wadsToSlash: slashingParams.wadsToSlash, - description: "test" - }); + // Manually check slash events since we have a deallocation pending + // Deallocation update is emitted first + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit AllocationUpdated(defaultOperator, allocateParams[0].operatorSet, allocateParams[0].strategies[0], uint64(uint128(int128(uint128(expectedCurrentMagnitude)) + expectedPendingDiff)), deallocationEffectBlock); + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit EncumberedMagnitudeUpdated(defaultOperator, allocateParams[0].strategies[0], uint64(magnitudeAllocated - magnitudeSlashed)); + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit AllocationUpdated(defaultOperator, allocateParams[0].operatorSet, allocateParams[0].strategies[0], uint64(expectedCurrentMagnitude), uint32(block.number)); + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit MaxMagnitudeUpdated(defaultOperator, allocateParams[0].strategies[0], uint64(WAD - magnitudeSlashed)); + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit OperatorSlashed(defaultOperator, allocateParams[0].operatorSet, allocateParams[0].strategies, magnitudeSlashed.toArrayU256(), "test"); cheats.prank(defaultAVS); allocationManager.slashOperator(defaultAVS, slashingParams); @@ -1075,65 +1094,41 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests operator: defaultOperator, operatorSet: allocateParams[0].operatorSet, strategy: allocateParams[0].strategies[0], - expectedCurrentMagnitude: expectedCurrentMagnitude, - expectedPendingDiff: expectedPendingDiff, - expectedEffectBlock: deallocationEffectBlock - }); - - // Check slashable stake after slash - _checkSlashableStake({ - operatorSet: allocateParams[0].operatorSet, - operator: defaultOperator, - strategies: allocateParams[0].strategies, - expectedStake: expectedCurrentMagnitude - }); - - // Check slashable stake after deallocation takes effect - _checkSlashableStake({ - operatorSet: allocateParams[0].operatorSet, - operator: defaultOperator, - strategies: allocateParams[0].strategies, - expectedStake: expectedCurrentMagnitude - uint128(-expectedPendingDiff) - 1, - futureBlock: deallocationEffectBlock + expectedAllocation: Allocation({ + currentMagnitude: uint64(expectedCurrentMagnitude), + pendingDiff: expectedPendingDiff, + effectBlock: deallocationEffectBlock + }), + expectedMagnitudes: Magnitudes({ + encumbered: expectedCurrentMagnitude, + max: uint64(WAD - magnitudeSlashed), + allocatable: 0 + }) }); - assertEq( - expectedCurrentMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, allocateParams[0].strategies[0]), - "encumberedMagnitude not updated" - ); - assertEq( - WAD - slashingParams.wadsToSlash[0], - allocationManager.getMaxMagnitudes(defaultOperator, allocateParams[0].strategies)[0], - "maxMagnitude not updated" - ); - cheats.roll(deallocationEffectBlock); allocationManager.clearDeallocationQueue(defaultOperator, allocateParams[0].strategies, _maxNumToClear()); + uint64 newMag = uint64(uint128(int128(uint128(expectedCurrentMagnitude)) + expectedPendingDiff)); + _checkAllocationStorage({ operator: defaultOperator, operatorSet: allocateParams[0].operatorSet, strategy: allocateParams[0].strategies[0], - expectedCurrentMagnitude: deallocateParams[0].newMagnitudes[0] - - deallocateParams[0].newMagnitudes[0] * slashingParams.wadsToSlash[0] / WAD, - expectedPendingDiff: 0, - expectedEffectBlock: 0 - }); - - // Check slashable stake after slash and deallocation - _checkSlashableStake({ - operatorSet: allocateParams[0].operatorSet, - operator: defaultOperator, - strategies: allocateParams[0].strategies, - expectedStake: expectedCurrentMagnitude - uint128(-expectedPendingDiff) - 1 + expectedAllocation: Allocation({currentMagnitude: newMag, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: newMag, + max: uint64(WAD - magnitudeSlashed), + allocatable: uint128(-expectedPendingDiff) // This works because we allocated all in the randomization allocation helper + }) }); } /** * Allocates all magnitude to a single opSet. Then slashes the entire magnitude - * Asserts that: - * 1. The operator cannot allocate again + * Validates: + * 1. Storage post slash + * 2. The operator cannot allocate again */ function testRevert_allocateAfterSlashedEntirely() public { // Allocate all magnitude @@ -1145,24 +1140,35 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests _checkSlashEvents({ operator: defaultOperator, operatorSet: defaultOperatorSet, - strategies: defaultStrategies, - wadsToSlash: WAD.toArrayU256(), - description: "test" + strategy: strategyMock, + wadToSlash: WAD, + description: "test", + currentMag: 0, + maxMag: 0, + encumberedMag: 0 }); // Slash operator for 100% cheats.prank(defaultAVS); - allocationManager.slashOperator( + allocationManager.slashOperator( defaultAVS, SlashingParams({ operator: defaultOperator, operatorSetId: allocateParams[0].operatorSet.id, - strategies: defaultStrategies, - wadsToSlash: WAD.toArrayU256(), + wadToSlash: WAD, description: "test" }) ); + // Validate storage post slash + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: 0, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: 0, max: 0, allocatable: 0}) + }); + OperatorSet memory operatorSet = _createOperatorSet(OperatorSet(defaultAVS, random().Uint32()), defaultStrategies); AllocateParams[] memory allocateParams2 = _newAllocateParams(operatorSet, 1); @@ -1174,12 +1180,12 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests } /** - * Allocates all magnitude to a single opSet. Deallocateas magnitude. Slashes al + * Allocates all magnitude to a single opSet. Deallocates magnitude. Slashes all * Asserts that: * 1. The Allocation is 0 after slash - * 2. Them sotrage post slash for encumbered and maxMags ais zero + * 2. Them storage post slash for encumbered and maxMags is zero */ - function test_allocateAll_deallocateAll() public { + function test_slash_allocateAll_deallocateAll() public { // Allocate all magnitude cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, _newAllocateParams(defaultOperatorSet, WAD)); @@ -1189,45 +1195,35 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, _newAllocateParams(defaultOperatorSet, 0)); - _checkSlashEvents({ - operator: defaultOperator, - operatorSet: defaultOperatorSet, - strategies: defaultStrategies, - wadsToSlash: WAD.toArrayU256(), - description: "test" - }); + // Validate event for the deallocation + cheats.expectEmit(true, true, true, true, address(allocationManager)); + emit AllocationUpdated(defaultOperator, defaultOperatorSet, strategyMock, 0, uint32(block.number + DEALLOCATION_DELAY)); // Slash operator for 100% cheats.prank(defaultAVS); - allocationManager.slashOperator( + allocationManager.slashOperator( defaultAVS, SlashingParams({ operator: defaultOperator, operatorSetId: defaultOperatorSet.id, - strategies: defaultStrategies, - wadsToSlash: WAD.toArrayU256(), + wadToSlash: WAD, description: "test" }) ); - assertEq( - 0, allocationManager.encumberedMagnitude(defaultOperator, strategyMock), "encumberedMagnitude not updated" - ); - assertEq( - 0, allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0], "maxMagnitude not updated" - ); + // forgefmt: disable-next-item _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: 0, - expectedPendingDiff: 0, - expectedEffectBlock: block.number + DEALLOCATION_DELAY + expectedAllocation: Allocation({currentMagnitude: 0, pendingDiff: 0, effectBlock: uint32(block.number) + DEALLOCATION_DELAY}), + expectedMagnitudes: Magnitudes({encumbered: 0, max: 0, allocatable: 0}) }); } /** - * Slashes the operator after deallocation, even if the deallocation has not been cleared. Validates that: + * Slashes the operator after deallocation, even if the deallocation has not been cleared. + * Validates that: * 1. Even if we do not clear deallocation queue, the deallocation is NOT slashed from since we're passed the deallocationEffectBlock * 2. Validates storage post slash & post clearing deallocation queue * 3. Max magnitude only decreased proportionally by the magnitude set after deallocation @@ -1245,16 +1241,6 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests allocationManager.modifyAllocations(defaultOperator, deallocateParams); uint32 deallocationEffectBlock = uint32(block.number + DEALLOCATION_DELAY); - // Check storage post deallocation - _checkAllocationStorage({ - operator: defaultOperator, - operatorSet: defaultOperatorSet, - strategy: strategyMock, - expectedCurrentMagnitude: WAD, - expectedPendingDiff: -5e17, - expectedEffectBlock: deallocationEffectBlock - }); - // Warp to deallocation effect block cheats.roll(deallocationEffectBlock); @@ -1262,71 +1248,58 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests SlashingParams memory slashingParams = SlashingParams({ operator: defaultOperator, operatorSetId: defaultOperatorSet.id, - strategies: defaultStrategies, - wadsToSlash: 25e16.toArrayU256(), + wadToSlash: 25e16, description: "test" }); uint64 expectedEncumberedMagnitude = 375e15; // 25e16 is slashed. 5e17 was previously uint64 magnitudeAfterSlash = 375e15; uint64 maxMagnitudeAfterSlash = 875e15; // Operator can only allocate up to 75e16 magnitude since 25% is slashed + uint256 expectedSlashedMagnitude = SlashingLib.mulWadRoundUp(5e17, 25e16); + // Slash Operator, only emit events assuming that there is no deallocation _checkSlashEvents({ operator: defaultOperator, operatorSet: defaultOperatorSet, - strategies: defaultStrategies, - wadsToSlash: uint256(25e16).toArrayU256(), - description: "test" + strategy: strategyMock, + wadToSlash: expectedSlashedMagnitude, + description: "test", + currentMag: magnitudeAfterSlash, + maxMag: maxMagnitudeAfterSlash, + encumberedMag: expectedEncumberedMagnitude }); - - // Slash Operator, only emit events assuming that there is no deallocation + cheats.prank(defaultAVS); allocationManager.slashOperator(defaultAVS, slashingParams); - // Check storage post slash - assertEq( - expectedEncumberedMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - assertEq( - maxMagnitudeAfterSlash, - allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0], - "maxMagnitude not updated" - ); + allocationManager.clearDeallocationQueue(defaultOperator, defaultStrategies, _maxNumToClear()); + + uint64 allocatableMagnitudeAfterSlash = allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock); + _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: magnitudeAfterSlash, - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: magnitudeAfterSlash, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMagnitude, + max: maxMagnitudeAfterSlash, + allocatable: allocatableMagnitudeAfterSlash + }) }); - - uint64 allocatableMagnitudeAfterSlash = allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock); - - // Check storage after complete modification. - allocationManager.clearDeallocationQueue(defaultOperator, defaultStrategies, _maxNumToClear()); - assertEq( - allocatableMagnitudeAfterSlash, - allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock), - "allocatable mag after slash shoudl be equal to allocatable mag after clearing queue" - ); } /** - * Allocates to multiple operatorSets for a strategy. Only slashes from one operatorSet. Validates - * 1. The slashable shares of each operatorSet after magnitude allocation - * 2. The first operatorSet has less slashable shares post slash - * 3. The second operatorSet has the same number slashable shares post slash - * 4. The PROPORTION that is slashable for opSet 2 has increased - * 5. Encumbered magnitude, total allocatable magnitude + * Allocates to multiple operatorSets for a strategy. Only slashes from one operatorSet. + * Validates: + * 1. The first operatorSet has less slashable shares post slash + * 2. The second operatorSet has the same number slashable shares post slash (within slippage) + * 3. The PROPORTION that is slashable for opSet 2 has increased */ - function test_allocateMultipleOpsets_slashSingleOpset() public { - // Set 100e18 shares for operator in DM - uint256 operatorShares = 100e18; - delegationManagerMock.setOperatorShares(defaultOperator, strategyMock, operatorShares); - uint64 magnitudeToAllocate = 4e17; + function testFuzz_allocateMultipleOpsets_slashSingleOpset(Randomness r) rand(r) public { + // Get magnitude to allocate + uint64 magnitudeToAllocate = r.Uint64(1, 5e17); + uint256 wadToSlash = r.Uint256(1, 1e18); OperatorSet memory operatorSet = OperatorSet(defaultAVS, 1); OperatorSet memory operatorSet2 = OperatorSet(defaultAVS, 2); @@ -1340,155 +1313,180 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests _createOperatorSet(OperatorSet(defaultAVS, 2), defaultStrategies), magnitudeToAllocate )[0]; + // Register operator for both operatorSets _registerForOperatorSet(defaultOperator, operatorSet); _registerForOperatorSet(defaultOperator, operatorSet2); + // Modify allocations cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); // Get slashable shares for each operatorSet - address[] memory operatorArray = new address[](1); - operatorArray[0] = defaultOperator; - - uint256 maxMagnitude = allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0]; - uint256 opSet2PortionOfMaxMagnitude = uint256(magnitudeToAllocate) * WAD / maxMagnitude; - + uint256 opset2SlashableSharesBefore = allocationManager.getMinimumSlashableStake(operatorSet2, defaultOperator.toArray(), defaultStrategies, uint32(block.number))[0][0]; // Slash operator on operatorSet1 for 50% SlashingParams memory slashingParams = SlashingParams({ operator: defaultOperator, operatorSetId: allocateParams[0].operatorSet.id, - strategies: defaultStrategies, - wadsToSlash: 5e17.toArrayU256(), + wadToSlash: wadToSlash, description: "test" }); - _checkSlashEvents({ - operator: defaultOperator, - operatorSet: operatorSet, - strategies: defaultStrategies, - wadsToSlash: slashingParams.wadsToSlash, - description: "test" + (, uint64 expectedCurrentMag, uint64 expectedMaxMag, uint64 expectedEncumberedMag) = _getExpectedSlashVals({ + magBeforeSlash: allocateParams[0].newMagnitudes[0], + wadToSlash: slashingParams.wadToSlash, + encumberedMagBeforeSlash: allocateParams[0].newMagnitudes[0] * 2 }); // Slash Operator cheats.prank(defaultAVS); allocationManager.slashOperator(defaultAVS, slashingParams); - // Operator should now have 80e18 shares, since half of 40e18 was slashed - delegationManagerMock.setOperatorShares(defaultOperator, strategyMock, 80e18); + // Validate storage operatorSet1 + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: operatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: expectedCurrentMag, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMag, + max: expectedMaxMag, + allocatable: expectedMaxMag - expectedEncumberedMag + }) + }); - // Validate encumbered and total allocatable magnitude - uint256 maxMagnitudeAfterSlash = allocationManager.getMaxMagnitudes(defaultOperator, defaultStrategies)[0]; - uint256 expectedEncumberedMagnitude = 6e17; // 4e17 from opSet2, 2e17 from opSet1 - assertEq( - expectedEncumberedMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - assertEq( - maxMagnitudeAfterSlash - expectedEncumberedMagnitude, - allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock), - "allocatableMagnitude should be diff of maxMagnitude and encumberedMagnitude" - ); + // Validate storage for operatorSet2 + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: operatorSet2, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: magnitudeToAllocate, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMag, + max: expectedMaxMag, + allocatable: expectedMaxMag - expectedEncumberedMag + }) + }); // Check proportion after slash - uint256 opSet2PortionOfMaxMagnitudeAfterSlash = uint256(magnitudeToAllocate) * WAD / maxMagnitudeAfterSlash; + uint256 opSet2PortionOfMaxMagnitudeAfterSlash = uint256(magnitudeToAllocate) * WAD / expectedMaxMag; assertGt( opSet2PortionOfMaxMagnitudeAfterSlash, - opSet2PortionOfMaxMagnitude, + magnitudeToAllocate, // This is the same as proportion before slash "opSet2 should have a greater proportion to slash from previous" ); + + // Assert that slashable stake is the same - we add slippage here due to rounding error from the slash itself + assertEq( + opset2SlashableSharesBefore, + allocationManager.getMinimumSlashableStake(operatorSet2, defaultOperator.toArray(), defaultStrategies, uint32(block.number))[0][0] + + 1, + "opSet2 slashable shares should be the same" + ); } /** - * Allocates to multiple strategies for the given operatorSetKey. Slashes from both strategies Validates a slash propogates to both strategies. + * Allocates to multiple strategies for the given operatorSetKey. Slashes from both strategies Validates a slash propagates to both strategies. * Validates that * 1. Proper events are emitted for each strategy slashed * 2. Each strategy is slashed proportional to its allocation * 3. Storage is updated for each strategy, opSet */ - function test_allocateMultipleStrategies_slashMultiple() public { - // Allocate to each strategy - uint64 strategy1Magnitude = 5e17; - uint64 strategy2Magnitude = WAD; + function testFuzz_allocateMultipleStrategies_slashMultiple(Randomness r) rand(r) public { + // Initialize random params + uint64 strategy1Magnitude = r.Uint64(1, 1e18); + uint64 strategy2Magnitude = r.Uint64(1, 1e18); + uint256 wadToSlash = r.Uint256(1, 1e18); + // Crate and allocate to operatorSets OperatorSet memory operatorSet = OperatorSet(defaultAVS, random().Uint32()); _createOperatorSet(operatorSet, random().StrategyArray(2)); _registerForOperatorSet(defaultOperator, operatorSet); IStrategy[] memory strategies = allocationManager.getStrategiesInOperatorSet(operatorSet); - AllocateParams memory allocateParams = - AllocateParams({operatorSet: operatorSet, strategies: strategies, newMagnitudes: new uint64[](2)}); - allocateParams.newMagnitudes[0] = strategy1Magnitude; - allocateParams.newMagnitudes[1] = strategy2Magnitude; - - cheats.prank(defaultOperator); - allocationManager.modifyAllocations(defaultOperator, allocateParams.toArray()); - cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); - - uint256[] memory wadsToSlash = new uint256[](2); - wadsToSlash[0] = 6e17; - wadsToSlash[1] = 6e17; - - // Slash operator on both strategies for 60% - SlashingParams memory slashingParams = SlashingParams({ - operator: defaultOperator, - operatorSetId: operatorSet.id, - strategies: strategies, - wadsToSlash: wadsToSlash, - description: "test" - }); + { + AllocateParams memory allocateParams = + AllocateParams({operatorSet: operatorSet, strategies: strategies, newMagnitudes: new uint64[](2)}); + allocateParams.newMagnitudes[0] = strategy1Magnitude; + allocateParams.newMagnitudes[1] = strategy2Magnitude; + + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, allocateParams.toArray()); + cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + } + // Store post-slash vars to check against uint64[] memory expectedEncumberedMags = new uint64[](2); - expectedEncumberedMags[0] = 2e17; // 60% of 5e17 - expectedEncumberedMags[1] = 4e17; // 60% of WAD - + uint256[] memory expectedSlashedMagnitude = new uint256[](2); uint64[] memory expectedMagnitudeAfterSlash = new uint64[](2); - expectedMagnitudeAfterSlash[0] = 2e17; - expectedMagnitudeAfterSlash[1] = 4e17; - uint64[] memory expectedMaxMagnitudeAfterSlash = new uint64[](2); - expectedMaxMagnitudeAfterSlash[0] = 7e17; - expectedMaxMagnitudeAfterSlash[1] = 4e17; + + { + (uint256 strat1ExpectedWadSlashed, uint64 strat1ExpectedCurrentMag, uint64 strat1ExpectedMaxMag, uint64 strat1ExpectedEncumberedMag) = _getExpectedSlashVals({ + magBeforeSlash: strategy1Magnitude, + wadToSlash: wadToSlash + }); + expectedEncumberedMags[0] = strat1ExpectedEncumberedMag; + expectedSlashedMagnitude[0] = strat1ExpectedWadSlashed; + expectedMagnitudeAfterSlash[0] = strat1ExpectedCurrentMag; + expectedMaxMagnitudeAfterSlash[0] = strat1ExpectedMaxMag; + } + { + (uint256 strat2ExpectedWadSlashed, uint64 strat2ExpectedCurrentMag, uint64 strat2ExpectedMaxMag, uint64 strat2ExpectedEncumberedMag) = _getExpectedSlashVals({ + magBeforeSlash: strategy2Magnitude, + wadToSlash: wadToSlash + }); + expectedEncumberedMags[1] = strat2ExpectedEncumberedMag; + expectedSlashedMagnitude[1] = strat2ExpectedWadSlashed; + expectedMagnitudeAfterSlash[1] = strat2ExpectedCurrentMag; + expectedMaxMagnitudeAfterSlash[1] = strat2ExpectedMaxMag; + } _checkSlashEvents({ operator: defaultOperator, operatorSet: operatorSet, strategies: strategies, - wadsToSlash: wadsToSlash, - description: "test" + wadToSlash: expectedSlashedMagnitude, + description: "test", + currentMags: expectedMagnitudeAfterSlash, + maxMags: expectedMaxMagnitudeAfterSlash, + encumberedMags: expectedEncumberedMags }); // Slash Operator - cheats.prank(defaultAVS); - allocationManager.slashOperator(defaultAVS, slashingParams); + { + SlashingParams memory slashingParams = SlashingParams({ + operator: defaultOperator, + operatorSetId: operatorSet.id, + wadToSlash: wadToSlash, + description: "test" + }); + cheats.prank(defaultAVS); + allocationManager.slashOperator(defaultAVS, slashingParams); + } // Check storage for (uint256 i; i < strategies.length; ++i) { - assertEq( - expectedEncumberedMags[i], - allocationManager.encumberedMagnitude(defaultOperator, strategies[i]), - "encumberedMagnitude not updated" - ); - assertEq( - expectedMaxMagnitudeAfterSlash[i] - expectedMagnitudeAfterSlash[i], - allocationManager.getAllocatableMagnitude(defaultOperator, strategies[i]), - "allocatableMagnitude not updated" - ); _checkAllocationStorage({ operator: defaultOperator, operatorSet: operatorSet, strategy: strategies[i], - expectedCurrentMagnitude: expectedMagnitudeAfterSlash[i], - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({ + currentMagnitude: expectedMagnitudeAfterSlash[i], + pendingDiff: 0, + effectBlock: 0 + }), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMags[i], + max: expectedMaxMagnitudeAfterSlash[i], + allocatable: expectedMaxMagnitudeAfterSlash[i] - expectedEncumberedMags[i] + }) }); } } /// @dev Allocates magnitude. Deallocates some. Slashes a portion, and then allocates up to the max available magnitude - function testFuzz_allocate_deallocate_slashWhilePending_allocateMax( + function testFuzz_allocate_deallocate_allocateMax( Randomness r ) public rand(r) { AllocateParams[] memory allocateParams = r.AllocateParams({avs: defaultAVS, numAllocations: 1, numStrats: 1}); @@ -1514,72 +1512,70 @@ contract AllocationManagerUnitTests_SlashOperator is AllocationManagerUnitTests SlashingParams memory slashingParams = SlashingParams({ operator: defaultOperator, operatorSetId: operatorSet.id, - strategies: strategy.toArray(), - wadsToSlash: r.Uint64(0.01 ether, 0.99 ether).toArrayU256(), + wadToSlash: r.Uint64(0.01 ether, 0.99 ether), description: "test" }); - uint256 magnitudeBeforeSlash = deallocateParams[0].newMagnitudes[0]; - uint256 slashedMagnitude = magnitudeBeforeSlash * slashingParams.wadsToSlash[0] / WAD; - uint256 currentMagnitude = magnitudeBeforeSlash - slashedMagnitude - 1; - uint256 maxMagnitude = WAD - slashedMagnitude - 1; + (uint256 expectedWadSlashed, uint64 expectedCurrentMag, uint64 expectedMaxMag, uint64 expectedEncumberedMag) = _getExpectedSlashVals({ + magBeforeSlash: deallocateParams[0].newMagnitudes[0], + wadToSlash: slashingParams.wadToSlash + }); _checkSlashEvents({ operator: defaultOperator, operatorSet: operatorSet, - strategies: strategy.toArray(), - wadsToSlash: slashingParams.wadsToSlash, - description: "test" + strategy: allocateParams[0].strategies[0], + wadToSlash: expectedWadSlashed, + description: "test", + currentMag: expectedCurrentMag, + maxMag: expectedMaxMag, + encumberedMag: expectedEncumberedMag }); cheats.prank(defaultAVS); allocationManager.slashOperator(defaultAVS, slashingParams); - assertEq( - currentMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategy), - "encumberedMagnitude should be half of firstMod" - ); + // Clear deallocation queue. + allocationManager.clearDeallocationQueue(defaultOperator, strategy.toArray(), _maxNumToClear()); _checkAllocationStorage({ operator: defaultOperator, operatorSet: operatorSet, strategy: strategy, - expectedCurrentMagnitude: uint64(currentMagnitude), - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: expectedCurrentMag, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({ + encumbered: expectedEncumberedMag, + max: expectedMaxMag, + allocatable: expectedMaxMag - expectedEncumberedMag + }) }); - // Clear deallocation queue. - allocationManager.clearDeallocationQueue(defaultOperator, strategy.toArray(), _maxNumToClear()); - - assertEq( - maxMagnitude, - allocationManager.getMaxMagnitudes(defaultOperator, strategy.toArray())[0], - "maxMagnitude should be expectedMaxMagnitude" - ); - - assertEq( - maxMagnitude - currentMagnitude, - allocationManager.getAllocatableMagnitude(defaultOperator, strategy), - "allocatableMagnitude should be expectedAllocatable" - ); - // Allocate up to max magnitude - AllocateParams[] memory allocateParams2 = _newAllocateParams(operatorSet, uint64(maxMagnitude)); + AllocateParams[] memory allocateParams2 = _newAllocateParams(operatorSet, expectedMaxMag); cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams2); - // Assert that encumbered is expectedMaxMagnitude - assertEq( - 0, allocationManager.getAllocatableMagnitude(defaultOperator, strategy), "allocatableMagnitude should be 0" - ); + int128 pendingDiff = int128(uint128(expectedMaxMag - expectedCurrentMag)); + + // Check storage + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: operatorSet, + strategy: strategy, + expectedAllocation: Allocation({currentMagnitude: expectedCurrentMag, pendingDiff: pendingDiff, effectBlock: _defaultAllocEffectBlock()}), + expectedMagnitudes: Magnitudes({ + encumbered: expectedMaxMag, + max: expectedMaxMag, + allocatable: 0 + }) + }); } } contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; using OperatorSetLib for *; + using SlashingLib for *; function test_revert_paused() public { allocationManager.pause(2 ** PAUSED_MODIFY_ALLOCATIONS); @@ -1789,11 +1785,14 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe allocationManager.modifyAllocations(defaultOperator, allocateParams); } - /// @dev Set allocation delay > ALLOCATION_CONFIGURATION_DELAY, allocate, - /// set allocation delay to < ALLOCATION_CONFIGURATION_DELAY, allocate again - /// once new delay is sect. - /// - /// NOTE: Should be able to allocate faster than `ALLOCATION_CONFIGURATION_DELAY`. + /** + * @notice Tests edge cases around allocation delay: + * 1. Set allocation delay to a value greater than ALLOCATION_CONFIGURATION_DELAY + * 2. Allocate magnitude before the configured delay is hit + * 3. Set allocation delay to a value less than ALLOCATION_CONFIGURATION_DELAY + * 4. Allocate magnitude after allocation in step 2 takes effect, but before the new delay is hit + * Validates that you should be able to allocate in step 4 since there is no other pending modifications + */ function testFuzz_ShouldBeAbleToAllocateSoonerThanLastDelay( Randomness r ) public rand(r) { @@ -1809,14 +1808,40 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe allocationManager.setAllocationDelay(defaultOperator, firstDelay); allocationManager.modifyAllocations(defaultOperator, _newAllocateParams(defaultOperatorSet, half)); + + // Validate storage - the `firstDelay` should not be applied yet + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: 0, pendingDiff: int64(half), effectBlock: _defaultAllocEffectBlock()}), + expectedMagnitudes: Magnitudes({encumbered: half, max: WAD, allocatable: WAD - half}) + }); allocationManager.setAllocationDelay(defaultOperator, secondDelay); - cheats.roll(block.number + secondDelay); - allocationManager.modifyAllocations(defaultOperator, _newAllocateParams(OperatorSet(defaultAVS, 1), half)); + + cheats.roll(block.number + ALLOCATION_CONFIGURATION_DELAY); + allocationManager.modifyAllocations(defaultOperator, _newAllocateParams(defaultOperatorSet, half+1)); cheats.stopPrank(); + + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: half, pendingDiff: int64(1), effectBlock: uint32(block.number + secondDelay)}), + expectedMagnitudes: Magnitudes({encumbered: half+1, max: WAD, allocatable: WAD - (half + 1)}) + }); } + /** + * @notice Allocates a random magnitude to the default operatorSet. + * Validates: + * 1. Storage is clear prior to allocation + * 2. Events are emitted + * 3. Allocation storage/introspection after allocation + * 4. Allocation storage/introspection after roll to allocation effect block + */ function testFuzz_allocate_singleStrat_singleOperatorSet( Randomness r ) public rand(r) { @@ -1825,7 +1850,7 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe // Save vars to check against uint64 magnitude = allocateParams[0].newMagnitudes[0]; - uint32 effectBlock = uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + uint32 effectBlock = _defaultAllocEffectBlock(); // Check that the operator has no allocated sets/strats before allocation OperatorSet[] memory allocatedSets = allocationManager.getAllocatedSets(defaultOperator); @@ -1838,7 +1863,7 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - currentMagnitude: magnitude, + magnitude: magnitude, encumberedMagnitude: magnitude, effectBlock: effectBlock }); @@ -1847,8 +1872,9 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); - // Check storage + // Check storage Prior to Completion + // 1. Validate allocated sets and strategies allocatedSets = allocationManager.getAllocatedSets(defaultOperator); allocatedStrats = allocationManager.getAllocatedStrategies(defaultOperator, defaultOperatorSet); assertEq(allocatedSets.length, 1, "should have a single allocated set"); @@ -1856,37 +1882,38 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe assertEq(allocatedStrats.length, 1, "should have a single allocated strategy to default set"); assertEq(address(allocatedStrats[0]), address(strategyMock), "should have allocated default strat"); - assertEq( - magnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - assertEq( - WAD - magnitude, - allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock), - "allocatableMagnitude not calcualted correctly" - ); + // 2. Validate allocation + info _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: 0, - expectedPendingDiff: int128(uint128(magnitude)), - expectedEffectBlock: effectBlock + expectedAllocation: Allocation({ + currentMagnitude: 0, + pendingDiff: int128(uint128(magnitude)), + effectBlock: effectBlock + }), + expectedMagnitudes: Magnitudes({encumbered: magnitude, max: WAD, allocatable: WAD - magnitude}) }); - // Check storage after roll to completion + + // 3. Check allocation and info after roll to completion cheats.roll(effectBlock); _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: magnitude, - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: magnitude, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: magnitude, max: WAD, allocatable: WAD - magnitude}) }); } + /** + * @notice Allocates magnitude for a single strategy to multiple operatorSets + * Validates: + * 1. Events + * 2. Allocation storage/introspection after allocation + * 3. Allocation storage/introspection after roll to allocation effect block + */ function testFuzz_allocate_singleStrat_multipleSets( Randomness r ) public rand(r) { @@ -1900,98 +1927,101 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe _registerForOperatorSets(defaultOperator, operatorSets); // Save vars to check against - uint32 effectBlock = uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + uint32 effectBlock = _defaultAllocEffectBlock(); uint64 usedMagnitude; for (uint256 i; i < allocateParams.length; ++i) { usedMagnitude += allocateParams[i].newMagnitudes[0]; } - // Check that the operator has no allocated sets/strats before allocation - OperatorSet[] memory allocatedSets = allocationManager.getAllocatedSets(defaultOperator); - IStrategy[] memory allocatedStrats = - allocationManager.getAllocatedStrategies(defaultOperator, defaultOperatorSet); - assertEq(allocatedSets.length, 0, "should not have any allocated sets before allocation"); - assertEq(allocatedStrats.length, 0, "should not have any allocated strats before allocation"); - + // Validate events for (uint256 i; i < allocateParams.length; ++i) { + // There is only one strategy in each allocateParams, so we don't need a nested for loop _checkAllocationEvents({ operator: defaultOperator, operatorSet: operatorSets[i], strategy: strategyMock, - currentMagnitude: allocateParams[i].newMagnitudes[0], - encumberedMagnitude: allocateParams[i].newMagnitudes[0], + magnitude: allocateParams[i].newMagnitudes[0], + encumberedMagnitude: _encumberedMagnitudes[strategyMock] + allocateParams[i].newMagnitudes[0], effectBlock: effectBlock }); + _encumberedMagnitudes[strategyMock] += allocateParams[i].newMagnitudes[0]; } + // Allocate magnitude cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); // Check storage - assertEq( - usedMagnitude, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - assertEq( - WAD - usedMagnitude, - allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock), - "allocatableMagnitude not calcualted correctly" - ); - allocatedSets = allocationManager.getAllocatedSets(defaultOperator); + // 1. Sanity check number of allocated sets + OperatorSet[] memory allocatedSets = allocationManager.getAllocatedSets(defaultOperator); assertEq(allocatedSets.length, numOpSets, "should have multiple allocated sets"); + // 2. Check storage after allocation for (uint256 i; i < allocateParams.length; ++i) { _checkAllocationStorage({ operator: defaultOperator, operatorSet: operatorSets[i], strategy: strategyMock, - expectedCurrentMagnitude: 0, - expectedPendingDiff: int128(uint128(allocateParams[i].newMagnitudes[0])), - expectedEffectBlock: effectBlock + expectedAllocation: Allocation({ + currentMagnitude: 0, + pendingDiff: int128(uint128(allocateParams[i].newMagnitudes[0])), + effectBlock: effectBlock + }), + expectedMagnitudes: Magnitudes({ + encumbered: _encumberedMagnitudes[strategyMock], + max: WAD, + allocatable: WAD - _encumberedMagnitudes[strategyMock] + }) }); - allocatedStrats = allocationManager.getAllocatedStrategies(defaultOperator, operatorSets[i]); + IStrategy[] memory allocatedStrats = allocationManager.getAllocatedStrategies(defaultOperator, operatorSets[i]); assertEq(allocatedStrats.length, 1, "should have a single allocated strategy to each set"); assertEq(address(allocatedStrats[0]), address(strategyMock), "should have allocated default strat"); assertEq(allocatedSets[i].key(), operatorSets[i].key(), "should be allocated to expected set"); } - // Check storage after roll to completion + // 3. Check storage after roll to completion cheats.roll(effectBlock); for (uint256 i; i < allocateParams.length; ++i) { _checkAllocationStorage({ operator: defaultOperator, operatorSet: operatorSets[i], strategy: strategyMock, - expectedCurrentMagnitude: allocateParams[i].newMagnitudes[0], - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({ + currentMagnitude: allocateParams[i].newMagnitudes[0], + pendingDiff: 0, + effectBlock: 0 + }), + expectedMagnitudes: Magnitudes({ + encumbered: _encumberedMagnitudes[strategyMock], + max: WAD, + allocatable: WAD - _encumberedMagnitudes[strategyMock] + }) }); } } + /** + * @notice Allocates once, warps to allocation effect block, then allocates again + * Validates: + * 1. Events for each allocation + * 2. Allocation storage/introspection immediately after each allocation + */ function testFuzz_allocateMultipleTimes( Randomness r ) public rand(r) { uint64 firstAlloc = r.Uint64(1, WAD - 1); uint64 secondAlloc = r.Uint64(firstAlloc + 1, WAD); - // Check that the operator has no allocated sets/strats before allocation - OperatorSet[] memory allocatedSets = allocationManager.getAllocatedSets(defaultOperator); - IStrategy[] memory allocatedStrats = - allocationManager.getAllocatedStrategies(defaultOperator, defaultOperatorSet); - assertEq(allocatedSets.length, 0, "should not have any allocated sets before allocation"); - assertEq(allocatedStrats.length, 0, "should not have any allocated strats before allocation"); - + // Validate events _checkAllocationEvents({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - currentMagnitude: firstAlloc, + magnitude: firstAlloc, encumberedMagnitude: firstAlloc, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) + effectBlock: _defaultAllocEffectBlock() }); // Allocate magnitude @@ -1999,6 +2029,14 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: 0, pendingDiff: int64(firstAlloc), effectBlock: _defaultAllocEffectBlock()}), + expectedMagnitudes: Magnitudes({encumbered: firstAlloc, max: WAD, allocatable: WAD - firstAlloc}) + }); + // Warp to allocation complete block cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); @@ -2009,29 +2047,28 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - currentMagnitude: firstAlloc + secondAlloc, - encumberedMagnitude: firstAlloc + secondAlloc, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) + magnitude: secondAlloc, + encumberedMagnitude: secondAlloc, + effectBlock: _defaultAllocEffectBlock() }); cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); // Check storage - assertEq( - secondAlloc, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude not updated" - ); - - allocatedSets = allocationManager.getAllocatedSets(defaultOperator); - allocatedStrats = allocationManager.getAllocatedStrategies(defaultOperator, defaultOperatorSet); - assertEq(allocatedSets.length, 1, "should have a single allocated set"); - assertEq(allocatedSets[0].key(), defaultOperatorSet.key(), "should be allocated to default set"); - assertEq(allocatedStrats.length, 1, "should have a single allocated strategy to default set"); - assertEq(address(allocatedStrats[0]), address(strategyMock), "should have allocated default strat"); + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: firstAlloc, pendingDiff: int64(secondAlloc - firstAlloc), effectBlock: _defaultAllocEffectBlock()}), + expectedMagnitudes: Magnitudes({encumbered: secondAlloc, max: WAD, allocatable: WAD - secondAlloc}) + }); } + /** + * Allocates maximum magnitude to multiple strategies for the same operatorSet + * Validates that encumbered magnitude is max for each strategy + */ function testFuzz_allocateMaxToMultipleStrategies( Randomness r ) public rand(r) { @@ -2048,9 +2085,9 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe operator: defaultOperator, operatorSet: operatorSet, strategy: strategies[i], - currentMagnitude: WAD, + magnitude: WAD, encumberedMagnitude: WAD, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) + effectBlock: _defaultAllocEffectBlock() }); } @@ -2072,10 +2109,12 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe /** * Allocates to `firstMod` magnitude and then deallocate to `secondMod` magnitude - * Validates the storage - * - 1. After deallocation is called - * - 2. After the deallocationd delay is hit - * - 3. After the deallocation queue is cleared + * Validates: + * 1. Events are valid for the allocation and deallocation + * 2. Storage after the allocation is made + * 3. Storage after the deallocation is made + * 4. Storage after the deallocation effect block is hit + * 5. Storage after the deallocation queue is cleared (specifically encumbered mag is decreased) */ function testFuzz_allocate_deallocate_whenRegistered( Randomness r @@ -2091,9 +2130,9 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - currentMagnitude: firstMod, + magnitude: firstMod, encumberedMagnitude: firstMod, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) + effectBlock: _defaultAllocEffectBlock() }); cheats.prank(defaultOperator); @@ -2105,39 +2144,30 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe // Deallocate allocateParams = _newAllocateParams(defaultOperatorSet, secondMod); - _checkAllocationEvents({ + _checkDeallocationEvent({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - currentMagnitude: firstMod - secondMod, - encumberedMagnitude: firstMod - secondMod, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) + magnitude: secondMod, + effectBlock: uint32(block.number + DEALLOCATION_DELAY) }); cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); // Check storage after dealloc - assertEq( - firstMod, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should not be updated" - ); - assertEq( - WAD - firstMod, - allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock), - "allocatableMagnitude not calcualted correctly" - ); - uint32 effectBlock = uint32(block.number + DEALLOCATION_DELAY); _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: firstMod, - expectedPendingDiff: -int128(uint128(firstMod - secondMod)), - expectedEffectBlock: effectBlock + expectedAllocation: Allocation({ + currentMagnitude: firstMod, + pendingDiff: -int128(uint128(firstMod - secondMod)), + effectBlock: effectBlock + }), + expectedMagnitudes: Magnitudes({encumbered: firstMod, max: WAD, allocatable: WAD - firstMod}) }); // Check storage after roll to completion @@ -2146,28 +2176,116 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: secondMod, - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: secondMod, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: firstMod, max: WAD, allocatable: WAD - secondMod}) }); - assertEq( - firstMod, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should not be updated" - ); // Check storage after clearing deallocation queue allocationManager.clearDeallocationQueue(defaultOperator, strategyMock.toArray(), uint16(1).toArrayU16()); - assertEq( - secondMod, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should be updated" - ); + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: secondMod, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: secondMod, max: WAD, allocatable: WAD - secondMod}) + }); + } + + /** + * Allocates to an operatorSet, then fully deallocates after the strategy is removed from the set. + * Validates that the deallocation takes effect immediately after the strategy is removed + */ + function test_allocate_removeStrategyFromSet_fullyDeallocate() public { + // Allocate + AllocateParams[] memory allocateParams = _randAllocateParams_SingleMockStrategy(defaultOperatorSet.toArray()); + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, allocateParams); + cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + + // Remove strategy from operatorSet + cheats.prank(defaultAVS); + allocationManager.removeStrategiesFromOperatorSet(defaultAVS, defaultOperatorSet.id, defaultStrategies); + + // Deallocate All Instantly + AllocateParams[] memory deallocateParams = allocateParams; + deallocateParams[0].newMagnitudes[0] = 0; + + // We check the allocation event and not the deallocation event since the encumbered mag is updated too! + _checkAllocationEvents({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + magnitude: 0, + encumberedMagnitude: 0, + effectBlock: uint32(block.number) + }); + + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, deallocateParams); + + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: 0, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: 0, max: WAD, allocatable: WAD}) + }); + } + + /** + * Allocates to an operatorSet, deallocates, then removes a strategy from the operatorSet + * Validates that: + * 1. The deallocation still completes at its expected time + */ + function testFuzz_allocate_deallocate_removeStrategyFromSet(Randomness r) public { + // Allocate + AllocateParams[] memory allocateParams = _randAllocateParams_SingleMockStrategy(defaultOperatorSet.toArray()); + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, allocateParams); + cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + + // Deallocate + AllocateParams[] memory deallocateParams = r.DeallocateParams(allocateParams); + uint32 deallocEffectBlock = uint32(block.number + DEALLOCATION_DELAY); + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, deallocateParams); + + // Remove strategy from operatorSet + cheats.prank(defaultAVS); + allocationManager.removeStrategiesFromOperatorSet(defaultAVS, defaultOperatorSet.id, defaultStrategies); + + // Roll to just before deallocation complete block & clear deallocation queue for sanity + cheats.roll(deallocEffectBlock - 1); + allocationManager.clearDeallocationQueue(defaultOperator, strategyMock.toArray(), _maxNumToClear()); + + int128 expectedDiff = -int128(uint128(allocateParams[0].newMagnitudes[0] - deallocateParams[0].newMagnitudes[0])); + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: allocateParams[0].newMagnitudes[0], pendingDiff: expectedDiff, effectBlock: deallocEffectBlock}), + expectedMagnitudes: Magnitudes({encumbered: allocateParams[0].newMagnitudes[0], max: WAD, allocatable: WAD - allocateParams[0].newMagnitudes[0]}) + }); + + // Roll to deallocation complete block + cheats.roll(deallocEffectBlock); + + // Note that the encumbered mag hasn't been updated since we haven't cleared the deallocaction queue! + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + expectedAllocation: Allocation({currentMagnitude: deallocateParams[0].newMagnitudes[0], pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: allocateParams[0].newMagnitudes[0], max: WAD, allocatable: WAD - deallocateParams[0].newMagnitudes[0]}) + }); } /** * Allocates to an operator set, then fully deallocates when not registered to the set. - * Checks that deallocation is instant and can be reallocated instantly. + * Validates that: + * 1. Events are properly emitted post instantaneous deallocation + * 2. The deallocation is instant & can be reallocated immediately + * 3. Storage/introspection post combined deallocation/allocation */ function testFuzz_allocate_fullyDeallocate_reallocate_WhenNotRegistered( Randomness r @@ -2175,31 +2293,15 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe // Bound allocation and deallocation uint64 firstMod = r.Uint64(1, WAD); - // Create a new operator sets that the operator is not registered for + // Create new operator sets that the operator is not registered for OperatorSet memory operatorSetA = _createOperatorSet(OperatorSet(defaultAVS, r.Uint32()), defaultStrategies); OperatorSet memory operatorSetB = _createOperatorSet(OperatorSet(defaultAVS, r.Uint32()), defaultStrategies); // Allocate magnitude to operator set AllocateParams[] memory allocateParams = _newAllocateParams(operatorSetA, firstMod); - - _checkAllocationEvents({ - operator: defaultOperator, - operatorSet: operatorSetA, - strategy: strategyMock, - currentMagnitude: firstMod, - encumberedMagnitude: firstMod, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) - }); - cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); - assertEq( - firstMod, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should equal firstMod" - ); - // Warp to allocation complete block cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); @@ -2208,46 +2310,36 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe allocateParams[0] = _newAllocateParams(operatorSetA, 0)[0]; allocateParams[1] = _newAllocateParams(operatorSetB, firstMod)[0]; + // We check the allocation event and not the deallocation event since + // encumbered magnitude is also updated here _checkAllocationEvents({ operator: defaultOperator, operatorSet: operatorSetA, strategy: strategyMock, - currentMagnitude: 0, + magnitude: 0, encumberedMagnitude: 0, - effectBlock: 0 + effectBlock: uint32(block.number) // Instant deallocation }); _checkAllocationEvents({ operator: defaultOperator, operatorSet: operatorSetB, strategy: strategyMock, - currentMagnitude: firstMod, + magnitude: firstMod, encumberedMagnitude: firstMod, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) + effectBlock: _defaultAllocEffectBlock() }); cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); - // Check storage after dealloc - assertEq( - firstMod, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should not be changed" - ); - assertEq( - WAD - firstMod, - allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock), - "allocatableMagnitude not calculated correctly" - ); - + // Check storage after deallocation // Check operator set A _checkAllocationStorage({ operator: defaultOperator, operatorSet: operatorSetA, strategy: strategyMock, - expectedCurrentMagnitude: 0, - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: 0, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: firstMod, max: WAD, allocatable: WAD - firstMod}) // This is from opsetB }); // Check operator set B @@ -2255,15 +2347,21 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe operator: defaultOperator, operatorSet: operatorSetB, strategy: strategyMock, - expectedCurrentMagnitude: 0, - expectedPendingDiff: int64(firstMod), - expectedEffectBlock: block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY + expectedAllocation: Allocation({ + currentMagnitude: 0, + pendingDiff: int128(uint128(firstMod)), + effectBlock: _defaultAllocEffectBlock() + }), + expectedMagnitudes: Magnitudes({encumbered: firstMod, max: WAD, allocatable: WAD - firstMod}) }); } /** - * Allocate to an operator set using magnitude that is only available if the deallocation - * queue is cleared + * Allocates all magnitude to a single strategy across multiple operatorSets. Deallocates fully, and then reallocates + * Validates: + * 1. Events are emitted for the allocation, deallocation, and reallocation (including the deallocation queue clear) + * 2. Stake is fully allocated & encumbered mag used up + * 3. Stake can be reallocated after the deallocation delay */ function testFuzz_allocate_fromClearedDeallocQueue( Randomness r @@ -2276,15 +2374,17 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe _registerForOperatorSets(defaultOperator, deallocSets); AllocateParams[] memory allocateParams = _randAllocateParams_SingleMockStrategy_AllocAll(deallocSets); - for (uint256 i; i < numOpSets; ++i) { + for (uint256 i; i < allocateParams.length; ++i) { + // There is only one strategy each allocateParams, so we don't need a nested for loop _checkAllocationEvents({ operator: defaultOperator, - operatorSet: deallocSets[i], + operatorSet: allocateParams[i].operatorSet, strategy: strategyMock, - currentMagnitude: WAD, - encumberedMagnitude: WAD, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) + magnitude: allocateParams[i].newMagnitudes[0], + encumberedMagnitude: _encumberedMagnitudes[strategyMock] + allocateParams[i].newMagnitudes[0], + effectBlock: _defaultAllocEffectBlock() }); + _encumberedMagnitudes[strategyMock] += allocateParams[i].newMagnitudes[0]; } cheats.prank(defaultOperator); @@ -2303,13 +2403,12 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe AllocateParams[] memory deallocateParams = _newAllocateParams(deallocSets, 0); for (uint256 i; i < numOpSets; ++i) { - _checkAllocationEvents({ + _checkDeallocationEvent({ operator: defaultOperator, operatorSet: deallocSets[i], strategy: strategyMock, - currentMagnitude: 0, - encumberedMagnitude: 0, - effectBlock: 0 + magnitude: 0, + effectBlock: uint32(block.number + DEALLOCATION_DELAY) }); } @@ -2339,13 +2438,19 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe _registerForOperatorSet(defaultOperator, finalOpSet); AllocateParams[] memory finalAllocParams = _newAllocateParams(finalOpSet, WAD); + _checkClearDeallocationQueueEvents({ + operator: defaultOperator, + strategy: strategyMock, + encumberedMagnitude: 0 + }); + _checkAllocationEvents({ operator: defaultOperator, operatorSet: finalOpSet, strategy: strategyMock, - currentMagnitude: WAD, + magnitude: WAD, encumberedMagnitude: WAD, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) + effectBlock: _defaultAllocEffectBlock() }); cheats.prank(defaultOperator); @@ -2357,62 +2462,40 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe operator: defaultOperator, operatorSet: finalOpSet, strategy: strategyMock, - expectedCurrentMagnitude: 0, - expectedPendingDiff: int64(WAD), - expectedEffectBlock: block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY + expectedAllocation: Allocation({ + currentMagnitude: 0, + pendingDiff: int128(uint128(WAD)), + effectBlock: _defaultAllocEffectBlock() + }), + expectedMagnitudes: Magnitudes({encumbered: WAD, max: WAD, allocatable: 0}) }); - assertEq( - allocationManager.getAllocatableMagnitude(defaultOperator, strategyMock), - 0, - "operator should not have any remaining allocatable magnitude" - ); - assertEq( - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - WAD, - "all magnitude should be allocated" - ); - - for (uint256 i; i < deallocSets.length; ++i) { - _checkAllocationStorage({ - operator: defaultOperator, - operatorSet: deallocSets[i], - strategy: strategyMock, - expectedCurrentMagnitude: 0, - expectedPendingDiff: 0, - expectedEffectBlock: 0 - }); - } } + /** + * Allocates all mag and then deallocates all mag + * Validates + * 1. Events for the deallocation + * 2. Storage after deallocation + * 3. Storage after clearing the deallocation queue + */ function test_deallocate_all() public { - // Allocate + // Allocate all AllocateParams[] memory allocateParams = _newAllocateParams(defaultOperatorSet, WAD); - - _checkAllocationEvents({ - operator: defaultOperator, - operatorSet: defaultOperatorSet, - strategy: strategyMock, - currentMagnitude: WAD, - encumberedMagnitude: WAD, - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) - }); - cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); // Warp to allocation complete block cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); - // Deallocate + // Deallocate all allocateParams[0].newMagnitudes[0] = 0; - _checkAllocationEvents({ + _checkDeallocationEvent({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - currentMagnitude: 0, - encumberedMagnitude: 0, - effectBlock: 0 + magnitude: 0, + effectBlock: uint32(block.number + DEALLOCATION_DELAY) }); cheats.prank(defaultOperator); @@ -2423,114 +2506,24 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe allocationManager.clearDeallocationQueue(defaultOperator, defaultStrategies, uint16(1).toArrayU16()); // Check storage - assertEq( - 0, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should be updated" - ); _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: 0, - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({currentMagnitude: 0, pendingDiff: 0, effectBlock: 0}), + expectedMagnitudes: Magnitudes({encumbered: 0, max: WAD, allocatable: WAD}) }); } - function testFuzz_allocate_deallocate_singleStrat_multipleOperatorSets( - Randomness r - ) public rand(r) { - uint8 numOpSets = uint8(r.Uint256(1, FUZZ_MAX_OP_SETS)); - - // Create and register for operator sets, each with a single default strategy - OperatorSet[] memory operatorSets = r.OperatorSetArray(defaultAVS, numOpSets); - _createOperatorSets(operatorSets, defaultStrategies); - _registerForOperatorSets(defaultOperator, operatorSets); - - (AllocateParams[] memory allocateParams, AllocateParams[] memory deallocateParams) = - _randAllocAndDeallocParams_SingleMockStrategy(operatorSets); - - // Allocate - for (uint256 i; i < allocateParams.length; ++i) { - _checkAllocationEvents({ - operator: defaultOperator, - operatorSet: operatorSets[i], - strategy: strategyMock, - currentMagnitude: allocateParams[i].newMagnitudes[0], - encumberedMagnitude: allocateParams[i].newMagnitudes[0], - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) - }); - } - - cheats.prank(defaultOperator); - allocationManager.modifyAllocations(defaultOperator, allocateParams); - uint64 encumberedMagnitudeAfterAllocation = allocationManager.encumberedMagnitude(defaultOperator, strategyMock); - - // Warp to allocation complete block - cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); - - // Calculate post-deallocation magnitude - // We can add each entry to this value because each operator set is using the same strategy - uint64 postDeallocMag; - for (uint256 i; i < deallocateParams.length; ++i) { - postDeallocMag += deallocateParams[i].newMagnitudes[0]; - _checkAllocationEvents({ - operator: defaultOperator, - operatorSet: operatorSets[i], - strategy: strategyMock, - currentMagnitude: deallocateParams[i].newMagnitudes[0], - encumberedMagnitude: deallocateParams[i].newMagnitudes[0], - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) - }); - } - - cheats.prank(defaultOperator); - allocationManager.modifyAllocations(defaultOperator, deallocateParams); - - // Check storage after dealloc - assertEq( - encumberedMagnitudeAfterAllocation, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should not be updated" - ); - - for (uint256 i; i < allocateParams.length; ++i) { - _checkAllocationStorage({ - operator: defaultOperator, - operatorSet: operatorSets[i], - strategy: strategyMock, - expectedCurrentMagnitude: allocateParams[i].newMagnitudes[0], - expectedPendingDiff: -int64(allocateParams[i].newMagnitudes[0] - deallocateParams[i].newMagnitudes[0]), - expectedEffectBlock: block.number + DEALLOCATION_DELAY - }); - } - - // Check storage after roll to completion - cheats.roll(block.number + DEALLOCATION_DELAY); - - for (uint256 i; i < allocateParams.length; ++i) { - _checkAllocationStorage({ - operator: defaultOperator, - operatorSet: operatorSets[i], - strategy: strategyMock, - expectedCurrentMagnitude: deallocateParams[i].newMagnitudes[0], - expectedPendingDiff: 0, - expectedEffectBlock: 0 - }); - } - - // Clear deallocation queue - allocationManager.clearDeallocationQueue(defaultOperator, defaultStrategies, type(uint16).max.toArrayU16()); - // Check storage after clearing deallocation queue - assertEq( - postDeallocMag, - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should be updated" - ); - } - - function testFuzz_MultipleSetsAndStrats( + + /** + * Allocates, deallocates, and then clears the deallocation queue. Multiple strategies & sets in a single operatorSet + * Validates: + * 1. Events for allocation, deallocation, and deallocation queue clear + * 2. Storage after allocation & after allocation effect block + * 3. Storage after deallocation & after deallocation effect block + */ + function testFuzz_lifecycle_allocate_deallocate_MultipleSetsAndStrats( Randomness r ) public rand(r) { uint256 numAllocations = r.Uint256(2, FUZZ_MAX_ALLOCATIONS); @@ -2542,16 +2535,21 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe cheats.prank(defaultAVS); allocationManager.createOperatorSets(defaultAVS, createSetParams); + + for(uint256 i = 0; i < allocateParams.length; i++) { + _registerForOperatorSet(defaultOperator, allocateParams[i].operatorSet); + } + // Allocate for (uint256 i; i < allocateParams.length; ++i) { for (uint256 j; j < allocateParams[i].strategies.length; ++j) { _checkAllocationEvents({ operator: defaultOperator, operatorSet: allocateParams[i].operatorSet, strategy: allocateParams[i].strategies[j], - currentMagnitude: allocateParams[i].newMagnitudes[j], + magnitude: allocateParams[i].newMagnitudes[j], encumberedMagnitude: allocateParams[i].newMagnitudes[j], - effectBlock: uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY) + effectBlock: _defaultAllocEffectBlock() }); } } @@ -2559,30 +2557,61 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, allocateParams); + // Check storage after allocation for (uint256 i; i < allocateParams.length; ++i) { for (uint256 j = 0; j < allocateParams[i].strategies.length; j++) { _checkAllocationStorage({ operator: defaultOperator, operatorSet: allocateParams[i].operatorSet, strategy: allocateParams[i].strategies[j], - expectedCurrentMagnitude: 0, - expectedPendingDiff: int64(allocateParams[i].newMagnitudes[j]), - expectedEffectBlock: block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY + expectedAllocation: Allocation({ + currentMagnitude: 0, + pendingDiff: int128(uint128(allocateParams[i].newMagnitudes[j])), + effectBlock: _defaultAllocEffectBlock() + }), + expectedMagnitudes: Magnitudes({ + encumbered: allocateParams[i].newMagnitudes[j], + max: WAD, + allocatable: WAD - allocateParams[i].newMagnitudes[j] + }) }); } } + // Warp to allocation complete block cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + // Check storage after roll to completion for (uint256 i; i < allocateParams.length; ++i) { for (uint256 j = 0; j < allocateParams[i].strategies.length; j++) { _checkAllocationStorage({ operator: defaultOperator, operatorSet: allocateParams[i].operatorSet, strategy: allocateParams[i].strategies[j], - expectedCurrentMagnitude: allocateParams[i].newMagnitudes[j], - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({ + currentMagnitude: allocateParams[i].newMagnitudes[j], + pendingDiff: 0, + effectBlock: 0 + }), + expectedMagnitudes: Magnitudes({ + encumbered: allocateParams[i].newMagnitudes[j], + max: WAD, + allocatable: WAD - allocateParams[i].newMagnitudes[j] + }) + }); + } + } + + // Deallocate + + for (uint256 i; i < deallocateParams.length; ++i) { + for (uint256 j = 0; j < deallocateParams[i].strategies.length; j++) { + _checkDeallocationEvent({ + operator: defaultOperator, + operatorSet: deallocateParams[i].operatorSet, + strategy: deallocateParams[i].strategies[j], + magnitude: deallocateParams[i].newMagnitudes[j], + effectBlock: uint32(block.number + DEALLOCATION_DELAY) }); } } @@ -2590,16 +2619,45 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, deallocateParams); - // Deallocations are immediate if the operator's allocation is not slashable. + for (uint256 i; i < allocateParams.length; ++i) { + for (uint256 j = 0; j < allocateParams[i].strategies.length; j++) { + int128 expectedDiff = -int128(uint128(allocateParams[i].newMagnitudes[j] - deallocateParams[i].newMagnitudes[j])); + _checkAllocationStorage({ + operator: defaultOperator, + operatorSet: deallocateParams[i].operatorSet, + strategy: deallocateParams[i].strategies[j], + expectedAllocation: Allocation({ + currentMagnitude: allocateParams[i].newMagnitudes[j], + pendingDiff: expectedDiff, + effectBlock: uint32(block.number + DEALLOCATION_DELAY) + }), + expectedMagnitudes: Magnitudes({ + encumbered: allocateParams[i].newMagnitudes[j], + max: WAD, + allocatable: WAD - allocateParams[i].newMagnitudes[j] + }) + }); + } + } + + // Warp to deallocation complete block + cheats.roll(block.number + DEALLOCATION_DELAY); for (uint256 i; i < allocateParams.length; ++i) { for (uint256 j = 0; j < allocateParams[i].strategies.length; j++) { _checkAllocationStorage({ operator: defaultOperator, - operatorSet: allocateParams[i].operatorSet, + operatorSet: deallocateParams[i].operatorSet, strategy: allocateParams[i].strategies[j], - expectedCurrentMagnitude: deallocateParams[i].newMagnitudes[j], - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({ + currentMagnitude: deallocateParams[i].newMagnitudes[j], + pendingDiff: 0, + effectBlock: 0 + }), + expectedMagnitudes: Magnitudes({ + encumbered: allocateParams[i].newMagnitudes[j], + max: WAD, + allocatable: WAD - deallocateParams[i].newMagnitudes[j] + }) }); } } @@ -2607,10 +2665,10 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe } contract AllocationManagerUnitTests_ClearDeallocationQueue is AllocationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; /// ----------------------------------------------------------------------- - /// clearModificationQueue() + /// clearDeallocationQueue() /// ----------------------------------------------------------------------- function test_revert_paused() public { @@ -2660,9 +2718,16 @@ contract AllocationManagerUnitTests_ClearDeallocationQueue is AllocationManagerU operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: allocateParams[0].newMagnitudes[0], - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({ + currentMagnitude: allocateParams[0].newMagnitudes[0], + pendingDiff: 0, + effectBlock: 0 + }), + expectedMagnitudes: Magnitudes({ + encumbered: allocateParams[0].newMagnitudes[0], + max: WAD, + allocatable: WAD - allocateParams[0].newMagnitudes[0] + }) }); } @@ -2673,7 +2738,7 @@ contract AllocationManagerUnitTests_ClearDeallocationQueue is AllocationManagerU * - Clears deallocation queue when the dealloc can be completed * - Assert events & validates storage after the deallocateParams are completed */ - function testFuzz_allocate_deallocate_whenRegistered( + function testFuzz_allocate_deallocate( Randomness r ) public rand(r) { // Generate a random allocation and subsequent deallocation from the default operator set @@ -2688,46 +2753,62 @@ contract AllocationManagerUnitTests_ClearDeallocationQueue is AllocationManagerU cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); // Deallocate + _checkDeallocationEvent({ + operator: defaultOperator, + operatorSet: defaultOperatorSet, + strategy: strategyMock, + magnitude: deallocateParams[0].newMagnitudes[0], + effectBlock: uint32(block.number + DEALLOCATION_DELAY) + }); cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, deallocateParams); // Clear queue - since we have not rolled forward, this should be a no-op allocationManager.clearDeallocationQueue(defaultOperator, defaultStrategies, _maxNumToClear()); - assertEq( - allocateParams[0].newMagnitudes[0], - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should not be updated" - ); // Validate storage - encumbered magnitude should just be allocateParams (we only have 1 allocation) _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: allocateParams[0].newMagnitudes[0], - expectedPendingDiff: -int128(uint128(allocateParams[0].newMagnitudes[0] - deallocateParams[0].newMagnitudes[0])), - expectedEffectBlock: block.number + DEALLOCATION_DELAY + expectedAllocation: Allocation({ + currentMagnitude: allocateParams[0].newMagnitudes[0], + pendingDiff: -int128(uint128(allocateParams[0].newMagnitudes[0] - deallocateParams[0].newMagnitudes[0])), + effectBlock: uint32(block.number + DEALLOCATION_DELAY) + }), + expectedMagnitudes: Magnitudes({ + encumbered: allocateParams[0].newMagnitudes[0], + max: WAD, + allocatable: WAD - allocateParams[0].newMagnitudes[0] + }) }); // Warp to deallocation complete block cheats.roll(block.number + DEALLOCATION_DELAY); // Clear queue + _checkClearDeallocationQueueEvents({ + operator: defaultOperator, + strategy: strategyMock, + encumberedMagnitude: deallocateParams[0].newMagnitudes[0] + }); allocationManager.clearDeallocationQueue(defaultOperator, defaultStrategies, _maxNumToClear()); // Validate storage - encumbered magnitude should just be deallocateParams (we only have 1 deallocation) - assertEq( - deallocateParams[0].newMagnitudes[0], - allocationManager.encumberedMagnitude(defaultOperator, strategyMock), - "encumberedMagnitude should be updated" - ); _checkAllocationStorage({ operator: defaultOperator, operatorSet: defaultOperatorSet, strategy: strategyMock, - expectedCurrentMagnitude: deallocateParams[0].newMagnitudes[0], - expectedPendingDiff: 0, - expectedEffectBlock: 0 + expectedAllocation: Allocation({ + currentMagnitude: deallocateParams[0].newMagnitudes[0], + pendingDiff: 0, + effectBlock: 0 + }), + expectedMagnitudes: Magnitudes({ + encumbered: deallocateParams[0].newMagnitudes[0], + max: WAD, + allocatable: WAD - deallocateParams[0].newMagnitudes[0] + }) }); } @@ -2736,7 +2817,7 @@ contract AllocationManagerUnitTests_ClearDeallocationQueue is AllocationManagerU * - The deallocation does not block state updates from the second allocation, even though the allocation has an earlier * effect block */ - function test_allocate_deallocate_allocate_whenRegistered() public { + function test_allocate_deallocate_allocate() public { // Allocate half of mag to default operator set AllocateParams[] memory firstAllocation = _newAllocateParams(defaultOperatorSet, 5e17); cheats.prank(defaultOperator); @@ -2758,14 +2839,14 @@ contract AllocationManagerUnitTests_ClearDeallocationQueue is AllocationManagerU _registerForOperatorSet(defaultOperator, newOperatorSet); // Allocate 33e16 mag to new operator set - uint32 allocationEffectBlock = uint32(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + uint32 allocationEffectBlock = _defaultAllocEffectBlock(); AllocateParams[] memory secondAllocation = _newAllocateParams(newOperatorSet, 33e16); cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, secondAllocation); allocation = allocationManager.getAllocation(defaultOperator, newOperatorSet, strategyMock); assertEq(allocationEffectBlock, allocation.effectBlock, "effect block not correct"); - // Warp to allocation effect block & clear the queue + // Warp to allocation effect block & clear the queue - clearing is a noop here cheats.roll(allocationEffectBlock); allocationManager.clearDeallocationQueue(defaultOperator, defaultStrategies, _maxNumToClear()); @@ -2777,6 +2858,15 @@ contract AllocationManagerUnitTests_ClearDeallocationQueue is AllocationManagerU AllocateParams[] memory thirdAllocation = _newAllocateParams(newOperatorSet, 10e16); cheats.prank(defaultOperator); allocationManager.modifyAllocations(defaultOperator, thirdAllocation); + + // Warp & validate deallocation + cheats.roll(deallocationEffectBlock); + _checkClearDeallocationQueueEvents({ + operator: defaultOperator, + strategy: strategyMock, + encumberedMagnitude: 58e16 + }); + allocationManager.clearDeallocationQueue(defaultOperator, defaultStrategies, _maxNumToClear()); } /** @@ -2857,7 +2947,7 @@ contract AllocationManagerUnitTests_SetAllocationDelay is AllocationManagerUnitT function test_revert_callerNotOperator() public { delegationManagerMock.setIsOperator(operatorToSet, false); cheats.prank(operatorToSet); - cheats.expectRevert(OperatorNotRegistered.selector); + cheats.expectRevert(InvalidOperator.selector); allocationManager.setAllocationDelay(operatorToSet, 1); } @@ -2973,7 +3063,7 @@ contract AllocationManagerUnitTests_SetAllocationDelay is AllocationManagerUnitT } contract AllocationManagerUnitTests_registerForOperatorSets is AllocationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; RegisterParams defaultRegisterParams; @@ -3063,7 +3153,7 @@ contract AllocationManagerUnitTests_registerForOperatorSets is AllocationManager } contract AllocationManagerUnitTests_deregisterFromOperatorSets is AllocationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; DeregisterParams defaultDeregisterParams; @@ -3143,7 +3233,12 @@ contract AllocationManagerUnitTests_deregisterFromOperatorSets is AllocationMana defaultAVS, abi.encodeWithSelector(IAVSRegistrar.deregisterOperator.selector, operator, operatorSetIds) ); - cheats.prank(operator); + bool callFromAVS = r.Boolean(); + if (callFromAVS) { + cheats.prank(defaultAVS); + } else { + cheats.prank(operator); + } allocationManager.deregisterFromOperatorSets(DeregisterParams(operator, defaultAVS, operatorSetIds)); assertEq(allocationManager.getRegisteredSets(operator).length, 0, "should not be registered for any sets"); @@ -3163,8 +3258,6 @@ contract AllocationManagerUnitTests_deregisterFromOperatorSets is AllocationMana } contract AllocationManagerUnitTests_addStrategiesToOperatorSet is AllocationManagerUnitTests { - using ArrayLib for *; - function test_addStrategiesToOperatorSet_InvalidOperatorSet() public { cheats.prank(defaultAVS); cheats.expectRevert(InvalidOperatorSet.selector); @@ -3177,25 +3270,6 @@ contract AllocationManagerUnitTests_addStrategiesToOperatorSet is AllocationMana allocationManager.addStrategiesToOperatorSet(defaultAVS, defaultOperatorSet.id, defaultStrategies); } - function test_addStrategiesToOperatorSet_MaxStrategiesExceeded() public { - cheats.startPrank(defaultAVS); - cheats.expectRevert(MaxStrategiesExceeded.selector); - allocationManager.addStrategiesToOperatorSet( - defaultAVS, defaultOperatorSet.id, new IStrategy[](MAX_OPERATOR_SET_STRATEGY_LIST_LENGTH + 1) - ); - - for (uint256 i; i < MAX_OPERATOR_SET_STRATEGY_LIST_LENGTH - 1; ++i) { - allocationManager.addStrategiesToOperatorSet( - defaultAVS, defaultOperatorSet.id, IStrategy(cheats.randomAddress()).toArray() - ); - } - - cheats.expectRevert(MaxStrategiesExceeded.selector); - allocationManager.addStrategiesToOperatorSet( - defaultAVS, defaultOperatorSet.id, IStrategy(cheats.randomAddress()).toArray() - ); - } - function testFuzz_addStrategiesToOperatorSet_Correctness( Randomness r ) public rand(r) { @@ -3221,7 +3295,7 @@ contract AllocationManagerUnitTests_addStrategiesToOperatorSet is AllocationMana } contract AllocationManagerUnitTests_removeStrategiesFromOperatorSet is AllocationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; function test_removeStrategiesFromOperatorSet_InvalidOperatorSet() public { cheats.prank(defaultAVS); @@ -3266,23 +3340,12 @@ contract AllocationManagerUnitTests_removeStrategiesFromOperatorSet is Allocatio } contract AllocationManagerUnitTests_createOperatorSets is AllocationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; - function testRevert_createOperatorSets_InvalidOperatorSet() public { + function test_createOperatorSets_InvalidOperatorSet() public { cheats.prank(defaultAVS); cheats.expectRevert(InvalidOperatorSet.selector); - allocationManager.createOperatorSets( - defaultAVS, CreateSetParams(defaultOperatorSet.id, defaultStrategies).toArray() - ); - } - - function testRevert_createOperatorSets_MaxStrategiesExceeded() public { - cheats.prank(defaultAVS); - cheats.expectRevert(MaxStrategiesExceeded.selector); - allocationManager.createOperatorSets( - defaultAVS, - CreateSetParams(defaultOperatorSet.id, new IStrategy[](MAX_OPERATOR_SET_STRATEGY_LIST_LENGTH + 1)).toArray() - ); + allocationManager.createOperatorSets(defaultAVS, CreateSetParams(defaultOperatorSet.id, defaultStrategies).toArray()); } function testFuzz_createOperatorSets_Correctness( @@ -3328,6 +3391,13 @@ contract AllocationManagerUnitTests_createOperatorSets is AllocationManagerUnitT } contract AllocationManagerUnitTests_setAVSRegistrar is AllocationManagerUnitTests { + + function test_getAVSRegistrar() public { + address randomAVS = random().Address(); + IAVSRegistrar avsRegistrar = allocationManager.getAVSRegistrar(randomAVS); + assertEq(address(avsRegistrar), address(randomAVS), "AVS registrar should return default"); + } + function testFuzz_setAVSRegistrar_Correctness( Randomness r ) public rand(r) { @@ -3369,17 +3439,297 @@ contract AllocationManagerUnitTests_getStrategyAllocations is AllocationManagerU cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); - (OperatorSet[] memory operatorSets, Allocation[] memory allocations) = + (OperatorSet[] memory operatorSets, ) = allocationManager.getStrategyAllocations(defaultOperator, allocateParams[0].strategies[0]); assertEq(operatorSets[0].avs, allocateParams[0].operatorSet.avs, "should be defaultAVS"); assertEq(operatorSets[0].id, allocateParams[0].operatorSet.id, "should be defaultOperatorSet"); _checkAllocationStorage({ - allocation: allocations[0], - expectedCurrentMagnitude: allocateParams[0].newMagnitudes[0], - expectedPendingDiff: 0, - expectedEffectBlock: 0 + operator: defaultOperator, + operatorSet: operatorSets[0], + strategy: createSetParams[0].strategies[0], + expectedAllocation: Allocation({ + currentMagnitude: allocateParams[0].newMagnitudes[0], + pendingDiff: 0, + effectBlock: 0 + }), + expectedMagnitudes: Magnitudes({ + encumbered: allocateParams[0].newMagnitudes[0], + max: WAD, + allocatable: WAD - allocateParams[0].newMagnitudes[0] + }) + }); + } +} + +contract AllocationManagerUnitTests_getSlashableStake is AllocationManagerUnitTests { + using SlashingLib for *; + + /** + * Allocates half of magnitude for a single strategy to an operatorSet. Then allocates again. Slashes 50% + * of the first allocation. Validates slashable stake at each step. + */ + function test_allocate_onePendingAllocation( + Randomness r + ) public rand(r) { + // Generate allocation for `strategyMock`, we allocate half + { + AllocateParams[] memory allocateParams = _newAllocateParams(defaultOperatorSet, 5e17); + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, allocateParams); + cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + } + + _checkSlashableStake({ + operatorSet: defaultOperatorSet, + operator: defaultOperator, + strategies: defaultStrategies, + expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(5e17) + }); + + // Allocate the other half + AllocateParams[] memory allocateParams2 = _newAllocateParams(defaultOperatorSet, WAD); + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, allocateParams2); + uint32 secondAllocEffectBlock = _defaultAllocEffectBlock(); + + // Check minimum slashable stake remains the same + _checkSlashableStake({ + operatorSet: defaultOperatorSet, + operator: defaultOperator, + strategies: defaultStrategies, + expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(5e17) + }); + + // Check minimum slashable stake would not change even after the second allocation becomes effective + // This is because the allocation is not effective yet & we're getting a MINIMUM + _checkSlashableStake({ + operatorSet: defaultOperatorSet, + operator: defaultOperator, + strategies: defaultStrategies, + expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(5e17), + futureBlock: secondAllocEffectBlock + 1 + }); + + // Check minimum slashable stake after the second allocation becomes effective + cheats.roll(secondAllocEffectBlock); + _checkSlashableStake({ + operatorSet: defaultOperatorSet, + operator: defaultOperator, + strategies: defaultStrategies, + expectedStake: DEFAULT_OPERATOR_SHARES + }); + } + + /** + * Allocates to `firstMod` magnitude and then deallocate to `secondMod` magnitude + * Validates slashable stake at each step after allocation and deallocation + */ + function testFuzz_allocate_deallocate_validateSlashableStake( + Randomness r + ) public rand(r) { + // Bound allocation and deallocation + uint64 firstMod = r.Uint64(1, WAD); + uint64 secondMod = r.Uint64(0, firstMod - 1); + + // Allocate magnitude to default registered set + AllocateParams[] memory allocateParams = _newAllocateParams(defaultOperatorSet, firstMod); + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, allocateParams); + + // 1. Validate slashable stake. + // This value should be 0 even at the effectBlock since its minimal slashable stake + _checkSlashableStake({ + operatorSet: defaultOperatorSet, + operator: defaultOperator, + strategies: defaultStrategies, + expectedStake: 0, + futureBlock: _defaultAllocEffectBlock() + }); + + // Warp to allocation complete block + cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + + // 2. Check slashable stake after allocation effect block + _checkSlashableStake({ + operatorSet: defaultOperatorSet, + operator: defaultOperator, + strategies: defaultStrategies, + expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(firstMod) + }); + + // Deallocate + allocateParams = _newAllocateParams(defaultOperatorSet, secondMod); + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, allocateParams); + // 3. Check slashable stake after deallocation - should be same at current block + _checkSlashableStake({ + operatorSet: defaultOperatorSet, + operator: defaultOperator, + strategies: defaultStrategies, + expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(firstMod), + futureBlock: uint32(block.number) + }); + + // 4. Check slashable stake at the deallocation effect block + _checkSlashableStake({ + operatorSet: defaultOperatorSet, + operator: defaultOperator, + strategies: defaultStrategies, + expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(secondMod), + futureBlock: uint32(block.number + DEALLOCATION_DELAY) + }); + + // Warp to deallocation effect block + cheats.roll(block.number + DEALLOCATION_DELAY); + + // 5. Check slashable stake at the deallocation effect block + _checkSlashableStake({ + operatorSet: defaultOperatorSet, + operator: defaultOperator, + strategies: defaultStrategies, + expectedStake: DEFAULT_OPERATOR_SHARES.mulWad(secondMod) + }); + } + + /** + * Allocates all of magnitude to a single strategy to an operatorSet. + * Deallocate some portion. Finally, slash while deallocation is pending + */ + function testFuzz_SlashWhileDeallocationPending( + Randomness r + ) public rand(r) { + // Initialize state + AllocateParams[] memory allocateParams = r.AllocateParams(defaultAVS, 1, 1); + AllocateParams[] memory deallocateParams = r.DeallocateParams(allocateParams); + CreateSetParams[] memory createSetParams = r.CreateSetParams(allocateParams); + RegisterParams memory registerParams = r.RegisterParams(allocateParams); + SlashingParams memory slashingParams = r.SlashingParams(defaultOperator, allocateParams[0]); + + delegationManagerMock.setOperatorShares( + defaultOperator, allocateParams[0].strategies[0], DEFAULT_OPERATOR_SHARES + ); + + cheats.prank(defaultAVS); + allocationManager.createOperatorSets(defaultAVS, createSetParams); + cheats.startPrank(defaultOperator); + allocationManager.registerForOperatorSets(defaultOperator, registerParams); + + // Allocate + allocationManager.modifyAllocations(defaultOperator, allocateParams); + cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + + // Deallocate + allocationManager.modifyAllocations(defaultOperator, deallocateParams); + uint32 deallocationEffectBlock = uint32(block.number + DEALLOCATION_DELAY); + cheats.stopPrank(); + + // Check slashable stake after deallocation (still pending; no change) + _checkSlashableStake({ + operatorSet: allocateParams[0].operatorSet, + operator: defaultOperator, + strategies: allocateParams[0].strategies, + expectedStake: allocateParams[0].newMagnitudes[0] + }); + + // Check slashable stake after deallocation takes effect, before slashing + _checkSlashableStake({ + operatorSet: allocateParams[0].operatorSet, + operator: defaultOperator, + strategies: allocateParams[0].strategies, + expectedStake: deallocateParams[0].newMagnitudes[0], + futureBlock: deallocationEffectBlock + }); + + uint256 magnitudeAllocated = allocateParams[0].newMagnitudes[0]; + uint256 magnitudeDeallocated = magnitudeAllocated - deallocateParams[0].newMagnitudes[0]; + uint256 magnitudeSlashed = magnitudeAllocated.mulWad(slashingParams.wadToSlash); + uint256 expectedCurrentMagnitude = magnitudeAllocated - magnitudeSlashed; + int128 expectedPendingDiff = + -int128(uint128(magnitudeDeallocated - magnitudeDeallocated.mulWadRoundUp(slashingParams.wadToSlash))); + + // Slash + cheats.prank(defaultAVS); + allocationManager.slashOperator(defaultAVS, slashingParams); + + // Check slashable stake after slash + _checkSlashableStake({ + operatorSet: allocateParams[0].operatorSet, + operator: defaultOperator, + strategies: allocateParams[0].strategies, + expectedStake: expectedCurrentMagnitude + }); + + // Check slashable stake after deallocation takes effect + // Add 1 slippage for rounding down slashable stake + _checkSlashableStake({ + operatorSet: allocateParams[0].operatorSet, + operator: defaultOperator, + strategies: allocateParams[0].strategies, + expectedStake: expectedCurrentMagnitude - uint128(-expectedPendingDiff) - 1, + futureBlock: deallocationEffectBlock + }); + + cheats.roll(deallocationEffectBlock); + allocationManager.clearDeallocationQueue(defaultOperator, allocateParams[0].strategies, _maxNumToClear()); + + // Check slashable stake after slash and deallocation + // Add 1 slippage for rounding down slashable stake + _checkSlashableStake({ + operatorSet: allocateParams[0].operatorSet, + operator: defaultOperator, + strategies: allocateParams[0].strategies, + expectedStake: expectedCurrentMagnitude - uint128(-expectedPendingDiff) - 1 }); } } + +contract AllocationManagerUnitTests_getMaxMagnitudesAtBlock is AllocationManagerUnitTests { + + function testFuzz_correctness(Randomness r) rand(r) public { + // Randomly allocate + AllocateParams[] memory allocateParams = _randAllocateParams_DefaultOpSet(); + cheats.prank(defaultOperator); + allocationManager.modifyAllocations(defaultOperator, allocateParams); + cheats.roll(block.number + DEFAULT_OPERATOR_ALLOCATION_DELAY); + + // Slash first time + SlashingParams memory slashParams = SlashingParams({ + operator: defaultOperator, + operatorSetId: defaultOperatorSet.id, + wadToSlash: r.Uint64(0.1 ether, 0.99 ether), + description: "test" + }); + uint32 firstSlashBlock = uint32(block.number); + cheats.prank(defaultAVS); + allocationManager.slashOperator(defaultAVS, slashParams); + uint64 maxMagnitudeAfterFirstSlash = allocationManager.getMaxMagnitude(defaultOperator, strategyMock); + + // Warp to random block + uint32 secondSlashBlock = uint32(block.number + r.Uint32()); + cheats.roll(secondSlashBlock); + + // Slash second time + slashParams.wadToSlash = r.Uint64(0.1 ether, 0.99 ether); + cheats.prank(defaultAVS); + allocationManager.slashOperator(defaultAVS, slashParams); + uint64 maxMagnitudeAfterSecondSlash = allocationManager.getMaxMagnitude(defaultOperator, strategyMock); + + // Warp to a block after the second slash + cheats.roll(block.number + r.Uint32()); + + // Validate get max magnitudes at block + assertEq( + allocationManager.getMaxMagnitudesAtBlock(defaultOperator, defaultStrategies, firstSlashBlock)[0], + maxMagnitudeAfterFirstSlash, + "max magnitude after first slash not correct" + ); + + assertEq( + allocationManager.getMaxMagnitudesAtBlock(defaultOperator, defaultStrategies, secondSlashBlock)[0], + maxMagnitudeAfterSecondSlash, + "max magnitude after second slash not correct" + ); + } +} \ No newline at end of file diff --git a/src/test/unit/DelegationUnit.t.sol b/src/test/unit/DelegationUnit.t.sol index ca0f94980..273ac8513 100644 --- a/src/test/unit/DelegationUnit.t.sol +++ b/src/test/unit/DelegationUnit.t.sol @@ -8,7 +8,11 @@ import "src/contracts/core/DelegationManager.sol"; import "src/contracts/strategies/StrategyBase.sol"; import "src/test/utils/EigenLayerUnitTestSetup.sol"; import "src/contracts/libraries/SlashingLib.sol"; +<<<<<<< HEAD import "src/test/utils/ArrayLib.sol"; +======= +import "src/test/utils/SingleItemArrayLib.sol"; +>>>>>>> b0193bfe (feat: alm tests) // TODO: add upgrade tests for completing withdrawals queued before upgrade in integration tests // TODO: add slashing cases for withdrawing as shares (can also be in integration tests) @@ -21,7 +25,11 @@ import "src/test/utils/ArrayLib.sol"; */ contract DelegationManagerUnitTests is EigenLayerUnitTestSetup, IDelegationManagerEvents, IDelegationManagerErrors { using SlashingLib for *; +<<<<<<< HEAD using ArrayLib for *; +======= + using SingleItemArrayLib for *; +>>>>>>> b0193bfe (feat: alm tests) // Contract under test DelegationManager delegationManager; @@ -681,16 +689,13 @@ contract DelegationManagerUnitTests is EigenLayerUnitTestSetup, IDelegationManag function _undelegate_expectEmit_singleStrat( UndelegateEmitStruct memory params ) internal { + cheats.expectEmit(true, true, true, true, address(delegationManager)); + emit StakerUndelegated(params.staker, params.operator); if (params.forceUndelegated) { cheats.expectEmit(true, true, true, true, address(delegationManager)); emit StakerForceUndelegated(params.staker, params.operator); - } - + } cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerUndelegated(params.staker, params.operator); - - if (address(params.strategy) != address(0)) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); emit OperatorSharesDecreased(params.operator, params.staker, params.strategy, params.operatorSharesDecreased); cheats.expectEmit(true, true, true, true, address(delegationManager)); emit SlashingWithdrawalQueued(params.withdrawalRoot, params.withdrawal, params.operatorSharesDecreased.toArrayU256()); @@ -1152,7 +1157,7 @@ contract DelegationManagerUnitTests_RegisterModifyOperator is DelegationManagerU } contract DelegationManagerUnitTests_delegateTo is DelegationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; using SlashingLib for *; function test_Revert_WhenPaused() public { @@ -2496,7 +2501,7 @@ contract DelegationManagerUnitTests_delegateTo is DelegationManagerUnitTests { } contract DelegationManagerUnitTests_ShareAdjustment is DelegationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; using SlashingLib for *; /// @notice Verifies that `DelegationManager.increaseDelegatedShares` reverts if not called by the StrategyManager nor EigenPodManager @@ -3037,250 +3042,14 @@ contract DelegationManagerUnitTests_ShareAdjustment is DelegationManagerUnitTest } } -contract DelegationManagerUnitTests_Redelegate is DelegationManagerUnitTests { - - ISignatureUtils.SignatureWithExpiry emptySig; - - // @notice Verifies that redelegating is not possible when the "delegation paused" switch is flipped - function testFuzz_Revert_redelegate_delegatePaused(Randomness r) public { - address staker = r.Address(); - address newOperator = r.Address(); - - // register *this contract* as an operator and delegate from the `staker` to them - _registerOperatorWithBaseDetails(defaultOperator); - _registerOperatorWithBaseDetails(newOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - - // set the pausing flag - cheats.prank(pauser); - delegationManager.pause(2 ** PAUSED_NEW_DELEGATION); - - cheats.prank(staker); - cheats.expectRevert(IPausable.CurrentlyPaused.selector); - delegationManager.redelegate(newOperator, emptySig, emptySalt); - } - - // @notice Verifies that redelegating is not possible when the "undelegation paused" switch is flipped - function testFuzz_Revert_redelegate_undelegatePaused(Randomness r) public { - address staker = r.Address(); - address newOperator = r.Address(); - - // register *this contract* as an operator and delegate from the `staker` to them - _registerOperatorWithBaseDetails(defaultOperator); - _registerOperatorWithBaseDetails(newOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - - // set the pausing flag - cheats.prank(pauser); - delegationManager.pause(2 ** PAUSED_ENTER_WITHDRAWAL_QUEUE); - - cheats.prank(staker); - cheats.expectRevert(IPausable.CurrentlyPaused.selector); - delegationManager.redelegate(newOperator, emptySig, emptySalt); - } - - function testFuzz_Revert_redelegate_notDelegated(Randomness r) public { - address undelegatedStaker = r.Address(); - assertFalse(delegationManager.isDelegated(undelegatedStaker), "bad test setup"); - - _registerOperatorWithBaseDetails(defaultOperator); - - cheats.prank(undelegatedStaker); - cheats.expectRevert(NotActivelyDelegated.selector); - delegationManager.redelegate(defaultOperator, emptySig, emptySalt); - } - - // @notice Verifies that an operator cannot undelegate from themself (this should always be forbidden) - function testFuzz_Revert_redelegate_stakerIsOperator(Randomness r) public { - address operator = r.Address(); - _registerOperatorWithBaseDetails(operator); - _registerOperatorWithBaseDetails(defaultOperator); - - cheats.prank(operator); - cheats.expectRevert(OperatorsCannotUndelegate.selector); - delegationManager.redelegate(defaultOperator, emptySig, emptySalt); - } - - /// @notice Verifies that `staker` cannot redelegate to an unregistered `operator` - function testFuzz_Revert_RedelegateToUnregisteredOperator(Randomness r) public { - address staker = r.Address(); - address operator = r.Address(); - assertFalse(delegationManager.isOperator(operator), "incorrect test input?"); - - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - - // try to delegate and check that the call reverts - cheats.prank(staker); - cheats.expectRevert(OperatorNotRegistered.selector); - delegationManager.redelegate(operator, emptySig, emptySalt); - } - - function testFuzz_Revert_Redelegate_ExpiredSignature( - Randomness r - ) public { - // roll to a very late timestamp - skip(type(uint256).max / 2); - - address staker = r.Address(); - address newOperator = r.Address(); - uint expiry = r.Uint256(0, block.timestamp - 1); - bytes32 salt = r.Bytes32(); - - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - - _registerOperatorWithDelegationApprover(newOperator); - - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - newOperator, - salt, - expiry - ); - - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectRevert(ISignatureUtils.SignatureExpired.selector); - delegationManager.redelegate(newOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - } - - function testFuzz_Revert_Redelegate_SpentSalt( - Randomness r - ) public { - address staker = r.Address(); - address newOperator = r.Address(); - uint expiry = r.Uint256(block.timestamp, block.timestamp + 100); - bytes32 salt = r.Bytes32(); - - _registerOperatorWithBaseDetails(defaultOperator); - _registerOperatorWithDelegationApprover(newOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(newOperator), - salt - ), - "salt somehow spent too early?" - ); - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - newOperator, - salt, - expiry - ); - - // Spend salt by delegating normally first - cheats.startPrank(staker); - delegationManager.delegateTo(newOperator, approverSignatureAndExpiry, salt); - assertTrue( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(newOperator), - salt - ), - "salt somehow spent not spent?" - ); - - // redelegate to a different operator - delegationManager.redelegate(defaultOperator, emptySig, emptySalt); - - // Now try to redelegate to the original operator using the invalid signature - cheats.expectRevert(SaltSpent.selector); - delegationManager.redelegate(newOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - } - - /** - * @notice Verifies that the `redelegate` function properly queues a withdrawal for all shares of the staker - * ... and delegates to a new operator - */ - function testFuzz_redelegate_noSlashing(Randomness r) public { - uint256 shares = r.Uint256(1, MAX_STRATEGY_SHARES); - IStrategy[] memory strategyArray = r.StrategyArray(1); - IStrategy strategy = strategyArray[0]; - - // Set the staker deposits in the strategies - strategyManagerMock.addDeposit(defaultStaker, strategy, shares); - - // register *this contract* as an operator and delegate from the `staker` to them - address newOperator = r.Address(); - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(defaultStaker, defaultOperator); - _registerOperatorWithBaseDetails(newOperator); - - // Format queued withdrawal - ( - , - Withdrawal memory withdrawal, - bytes32 withdrawalRoot - ) = _setUpQueueWithdrawalsSingleStrat({ - staker: defaultStaker, - withdrawer: defaultStaker, - strategy: strategy, - depositSharesToWithdraw: shares - }); - - // Redelegate the staker - _undelegate_expectEmit_singleStrat( - UndelegateEmitStruct({ - staker: defaultStaker, - operator: defaultOperator, - strategy: strategy, - depositSharesQueued: shares, - operatorSharesDecreased: shares, - withdrawal: withdrawal, - withdrawalRoot: withdrawalRoot, - depositScalingFactor: WAD, - forceUndelegated: false - }) - ); - _delegateTo_expectEmit_singleStrat( - DelegateToSingleStratEmitStruct({ - staker: defaultStaker, - operator: newOperator, - strategy: strategyMock, - depositShares: 0, - depositScalingFactor: WAD - }) - ); - cheats.prank(defaultStaker); - delegationManager.redelegate(newOperator, emptySig, emptySalt); - - // Checks - delegation status - assertEq( - delegationManager.delegatedTo(defaultStaker), - newOperator, - "undelegated staker should be delegated to new operator" - ); - assertTrue(delegationManager.isDelegated(defaultStaker), "staker should still be delegated"); - - // Checks - operator & staker shares - assertEq(delegationManager.operatorShares(defaultOperator, strategyMock), 0, "operator shares not decreased correctly"); - assertEq(delegationManager.operatorShares(newOperator, strategyMock), 0, "operator shares should not have been added"); - (uint256[] memory stakerWithdrawableShares, ) = delegationManager.getWithdrawableShares(defaultStaker, strategyArray); - assertEq(stakerWithdrawableShares[0], 0, "staker withdrawable shares not calculated correctly"); - } -} - contract DelegationManagerUnitTests_Undelegate is DelegationManagerUnitTests { using SlashingLib for uint256; - using ArrayLib for *; + using SingleItemArrayLib for *; using Math for uint256; // @notice Verifies that undelegating is not possible when the "undelegation paused" switch is flipped function testFuzz_Revert_undelegate_paused(Randomness r) public { address staker = r.Address(); - - // register *this contract* as an operator and delegate from the `staker` to them - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - // set the pausing flag cheats.prank(pauser); delegationManager.pause(2 ** PAUSED_ENTER_WITHDRAWAL_QUEUE); @@ -3434,12 +3203,11 @@ contract DelegationManagerUnitTests_Undelegate is DelegationManagerUnitTests { assertFalse(delegationManager.isDelegated(staker), "staker not undelegated"); } - function testFuzz_undelegate_UAM(Randomness r) public rand(r) { - address staker = r.Address(); - bytes32 salt = r.Bytes32(); + function testFuzz_undelegate_UAM(address staker, bytes32 salt) public { _registerOperatorWithBaseDetails(defaultOperator); _delegateToOperatorWhoRequiresSig(staker, defaultOperator, salt); + // Set delegate cheats.prank(defaultOperator); permissionController.setAppointee( defaultOperator, @@ -4085,7 +3853,7 @@ contract DelegationManagerUnitTests_Undelegate is DelegationManagerUnitTests { contract DelegationManagerUnitTests_queueWithdrawals is DelegationManagerUnitTests { using SlashingLib for *; - using ArrayLib for *; + using SingleItemArrayLib for *; function test_Revert_WhenEnterQueueWithdrawalsPaused() public { cheats.prank(pauser); @@ -4783,7 +4551,7 @@ contract DelegationManagerUnitTests_queueWithdrawals is DelegationManagerUnitTes } contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; using SlashingLib for *; using Math for uint256; @@ -5399,7 +5167,7 @@ contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManage } contract DelegationManagerUnitTests_burningShares is DelegationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; /** * @notice Test burning shares for an operator with no queued withdrawals @@ -6461,7 +6229,7 @@ contract DelegationManagerUnitTests_SharesUnderflowChecks is DelegationManagerUn */ contract DelegationManagerUnitTests_Lifecycle is DelegationManagerUnitTests { - using ArrayLib for *; + using SingleItemArrayLib for *; // 2. RegisterOperator, Deposit, Delegate, Queue, Complete function test_register_operator_deposit_delegate_queue_complete(Randomness r) public rand(r) { diff --git a/src/test/unit/RewardsCoordinatorUnit.t.sol b/src/test/unit/RewardsCoordinatorUnit.t.sol index b01410426..55f4f001f 100644 --- a/src/test/unit/RewardsCoordinatorUnit.t.sol +++ b/src/test/unit/RewardsCoordinatorUnit.t.sol @@ -2710,8 +2710,8 @@ contract RewardsCoordinatorUnitTests_processClaim is RewardsCoordinatorUnitTests } // Parse all 3 claim proofs for distributionRoots 0,1,2 respectively - IRewardsCoordinator.RewardsMerkleClaim[] memory claims = _parseAllProofs(); - IRewardsCoordinator.RewardsMerkleClaim memory claim = claims[2]; + IRewardsCoordinatorTypes.RewardsMerkleClaim[] memory claims = _parseAllProofs(); + IRewardsCoordinatorTypes.RewardsMerkleClaim memory claim = claims[2]; uint32 rootIndex = claim.rootIndex; IRewardsCoordinator.DistributionRoot memory distributionRoot = rewardsCoordinator.getDistributionRootAtIndex( diff --git a/src/test/unit/StrategyManagerUnit.t.sol b/src/test/unit/StrategyManagerUnit.t.sol index db0a1cb77..84467aead 100644 --- a/src/test/unit/StrategyManagerUnit.t.sol +++ b/src/test/unit/StrategyManagerUnit.t.sol @@ -110,11 +110,8 @@ contract StrategyManagerUnitTests is EigenLayerUnitTestSetup, IStrategyManagerEv token.transfer(staker, amount); - uint256 depositSharesBefore = strategyManager.stakerDepositShares(staker, strategy); uint256 stakerStrategyListLengthBefore = strategyManager.stakerStrategyListLength(staker); - // needed for expecting an event with the right parameters - uint256 expectedDepositShares = amount; cheats.startPrank(staker); token.approve(address(strategyManager), amount); @@ -122,12 +119,9 @@ contract StrategyManagerUnitTests is EigenLayerUnitTestSetup, IStrategyManagerEv cheats.expectEmit(true, true, true, true, address(strategyManager)); emit Deposit(staker, token, strategy, expectedDepositShares); uint256 shares = strategyManager.depositIntoStrategy(strategy, token, amount); - cheats.stopPrank(); uint256 depositSharesAfter = strategyManager.stakerDepositShares(staker, strategy); - uint256 stakerStrategyListLengthAfter = strategyManager.stakerStrategyListLength(staker); - assertEq(depositSharesAfter, depositSharesBefore + shares, "depositSharesAfter != depositSharesBefore + shares"); if (depositSharesBefore == 0) { assertEq( @@ -1495,7 +1489,6 @@ contract StrategyManagerUnitTests_burnShares is StrategyManagerUnitTests { strategyManager.burnShares(strategy, sharesToBurn); uint256 strategyBalanceAfter = token.balanceOf(address(strategy)); uint256 burnAddressBalanceAfter = token.balanceOf(strategyManager.DEFAULT_BURN_ADDRESS()); - console.log(strategyBalanceAfter); console.log(strategyBalanceBefore); console.log(strategyBalanceBefore - sharesToBurn); @@ -1538,13 +1531,6 @@ contract StrategyManagerUnitTests_burnShares is StrategyManagerUnitTests { assertEq(burnAddressBalanceBefore, burnAddressBalanceAfter, "burnAddressBalanceBefore != burnAddressBalanceAfter"); assertEq(strategyBalanceBefore, strategyBalanceAfter, "strategyBalanceBefore != strategyBalanceAfter"); - } -} - -contract StrategyManagerUnitTests_setStrategyWhitelister is StrategyManagerUnitTests { - function testFuzz_SetStrategyWhitelister( - address newWhitelister - ) external filterFuzzedAddressInputs(newWhitelister) { address previousStrategyWhitelister = strategyManager.strategyWhitelister(); cheats.expectEmit(true, true, true, true, address(strategyManager)); emit StrategyWhitelisterChanged(previousStrategyWhitelister, newWhitelister); diff --git a/src/test/utils/EigenLayerUnitTestSetup.sol b/src/test/utils/EigenLayerUnitTestSetup.sol index a8ac0e187..15c3941ae 100644 --- a/src/test/utils/EigenLayerUnitTestSetup.sol +++ b/src/test/utils/EigenLayerUnitTestSetup.sol @@ -18,13 +18,13 @@ import "src/test/mocks/DelegationManagerMock.sol"; import "src/test/mocks/EigenPodManagerMock.sol"; import "src/test/mocks/EmptyContract.sol"; -import "src/test/utils/ArrayLib.sol"; +import "src/test/utils/SingleItemArrayLib.sol"; import "src/test/utils/Random.sol"; -import "src/test/utils/ArrayLib.sol"; +import "src/test/utils/SingleItemArrayLib.sol"; abstract contract EigenLayerUnitTestSetup is Test { - using ArrayLib for *; + using SingleItemArrayLib for *; uint256 internal constant MAX_PRIVATE_KEY = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140; diff --git a/src/test/utils/SingleItemArrayLib.sol b/src/test/utils/SingleItemArrayLib.sol new file mode 100644 index 000000000..b0da93810 --- /dev/null +++ b/src/test/utils/SingleItemArrayLib.sol @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.27; + +import "src/contracts/interfaces/IAllocationManager.sol"; + +/// @dev Helper library for simplifying the syntax for creating single item arrays for inputs. +library SingleItemArrayLib { + /// ----------------------------------------------------------------------- + /// Native Types + /// ----------------------------------------------------------------------- + + function toArrayU16( + uint16 x + ) internal pure returns (uint16[] memory array) { + array = new uint16[](1); + array[0] = x; + } + + function toArrayU32( + uint32 x + ) internal pure returns (uint32[] memory array) { + array = new uint32[](1); + array[0] = x; + } + + function toArrayU64( + uint64 x + ) internal pure returns (uint64[] memory array) { + array = new uint64[](1); + array[0] = x; + } + + function toArrayU256( + uint256 x + ) internal pure returns (uint256[] memory array) { + array = new uint256[](1); + array[0] = x; + } + + + function toArrayU16( + uint16 x, + uint256 len + ) internal pure returns (uint16[] memory array) { + array = new uint16[](len); + for (uint256 i; i < len; ++i) { + array[i] = x; + } + } + + function toArrayU32( + uint32 x, + uint256 len + ) internal pure returns (uint32[] memory array) { + array = new uint32[](len); + for (uint256 i; i < len; ++i) { + array[i] = x; + } + } + + function toArrayU64( + uint64 x, + uint256 len + ) internal pure returns (uint64[] memory array) { + array = new uint64[](len); + for (uint256 i; i < len; ++i) { + array[i] = x; + } + } + + function toArrayU256( + uint256 x, + uint256 len + ) internal pure returns (uint256[] memory array) { + array = new uint256[](len); + for (uint256 i; i < len; ++i) { + array[i] = x; + } + } + + function toArray( + address x + ) internal pure returns (address[] memory array) { + array = new address[](1); + array[0] = x; + } + + /// ----------------------------------------------------------------------- + /// EigenLayer Types + /// ----------------------------------------------------------------------- + + function toArray( + IERC20 token + ) internal pure returns (IERC20[] memory array) { + array = new IERC20[](1); + array[0] = token; + } + + function toArray( + IStrategy strategy + ) internal pure returns (IStrategy[] memory array) { + array = new IStrategy[](1); + array[0] = strategy; + } + + function toArray( + OperatorSet memory operatorSet + ) internal pure returns (OperatorSet[] memory array) { + array = new OperatorSet[](1); + array[0] = operatorSet; + } + + function toArray( + IAllocationManagerTypes.CreateSetParams memory createSetParams + ) internal pure returns (IAllocationManagerTypes.CreateSetParams[] memory array) { + array = new IAllocationManagerTypes.CreateSetParams[](1); + array[0] = createSetParams; + } + + function toArray( + IAllocationManagerTypes.AllocateParams memory allocateParams + ) internal pure returns (IAllocationManagerTypes.AllocateParams[] memory array) { + array = new IAllocationManagerTypes.AllocateParams[](1); + array[0] = allocateParams; + } +} \ No newline at end of file