diff --git a/.gitignore b/.gitignore index c8e5b6075..3d761d162 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,7 @@ InheritanceGraph.png surya_report.md .idea + +*state.json +deployed_strategies.json +populate_src* \ No newline at end of file diff --git a/pkg/bindings/AVSDirectory/binding.go b/pkg/bindings/AVSDirectory/binding.go index e91d51eb1..69917ce38 100644 --- a/pkg/bindings/AVSDirectory/binding.go +++ b/pkg/bindings/AVSDirectory/binding.go @@ -29,6 +29,19 @@ var ( _ = abi.ConvertType ) +// IAVSDirectoryMagnitudeAdjustment is an auto generated low-level Go binding around an user-defined struct. +type IAVSDirectoryMagnitudeAdjustment struct { + Strategy common.Address + OperatorSets []IAVSDirectoryOperatorSet + MagnitudeDiffs []uint64 +} + +// IAVSDirectoryOperatorSet is an auto generated low-level Go binding around an user-defined struct. +type IAVSDirectoryOperatorSet struct { + Avs common.Address + OperatorSetId uint32 +} + // ISignatureUtilsSignatureWithSaltAndExpiry is an auto generated low-level Go binding around an user-defined struct. type ISignatureUtilsSignatureWithSaltAndExpiry struct { Signature []byte @@ -38,8 +51,8 @@ type ISignatureUtilsSignatureWithSaltAndExpiry struct { // AVSDirectoryMetaData contains all meta data concerning the AVSDirectory contract. var AVSDirectoryMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_delegation\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"DOMAIN_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_AVS_REGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"avsOperatorStatus\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorAVSRegistrationDigestHash\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"cancelSalt\",\"inputs\":[{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deregisterOperatorFromAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"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\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorSaltIsSpent\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"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\":\"registerOperatorToAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"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\":\"updateAVSMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSMetadataURIUpdated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAVSRegistrationStatusUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"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}]", - Bin: "0x60c06040523480156200001157600080fd5b5060405162001f7838038062001f78833981016040819052620000349162000118565b6001600160a01b0381166080526200004b62000056565b504660a0526200014a565b600054610100900460ff1615620000c35760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000116576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012b57600080fd5b81516001600160a01b03811681146200014357600080fd5b9392505050565b60805160a051611e01620001776000396000610ea801526000818161032401526109830152611e016000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80638da5cb5b116100b8578063d79aceab1161007c578063d79aceab146102f8578063df5cf7231461031f578063ec76f44214610346578063f2fde38b14610359578063f698da251461036c578063fabc1cbc1461037457600080fd5b80638da5cb5b1461029b5780639926ee7d146102ac578063a1060c88146102bf578063a364f4da146102d2578063a98fb355146102e557600080fd5b806349075da31161010a57806349075da3146101fa578063595c6a67146102355780635ac86ab71461023d5780635c975abb14610260578063715018a614610268578063886f11951461027057600080fd5b806310d67a2f14610147578063136439dd1461015c5780631794bb3c1461016f57806320606b7014610182578063374823b5146101bc575b600080fd5b61015a6101553660046118ab565b610387565b005b61015a61016a3660046118cf565b610443565b61015a61017d3660046118e8565b610582565b6101a97f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6040519081526020015b60405180910390f35b6101ea6101ca366004611929565b609960209081526000928352604080842090915290825290205460ff1681565b60405190151581526020016101b3565b610228610208366004611955565b609860209081526000928352604080842090915290825290205460ff1681565b6040516101b391906119a4565b61015a6106ac565b6101ea61024b3660046119cc565b606654600160ff9092169190911b9081161490565b6066546101a9565b61015a610773565b606554610283906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b6033546001600160a01b0316610283565b61015a6102ba366004611a5f565b610787565b6101a96102cd366004611b46565b610b1a565b61015a6102e03660046118ab565b610bd3565b61015a6102f3366004611b8c565b610d3c565b6101a97fda2c89bafdd34776a2b8bb9c83c82f419e20cc8c67207f70edd58249b92661bd81565b6102837f000000000000000000000000000000000000000000000000000000000000000081565b61015a6103543660046118cf565b610d83565b61015a6103673660046118ab565b610e2e565b6101a9610ea4565b61015a6103823660046118cf565b610ee2565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fe9190611bfe565b6001600160a01b0316336001600160a01b0316146104375760405162461bcd60e51b815260040161042e90611c1b565b60405180910390fd5b6104408161103e565b50565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa15801561048b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104af9190611c65565b6104cb5760405162461bcd60e51b815260040161042e90611c87565b606654818116146105445760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c6974790000000000000000606482015260840161042e565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600054610100900460ff16158080156105a25750600054600160ff909116105b806105bc5750303b1580156105bc575060005460ff166001145b61061f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161042e565b6000805460ff191660011790558015610642576000805461ff0019166101001790555b61064c8383611135565b61065461121f565b609755610660846112b6565b80156106a6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156106f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107189190611c65565b6107345760405162461bcd60e51b815260040161042e90611c87565b600019606681905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b61077b611308565b61078560006112b6565b565b606654600090600190811614156107dc5760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b604482015260640161042e565b42826040015110156108445760405162461bcd60e51b815260206004820152603e6024820152600080516020611dac83398151915260448201527f56533a206f70657261746f72207369676e617475726520657870697265640000606482015260840161042e565b60013360009081526098602090815260408083206001600160a01b038816845290915290205460ff16600181111561087e5761087e61198e565b14156108e05760405162461bcd60e51b815260206004820152603f6024820152600080516020611dac83398151915260448201527f56533a206f70657261746f7220616c7265616479207265676973746572656400606482015260840161042e565b6001600160a01b038316600090815260996020908152604080832085830151845290915290205460ff16156109645760405162461bcd60e51b81526020600482015260366024820152600080516020611dac8339815191526044820152751594ce881cd85b1d08185b1c9958591e481cdc195b9d60521b606482015260840161042e565b6040516336b87bd760e11b81526001600160a01b0384811660048301527f00000000000000000000000000000000000000000000000000000000000000001690636d70f7ae90602401602060405180830381865afa1580156109ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ee9190611c65565b610a645760405162461bcd60e51b815260206004820152604d6024820152600080516020611dac83398151915260448201527f56533a206f70657261746f72206e6f74207265676973746572656420746f204560648201526c1a59d95b93185e595c881e595d609a1b608482015260a40161042e565b6000610a7a843385602001518660400151610b1a565b9050610a8b84828560000151611362565b3360008181526098602090815260408083206001600160a01b0389168085529083528184208054600160ff199182168117909255609985528386208a860151875290945293829020805490931684179092555190917ff0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b4191610b0c91906119a4565b60405180910390a350505050565b604080517fda2c89bafdd34776a2b8bb9c83c82f419e20cc8c67207f70edd58249b92661bd6020808301919091526001600160a01b0387811683850152861660608301526080820185905260a08083018590528351808403909101815260c0909201909252805191012060009081610b90610ea4565b60405161190160f01b602082015260228101919091526042810183905260620160408051808303601f190181529190528051602090910120979650505050505050565b60665460009060019081161415610c285760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b604482015260640161042e565b60013360009081526098602090815260408083206001600160a01b038716845290915290205460ff166001811115610c6257610c6261198e565b14610cd55760405162461bcd60e51b815260206004820152603f60248201527f4156534469726563746f72792e646572656769737465724f70657261746f724660448201527f726f6d4156533a206f70657261746f72206e6f74207265676973746572656400606482015260840161042e565b3360008181526098602090815260408083206001600160a01b0387168085529252808320805460ff191690555190917ff0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b4191610d3091906119a4565b60405180910390a35050565b336001600160a01b03167fa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c9437138383604051610d77929190611ccf565b60405180910390a25050565b33600090815260996020908152604080832084845290915290205460ff1615610e085760405162461bcd60e51b815260206004820152603160248201527f4156534469726563746f72792e63616e63656c53616c743a2063616e6e6f742060448201527018d85b98d95b081cdc195b9d081cd85b1d607a1b606482015260840161042e565b33600090815260996020908152604080832093835292905220805460ff19166001179055565b610e36611308565b6001600160a01b038116610e9b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161042e565b610440816112b6565b60007f0000000000000000000000000000000000000000000000000000000000000000461415610ed5575060975490565b610edd61121f565b905090565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f599190611bfe565b6001600160a01b0316336001600160a01b031614610f895760405162461bcd60e51b815260040161042e90611c1b565b6066541981196066541916146110075760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c6974790000000000000000606482015260840161042e565b606681905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610577565b6001600160a01b0381166110cc5760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a40161042e565b606554604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b6065546001600160a01b031615801561115657506001600160a01b03821615155b6111d85760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a40161042e565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a261121b8261103e565b5050565b604080518082018252600a81526922b4b3b2b72630bcb2b960b11b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea81840152466060820152306080808301919091528351808303909101815260a0909101909252815191012090565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6033546001600160a01b031633146107855760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161042e565b6001600160a01b0383163b1561148157604051630b135d3f60e11b808252906001600160a01b03851690631626ba7e906113a29086908690600401611cfe565b602060405180830381865afa1580156113bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e39190611d5b565b6001600160e01b0319161461147c5760405162461bcd60e51b815260206004820152605360248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a2045524331323731207369676e6174757265206064820152721d995c9a599a58d85d1a5bdb8819985a5b1959606a1b608482015260a40161042e565b505050565b826001600160a01b03166114958383611521565b6001600160a01b03161461147c5760405162461bcd60e51b815260206004820152604760248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a207369676e6174757265206e6f742066726f6d6064820152661039b4b3b732b960c91b608482015260a40161042e565b60008060006115308585611545565b9150915061153d816115b5565b509392505050565b60008082516041141561157c5760208301516040840151606085015160001a61157087828585611770565b945094505050506115ae565b8251604014156115a6576020830151604084015161159b86838361185d565b9350935050506115ae565b506000905060025b9250929050565b60008160048111156115c9576115c961198e565b14156115d25750565b60018160048111156115e6576115e661198e565b14156116345760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161042e565b60028160048111156116485761164861198e565b14156116965760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161042e565b60038160048111156116aa576116aa61198e565b14156117035760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161042e565b60048160048111156117175761171761198e565b14156104405760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161042e565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156117a75750600090506003611854565b8460ff16601b141580156117bf57508460ff16601c14155b156117d05750600090506004611854565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611824573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661184d57600060019250925050611854565b9150600090505b94509492505050565b6000806001600160ff1b0383168161187a60ff86901c601b611d85565b905061188887828885611770565b935093505050935093915050565b6001600160a01b038116811461044057600080fd5b6000602082840312156118bd57600080fd5b81356118c881611896565b9392505050565b6000602082840312156118e157600080fd5b5035919050565b6000806000606084860312156118fd57600080fd5b833561190881611896565b9250602084013561191881611896565b929592945050506040919091013590565b6000806040838503121561193c57600080fd5b823561194781611896565b946020939093013593505050565b6000806040838503121561196857600080fd5b823561197381611896565b9150602083013561198381611896565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600283106119c657634e487b7160e01b600052602160045260246000fd5b91905290565b6000602082840312156119de57600080fd5b813560ff811681146118c857600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715611a2857611a286119ef565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611a5757611a576119ef565b604052919050565b60008060408385031215611a7257600080fd5b8235611a7d81611896565b915060208381013567ffffffffffffffff80821115611a9b57600080fd5b9085019060608288031215611aaf57600080fd5b611ab7611a05565b823582811115611ac657600080fd5b8301601f81018913611ad757600080fd5b803583811115611ae957611ae96119ef565b611afb601f8201601f19168701611a2e565b93508084528986828401011115611b1157600080fd5b808683018786013760008682860101525050818152838301358482015260408301356040820152809450505050509250929050565b60008060008060808587031215611b5c57600080fd5b8435611b6781611896565b93506020850135611b7781611896565b93969395505050506040820135916060013590565b60008060208385031215611b9f57600080fd5b823567ffffffffffffffff80821115611bb757600080fd5b818501915085601f830112611bcb57600080fd5b813581811115611bda57600080fd5b866020828501011115611bec57600080fd5b60209290920196919550909350505050565b600060208284031215611c1057600080fd5b81516118c881611896565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b600060208284031215611c7757600080fd5b815180151581146118c857600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b82815260006020604081840152835180604085015260005b81811015611d3257858101830151858201606001528201611d16565b81811115611d44576000606083870101525b50601f01601f191692909201606001949350505050565b600060208284031215611d6d57600080fd5b81516001600160e01b0319811681146118c857600080fd5b60008219821115611da657634e487b7160e01b600052601160045260246000fd5b50019056fe4156534469726563746f72792e72656769737465724f70657261746f72546f41a26469706673582212203078326ec29ef6e4c0629c3db8b9232b52ccd0d073d4926089bdbc0d9eef3c0f64736f6c634300080c0033", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_delegation\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ALLOCATION_DELAY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DOMAIN_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAGNITUDE_ADJUSTMENT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_PENDING_UPDATES\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_AVS_REGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_SET_REGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"allocate\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"allocations\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.MagnitudeAdjustment[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudeDiffs\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}]},{\"name\":\"allocatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"allocatorSaltIsSpent\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"avsOperatorStatus\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"becomeOperatorSetAVS\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"calculateMagnitudeAdjustmentDigestHash\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"adjustments\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.MagnitudeAdjustment[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudeDiffs\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}]},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorAVSRegistrationDigestHash\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorSetForceDeregistrationTypehash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorSetRegistrationDigestHash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"cancelSalt\",\"inputs\":[{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createOperatorSets\",\"inputs\":[{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deallocate\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"deallocations\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.MagnitudeAdjustment[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudeDiffs\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}]},{\"name\":\"allocatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deregisterOperatorFromOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"forceDeregisterFromOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"freeMagnitude\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSlashableBips\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"inTotalOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isMember\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorSet\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorSetAVS\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorSlashable\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"migrateOperatorsToOperatorSets\",\"inputs\":[{\"name\":\"operators\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[][]\",\"internalType\":\"uint32[][]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorSaltIsSpent\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSetMemberCount\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSetStatus\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"registered\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"lastDeregisteredTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSetsMemberOf\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"start\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSetsMemberOf\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"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\":\"registerOperatorToOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"slashOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"bipsToSlash\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"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\":\"updateAVSMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateFreeMagnitude\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"numToComplete\",\"type\":\"uint8[]\",\"internalType\":\"uint8[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSMetadataURIUpdated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AVSMigratedToOperatorSets\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MagnitudeAllocated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudeToAllocate\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"effectTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MagnitudeDeallocationCompleted\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"freeMagnitudeAdded\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MagnitudeQueueDeallocated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudeToDeallocate\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"completableTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAVSRegistrationStatusUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAddedToOperatorSet\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorMigratedToOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"indexed\":false,\"internalType\":\"uint32[]\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRemovedFromOperatorSet\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetCreated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSlashed\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"bipsToSlash\",\"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\":\"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}]", + Bin: "0x60c06040523480156200001157600080fd5b50604051620062d8380380620062d8833981016040819052620000349162000118565b6001600160a01b0381166080526200004b62000056565b504660a0526200014a565b600054610100900460ff1615620000c35760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000116576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012b57600080fd5b81516001600160a01b03811681146200014357600080fd5b9392505050565b60805160a05161615362000185600039600061295f0152600081816107fd01528181610e4e015281816111d8015261163701526161536000f3fe608060405234801561001057600080fd5b50600436106102d65760003560e01c80638522fcb111610182578063c1a8e2c5116100e9578063dce974b9116100a2578063ef2dfa8d1161007c578063ef2dfa8d14610853578063f2fde38b14610866578063f698da2514610879578063fabc1cbc1461088157600080fd5b8063dce974b9146107d1578063df5cf723146107f8578063ec76f4421461081f57600080fd5b8063c1a8e2c51461071f578063c825fe6814610732578063cbdf0e4214610759578063d79aceab1461076c578063da2ff05d14610793578063dae226b6146107a657600080fd5b8063a98fb3551161013b578063a98fb355146106c3578063aec205c5146106d6578063afe02ed5146106de578063b2841d48146106f1578063b3e52eaa14610704578063bd74a06c1461070c57600080fd5b80638522fcb11461062e578063886f1195146106415780638da5cb5b1461066c5780638de549441461067d578063955e66961461069d578063a1060c88146106b057600080fd5b806346fb3a00116102415780636fbb031c116101fa5780637673e93a116101d45780637673e93a146105a35780637b205de3146105c657806384b78fc2146105ed57806384d76f7b1461060057600080fd5b80636fbb031c146105695780637019670814610588578063715018a61461059b57600080fd5b806346fb3a001461048157806349075da3146104af578063595c6a67146104ea5780635ac86ab7146104f25780635c975abb146105155780635fd6abfd1461051d57600080fd5b80631e68134e116102935780631e68134e1461037557806320606b70146103d257806333429a6a146104075780633367a33c1461042d578063374823b5146104405780633fee332d1461046e57600080fd5b80630d5387c5146102db57806310d67a2f146103045780631352c3e614610319578063136439dd1461033c5780631794bb3c1461034f5780631e2199e214610362575b600080fd5b6102ee6102e9366004614fe1565b610894565b6040516102fb9190615016565b60405180910390f35b61031761031236600461507c565b6109d9565b005b61032c610327366004615120565b610a95565b60405190151581526020016102fb565b61031761034a3660046151a5565b610b25565b61031761035d3660046151be565b610c64565b6103176103703660046152f5565b610d8e565b6103b6610383366004615370565b609e60209081526000938452604080852082529284528284209052825290205460ff811690610100900463ffffffff1682565b60408051921515835263ffffffff9091166020830152016102fb565b6103f97f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6040519081526020016102fb565b61041a6104153660046153b7565b6110ae565b60405161ffff90911681526020016102fb565b61031761043b36600461541b565b6111b6565b61032c61044e36600461549b565b609960209081526000928352604080842090915290825290205460ff1681565b61031761047c3660046154c7565b611304565b61032c61048f36600461549b565b60a560209081526000928352604080842090915290825290205460ff1681565b6104dd6104bd366004615555565b609860209081526000928352604080842090915290825290205460ff1681565b6040516102fb91906155a4565b61031761154e565b61032c6105003660046155cc565b606654600160ff9092169190911b9081161490565b6066546103f9565b61055161052b366004615555565b60a16020908152600092835260408084209091529082529020546001600160401b031681565b6040516001600160401b0390911681526020016102fb565b610573621baf8081565b60405163ffffffff90911681526020016102fb565b61031761059636600461541b565b611615565b610317611733565b61032c6105b136600461507c565b609a6020526000908152604090205460ff1681565b6103f97fb3cc2868468e0461dcbecef0a4fcb7a8ef26c2e1f3e59c9d0de6afcc74448a2481565b6103176105fb3660046155ef565b611747565b61032c61060e366004615671565b609b60209081526000928352604080842090915290825290205460ff1681565b6103f961063c3660046156a6565b6117b9565b606554610654906001600160a01b031681565b6040516001600160a01b0390911681526020016102fb565b6033546001600160a01b0316610654565b61069061068b36600461549b565b61181e565b6040516102fb919061570c565b6103f96106ab3660046156a6565b61185f565b6103f96106be366004615732565b61189f565b6103176106d1366004615778565b611909565b610317611950565b6103176106ec3660046157e9565b611a18565b6103f96106ff3660046156a6565b611be5565b6103f9600181565b61031761071a36600461582a565b611c25565b61031761072d3660046158ab565b612158565b6103f97f809c5ac049c45b7a7f050a20f00c16cf63797efbf8b1eb8d749fdfa39ff8f92981565b6103f961076736600461507c565b61218d565b6103f97fda2c89bafdd34776a2b8bb9c83c82f419e20cc8c67207f70edd58249b92661bd81565b61032c6107a1366004615120565b6121ae565b6103f96107b4366004615671565b609c60209081526000928352604080842090915290825290205481565b6103f97f4ee65f64218c67b68da66fd0db16560040a6b973290b9e71912d661ee53fe49581565b6106547f000000000000000000000000000000000000000000000000000000000000000081565b61031761082d3660046151a5565b33600090815260996020908152604080832093835292905220805460ff19166001179055565b6103176108613660046158ff565b6121da565b61031761087436600461507c565b612583565b6103f96125f9565b61031761088f3660046151a5565b612608565b6001600160a01b0383166000908152609d602052604081206060919084906108bb90612764565b6108c59190615980565b9050808311156108d3578092505b826001600160401b038111156108eb576108eb615099565b60405190808252806020026020018201604052801561093057816020015b60408051808201909152600080825260208201528152602001906001900390816109095790505b50915060005b838110156109d0576109a261096c61094e8388615997565b6001600160a01b0389166000908152609d602052604090209061276e565b60408051808201909152600080825260208201525060408051808201909152606082901c815263ffffffff909116602082015290565b8382815181106109b4576109b46159af565b6020026020010181905250806109c9906159c5565b9050610936565b50509392505050565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5091906159e0565b6001600160a01b0316336001600160a01b031614610a895760405162461bcd60e51b8152600401610a80906159fd565b60405180910390fd5b610a928161277a565b50565b80516001600160a01b039081166000908152609e6020908152604080832093861683529281528282208185015163ffffffff908116845290825283832084518086019095525460ff8116151585526101009004169083015290610af884846121ae565b80610b1b575042621baf808260200151610b129190615a47565b63ffffffff1610155b9150505b92915050565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610b6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b919190615a6f565b610bad5760405162461bcd60e51b8152600401610a8090615a91565b60665481811614610c265760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610a80565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600054610100900460ff1615808015610c845750600054600160ff909116105b80610c9e5750303b158015610c9e575060005460ff166001145b610d015760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a80565b6000805460ff191660011790558015610d24576000805461ff0019166101001790555b610d2e8383612871565b610d3661295b565b609755610d4284612a24565b8015610d88576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60665460019060029081161415610db75760405162461bcd60e51b8152600401610a8090615ad9565b4282604001511015610e2f5760405162461bcd60e51b815260206004820152604760248201526000805160206160fe83398151915260448201527f70657261746f72536574733a206f70657261746f72207369676e617475726520606482015266195e1c1a5c995960ca1b608482015260a401610a80565b6040516336b87bd760e11b81526001600160a01b0386811660048301527f00000000000000000000000000000000000000000000000000000000000000001690636d70f7ae90602401602060405180830381865afa158015610e95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb99190615a6f565b610f385760405162461bcd60e51b815260206004820152605660248201526000805160206160fe83398151915260448201527f70657261746f72536574733a206f70657261746f72206e6f7420726567697374606482015275195c9959081d1bc8115a59d95b93185e595c881e595d60521b608482015260a401610a80565b336000908152609a602052604090205460ff16610fbf5760405162461bcd60e51b815260206004820152604b60248201526000805160206160fe83398151915260448201527f70657261746f72536574733a20415653206973206e6f7420616e206f7065726160648201526a746f72207365742041565360a81b608482015260a401610a80565b6001600160a01b038516600090815260996020908152604080832085830151845290915290205460ff161561104a5760405162461bcd60e51b815260206004820152603f60248201526000805160206160fe83398151915260448201527f70657261746f72536574733a2073616c7420616c7265616479207370656e74006064820152608401610a80565b61106a856110633387878760200151886040015161185f565b8451612a76565b6001600160a01b03851660009081526099602090815260408083208583015184529091529020805460ff191660011790556110a785338686612c30565b5050505050565b6001600160a01b038085166000908152609f60209081526040808320938616835292905290812081906110e19084612fff565b6001600160a01b03808816600090815260a06020908152604080832093891683529281529181209293509161117e918691908490611121908b018b61507c565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008960200160208101906111569190615b10565b63ffffffff1663ffffffff168152602001908152602001600020612fff90919063ffffffff16565b9050816001600160401b0316612710826001600160401b03166111a19190615b2b565b6111ab9190615b60565b979650505050505050565b6040516369066d9160e01b81526001600160a01b0385811660048301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906369066d9190602401602060405180830381865afa158015611221573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124591906159e0565b9050336001600160a01b03821614611264576112648186868686613057565b6000611273621baf8042615a47565b905060005b848110156112fb576112bd87878784818110611296576112966159af565b90506020028101906112a89190615b82565b6112b690602081019061507c565b600061320b565b6112eb878787848181106112d3576112d36159af565b90506020028101906112e59190615b82565b846133b2565b6112f4816159c5565b9050611278565b50505050505050565b6066546001906002908116141561132d5760405162461bcd60e51b8152600401610a8090615ad9565b8151516113c557336001600160a01b038716146113c05760405162461bcd60e51b815260206004820152604560248201527f4156534469726563746f72792e666f7263654465726567697374657246726f6d60448201527f4f70657261746f72536574733a2063616c6c6572206d757374206265206f70656064820152643930ba37b960d91b608482015260a401610a80565b61153a565b42826040015110156114505760405162461bcd60e51b815260206004820152604860248201527f4156534469726563746f72792e666f7263654465726567697374657246726f6d60448201527f4f70657261746f72536574733a206f70657261746f72207369676e617475726560648201526708195e1c1a5c995960c21b608482015260a401610a80565b6001600160a01b038616600090815260996020908152604080832085830151845290915290205460ff16156114ef576040805162461bcd60e51b81526020600482015260248101919091527f4156534469726563746f72792e666f7263654465726567697374657246726f6d60448201527f4f70657261746f72536574733a2073616c7420616c7265616479207370656e746064820152608401610a80565b6115088661106387878787602001518860400151611be5565b6001600160a01b03861660009081526099602090815260408083208583015184529091529020805460ff191660011790555b61154685878686613983565b505050505050565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015611596573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ba9190615a6f565b6115d65760405162461bcd60e51b8152600401610a8090615a91565b600019606681905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b6040516369066d9160e01b81526001600160a01b0385811660048301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906369066d9190602401602060405180830381865afa158015611680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a491906159e0565b9050336001600160a01b038216146116c3576116c38186868686613057565b60006116d2621baf8042615a47565b905060005b848110156112fb576116f587878784818110611296576112966159af565b6117238787878481811061170b5761170b6159af565b905060200281019061171d9190615b82565b84613b65565b61172c816159c5565b90506116d7565b61173b614157565b6117456000612a24565b565b60005b83811015611546576117a986868684818110611768576117686159af565b905060200201602081019061177d919061507c565b85858581811061178f5761178f6159af565b90506020020160208101906117a491906155cc565b61320b565b6117b2816159c5565b905061174a565b60006118147fb3cc2868468e0461dcbecef0a4fcb7a8ef26c2e1f3e59c9d0de6afcc74448a2487878787876040516020016117f996959493929190615c9e565b604051602081830303815290604052805190602001206141b1565b9695505050505050565b60408051808201909152600080825260208201526001600160a01b0383166000908152609d602052604090206118589061096c908461276e565b9392505050565b60006118147f809c5ac049c45b7a7f050a20f00c16cf63797efbf8b1eb8d749fdfa39ff8f92987878787876040516020016117f996959493929190615df8565b604080517fda2c89bafdd34776a2b8bb9c83c82f419e20cc8c67207f70edd58249b92661bd60208201526001600160a01b038087169282019290925290841660608201526080810183905260a081018290526000906119009060c0016117f9565b95945050505050565b336001600160a01b03167fa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c9437138383604051611944929190615e38565b60405180910390a25050565b336000908152609a602052604090205460ff16156119d65760405162461bcd60e51b815260206004820152603e60248201527f4156534469726563746f72792e6265636f6d654f70657261746f72536574415660448201527f533a20616c726561647920616e206f70657261746f72207365742041565300006064820152608401610a80565b336000818152609a6020526040808220805460ff19166001179055517f702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf9190a2565b60005b81811015611be057336000908152609b6020526040812090848484818110611a4557611a456159af565b9050602002016020810190611a5a9190615b10565b63ffffffff16815260208101919091526040016000205460ff1615611ae75760405162461bcd60e51b815260206004820152603b60248201527f4156534469726563746f72792e6372656174654f70657261746f725365743a2060448201527f6f70657261746f722073657420616c72656164792065786973747300000000006064820152608401610a80565b336000908152609b60205260408120600191858585818110611b0b57611b0b6159af565b9050602002016020810190611b209190615b10565b63ffffffff1663ffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c6040518060400160405280336001600160a01b03168152602001858585818110611b9e57611b9e6159af565b9050602002016020810190611bb39190615b10565b63ffffffff169052604051611bc8919061570c565b60405180910390a1611bd9816159c5565b9050611a1b565b505050565b60006118147f4ee65f64218c67b68da66fd0db16560040a6b973290b9e71912d661ee53fe49587878787876040516020016117f996959493929190615df8565b611c52856040518060400160405280336001600160a01b031681526020018763ffffffff16815250610a95565b611ccf5760405162461bcd60e51b815260206004820152604260248201527f4156534469726563746f72792e736c6173684f70657261746f723a206f70657260448201527f61746f72206e6f7420736c61736861626c6520666f72206f70657261746f7253606482015261195d60f21b608482015260a401610a80565b60005b82811015611546576001600160a01b038616600090815260a0602052604081208190611d5d90429083898988818110611d0d57611d0d6159af565b9050602002016020810190611d22919061507c565b6001600160a01b0316815260208082019290925260409081016000908120338252835281812063ffffffff808e16835293522091906141f816565b9050612710611d796001600160401b03831661ffff8716615b2b565b611d839190615b60565b6001600160a01b038916600090815260a060205260408120919350611e139142916001600160401b03861691908a8a89818110611dc257611dc26159af565b9050602002016020810190611dd7919061507c565b6001600160a01b0316815260208082019290925260409081016000908120338252835281812063ffffffff808f16835293522092919061429d16565b506001600160a01b038716600090815260a46020526040812081878786818110611e3f57611e3f6159af565b9050602002016020810190611e54919061507c565b6001600160a01b0316815260208082019290925260409081016000908120338252835281812063ffffffff8b1682529092529020549050805b801561205e576001600160a01b038916600090815260a46020526040812081898988818110611ebe57611ebe6159af565b9050602002016020810190611ed3919061507c565b6001600160a01b0316815260208082019290925260409081016000908120338252835281812063ffffffff8d1682529092529020611f12600184615980565b81548110611f2257611f226159af565b60009182526020808320909101546001600160a01b038d16835260a290915260408220909250818a8a89818110611f5b57611f5b6159af565b9050602002016020810190611f70919061507c565b6001600160a01b03166001600160a01b031681526020019081526020016000208281548110611fa157611fa16159af565b6000918252602090912001805490915063ffffffff428116600160401b9092041610611fce57505061205e565b805460009061271090611fee906001600160401b031661ffff8b16615b2b565b611ff89190615b60565b8254909150819083906000906120189084906001600160401b0316615e67565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555080866120489190615e8f565b95505050508061205790615eb1565b9050611e8d565b50506001600160a01b0387166000908152609f602052604081206121449142916001600160401b038516916120da91908a8a898181106120a0576120a06159af565b90506020020160208101906120b5919061507c565b6001600160a01b03166001600160a01b03168152602001908152602001600020614339565b6120e49190615ec8565b6001600160a01b038a166000908152609f602052604081209089898881811061210f5761210f6159af565b9050602002016020810190612124919061507c565b6001600160a01b0316815260208101919091526040016000209190614372565b50505080612151906159c5565b9050611cd2565b606654600190600290811614156121815760405162461bcd60e51b8152600401610a8090615ad9565b610d8833858585613983565b6001600160a01b0381166000908152609d60205260408120610b1f90612764565b60006118586121bc8361438d565b6001600160a01b0385166000908152609d60205260409020906143f2565b606654600190600290811614156122035760405162461bcd60e51b8152600401610a8090615ad9565b336000908152609a602052604090205460ff1661229c5760405162461bcd60e51b815260206004820152604b60248201527f4156534469726563746f72792e6d6967726174654f70657261746f7273546f4f60448201527f70657261746f72536574733a20415653206973206e6f7420616e206f7065726160648201526a746f72207365742041565360a81b608482015260a401610a80565b60005b84811015611546576001336000908152609860205260408120908888858181106122cb576122cb6159af565b90506020020160208101906122e0919061507c565b6001600160a01b0316815260208101919091526040016000205460ff16600181111561230e5761230e61558e565b146123ba5760405162461bcd60e51b815260206004820152606a60248201527f4156534469726563746f72792e6d6967726174654f70657261746f7273546f4f60448201527f70657261746f72536574733a206f70657261746f7220616c7265616479206d6960648201527f677261746564206f72206e6f742061206c656761637920726567697374657265608482015269321037b832b930ba37b960b11b60a482015260c401610a80565b61240e8686838181106123cf576123cf6159af565b90506020020160208101906123e4919061507c565b338686858181106123f7576123f76159af565b90506020028101906124099190615ee8565b612c30565b33600090815260986020526040812081888885818110612430576124306159af565b9050602002016020810190612445919061507c565b6001600160a01b031681526020810191909152604001600020805460ff1916600183818111156124775761247761558e565b02179055503386868381811061248f5761248f6159af565b90506020020160208101906124a4919061507c565b6001600160a01b03167ff0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b4160006040516124dd91906155a4565b60405180910390a3338686838181106124f8576124f86159af565b905060200201602081019061250d919061507c565b6001600160a01b03167f54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01868685818110612549576125496159af565b905060200281019061255b9190615ee8565b604051612569929190615f31565b60405180910390a38061257b816159c5565b91505061229f565b61258b614157565b6001600160a01b0381166125f05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a80565b610a9281612a24565b600061260361295b565b905090565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561265b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061267f91906159e0565b6001600160a01b0316336001600160a01b0316146126af5760405162461bcd60e51b8152600401610a80906159fd565b60665419811960665419161461272d5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610a80565b606681905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610c59565b6000610b1f825490565b6000611858838361440a565b6001600160a01b0381166128085760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610a80565b606554604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b6065546001600160a01b031615801561289257506001600160a01b03821615155b6129145760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610a80565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a26129578261277a565b5050565b60007f000000000000000000000000000000000000000000000000000000000000000046141561298c575060975490565b50604080518082018252600a81526922b4b3b2b72630bcb2b960b11b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea81840152466060820152306080808301919091528351808303909101815260a0909101909252815191012090565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0383163b15612b9057604051630b135d3f60e11b808252906001600160a01b03851690631626ba7e90612ab69086908690600401615f4d565b602060405180830381865afa158015612ad3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612af79190615faa565b6001600160e01b03191614611be05760405162461bcd60e51b815260206004820152605360248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a2045524331323731207369676e6174757265206064820152721d995c9a599a58d85d1a5bdb8819985a5b1959606a1b608482015260a401610a80565b826001600160a01b0316612ba48383614434565b6001600160a01b031614611be05760405162461bcd60e51b815260206004820152604760248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a207369676e6174757265206e6f742066726f6d6064820152661039b4b3b732b960c91b608482015260a401610a80565b60005b818110156110a75760006040518060400160405280866001600160a01b03168152602001858585818110612c6957612c696159af565b9050602002016020810190612c7e9190615b10565b63ffffffff1690526001600160a01b0386166000908152609b60205260408120919250858585818110612cb357612cb36159af565b9050602002016020810190612cc89190615b10565b63ffffffff16815260208101919091526040016000205460ff16612d5f5760405162461bcd60e51b815260206004820152604260248201527f4156534469726563746f72792e5f72656769737465724f70657261746f72546f60448201527f4f70657261746f72536574733a20696e76616c6964206f70657261746f722073606482015261195d60f21b608482015260a401610a80565b612d6986826121ae565b15612e025760405162461bcd60e51b815260206004820152605960248201527f4156534469726563746f72792e5f72656769737465724f70657261746f72546f60448201527f4f70657261746f72536574733a206f70657261746f7220616c7265616479207260648201527f65676973746572656420746f206f70657261746f722073657400000000000000608482015260a401610a80565b6001600160a01b0385166000908152609c6020526040812090858585818110612e2d57612e2d6159af565b9050602002016020810190612e429190615b10565b63ffffffff1663ffffffff16815260200190815260200160002060008154612e69906159c5565b90915550612e97612e798261438d565b6001600160a01b0388166000908152609d6020526040902090614458565b506001600160a01b038086166000908152609e60209081526040808320938a16835292905290812081868686818110612ed257612ed26159af565b9050602002016020810190612ee79190615b10565b63ffffffff1681526020810191909152604001600020805490915060ff1615612f9e5760405162461bcd60e51b815260206004820152605a60248201527f4156534469726563746f72792e5f72656769737465724f70657261746f72546f60448201527f4f70657261746f72536574733a206f70657261746f7220616c7265616479207260648201527f65676973746572656420666f72206f70657261746f7220736574000000000000608482015260a401610a80565b805460ff191660011781556040516001600160a01b038816907f43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e90612fe490859061570c565b60405180910390a2505080612ff8906159c5565b9050612c33565b81546000908161301185858385614464565b9050801561304c5761303685613028600184615980565b600091825260209091200190565b54600160201b90046001600160e01b0316611900565b600095945050505050565b42816040013510156130dd5760405162461bcd60e51b815260206004820152604360248201527f4156534469726563746f72792e5f766572696679416c6c6f6361746f7253696760448201527f6e61747572653a20616c6c6f6361746f72207369676e617475726520657870696064820152621c995960ea1b608482015260a401610a80565b6001600160a01b038516600090815260a56020908152604080832084830135845290915290205460ff161561316f5760405162461bcd60e51b815260206004820152603260248201527f4156534469726563746f72792e5f766572696679416c6c6f6361746f725369676044820152711b985d1d5c994e881cd85b1d081cdc195b9d60721b6064820152608401610a80565b6000613186858585856020013586604001356117b9565b90506131d186826131978580615fd4565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612a7692505050565b506001600160a01b03909416600090815260a56020908152604080832096820135835295905293909320805460ff19166001179055505050565b6001600160a01b03808416600081815260a3602090815260408083209487168084529482528083205493835260a2825280832094835293905291822054909160ff84161561325a57600061325d565b60ff5b90505b818310801561327457508360ff168160ff16105b1561337f576001600160a01b03808716600090815260a26020908152604080832093891683529290529081208054859081106132b2576132b26159af565b6000918252602091829020604080518082019091529101546001600160401b038116825263ffffffff600160401b9091048116928201839052909250421611156132fc575061337f565b80516001600160a01b03808916600090815260a160209081526040808320938b168352929052908120805490919061333e9084906001600160401b0316615e8f565b92506101000a8154816001600160401b0302191690836001600160401b031602179055508361336c906159c5565b93506133778261601a565b915050613260565b50506001600160a01b03938416600090815260a36020908152604080832095909616825293909352929091209190915550565b60006133c1602084018461507c565b90506133d06040840184615ee8565b90506133df602085018561603a565b9050146134665760405162461bcd60e51b815260206004820152604960248201527f4156534469726563746f72792e5f6465616c6c6f636174653a206f706572617460448201527f6f725365747320616e64206d61676e69747564654469666673206c656e677468606482015268040dad2e6dac2e8c6d60bb1b608482015260a401610a80565b366000613476602086018661603a565b9150915060005b818110156112fb576001600160a01b03808816600090815260a060209081526040808320938816835292905290812061354f904290838787878181106134c5576134c56159af565b6134db926020604090920201908101915061507c565b6001600160a01b03166001600160a01b03168152602001908152602001600020600087878781811061350f5761350f6159af565b90506040020160200160208101906135279190615b10565b63ffffffff1663ffffffff1681526020019081526020016000206141f890919063ffffffff16565b905060006135606040890189615ee8565b84818110613570576135706159af565b90506020020160208101906135859190616083565b6001600160401b0316116136015760405162461bcd60e51b815260206004820152603e60248201527f4156534469726563746f72792e5f6465616c6c6f636174653a206d61676e697460448201527f75646544696666206d7573742062652067726561746572207468616e203000006064820152608401610a80565b6001600160401b0381166136186040890189615ee8565b84818110613628576136286159af565b905060200201602081019061363d9190616083565b6001600160401b031611156136ca5760405162461bcd60e51b815260206004820152604760248201527f4156534469726563746f72792e5f6465616c6c6f636174653a2063616e6e6f7460448201527f206465616c6c6f63617465206d6f7265207468616e207768617420697320616c6064820152661b1bd8d85d195960ca1b608482015260a401610a80565b6137d2426136db60408a018a615ee8565b858181106136eb576136eb6159af565b90506020020160208101906137009190616083565b6001600160a01b03808c16600090815260a060209081526040808320938c1683529290529081206001600160401b03929092169190888888818110613747576137476159af565b61375d926020604090920201908101915061507c565b6001600160a01b03166001600160a01b031681526020019081526020016000206000888888818110613791576137916159af565b90506040020160200160208101906137a99190615b10565b63ffffffff1663ffffffff16815260200190815260200160002061429d9092919063ffffffff16565b6137f488868686868181106137e9576137e96159af565b9050604002016144ba565b6001600160a01b03888116600090815260a260209081526040808320938916835292905281902080548251808401845290928190613834908c018c615ee8565b87818110613844576138446159af565b90506020020160208101906138599190616083565b6001600160401b03908116825263ffffffff808c166020938401528454600181018655600095865283862085519101805495850151909216600160401b026bffffffffffffffffffffffff19909516921691909117929092179091556001600160a01b03808c16835260a482526040808420918a16845291528120908686868181106138e7576138e76159af565b6138fd926020604090920201908101915061507c565b6001600160a01b03166001600160a01b031681526020019081526020016000206000868686818110613931576139316159af565b90506040020160200160208101906139499190615b10565b63ffffffff1681526020808201929092526040016000908120805460018101825590825291902001555061397c816159c5565b905061347d565b60005b818110156110a75760006040518060400160405280876001600160a01b031681526020018585858181106139bc576139bc6159af565b90506020020160208101906139d19190615b10565b63ffffffff16905290506139e585826121ae565b613a7d5760405162461bcd60e51b815260206004820152605960248201527f4156534469726563746f72792e5f646572656769737465724f70657261746f7260448201527f46726f6d4f70657261746f725365743a206f70657261746f72206e6f7420726560648201527f676973746572656420666f72206f70657261746f722073657400000000000000608482015260a401610a80565b6001600160a01b0386166000908152609c6020526040812090858585818110613aa857613aa86159af565b9050602002016020810190613abd9190615b10565b63ffffffff1663ffffffff16815260200190815260200160002060008154613ae490615eb1565b90915550613b12613af48261438d565b6001600160a01b0387166000908152609d6020526040902090614727565b50846001600160a01b03167fad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe82604051613b4c919061570c565b60405180910390a250613b5e816159c5565b9050613986565b6000613b74602084018461507c565b9050366000613b86602086018661603a565b6001600160a01b03808916600090815260a1602090815260408083209389168352929052908120549294509092506001600160401b03909116905b82811015614107576000613bd86040890189615ee8565b83818110613be857613be86159af565b9050602002016020810190613bfd9190616083565b6001600160401b031611613c855760405162461bcd60e51b815260206004820152604360248201527f4156534469726563746f72792e7175657565416c6c6f636174696f6e733a206d60448201527f61676e697475646544696666206d75737420626520677265617465722074686160648201526206e20360ec1b608482015260a401610a80565b613c926040880188615ee8565b82818110613ca257613ca26159af565b9050602002016020810190613cb79190616083565b6001600160401b0316826001600160401b03161015613d575760405162461bcd60e51b815260206004820152605060248201527f4156534469726563746f72792e7175657565416c6c6f636174696f6e733a206960448201527f6e73756666696369656e7420617661696c61626c652066726565206d61676e6960648201526f7475646520746f20616c6c6f6361746560801b608482015260a401610a80565b6001600160a01b03808916600090815260a06020908152604080832093891683529290529081208190613e2390429083898988818110613d9957613d996159af565b613daf926020604090920201908101915061507c565b6001600160a01b03166001600160a01b031681526020019081526020016000206000898988818110613de357613de36159af565b9050604002016020016020810190613dfb9190615b10565b63ffffffff1663ffffffff16815260200190815260200160002061473390919063ffffffff16565b91509150816001600160e01b03166000141580613e3f57508015155b15613fa5576001600160a01b03808b16600090815260a060209081526040808320938b168352929052908120613f0191888887818110613e8157613e816159af565b613e97926020604090920201908101915061507c565b6001600160a01b03166001600160a01b031681526020019081526020016000206000888887818110613ecb57613ecb6159af565b9050604002016020016020810190613ee39190615b10565b63ffffffff1663ffffffff1681526020019081526020016000205490565b613f0c600183615997565b14613fa55760405162461bcd60e51b815260206004820152605d60248201527f4156534469726563746f72792e7175657565416c6c6f636174696f6e733a206560448201527f7863656564206d61782070656e64696e6720616c6c6f636174696f6e7320616c60648201527f6c6f77656420666f72206f702c206f705365742c207374726174656779000000608482015260a401610a80565b6140b388613fb660408c018c615ee8565b86818110613fc657613fc66159af565b9050602002016020810190613fdb9190616083565b613fee906001600160401b03168561609e565b6001600160a01b03808e16600090815260a060209081526040808320938e168352929052908120908a8a89818110614028576140286159af565b61403e926020604090920201908101915061507c565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008a8a89818110614072576140726159af565b905060400201602001602081019061408a9190615b10565b63ffffffff1663ffffffff1681526020019081526020016000206143729092919063ffffffff16565b506140c3905060408a018a615ee8565b848181106140d3576140d36159af565b90506020020160208101906140e89190616083565b6140f29085615e67565b9350505080614100906159c5565b9050613bc1565b506001600160a01b03968716600090815260a1602090815260408083209690991682529490945295909220805467ffffffffffffffff19166001600160401b039096169590951790945550505050565b6033546001600160a01b031633146117455760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a80565b60006141bb61295b565b60405161190160f01b6020820152602281019190915260428101839052606201604051602081830303815290604052805190602001209050919050565b815460009081816005811115614255576000614213846147ec565b61421d9085615980565b60008881526020902090915081015463ffffffff908116908716101561424557809150614253565b614250816001615997565b92505b505b600061426387878585614464565b905080156142905761427a87613028600184615980565b54600160201b90046001600160e01b03166111ab565b6000979650505050505050565b6000806142aa8585614733565b91509150816001600160e01b031660001480156142c5575080155b156142cf57506000195b84545b80821015611546576000868152602090208201805485908290600490614309908490600160201b90046001600160e01b0316615ec8565b92506101000a8154816001600160e01b0302191690836001600160e01b03160217905550826001019250506142d2565b805460009080156143695761435383613028600184615980565b54600160201b90046001600160e01b0316611858565b60009392505050565b6000806143808585856148d1565b915091505b935093915050565b60008160000151826020015163ffffffff166040516020016143da92919060609290921b6bffffffffffffffffffffffff1916825260a01b6001600160a01b031916601482015260200190565b604051602081830303815290604052610b1f906160c0565b60008181526001830160205260408120541515611858565b6000826000018281548110614421576144216159af565b9060005260206000200154905092915050565b60008060006144438585614a77565b9150915061445081614ae4565b509392505050565b60006118588383614c9f565b60005b8183101561445057600061447b8484614cee565b60008781526020902090915063ffffffff86169082015463ffffffff1611156144a6578092506144b4565b6144b1816001615997565b93505b50614467565b6001600160a01b03808416600090815260a4602090815260408083209386168352928152918120909182906144f19085018561507c565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008360200160208101906145269190615b10565b63ffffffff1681526020810191909152604001600020549050805b80156110a7576001600160a01b03808616600090815260a46020908152604080832093881683529281529181209091829061457e9087018761507c565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008560200160208101906145b39190615b10565b63ffffffff16815260208101919091526040016000206145d4600184615980565b815481106145e4576145e46159af565b60009182526020808320909101546001600160a01b03808a16845260a283526040808520918a168552925290822080549193509083908110614628576146286159af565b6000918252602091829020604080518082019091529101546001600160401b038116825263ffffffff600160401b90910481169282018390529092504216111561470d5760016146788486615980565b614683906001615997565b106147085760405162461bcd60e51b815260206004820152604960248201527f4156534469726563746f72792e5f636865636b5175657565644465616c6c6f6360448201527f6174696f6e733a2065786365656473206d61782070656e64696e67206465616c6064820152686c6f636174696f6e7360b81b608482015260a401610a80565b614714565b50506110a7565b50508061472090615eb1565b9050614541565b60006118588383614d09565b8154600090819081816005811115614792576000614750846147ec565b61475a9085615980565b60008981526020902090915081015463ffffffff908116908816101561478257809150614790565b61478d816001615997565b92505b505b60006147a088888585614464565b905080156147d8576147b788613028600184615980565b54600160201b90046001600160e01b03166147d3600183615980565b6147dc565b6000805b95509550505050505b9250929050565b6000816147fb57506000919050565b6000600161480884614dfc565b901c6001901b9050600181848161482157614821615b4a565b048201901c9050600181848161483957614839615b4a565b048201901c9050600181848161485157614851615b4a565b048201901c9050600181848161486957614869615b4a565b048201901c9050600181848161488157614881615b4a565b048201901c9050600181848161489957614899615b4a565b048201901c905060018184816148b1576148b1615b4a565b048201901c9050611858818285816148cb576148cb615b4a565b04614e90565b825460009081908015614a1e5760006148ef87613028600185615980565b60408051808201909152905463ffffffff808216808452600160201b9092046001600160e01b0316602084015291925090871610156149705760405162461bcd60e51b815260206004820152601b60248201527f436865636b706f696e743a2064656372656173696e67206b65797300000000006044820152606401610a80565b8563ffffffff16816000015163ffffffff1614156149bf578461499888613028600186615980565b80546001600160e01b0392909216600160201b0263ffffffff909216919091179055614a0e565b6040805180820190915263ffffffff80881682526001600160e01b0380881660208085019182528b54600181018d5560008d81529190912094519151909216600160201b029216919091179101555b6020015192508391506143859050565b50506040805180820190915263ffffffff80851682526001600160e01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160201b029190931617920191909155905081614385565b600080825160411415614aae5760208301516040840151606085015160001a614aa287828585614ea6565b945094505050506147e5565b825160401415614ad85760208301516040840151614acd868383614f93565b9350935050506147e5565b506000905060026147e5565b6000816004811115614af857614af861558e565b1415614b015750565b6001816004811115614b1557614b1561558e565b1415614b635760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a80565b6002816004811115614b7757614b7761558e565b1415614bc55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a80565b6003816004811115614bd957614bd961558e565b1415614c325760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a80565b6004816004811115614c4657614c4661558e565b1415610a925760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a80565b6000818152600183016020526040812054614ce657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610b1f565b506000610b1f565b6000614cfd6002848418615b60565b61185890848416615997565b60008181526001830160205260408120548015614df2576000614d2d600183615980565b8554909150600090614d4190600190615980565b9050818114614da6576000866000018281548110614d6157614d616159af565b9060005260206000200154905080876000018481548110614d8457614d846159af565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080614db757614db76160e7565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610b1f565b6000915050610b1f565b600080608083901c15614e1157608092831c92015b604083901c15614e2357604092831c92015b602083901c15614e3557602092831c92015b601083901c15614e4757601092831c92015b600883901c15614e5957600892831c92015b600483901c15614e6b57600492831c92015b600283901c15614e7d57600292831c92015b600183901c15610b1f5760010192915050565b6000818310614e9f5781611858565b5090919050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614edd5750600090506003614f8a565b8460ff16601b14158015614ef557508460ff16601c14155b15614f065750600090506004614f8a565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614f5a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614f8357600060019250925050614f8a565b9150600090505b94509492505050565b6000806001600160ff1b03831681614fb060ff86901c601b615997565b9050614fbe87828885614ea6565b935093505050935093915050565b6001600160a01b0381168114610a9257600080fd5b600080600060608486031215614ff657600080fd5b833561500181614fcc565b95602085013595506040909401359392505050565b602080825282518282018190526000919060409081850190868401855b8281101561506f5761505f84835180516001600160a01b0316825260209081015163ffffffff16910152565b9284019290850190600101615033565b5091979650505050505050565b60006020828403121561508e57600080fd5b813561185881614fcc565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156150d1576150d1615099565b60405290565b604051601f8201601f191681016001600160401b03811182821017156150ff576150ff615099565b604052919050565b803563ffffffff8116811461511b57600080fd5b919050565b600080828403606081121561513457600080fd5b833561513f81614fcc565b92506040601f198201121561515357600080fd5b50604051604081018181106001600160401b038211171561517657615176615099565b604052602084013561518781614fcc565b815261519560408501615107565b6020820152809150509250929050565b6000602082840312156151b757600080fd5b5035919050565b6000806000606084860312156151d357600080fd5b83356151de81614fcc565b925060208401356151ee81614fcc565b929592945050506040919091013590565b60008083601f84011261521157600080fd5b5081356001600160401b0381111561522857600080fd5b6020830191508360208260051b85010111156147e557600080fd5b60006060828403121561525557600080fd5b61525d6150af565b905081356001600160401b038082111561527657600080fd5b818401915084601f83011261528a57600080fd5b813560208282111561529e5761529e615099565b6152b0601f8301601f191682016150d7565b925081835286818386010111156152c657600080fd5b818185018285013760008183850101528285528086013581860152505050506040820135604082015292915050565b6000806000806060858703121561530b57600080fd5b843561531681614fcc565b935060208501356001600160401b038082111561533257600080fd5b61533e888389016151ff565b9095509350604087013591508082111561535757600080fd5b5061536487828801615243565b91505092959194509250565b60008060006060848603121561538557600080fd5b833561539081614fcc565b925060208401356153a081614fcc565b91506153ae60408501615107565b90509250925092565b60008060008084860360a08112156153ce57600080fd5b85356153d981614fcc565b94506040601f19820112156153ed57600080fd5b50602085019250606085013561540281614fcc565b915061541060808601615107565b905092959194509250565b6000806000806060858703121561543157600080fd5b843561543c81614fcc565b935060208501356001600160401b038082111561545857600080fd5b615464888389016151ff565b9095509350604087013591508082111561547d57600080fd5b5085016060818803121561549057600080fd5b939692955090935050565b600080604083850312156154ae57600080fd5b82356154b981614fcc565b946020939093013593505050565b6000806000806000608086880312156154df57600080fd5b85356154ea81614fcc565b945060208601356154fa81614fcc565b935060408601356001600160401b038082111561551657600080fd5b61552289838a016151ff565b9095509350606088013591508082111561553b57600080fd5b5061554888828901615243565b9150509295509295909350565b6000806040838503121561556857600080fd5b823561557381614fcc565b9150602083013561558381614fcc565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600283106155c657634e487b7160e01b600052602160045260246000fd5b91905290565b6000602082840312156155de57600080fd5b813560ff8116811461185857600080fd5b60008060008060006060868803121561560757600080fd5b853561561281614fcc565b945060208601356001600160401b038082111561562e57600080fd5b61563a89838a016151ff565b9096509450604088013591508082111561565357600080fd5b50615660888289016151ff565b969995985093965092949392505050565b6000806040838503121561568457600080fd5b823561568f81614fcc565b915061569d60208401615107565b90509250929050565b6000806000806000608086880312156156be57600080fd5b85356156c981614fcc565b945060208601356001600160401b038111156156e457600080fd5b6156f0888289016151ff565b9699909850959660408101359660609091013595509350505050565b81516001600160a01b0316815260208083015163ffffffff169082015260408101610b1f565b6000806000806080858703121561574857600080fd5b843561575381614fcc565b9350602085013561576381614fcc565b93969395505050506040820135916060013590565b6000806020838503121561578b57600080fd5b82356001600160401b03808211156157a257600080fd5b818501915085601f8301126157b657600080fd5b8135818111156157c557600080fd5b8660208285010111156157d757600080fd5b60209290920196919550909350505050565b600080602083850312156157fc57600080fd5b82356001600160401b0381111561581257600080fd5b61581e858286016151ff565b90969095509350505050565b60008060008060006080868803121561584257600080fd5b853561584d81614fcc565b945061585b60208701615107565b935060408601356001600160401b0381111561587657600080fd5b615882888289016151ff565b909450925050606086013561ffff8116811461589d57600080fd5b809150509295509295909350565b6000806000604084860312156158c057600080fd5b83356158cb81614fcc565b925060208401356001600160401b038111156158e657600080fd5b6158f2868287016151ff565b9497909650939450505050565b6000806000806040858703121561591557600080fd5b84356001600160401b038082111561592c57600080fd5b615938888389016151ff565b9096509450602087013591508082111561595157600080fd5b5061595e878288016151ff565b95989497509550505050565b634e487b7160e01b600052601160045260246000fd5b6000828210156159925761599261596a565b500390565b600082198211156159aa576159aa61596a565b500190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156159d9576159d961596a565b5060010190565b6000602082840312156159f257600080fd5b815161185881614fcc565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b600063ffffffff808316818516808303821115615a6657615a6661596a565b01949350505050565b600060208284031215615a8157600080fd5b8151801515811461185857600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b60208082526019908201527f5061757361626c653a20696e6465782069732070617573656400000000000000604082015260600190565b600060208284031215615b2257600080fd5b61185882615107565b6000816000190483118215151615615b4557615b4561596a565b500290565b634e487b7160e01b600052601260045260246000fd5b600082615b7d57634e487b7160e01b600052601260045260246000fd5b500490565b60008235605e19833603018112615b9857600080fd5b9190910192915050565b8183526000602080850194508260005b85811015615bf8578135615bc581614fcc565b6001600160a01b0316875263ffffffff615be0838501615107565b16878401526040968701969190910190600101615bb2565b509495945050505050565b6000808335601e19843603018112615c1a57600080fd5b83016020810192503590506001600160401b03811115615c3957600080fd5b8060051b36038313156147e557600080fd5b80356001600160401b038116811461511b57600080fd5b8183526000602080850194508260005b85811015615bf8576001600160401b03615c8b83615c4b565b1687529582019590820190600101615c72565b600060a08201888352602060018060a01b03808a1682860152604060a0818701528389855260c08701905060c08a60051b88010194508a60005b8b811015615d9f5788870360bf190183528135368e9003605e19018112615cfe57600080fd5b8d0160608135615d0d81614fcc565b871689528188013536839003601e19018112615d2857600080fd5b820180356001600160401b03811115615d4057600080fd5b8060061b3603841315615d5257600080fd5b828a8c0152615d66838c01828c8501615ba2565b92505050615d7686830183615c03565b9250898203878b0152615d8a828483615c62565b99505050928601925090850190600101615cd8565b505050505060608401959095526080909201929092529695505050505050565b8183526000602080850194508260005b85811015615bf85763ffffffff615de583615107565b1687529582019590820190600101615dcf565b8681526001600160a01b038616602082015260a060408201819052600090615e239083018688615dbf565b60608301949094525060800152949350505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006001600160401b0383811690831681811015615e8757615e8761596a565b039392505050565b60006001600160401b03808316818516808303821115615a6657615a6661596a565b600081615ec057615ec061596a565b506000190190565b60006001600160e01b0383811690831681811015615e8757615e8761596a565b6000808335601e19843603018112615eff57600080fd5b8301803591506001600160401b03821115615f1957600080fd5b6020019150600581901b36038213156147e557600080fd5b602081526000615f45602083018486615dbf565b949350505050565b82815260006020604081840152835180604085015260005b81811015615f8157858101830151858201606001528201615f65565b81811115615f93576000606083870101525b50601f01601f191692909201606001949350505050565b600060208284031215615fbc57600080fd5b81516001600160e01b03198116811461185857600080fd5b6000808335601e19843603018112615feb57600080fd5b8301803591506001600160401b0382111561600557600080fd5b6020019150368190038213156147e557600080fd5b600060ff821660ff8114156160315761603161596a565b60010192915050565b6000808335601e1984360301811261605157600080fd5b8301803591506001600160401b0382111561606b57600080fd5b6020019150600681901b36038213156147e557600080fd5b60006020828403121561609557600080fd5b61185882615c4b565b60006001600160e01b03828116848216808303821115615a6657615a6661596a565b805160208083015191908110156160e1576000198160200360031b1b821691505b50919050565b634e487b7160e01b600052603160045260246000fdfe4156534469726563746f72792e72656769737465724f70657261746f72546f4fa264697066735822122057615600b1b8ed2c594c0ca166b1ad1650f361bd0a718ba6d96322a3c846a50d64736f6c634300080c0033", } // AVSDirectoryABI is the input ABI used to generate the binding from. @@ -209,6 +222,37 @@ func (_AVSDirectory *AVSDirectoryTransactorRaw) Transact(opts *bind.TransactOpts return _AVSDirectory.Contract.contract.Transact(opts, method, params...) } +// ALLOCATIONDELAY is a free data retrieval call binding the contract method 0x6fbb031c. +// +// Solidity: function ALLOCATION_DELAY() view returns(uint32) +func (_AVSDirectory *AVSDirectoryCaller) ALLOCATIONDELAY(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "ALLOCATION_DELAY") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// ALLOCATIONDELAY is a free data retrieval call binding the contract method 0x6fbb031c. +// +// Solidity: function ALLOCATION_DELAY() view returns(uint32) +func (_AVSDirectory *AVSDirectorySession) ALLOCATIONDELAY() (uint32, error) { + return _AVSDirectory.Contract.ALLOCATIONDELAY(&_AVSDirectory.CallOpts) +} + +// ALLOCATIONDELAY is a free data retrieval call binding the contract method 0x6fbb031c. +// +// Solidity: function ALLOCATION_DELAY() view returns(uint32) +func (_AVSDirectory *AVSDirectoryCallerSession) ALLOCATIONDELAY() (uint32, error) { + return _AVSDirectory.Contract.ALLOCATIONDELAY(&_AVSDirectory.CallOpts) +} + // DOMAINTYPEHASH is a free data retrieval call binding the contract method 0x20606b70. // // Solidity: function DOMAIN_TYPEHASH() view returns(bytes32) @@ -240,6 +284,68 @@ func (_AVSDirectory *AVSDirectoryCallerSession) DOMAINTYPEHASH() ([32]byte, erro return _AVSDirectory.Contract.DOMAINTYPEHASH(&_AVSDirectory.CallOpts) } +// MAGNITUDEADJUSTMENTTYPEHASH is a free data retrieval call binding the contract method 0x7b205de3. +// +// Solidity: function MAGNITUDE_ADJUSTMENT_TYPEHASH() view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCaller) MAGNITUDEADJUSTMENTTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "MAGNITUDE_ADJUSTMENT_TYPEHASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAGNITUDEADJUSTMENTTYPEHASH is a free data retrieval call binding the contract method 0x7b205de3. +// +// Solidity: function MAGNITUDE_ADJUSTMENT_TYPEHASH() view returns(bytes32) +func (_AVSDirectory *AVSDirectorySession) MAGNITUDEADJUSTMENTTYPEHASH() ([32]byte, error) { + return _AVSDirectory.Contract.MAGNITUDEADJUSTMENTTYPEHASH(&_AVSDirectory.CallOpts) +} + +// MAGNITUDEADJUSTMENTTYPEHASH is a free data retrieval call binding the contract method 0x7b205de3. +// +// Solidity: function MAGNITUDE_ADJUSTMENT_TYPEHASH() view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCallerSession) MAGNITUDEADJUSTMENTTYPEHASH() ([32]byte, error) { + return _AVSDirectory.Contract.MAGNITUDEADJUSTMENTTYPEHASH(&_AVSDirectory.CallOpts) +} + +// MAXPENDINGUPDATES is a free data retrieval call binding the contract method 0xb3e52eaa. +// +// Solidity: function MAX_PENDING_UPDATES() view returns(uint256) +func (_AVSDirectory *AVSDirectoryCaller) MAXPENDINGUPDATES(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "MAX_PENDING_UPDATES") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MAXPENDINGUPDATES is a free data retrieval call binding the contract method 0xb3e52eaa. +// +// Solidity: function MAX_PENDING_UPDATES() view returns(uint256) +func (_AVSDirectory *AVSDirectorySession) MAXPENDINGUPDATES() (*big.Int, error) { + return _AVSDirectory.Contract.MAXPENDINGUPDATES(&_AVSDirectory.CallOpts) +} + +// MAXPENDINGUPDATES is a free data retrieval call binding the contract method 0xb3e52eaa. +// +// Solidity: function MAX_PENDING_UPDATES() view returns(uint256) +func (_AVSDirectory *AVSDirectoryCallerSession) MAXPENDINGUPDATES() (*big.Int, error) { + return _AVSDirectory.Contract.MAXPENDINGUPDATES(&_AVSDirectory.CallOpts) +} + // OPERATORAVSREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xd79aceab. // // Solidity: function OPERATOR_AVS_REGISTRATION_TYPEHASH() view returns(bytes32) @@ -271,6 +377,99 @@ func (_AVSDirectory *AVSDirectoryCallerSession) OPERATORAVSREGISTRATIONTYPEHASH( return _AVSDirectory.Contract.OPERATORAVSREGISTRATIONTYPEHASH(&_AVSDirectory.CallOpts) } +// OPERATORSETFORCEDEREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xdce974b9. +// +// Solidity: function OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCaller) OPERATORSETFORCEDEREGISTRATIONTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// OPERATORSETFORCEDEREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xdce974b9. +// +// Solidity: function OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectory *AVSDirectorySession) OPERATORSETFORCEDEREGISTRATIONTYPEHASH() ([32]byte, error) { + return _AVSDirectory.Contract.OPERATORSETFORCEDEREGISTRATIONTYPEHASH(&_AVSDirectory.CallOpts) +} + +// OPERATORSETFORCEDEREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xdce974b9. +// +// Solidity: function OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCallerSession) OPERATORSETFORCEDEREGISTRATIONTYPEHASH() ([32]byte, error) { + return _AVSDirectory.Contract.OPERATORSETFORCEDEREGISTRATIONTYPEHASH(&_AVSDirectory.CallOpts) +} + +// OPERATORSETREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xc825fe68. +// +// Solidity: function OPERATOR_SET_REGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCaller) OPERATORSETREGISTRATIONTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "OPERATOR_SET_REGISTRATION_TYPEHASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// OPERATORSETREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xc825fe68. +// +// Solidity: function OPERATOR_SET_REGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectory *AVSDirectorySession) OPERATORSETREGISTRATIONTYPEHASH() ([32]byte, error) { + return _AVSDirectory.Contract.OPERATORSETREGISTRATIONTYPEHASH(&_AVSDirectory.CallOpts) +} + +// OPERATORSETREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xc825fe68. +// +// Solidity: function OPERATOR_SET_REGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCallerSession) OPERATORSETREGISTRATIONTYPEHASH() ([32]byte, error) { + return _AVSDirectory.Contract.OPERATORSETREGISTRATIONTYPEHASH(&_AVSDirectory.CallOpts) +} + +// AllocatorSaltIsSpent is a free data retrieval call binding the contract method 0x46fb3a00. +// +// Solidity: function allocatorSaltIsSpent(address , bytes32 ) view returns(bool) +func (_AVSDirectory *AVSDirectoryCaller) AllocatorSaltIsSpent(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte) (bool, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "allocatorSaltIsSpent", arg0, arg1) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// AllocatorSaltIsSpent is a free data retrieval call binding the contract method 0x46fb3a00. +// +// Solidity: function allocatorSaltIsSpent(address , bytes32 ) view returns(bool) +func (_AVSDirectory *AVSDirectorySession) AllocatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { + return _AVSDirectory.Contract.AllocatorSaltIsSpent(&_AVSDirectory.CallOpts, arg0, arg1) +} + +// AllocatorSaltIsSpent is a free data retrieval call binding the contract method 0x46fb3a00. +// +// Solidity: function allocatorSaltIsSpent(address , bytes32 ) view returns(bool) +func (_AVSDirectory *AVSDirectoryCallerSession) AllocatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { + return _AVSDirectory.Contract.AllocatorSaltIsSpent(&_AVSDirectory.CallOpts, arg0, arg1) +} + // AvsOperatorStatus is a free data retrieval call binding the contract method 0x49075da3. // // Solidity: function avsOperatorStatus(address , address ) view returns(uint8) @@ -302,6 +501,37 @@ func (_AVSDirectory *AVSDirectoryCallerSession) AvsOperatorStatus(arg0 common.Ad return _AVSDirectory.Contract.AvsOperatorStatus(&_AVSDirectory.CallOpts, arg0, arg1) } +// CalculateMagnitudeAdjustmentDigestHash is a free data retrieval call binding the contract method 0x8522fcb1. +// +// Solidity: function calculateMagnitudeAdjustmentDigestHash(address operator, (address,(address,uint32)[],uint64[])[] adjustments, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCaller) CalculateMagnitudeAdjustmentDigestHash(opts *bind.CallOpts, operator common.Address, adjustments []IAVSDirectoryMagnitudeAdjustment, salt [32]byte, expiry *big.Int) ([32]byte, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "calculateMagnitudeAdjustmentDigestHash", operator, adjustments, salt, expiry) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateMagnitudeAdjustmentDigestHash is a free data retrieval call binding the contract method 0x8522fcb1. +// +// Solidity: function calculateMagnitudeAdjustmentDigestHash(address operator, (address,(address,uint32)[],uint64[])[] adjustments, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectory *AVSDirectorySession) CalculateMagnitudeAdjustmentDigestHash(operator common.Address, adjustments []IAVSDirectoryMagnitudeAdjustment, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectory.Contract.CalculateMagnitudeAdjustmentDigestHash(&_AVSDirectory.CallOpts, operator, adjustments, salt, expiry) +} + +// CalculateMagnitudeAdjustmentDigestHash is a free data retrieval call binding the contract method 0x8522fcb1. +// +// Solidity: function calculateMagnitudeAdjustmentDigestHash(address operator, (address,(address,uint32)[],uint64[])[] adjustments, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCallerSession) CalculateMagnitudeAdjustmentDigestHash(operator common.Address, adjustments []IAVSDirectoryMagnitudeAdjustment, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectory.Contract.CalculateMagnitudeAdjustmentDigestHash(&_AVSDirectory.CallOpts, operator, adjustments, salt, expiry) +} + // CalculateOperatorAVSRegistrationDigestHash is a free data retrieval call binding the contract method 0xa1060c88. // // Solidity: function calculateOperatorAVSRegistrationDigestHash(address operator, address avs, bytes32 salt, uint256 expiry) view returns(bytes32) @@ -333,6 +563,68 @@ func (_AVSDirectory *AVSDirectoryCallerSession) CalculateOperatorAVSRegistration return _AVSDirectory.Contract.CalculateOperatorAVSRegistrationDigestHash(&_AVSDirectory.CallOpts, operator, avs, salt, expiry) } +// CalculateOperatorSetForceDeregistrationTypehash is a free data retrieval call binding the contract method 0xb2841d48. +// +// Solidity: function calculateOperatorSetForceDeregistrationTypehash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCaller) CalculateOperatorSetForceDeregistrationTypehash(opts *bind.CallOpts, avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "calculateOperatorSetForceDeregistrationTypehash", avs, operatorSetIds, salt, expiry) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateOperatorSetForceDeregistrationTypehash is a free data retrieval call binding the contract method 0xb2841d48. +// +// Solidity: function calculateOperatorSetForceDeregistrationTypehash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectory *AVSDirectorySession) CalculateOperatorSetForceDeregistrationTypehash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectory.Contract.CalculateOperatorSetForceDeregistrationTypehash(&_AVSDirectory.CallOpts, avs, operatorSetIds, salt, expiry) +} + +// CalculateOperatorSetForceDeregistrationTypehash is a free data retrieval call binding the contract method 0xb2841d48. +// +// Solidity: function calculateOperatorSetForceDeregistrationTypehash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCallerSession) CalculateOperatorSetForceDeregistrationTypehash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectory.Contract.CalculateOperatorSetForceDeregistrationTypehash(&_AVSDirectory.CallOpts, avs, operatorSetIds, salt, expiry) +} + +// CalculateOperatorSetRegistrationDigestHash is a free data retrieval call binding the contract method 0x955e6696. +// +// Solidity: function calculateOperatorSetRegistrationDigestHash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCaller) CalculateOperatorSetRegistrationDigestHash(opts *bind.CallOpts, avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "calculateOperatorSetRegistrationDigestHash", avs, operatorSetIds, salt, expiry) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateOperatorSetRegistrationDigestHash is a free data retrieval call binding the contract method 0x955e6696. +// +// Solidity: function calculateOperatorSetRegistrationDigestHash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectory *AVSDirectorySession) CalculateOperatorSetRegistrationDigestHash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectory.Contract.CalculateOperatorSetRegistrationDigestHash(&_AVSDirectory.CallOpts, avs, operatorSetIds, salt, expiry) +} + +// CalculateOperatorSetRegistrationDigestHash is a free data retrieval call binding the contract method 0x955e6696. +// +// Solidity: function calculateOperatorSetRegistrationDigestHash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectory *AVSDirectoryCallerSession) CalculateOperatorSetRegistrationDigestHash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectory.Contract.CalculateOperatorSetRegistrationDigestHash(&_AVSDirectory.CallOpts, avs, operatorSetIds, salt, expiry) +} + // Delegation is a free data retrieval call binding the contract method 0xdf5cf723. // // Solidity: function delegation() view returns(address) @@ -395,395 +687,2366 @@ func (_AVSDirectory *AVSDirectoryCallerSession) DomainSeparator() ([32]byte, err return _AVSDirectory.Contract.DomainSeparator(&_AVSDirectory.CallOpts) } -// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +<<<<<<< HEAD +<<<<<<< HEAD +// GetNumOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x1023aa35. // -// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) -func (_AVSDirectory *AVSDirectoryCaller) OperatorSaltIsSpent(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte) (bool, error) { +// Solidity: function getNumOperatorsInOperatorSet((address,uint32) operatorSet) view returns(uint256) +func (_AVSDirectory *AVSDirectoryCaller) GetNumOperatorsInOperatorSet(opts *bind.CallOpts, operatorSet IAVSDirectoryOperatorSet) (*big.Int, error) { var out []interface{} - err := _AVSDirectory.contract.Call(opts, &out, "operatorSaltIsSpent", arg0, arg1) + err := _AVSDirectory.contract.Call(opts, &out, "getNumOperatorsInOperatorSet", operatorSet) if err != nil { - return *new(bool), err + return *new(*big.Int), err } - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } -// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// GetNumOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x1023aa35. // -// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) -func (_AVSDirectory *AVSDirectorySession) OperatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { - return _AVSDirectory.Contract.OperatorSaltIsSpent(&_AVSDirectory.CallOpts, arg0, arg1) +// Solidity: function getNumOperatorsInOperatorSet((address,uint32) operatorSet) view returns(uint256) +func (_AVSDirectory *AVSDirectorySession) GetNumOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet) (*big.Int, error) { + return _AVSDirectory.Contract.GetNumOperatorsInOperatorSet(&_AVSDirectory.CallOpts, operatorSet) } -// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// GetNumOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x1023aa35. // -// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) -func (_AVSDirectory *AVSDirectoryCallerSession) OperatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { - return _AVSDirectory.Contract.OperatorSaltIsSpent(&_AVSDirectory.CallOpts, arg0, arg1) +// Solidity: function getNumOperatorsInOperatorSet((address,uint32) operatorSet) view returns(uint256) +func (_AVSDirectory *AVSDirectoryCallerSession) GetNumOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet) (*big.Int, error) { + return _AVSDirectory.Contract.GetNumOperatorsInOperatorSet(&_AVSDirectory.CallOpts, operatorSet) } -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// GetOperatorSetsOfOperator is a free data retrieval call binding the contract method 0x16ae76cb. // -// Solidity: function owner() view returns(address) -func (_AVSDirectory *AVSDirectoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function getOperatorSetsOfOperator(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_AVSDirectory *AVSDirectoryCaller) GetOperatorSetsOfOperator(opts *bind.CallOpts, operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { var out []interface{} - err := _AVSDirectory.contract.Call(opts, &out, "owner") + err := _AVSDirectory.contract.Call(opts, &out, "getOperatorSetsOfOperator", operator, start, length) if err != nil { - return *new(common.Address), err + return *new([]IAVSDirectoryOperatorSet), err } - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + out0 := *abi.ConvertType(out[0], new([]IAVSDirectoryOperatorSet)).(*[]IAVSDirectoryOperatorSet) return out0, err } -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// GetOperatorSetsOfOperator is a free data retrieval call binding the contract method 0x16ae76cb. // -// Solidity: function owner() view returns(address) -func (_AVSDirectory *AVSDirectorySession) Owner() (common.Address, error) { - return _AVSDirectory.Contract.Owner(&_AVSDirectory.CallOpts) +// Solidity: function getOperatorSetsOfOperator(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_AVSDirectory *AVSDirectorySession) GetOperatorSetsOfOperator(operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + return _AVSDirectory.Contract.GetOperatorSetsOfOperator(&_AVSDirectory.CallOpts, operator, start, length) } -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// GetOperatorSetsOfOperator is a free data retrieval call binding the contract method 0x16ae76cb. // -// Solidity: function owner() view returns(address) -func (_AVSDirectory *AVSDirectoryCallerSession) Owner() (common.Address, error) { - return _AVSDirectory.Contract.Owner(&_AVSDirectory.CallOpts) +// Solidity: function getOperatorSetsOfOperator(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_AVSDirectory *AVSDirectoryCallerSession) GetOperatorSetsOfOperator(operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + return _AVSDirectory.Contract.GetOperatorSetsOfOperator(&_AVSDirectory.CallOpts, operator, start, length) } -// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// GetOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x7357723b. // -// Solidity: function paused(uint8 index) view returns(bool) -func (_AVSDirectory *AVSDirectoryCaller) Paused(opts *bind.CallOpts, index uint8) (bool, error) { +// Solidity: function getOperatorsInOperatorSet((address,uint32) operatorSet, uint256 start, uint256 length) view returns(address[] operators) +func (_AVSDirectory *AVSDirectoryCaller) GetOperatorsInOperatorSet(opts *bind.CallOpts, operatorSet IAVSDirectoryOperatorSet, start *big.Int, length *big.Int) ([]common.Address, error) { var out []interface{} - err := _AVSDirectory.contract.Call(opts, &out, "paused", index) + err := _AVSDirectory.contract.Call(opts, &out, "getOperatorsInOperatorSet", operatorSet, start, length) if err != nil { - return *new(bool), err + return *new([]common.Address), err } - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) return out0, err } -// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// GetOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x7357723b. // -// Solidity: function paused(uint8 index) view returns(bool) -func (_AVSDirectory *AVSDirectorySession) Paused(index uint8) (bool, error) { - return _AVSDirectory.Contract.Paused(&_AVSDirectory.CallOpts, index) +// Solidity: function getOperatorsInOperatorSet((address,uint32) operatorSet, uint256 start, uint256 length) view returns(address[] operators) +func (_AVSDirectory *AVSDirectorySession) GetOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet, start *big.Int, length *big.Int) ([]common.Address, error) { + return _AVSDirectory.Contract.GetOperatorsInOperatorSet(&_AVSDirectory.CallOpts, operatorSet, start, length) } -// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// GetOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x7357723b. // -// Solidity: function paused(uint8 index) view returns(bool) -func (_AVSDirectory *AVSDirectoryCallerSession) Paused(index uint8) (bool, error) { - return _AVSDirectory.Contract.Paused(&_AVSDirectory.CallOpts, index) +// Solidity: function getOperatorsInOperatorSet((address,uint32) operatorSet, uint256 start, uint256 length) view returns(address[] operators) +func (_AVSDirectory *AVSDirectoryCallerSession) GetOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet, start *big.Int, length *big.Int) ([]common.Address, error) { + return _AVSDirectory.Contract.GetOperatorsInOperatorSet(&_AVSDirectory.CallOpts, operatorSet, start, length) } -// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. +======= +// IsMember is a free data retrieval call binding the contract method 0x3c4385d0. +>>>>>>> ce94473c (feat: operator commission bips (#627)) +======= +// FreeMagnitude is a free data retrieval call binding the contract method 0x5fd6abfd. +>>>>>>> 6b2ab7ed (build: bindings) // -// Solidity: function paused() view returns(uint256) -func (_AVSDirectory *AVSDirectoryCaller) Paused0(opts *bind.CallOpts) (*big.Int, error) { +// Solidity: function freeMagnitude(address , address ) view returns(uint64) +func (_AVSDirectory *AVSDirectoryCaller) FreeMagnitude(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (uint64, error) { var out []interface{} - err := _AVSDirectory.contract.Call(opts, &out, "paused0") + err := _AVSDirectory.contract.Call(opts, &out, "freeMagnitude", arg0, arg1) if err != nil { - return *new(*big.Int), err + return *new(uint64), err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) return out0, err } -// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// FreeMagnitude is a free data retrieval call binding the contract method 0x5fd6abfd. // -// Solidity: function paused() view returns(uint256) -func (_AVSDirectory *AVSDirectorySession) Paused0() (*big.Int, error) { - return _AVSDirectory.Contract.Paused0(&_AVSDirectory.CallOpts) +// Solidity: function freeMagnitude(address , address ) view returns(uint64) +func (_AVSDirectory *AVSDirectorySession) FreeMagnitude(arg0 common.Address, arg1 common.Address) (uint64, error) { + return _AVSDirectory.Contract.FreeMagnitude(&_AVSDirectory.CallOpts, arg0, arg1) } -// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// FreeMagnitude is a free data retrieval call binding the contract method 0x5fd6abfd. // -// Solidity: function paused() view returns(uint256) -func (_AVSDirectory *AVSDirectoryCallerSession) Paused0() (*big.Int, error) { - return _AVSDirectory.Contract.Paused0(&_AVSDirectory.CallOpts) +// Solidity: function freeMagnitude(address , address ) view returns(uint64) +func (_AVSDirectory *AVSDirectoryCallerSession) FreeMagnitude(arg0 common.Address, arg1 common.Address) (uint64, error) { + return _AVSDirectory.Contract.FreeMagnitude(&_AVSDirectory.CallOpts, arg0, arg1) } -// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// GetSlashableBips is a free data retrieval call binding the contract method 0x33429a6a. // -// Solidity: function pauserRegistry() view returns(address) -func (_AVSDirectory *AVSDirectoryCaller) PauserRegistry(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function getSlashableBips(address operator, (address,uint32) operatorSet, address strategy, uint32 timestamp) view returns(uint16) +func (_AVSDirectory *AVSDirectoryCaller) GetSlashableBips(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet, strategy common.Address, timestamp uint32) (uint16, error) { var out []interface{} - err := _AVSDirectory.contract.Call(opts, &out, "pauserRegistry") + err := _AVSDirectory.contract.Call(opts, &out, "getSlashableBips", operator, operatorSet, strategy, timestamp) if err != nil { - return *new(common.Address), err + return *new(uint16), err } - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } -// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// GetSlashableBips is a free data retrieval call binding the contract method 0x33429a6a. // -// Solidity: function pauserRegistry() view returns(address) -func (_AVSDirectory *AVSDirectorySession) PauserRegistry() (common.Address, error) { - return _AVSDirectory.Contract.PauserRegistry(&_AVSDirectory.CallOpts) +// Solidity: function getSlashableBips(address operator, (address,uint32) operatorSet, address strategy, uint32 timestamp) view returns(uint16) +func (_AVSDirectory *AVSDirectorySession) GetSlashableBips(operator common.Address, operatorSet IAVSDirectoryOperatorSet, strategy common.Address, timestamp uint32) (uint16, error) { + return _AVSDirectory.Contract.GetSlashableBips(&_AVSDirectory.CallOpts, operator, operatorSet, strategy, timestamp) } -// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// GetSlashableBips is a free data retrieval call binding the contract method 0x33429a6a. // -// Solidity: function pauserRegistry() view returns(address) -func (_AVSDirectory *AVSDirectoryCallerSession) PauserRegistry() (common.Address, error) { - return _AVSDirectory.Contract.PauserRegistry(&_AVSDirectory.CallOpts) +// Solidity: function getSlashableBips(address operator, (address,uint32) operatorSet, address strategy, uint32 timestamp) view returns(uint16) +func (_AVSDirectory *AVSDirectoryCallerSession) GetSlashableBips(operator common.Address, operatorSet IAVSDirectoryOperatorSet, strategy common.Address, timestamp uint32) (uint16, error) { + return _AVSDirectory.Contract.GetSlashableBips(&_AVSDirectory.CallOpts, operator, operatorSet, strategy, timestamp) } -// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. // -// Solidity: function cancelSalt(bytes32 salt) returns() -func (_AVSDirectory *AVSDirectoryTransactor) CancelSalt(opts *bind.TransactOpts, salt [32]byte) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "cancelSalt", salt) -} +// Solidity: function inTotalOperatorSets(address operator) view returns(uint256) +func (_AVSDirectory *AVSDirectoryCaller) InTotalOperatorSets(opts *bind.CallOpts, operator common.Address) (*big.Int, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "inTotalOperatorSets", operator) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err -// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. -// -// Solidity: function cancelSalt(bytes32 salt) returns() -func (_AVSDirectory *AVSDirectorySession) CancelSalt(salt [32]byte) (*types.Transaction, error) { - return _AVSDirectory.Contract.CancelSalt(&_AVSDirectory.TransactOpts, salt) } -// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. // -// Solidity: function cancelSalt(bytes32 salt) returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) CancelSalt(salt [32]byte) (*types.Transaction, error) { - return _AVSDirectory.Contract.CancelSalt(&_AVSDirectory.TransactOpts, salt) +// Solidity: function inTotalOperatorSets(address operator) view returns(uint256) +func (_AVSDirectory *AVSDirectorySession) InTotalOperatorSets(operator common.Address) (*big.Int, error) { + return _AVSDirectory.Contract.InTotalOperatorSets(&_AVSDirectory.CallOpts, operator) } -// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. // -// Solidity: function deregisterOperatorFromAVS(address operator) returns() -func (_AVSDirectory *AVSDirectoryTransactor) DeregisterOperatorFromAVS(opts *bind.TransactOpts, operator common.Address) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "deregisterOperatorFromAVS", operator) +// Solidity: function inTotalOperatorSets(address operator) view returns(uint256) +func (_AVSDirectory *AVSDirectoryCallerSession) InTotalOperatorSets(operator common.Address) (*big.Int, error) { + return _AVSDirectory.Contract.InTotalOperatorSets(&_AVSDirectory.CallOpts, operator) } -// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// IsMember is a free data retrieval call binding the contract method 0xda2ff05d. // -// Solidity: function deregisterOperatorFromAVS(address operator) returns() -func (_AVSDirectory *AVSDirectorySession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { - return _AVSDirectory.Contract.DeregisterOperatorFromAVS(&_AVSDirectory.TransactOpts, operator) +// Solidity: function isMember(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectory *AVSDirectoryCaller) IsMember(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "isMember", operator, operatorSet) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + } -// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// IsMember is a free data retrieval call binding the contract method 0xda2ff05d. // -// Solidity: function deregisterOperatorFromAVS(address operator) returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { - return _AVSDirectory.Contract.DeregisterOperatorFromAVS(&_AVSDirectory.TransactOpts, operator) +// Solidity: function isMember(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectory *AVSDirectorySession) IsMember(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _AVSDirectory.Contract.IsMember(&_AVSDirectory.CallOpts, operator, operatorSet) } -// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. +// IsMember is a free data retrieval call binding the contract method 0xda2ff05d. // -// Solidity: function initialize(address initialOwner, address _pauserRegistry, uint256 initialPausedStatus) returns() -func (_AVSDirectory *AVSDirectoryTransactor) Initialize(opts *bind.TransactOpts, initialOwner common.Address, _pauserRegistry common.Address, initialPausedStatus *big.Int) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "initialize", initialOwner, _pauserRegistry, initialPausedStatus) +// Solidity: function isMember(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectory *AVSDirectoryCallerSession) IsMember(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _AVSDirectory.Contract.IsMember(&_AVSDirectory.CallOpts, operator, operatorSet) } -// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. +// IsOperatorSet is a free data retrieval call binding the contract method 0x84d76f7b. // -// Solidity: function initialize(address initialOwner, address _pauserRegistry, uint256 initialPausedStatus) returns() -func (_AVSDirectory *AVSDirectorySession) Initialize(initialOwner common.Address, _pauserRegistry common.Address, initialPausedStatus *big.Int) (*types.Transaction, error) { - return _AVSDirectory.Contract.Initialize(&_AVSDirectory.TransactOpts, initialOwner, _pauserRegistry, initialPausedStatus) +// Solidity: function isOperatorSet(address , uint32 ) view returns(bool) +func (_AVSDirectory *AVSDirectoryCaller) IsOperatorSet(opts *bind.CallOpts, arg0 common.Address, arg1 uint32) (bool, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "isOperatorSet", arg0, arg1) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + } -// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. +// IsOperatorSet is a free data retrieval call binding the contract method 0x84d76f7b. // -// Solidity: function initialize(address initialOwner, address _pauserRegistry, uint256 initialPausedStatus) returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) Initialize(initialOwner common.Address, _pauserRegistry common.Address, initialPausedStatus *big.Int) (*types.Transaction, error) { - return _AVSDirectory.Contract.Initialize(&_AVSDirectory.TransactOpts, initialOwner, _pauserRegistry, initialPausedStatus) +// Solidity: function isOperatorSet(address , uint32 ) view returns(bool) +func (_AVSDirectory *AVSDirectorySession) IsOperatorSet(arg0 common.Address, arg1 uint32) (bool, error) { + return _AVSDirectory.Contract.IsOperatorSet(&_AVSDirectory.CallOpts, arg0, arg1) } -// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// IsOperatorSet is a free data retrieval call binding the contract method 0x84d76f7b. // -// Solidity: function pause(uint256 newPausedStatus) returns() -func (_AVSDirectory *AVSDirectoryTransactor) Pause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "pause", newPausedStatus) +// Solidity: function isOperatorSet(address , uint32 ) view returns(bool) +func (_AVSDirectory *AVSDirectoryCallerSession) IsOperatorSet(arg0 common.Address, arg1 uint32) (bool, error) { + return _AVSDirectory.Contract.IsOperatorSet(&_AVSDirectory.CallOpts, arg0, arg1) } -// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// IsOperatorSetAVS is a free data retrieval call binding the contract method 0x7673e93a. // -// Solidity: function pause(uint256 newPausedStatus) returns() -func (_AVSDirectory *AVSDirectorySession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { - return _AVSDirectory.Contract.Pause(&_AVSDirectory.TransactOpts, newPausedStatus) +// Solidity: function isOperatorSetAVS(address ) view returns(bool) +func (_AVSDirectory *AVSDirectoryCaller) IsOperatorSetAVS(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "isOperatorSetAVS", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + } -// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// IsOperatorSetAVS is a free data retrieval call binding the contract method 0x7673e93a. // -// Solidity: function pause(uint256 newPausedStatus) returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { - return _AVSDirectory.Contract.Pause(&_AVSDirectory.TransactOpts, newPausedStatus) +// Solidity: function isOperatorSetAVS(address ) view returns(bool) +func (_AVSDirectory *AVSDirectorySession) IsOperatorSetAVS(arg0 common.Address) (bool, error) { + return _AVSDirectory.Contract.IsOperatorSetAVS(&_AVSDirectory.CallOpts, arg0) } -// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// IsOperatorSetAVS is a free data retrieval call binding the contract method 0x7673e93a. // -// Solidity: function pauseAll() returns() -func (_AVSDirectory *AVSDirectoryTransactor) PauseAll(opts *bind.TransactOpts) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "pauseAll") +// Solidity: function isOperatorSetAVS(address ) view returns(bool) +func (_AVSDirectory *AVSDirectoryCallerSession) IsOperatorSetAVS(arg0 common.Address) (bool, error) { + return _AVSDirectory.Contract.IsOperatorSetAVS(&_AVSDirectory.CallOpts, arg0) } -// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// IsOperatorSlashable is a free data retrieval call binding the contract method 0x1352c3e6. // -// Solidity: function pauseAll() returns() -func (_AVSDirectory *AVSDirectorySession) PauseAll() (*types.Transaction, error) { - return _AVSDirectory.Contract.PauseAll(&_AVSDirectory.TransactOpts) +// Solidity: function isOperatorSlashable(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectory *AVSDirectoryCaller) IsOperatorSlashable(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "isOperatorSlashable", operator, operatorSet) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + } -// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// IsOperatorSlashable is a free data retrieval call binding the contract method 0x1352c3e6. // -// Solidity: function pauseAll() returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) PauseAll() (*types.Transaction, error) { - return _AVSDirectory.Contract.PauseAll(&_AVSDirectory.TransactOpts) +// Solidity: function isOperatorSlashable(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectory *AVSDirectorySession) IsOperatorSlashable(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _AVSDirectory.Contract.IsOperatorSlashable(&_AVSDirectory.CallOpts, operator, operatorSet) } -// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// IsOperatorSlashable is a free data retrieval call binding the contract method 0x1352c3e6. // -// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() -func (_AVSDirectory *AVSDirectoryTransactor) RegisterOperatorToAVS(opts *bind.TransactOpts, operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "registerOperatorToAVS", operator, operatorSignature) +// Solidity: function isOperatorSlashable(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectory *AVSDirectoryCallerSession) IsOperatorSlashable(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _AVSDirectory.Contract.IsOperatorSlashable(&_AVSDirectory.CallOpts, operator, operatorSet) } -// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. // -// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() -func (_AVSDirectory *AVSDirectorySession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { - return _AVSDirectory.Contract.RegisterOperatorToAVS(&_AVSDirectory.TransactOpts, operator, operatorSignature) +// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) +func (_AVSDirectory *AVSDirectoryCaller) OperatorSaltIsSpent(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte) (bool, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "operatorSaltIsSpent", arg0, arg1) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + } -// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. // -// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { - return _AVSDirectory.Contract.RegisterOperatorToAVS(&_AVSDirectory.TransactOpts, operator, operatorSignature) +// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) +func (_AVSDirectory *AVSDirectorySession) OperatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { + return _AVSDirectory.Contract.OperatorSaltIsSpent(&_AVSDirectory.CallOpts, arg0, arg1) } -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. // -// Solidity: function renounceOwnership() returns() -func (_AVSDirectory *AVSDirectoryTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "renounceOwnership") +// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) +func (_AVSDirectory *AVSDirectoryCallerSession) OperatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { + return _AVSDirectory.Contract.OperatorSaltIsSpent(&_AVSDirectory.CallOpts, arg0, arg1) } -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +<<<<<<< HEAD +<<<<<<< HEAD +// OperatorSetMemberAtIndex is a free data retrieval call binding the contract method 0x411d415b. // -// Solidity: function renounceOwnership() returns() -func (_AVSDirectory *AVSDirectorySession) RenounceOwnership() (*types.Transaction, error) { - return _AVSDirectory.Contract.RenounceOwnership(&_AVSDirectory.TransactOpts) +// Solidity: function operatorSetMemberAtIndex((address,uint32) operatorSet, uint256 index) view returns(address) +func (_AVSDirectory *AVSDirectoryCaller) OperatorSetMemberAtIndex(opts *bind.CallOpts, operatorSet IAVSDirectoryOperatorSet, index *big.Int) (common.Address, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "operatorSetMemberAtIndex", operatorSet, index) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) +======= +// OperatorSetMemberCount is a free data retrieval call binding the contract method 0xdae226b6. +// +// Solidity: function operatorSetMemberCount(address , uint32 ) view returns(uint256) +func (_AVSDirectory *AVSDirectoryCaller) OperatorSetMemberCount(opts *bind.CallOpts, arg0 common.Address, arg1 uint32) (*big.Int, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "operatorSetMemberCount", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) +>>>>>>> 6b2ab7ed (build: bindings) + + return out0, err + } -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +<<<<<<< HEAD +// OperatorSetMemberAtIndex is a free data retrieval call binding the contract method 0x411d415b. // -// Solidity: function renounceOwnership() returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _AVSDirectory.Contract.RenounceOwnership(&_AVSDirectory.TransactOpts) +// Solidity: function operatorSetMemberAtIndex((address,uint32) operatorSet, uint256 index) view returns(address) +func (_AVSDirectory *AVSDirectorySession) OperatorSetMemberAtIndex(operatorSet IAVSDirectoryOperatorSet, index *big.Int) (common.Address, error) { + return _AVSDirectory.Contract.OperatorSetMemberAtIndex(&_AVSDirectory.CallOpts, operatorSet, index) +} + +// OperatorSetMemberAtIndex is a free data retrieval call binding the contract method 0x411d415b. +// +// Solidity: function operatorSetMemberAtIndex((address,uint32) operatorSet, uint256 index) view returns(address) +func (_AVSDirectory *AVSDirectoryCallerSession) OperatorSetMemberAtIndex(operatorSet IAVSDirectoryOperatorSet, index *big.Int) (common.Address, error) { + return _AVSDirectory.Contract.OperatorSetMemberAtIndex(&_AVSDirectory.CallOpts, operatorSet, index) +} + +// OperatorSetsMemberOfAtIndex is a free data retrieval call binding the contract method 0xb5a768ca. +// +// Solidity: function operatorSetsMemberOfAtIndex(address operator, uint256 index) view returns((address,uint32)) +func (_AVSDirectory *AVSDirectoryCaller) OperatorSetsMemberOfAtIndex(opts *bind.CallOpts, operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "operatorSetsMemberOfAtIndex", operator, index) +======= +// OperatorSetMemberCount is a free data retrieval call binding the contract method 0xdae226b6. +// +// Solidity: function operatorSetMemberCount(address , uint32 ) view returns(uint256) +func (_AVSDirectory *AVSDirectorySession) OperatorSetMemberCount(arg0 common.Address, arg1 uint32) (*big.Int, error) { + return _AVSDirectory.Contract.OperatorSetMemberCount(&_AVSDirectory.CallOpts, arg0, arg1) +} + +// OperatorSetMemberCount is a free data retrieval call binding the contract method 0xdae226b6. +// +// Solidity: function operatorSetMemberCount(address , uint32 ) view returns(uint256) +func (_AVSDirectory *AVSDirectoryCallerSession) OperatorSetMemberCount(arg0 common.Address, arg1 uint32) (*big.Int, error) { + return _AVSDirectory.Contract.OperatorSetMemberCount(&_AVSDirectory.CallOpts, arg0, arg1) +} + +// OperatorSetStatus is a free data retrieval call binding the contract method 0x1e68134e. +// +// Solidity: function operatorSetStatus(address , address , uint32 ) view returns(bool registered, uint32 lastDeregisteredTimestamp) +func (_AVSDirectory *AVSDirectoryCaller) OperatorSetStatus(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 uint32) (struct { + Registered bool + LastDeregisteredTimestamp uint32 +}, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "operatorSetStatus", arg0, arg1, arg2) + + outstruct := new(struct { + Registered bool + LastDeregisteredTimestamp uint32 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Registered = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.LastDeregisteredTimestamp = *abi.ConvertType(out[1], new(uint32)).(*uint32) + + return *outstruct, err + +} + +// OperatorSetStatus is a free data retrieval call binding the contract method 0x1e68134e. +// +// Solidity: function operatorSetStatus(address , address , uint32 ) view returns(bool registered, uint32 lastDeregisteredTimestamp) +func (_AVSDirectory *AVSDirectorySession) OperatorSetStatus(arg0 common.Address, arg1 common.Address, arg2 uint32) (struct { + Registered bool + LastDeregisteredTimestamp uint32 +}, error) { + return _AVSDirectory.Contract.OperatorSetStatus(&_AVSDirectory.CallOpts, arg0, arg1, arg2) +} + +// OperatorSetStatus is a free data retrieval call binding the contract method 0x1e68134e. +// +// Solidity: function operatorSetStatus(address , address , uint32 ) view returns(bool registered, uint32 lastDeregisteredTimestamp) +func (_AVSDirectory *AVSDirectoryCallerSession) OperatorSetStatus(arg0 common.Address, arg1 common.Address, arg2 uint32) (struct { + Registered bool + LastDeregisteredTimestamp uint32 +}, error) { + return _AVSDirectory.Contract.OperatorSetStatus(&_AVSDirectory.CallOpts, arg0, arg1, arg2) +} + +// OperatorSetsMemberOf is a free data retrieval call binding the contract method 0x0d5387c5. +// +// Solidity: function operatorSetsMemberOf(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_AVSDirectory *AVSDirectoryCaller) OperatorSetsMemberOf(opts *bind.CallOpts, operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "operatorSetsMemberOf", operator, start, length) + + if err != nil { + return *new([]IAVSDirectoryOperatorSet), err + } + + out0 := *abi.ConvertType(out[0], new([]IAVSDirectoryOperatorSet)).(*[]IAVSDirectoryOperatorSet) + + return out0, err + +} + +// OperatorSetsMemberOf is a free data retrieval call binding the contract method 0x0d5387c5. +// +// Solidity: function operatorSetsMemberOf(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_AVSDirectory *AVSDirectorySession) OperatorSetsMemberOf(operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + return _AVSDirectory.Contract.OperatorSetsMemberOf(&_AVSDirectory.CallOpts, operator, start, length) +} + +// OperatorSetsMemberOf is a free data retrieval call binding the contract method 0x0d5387c5. +// +// Solidity: function operatorSetsMemberOf(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_AVSDirectory *AVSDirectoryCallerSession) OperatorSetsMemberOf(operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + return _AVSDirectory.Contract.OperatorSetsMemberOf(&_AVSDirectory.CallOpts, operator, start, length) +} + +// OperatorSetsMemberOf0 is a free data retrieval call binding the contract method 0x8de54944. +// +// Solidity: function operatorSetsMemberOf(address operator, uint256 index) view returns((address,uint32)) +func (_AVSDirectory *AVSDirectoryCaller) OperatorSetsMemberOf0(opts *bind.CallOpts, operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + var out []interface{} + err := _AVSDirectory.contract.Call(opts, &out, "operatorSetsMemberOf0", operator, index) +>>>>>>> 6b2ab7ed (build: bindings) + + if err != nil { + return *new(IAVSDirectoryOperatorSet), err + } + + out0 := *abi.ConvertType(out[0], new(IAVSDirectoryOperatorSet)).(*IAVSDirectoryOperatorSet) + + return out0, err + +} + +<<<<<<< HEAD +// OperatorSetsMemberOfAtIndex is a free data retrieval call binding the contract method 0xb5a768ca. +// +// Solidity: function operatorSetsMemberOfAtIndex(address operator, uint256 index) view returns((address,uint32)) +func (_AVSDirectory *AVSDirectorySession) OperatorSetsMemberOfAtIndex(operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + return _AVSDirectory.Contract.OperatorSetsMemberOfAtIndex(&_AVSDirectory.CallOpts, operator, index) +} + +// OperatorSetsMemberOfAtIndex is a free data retrieval call binding the contract method 0xb5a768ca. +// +// Solidity: function operatorSetsMemberOfAtIndex(address operator, uint256 index) view returns((address,uint32)) +func (_AVSDirectory *AVSDirectoryCallerSession) OperatorSetsMemberOfAtIndex(operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + return _AVSDirectory.Contract.OperatorSetsMemberOfAtIndex(&_AVSDirectory.CallOpts, operator, index) +} + +======= +>>>>>>> ce94473c (feat: operator commission bips (#627)) +======= +// OperatorSetsMemberOf0 is a free data retrieval call binding the contract method 0x8de54944. +// +// Solidity: function operatorSetsMemberOf(address operator, uint256 index) view returns((address,uint32)) +func (_AVSDirectory *AVSDirectorySession) OperatorSetsMemberOf0(operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + return _AVSDirectory.Contract.OperatorSetsMemberOf0(&_AVSDirectory.CallOpts, operator, index) +} + +// OperatorSetsMemberOf0 is a free data retrieval call binding the contract method 0x8de54944. +// +// Solidity: function operatorSetsMemberOf(address operator, uint256 index) view returns((address,uint32)) +func (_AVSDirectory *AVSDirectoryCallerSession) OperatorSetsMemberOf0(operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + return _AVSDirectory.Contract.OperatorSetsMemberOf0(&_AVSDirectory.CallOpts, operator, index) +} + +>>>>>>> 6b2ab7ed (build: bindings) +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_AVSDirectory *AVSDirectoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _AVSDirectory.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 + } -// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. -// -// Solidity: function setPauserRegistry(address newPauserRegistry) returns() -func (_AVSDirectory *AVSDirectoryTransactor) SetPauserRegistry(opts *bind.TransactOpts, newPauserRegistry common.Address) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "setPauserRegistry", newPauserRegistry) -} +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_AVSDirectory *AVSDirectorySession) Owner() (common.Address, error) { + return _AVSDirectory.Contract.Owner(&_AVSDirectory.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_AVSDirectory *AVSDirectoryCallerSession) Owner() (common.Address, error) { + return _AVSDirectory.Contract.Owner(&_AVSDirectory.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// +// Solidity: function paused(uint8 index) view returns(bool) +func (_AVSDirectory *AVSDirectoryCaller) Paused(opts *bind.CallOpts, index uint8) (bool, error) { + var out []interface{} + err := _AVSDirectory.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 (_AVSDirectory *AVSDirectorySession) Paused(index uint8) (bool, error) { + return _AVSDirectory.Contract.Paused(&_AVSDirectory.CallOpts, index) +} + +// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// +// Solidity: function paused(uint8 index) view returns(bool) +func (_AVSDirectory *AVSDirectoryCallerSession) Paused(index uint8) (bool, error) { + return _AVSDirectory.Contract.Paused(&_AVSDirectory.CallOpts, index) +} + +// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(uint256) +func (_AVSDirectory *AVSDirectoryCaller) Paused0(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _AVSDirectory.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 (_AVSDirectory *AVSDirectorySession) Paused0() (*big.Int, error) { + return _AVSDirectory.Contract.Paused0(&_AVSDirectory.CallOpts) +} + +// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(uint256) +func (_AVSDirectory *AVSDirectoryCallerSession) Paused0() (*big.Int, error) { + return _AVSDirectory.Contract.Paused0(&_AVSDirectory.CallOpts) +} + +// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// +// Solidity: function pauserRegistry() view returns(address) +func (_AVSDirectory *AVSDirectoryCaller) PauserRegistry(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _AVSDirectory.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 (_AVSDirectory *AVSDirectorySession) PauserRegistry() (common.Address, error) { + return _AVSDirectory.Contract.PauserRegistry(&_AVSDirectory.CallOpts) +} + +// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// +// Solidity: function pauserRegistry() view returns(address) +func (_AVSDirectory *AVSDirectoryCallerSession) PauserRegistry() (common.Address, error) { + return _AVSDirectory.Contract.PauserRegistry(&_AVSDirectory.CallOpts) +} + +// Allocate is a paid mutator transaction binding the contract method 0x70196708. +// +// Solidity: function allocate(address operator, (address,(address,uint32)[],uint64[])[] allocations, (bytes,bytes32,uint256) allocatorSignature) returns() +func (_AVSDirectory *AVSDirectoryTransactor) Allocate(opts *bind.TransactOpts, operator common.Address, allocations []IAVSDirectoryMagnitudeAdjustment, allocatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "allocate", operator, allocations, allocatorSignature) +} + +// Allocate is a paid mutator transaction binding the contract method 0x70196708. +// +// Solidity: function allocate(address operator, (address,(address,uint32)[],uint64[])[] allocations, (bytes,bytes32,uint256) allocatorSignature) returns() +func (_AVSDirectory *AVSDirectorySession) Allocate(operator common.Address, allocations []IAVSDirectoryMagnitudeAdjustment, allocatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.Contract.Allocate(&_AVSDirectory.TransactOpts, operator, allocations, allocatorSignature) +} + +// Allocate is a paid mutator transaction binding the contract method 0x70196708. +// +// Solidity: function allocate(address operator, (address,(address,uint32)[],uint64[])[] allocations, (bytes,bytes32,uint256) allocatorSignature) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) Allocate(operator common.Address, allocations []IAVSDirectoryMagnitudeAdjustment, allocatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.Contract.Allocate(&_AVSDirectory.TransactOpts, operator, allocations, allocatorSignature) +} + +// BecomeOperatorSetAVS is a paid mutator transaction binding the contract method 0xaec205c5. +// +// Solidity: function becomeOperatorSetAVS() returns() +func (_AVSDirectory *AVSDirectoryTransactor) BecomeOperatorSetAVS(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "becomeOperatorSetAVS") +} + +// BecomeOperatorSetAVS is a paid mutator transaction binding the contract method 0xaec205c5. +// +// Solidity: function becomeOperatorSetAVS() returns() +func (_AVSDirectory *AVSDirectorySession) BecomeOperatorSetAVS() (*types.Transaction, error) { + return _AVSDirectory.Contract.BecomeOperatorSetAVS(&_AVSDirectory.TransactOpts) +} + +// BecomeOperatorSetAVS is a paid mutator transaction binding the contract method 0xaec205c5. +// +// Solidity: function becomeOperatorSetAVS() returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) BecomeOperatorSetAVS() (*types.Transaction, error) { + return _AVSDirectory.Contract.BecomeOperatorSetAVS(&_AVSDirectory.TransactOpts) +} + +// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// +// Solidity: function cancelSalt(bytes32 salt) returns() +func (_AVSDirectory *AVSDirectoryTransactor) CancelSalt(opts *bind.TransactOpts, salt [32]byte) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "cancelSalt", salt) +} + +// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// +// Solidity: function cancelSalt(bytes32 salt) returns() +func (_AVSDirectory *AVSDirectorySession) CancelSalt(salt [32]byte) (*types.Transaction, error) { + return _AVSDirectory.Contract.CancelSalt(&_AVSDirectory.TransactOpts, salt) +} + +// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// +// Solidity: function cancelSalt(bytes32 salt) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) CancelSalt(salt [32]byte) (*types.Transaction, error) { + return _AVSDirectory.Contract.CancelSalt(&_AVSDirectory.TransactOpts, salt) +} + +// CreateOperatorSets is a paid mutator transaction binding the contract method 0xafe02ed5. +// +// Solidity: function createOperatorSets(uint32[] operatorSetIds) returns() +func (_AVSDirectory *AVSDirectoryTransactor) CreateOperatorSets(opts *bind.TransactOpts, operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "createOperatorSets", operatorSetIds) +} + +// CreateOperatorSets is a paid mutator transaction binding the contract method 0xafe02ed5. +// +// Solidity: function createOperatorSets(uint32[] operatorSetIds) returns() +func (_AVSDirectory *AVSDirectorySession) CreateOperatorSets(operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectory.Contract.CreateOperatorSets(&_AVSDirectory.TransactOpts, operatorSetIds) +} + +// CreateOperatorSets is a paid mutator transaction binding the contract method 0xafe02ed5. +// +// Solidity: function createOperatorSets(uint32[] operatorSetIds) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) CreateOperatorSets(operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectory.Contract.CreateOperatorSets(&_AVSDirectory.TransactOpts, operatorSetIds) +} + +// Deallocate is a paid mutator transaction binding the contract method 0x3367a33c. +// +// Solidity: function deallocate(address operator, (address,(address,uint32)[],uint64[])[] deallocations, (bytes,bytes32,uint256) allocatorSignature) returns() +func (_AVSDirectory *AVSDirectoryTransactor) Deallocate(opts *bind.TransactOpts, operator common.Address, deallocations []IAVSDirectoryMagnitudeAdjustment, allocatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "deallocate", operator, deallocations, allocatorSignature) +} + +// Deallocate is a paid mutator transaction binding the contract method 0x3367a33c. +// +// Solidity: function deallocate(address operator, (address,(address,uint32)[],uint64[])[] deallocations, (bytes,bytes32,uint256) allocatorSignature) returns() +func (_AVSDirectory *AVSDirectorySession) Deallocate(operator common.Address, deallocations []IAVSDirectoryMagnitudeAdjustment, allocatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.Contract.Deallocate(&_AVSDirectory.TransactOpts, operator, deallocations, allocatorSignature) +} + +// Deallocate is a paid mutator transaction binding the contract method 0x3367a33c. +// +// Solidity: function deallocate(address operator, (address,(address,uint32)[],uint64[])[] deallocations, (bytes,bytes32,uint256) allocatorSignature) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) Deallocate(operator common.Address, deallocations []IAVSDirectoryMagnitudeAdjustment, allocatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.Contract.Deallocate(&_AVSDirectory.TransactOpts, operator, deallocations, allocatorSignature) +} + +// DeregisterOperatorFromOperatorSets is a paid mutator transaction binding the contract method 0xc1a8e2c5. +// +// Solidity: function deregisterOperatorFromOperatorSets(address operator, uint32[] operatorSetIds) returns() +func (_AVSDirectory *AVSDirectoryTransactor) DeregisterOperatorFromOperatorSets(opts *bind.TransactOpts, operator common.Address, operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "deregisterOperatorFromOperatorSets", operator, operatorSetIds) +} + +// DeregisterOperatorFromOperatorSets is a paid mutator transaction binding the contract method 0xc1a8e2c5. +// +// Solidity: function deregisterOperatorFromOperatorSets(address operator, uint32[] operatorSetIds) returns() +func (_AVSDirectory *AVSDirectorySession) DeregisterOperatorFromOperatorSets(operator common.Address, operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectory.Contract.DeregisterOperatorFromOperatorSets(&_AVSDirectory.TransactOpts, operator, operatorSetIds) +} + +// DeregisterOperatorFromOperatorSets is a paid mutator transaction binding the contract method 0xc1a8e2c5. +// +// Solidity: function deregisterOperatorFromOperatorSets(address operator, uint32[] operatorSetIds) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) DeregisterOperatorFromOperatorSets(operator common.Address, operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectory.Contract.DeregisterOperatorFromOperatorSets(&_AVSDirectory.TransactOpts, operator, operatorSetIds) +} + +// ForceDeregisterFromOperatorSets is a paid mutator transaction binding the contract method 0x3fee332d. +// +// Solidity: function forceDeregisterFromOperatorSets(address operator, address avs, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectory *AVSDirectoryTransactor) ForceDeregisterFromOperatorSets(opts *bind.TransactOpts, operator common.Address, avs common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "forceDeregisterFromOperatorSets", operator, avs, operatorSetIds, operatorSignature) +} + +// ForceDeregisterFromOperatorSets is a paid mutator transaction binding the contract method 0x3fee332d. +// +// Solidity: function forceDeregisterFromOperatorSets(address operator, address avs, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectory *AVSDirectorySession) ForceDeregisterFromOperatorSets(operator common.Address, avs common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.Contract.ForceDeregisterFromOperatorSets(&_AVSDirectory.TransactOpts, operator, avs, operatorSetIds, operatorSignature) +} + +// ForceDeregisterFromOperatorSets is a paid mutator transaction binding the contract method 0x3fee332d. +// +// Solidity: function forceDeregisterFromOperatorSets(address operator, address avs, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) ForceDeregisterFromOperatorSets(operator common.Address, avs common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.Contract.ForceDeregisterFromOperatorSets(&_AVSDirectory.TransactOpts, operator, avs, operatorSetIds, operatorSignature) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. +// +// Solidity: function initialize(address initialOwner, address _pauserRegistry, uint256 initialPausedStatus) returns() +func (_AVSDirectory *AVSDirectoryTransactor) Initialize(opts *bind.TransactOpts, initialOwner common.Address, _pauserRegistry common.Address, initialPausedStatus *big.Int) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "initialize", initialOwner, _pauserRegistry, initialPausedStatus) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. +// +// Solidity: function initialize(address initialOwner, address _pauserRegistry, uint256 initialPausedStatus) returns() +func (_AVSDirectory *AVSDirectorySession) Initialize(initialOwner common.Address, _pauserRegistry common.Address, initialPausedStatus *big.Int) (*types.Transaction, error) { + return _AVSDirectory.Contract.Initialize(&_AVSDirectory.TransactOpts, initialOwner, _pauserRegistry, initialPausedStatus) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. +// +// Solidity: function initialize(address initialOwner, address _pauserRegistry, uint256 initialPausedStatus) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) Initialize(initialOwner common.Address, _pauserRegistry common.Address, initialPausedStatus *big.Int) (*types.Transaction, error) { + return _AVSDirectory.Contract.Initialize(&_AVSDirectory.TransactOpts, initialOwner, _pauserRegistry, initialPausedStatus) +} + +// MigrateOperatorsToOperatorSets is a paid mutator transaction binding the contract method 0xef2dfa8d. +// +// Solidity: function migrateOperatorsToOperatorSets(address[] operators, uint32[][] operatorSetIds) returns() +func (_AVSDirectory *AVSDirectoryTransactor) MigrateOperatorsToOperatorSets(opts *bind.TransactOpts, operators []common.Address, operatorSetIds [][]uint32) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "migrateOperatorsToOperatorSets", operators, operatorSetIds) +} + +// MigrateOperatorsToOperatorSets is a paid mutator transaction binding the contract method 0xef2dfa8d. +// +// Solidity: function migrateOperatorsToOperatorSets(address[] operators, uint32[][] operatorSetIds) returns() +func (_AVSDirectory *AVSDirectorySession) MigrateOperatorsToOperatorSets(operators []common.Address, operatorSetIds [][]uint32) (*types.Transaction, error) { + return _AVSDirectory.Contract.MigrateOperatorsToOperatorSets(&_AVSDirectory.TransactOpts, operators, operatorSetIds) +} + +// MigrateOperatorsToOperatorSets is a paid mutator transaction binding the contract method 0xef2dfa8d. +// +// Solidity: function migrateOperatorsToOperatorSets(address[] operators, uint32[][] operatorSetIds) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) MigrateOperatorsToOperatorSets(operators []common.Address, operatorSetIds [][]uint32) (*types.Transaction, error) { + return _AVSDirectory.Contract.MigrateOperatorsToOperatorSets(&_AVSDirectory.TransactOpts, operators, operatorSetIds) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 newPausedStatus) returns() +func (_AVSDirectory *AVSDirectoryTransactor) Pause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "pause", newPausedStatus) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 newPausedStatus) returns() +func (_AVSDirectory *AVSDirectorySession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _AVSDirectory.Contract.Pause(&_AVSDirectory.TransactOpts, newPausedStatus) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 newPausedStatus) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _AVSDirectory.Contract.Pause(&_AVSDirectory.TransactOpts, newPausedStatus) +} + +// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// +// Solidity: function pauseAll() returns() +func (_AVSDirectory *AVSDirectoryTransactor) PauseAll(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "pauseAll") +} + +// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// +// Solidity: function pauseAll() returns() +func (_AVSDirectory *AVSDirectorySession) PauseAll() (*types.Transaction, error) { + return _AVSDirectory.Contract.PauseAll(&_AVSDirectory.TransactOpts) +} + +// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// +// Solidity: function pauseAll() returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) PauseAll() (*types.Transaction, error) { + return _AVSDirectory.Contract.PauseAll(&_AVSDirectory.TransactOpts) +} + +// RegisterOperatorToOperatorSets is a paid mutator transaction binding the contract method 0x1e2199e2. +// +// Solidity: function registerOperatorToOperatorSets(address operator, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectory *AVSDirectoryTransactor) RegisterOperatorToOperatorSets(opts *bind.TransactOpts, operator common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "registerOperatorToOperatorSets", operator, operatorSetIds, operatorSignature) +} + +// RegisterOperatorToOperatorSets is a paid mutator transaction binding the contract method 0x1e2199e2. +// +// Solidity: function registerOperatorToOperatorSets(address operator, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectory *AVSDirectorySession) RegisterOperatorToOperatorSets(operator common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.Contract.RegisterOperatorToOperatorSets(&_AVSDirectory.TransactOpts, operator, operatorSetIds, operatorSignature) +} + +// RegisterOperatorToOperatorSets is a paid mutator transaction binding the contract method 0x1e2199e2. +// +// Solidity: function registerOperatorToOperatorSets(address operator, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) RegisterOperatorToOperatorSets(operator common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectory.Contract.RegisterOperatorToOperatorSets(&_AVSDirectory.TransactOpts, operator, operatorSetIds, operatorSignature) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_AVSDirectory *AVSDirectoryTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_AVSDirectory *AVSDirectorySession) RenounceOwnership() (*types.Transaction, error) { + return _AVSDirectory.Contract.RenounceOwnership(&_AVSDirectory.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _AVSDirectory.Contract.RenounceOwnership(&_AVSDirectory.TransactOpts) +} + +// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. +// +// Solidity: function setPauserRegistry(address newPauserRegistry) returns() +func (_AVSDirectory *AVSDirectoryTransactor) SetPauserRegistry(opts *bind.TransactOpts, newPauserRegistry common.Address) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "setPauserRegistry", newPauserRegistry) +} + +// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. +// +// Solidity: function setPauserRegistry(address newPauserRegistry) returns() +func (_AVSDirectory *AVSDirectorySession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { + return _AVSDirectory.Contract.SetPauserRegistry(&_AVSDirectory.TransactOpts, newPauserRegistry) +} + +// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. +// +// Solidity: function setPauserRegistry(address newPauserRegistry) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { + return _AVSDirectory.Contract.SetPauserRegistry(&_AVSDirectory.TransactOpts, newPauserRegistry) +} + +// SlashOperator is a paid mutator transaction binding the contract method 0xbd74a06c. +// +// Solidity: function slashOperator(address operator, uint32 operatorSetId, address[] strategies, uint16 bipsToSlash) returns() +func (_AVSDirectory *AVSDirectoryTransactor) SlashOperator(opts *bind.TransactOpts, operator common.Address, operatorSetId uint32, strategies []common.Address, bipsToSlash uint16) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "slashOperator", operator, operatorSetId, strategies, bipsToSlash) +} + +// SlashOperator is a paid mutator transaction binding the contract method 0xbd74a06c. +// +// Solidity: function slashOperator(address operator, uint32 operatorSetId, address[] strategies, uint16 bipsToSlash) returns() +func (_AVSDirectory *AVSDirectorySession) SlashOperator(operator common.Address, operatorSetId uint32, strategies []common.Address, bipsToSlash uint16) (*types.Transaction, error) { + return _AVSDirectory.Contract.SlashOperator(&_AVSDirectory.TransactOpts, operator, operatorSetId, strategies, bipsToSlash) +} + +// SlashOperator is a paid mutator transaction binding the contract method 0xbd74a06c. +// +// Solidity: function slashOperator(address operator, uint32 operatorSetId, address[] strategies, uint16 bipsToSlash) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) SlashOperator(operator common.Address, operatorSetId uint32, strategies []common.Address, bipsToSlash uint16) (*types.Transaction, error) { + return _AVSDirectory.Contract.SlashOperator(&_AVSDirectory.TransactOpts, operator, operatorSetId, strategies, bipsToSlash) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_AVSDirectory *AVSDirectoryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_AVSDirectory *AVSDirectorySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _AVSDirectory.Contract.TransferOwnership(&_AVSDirectory.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _AVSDirectory.Contract.TransferOwnership(&_AVSDirectory.TransactOpts, newOwner) +} + +// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// +// Solidity: function unpause(uint256 newPausedStatus) returns() +func (_AVSDirectory *AVSDirectoryTransactor) Unpause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "unpause", newPausedStatus) +} + +// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// +// Solidity: function unpause(uint256 newPausedStatus) returns() +func (_AVSDirectory *AVSDirectorySession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _AVSDirectory.Contract.Unpause(&_AVSDirectory.TransactOpts, newPausedStatus) +} + +// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// +// Solidity: function unpause(uint256 newPausedStatus) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _AVSDirectory.Contract.Unpause(&_AVSDirectory.TransactOpts, newPausedStatus) +} + +// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// +// Solidity: function updateAVSMetadataURI(string metadataURI) returns() +func (_AVSDirectory *AVSDirectoryTransactor) UpdateAVSMetadataURI(opts *bind.TransactOpts, metadataURI string) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "updateAVSMetadataURI", metadataURI) +} + +// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// +// Solidity: function updateAVSMetadataURI(string metadataURI) returns() +func (_AVSDirectory *AVSDirectorySession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { + return _AVSDirectory.Contract.UpdateAVSMetadataURI(&_AVSDirectory.TransactOpts, metadataURI) +} + +// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// +// Solidity: function updateAVSMetadataURI(string metadataURI) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { + return _AVSDirectory.Contract.UpdateAVSMetadataURI(&_AVSDirectory.TransactOpts, metadataURI) +} + +// UpdateFreeMagnitude is a paid mutator transaction binding the contract method 0x84b78fc2. +// +// Solidity: function updateFreeMagnitude(address operator, address[] strategies, uint8[] numToComplete) returns() +func (_AVSDirectory *AVSDirectoryTransactor) UpdateFreeMagnitude(opts *bind.TransactOpts, operator common.Address, strategies []common.Address, numToComplete []uint8) (*types.Transaction, error) { + return _AVSDirectory.contract.Transact(opts, "updateFreeMagnitude", operator, strategies, numToComplete) +} + +// UpdateFreeMagnitude is a paid mutator transaction binding the contract method 0x84b78fc2. +// +// Solidity: function updateFreeMagnitude(address operator, address[] strategies, uint8[] numToComplete) returns() +func (_AVSDirectory *AVSDirectorySession) UpdateFreeMagnitude(operator common.Address, strategies []common.Address, numToComplete []uint8) (*types.Transaction, error) { + return _AVSDirectory.Contract.UpdateFreeMagnitude(&_AVSDirectory.TransactOpts, operator, strategies, numToComplete) +} + +// UpdateFreeMagnitude is a paid mutator transaction binding the contract method 0x84b78fc2. +// +// Solidity: function updateFreeMagnitude(address operator, address[] strategies, uint8[] numToComplete) returns() +func (_AVSDirectory *AVSDirectoryTransactorSession) UpdateFreeMagnitude(operator common.Address, strategies []common.Address, numToComplete []uint8) (*types.Transaction, error) { + return _AVSDirectory.Contract.UpdateFreeMagnitude(&_AVSDirectory.TransactOpts, operator, strategies, numToComplete) +} + +// AVSDirectoryAVSMetadataURIUpdatedIterator is returned from FilterAVSMetadataURIUpdated and is used to iterate over the raw logs and unpacked data for AVSMetadataURIUpdated events raised by the AVSDirectory contract. +type AVSDirectoryAVSMetadataURIUpdatedIterator struct { + Event *AVSDirectoryAVSMetadataURIUpdated // 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 *AVSDirectoryAVSMetadataURIUpdatedIterator) 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(AVSDirectoryAVSMetadataURIUpdated) + 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(AVSDirectoryAVSMetadataURIUpdated) + 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 *AVSDirectoryAVSMetadataURIUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryAVSMetadataURIUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryAVSMetadataURIUpdated represents a AVSMetadataURIUpdated event raised by the AVSDirectory contract. +type AVSDirectoryAVSMetadataURIUpdated struct { + Avs common.Address + MetadataURI string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAVSMetadataURIUpdated is a free log retrieval operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// +// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) +func (_AVSDirectory *AVSDirectoryFilterer) FilterAVSMetadataURIUpdated(opts *bind.FilterOpts, avs []common.Address) (*AVSDirectoryAVSMetadataURIUpdatedIterator, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "AVSMetadataURIUpdated", avsRule) + if err != nil { + return nil, err + } + return &AVSDirectoryAVSMetadataURIUpdatedIterator{contract: _AVSDirectory.contract, event: "AVSMetadataURIUpdated", logs: logs, sub: sub}, nil +} + +// WatchAVSMetadataURIUpdated is a free log subscription operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// +// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) +func (_AVSDirectory *AVSDirectoryFilterer) WatchAVSMetadataURIUpdated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryAVSMetadataURIUpdated, avs []common.Address) (event.Subscription, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "AVSMetadataURIUpdated", avsRule) + 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(AVSDirectoryAVSMetadataURIUpdated) + if err := _AVSDirectory.contract.UnpackLog(event, "AVSMetadataURIUpdated", 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 +} + +// ParseAVSMetadataURIUpdated is a log parse operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// +// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) +func (_AVSDirectory *AVSDirectoryFilterer) ParseAVSMetadataURIUpdated(log types.Log) (*AVSDirectoryAVSMetadataURIUpdated, error) { + event := new(AVSDirectoryAVSMetadataURIUpdated) + if err := _AVSDirectory.contract.UnpackLog(event, "AVSMetadataURIUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryAVSMigratedToOperatorSetsIterator is returned from FilterAVSMigratedToOperatorSets and is used to iterate over the raw logs and unpacked data for AVSMigratedToOperatorSets events raised by the AVSDirectory contract. +type AVSDirectoryAVSMigratedToOperatorSetsIterator struct { + Event *AVSDirectoryAVSMigratedToOperatorSets // 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 *AVSDirectoryAVSMigratedToOperatorSetsIterator) 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(AVSDirectoryAVSMigratedToOperatorSets) + 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(AVSDirectoryAVSMigratedToOperatorSets) + 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 *AVSDirectoryAVSMigratedToOperatorSetsIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryAVSMigratedToOperatorSetsIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryAVSMigratedToOperatorSets represents a AVSMigratedToOperatorSets event raised by the AVSDirectory contract. +type AVSDirectoryAVSMigratedToOperatorSets struct { + Avs common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAVSMigratedToOperatorSets is a free log retrieval operation binding the contract event 0x702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf. +// +// Solidity: event AVSMigratedToOperatorSets(address indexed avs) +func (_AVSDirectory *AVSDirectoryFilterer) FilterAVSMigratedToOperatorSets(opts *bind.FilterOpts, avs []common.Address) (*AVSDirectoryAVSMigratedToOperatorSetsIterator, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "AVSMigratedToOperatorSets", avsRule) + if err != nil { + return nil, err + } + return &AVSDirectoryAVSMigratedToOperatorSetsIterator{contract: _AVSDirectory.contract, event: "AVSMigratedToOperatorSets", logs: logs, sub: sub}, nil +} + +// WatchAVSMigratedToOperatorSets is a free log subscription operation binding the contract event 0x702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf. +// +// Solidity: event AVSMigratedToOperatorSets(address indexed avs) +func (_AVSDirectory *AVSDirectoryFilterer) WatchAVSMigratedToOperatorSets(opts *bind.WatchOpts, sink chan<- *AVSDirectoryAVSMigratedToOperatorSets, avs []common.Address) (event.Subscription, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "AVSMigratedToOperatorSets", avsRule) + 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(AVSDirectoryAVSMigratedToOperatorSets) + if err := _AVSDirectory.contract.UnpackLog(event, "AVSMigratedToOperatorSets", 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 +} + +// ParseAVSMigratedToOperatorSets is a log parse operation binding the contract event 0x702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf. +// +// Solidity: event AVSMigratedToOperatorSets(address indexed avs) +func (_AVSDirectory *AVSDirectoryFilterer) ParseAVSMigratedToOperatorSets(log types.Log) (*AVSDirectoryAVSMigratedToOperatorSets, error) { + event := new(AVSDirectoryAVSMigratedToOperatorSets) + if err := _AVSDirectory.contract.UnpackLog(event, "AVSMigratedToOperatorSets", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the AVSDirectory contract. +type AVSDirectoryInitializedIterator struct { + Event *AVSDirectoryInitialized // 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 *AVSDirectoryInitializedIterator) 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(AVSDirectoryInitialized) + 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(AVSDirectoryInitialized) + 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 *AVSDirectoryInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryInitialized represents a Initialized event raised by the AVSDirectory contract. +type AVSDirectoryInitialized 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 (_AVSDirectory *AVSDirectoryFilterer) FilterInitialized(opts *bind.FilterOpts) (*AVSDirectoryInitializedIterator, error) { + + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &AVSDirectoryInitializedIterator{contract: _AVSDirectory.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 (_AVSDirectory *AVSDirectoryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *AVSDirectoryInitialized) (event.Subscription, error) { + + logs, sub, err := _AVSDirectory.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(AVSDirectoryInitialized) + if err := _AVSDirectory.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 (_AVSDirectory *AVSDirectoryFilterer) ParseInitialized(log types.Log) (*AVSDirectoryInitialized, error) { + event := new(AVSDirectoryInitialized) + if err := _AVSDirectory.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryMagnitudeAllocatedIterator is returned from FilterMagnitudeAllocated and is used to iterate over the raw logs and unpacked data for MagnitudeAllocated events raised by the AVSDirectory contract. +type AVSDirectoryMagnitudeAllocatedIterator struct { + Event *AVSDirectoryMagnitudeAllocated // 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 *AVSDirectoryMagnitudeAllocatedIterator) 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(AVSDirectoryMagnitudeAllocated) + 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(AVSDirectoryMagnitudeAllocated) + 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 *AVSDirectoryMagnitudeAllocatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryMagnitudeAllocatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryMagnitudeAllocated represents a MagnitudeAllocated event raised by the AVSDirectory contract. +type AVSDirectoryMagnitudeAllocated struct { + Operator common.Address + Strategy common.Address + OperatorSet IAVSDirectoryOperatorSet + MagnitudeToAllocate uint64 + EffectTimestamp uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMagnitudeAllocated is a free log retrieval operation binding the contract event 0x6d7d0079582cb2c5e70d4135b37f36711415ee6c260778b716bd65e026eb4f1a. +// +// Solidity: event MagnitudeAllocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToAllocate, uint32 effectTimestamp) +func (_AVSDirectory *AVSDirectoryFilterer) FilterMagnitudeAllocated(opts *bind.FilterOpts) (*AVSDirectoryMagnitudeAllocatedIterator, error) { + + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "MagnitudeAllocated") + if err != nil { + return nil, err + } + return &AVSDirectoryMagnitudeAllocatedIterator{contract: _AVSDirectory.contract, event: "MagnitudeAllocated", logs: logs, sub: sub}, nil +} + +// WatchMagnitudeAllocated is a free log subscription operation binding the contract event 0x6d7d0079582cb2c5e70d4135b37f36711415ee6c260778b716bd65e026eb4f1a. +// +// Solidity: event MagnitudeAllocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToAllocate, uint32 effectTimestamp) +func (_AVSDirectory *AVSDirectoryFilterer) WatchMagnitudeAllocated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryMagnitudeAllocated) (event.Subscription, error) { + + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "MagnitudeAllocated") + 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(AVSDirectoryMagnitudeAllocated) + if err := _AVSDirectory.contract.UnpackLog(event, "MagnitudeAllocated", 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 +} + +// ParseMagnitudeAllocated is a log parse operation binding the contract event 0x6d7d0079582cb2c5e70d4135b37f36711415ee6c260778b716bd65e026eb4f1a. +// +// Solidity: event MagnitudeAllocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToAllocate, uint32 effectTimestamp) +func (_AVSDirectory *AVSDirectoryFilterer) ParseMagnitudeAllocated(log types.Log) (*AVSDirectoryMagnitudeAllocated, error) { + event := new(AVSDirectoryMagnitudeAllocated) + if err := _AVSDirectory.contract.UnpackLog(event, "MagnitudeAllocated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryMagnitudeDeallocationCompletedIterator is returned from FilterMagnitudeDeallocationCompleted and is used to iterate over the raw logs and unpacked data for MagnitudeDeallocationCompleted events raised by the AVSDirectory contract. +type AVSDirectoryMagnitudeDeallocationCompletedIterator struct { + Event *AVSDirectoryMagnitudeDeallocationCompleted // 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 *AVSDirectoryMagnitudeDeallocationCompletedIterator) 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(AVSDirectoryMagnitudeDeallocationCompleted) + 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(AVSDirectoryMagnitudeDeallocationCompleted) + 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 *AVSDirectoryMagnitudeDeallocationCompletedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryMagnitudeDeallocationCompletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryMagnitudeDeallocationCompleted represents a MagnitudeDeallocationCompleted event raised by the AVSDirectory contract. +type AVSDirectoryMagnitudeDeallocationCompleted struct { + Operator common.Address + Strategy common.Address + OperatorSet IAVSDirectoryOperatorSet + FreeMagnitudeAdded uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMagnitudeDeallocationCompleted is a free log retrieval operation binding the contract event 0x1e5c8e13c62c31d6252ac205e592477d643c7e95831d5b46d99a3c60c2fad8db. +// +// Solidity: event MagnitudeDeallocationCompleted(address operator, address strategy, (address,uint32) operatorSet, uint64 freeMagnitudeAdded) +func (_AVSDirectory *AVSDirectoryFilterer) FilterMagnitudeDeallocationCompleted(opts *bind.FilterOpts) (*AVSDirectoryMagnitudeDeallocationCompletedIterator, error) { + + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "MagnitudeDeallocationCompleted") + if err != nil { + return nil, err + } + return &AVSDirectoryMagnitudeDeallocationCompletedIterator{contract: _AVSDirectory.contract, event: "MagnitudeDeallocationCompleted", logs: logs, sub: sub}, nil +} + +// WatchMagnitudeDeallocationCompleted is a free log subscription operation binding the contract event 0x1e5c8e13c62c31d6252ac205e592477d643c7e95831d5b46d99a3c60c2fad8db. +// +// Solidity: event MagnitudeDeallocationCompleted(address operator, address strategy, (address,uint32) operatorSet, uint64 freeMagnitudeAdded) +func (_AVSDirectory *AVSDirectoryFilterer) WatchMagnitudeDeallocationCompleted(opts *bind.WatchOpts, sink chan<- *AVSDirectoryMagnitudeDeallocationCompleted) (event.Subscription, error) { + + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "MagnitudeDeallocationCompleted") + 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(AVSDirectoryMagnitudeDeallocationCompleted) + if err := _AVSDirectory.contract.UnpackLog(event, "MagnitudeDeallocationCompleted", 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 +} + +// ParseMagnitudeDeallocationCompleted is a log parse operation binding the contract event 0x1e5c8e13c62c31d6252ac205e592477d643c7e95831d5b46d99a3c60c2fad8db. +// +// Solidity: event MagnitudeDeallocationCompleted(address operator, address strategy, (address,uint32) operatorSet, uint64 freeMagnitudeAdded) +func (_AVSDirectory *AVSDirectoryFilterer) ParseMagnitudeDeallocationCompleted(log types.Log) (*AVSDirectoryMagnitudeDeallocationCompleted, error) { + event := new(AVSDirectoryMagnitudeDeallocationCompleted) + if err := _AVSDirectory.contract.UnpackLog(event, "MagnitudeDeallocationCompleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryMagnitudeQueueDeallocatedIterator is returned from FilterMagnitudeQueueDeallocated and is used to iterate over the raw logs and unpacked data for MagnitudeQueueDeallocated events raised by the AVSDirectory contract. +type AVSDirectoryMagnitudeQueueDeallocatedIterator struct { + Event *AVSDirectoryMagnitudeQueueDeallocated // 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 *AVSDirectoryMagnitudeQueueDeallocatedIterator) 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(AVSDirectoryMagnitudeQueueDeallocated) + 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(AVSDirectoryMagnitudeQueueDeallocated) + 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 *AVSDirectoryMagnitudeQueueDeallocatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryMagnitudeQueueDeallocatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryMagnitudeQueueDeallocated represents a MagnitudeQueueDeallocated event raised by the AVSDirectory contract. +type AVSDirectoryMagnitudeQueueDeallocated struct { + Operator common.Address + Strategy common.Address + OperatorSet IAVSDirectoryOperatorSet + MagnitudeToDeallocate uint64 + CompletableTimestamp uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMagnitudeQueueDeallocated is a free log retrieval operation binding the contract event 0x2e68db1fe51107d7e451ae268d1631796989ab9d7925054e9b247854cb5be950. +// +// Solidity: event MagnitudeQueueDeallocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToDeallocate, uint32 completableTimestamp) +func (_AVSDirectory *AVSDirectoryFilterer) FilterMagnitudeQueueDeallocated(opts *bind.FilterOpts) (*AVSDirectoryMagnitudeQueueDeallocatedIterator, error) { + + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "MagnitudeQueueDeallocated") + if err != nil { + return nil, err + } + return &AVSDirectoryMagnitudeQueueDeallocatedIterator{contract: _AVSDirectory.contract, event: "MagnitudeQueueDeallocated", logs: logs, sub: sub}, nil +} + +// WatchMagnitudeQueueDeallocated is a free log subscription operation binding the contract event 0x2e68db1fe51107d7e451ae268d1631796989ab9d7925054e9b247854cb5be950. +// +// Solidity: event MagnitudeQueueDeallocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToDeallocate, uint32 completableTimestamp) +func (_AVSDirectory *AVSDirectoryFilterer) WatchMagnitudeQueueDeallocated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryMagnitudeQueueDeallocated) (event.Subscription, error) { + + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "MagnitudeQueueDeallocated") + 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(AVSDirectoryMagnitudeQueueDeallocated) + if err := _AVSDirectory.contract.UnpackLog(event, "MagnitudeQueueDeallocated", 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 +} + +// ParseMagnitudeQueueDeallocated is a log parse operation binding the contract event 0x2e68db1fe51107d7e451ae268d1631796989ab9d7925054e9b247854cb5be950. +// +// Solidity: event MagnitudeQueueDeallocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToDeallocate, uint32 completableTimestamp) +func (_AVSDirectory *AVSDirectoryFilterer) ParseMagnitudeQueueDeallocated(log types.Log) (*AVSDirectoryMagnitudeQueueDeallocated, error) { + event := new(AVSDirectoryMagnitudeQueueDeallocated) + if err := _AVSDirectory.contract.UnpackLog(event, "MagnitudeQueueDeallocated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator is returned from FilterOperatorAVSRegistrationStatusUpdated and is used to iterate over the raw logs and unpacked data for OperatorAVSRegistrationStatusUpdated events raised by the AVSDirectory contract. +type AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator struct { + Event *AVSDirectoryOperatorAVSRegistrationStatusUpdated // 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 *AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) 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(AVSDirectoryOperatorAVSRegistrationStatusUpdated) + 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(AVSDirectoryOperatorAVSRegistrationStatusUpdated) + 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 *AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryOperatorAVSRegistrationStatusUpdated represents a OperatorAVSRegistrationStatusUpdated event raised by the AVSDirectory contract. +type AVSDirectoryOperatorAVSRegistrationStatusUpdated struct { + Operator common.Address + Avs common.Address + Status uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorAVSRegistrationStatusUpdated is a free log retrieval operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// +// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) +func (_AVSDirectory *AVSDirectoryFilterer) FilterOperatorAVSRegistrationStatusUpdated(opts *bind.FilterOpts, operator []common.Address, avs []common.Address) (*AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + if err != nil { + return nil, err + } + return &AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator{contract: _AVSDirectory.contract, event: "OperatorAVSRegistrationStatusUpdated", logs: logs, sub: sub}, nil +} + +// WatchOperatorAVSRegistrationStatusUpdated is a free log subscription operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// +// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) +func (_AVSDirectory *AVSDirectoryFilterer) WatchOperatorAVSRegistrationStatusUpdated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryOperatorAVSRegistrationStatusUpdated, operator []common.Address, avs []common.Address) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + 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(AVSDirectoryOperatorAVSRegistrationStatusUpdated) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", 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 +} + +// ParseOperatorAVSRegistrationStatusUpdated is a log parse operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// +// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) +func (_AVSDirectory *AVSDirectoryFilterer) ParseOperatorAVSRegistrationStatusUpdated(log types.Log) (*AVSDirectoryOperatorAVSRegistrationStatusUpdated, error) { + event := new(AVSDirectoryOperatorAVSRegistrationStatusUpdated) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryOperatorAddedToOperatorSetIterator is returned from FilterOperatorAddedToOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorAddedToOperatorSet events raised by the AVSDirectory contract. +type AVSDirectoryOperatorAddedToOperatorSetIterator struct { + Event *AVSDirectoryOperatorAddedToOperatorSet // 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 *AVSDirectoryOperatorAddedToOperatorSetIterator) 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(AVSDirectoryOperatorAddedToOperatorSet) + 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(AVSDirectoryOperatorAddedToOperatorSet) + 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 *AVSDirectoryOperatorAddedToOperatorSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryOperatorAddedToOperatorSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryOperatorAddedToOperatorSet represents a OperatorAddedToOperatorSet event raised by the AVSDirectory contract. +type AVSDirectoryOperatorAddedToOperatorSet struct { + Operator common.Address + OperatorSet IAVSDirectoryOperatorSet + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorAddedToOperatorSet is a free log retrieval operation binding the contract event 0x43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e. +// +// Solidity: event OperatorAddedToOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectory *AVSDirectoryFilterer) FilterOperatorAddedToOperatorSet(opts *bind.FilterOpts, operator []common.Address) (*AVSDirectoryOperatorAddedToOperatorSetIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "OperatorAddedToOperatorSet", operatorRule) + if err != nil { + return nil, err + } + return &AVSDirectoryOperatorAddedToOperatorSetIterator{contract: _AVSDirectory.contract, event: "OperatorAddedToOperatorSet", logs: logs, sub: sub}, nil +} + +// WatchOperatorAddedToOperatorSet is a free log subscription operation binding the contract event 0x43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e. +// +// Solidity: event OperatorAddedToOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectory *AVSDirectoryFilterer) WatchOperatorAddedToOperatorSet(opts *bind.WatchOpts, sink chan<- *AVSDirectoryOperatorAddedToOperatorSet, operator []common.Address) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "OperatorAddedToOperatorSet", operatorRule) + 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(AVSDirectoryOperatorAddedToOperatorSet) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorAddedToOperatorSet", 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 +} + +// ParseOperatorAddedToOperatorSet is a log parse operation binding the contract event 0x43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e. +// +// Solidity: event OperatorAddedToOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectory *AVSDirectoryFilterer) ParseOperatorAddedToOperatorSet(log types.Log) (*AVSDirectoryOperatorAddedToOperatorSet, error) { + event := new(AVSDirectoryOperatorAddedToOperatorSet) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorAddedToOperatorSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryOperatorMigratedToOperatorSetsIterator is returned from FilterOperatorMigratedToOperatorSets and is used to iterate over the raw logs and unpacked data for OperatorMigratedToOperatorSets events raised by the AVSDirectory contract. +type AVSDirectoryOperatorMigratedToOperatorSetsIterator struct { + Event *AVSDirectoryOperatorMigratedToOperatorSets // 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 *AVSDirectoryOperatorMigratedToOperatorSetsIterator) 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(AVSDirectoryOperatorMigratedToOperatorSets) + 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(AVSDirectoryOperatorMigratedToOperatorSets) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true -// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. -// -// Solidity: function setPauserRegistry(address newPauserRegistry) returns() -func (_AVSDirectory *AVSDirectorySession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { - return _AVSDirectory.Contract.SetPauserRegistry(&_AVSDirectory.TransactOpts, newPauserRegistry) + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } } -// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. -// -// Solidity: function setPauserRegistry(address newPauserRegistry) returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { - return _AVSDirectory.Contract.SetPauserRegistry(&_AVSDirectory.TransactOpts, newPauserRegistry) +// Error returns any retrieval or parsing error occurred during filtering. +func (it *AVSDirectoryOperatorMigratedToOperatorSetsIterator) Error() error { + return it.fail } -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_AVSDirectory *AVSDirectoryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "transferOwnership", newOwner) +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryOperatorMigratedToOperatorSetsIterator) Close() error { + it.sub.Unsubscribe() + return nil } -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_AVSDirectory *AVSDirectorySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _AVSDirectory.Contract.TransferOwnership(&_AVSDirectory.TransactOpts, newOwner) +// AVSDirectoryOperatorMigratedToOperatorSets represents a OperatorMigratedToOperatorSets event raised by the AVSDirectory contract. +type AVSDirectoryOperatorMigratedToOperatorSets struct { + Operator common.Address + Avs common.Address + OperatorSetIds []uint32 + Raw types.Log // Blockchain specific contextual infos } -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// FilterOperatorMigratedToOperatorSets is a free log retrieval operation binding the contract event 0x54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01. // -// Solidity: function transferOwnership(address newOwner) returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _AVSDirectory.Contract.TransferOwnership(&_AVSDirectory.TransactOpts, newOwner) -} +// Solidity: event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds) +func (_AVSDirectory *AVSDirectoryFilterer) FilterOperatorMigratedToOperatorSets(opts *bind.FilterOpts, operator []common.Address, avs []common.Address) (*AVSDirectoryOperatorMigratedToOperatorSetsIterator, error) { -// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. -// -// Solidity: function unpause(uint256 newPausedStatus) returns() -func (_AVSDirectory *AVSDirectoryTransactor) Unpause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "unpause", newPausedStatus) -} + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } -// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. -// -// Solidity: function unpause(uint256 newPausedStatus) returns() -func (_AVSDirectory *AVSDirectorySession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { - return _AVSDirectory.Contract.Unpause(&_AVSDirectory.TransactOpts, newPausedStatus) + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "OperatorMigratedToOperatorSets", operatorRule, avsRule) + if err != nil { + return nil, err + } + return &AVSDirectoryOperatorMigratedToOperatorSetsIterator{contract: _AVSDirectory.contract, event: "OperatorMigratedToOperatorSets", logs: logs, sub: sub}, nil } -// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// WatchOperatorMigratedToOperatorSets is a free log subscription operation binding the contract event 0x54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01. // -// Solidity: function unpause(uint256 newPausedStatus) returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { - return _AVSDirectory.Contract.Unpause(&_AVSDirectory.TransactOpts, newPausedStatus) -} +// Solidity: event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds) +func (_AVSDirectory *AVSDirectoryFilterer) WatchOperatorMigratedToOperatorSets(opts *bind.WatchOpts, sink chan<- *AVSDirectoryOperatorMigratedToOperatorSets, operator []common.Address, avs []common.Address) (event.Subscription, error) { -// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. -// -// Solidity: function updateAVSMetadataURI(string metadataURI) returns() -func (_AVSDirectory *AVSDirectoryTransactor) UpdateAVSMetadataURI(opts *bind.TransactOpts, metadataURI string) (*types.Transaction, error) { - return _AVSDirectory.contract.Transact(opts, "updateAVSMetadataURI", metadataURI) -} + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } -// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. -// -// Solidity: function updateAVSMetadataURI(string metadataURI) returns() -func (_AVSDirectory *AVSDirectorySession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { - return _AVSDirectory.Contract.UpdateAVSMetadataURI(&_AVSDirectory.TransactOpts, metadataURI) + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "OperatorMigratedToOperatorSets", operatorRule, avsRule) + 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(AVSDirectoryOperatorMigratedToOperatorSets) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorMigratedToOperatorSets", 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 } -// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// ParseOperatorMigratedToOperatorSets is a log parse operation binding the contract event 0x54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01. // -// Solidity: function updateAVSMetadataURI(string metadataURI) returns() -func (_AVSDirectory *AVSDirectoryTransactorSession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { - return _AVSDirectory.Contract.UpdateAVSMetadataURI(&_AVSDirectory.TransactOpts, metadataURI) +// Solidity: event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds) +func (_AVSDirectory *AVSDirectoryFilterer) ParseOperatorMigratedToOperatorSets(log types.Log) (*AVSDirectoryOperatorMigratedToOperatorSets, error) { + event := new(AVSDirectoryOperatorMigratedToOperatorSets) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorMigratedToOperatorSets", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil } -// AVSDirectoryAVSMetadataURIUpdatedIterator is returned from FilterAVSMetadataURIUpdated and is used to iterate over the raw logs and unpacked data for AVSMetadataURIUpdated events raised by the AVSDirectory contract. -type AVSDirectoryAVSMetadataURIUpdatedIterator struct { - Event *AVSDirectoryAVSMetadataURIUpdated // Event containing the contract specifics and raw log +// AVSDirectoryOperatorRemovedFromOperatorSetIterator is returned from FilterOperatorRemovedFromOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorRemovedFromOperatorSet events raised by the AVSDirectory contract. +type AVSDirectoryOperatorRemovedFromOperatorSetIterator struct { + Event *AVSDirectoryOperatorRemovedFromOperatorSet // 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 @@ -797,7 +3060,7 @@ type AVSDirectoryAVSMetadataURIUpdatedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *AVSDirectoryAVSMetadataURIUpdatedIterator) Next() bool { +func (it *AVSDirectoryOperatorRemovedFromOperatorSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -806,7 +3069,7 @@ func (it *AVSDirectoryAVSMetadataURIUpdatedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(AVSDirectoryAVSMetadataURIUpdated) + it.Event = new(AVSDirectoryOperatorRemovedFromOperatorSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -821,7 +3084,7 @@ func (it *AVSDirectoryAVSMetadataURIUpdatedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(AVSDirectoryAVSMetadataURIUpdated) + it.Event = new(AVSDirectoryOperatorRemovedFromOperatorSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -837,52 +3100,52 @@ func (it *AVSDirectoryAVSMetadataURIUpdatedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *AVSDirectoryAVSMetadataURIUpdatedIterator) Error() error { +func (it *AVSDirectoryOperatorRemovedFromOperatorSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *AVSDirectoryAVSMetadataURIUpdatedIterator) Close() error { +func (it *AVSDirectoryOperatorRemovedFromOperatorSetIterator) Close() error { it.sub.Unsubscribe() return nil } -// AVSDirectoryAVSMetadataURIUpdated represents a AVSMetadataURIUpdated event raised by the AVSDirectory contract. -type AVSDirectoryAVSMetadataURIUpdated struct { - Avs common.Address - MetadataURI string +// AVSDirectoryOperatorRemovedFromOperatorSet represents a OperatorRemovedFromOperatorSet event raised by the AVSDirectory contract. +type AVSDirectoryOperatorRemovedFromOperatorSet struct { + Operator common.Address + OperatorSet IAVSDirectoryOperatorSet Raw types.Log // Blockchain specific contextual infos } -// FilterAVSMetadataURIUpdated is a free log retrieval operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// FilterOperatorRemovedFromOperatorSet is a free log retrieval operation binding the contract event 0xad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe. // -// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) -func (_AVSDirectory *AVSDirectoryFilterer) FilterAVSMetadataURIUpdated(opts *bind.FilterOpts, avs []common.Address) (*AVSDirectoryAVSMetadataURIUpdatedIterator, error) { +// Solidity: event OperatorRemovedFromOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectory *AVSDirectoryFilterer) FilterOperatorRemovedFromOperatorSet(opts *bind.FilterOpts, operator []common.Address) (*AVSDirectoryOperatorRemovedFromOperatorSetIterator, error) { - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) } - logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "AVSMetadataURIUpdated", avsRule) + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "OperatorRemovedFromOperatorSet", operatorRule) if err != nil { return nil, err } - return &AVSDirectoryAVSMetadataURIUpdatedIterator{contract: _AVSDirectory.contract, event: "AVSMetadataURIUpdated", logs: logs, sub: sub}, nil + return &AVSDirectoryOperatorRemovedFromOperatorSetIterator{contract: _AVSDirectory.contract, event: "OperatorRemovedFromOperatorSet", logs: logs, sub: sub}, nil } -// WatchAVSMetadataURIUpdated is a free log subscription operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// WatchOperatorRemovedFromOperatorSet is a free log subscription operation binding the contract event 0xad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe. // -// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) -func (_AVSDirectory *AVSDirectoryFilterer) WatchAVSMetadataURIUpdated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryAVSMetadataURIUpdated, avs []common.Address) (event.Subscription, error) { +// Solidity: event OperatorRemovedFromOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectory *AVSDirectoryFilterer) WatchOperatorRemovedFromOperatorSet(opts *bind.WatchOpts, sink chan<- *AVSDirectoryOperatorRemovedFromOperatorSet, operator []common.Address) (event.Subscription, error) { - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) } - logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "AVSMetadataURIUpdated", avsRule) + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "OperatorRemovedFromOperatorSet", operatorRule) if err != nil { return nil, err } @@ -892,8 +3155,8 @@ func (_AVSDirectory *AVSDirectoryFilterer) WatchAVSMetadataURIUpdated(opts *bind select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(AVSDirectoryAVSMetadataURIUpdated) - if err := _AVSDirectory.contract.UnpackLog(event, "AVSMetadataURIUpdated", log); err != nil { + event := new(AVSDirectoryOperatorRemovedFromOperatorSet) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorRemovedFromOperatorSet", log); err != nil { return err } event.Raw = log @@ -914,21 +3177,21 @@ func (_AVSDirectory *AVSDirectoryFilterer) WatchAVSMetadataURIUpdated(opts *bind }), nil } -// ParseAVSMetadataURIUpdated is a log parse operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// ParseOperatorRemovedFromOperatorSet is a log parse operation binding the contract event 0xad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe. // -// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) -func (_AVSDirectory *AVSDirectoryFilterer) ParseAVSMetadataURIUpdated(log types.Log) (*AVSDirectoryAVSMetadataURIUpdated, error) { - event := new(AVSDirectoryAVSMetadataURIUpdated) - if err := _AVSDirectory.contract.UnpackLog(event, "AVSMetadataURIUpdated", log); err != nil { +// Solidity: event OperatorRemovedFromOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectory *AVSDirectoryFilterer) ParseOperatorRemovedFromOperatorSet(log types.Log) (*AVSDirectoryOperatorRemovedFromOperatorSet, error) { + event := new(AVSDirectoryOperatorRemovedFromOperatorSet) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorRemovedFromOperatorSet", log); err != nil { return nil, err } event.Raw = log return event, nil } -// AVSDirectoryInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the AVSDirectory contract. -type AVSDirectoryInitializedIterator struct { - Event *AVSDirectoryInitialized // Event containing the contract specifics and raw log +// AVSDirectoryOperatorSetCreatedIterator is returned from FilterOperatorSetCreated and is used to iterate over the raw logs and unpacked data for OperatorSetCreated events raised by the AVSDirectory contract. +type AVSDirectoryOperatorSetCreatedIterator struct { + Event *AVSDirectoryOperatorSetCreated // 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 @@ -942,7 +3205,7 @@ type AVSDirectoryInitializedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *AVSDirectoryInitializedIterator) Next() bool { +func (it *AVSDirectoryOperatorSetCreatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -951,7 +3214,7 @@ func (it *AVSDirectoryInitializedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(AVSDirectoryInitialized) + it.Event = new(AVSDirectoryOperatorSetCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -966,7 +3229,7 @@ func (it *AVSDirectoryInitializedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(AVSDirectoryInitialized) + it.Event = new(AVSDirectoryOperatorSetCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -982,41 +3245,41 @@ func (it *AVSDirectoryInitializedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *AVSDirectoryInitializedIterator) Error() error { +func (it *AVSDirectoryOperatorSetCreatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *AVSDirectoryInitializedIterator) Close() error { +func (it *AVSDirectoryOperatorSetCreatedIterator) Close() error { it.sub.Unsubscribe() return nil } -// AVSDirectoryInitialized represents a Initialized event raised by the AVSDirectory contract. -type AVSDirectoryInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos +// AVSDirectoryOperatorSetCreated represents a OperatorSetCreated event raised by the AVSDirectory contract. +type AVSDirectoryOperatorSetCreated struct { + OperatorSet IAVSDirectoryOperatorSet + Raw types.Log // Blockchain specific contextual infos } -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// FilterOperatorSetCreated is a free log retrieval operation binding the contract event 0x31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c. // -// Solidity: event Initialized(uint8 version) -func (_AVSDirectory *AVSDirectoryFilterer) FilterInitialized(opts *bind.FilterOpts) (*AVSDirectoryInitializedIterator, error) { +// Solidity: event OperatorSetCreated((address,uint32) operatorSet) +func (_AVSDirectory *AVSDirectoryFilterer) FilterOperatorSetCreated(opts *bind.FilterOpts) (*AVSDirectoryOperatorSetCreatedIterator, error) { - logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "Initialized") + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "OperatorSetCreated") if err != nil { return nil, err } - return &AVSDirectoryInitializedIterator{contract: _AVSDirectory.contract, event: "Initialized", logs: logs, sub: sub}, nil + return &AVSDirectoryOperatorSetCreatedIterator{contract: _AVSDirectory.contract, event: "OperatorSetCreated", logs: logs, sub: sub}, nil } -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// WatchOperatorSetCreated is a free log subscription operation binding the contract event 0x31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c. // -// Solidity: event Initialized(uint8 version) -func (_AVSDirectory *AVSDirectoryFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *AVSDirectoryInitialized) (event.Subscription, error) { +// Solidity: event OperatorSetCreated((address,uint32) operatorSet) +func (_AVSDirectory *AVSDirectoryFilterer) WatchOperatorSetCreated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryOperatorSetCreated) (event.Subscription, error) { - logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "Initialized") + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "OperatorSetCreated") if err != nil { return nil, err } @@ -1026,8 +3289,8 @@ func (_AVSDirectory *AVSDirectoryFilterer) WatchInitialized(opts *bind.WatchOpts select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(AVSDirectoryInitialized) - if err := _AVSDirectory.contract.UnpackLog(event, "Initialized", log); err != nil { + event := new(AVSDirectoryOperatorSetCreated) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorSetCreated", log); err != nil { return err } event.Raw = log @@ -1048,21 +3311,21 @@ func (_AVSDirectory *AVSDirectoryFilterer) WatchInitialized(opts *bind.WatchOpts }), nil } -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// ParseOperatorSetCreated is a log parse operation binding the contract event 0x31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c. // -// Solidity: event Initialized(uint8 version) -func (_AVSDirectory *AVSDirectoryFilterer) ParseInitialized(log types.Log) (*AVSDirectoryInitialized, error) { - event := new(AVSDirectoryInitialized) - if err := _AVSDirectory.contract.UnpackLog(event, "Initialized", log); err != nil { +// Solidity: event OperatorSetCreated((address,uint32) operatorSet) +func (_AVSDirectory *AVSDirectoryFilterer) ParseOperatorSetCreated(log types.Log) (*AVSDirectoryOperatorSetCreated, error) { + event := new(AVSDirectoryOperatorSetCreated) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorSetCreated", log); err != nil { return nil, err } event.Raw = log return event, nil } -// AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator is returned from FilterOperatorAVSRegistrationStatusUpdated and is used to iterate over the raw logs and unpacked data for OperatorAVSRegistrationStatusUpdated events raised by the AVSDirectory contract. -type AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator struct { - Event *AVSDirectoryOperatorAVSRegistrationStatusUpdated // Event containing the contract specifics and raw log +// AVSDirectoryOperatorSlashedIterator is returned from FilterOperatorSlashed and is used to iterate over the raw logs and unpacked data for OperatorSlashed events raised by the AVSDirectory contract. +type AVSDirectoryOperatorSlashedIterator struct { + Event *AVSDirectoryOperatorSlashed // 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 @@ -1076,7 +3339,7 @@ type AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Next() bool { +func (it *AVSDirectoryOperatorSlashedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1085,7 +3348,7 @@ func (it *AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Next() bool if it.done { select { case log := <-it.logs: - it.Event = new(AVSDirectoryOperatorAVSRegistrationStatusUpdated) + it.Event = new(AVSDirectoryOperatorSlashed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1100,7 +3363,7 @@ func (it *AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Next() bool // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(AVSDirectoryOperatorAVSRegistrationStatusUpdated) + it.Event = new(AVSDirectoryOperatorSlashed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1116,61 +3379,44 @@ func (it *AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Next() bool } // Error returns any retrieval or parsing error occurred during filtering. -func (it *AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Error() error { +func (it *AVSDirectoryOperatorSlashedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Close() error { +func (it *AVSDirectoryOperatorSlashedIterator) Close() error { it.sub.Unsubscribe() return nil } -// AVSDirectoryOperatorAVSRegistrationStatusUpdated represents a OperatorAVSRegistrationStatusUpdated event raised by the AVSDirectory contract. -type AVSDirectoryOperatorAVSRegistrationStatusUpdated struct { - Operator common.Address - Avs common.Address - Status uint8 - Raw types.Log // Blockchain specific contextual infos +// AVSDirectoryOperatorSlashed represents a OperatorSlashed event raised by the AVSDirectory contract. +type AVSDirectoryOperatorSlashed struct { + Operator common.Address + OperatorSetId uint32 + Strategy common.Address + BipsToSlash uint16 + Raw types.Log // Blockchain specific contextual infos } -// FilterOperatorAVSRegistrationStatusUpdated is a free log retrieval operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// FilterOperatorSlashed is a free log retrieval operation binding the contract event 0xe672839d3c371691acdb52de9fefc94b3dbf407dc0920ef566c7c059ad575b1c. // -// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) -func (_AVSDirectory *AVSDirectoryFilterer) FilterOperatorAVSRegistrationStatusUpdated(opts *bind.FilterOpts, operator []common.Address, avs []common.Address) (*AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) - } +// Solidity: event OperatorSlashed(address operator, uint32 operatorSetId, address strategy, uint16 bipsToSlash) +func (_AVSDirectory *AVSDirectoryFilterer) FilterOperatorSlashed(opts *bind.FilterOpts) (*AVSDirectoryOperatorSlashedIterator, error) { - logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + logs, sub, err := _AVSDirectory.contract.FilterLogs(opts, "OperatorSlashed") if err != nil { return nil, err } - return &AVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator{contract: _AVSDirectory.contract, event: "OperatorAVSRegistrationStatusUpdated", logs: logs, sub: sub}, nil + return &AVSDirectoryOperatorSlashedIterator{contract: _AVSDirectory.contract, event: "OperatorSlashed", logs: logs, sub: sub}, nil } -// WatchOperatorAVSRegistrationStatusUpdated is a free log subscription operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// WatchOperatorSlashed is a free log subscription operation binding the contract event 0xe672839d3c371691acdb52de9fefc94b3dbf407dc0920ef566c7c059ad575b1c. // -// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) -func (_AVSDirectory *AVSDirectoryFilterer) WatchOperatorAVSRegistrationStatusUpdated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryOperatorAVSRegistrationStatusUpdated, operator []common.Address, avs []common.Address) (event.Subscription, error) { - - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) - } +// Solidity: event OperatorSlashed(address operator, uint32 operatorSetId, address strategy, uint16 bipsToSlash) +func (_AVSDirectory *AVSDirectoryFilterer) WatchOperatorSlashed(opts *bind.WatchOpts, sink chan<- *AVSDirectoryOperatorSlashed) (event.Subscription, error) { - logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + logs, sub, err := _AVSDirectory.contract.WatchLogs(opts, "OperatorSlashed") if err != nil { return nil, err } @@ -1180,8 +3426,8 @@ func (_AVSDirectory *AVSDirectoryFilterer) WatchOperatorAVSRegistrationStatusUpd select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(AVSDirectoryOperatorAVSRegistrationStatusUpdated) - if err := _AVSDirectory.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", log); err != nil { + event := new(AVSDirectoryOperatorSlashed) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorSlashed", log); err != nil { return err } event.Raw = log @@ -1202,12 +3448,12 @@ func (_AVSDirectory *AVSDirectoryFilterer) WatchOperatorAVSRegistrationStatusUpd }), nil } -// ParseOperatorAVSRegistrationStatusUpdated is a log parse operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// ParseOperatorSlashed is a log parse operation binding the contract event 0xe672839d3c371691acdb52de9fefc94b3dbf407dc0920ef566c7c059ad575b1c. // -// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) -func (_AVSDirectory *AVSDirectoryFilterer) ParseOperatorAVSRegistrationStatusUpdated(log types.Log) (*AVSDirectoryOperatorAVSRegistrationStatusUpdated, error) { - event := new(AVSDirectoryOperatorAVSRegistrationStatusUpdated) - if err := _AVSDirectory.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", log); err != nil { +// Solidity: event OperatorSlashed(address operator, uint32 operatorSetId, address strategy, uint16 bipsToSlash) +func (_AVSDirectory *AVSDirectoryFilterer) ParseOperatorSlashed(log types.Log) (*AVSDirectoryOperatorSlashed, error) { + event := new(AVSDirectoryOperatorSlashed) + if err := _AVSDirectory.contract.UnpackLog(event, "OperatorSlashed", log); err != nil { return nil, err } event.Raw = log diff --git a/pkg/bindings/AVSDirectoryStorage/binding.go b/pkg/bindings/AVSDirectoryStorage/binding.go index 2070a8e69..b705c9766 100644 --- a/pkg/bindings/AVSDirectoryStorage/binding.go +++ b/pkg/bindings/AVSDirectoryStorage/binding.go @@ -29,6 +29,20 @@ var ( _ = abi.ConvertType ) +// IAVSDirectoryMagnitudeAllocation is an auto generated low-level Go binding around an user-defined struct. +type IAVSDirectoryMagnitudeAllocation struct { + Strategy common.Address + ExpectedTotalMagnitude uint64 + OperatorSets []IAVSDirectoryOperatorSet + Magnitudes []uint64 +} + +// IAVSDirectoryOperatorSet is an auto generated low-level Go binding around an user-defined struct. +type IAVSDirectoryOperatorSet struct { + Avs common.Address + OperatorSetId uint32 +} + // ISignatureUtilsSignatureWithSaltAndExpiry is an auto generated low-level Go binding around an user-defined struct. type ISignatureUtilsSignatureWithSaltAndExpiry struct { Signature []byte @@ -38,7 +52,7 @@ type ISignatureUtilsSignatureWithSaltAndExpiry struct { // AVSDirectoryStorageMetaData contains all meta data concerning the AVSDirectoryStorage contract. var AVSDirectoryStorageMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"DOMAIN_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_AVS_REGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"avsOperatorStatus\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorAVSRegistrationDigestHash\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"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\":\"deregisterOperatorFromAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorSaltIsSpent\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerOperatorToAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateAVSMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSMetadataURIUpdated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAVSRegistrationStatusUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"anonymous\":false}]", + ABI: "[{\"type\":\"function\",\"name\":\"DOMAIN_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAGNITUDE_ADJUSTMENT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_AVS_REGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_SET_REGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"avsOperatorStatus\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"becomeOperatorSetAVS\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"calculateMagnitudeAllocationDigestHash\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"allocations\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.MagnitudeAllocation[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"expectedTotalMagnitude\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudes\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}]},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorAVSRegistrationDigestHash\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorSetForceDeregistrationTypehash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorSetRegistrationDigestHash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"cancelSalt\",\"inputs\":[{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createOperatorSets\",\"inputs\":[{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deregisterOperatorFromAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deregisterOperatorFromOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"forceDeregisterFromOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getAllocatableMagnitude\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"numToComplete\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentSlashableMagnitudes\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"\",\"type\":\"uint64[][]\",\"internalType\":\"uint64[][]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNumOperatorsInOperatorSet\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorSetsOfOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"start\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorsInOperatorSet\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"start\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"operators\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSlashableMagnitudes\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"\",\"type\":\"uint64[][]\",\"internalType\":\"uint64[][]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSlashablePPM\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"linear\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint24[]\",\"internalType\":\"uint24[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalMagnitude\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalMagnitudeAtTimestamp\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalMagnitudes\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalMagnitudesAtTimestamp\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"inTotalOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isMember\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorSet\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorSetAVS\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorSlashable\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"migrateOperatorsToOperatorSets\",\"inputs\":[{\"name\":\"operators\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[][]\",\"internalType\":\"uint32[][]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"modifyAllocations\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"allocations\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.MagnitudeAllocation[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"expectedTotalMagnitude\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudes\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}]},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorMagnitudeInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"nextPendingFreeMagnitudeIndex\",\"type\":\"uint192\",\"internalType\":\"uint192\"},{\"name\":\"freeMagnitude\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSaltIsSpent\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSetMemberAtIndex\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSetStatus\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"registered\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"lastDeregisteredTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSetsMemberOfAtIndex\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerOperatorToAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerOperatorToOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slashOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"bipsToSlash\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateAVSMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateFreeMagnitude\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"numToComplete\",\"type\":\"uint16[]\",\"internalType\":\"uint16[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSMetadataURIUpdated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AVSMigratedToOperatorSets\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MagnitudeAllocated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudeToAllocate\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"effectTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MagnitudeDeallocationCompleted\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"freeMagnitudeAdded\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MagnitudeQueueDeallocated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudeToDeallocate\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"completableTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAVSRegistrationStatusUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAddedToOperatorSet\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorMigratedToOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"indexed\":false,\"internalType\":\"uint32[]\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRemovedFromOperatorSet\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetCreated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSlashed\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"bipsToSlash\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false}]", } // AVSDirectoryStorageABI is the input ABI used to generate the binding from. @@ -218,6 +232,37 @@ func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) DOMAINTYPEHASH() ( return _AVSDirectoryStorage.Contract.DOMAINTYPEHASH(&_AVSDirectoryStorage.CallOpts) } +// MAGNITUDEADJUSTMENTTYPEHASH is a free data retrieval call binding the contract method 0x7b205de3. +// +// Solidity: function MAGNITUDE_ADJUSTMENT_TYPEHASH() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) MAGNITUDEADJUSTMENTTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "MAGNITUDE_ADJUSTMENT_TYPEHASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAGNITUDEADJUSTMENTTYPEHASH is a free data retrieval call binding the contract method 0x7b205de3. +// +// Solidity: function MAGNITUDE_ADJUSTMENT_TYPEHASH() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) MAGNITUDEADJUSTMENTTYPEHASH() ([32]byte, error) { + return _AVSDirectoryStorage.Contract.MAGNITUDEADJUSTMENTTYPEHASH(&_AVSDirectoryStorage.CallOpts) +} + +// MAGNITUDEADJUSTMENTTYPEHASH is a free data retrieval call binding the contract method 0x7b205de3. +// +// Solidity: function MAGNITUDE_ADJUSTMENT_TYPEHASH() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) MAGNITUDEADJUSTMENTTYPEHASH() ([32]byte, error) { + return _AVSDirectoryStorage.Contract.MAGNITUDEADJUSTMENTTYPEHASH(&_AVSDirectoryStorage.CallOpts) +} + // OPERATORAVSREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xd79aceab. // // Solidity: function OPERATOR_AVS_REGISTRATION_TYPEHASH() view returns(bytes32) @@ -249,6 +294,68 @@ func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) OPERATORAVSREGISTR return _AVSDirectoryStorage.Contract.OPERATORAVSREGISTRATIONTYPEHASH(&_AVSDirectoryStorage.CallOpts) } +// OPERATORSETFORCEDEREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xdce974b9. +// +// Solidity: function OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) OPERATORSETFORCEDEREGISTRATIONTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// OPERATORSETFORCEDEREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xdce974b9. +// +// Solidity: function OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) OPERATORSETFORCEDEREGISTRATIONTYPEHASH() ([32]byte, error) { + return _AVSDirectoryStorage.Contract.OPERATORSETFORCEDEREGISTRATIONTYPEHASH(&_AVSDirectoryStorage.CallOpts) +} + +// OPERATORSETFORCEDEREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xdce974b9. +// +// Solidity: function OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) OPERATORSETFORCEDEREGISTRATIONTYPEHASH() ([32]byte, error) { + return _AVSDirectoryStorage.Contract.OPERATORSETFORCEDEREGISTRATIONTYPEHASH(&_AVSDirectoryStorage.CallOpts) +} + +// OPERATORSETREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xc825fe68. +// +// Solidity: function OPERATOR_SET_REGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) OPERATORSETREGISTRATIONTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "OPERATOR_SET_REGISTRATION_TYPEHASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// OPERATORSETREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xc825fe68. +// +// Solidity: function OPERATOR_SET_REGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) OPERATORSETREGISTRATIONTYPEHASH() ([32]byte, error) { + return _AVSDirectoryStorage.Contract.OPERATORSETREGISTRATIONTYPEHASH(&_AVSDirectoryStorage.CallOpts) +} + +// OPERATORSETREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xc825fe68. +// +// Solidity: function OPERATOR_SET_REGISTRATION_TYPEHASH() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) OPERATORSETREGISTRATIONTYPEHASH() ([32]byte, error) { + return _AVSDirectoryStorage.Contract.OPERATORSETREGISTRATIONTYPEHASH(&_AVSDirectoryStorage.CallOpts) +} + // AvsOperatorStatus is a free data retrieval call binding the contract method 0x49075da3. // // Solidity: function avsOperatorStatus(address , address ) view returns(uint8) @@ -280,6 +387,37 @@ func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) AvsOperatorStatus( return _AVSDirectoryStorage.Contract.AvsOperatorStatus(&_AVSDirectoryStorage.CallOpts, arg0, arg1) } +// CalculateMagnitudeAllocationDigestHash is a free data retrieval call binding the contract method 0x686b686e. +// +// Solidity: function calculateMagnitudeAllocationDigestHash(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) CalculateMagnitudeAllocationDigestHash(opts *bind.CallOpts, operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, salt [32]byte, expiry *big.Int) ([32]byte, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "calculateMagnitudeAllocationDigestHash", operator, allocations, salt, expiry) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateMagnitudeAllocationDigestHash is a free data retrieval call binding the contract method 0x686b686e. +// +// Solidity: function calculateMagnitudeAllocationDigestHash(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) CalculateMagnitudeAllocationDigestHash(operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectoryStorage.Contract.CalculateMagnitudeAllocationDigestHash(&_AVSDirectoryStorage.CallOpts, operator, allocations, salt, expiry) +} + +// CalculateMagnitudeAllocationDigestHash is a free data retrieval call binding the contract method 0x686b686e. +// +// Solidity: function calculateMagnitudeAllocationDigestHash(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) CalculateMagnitudeAllocationDigestHash(operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectoryStorage.Contract.CalculateMagnitudeAllocationDigestHash(&_AVSDirectoryStorage.CallOpts, operator, allocations, salt, expiry) +} + // CalculateOperatorAVSRegistrationDigestHash is a free data retrieval call binding the contract method 0xa1060c88. // // Solidity: function calculateOperatorAVSRegistrationDigestHash(address operator, address avs, bytes32 salt, uint256 expiry) view returns(bytes32) @@ -311,6 +449,68 @@ func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) CalculateOperatorA return _AVSDirectoryStorage.Contract.CalculateOperatorAVSRegistrationDigestHash(&_AVSDirectoryStorage.CallOpts, operator, avs, salt, expiry) } +// CalculateOperatorSetForceDeregistrationTypehash is a free data retrieval call binding the contract method 0xb2841d48. +// +// Solidity: function calculateOperatorSetForceDeregistrationTypehash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) CalculateOperatorSetForceDeregistrationTypehash(opts *bind.CallOpts, avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "calculateOperatorSetForceDeregistrationTypehash", avs, operatorSetIds, salt, expiry) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateOperatorSetForceDeregistrationTypehash is a free data retrieval call binding the contract method 0xb2841d48. +// +// Solidity: function calculateOperatorSetForceDeregistrationTypehash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) CalculateOperatorSetForceDeregistrationTypehash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectoryStorage.Contract.CalculateOperatorSetForceDeregistrationTypehash(&_AVSDirectoryStorage.CallOpts, avs, operatorSetIds, salt, expiry) +} + +// CalculateOperatorSetForceDeregistrationTypehash is a free data retrieval call binding the contract method 0xb2841d48. +// +// Solidity: function calculateOperatorSetForceDeregistrationTypehash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) CalculateOperatorSetForceDeregistrationTypehash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectoryStorage.Contract.CalculateOperatorSetForceDeregistrationTypehash(&_AVSDirectoryStorage.CallOpts, avs, operatorSetIds, salt, expiry) +} + +// CalculateOperatorSetRegistrationDigestHash is a free data retrieval call binding the contract method 0x955e6696. +// +// Solidity: function calculateOperatorSetRegistrationDigestHash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) CalculateOperatorSetRegistrationDigestHash(opts *bind.CallOpts, avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "calculateOperatorSetRegistrationDigestHash", avs, operatorSetIds, salt, expiry) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateOperatorSetRegistrationDigestHash is a free data retrieval call binding the contract method 0x955e6696. +// +// Solidity: function calculateOperatorSetRegistrationDigestHash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) CalculateOperatorSetRegistrationDigestHash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectoryStorage.Contract.CalculateOperatorSetRegistrationDigestHash(&_AVSDirectoryStorage.CallOpts, avs, operatorSetIds, salt, expiry) +} + +// CalculateOperatorSetRegistrationDigestHash is a free data retrieval call binding the contract method 0x955e6696. +// +// Solidity: function calculateOperatorSetRegistrationDigestHash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) CalculateOperatorSetRegistrationDigestHash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _AVSDirectoryStorage.Contract.CalculateOperatorSetRegistrationDigestHash(&_AVSDirectoryStorage.CallOpts, avs, operatorSetIds, salt, expiry) +} + // Delegation is a free data retrieval call binding the contract method 0xdf5cf723. // // Solidity: function delegation() view returns(address) @@ -342,165 +542,1056 @@ func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) Delegation() (comm return _AVSDirectoryStorage.Contract.Delegation(&_AVSDirectoryStorage.CallOpts) } -// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. // -// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) -func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) OperatorSaltIsSpent(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte) (bool, error) { +// Solidity: function domainSeparator() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) DomainSeparator(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} - err := _AVSDirectoryStorage.contract.Call(opts, &out, "operatorSaltIsSpent", arg0, arg1) + err := _AVSDirectoryStorage.contract.Call(opts, &out, "domainSeparator") if err != nil { - return *new(bool), err + return *new([32]byte), err } - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } -// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. // -// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) -func (_AVSDirectoryStorage *AVSDirectoryStorageSession) OperatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { - return _AVSDirectoryStorage.Contract.OperatorSaltIsSpent(&_AVSDirectoryStorage.CallOpts, arg0, arg1) +// Solidity: function domainSeparator() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) DomainSeparator() ([32]byte, error) { + return _AVSDirectoryStorage.Contract.DomainSeparator(&_AVSDirectoryStorage.CallOpts) } -// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. // -// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) -func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) OperatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { - return _AVSDirectoryStorage.Contract.OperatorSaltIsSpent(&_AVSDirectoryStorage.CallOpts, arg0, arg1) +// Solidity: function domainSeparator() view returns(bytes32) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) DomainSeparator() ([32]byte, error) { + return _AVSDirectoryStorage.Contract.DomainSeparator(&_AVSDirectoryStorage.CallOpts) } -// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// GetAllocatableMagnitude is a free data retrieval call binding the contract method 0x3f78612f. // -// Solidity: function deregisterOperatorFromAVS(address operator) returns() -func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) DeregisterOperatorFromAVS(opts *bind.TransactOpts, operator common.Address) (*types.Transaction, error) { - return _AVSDirectoryStorage.contract.Transact(opts, "deregisterOperatorFromAVS", operator) +// Solidity: function getAllocatableMagnitude(address operator, address strategy, uint16 numToComplete) view returns(uint64) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetAllocatableMagnitude(opts *bind.CallOpts, operator common.Address, strategy common.Address, numToComplete uint16) (uint64, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getAllocatableMagnitude", operator, strategy, numToComplete) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + } -// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// GetAllocatableMagnitude is a free data retrieval call binding the contract method 0x3f78612f. // -// Solidity: function deregisterOperatorFromAVS(address operator) returns() -func (_AVSDirectoryStorage *AVSDirectoryStorageSession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { - return _AVSDirectoryStorage.Contract.DeregisterOperatorFromAVS(&_AVSDirectoryStorage.TransactOpts, operator) +// Solidity: function getAllocatableMagnitude(address operator, address strategy, uint16 numToComplete) view returns(uint64) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetAllocatableMagnitude(operator common.Address, strategy common.Address, numToComplete uint16) (uint64, error) { + return _AVSDirectoryStorage.Contract.GetAllocatableMagnitude(&_AVSDirectoryStorage.CallOpts, operator, strategy, numToComplete) } -// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// GetAllocatableMagnitude is a free data retrieval call binding the contract method 0x3f78612f. // -// Solidity: function deregisterOperatorFromAVS(address operator) returns() -func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { - return _AVSDirectoryStorage.Contract.DeregisterOperatorFromAVS(&_AVSDirectoryStorage.TransactOpts, operator) +// Solidity: function getAllocatableMagnitude(address operator, address strategy, uint16 numToComplete) view returns(uint64) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetAllocatableMagnitude(operator common.Address, strategy common.Address, numToComplete uint16) (uint64, error) { + return _AVSDirectoryStorage.Contract.GetAllocatableMagnitude(&_AVSDirectoryStorage.CallOpts, operator, strategy, numToComplete) } -// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// GetCurrentSlashableMagnitudes is a free data retrieval call binding the contract method 0x1d95b524. // -// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() -func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) RegisterOperatorToAVS(opts *bind.TransactOpts, operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { - return _AVSDirectoryStorage.contract.Transact(opts, "registerOperatorToAVS", operator, operatorSignature) +// Solidity: function getCurrentSlashableMagnitudes(address operator, address[] strategies) view returns((address,uint32)[], uint64[][]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetCurrentSlashableMagnitudes(opts *bind.CallOpts, operator common.Address, strategies []common.Address) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getCurrentSlashableMagnitudes", operator, strategies) + + if err != nil { + return *new([]IAVSDirectoryOperatorSet), *new([][]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]IAVSDirectoryOperatorSet)).(*[]IAVSDirectoryOperatorSet) + out1 := *abi.ConvertType(out[1], new([][]uint64)).(*[][]uint64) + + return out0, out1, err + } -// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// GetCurrentSlashableMagnitudes is a free data retrieval call binding the contract method 0x1d95b524. // -// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() -func (_AVSDirectoryStorage *AVSDirectoryStorageSession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { - return _AVSDirectoryStorage.Contract.RegisterOperatorToAVS(&_AVSDirectoryStorage.TransactOpts, operator, operatorSignature) +// Solidity: function getCurrentSlashableMagnitudes(address operator, address[] strategies) view returns((address,uint32)[], uint64[][]) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetCurrentSlashableMagnitudes(operator common.Address, strategies []common.Address) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + return _AVSDirectoryStorage.Contract.GetCurrentSlashableMagnitudes(&_AVSDirectoryStorage.CallOpts, operator, strategies) } -// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// GetCurrentSlashableMagnitudes is a free data retrieval call binding the contract method 0x1d95b524. // -// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() -func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { - return _AVSDirectoryStorage.Contract.RegisterOperatorToAVS(&_AVSDirectoryStorage.TransactOpts, operator, operatorSignature) +// Solidity: function getCurrentSlashableMagnitudes(address operator, address[] strategies) view returns((address,uint32)[], uint64[][]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetCurrentSlashableMagnitudes(operator common.Address, strategies []common.Address) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + return _AVSDirectoryStorage.Contract.GetCurrentSlashableMagnitudes(&_AVSDirectoryStorage.CallOpts, operator, strategies) } -// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// GetNumOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x1023aa35. // -// Solidity: function updateAVSMetadataURI(string metadataURI) returns() -func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) UpdateAVSMetadataURI(opts *bind.TransactOpts, metadataURI string) (*types.Transaction, error) { - return _AVSDirectoryStorage.contract.Transact(opts, "updateAVSMetadataURI", metadataURI) +// Solidity: function getNumOperatorsInOperatorSet((address,uint32) operatorSet) view returns(uint256) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetNumOperatorsInOperatorSet(opts *bind.CallOpts, operatorSet IAVSDirectoryOperatorSet) (*big.Int, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getNumOperatorsInOperatorSet", operatorSet) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + } -// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// GetNumOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x1023aa35. // -// Solidity: function updateAVSMetadataURI(string metadataURI) returns() -func (_AVSDirectoryStorage *AVSDirectoryStorageSession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { - return _AVSDirectoryStorage.Contract.UpdateAVSMetadataURI(&_AVSDirectoryStorage.TransactOpts, metadataURI) +// Solidity: function getNumOperatorsInOperatorSet((address,uint32) operatorSet) view returns(uint256) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetNumOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet) (*big.Int, error) { + return _AVSDirectoryStorage.Contract.GetNumOperatorsInOperatorSet(&_AVSDirectoryStorage.CallOpts, operatorSet) } -// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// GetNumOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x1023aa35. // -// Solidity: function updateAVSMetadataURI(string metadataURI) returns() -func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { - return _AVSDirectoryStorage.Contract.UpdateAVSMetadataURI(&_AVSDirectoryStorage.TransactOpts, metadataURI) +// Solidity: function getNumOperatorsInOperatorSet((address,uint32) operatorSet) view returns(uint256) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetNumOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet) (*big.Int, error) { + return _AVSDirectoryStorage.Contract.GetNumOperatorsInOperatorSet(&_AVSDirectoryStorage.CallOpts, operatorSet) } -// AVSDirectoryStorageAVSMetadataURIUpdatedIterator is returned from FilterAVSMetadataURIUpdated and is used to iterate over the raw logs and unpacked data for AVSMetadataURIUpdated events raised by the AVSDirectoryStorage contract. -type AVSDirectoryStorageAVSMetadataURIUpdatedIterator struct { - Event *AVSDirectoryStorageAVSMetadataURIUpdated // 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 -} +// GetOperatorSetsOfOperator is a free data retrieval call binding the contract method 0x16ae76cb. +// +// Solidity: function getOperatorSetsOfOperator(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetOperatorSetsOfOperator(opts *bind.CallOpts, operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getOperatorSetsOfOperator", operator, start, length) -// 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 *AVSDirectoryStorageAVSMetadataURIUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false + if err != nil { + return *new([]IAVSDirectoryOperatorSet), err } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AVSDirectoryStorageAVSMetadataURIUpdated) - 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(AVSDirectoryStorageAVSMetadataURIUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true + out0 := *abi.ConvertType(out[0], new([]IAVSDirectoryOperatorSet)).(*[]IAVSDirectoryOperatorSet) - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} + return out0, err -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AVSDirectoryStorageAVSMetadataURIUpdatedIterator) Error() error { - return it.fail } -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AVSDirectoryStorageAVSMetadataURIUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil +// GetOperatorSetsOfOperator is a free data retrieval call binding the contract method 0x16ae76cb. +// +// Solidity: function getOperatorSetsOfOperator(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetOperatorSetsOfOperator(operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + return _AVSDirectoryStorage.Contract.GetOperatorSetsOfOperator(&_AVSDirectoryStorage.CallOpts, operator, start, length) +} + +// GetOperatorSetsOfOperator is a free data retrieval call binding the contract method 0x16ae76cb. +// +// Solidity: function getOperatorSetsOfOperator(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetOperatorSetsOfOperator(operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + return _AVSDirectoryStorage.Contract.GetOperatorSetsOfOperator(&_AVSDirectoryStorage.CallOpts, operator, start, length) +} + +// GetOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x7357723b. +// +// Solidity: function getOperatorsInOperatorSet((address,uint32) operatorSet, uint256 start, uint256 length) view returns(address[] operators) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetOperatorsInOperatorSet(opts *bind.CallOpts, operatorSet IAVSDirectoryOperatorSet, start *big.Int, length *big.Int) ([]common.Address, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getOperatorsInOperatorSet", operatorSet, start, length) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x7357723b. +// +// Solidity: function getOperatorsInOperatorSet((address,uint32) operatorSet, uint256 start, uint256 length) view returns(address[] operators) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet, start *big.Int, length *big.Int) ([]common.Address, error) { + return _AVSDirectoryStorage.Contract.GetOperatorsInOperatorSet(&_AVSDirectoryStorage.CallOpts, operatorSet, start, length) +} + +// GetOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x7357723b. +// +// Solidity: function getOperatorsInOperatorSet((address,uint32) operatorSet, uint256 start, uint256 length) view returns(address[] operators) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet, start *big.Int, length *big.Int) ([]common.Address, error) { + return _AVSDirectoryStorage.Contract.GetOperatorsInOperatorSet(&_AVSDirectoryStorage.CallOpts, operatorSet, start, length) +} + +// GetSlashableMagnitudes is a free data retrieval call binding the contract method 0x43b0592d. +// +// Solidity: function getSlashableMagnitudes(address operator, address[] strategies, uint32 timestamp) view returns((address,uint32)[], uint64[][]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetSlashableMagnitudes(opts *bind.CallOpts, operator common.Address, strategies []common.Address, timestamp uint32) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getSlashableMagnitudes", operator, strategies, timestamp) + + if err != nil { + return *new([]IAVSDirectoryOperatorSet), *new([][]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]IAVSDirectoryOperatorSet)).(*[]IAVSDirectoryOperatorSet) + out1 := *abi.ConvertType(out[1], new([][]uint64)).(*[][]uint64) + + return out0, out1, err + +} + +// GetSlashableMagnitudes is a free data retrieval call binding the contract method 0x43b0592d. +// +// Solidity: function getSlashableMagnitudes(address operator, address[] strategies, uint32 timestamp) view returns((address,uint32)[], uint64[][]) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetSlashableMagnitudes(operator common.Address, strategies []common.Address, timestamp uint32) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + return _AVSDirectoryStorage.Contract.GetSlashableMagnitudes(&_AVSDirectoryStorage.CallOpts, operator, strategies, timestamp) +} + +// GetSlashableMagnitudes is a free data retrieval call binding the contract method 0x43b0592d. +// +// Solidity: function getSlashableMagnitudes(address operator, address[] strategies, uint32 timestamp) view returns((address,uint32)[], uint64[][]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetSlashableMagnitudes(operator common.Address, strategies []common.Address, timestamp uint32) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + return _AVSDirectoryStorage.Contract.GetSlashableMagnitudes(&_AVSDirectoryStorage.CallOpts, operator, strategies, timestamp) +} + +// GetSlashablePPM is a free data retrieval call binding the contract method 0x1c699d65. +// +// Solidity: function getSlashablePPM(address operator, (address,uint32) operatorSet, address[] strategies, uint32 timestamp, bool linear) view returns(uint24[]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetSlashablePPM(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet, strategies []common.Address, timestamp uint32, linear bool) ([]*big.Int, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getSlashablePPM", operator, operatorSet, strategies, timestamp, linear) + + if err != nil { + return *new([]*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) + + return out0, err + +} + +// GetSlashablePPM is a free data retrieval call binding the contract method 0x1c699d65. +// +// Solidity: function getSlashablePPM(address operator, (address,uint32) operatorSet, address[] strategies, uint32 timestamp, bool linear) view returns(uint24[]) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetSlashablePPM(operator common.Address, operatorSet IAVSDirectoryOperatorSet, strategies []common.Address, timestamp uint32, linear bool) ([]*big.Int, error) { + return _AVSDirectoryStorage.Contract.GetSlashablePPM(&_AVSDirectoryStorage.CallOpts, operator, operatorSet, strategies, timestamp, linear) +} + +// GetSlashablePPM is a free data retrieval call binding the contract method 0x1c699d65. +// +// Solidity: function getSlashablePPM(address operator, (address,uint32) operatorSet, address[] strategies, uint32 timestamp, bool linear) view returns(uint24[]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetSlashablePPM(operator common.Address, operatorSet IAVSDirectoryOperatorSet, strategies []common.Address, timestamp uint32, linear bool) ([]*big.Int, error) { + return _AVSDirectoryStorage.Contract.GetSlashablePPM(&_AVSDirectoryStorage.CallOpts, operator, operatorSet, strategies, timestamp, linear) +} + +// GetTotalMagnitude is a free data retrieval call binding the contract method 0xb47265e2. +// +// Solidity: function getTotalMagnitude(address operator, address strategy) view returns(uint64) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetTotalMagnitude(opts *bind.CallOpts, operator common.Address, strategy common.Address) (uint64, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getTotalMagnitude", operator, strategy) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// GetTotalMagnitude is a free data retrieval call binding the contract method 0xb47265e2. +// +// Solidity: function getTotalMagnitude(address operator, address strategy) view returns(uint64) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetTotalMagnitude(operator common.Address, strategy common.Address) (uint64, error) { + return _AVSDirectoryStorage.Contract.GetTotalMagnitude(&_AVSDirectoryStorage.CallOpts, operator, strategy) +} + +// GetTotalMagnitude is a free data retrieval call binding the contract method 0xb47265e2. +// +// Solidity: function getTotalMagnitude(address operator, address strategy) view returns(uint64) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetTotalMagnitude(operator common.Address, strategy common.Address) (uint64, error) { + return _AVSDirectoryStorage.Contract.GetTotalMagnitude(&_AVSDirectoryStorage.CallOpts, operator, strategy) +} + +// GetTotalMagnitudeAtTimestamp is a free data retrieval call binding the contract method 0xdabe97c7. +// +// Solidity: function getTotalMagnitudeAtTimestamp(address operator, address strategy, uint32 timestamp) view returns(uint64) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetTotalMagnitudeAtTimestamp(opts *bind.CallOpts, operator common.Address, strategy common.Address, timestamp uint32) (uint64, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getTotalMagnitudeAtTimestamp", operator, strategy, timestamp) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// GetTotalMagnitudeAtTimestamp is a free data retrieval call binding the contract method 0xdabe97c7. +// +// Solidity: function getTotalMagnitudeAtTimestamp(address operator, address strategy, uint32 timestamp) view returns(uint64) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetTotalMagnitudeAtTimestamp(operator common.Address, strategy common.Address, timestamp uint32) (uint64, error) { + return _AVSDirectoryStorage.Contract.GetTotalMagnitudeAtTimestamp(&_AVSDirectoryStorage.CallOpts, operator, strategy, timestamp) +} + +// GetTotalMagnitudeAtTimestamp is a free data retrieval call binding the contract method 0xdabe97c7. +// +// Solidity: function getTotalMagnitudeAtTimestamp(address operator, address strategy, uint32 timestamp) view returns(uint64) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetTotalMagnitudeAtTimestamp(operator common.Address, strategy common.Address, timestamp uint32) (uint64, error) { + return _AVSDirectoryStorage.Contract.GetTotalMagnitudeAtTimestamp(&_AVSDirectoryStorage.CallOpts, operator, strategy, timestamp) +} + +// GetTotalMagnitudes is a free data retrieval call binding the contract method 0x39a9a3ed. +// +// Solidity: function getTotalMagnitudes(address operator, address[] strategies) view returns(uint64[]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetTotalMagnitudes(opts *bind.CallOpts, operator common.Address, strategies []common.Address) ([]uint64, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getTotalMagnitudes", operator, strategies) + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +// GetTotalMagnitudes is a free data retrieval call binding the contract method 0x39a9a3ed. +// +// Solidity: function getTotalMagnitudes(address operator, address[] strategies) view returns(uint64[]) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetTotalMagnitudes(operator common.Address, strategies []common.Address) ([]uint64, error) { + return _AVSDirectoryStorage.Contract.GetTotalMagnitudes(&_AVSDirectoryStorage.CallOpts, operator, strategies) +} + +// GetTotalMagnitudes is a free data retrieval call binding the contract method 0x39a9a3ed. +// +// Solidity: function getTotalMagnitudes(address operator, address[] strategies) view returns(uint64[]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetTotalMagnitudes(operator common.Address, strategies []common.Address) ([]uint64, error) { + return _AVSDirectoryStorage.Contract.GetTotalMagnitudes(&_AVSDirectoryStorage.CallOpts, operator, strategies) +} + +// GetTotalMagnitudesAtTimestamp is a free data retrieval call binding the contract method 0x858d0b47. +// +// Solidity: function getTotalMagnitudesAtTimestamp(address operator, address[] strategies, uint32 timestamp) view returns(uint64[]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) GetTotalMagnitudesAtTimestamp(opts *bind.CallOpts, operator common.Address, strategies []common.Address, timestamp uint32) ([]uint64, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "getTotalMagnitudesAtTimestamp", operator, strategies, timestamp) + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +// GetTotalMagnitudesAtTimestamp is a free data retrieval call binding the contract method 0x858d0b47. +// +// Solidity: function getTotalMagnitudesAtTimestamp(address operator, address[] strategies, uint32 timestamp) view returns(uint64[]) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) GetTotalMagnitudesAtTimestamp(operator common.Address, strategies []common.Address, timestamp uint32) ([]uint64, error) { + return _AVSDirectoryStorage.Contract.GetTotalMagnitudesAtTimestamp(&_AVSDirectoryStorage.CallOpts, operator, strategies, timestamp) +} + +// GetTotalMagnitudesAtTimestamp is a free data retrieval call binding the contract method 0x858d0b47. +// +// Solidity: function getTotalMagnitudesAtTimestamp(address operator, address[] strategies, uint32 timestamp) view returns(uint64[]) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) GetTotalMagnitudesAtTimestamp(operator common.Address, strategies []common.Address, timestamp uint32) ([]uint64, error) { + return _AVSDirectoryStorage.Contract.GetTotalMagnitudesAtTimestamp(&_AVSDirectoryStorage.CallOpts, operator, strategies, timestamp) +} + +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. +// +// Solidity: function inTotalOperatorSets(address operator) view returns(uint256) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) InTotalOperatorSets(opts *bind.CallOpts, operator common.Address) (*big.Int, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "inTotalOperatorSets", operator) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. +// +// Solidity: function inTotalOperatorSets(address operator) view returns(uint256) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) InTotalOperatorSets(operator common.Address) (*big.Int, error) { + return _AVSDirectoryStorage.Contract.InTotalOperatorSets(&_AVSDirectoryStorage.CallOpts, operator) +} + +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. +// +// Solidity: function inTotalOperatorSets(address operator) view returns(uint256) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) InTotalOperatorSets(operator common.Address) (*big.Int, error) { + return _AVSDirectoryStorage.Contract.InTotalOperatorSets(&_AVSDirectoryStorage.CallOpts, operator) +} + +// IsMember is a free data retrieval call binding the contract method 0xda2ff05d. +// +// Solidity: function isMember(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) IsMember(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "isMember", operator, operatorSet) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsMember is a free data retrieval call binding the contract method 0xda2ff05d. +// +// Solidity: function isMember(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) IsMember(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _AVSDirectoryStorage.Contract.IsMember(&_AVSDirectoryStorage.CallOpts, operator, operatorSet) +} + +// IsMember is a free data retrieval call binding the contract method 0xda2ff05d. +// +// Solidity: function isMember(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) IsMember(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _AVSDirectoryStorage.Contract.IsMember(&_AVSDirectoryStorage.CallOpts, operator, operatorSet) +} + +// IsOperatorSet is a free data retrieval call binding the contract method 0x84d76f7b. +// +// Solidity: function isOperatorSet(address , uint32 ) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) IsOperatorSet(opts *bind.CallOpts, arg0 common.Address, arg1 uint32) (bool, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "isOperatorSet", arg0, arg1) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOperatorSet is a free data retrieval call binding the contract method 0x84d76f7b. +// +// Solidity: function isOperatorSet(address , uint32 ) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) IsOperatorSet(arg0 common.Address, arg1 uint32) (bool, error) { + return _AVSDirectoryStorage.Contract.IsOperatorSet(&_AVSDirectoryStorage.CallOpts, arg0, arg1) +} + +// IsOperatorSet is a free data retrieval call binding the contract method 0x84d76f7b. +// +// Solidity: function isOperatorSet(address , uint32 ) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) IsOperatorSet(arg0 common.Address, arg1 uint32) (bool, error) { + return _AVSDirectoryStorage.Contract.IsOperatorSet(&_AVSDirectoryStorage.CallOpts, arg0, arg1) +} + +// IsOperatorSetAVS is a free data retrieval call binding the contract method 0x7673e93a. +// +// Solidity: function isOperatorSetAVS(address ) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) IsOperatorSetAVS(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "isOperatorSetAVS", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOperatorSetAVS is a free data retrieval call binding the contract method 0x7673e93a. +// +// Solidity: function isOperatorSetAVS(address ) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) IsOperatorSetAVS(arg0 common.Address) (bool, error) { + return _AVSDirectoryStorage.Contract.IsOperatorSetAVS(&_AVSDirectoryStorage.CallOpts, arg0) +} + +// IsOperatorSetAVS is a free data retrieval call binding the contract method 0x7673e93a. +// +// Solidity: function isOperatorSetAVS(address ) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) IsOperatorSetAVS(arg0 common.Address) (bool, error) { + return _AVSDirectoryStorage.Contract.IsOperatorSetAVS(&_AVSDirectoryStorage.CallOpts, arg0) +} + +// IsOperatorSlashable is a free data retrieval call binding the contract method 0x1352c3e6. +// +// Solidity: function isOperatorSlashable(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) IsOperatorSlashable(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "isOperatorSlashable", operator, operatorSet) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOperatorSlashable is a free data retrieval call binding the contract method 0x1352c3e6. +// +// Solidity: function isOperatorSlashable(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) IsOperatorSlashable(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _AVSDirectoryStorage.Contract.IsOperatorSlashable(&_AVSDirectoryStorage.CallOpts, operator, operatorSet) +} + +// IsOperatorSlashable is a free data retrieval call binding the contract method 0x1352c3e6. +// +// Solidity: function isOperatorSlashable(address operator, (address,uint32) operatorSet) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) IsOperatorSlashable(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _AVSDirectoryStorage.Contract.IsOperatorSlashable(&_AVSDirectoryStorage.CallOpts, operator, operatorSet) +} + +// OperatorMagnitudeInfo is a free data retrieval call binding the contract method 0xcb13e56b. +// +// Solidity: function operatorMagnitudeInfo(address , address ) view returns(uint192 nextPendingFreeMagnitudeIndex, uint64 freeMagnitude) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) OperatorMagnitudeInfo(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (struct { + NextPendingFreeMagnitudeIndex *big.Int + FreeMagnitude uint64 +}, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "operatorMagnitudeInfo", arg0, arg1) + + outstruct := new(struct { + NextPendingFreeMagnitudeIndex *big.Int + FreeMagnitude uint64 + }) + if err != nil { + return *outstruct, err + } + + outstruct.NextPendingFreeMagnitudeIndex = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.FreeMagnitude = *abi.ConvertType(out[1], new(uint64)).(*uint64) + + return *outstruct, err + +} + +// OperatorMagnitudeInfo is a free data retrieval call binding the contract method 0xcb13e56b. +// +// Solidity: function operatorMagnitudeInfo(address , address ) view returns(uint192 nextPendingFreeMagnitudeIndex, uint64 freeMagnitude) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) OperatorMagnitudeInfo(arg0 common.Address, arg1 common.Address) (struct { + NextPendingFreeMagnitudeIndex *big.Int + FreeMagnitude uint64 +}, error) { + return _AVSDirectoryStorage.Contract.OperatorMagnitudeInfo(&_AVSDirectoryStorage.CallOpts, arg0, arg1) +} + +// OperatorMagnitudeInfo is a free data retrieval call binding the contract method 0xcb13e56b. +// +// Solidity: function operatorMagnitudeInfo(address , address ) view returns(uint192 nextPendingFreeMagnitudeIndex, uint64 freeMagnitude) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) OperatorMagnitudeInfo(arg0 common.Address, arg1 common.Address) (struct { + NextPendingFreeMagnitudeIndex *big.Int + FreeMagnitude uint64 +}, error) { + return _AVSDirectoryStorage.Contract.OperatorMagnitudeInfo(&_AVSDirectoryStorage.CallOpts, arg0, arg1) +} + +// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// +// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) OperatorSaltIsSpent(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte) (bool, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "operatorSaltIsSpent", arg0, arg1) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// +// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) OperatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { + return _AVSDirectoryStorage.Contract.OperatorSaltIsSpent(&_AVSDirectoryStorage.CallOpts, arg0, arg1) +} + +// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// +// Solidity: function operatorSaltIsSpent(address , bytes32 ) view returns(bool) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) OperatorSaltIsSpent(arg0 common.Address, arg1 [32]byte) (bool, error) { + return _AVSDirectoryStorage.Contract.OperatorSaltIsSpent(&_AVSDirectoryStorage.CallOpts, arg0, arg1) +} + +// OperatorSetMemberAtIndex is a free data retrieval call binding the contract method 0x411d415b. +// +// Solidity: function operatorSetMemberAtIndex((address,uint32) operatorSet, uint256 index) view returns(address) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) OperatorSetMemberAtIndex(opts *bind.CallOpts, operatorSet IAVSDirectoryOperatorSet, index *big.Int) (common.Address, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "operatorSetMemberAtIndex", operatorSet, index) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OperatorSetMemberAtIndex is a free data retrieval call binding the contract method 0x411d415b. +// +// Solidity: function operatorSetMemberAtIndex((address,uint32) operatorSet, uint256 index) view returns(address) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) OperatorSetMemberAtIndex(operatorSet IAVSDirectoryOperatorSet, index *big.Int) (common.Address, error) { + return _AVSDirectoryStorage.Contract.OperatorSetMemberAtIndex(&_AVSDirectoryStorage.CallOpts, operatorSet, index) +} + +// OperatorSetMemberAtIndex is a free data retrieval call binding the contract method 0x411d415b. +// +// Solidity: function operatorSetMemberAtIndex((address,uint32) operatorSet, uint256 index) view returns(address) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) OperatorSetMemberAtIndex(operatorSet IAVSDirectoryOperatorSet, index *big.Int) (common.Address, error) { + return _AVSDirectoryStorage.Contract.OperatorSetMemberAtIndex(&_AVSDirectoryStorage.CallOpts, operatorSet, index) +} + +// OperatorSetStatus is a free data retrieval call binding the contract method 0x1e68134e. +// +// Solidity: function operatorSetStatus(address , address , uint32 ) view returns(bool registered, uint32 lastDeregisteredTimestamp) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) OperatorSetStatus(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 uint32) (struct { + Registered bool + LastDeregisteredTimestamp uint32 +}, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "operatorSetStatus", arg0, arg1, arg2) + + outstruct := new(struct { + Registered bool + LastDeregisteredTimestamp uint32 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Registered = *abi.ConvertType(out[0], new(bool)).(*bool) + outstruct.LastDeregisteredTimestamp = *abi.ConvertType(out[1], new(uint32)).(*uint32) + + return *outstruct, err + +} + +// OperatorSetStatus is a free data retrieval call binding the contract method 0x1e68134e. +// +// Solidity: function operatorSetStatus(address , address , uint32 ) view returns(bool registered, uint32 lastDeregisteredTimestamp) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) OperatorSetStatus(arg0 common.Address, arg1 common.Address, arg2 uint32) (struct { + Registered bool + LastDeregisteredTimestamp uint32 +}, error) { + return _AVSDirectoryStorage.Contract.OperatorSetStatus(&_AVSDirectoryStorage.CallOpts, arg0, arg1, arg2) +} + +// OperatorSetStatus is a free data retrieval call binding the contract method 0x1e68134e. +// +// Solidity: function operatorSetStatus(address , address , uint32 ) view returns(bool registered, uint32 lastDeregisteredTimestamp) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) OperatorSetStatus(arg0 common.Address, arg1 common.Address, arg2 uint32) (struct { + Registered bool + LastDeregisteredTimestamp uint32 +}, error) { + return _AVSDirectoryStorage.Contract.OperatorSetStatus(&_AVSDirectoryStorage.CallOpts, arg0, arg1, arg2) +} + +// OperatorSetsMemberOfAtIndex is a free data retrieval call binding the contract method 0xb5a768ca. +// +// Solidity: function operatorSetsMemberOfAtIndex(address operator, uint256 index) view returns((address,uint32)) +func (_AVSDirectoryStorage *AVSDirectoryStorageCaller) OperatorSetsMemberOfAtIndex(opts *bind.CallOpts, operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + var out []interface{} + err := _AVSDirectoryStorage.contract.Call(opts, &out, "operatorSetsMemberOfAtIndex", operator, index) + + if err != nil { + return *new(IAVSDirectoryOperatorSet), err + } + + out0 := *abi.ConvertType(out[0], new(IAVSDirectoryOperatorSet)).(*IAVSDirectoryOperatorSet) + + return out0, err + +} + +// OperatorSetsMemberOfAtIndex is a free data retrieval call binding the contract method 0xb5a768ca. +// +// Solidity: function operatorSetsMemberOfAtIndex(address operator, uint256 index) view returns((address,uint32)) +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) OperatorSetsMemberOfAtIndex(operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + return _AVSDirectoryStorage.Contract.OperatorSetsMemberOfAtIndex(&_AVSDirectoryStorage.CallOpts, operator, index) +} + +// OperatorSetsMemberOfAtIndex is a free data retrieval call binding the contract method 0xb5a768ca. +// +// Solidity: function operatorSetsMemberOfAtIndex(address operator, uint256 index) view returns((address,uint32)) +func (_AVSDirectoryStorage *AVSDirectoryStorageCallerSession) OperatorSetsMemberOfAtIndex(operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + return _AVSDirectoryStorage.Contract.OperatorSetsMemberOfAtIndex(&_AVSDirectoryStorage.CallOpts, operator, index) +} + +// BecomeOperatorSetAVS is a paid mutator transaction binding the contract method 0xaec205c5. +// +// Solidity: function becomeOperatorSetAVS() returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) BecomeOperatorSetAVS(opts *bind.TransactOpts) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "becomeOperatorSetAVS") +} + +// BecomeOperatorSetAVS is a paid mutator transaction binding the contract method 0xaec205c5. +// +// Solidity: function becomeOperatorSetAVS() returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) BecomeOperatorSetAVS() (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.BecomeOperatorSetAVS(&_AVSDirectoryStorage.TransactOpts) +} + +// BecomeOperatorSetAVS is a paid mutator transaction binding the contract method 0xaec205c5. +// +// Solidity: function becomeOperatorSetAVS() returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) BecomeOperatorSetAVS() (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.BecomeOperatorSetAVS(&_AVSDirectoryStorage.TransactOpts) +} + +// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// +// Solidity: function cancelSalt(bytes32 salt) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) CancelSalt(opts *bind.TransactOpts, salt [32]byte) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "cancelSalt", salt) +} + +// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// +// Solidity: function cancelSalt(bytes32 salt) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) CancelSalt(salt [32]byte) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.CancelSalt(&_AVSDirectoryStorage.TransactOpts, salt) +} + +// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// +// Solidity: function cancelSalt(bytes32 salt) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) CancelSalt(salt [32]byte) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.CancelSalt(&_AVSDirectoryStorage.TransactOpts, salt) +} + +// CreateOperatorSets is a paid mutator transaction binding the contract method 0xafe02ed5. +// +// Solidity: function createOperatorSets(uint32[] operatorSetIds) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) CreateOperatorSets(opts *bind.TransactOpts, operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "createOperatorSets", operatorSetIds) +} + +// CreateOperatorSets is a paid mutator transaction binding the contract method 0xafe02ed5. +// +// Solidity: function createOperatorSets(uint32[] operatorSetIds) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) CreateOperatorSets(operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.CreateOperatorSets(&_AVSDirectoryStorage.TransactOpts, operatorSetIds) +} + +// CreateOperatorSets is a paid mutator transaction binding the contract method 0xafe02ed5. +// +// Solidity: function createOperatorSets(uint32[] operatorSetIds) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) CreateOperatorSets(operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.CreateOperatorSets(&_AVSDirectoryStorage.TransactOpts, operatorSetIds) +} + +// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// +// Solidity: function deregisterOperatorFromAVS(address operator) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) DeregisterOperatorFromAVS(opts *bind.TransactOpts, operator common.Address) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "deregisterOperatorFromAVS", operator) +} + +// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// +// Solidity: function deregisterOperatorFromAVS(address operator) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.DeregisterOperatorFromAVS(&_AVSDirectoryStorage.TransactOpts, operator) +} + +// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// +// Solidity: function deregisterOperatorFromAVS(address operator) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.DeregisterOperatorFromAVS(&_AVSDirectoryStorage.TransactOpts, operator) +} + +// DeregisterOperatorFromOperatorSets is a paid mutator transaction binding the contract method 0xc1a8e2c5. +// +// Solidity: function deregisterOperatorFromOperatorSets(address operator, uint32[] operatorSetIds) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) DeregisterOperatorFromOperatorSets(opts *bind.TransactOpts, operator common.Address, operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "deregisterOperatorFromOperatorSets", operator, operatorSetIds) +} + +// DeregisterOperatorFromOperatorSets is a paid mutator transaction binding the contract method 0xc1a8e2c5. +// +// Solidity: function deregisterOperatorFromOperatorSets(address operator, uint32[] operatorSetIds) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) DeregisterOperatorFromOperatorSets(operator common.Address, operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.DeregisterOperatorFromOperatorSets(&_AVSDirectoryStorage.TransactOpts, operator, operatorSetIds) +} + +// DeregisterOperatorFromOperatorSets is a paid mutator transaction binding the contract method 0xc1a8e2c5. +// +// Solidity: function deregisterOperatorFromOperatorSets(address operator, uint32[] operatorSetIds) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) DeregisterOperatorFromOperatorSets(operator common.Address, operatorSetIds []uint32) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.DeregisterOperatorFromOperatorSets(&_AVSDirectoryStorage.TransactOpts, operator, operatorSetIds) +} + +// ForceDeregisterFromOperatorSets is a paid mutator transaction binding the contract method 0x3fee332d. +// +// Solidity: function forceDeregisterFromOperatorSets(address operator, address avs, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) ForceDeregisterFromOperatorSets(opts *bind.TransactOpts, operator common.Address, avs common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "forceDeregisterFromOperatorSets", operator, avs, operatorSetIds, operatorSignature) +} + +// ForceDeregisterFromOperatorSets is a paid mutator transaction binding the contract method 0x3fee332d. +// +// Solidity: function forceDeregisterFromOperatorSets(address operator, address avs, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) ForceDeregisterFromOperatorSets(operator common.Address, avs common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.ForceDeregisterFromOperatorSets(&_AVSDirectoryStorage.TransactOpts, operator, avs, operatorSetIds, operatorSignature) +} + +// ForceDeregisterFromOperatorSets is a paid mutator transaction binding the contract method 0x3fee332d. +// +// Solidity: function forceDeregisterFromOperatorSets(address operator, address avs, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) ForceDeregisterFromOperatorSets(operator common.Address, avs common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.ForceDeregisterFromOperatorSets(&_AVSDirectoryStorage.TransactOpts, operator, avs, operatorSetIds, operatorSignature) +} + +// MigrateOperatorsToOperatorSets is a paid mutator transaction binding the contract method 0xef2dfa8d. +// +// Solidity: function migrateOperatorsToOperatorSets(address[] operators, uint32[][] operatorSetIds) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) MigrateOperatorsToOperatorSets(opts *bind.TransactOpts, operators []common.Address, operatorSetIds [][]uint32) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "migrateOperatorsToOperatorSets", operators, operatorSetIds) +} + +// MigrateOperatorsToOperatorSets is a paid mutator transaction binding the contract method 0xef2dfa8d. +// +// Solidity: function migrateOperatorsToOperatorSets(address[] operators, uint32[][] operatorSetIds) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) MigrateOperatorsToOperatorSets(operators []common.Address, operatorSetIds [][]uint32) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.MigrateOperatorsToOperatorSets(&_AVSDirectoryStorage.TransactOpts, operators, operatorSetIds) +} + +// MigrateOperatorsToOperatorSets is a paid mutator transaction binding the contract method 0xef2dfa8d. +// +// Solidity: function migrateOperatorsToOperatorSets(address[] operators, uint32[][] operatorSetIds) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) MigrateOperatorsToOperatorSets(operators []common.Address, operatorSetIds [][]uint32) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.MigrateOperatorsToOperatorSets(&_AVSDirectoryStorage.TransactOpts, operators, operatorSetIds) +} + +// ModifyAllocations is a paid mutator transaction binding the contract method 0xf8e91d16. +// +// Solidity: function modifyAllocations(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) ModifyAllocations(opts *bind.TransactOpts, operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "modifyAllocations", operator, allocations, operatorSignature) +} + +// ModifyAllocations is a paid mutator transaction binding the contract method 0xf8e91d16. +// +// Solidity: function modifyAllocations(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) ModifyAllocations(operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.ModifyAllocations(&_AVSDirectoryStorage.TransactOpts, operator, allocations, operatorSignature) +} + +// ModifyAllocations is a paid mutator transaction binding the contract method 0xf8e91d16. +// +// Solidity: function modifyAllocations(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) ModifyAllocations(operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.ModifyAllocations(&_AVSDirectoryStorage.TransactOpts, operator, allocations, operatorSignature) +} + +// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// +// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) RegisterOperatorToAVS(opts *bind.TransactOpts, operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "registerOperatorToAVS", operator, operatorSignature) +} + +// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// +// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.RegisterOperatorToAVS(&_AVSDirectoryStorage.TransactOpts, operator, operatorSignature) +} + +// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// +// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.RegisterOperatorToAVS(&_AVSDirectoryStorage.TransactOpts, operator, operatorSignature) +} + +// RegisterOperatorToOperatorSets is a paid mutator transaction binding the contract method 0x1e2199e2. +// +// Solidity: function registerOperatorToOperatorSets(address operator, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) RegisterOperatorToOperatorSets(opts *bind.TransactOpts, operator common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "registerOperatorToOperatorSets", operator, operatorSetIds, operatorSignature) +} + +// RegisterOperatorToOperatorSets is a paid mutator transaction binding the contract method 0x1e2199e2. +// +// Solidity: function registerOperatorToOperatorSets(address operator, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) RegisterOperatorToOperatorSets(operator common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.RegisterOperatorToOperatorSets(&_AVSDirectoryStorage.TransactOpts, operator, operatorSetIds, operatorSignature) +} + +// RegisterOperatorToOperatorSets is a paid mutator transaction binding the contract method 0x1e2199e2. +// +// Solidity: function registerOperatorToOperatorSets(address operator, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) RegisterOperatorToOperatorSets(operator common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.RegisterOperatorToOperatorSets(&_AVSDirectoryStorage.TransactOpts, operator, operatorSetIds, operatorSignature) +} + +// SlashOperator is a paid mutator transaction binding the contract method 0xbd74a06c. +// +// Solidity: function slashOperator(address operator, uint32 operatorSetId, address[] strategies, uint16 bipsToSlash) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) SlashOperator(opts *bind.TransactOpts, operator common.Address, operatorSetId uint32, strategies []common.Address, bipsToSlash uint16) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "slashOperator", operator, operatorSetId, strategies, bipsToSlash) +} + +// SlashOperator is a paid mutator transaction binding the contract method 0xbd74a06c. +// +// Solidity: function slashOperator(address operator, uint32 operatorSetId, address[] strategies, uint16 bipsToSlash) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) SlashOperator(operator common.Address, operatorSetId uint32, strategies []common.Address, bipsToSlash uint16) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.SlashOperator(&_AVSDirectoryStorage.TransactOpts, operator, operatorSetId, strategies, bipsToSlash) +} + +// SlashOperator is a paid mutator transaction binding the contract method 0xbd74a06c. +// +// Solidity: function slashOperator(address operator, uint32 operatorSetId, address[] strategies, uint16 bipsToSlash) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) SlashOperator(operator common.Address, operatorSetId uint32, strategies []common.Address, bipsToSlash uint16) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.SlashOperator(&_AVSDirectoryStorage.TransactOpts, operator, operatorSetId, strategies, bipsToSlash) +} + +// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// +// Solidity: function updateAVSMetadataURI(string metadataURI) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) UpdateAVSMetadataURI(opts *bind.TransactOpts, metadataURI string) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "updateAVSMetadataURI", metadataURI) +} + +// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// +// Solidity: function updateAVSMetadataURI(string metadataURI) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.UpdateAVSMetadataURI(&_AVSDirectoryStorage.TransactOpts, metadataURI) +} + +// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// +// Solidity: function updateAVSMetadataURI(string metadataURI) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.UpdateAVSMetadataURI(&_AVSDirectoryStorage.TransactOpts, metadataURI) +} + +// UpdateFreeMagnitude is a paid mutator transaction binding the contract method 0xce770388. +// +// Solidity: function updateFreeMagnitude(address operator, address[] strategies, uint16[] numToComplete) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactor) UpdateFreeMagnitude(opts *bind.TransactOpts, operator common.Address, strategies []common.Address, numToComplete []uint16) (*types.Transaction, error) { + return _AVSDirectoryStorage.contract.Transact(opts, "updateFreeMagnitude", operator, strategies, numToComplete) +} + +// UpdateFreeMagnitude is a paid mutator transaction binding the contract method 0xce770388. +// +// Solidity: function updateFreeMagnitude(address operator, address[] strategies, uint16[] numToComplete) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageSession) UpdateFreeMagnitude(operator common.Address, strategies []common.Address, numToComplete []uint16) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.UpdateFreeMagnitude(&_AVSDirectoryStorage.TransactOpts, operator, strategies, numToComplete) +} + +// UpdateFreeMagnitude is a paid mutator transaction binding the contract method 0xce770388. +// +// Solidity: function updateFreeMagnitude(address operator, address[] strategies, uint16[] numToComplete) returns() +func (_AVSDirectoryStorage *AVSDirectoryStorageTransactorSession) UpdateFreeMagnitude(operator common.Address, strategies []common.Address, numToComplete []uint16) (*types.Transaction, error) { + return _AVSDirectoryStorage.Contract.UpdateFreeMagnitude(&_AVSDirectoryStorage.TransactOpts, operator, strategies, numToComplete) +} + +// AVSDirectoryStorageAVSMetadataURIUpdatedIterator is returned from FilterAVSMetadataURIUpdated and is used to iterate over the raw logs and unpacked data for AVSMetadataURIUpdated events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageAVSMetadataURIUpdatedIterator struct { + Event *AVSDirectoryStorageAVSMetadataURIUpdated // 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 *AVSDirectoryStorageAVSMetadataURIUpdatedIterator) 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(AVSDirectoryStorageAVSMetadataURIUpdated) + 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(AVSDirectoryStorageAVSMetadataURIUpdated) + 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 *AVSDirectoryStorageAVSMetadataURIUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageAVSMetadataURIUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil } // AVSDirectoryStorageAVSMetadataURIUpdated represents a AVSMetadataURIUpdated event raised by the AVSDirectoryStorage contract. @@ -510,34 +1601,1189 @@ type AVSDirectoryStorageAVSMetadataURIUpdated struct { Raw types.Log // Blockchain specific contextual infos } -// FilterAVSMetadataURIUpdated is a free log retrieval operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// FilterAVSMetadataURIUpdated is a free log retrieval operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// +// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterAVSMetadataURIUpdated(opts *bind.FilterOpts, avs []common.Address) (*AVSDirectoryStorageAVSMetadataURIUpdatedIterator, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "AVSMetadataURIUpdated", avsRule) + if err != nil { + return nil, err + } + return &AVSDirectoryStorageAVSMetadataURIUpdatedIterator{contract: _AVSDirectoryStorage.contract, event: "AVSMetadataURIUpdated", logs: logs, sub: sub}, nil +} + +// WatchAVSMetadataURIUpdated is a free log subscription operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// +// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchAVSMetadataURIUpdated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageAVSMetadataURIUpdated, avs []common.Address) (event.Subscription, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "AVSMetadataURIUpdated", avsRule) + 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(AVSDirectoryStorageAVSMetadataURIUpdated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "AVSMetadataURIUpdated", 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 +} + +// ParseAVSMetadataURIUpdated is a log parse operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// +// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseAVSMetadataURIUpdated(log types.Log) (*AVSDirectoryStorageAVSMetadataURIUpdated, error) { + event := new(AVSDirectoryStorageAVSMetadataURIUpdated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "AVSMetadataURIUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryStorageAVSMigratedToOperatorSetsIterator is returned from FilterAVSMigratedToOperatorSets and is used to iterate over the raw logs and unpacked data for AVSMigratedToOperatorSets events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageAVSMigratedToOperatorSetsIterator struct { + Event *AVSDirectoryStorageAVSMigratedToOperatorSets // 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 *AVSDirectoryStorageAVSMigratedToOperatorSetsIterator) 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(AVSDirectoryStorageAVSMigratedToOperatorSets) + 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(AVSDirectoryStorageAVSMigratedToOperatorSets) + 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 *AVSDirectoryStorageAVSMigratedToOperatorSetsIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageAVSMigratedToOperatorSetsIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryStorageAVSMigratedToOperatorSets represents a AVSMigratedToOperatorSets event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageAVSMigratedToOperatorSets struct { + Avs common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAVSMigratedToOperatorSets is a free log retrieval operation binding the contract event 0x702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf. +// +// Solidity: event AVSMigratedToOperatorSets(address indexed avs) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterAVSMigratedToOperatorSets(opts *bind.FilterOpts, avs []common.Address) (*AVSDirectoryStorageAVSMigratedToOperatorSetsIterator, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "AVSMigratedToOperatorSets", avsRule) + if err != nil { + return nil, err + } + return &AVSDirectoryStorageAVSMigratedToOperatorSetsIterator{contract: _AVSDirectoryStorage.contract, event: "AVSMigratedToOperatorSets", logs: logs, sub: sub}, nil +} + +// WatchAVSMigratedToOperatorSets is a free log subscription operation binding the contract event 0x702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf. +// +// Solidity: event AVSMigratedToOperatorSets(address indexed avs) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchAVSMigratedToOperatorSets(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageAVSMigratedToOperatorSets, avs []common.Address) (event.Subscription, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "AVSMigratedToOperatorSets", avsRule) + 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(AVSDirectoryStorageAVSMigratedToOperatorSets) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "AVSMigratedToOperatorSets", 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 +} + +// ParseAVSMigratedToOperatorSets is a log parse operation binding the contract event 0x702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf. +// +// Solidity: event AVSMigratedToOperatorSets(address indexed avs) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseAVSMigratedToOperatorSets(log types.Log) (*AVSDirectoryStorageAVSMigratedToOperatorSets, error) { + event := new(AVSDirectoryStorageAVSMigratedToOperatorSets) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "AVSMigratedToOperatorSets", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryStorageMagnitudeAllocatedIterator is returned from FilterMagnitudeAllocated and is used to iterate over the raw logs and unpacked data for MagnitudeAllocated events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageMagnitudeAllocatedIterator struct { + Event *AVSDirectoryStorageMagnitudeAllocated // 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 *AVSDirectoryStorageMagnitudeAllocatedIterator) 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(AVSDirectoryStorageMagnitudeAllocated) + 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(AVSDirectoryStorageMagnitudeAllocated) + 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 *AVSDirectoryStorageMagnitudeAllocatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageMagnitudeAllocatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryStorageMagnitudeAllocated represents a MagnitudeAllocated event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageMagnitudeAllocated struct { + Operator common.Address + Strategy common.Address + OperatorSet IAVSDirectoryOperatorSet + MagnitudeToAllocate uint64 + EffectTimestamp uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMagnitudeAllocated is a free log retrieval operation binding the contract event 0x6d7d0079582cb2c5e70d4135b37f36711415ee6c260778b716bd65e026eb4f1a. +// +// Solidity: event MagnitudeAllocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToAllocate, uint32 effectTimestamp) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterMagnitudeAllocated(opts *bind.FilterOpts) (*AVSDirectoryStorageMagnitudeAllocatedIterator, error) { + + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "MagnitudeAllocated") + if err != nil { + return nil, err + } + return &AVSDirectoryStorageMagnitudeAllocatedIterator{contract: _AVSDirectoryStorage.contract, event: "MagnitudeAllocated", logs: logs, sub: sub}, nil +} + +// WatchMagnitudeAllocated is a free log subscription operation binding the contract event 0x6d7d0079582cb2c5e70d4135b37f36711415ee6c260778b716bd65e026eb4f1a. +// +// Solidity: event MagnitudeAllocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToAllocate, uint32 effectTimestamp) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchMagnitudeAllocated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageMagnitudeAllocated) (event.Subscription, error) { + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "MagnitudeAllocated") + 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(AVSDirectoryStorageMagnitudeAllocated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "MagnitudeAllocated", 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 +} + +// ParseMagnitudeAllocated is a log parse operation binding the contract event 0x6d7d0079582cb2c5e70d4135b37f36711415ee6c260778b716bd65e026eb4f1a. +// +// Solidity: event MagnitudeAllocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToAllocate, uint32 effectTimestamp) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseMagnitudeAllocated(log types.Log) (*AVSDirectoryStorageMagnitudeAllocated, error) { + event := new(AVSDirectoryStorageMagnitudeAllocated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "MagnitudeAllocated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryStorageMagnitudeDeallocationCompletedIterator is returned from FilterMagnitudeDeallocationCompleted and is used to iterate over the raw logs and unpacked data for MagnitudeDeallocationCompleted events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageMagnitudeDeallocationCompletedIterator struct { + Event *AVSDirectoryStorageMagnitudeDeallocationCompleted // 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 *AVSDirectoryStorageMagnitudeDeallocationCompletedIterator) 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(AVSDirectoryStorageMagnitudeDeallocationCompleted) + 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(AVSDirectoryStorageMagnitudeDeallocationCompleted) + 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 *AVSDirectoryStorageMagnitudeDeallocationCompletedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageMagnitudeDeallocationCompletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryStorageMagnitudeDeallocationCompleted represents a MagnitudeDeallocationCompleted event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageMagnitudeDeallocationCompleted struct { + Operator common.Address + Strategy common.Address + OperatorSet IAVSDirectoryOperatorSet + FreeMagnitudeAdded uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMagnitudeDeallocationCompleted is a free log retrieval operation binding the contract event 0x1e5c8e13c62c31d6252ac205e592477d643c7e95831d5b46d99a3c60c2fad8db. +// +// Solidity: event MagnitudeDeallocationCompleted(address operator, address strategy, (address,uint32) operatorSet, uint64 freeMagnitudeAdded) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterMagnitudeDeallocationCompleted(opts *bind.FilterOpts) (*AVSDirectoryStorageMagnitudeDeallocationCompletedIterator, error) { + + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "MagnitudeDeallocationCompleted") + if err != nil { + return nil, err + } + return &AVSDirectoryStorageMagnitudeDeallocationCompletedIterator{contract: _AVSDirectoryStorage.contract, event: "MagnitudeDeallocationCompleted", logs: logs, sub: sub}, nil +} + +// WatchMagnitudeDeallocationCompleted is a free log subscription operation binding the contract event 0x1e5c8e13c62c31d6252ac205e592477d643c7e95831d5b46d99a3c60c2fad8db. +// +// Solidity: event MagnitudeDeallocationCompleted(address operator, address strategy, (address,uint32) operatorSet, uint64 freeMagnitudeAdded) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchMagnitudeDeallocationCompleted(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageMagnitudeDeallocationCompleted) (event.Subscription, error) { + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "MagnitudeDeallocationCompleted") + 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(AVSDirectoryStorageMagnitudeDeallocationCompleted) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "MagnitudeDeallocationCompleted", 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 +} + +// ParseMagnitudeDeallocationCompleted is a log parse operation binding the contract event 0x1e5c8e13c62c31d6252ac205e592477d643c7e95831d5b46d99a3c60c2fad8db. +// +// Solidity: event MagnitudeDeallocationCompleted(address operator, address strategy, (address,uint32) operatorSet, uint64 freeMagnitudeAdded) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseMagnitudeDeallocationCompleted(log types.Log) (*AVSDirectoryStorageMagnitudeDeallocationCompleted, error) { + event := new(AVSDirectoryStorageMagnitudeDeallocationCompleted) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "MagnitudeDeallocationCompleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryStorageMagnitudeQueueDeallocatedIterator is returned from FilterMagnitudeQueueDeallocated and is used to iterate over the raw logs and unpacked data for MagnitudeQueueDeallocated events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageMagnitudeQueueDeallocatedIterator struct { + Event *AVSDirectoryStorageMagnitudeQueueDeallocated // 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 *AVSDirectoryStorageMagnitudeQueueDeallocatedIterator) 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(AVSDirectoryStorageMagnitudeQueueDeallocated) + 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(AVSDirectoryStorageMagnitudeQueueDeallocated) + 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 *AVSDirectoryStorageMagnitudeQueueDeallocatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageMagnitudeQueueDeallocatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryStorageMagnitudeQueueDeallocated represents a MagnitudeQueueDeallocated event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageMagnitudeQueueDeallocated struct { + Operator common.Address + Strategy common.Address + OperatorSet IAVSDirectoryOperatorSet + MagnitudeToDeallocate uint64 + CompletableTimestamp uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMagnitudeQueueDeallocated is a free log retrieval operation binding the contract event 0x2e68db1fe51107d7e451ae268d1631796989ab9d7925054e9b247854cb5be950. +// +// Solidity: event MagnitudeQueueDeallocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToDeallocate, uint32 completableTimestamp) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterMagnitudeQueueDeallocated(opts *bind.FilterOpts) (*AVSDirectoryStorageMagnitudeQueueDeallocatedIterator, error) { + + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "MagnitudeQueueDeallocated") + if err != nil { + return nil, err + } + return &AVSDirectoryStorageMagnitudeQueueDeallocatedIterator{contract: _AVSDirectoryStorage.contract, event: "MagnitudeQueueDeallocated", logs: logs, sub: sub}, nil +} + +// WatchMagnitudeQueueDeallocated is a free log subscription operation binding the contract event 0x2e68db1fe51107d7e451ae268d1631796989ab9d7925054e9b247854cb5be950. +// +// Solidity: event MagnitudeQueueDeallocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToDeallocate, uint32 completableTimestamp) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchMagnitudeQueueDeallocated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageMagnitudeQueueDeallocated) (event.Subscription, error) { + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "MagnitudeQueueDeallocated") + 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(AVSDirectoryStorageMagnitudeQueueDeallocated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "MagnitudeQueueDeallocated", 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 +} + +// ParseMagnitudeQueueDeallocated is a log parse operation binding the contract event 0x2e68db1fe51107d7e451ae268d1631796989ab9d7925054e9b247854cb5be950. +// +// Solidity: event MagnitudeQueueDeallocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToDeallocate, uint32 completableTimestamp) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseMagnitudeQueueDeallocated(log types.Log) (*AVSDirectoryStorageMagnitudeQueueDeallocated, error) { + event := new(AVSDirectoryStorageMagnitudeQueueDeallocated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "MagnitudeQueueDeallocated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator is returned from FilterOperatorAVSRegistrationStatusUpdated and is used to iterate over the raw logs and unpacked data for OperatorAVSRegistrationStatusUpdated events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator struct { + Event *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated // 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 *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator) 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(AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated) + 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(AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated) + 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 *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated represents a OperatorAVSRegistrationStatusUpdated event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated struct { + Operator common.Address + Avs common.Address + Status uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorAVSRegistrationStatusUpdated is a free log retrieval operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// +// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterOperatorAVSRegistrationStatusUpdated(opts *bind.FilterOpts, operator []common.Address, avs []common.Address) (*AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + if err != nil { + return nil, err + } + return &AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator{contract: _AVSDirectoryStorage.contract, event: "OperatorAVSRegistrationStatusUpdated", logs: logs, sub: sub}, nil +} + +// WatchOperatorAVSRegistrationStatusUpdated is a free log subscription operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// +// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchOperatorAVSRegistrationStatusUpdated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated, operator []common.Address, avs []common.Address) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + 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(AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", 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 +} + +// ParseOperatorAVSRegistrationStatusUpdated is a log parse operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// +// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseOperatorAVSRegistrationStatusUpdated(log types.Log) (*AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated, error) { + event := new(AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryStorageOperatorAddedToOperatorSetIterator is returned from FilterOperatorAddedToOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorAddedToOperatorSet events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorAddedToOperatorSetIterator struct { + Event *AVSDirectoryStorageOperatorAddedToOperatorSet // 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 *AVSDirectoryStorageOperatorAddedToOperatorSetIterator) 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(AVSDirectoryStorageOperatorAddedToOperatorSet) + 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(AVSDirectoryStorageOperatorAddedToOperatorSet) + 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 *AVSDirectoryStorageOperatorAddedToOperatorSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageOperatorAddedToOperatorSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryStorageOperatorAddedToOperatorSet represents a OperatorAddedToOperatorSet event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorAddedToOperatorSet struct { + Operator common.Address + OperatorSet IAVSDirectoryOperatorSet + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorAddedToOperatorSet is a free log retrieval operation binding the contract event 0x43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e. +// +// Solidity: event OperatorAddedToOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterOperatorAddedToOperatorSet(opts *bind.FilterOpts, operator []common.Address) (*AVSDirectoryStorageOperatorAddedToOperatorSetIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "OperatorAddedToOperatorSet", operatorRule) + if err != nil { + return nil, err + } + return &AVSDirectoryStorageOperatorAddedToOperatorSetIterator{contract: _AVSDirectoryStorage.contract, event: "OperatorAddedToOperatorSet", logs: logs, sub: sub}, nil +} + +// WatchOperatorAddedToOperatorSet is a free log subscription operation binding the contract event 0x43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e. +// +// Solidity: event OperatorAddedToOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchOperatorAddedToOperatorSet(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageOperatorAddedToOperatorSet, operator []common.Address) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "OperatorAddedToOperatorSet", operatorRule) + 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(AVSDirectoryStorageOperatorAddedToOperatorSet) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorAddedToOperatorSet", 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 +} + +// ParseOperatorAddedToOperatorSet is a log parse operation binding the contract event 0x43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e. +// +// Solidity: event OperatorAddedToOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseOperatorAddedToOperatorSet(log types.Log) (*AVSDirectoryStorageOperatorAddedToOperatorSet, error) { + event := new(AVSDirectoryStorageOperatorAddedToOperatorSet) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorAddedToOperatorSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryStorageOperatorMigratedToOperatorSetsIterator is returned from FilterOperatorMigratedToOperatorSets and is used to iterate over the raw logs and unpacked data for OperatorMigratedToOperatorSets events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorMigratedToOperatorSetsIterator struct { + Event *AVSDirectoryStorageOperatorMigratedToOperatorSets // 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 *AVSDirectoryStorageOperatorMigratedToOperatorSetsIterator) 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(AVSDirectoryStorageOperatorMigratedToOperatorSets) + 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(AVSDirectoryStorageOperatorMigratedToOperatorSets) + 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 *AVSDirectoryStorageOperatorMigratedToOperatorSetsIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageOperatorMigratedToOperatorSetsIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryStorageOperatorMigratedToOperatorSets represents a OperatorMigratedToOperatorSets event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorMigratedToOperatorSets struct { + Operator common.Address + Avs common.Address + OperatorSetIds []uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorMigratedToOperatorSets is a free log retrieval operation binding the contract event 0x54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01. +// +// Solidity: event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterOperatorMigratedToOperatorSets(opts *bind.FilterOpts, operator []common.Address, avs []common.Address) (*AVSDirectoryStorageOperatorMigratedToOperatorSetsIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "OperatorMigratedToOperatorSets", operatorRule, avsRule) + if err != nil { + return nil, err + } + return &AVSDirectoryStorageOperatorMigratedToOperatorSetsIterator{contract: _AVSDirectoryStorage.contract, event: "OperatorMigratedToOperatorSets", logs: logs, sub: sub}, nil +} + +// WatchOperatorMigratedToOperatorSets is a free log subscription operation binding the contract event 0x54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01. +// +// Solidity: event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchOperatorMigratedToOperatorSets(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageOperatorMigratedToOperatorSets, operator []common.Address, avs []common.Address) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "OperatorMigratedToOperatorSets", operatorRule, avsRule) + 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(AVSDirectoryStorageOperatorMigratedToOperatorSets) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorMigratedToOperatorSets", 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 +} + +// ParseOperatorMigratedToOperatorSets is a log parse operation binding the contract event 0x54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01. +// +// Solidity: event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseOperatorMigratedToOperatorSets(log types.Log) (*AVSDirectoryStorageOperatorMigratedToOperatorSets, error) { + event := new(AVSDirectoryStorageOperatorMigratedToOperatorSets) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorMigratedToOperatorSets", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// AVSDirectoryStorageOperatorRemovedFromOperatorSetIterator is returned from FilterOperatorRemovedFromOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorRemovedFromOperatorSet events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorRemovedFromOperatorSetIterator struct { + Event *AVSDirectoryStorageOperatorRemovedFromOperatorSet // 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 *AVSDirectoryStorageOperatorRemovedFromOperatorSetIterator) 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(AVSDirectoryStorageOperatorRemovedFromOperatorSet) + 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(AVSDirectoryStorageOperatorRemovedFromOperatorSet) + 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 *AVSDirectoryStorageOperatorRemovedFromOperatorSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageOperatorRemovedFromOperatorSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryStorageOperatorRemovedFromOperatorSet represents a OperatorRemovedFromOperatorSet event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorRemovedFromOperatorSet struct { + Operator common.Address + OperatorSet IAVSDirectoryOperatorSet + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorRemovedFromOperatorSet is a free log retrieval operation binding the contract event 0xad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe. // -// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) -func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterAVSMetadataURIUpdated(opts *bind.FilterOpts, avs []common.Address) (*AVSDirectoryStorageAVSMetadataURIUpdatedIterator, error) { +// Solidity: event OperatorRemovedFromOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterOperatorRemovedFromOperatorSet(opts *bind.FilterOpts, operator []common.Address) (*AVSDirectoryStorageOperatorRemovedFromOperatorSetIterator, error) { - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) } - logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "AVSMetadataURIUpdated", avsRule) + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "OperatorRemovedFromOperatorSet", operatorRule) if err != nil { return nil, err } - return &AVSDirectoryStorageAVSMetadataURIUpdatedIterator{contract: _AVSDirectoryStorage.contract, event: "AVSMetadataURIUpdated", logs: logs, sub: sub}, nil + return &AVSDirectoryStorageOperatorRemovedFromOperatorSetIterator{contract: _AVSDirectoryStorage.contract, event: "OperatorRemovedFromOperatorSet", logs: logs, sub: sub}, nil } -// WatchAVSMetadataURIUpdated is a free log subscription operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// WatchOperatorRemovedFromOperatorSet is a free log subscription operation binding the contract event 0xad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe. // -// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) -func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchAVSMetadataURIUpdated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageAVSMetadataURIUpdated, avs []common.Address) (event.Subscription, error) { +// Solidity: event OperatorRemovedFromOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchOperatorRemovedFromOperatorSet(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageOperatorRemovedFromOperatorSet, operator []common.Address) (event.Subscription, error) { - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) } - logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "AVSMetadataURIUpdated", avsRule) + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "OperatorRemovedFromOperatorSet", operatorRule) if err != nil { return nil, err } @@ -547,8 +2793,8 @@ func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchAVSMetadataURIUpda select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(AVSDirectoryStorageAVSMetadataURIUpdated) - if err := _AVSDirectoryStorage.contract.UnpackLog(event, "AVSMetadataURIUpdated", log); err != nil { + event := new(AVSDirectoryStorageOperatorRemovedFromOperatorSet) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorRemovedFromOperatorSet", log); err != nil { return err } event.Raw = log @@ -569,21 +2815,21 @@ func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchAVSMetadataURIUpda }), nil } -// ParseAVSMetadataURIUpdated is a log parse operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// ParseOperatorRemovedFromOperatorSet is a log parse operation binding the contract event 0xad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe. // -// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) -func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseAVSMetadataURIUpdated(log types.Log) (*AVSDirectoryStorageAVSMetadataURIUpdated, error) { - event := new(AVSDirectoryStorageAVSMetadataURIUpdated) - if err := _AVSDirectoryStorage.contract.UnpackLog(event, "AVSMetadataURIUpdated", log); err != nil { +// Solidity: event OperatorRemovedFromOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseOperatorRemovedFromOperatorSet(log types.Log) (*AVSDirectoryStorageOperatorRemovedFromOperatorSet, error) { + event := new(AVSDirectoryStorageOperatorRemovedFromOperatorSet) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorRemovedFromOperatorSet", log); err != nil { return nil, err } event.Raw = log return event, nil } -// AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator is returned from FilterOperatorAVSRegistrationStatusUpdated and is used to iterate over the raw logs and unpacked data for OperatorAVSRegistrationStatusUpdated events raised by the AVSDirectoryStorage contract. -type AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator struct { - Event *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated // Event containing the contract specifics and raw log +// AVSDirectoryStorageOperatorSetCreatedIterator is returned from FilterOperatorSetCreated and is used to iterate over the raw logs and unpacked data for OperatorSetCreated events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorSetCreatedIterator struct { + Event *AVSDirectoryStorageOperatorSetCreated // 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 @@ -597,7 +2843,7 @@ type AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator) Next() bool { +func (it *AVSDirectoryStorageOperatorSetCreatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -606,7 +2852,7 @@ func (it *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator) Next( if it.done { select { case log := <-it.logs: - it.Event = new(AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated) + it.Event = new(AVSDirectoryStorageOperatorSetCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -621,7 +2867,7 @@ func (it *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator) Next( // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated) + it.Event = new(AVSDirectoryStorageOperatorSetCreated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -637,61 +2883,178 @@ func (it *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator) Next( } // Error returns any retrieval or parsing error occurred during filtering. -func (it *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator) Error() error { +func (it *AVSDirectoryStorageOperatorSetCreatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator) Close() error { +func (it *AVSDirectoryStorageOperatorSetCreatedIterator) Close() error { it.sub.Unsubscribe() return nil } -// AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated represents a OperatorAVSRegistrationStatusUpdated event raised by the AVSDirectoryStorage contract. -type AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated struct { - Operator common.Address - Avs common.Address - Status uint8 - Raw types.Log // Blockchain specific contextual infos +// AVSDirectoryStorageOperatorSetCreated represents a OperatorSetCreated event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorSetCreated struct { + OperatorSet IAVSDirectoryOperatorSet + Raw types.Log // Blockchain specific contextual infos } -// FilterOperatorAVSRegistrationStatusUpdated is a free log retrieval operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// FilterOperatorSetCreated is a free log retrieval operation binding the contract event 0x31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c. // -// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) -func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterOperatorAVSRegistrationStatusUpdated(opts *bind.FilterOpts, operator []common.Address, avs []common.Address) (*AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator, error) { +// Solidity: event OperatorSetCreated((address,uint32) operatorSet) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterOperatorSetCreated(opts *bind.FilterOpts) (*AVSDirectoryStorageOperatorSetCreatedIterator, error) { - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "OperatorSetCreated") + if err != nil { + return nil, err } + return &AVSDirectoryStorageOperatorSetCreatedIterator{contract: _AVSDirectoryStorage.contract, event: "OperatorSetCreated", logs: logs, sub: sub}, nil +} - logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) +// WatchOperatorSetCreated is a free log subscription operation binding the contract event 0x31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c. +// +// Solidity: event OperatorSetCreated((address,uint32) operatorSet) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchOperatorSetCreated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageOperatorSetCreated) (event.Subscription, error) { + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "OperatorSetCreated") if err != nil { return nil, err } - return &AVSDirectoryStorageOperatorAVSRegistrationStatusUpdatedIterator{contract: _AVSDirectoryStorage.contract, event: "OperatorAVSRegistrationStatusUpdated", logs: logs, sub: sub}, nil + 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(AVSDirectoryStorageOperatorSetCreated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorSetCreated", 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 } -// WatchOperatorAVSRegistrationStatusUpdated is a free log subscription operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// ParseOperatorSetCreated is a log parse operation binding the contract event 0x31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c. // -// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) -func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchOperatorAVSRegistrationStatusUpdated(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated, operator []common.Address, avs []common.Address) (event.Subscription, error) { +// Solidity: event OperatorSetCreated((address,uint32) operatorSet) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseOperatorSetCreated(log types.Log) (*AVSDirectoryStorageOperatorSetCreated, error) { + event := new(AVSDirectoryStorageOperatorSetCreated) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorSetCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) +// AVSDirectoryStorageOperatorSlashedIterator is returned from FilterOperatorSlashed and is used to iterate over the raw logs and unpacked data for OperatorSlashed events raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorSlashedIterator struct { + Event *AVSDirectoryStorageOperatorSlashed // 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 *AVSDirectoryStorageOperatorSlashedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false } - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(AVSDirectoryStorageOperatorSlashed) + 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(AVSDirectoryStorageOperatorSlashed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true - logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + 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 *AVSDirectoryStorageOperatorSlashedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *AVSDirectoryStorageOperatorSlashedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// AVSDirectoryStorageOperatorSlashed represents a OperatorSlashed event raised by the AVSDirectoryStorage contract. +type AVSDirectoryStorageOperatorSlashed struct { + Operator common.Address + OperatorSetId uint32 + Strategy common.Address + BipsToSlash uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorSlashed is a free log retrieval operation binding the contract event 0xe672839d3c371691acdb52de9fefc94b3dbf407dc0920ef566c7c059ad575b1c. +// +// Solidity: event OperatorSlashed(address operator, uint32 operatorSetId, address strategy, uint16 bipsToSlash) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) FilterOperatorSlashed(opts *bind.FilterOpts) (*AVSDirectoryStorageOperatorSlashedIterator, error) { + + logs, sub, err := _AVSDirectoryStorage.contract.FilterLogs(opts, "OperatorSlashed") + if err != nil { + return nil, err + } + return &AVSDirectoryStorageOperatorSlashedIterator{contract: _AVSDirectoryStorage.contract, event: "OperatorSlashed", logs: logs, sub: sub}, nil +} + +// WatchOperatorSlashed is a free log subscription operation binding the contract event 0xe672839d3c371691acdb52de9fefc94b3dbf407dc0920ef566c7c059ad575b1c. +// +// Solidity: event OperatorSlashed(address operator, uint32 operatorSetId, address strategy, uint16 bipsToSlash) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchOperatorSlashed(opts *bind.WatchOpts, sink chan<- *AVSDirectoryStorageOperatorSlashed) (event.Subscription, error) { + + logs, sub, err := _AVSDirectoryStorage.contract.WatchLogs(opts, "OperatorSlashed") if err != nil { return nil, err } @@ -701,8 +3064,8 @@ func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchOperatorAVSRegistr select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated) - if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", log); err != nil { + event := new(AVSDirectoryStorageOperatorSlashed) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorSlashed", log); err != nil { return err } event.Raw = log @@ -723,12 +3086,12 @@ func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) WatchOperatorAVSRegistr }), nil } -// ParseOperatorAVSRegistrationStatusUpdated is a log parse operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// ParseOperatorSlashed is a log parse operation binding the contract event 0xe672839d3c371691acdb52de9fefc94b3dbf407dc0920ef566c7c059ad575b1c. // -// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) -func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseOperatorAVSRegistrationStatusUpdated(log types.Log) (*AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated, error) { - event := new(AVSDirectoryStorageOperatorAVSRegistrationStatusUpdated) - if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", log); err != nil { +// Solidity: event OperatorSlashed(address operator, uint32 operatorSetId, address strategy, uint16 bipsToSlash) +func (_AVSDirectoryStorage *AVSDirectoryStorageFilterer) ParseOperatorSlashed(log types.Log) (*AVSDirectoryStorageOperatorSlashed, error) { + event := new(AVSDirectoryStorageOperatorSlashed) + if err := _AVSDirectoryStorage.contract.UnpackLog(event, "OperatorSlashed", log); err != nil { return nil, err } event.Raw = log 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/DelegationManager/binding.go b/pkg/bindings/DelegationManager/binding.go index cf241371c..5740ffc70 100644 --- a/pkg/bindings/DelegationManager/binding.go +++ b/pkg/bindings/DelegationManager/binding.go @@ -29,6 +29,12 @@ var ( _ = abi.ConvertType ) +// IDelegationManagerAllocationDelayDetails is an auto generated low-level Go binding around an user-defined struct. +type IDelegationManagerAllocationDelayDetails struct { + IsSet bool + AllocationDelay uint32 +} + // IDelegationManagerOperatorDetails is an auto generated low-level Go binding around an user-defined struct. type IDelegationManagerOperatorDetails struct { DeprecatedEarningsReceiver common.Address @@ -45,13 +51,13 @@ type IDelegationManagerQueuedWithdrawalParams struct { // IDelegationManagerWithdrawal is an auto generated low-level Go binding around an user-defined struct. type IDelegationManagerWithdrawal struct { - Staker common.Address - DelegatedTo common.Address - Withdrawer common.Address - Nonce *big.Int - StartBlock uint32 - Strategies []common.Address - Shares []*big.Int + Staker common.Address + DelegatedTo common.Address + Withdrawer common.Address + Nonce *big.Int + StartTimestamp uint32 + Strategies []common.Address + ScaledShares []*big.Int } // ISignatureUtilsSignatureWithExpiry is an auto generated low-level Go binding around an user-defined struct. @@ -62,8 +68,8 @@ type ISignatureUtilsSignatureWithExpiry struct { // DelegationManagerMetaData contains all meta data concerning the DelegationManager contract. var DelegationManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"},{\"name\":\"_slasher\",\"type\":\"address\",\"internalType\":\"contractISlasher\"},{\"name\":\"_eigenPodManager\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"DELEGATION_APPROVAL_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\":\"MAX_STAKER_OPT_OUT_WINDOW_BLOCKS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_WITHDRAWAL_DELAY_BLOCKS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"STAKER_DELEGATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateCurrentStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateDelegationApprovalDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_stakerNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateWithdrawalRoot\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"middlewareTimesIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawals\",\"inputs\":[{\"name\":\"withdrawals\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.Withdrawal[]\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[][]\",\"internalType\":\"contractIERC20[][]\"},{\"name\":\"middlewareTimesIndexes\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool[]\",\"internalType\":\"bool[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeWithdrawalsQueued\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseDelegatedShares\",\"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\":\"delegateTo\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateToBySignature\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegatedTo\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApprover\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApproverSaltIsSpent\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDelegatableShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorShares\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWithdrawalDelay\",\"inputs\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseDelegatedShares\",\"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\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"initialPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minWithdrawalDelayBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"_withdrawalDelayBlocks\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minWithdrawalDelayBlocks\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"modifyOperatorDetails\",\"inputs\":[{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorDetails\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"pendingWithdrawals\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"queueWithdrawals\",\"inputs\":[{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerAsOperator\",\"inputs\":[{\"name\":\"registeringOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMinWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"newMinWithdrawalDelayBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setStrategyWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"withdrawalDelayBlocks\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerNonce\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerOptOutWindowBlocks\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"undelegate\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"withdrawalRoots\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOperatorMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MinWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorDetailsModified\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorMetadataURIUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRegistered\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesDecreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesIncreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\":\"StakerDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerForceUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\":\"WithdrawalCompleted\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalQueued\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"withdrawal\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false}]", - Bin: "0x6101006040523480156200001257600080fd5b5060405162005c4638038062005c46833981016040819052620000359162000140565b6001600160a01b0380841660805280821660c052821660a0526200005862000065565b50504660e0525062000194565b600054610100900460ff1615620000d25760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000125576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200013d57600080fd5b50565b6000806000606084860312156200015657600080fd5b8351620001638162000127565b6020850151909350620001768162000127565b6040850151909250620001898162000127565b809150509250925092565b60805160a05160c05160e051615a1d6200022960003960006126a00152600081816105b10152818161102e015281816113aa01528181611c23015281816129f901528181613eac0152614398015260006107620152600081816104f901528181610ffc0152818161137801528181611cb701528181612ac601528181612c4901528181613fd2015261443e0152615a1d6000f3fe608060405234801561001057600080fd5b50600436106103425760003560e01c8063635bbd10116101b8578063b7f06ebe11610104578063cf80873e116100a2578063f16172b01161007c578063f16172b014610908578063f2fde38b1461091b578063f698da251461092e578063fabc1cbc1461093657600080fd5b8063cf80873e146108c1578063da8be864146108e2578063eea9064b146108f557600080fd5b8063c488375a116100de578063c488375a146107de578063c5e480db146107fe578063c94b5111146108a4578063ca661c04146108b757600080fd5b8063b7f06ebe14610784578063bb45fef2146107a7578063c448feb8146107d557600080fd5b8063886f1195116101715780639104c3191161014b5780639104c3191461070f57806399be81c81461072a578063a17884841461073d578063b13442711461075d57600080fd5b8063886f1195146106cb5780638da5cb5b146106de57806390041347146106ef57600080fd5b8063635bbd101461063657806365da1264146106495780636d70f7ae14610672578063715018a614610685578063778e55f31461068d5780637f548071146106b857600080fd5b806328a573ae116102925780634665bcda11610230578063597b36da1161020a578063597b36da146105e55780635ac86ab7146105f85780635c975abb1461061b57806360d7faed1461062357600080fd5b80634665bcda146105ac5780634fc40b61146105d3578063595c6a67146105dd57600080fd5b806339b70e381161026c57806339b70e38146104f45780633cdeb5e0146105335780633e28391d14610562578063433773821461058557600080fd5b806328a573ae146104ae57806329c77d4f146104c157806333404396146104e157600080fd5b8063132d4967116102ff57806316928365116102d957806316928365146104285780631bbce0911461046157806320606b701461047457806322bf40e41461049b57600080fd5b8063132d4967146103ef578063136439dd146104025780631522bf021461041557600080fd5b80630449ca391461034757806304a4f9791461036d5780630b9f487a146103945780630dd8dd02146103a75780630f589e59146103c757806310d67a2f146103dc575b600080fd5b61035a61035536600461484e565b610949565b6040519081526020015b60405180910390f35b61035a7f14bde674c9f64b2ad00eaaee4a8bed1fabef35c7507e3c5b9cfc9436909a2dad81565b61035a6103a23660046148b4565b6109ce565b6103ba6103b536600461484e565b610a90565b604051610364919061490f565b6103da6103d53660046149ac565b610df9565b005b6103da6103ea3660046149ff565b610f3e565b6103da6103fd366004614a23565b610ff1565b6103da610410366004614a64565b6110a8565b6103da610423366004614a7d565b6111e7565b61035a6104363660046149ff565b6001600160a01b0316600090815260996020526040902060010154600160a01b900463ffffffff1690565b61035a61046f366004614a23565b6111fb565b61035a7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6103da6104a9366004614ae8565b611229565b6103da6104bc366004614a23565b61136d565b61035a6104cf3660046149ff565b609b6020526000908152604090205481565b6103da6104ef366004614b8f565b61141d565b61051b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610364565b61051b6105413660046149ff565b6001600160a01b039081166000908152609960205260409020600101541690565b6105756105703660046149ff565b61155a565b6040519015158152602001610364565b61035a7f39111bc4a4d688e1f685123d7497d4615370152a8ee4a0593e647bd06ad8bb0b81565b61051b7f000000000000000000000000000000000000000000000000000000000000000081565b61035a6213c68081565b6103da61157a565b61035a6105f3366004614e8c565b611641565b610575610606366004614ec8565b606654600160ff9092169190911b9081161490565b60665461035a565b6103da610631366004614ef9565b611671565b6103da610644366004614a64565b61170c565b61051b6106573660046149ff565b609a602052600090815260409020546001600160a01b031681565b6105756106803660046149ff565b61171d565b6103da611757565b61035a61069b366004614f88565b609860209081526000928352604080842090915290825290205481565b6103da6106c6366004615069565b61176b565b60655461051b906001600160a01b031681565b6033546001600160a01b031661051b565b6107026106fd3660046150f9565b611997565b6040516103649190615183565b61051b73beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac081565b6103da610738366004615196565b611a71565b61035a61074b3660046149ff565b609f6020526000908152604090205481565b61051b7f000000000000000000000000000000000000000000000000000000000000000081565b610575610792366004614a64565b609e6020526000908152604090205460ff1681565b6105756107b53660046151cb565b609c60209081526000928352604080842090915290825290205460ff1681565b61035a609d5481565b61035a6107ec3660046149ff565b60a16020526000908152604090205481565b61086e61080c3660046149ff565b6040805160608082018352600080835260208084018290529284018190526001600160a01b03948516815260998352839020835191820184528054851682526001015493841691810191909152600160a01b90920463ffffffff169082015290565b6040805182516001600160a01b039081168252602080850151909116908201529181015163ffffffff1690820152606001610364565b61035a6108b23660046151f7565b611b43565b61035a62034bc081565b6108d46108cf3660046149ff565b611bfc565b604051610364929190615278565b6103ba6108f03660046149ff565b611fb4565b6103da61090336600461529d565b612478565b6103da6109163660046152f5565b612595565b6103da6109293660046149ff565b612626565b61035a61269c565b6103da610944366004614a64565b6126da565b609d54600090815b838110156109c657600060a1600087878581811061097157610971615311565b905060200201602081019061098691906149ff565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050828111156109b5578092505b506109bf8161533d565b9050610951565b509392505050565b604080517f14bde674c9f64b2ad00eaaee4a8bed1fabef35c7507e3c5b9cfc9436909a2dad6020808301919091526001600160a01b038681168385015288811660608401528716608083015260a0820185905260c08083018590528351808403909101815260e0909201909252805191012060009081610a4c61269c565b60405161190160f01b602082015260228101919091526042810183905260620160408051808303601f19018152919052805160209091012098975050505050505050565b60665460609060019060029081161415610ac55760405162461bcd60e51b8152600401610abc90615358565b60405180910390fd5b6000836001600160401b03811115610adf57610adf614c31565b604051908082528060200260200182016040528015610b08578160200160208202803683370190505b50336000908152609a60205260408120549192506001600160a01b03909116905b85811015610dee57868682818110610b4357610b43615311565b9050602002810190610b55919061538f565b610b639060208101906153af565b9050878783818110610b7757610b77615311565b9050602002810190610b89919061538f565b610b9390806153af565b905014610c085760405162461bcd60e51b815260206004820152603860248201527f44656c65676174696f6e4d616e616765722e717565756557697468647261776160448201527f6c3a20696e707574206c656e677468206d69736d6174636800000000000000006064820152608401610abc565b33878783818110610c1b57610c1b615311565b9050602002810190610c2d919061538f565b610c3e9060608101906040016149ff565b6001600160a01b031614610cba5760405162461bcd60e51b815260206004820152603c60248201527f44656c65676174696f6e4d616e616765722e717565756557697468647261776160448201527f6c3a2077697468647261776572206d757374206265207374616b6572000000006064820152608401610abc565b610dbf3383898985818110610cd157610cd1615311565b9050602002810190610ce3919061538f565b610cf49060608101906040016149ff565b8a8a86818110610d0657610d06615311565b9050602002810190610d18919061538f565b610d2290806153af565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508e92508d9150889050818110610d6857610d68615311565b9050602002810190610d7a919061538f565b610d889060208101906153af565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061283692505050565b838281518110610dd157610dd1615311565b602090810291909101015280610de68161533d565b915050610b29565b509095945050505050565b610e023361155a565b15610e885760405162461bcd60e51b815260206004820152604a60248201527f44656c65676174696f6e4d616e616765722e726567697374657241734f70657260448201527f61746f723a2063616c6c657220697320616c7265616479206163746976656c796064820152690819195b1959d85d195960b21b608482015260a401610abc565b610e923384612df6565b604080518082019091526060815260006020820152610eb43380836000612fe9565b336001600160a01b03167f8e8485583a2310d41f7c82b9427d0bd49bad74bb9cff9d3402a29d8f9b28a0e285604051610eed91906153f8565b60405180910390a2336001600160a01b03167f02a919ed0e2acad1dd90f17ef2fa4ae5462ee1339170034a8531cca4b67080908484604051610f3092919061544a565b60405180910390a250505050565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb59190615479565b6001600160a01b0316336001600160a01b031614610fe55760405162461bcd60e51b8152600401610abc90615496565b610fee8161327f565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806110505750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b61106c5760405162461bcd60e51b8152600401610abc906154e0565b6110758361155a565b156110a3576001600160a01b038084166000908152609a6020526040902054166110a181858585613376565b505b505050565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156110f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611114919061553d565b6111305760405162461bcd60e51b8152600401610abc9061555a565b606654818116146111a95760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610abc565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b6111ef6133f1565b6110a18484848461344b565b6001600160a01b0383166000908152609b602052604081205461122085828686611b43565b95945050505050565b600054610100900460ff16158080156112495750600054600160ff909116105b806112635750303b158015611263575060005460ff166001145b6112c65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610abc565b6000805460ff1916600117905580156112e9576000805461ff0019166101001790555b6112f38888613671565b6112fb61375b565b609755611307896137f2565b61131086613844565b61131c8585858561344b565b8015611362576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806113cc5750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b6113e85760405162461bcd60e51b8152600401610abc906154e0565b6113f18361155a565b156110a3576001600160a01b038084166000908152609a6020526040902054166110a18185858561393e565b606654600290600490811614156114465760405162461bcd60e51b8152600401610abc90615358565b600260c95414156114995760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610abc565b600260c95560005b88811015611549576115398a8a838181106114be576114be615311565b90506020028101906114d091906155a2565b8989848181106114e2576114e2615311565b90506020028101906114f491906153af565b89898681811061150657611506615311565b9050602002013588888781811061151f5761151f615311565b905060200201602081019061153491906155b8565b6139b9565b6115428161533d565b90506114a1565b5050600160c9555050505050505050565b6001600160a01b039081166000908152609a602052604090205416151590565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156115c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115e6919061553d565b6116025760405162461bcd60e51b8152600401610abc9061555a565b600019606681905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b6000816040516020016116549190615649565b604051602081830303815290604052805190602001209050919050565b6066546002906004908116141561169a5760405162461bcd60e51b8152600401610abc90615358565b600260c95414156116ed5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610abc565b600260c9556116ff86868686866139b9565b5050600160c95550505050565b6117146133f1565b610fee81613844565b60006001600160a01b0382161580159061175157506001600160a01b038083166000818152609a6020526040902054909116145b92915050565b61175f6133f1565b61176960006137f2565b565b42836020015110156117ef5760405162461bcd60e51b815260206004820152604160248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f4279536960448201527f676e61747572653a207374616b6572207369676e6174757265206578706972656064820152601960fa1b608482015260a401610abc565b6117f88561155a565b156118815760405162461bcd60e51b815260206004820152604d60248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f4279536960448201527f676e61747572653a207374616b657220697320616c726561647920616374697660648201526c195b1e4819195b1959d85d1959609a1b608482015260a401610abc565b61188a8461171d565b6119165760405162461bcd60e51b815260206004820152605160248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f4279536960448201527f676e61747572653a206f70657261746f72206973206e6f7420726567697374656064820152703932b21034b71022b4b3b2b72630bcb2b960791b608482015260a401610abc565b6000609b6000876001600160a01b03166001600160a01b0316815260200190815260200160002054905060006119528783888860200151611b43565b6001600160a01b0388166000908152609b60205260409020600184019055855190915061198290889083906141a3565b61198e87878686612fe9565b50505050505050565b6060600082516001600160401b038111156119b4576119b4614c31565b6040519080825280602002602001820160405280156119dd578160200160208202803683370190505b50905060005b83518110156109c6576001600160a01b03851660009081526098602052604081208551909190869084908110611a1b57611a1b615311565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054828281518110611a5657611a56615311565b6020908102919091010152611a6a8161533d565b90506119e3565b611a7a3361171d565b611afc5760405162461bcd60e51b815260206004820152604760248201527f44656c65676174696f6e4d616e616765722e7570646174654f70657261746f7260448201527f4d657461646174615552493a2063616c6c6572206d75737420626520616e206f6064820152663832b930ba37b960c91b608482015260a401610abc565b336001600160a01b03167f02a919ed0e2acad1dd90f17ef2fa4ae5462ee1339170034a8531cca4b67080908383604051611b3792919061544a565b60405180910390a25050565b604080517f39111bc4a4d688e1f685123d7497d4615370152a8ee4a0593e647bd06ad8bb0b6020808301919091526001600160a01b0387811683850152851660608301526080820186905260a08083018590528351808403909101815260c0909201909252805191012060009081611bb961269c565b60405161190160f01b602082015260228101919091526042810183905260620160408051808303601f190181529190528051602090910120979650505050505050565b6040516360f4062b60e01b81526001600160a01b03828116600483015260609182916000917f0000000000000000000000000000000000000000000000000000000000000000909116906360f4062b90602401602060405180830381865afa158015611c6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c90919061565c565b6040516394f649dd60e01b81526001600160a01b03868116600483015291925060009182917f0000000000000000000000000000000000000000000000000000000000000000909116906394f649dd90602401600060405180830381865afa158015611d00573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611d2891908101906156d0565b9150915060008313611d3f57909590945092505050565b606080835160001415611df9576040805160018082528183019092529060208083019080368337505060408051600180825281830190925292945090506020808301908036833701905050905073beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac082600081518110611db457611db4615311565b60200260200101906001600160a01b031690816001600160a01b0316815250508481600081518110611de857611de8615311565b602002602001018181525050611fa7565b8351611e0690600161578a565b6001600160401b03811115611e1d57611e1d614c31565b604051908082528060200260200182016040528015611e46578160200160208202803683370190505b50915081516001600160401b03811115611e6257611e62614c31565b604051908082528060200260200182016040528015611e8b578160200160208202803683370190505b50905060005b8451811015611f2557848181518110611eac57611eac615311565b6020026020010151838281518110611ec657611ec6615311565b60200260200101906001600160a01b031690816001600160a01b031681525050838181518110611ef857611ef8615311565b6020026020010151828281518110611f1257611f12615311565b6020908102919091010152600101611e91565b5073beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac08260018451611f4a91906157a2565b81518110611f5a57611f5a615311565b60200260200101906001600160a01b031690816001600160a01b031681525050848160018451611f8a91906157a2565b81518110611f9a57611f9a615311565b6020026020010181815250505b9097909650945050505050565b60665460609060019060029081161415611fe05760405162461bcd60e51b8152600401610abc90615358565b611fe98361155a565b6120695760405162461bcd60e51b8152602060048201526044602482018190527f44656c65676174696f6e4d616e616765722e756e64656c65676174653a207374908201527f616b6572206d7573742062652064656c65676174656420746f20756e64656c656064820152636761746560e01b608482015260a401610abc565b6120728361171d565b156120e55760405162461bcd60e51b815260206004820152603d60248201527f44656c65676174696f6e4d616e616765722e756e64656c65676174653a206f7060448201527f657261746f72732063616e6e6f7420626520756e64656c6567617465640000006064820152608401610abc565b6001600160a01b0383166121615760405162461bcd60e51b815260206004820152603c60248201527f44656c65676174696f6e4d616e616765722e756e64656c65676174653a20636160448201527f6e6e6f7420756e64656c6567617465207a65726f2061646472657373000000006064820152608401610abc565b6001600160a01b038084166000818152609a6020526040902054909116903314806121945750336001600160a01b038216145b806121bb57506001600160a01b038181166000908152609960205260409020600101541633145b61222d5760405162461bcd60e51b815260206004820152603d60248201527f44656c65676174696f6e4d616e616765722e756e64656c65676174653a20636160448201527f6c6c65722063616e6e6f7420756e64656c6567617465207374616b65720000006064820152608401610abc565b60008061223986611bfc565b9092509050336001600160a01b0387161461228f57826001600160a01b0316866001600160a01b03167ff0eddf07e6ea14f388b47e1e94a0f464ecbd9eed4171130e0fc0e99fb4030a8a60405160405180910390a35b826001600160a01b0316866001600160a01b03167ffee30966a256b71e14bc0ebfc94315e28ef4a97a7131a9e2b7a310a73af4467660405160405180910390a36001600160a01b0386166000908152609a6020526040902080546001600160a01b0319169055815161231157604080516000815260208101909152945061246f565b81516001600160401b0381111561232a5761232a614c31565b604051908082528060200260200182016040528015612353578160200160208202803683370190505b50945060005b825181101561246d576040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602080830190803683370190505090508483815181106123b9576123b9615311565b6020026020010151826000815181106123d4576123d4615311565b60200260200101906001600160a01b031690816001600160a01b03168152505083838151811061240657612406615311565b60200260200101518160008151811061242157612421615311565b60200260200101818152505061243a89878b8585612836565b88848151811061244c5761244c615311565b602002602001018181525050505080806124659061533d565b915050612359565b505b50505050919050565b6124813361155a565b156124ff5760405162461bcd60e51b815260206004820152604260248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f3a20737460448201527f616b657220697320616c7265616479206163746976656c792064656c65676174606482015261195960f21b608482015260a401610abc565b6125088361171d565b6125895760405162461bcd60e51b815260206004820152604660248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f3a206f7060448201527f657261746f72206973206e6f74207265676973746572656420696e2045696765606482015265372630bcb2b960d11b608482015260a401610abc565b6110a333848484612fe9565b61259e3361171d565b61261c5760405162461bcd60e51b815260206004820152604360248201527f44656c65676174696f6e4d616e616765722e6d6f646966794f70657261746f7260448201527f44657461696c733a2063616c6c6572206d75737420626520616e206f706572616064820152623a37b960e91b608482015260a401610abc565b610fee3382612df6565b61262e6133f1565b6001600160a01b0381166126935760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610abc565b610fee816137f2565b60007f00000000000000000000000000000000000000000000000000000000000000004614156126cd575060975490565b6126d561375b565b905090565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561272d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127519190615479565b6001600160a01b0316336001600160a01b0316146127815760405162461bcd60e51b8152600401610abc90615496565b6066541981196066541916146127ff5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610abc565b606681905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c906020016111dc565b60006001600160a01b0386166128cd5760405162461bcd60e51b815260206004820152605060248201527f44656c65676174696f6e4d616e616765722e5f72656d6f76655368617265734160448201527f6e6451756575655769746864726177616c3a207374616b65722063616e6e6f7460648201526f206265207a65726f206164647265737360801b608482015260a401610abc565b82516129575760405162461bcd60e51b815260206004820152604d60248201527f44656c65676174696f6e4d616e616765722e5f72656d6f76655368617265734160448201527f6e6451756575655769746864726177616c3a207374726174656769657320636160648201526c6e6e6f7420626520656d70747960981b608482015260a401610abc565b60005b8351811015612d04576001600160a01b038616156129b0576129b0868886848151811061298957612989615311565b60200260200101518685815181106129a3576129a3615311565b6020026020010151613376565b73beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac06001600160a01b03168482815181106129e0576129e0615311565b60200260200101516001600160a01b03161415612aa9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663beffbb8988858481518110612a3957612a39615311565b60200260200101516040518363ffffffff1660e01b8152600401612a729291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b158015612a8c57600080fd5b505af1158015612aa0573d6000803e3d6000fd5b50505050612cfc565b846001600160a01b0316876001600160a01b03161480612b7b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639b4da03d858381518110612b0557612b05615311565b60200260200101516040518263ffffffff1660e01b8152600401612b3891906001600160a01b0391909116815260200190565b602060405180830381865afa158015612b55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b79919061553d565b155b612c475760405162461bcd60e51b8152602060048201526084602482018190527f44656c65676174696f6e4d616e616765722e5f72656d6f76655368617265734160448301527f6e6451756575655769746864726177616c3a2077697468647261776572206d7560648301527f73742062652073616d652061646472657373206173207374616b657220696620908201527f746869726450617274795472616e7366657273466f7262696464656e2061726560a482015263081cd95d60e21b60c482015260e401610abc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638c80d4e588868481518110612c8957612c89615311565b6020026020010151868581518110612ca357612ca3615311565b60200260200101516040518463ffffffff1660e01b8152600401612cc9939291906157b9565b600060405180830381600087803b158015612ce357600080fd5b505af1158015612cf7573d6000803e3d6000fd5b505050505b60010161295a565b506001600160a01b0386166000908152609f60205260408120805491829190612d2c8361533d565b919050555060006040518060e00160405280896001600160a01b03168152602001886001600160a01b03168152602001876001600160a01b031681526020018381526020014363ffffffff1681526020018681526020018581525090506000612d9482611641565b6000818152609e602052604090819020805460ff19166001179055519091507f9009ab153e8014fbfb02f2217f5cde7aa7f9ad734ae85ca3ee3f4ca2fdd499f990612de290839085906157dd565b60405180910390a198975050505050505050565b6213c680612e0a60608301604084016157f6565b63ffffffff161115612ebf5760405162461bcd60e51b815260206004820152606c60248201527f44656c65676174696f6e4d616e616765722e5f7365744f70657261746f72446560448201527f7461696c733a207374616b65724f70744f757457696e646f77426c6f636b732060648201527f63616e6e6f74206265203e204d41585f5354414b45525f4f50545f4f55545f5760848201526b494e444f575f424c4f434b5360a01b60a482015260c401610abc565b6001600160a01b0382166000908152609960205260409081902060010154600160a01b900463ffffffff1690612efb90606084019084016157f6565b63ffffffff161015612f915760405162461bcd60e51b815260206004820152605360248201527f44656c65676174696f6e4d616e616765722e5f7365744f70657261746f72446560448201527f7461696c733a207374616b65724f70744f757457696e646f77426c6f636b732060648201527218d85b9b9bdd08189948191958dc99585cd959606a1b608482015260a401610abc565b6001600160a01b03821660009081526099602052604090208190612fb58282615833565b505060405133907ffebe5cd24b2cbc7b065b9d0fdeb904461e4afcff57dd57acda1e7832031ba7ac90611b379084906153f8565b606654600090600190811614156130125760405162461bcd60e51b8152600401610abc90615358565b6001600160a01b038085166000908152609960205260409020600101541680158015906130485750336001600160a01b03821614155b801561305d5750336001600160a01b03861614155b156131ca5742846020015110156130dc5760405162461bcd60e51b815260206004820152603760248201527f44656c65676174696f6e4d616e616765722e5f64656c65676174653a2061707060448201527f726f766572207369676e617475726520657870697265640000000000000000006064820152608401610abc565b6001600160a01b0381166000908152609c6020908152604080832086845290915290205460ff16156131765760405162461bcd60e51b815260206004820152603760248201527f44656c65676174696f6e4d616e616765722e5f64656c65676174653a2061707060448201527f726f76657253616c7420616c7265616479207370656e740000000000000000006064820152608401610abc565b6001600160a01b0381166000908152609c6020908152604080832086845282528220805460ff191660011790558501516131b79088908890859088906109ce565b90506131c8828287600001516141a3565b505b6001600160a01b038681166000818152609a602052604080822080546001600160a01b031916948a169485179055517fc3ee9f2e5fda98e8066a1f745b2df9285f416fe98cf2559cd21484b3d87433049190a360008061322988611bfc565b9150915060005b825181101561136257613277888a85848151811061325057613250615311565b602002602001015185858151811061326a5761326a615311565b602002602001015161393e565b600101613230565b6001600160a01b03811661330d5760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610abc565b606554604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038085166000908152609860209081526040808320938616835292905290812080548392906133ad9084906157a2565b92505081905550836001600160a01b03167f6909600037b75d7b4733aedd815442b5ec018a827751c832aaff64eba5d6d2dd848484604051610f30939291906157b9565b6033546001600160a01b031633146117695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610abc565b8281146134d35760405162461bcd60e51b815260206004820152604a60248201527f44656c65676174696f6e4d616e616765722e5f7365745374726174656779576960448201527f746864726177616c44656c6179426c6f636b733a20696e707574206c656e67746064820152690d040dad2e6dac2e8c6d60b31b608482015260a401610abc565b8260005b818110156136695760008686838181106134f3576134f3615311565b905060200201602081019061350891906149ff565b6001600160a01b038116600090815260a1602052604081205491925086868581811061353657613536615311565b90506020020135905062034bc08111156135fa5760405162461bcd60e51b815260206004820152607360248201527f44656c65676174696f6e4d616e616765722e5f7365745374726174656779576960448201527f746864726177616c44656c6179426c6f636b733a205f7769746864726177616c60648201527f44656c6179426c6f636b732063616e6e6f74206265203e204d41585f5749544860848201527244524157414c5f44454c41595f424c4f434b5360681b60a482015260c401610abc565b6001600160a01b038316600081815260a160209081526040918290208490558151928352820184905281018290527f0e7efa738e8b0ce6376a0c1af471655540d2e9a81647d7b09ed823018426576d9060600160405180910390a1505050806136629061533d565b90506134d7565b505050505050565b6065546001600160a01b031615801561369257506001600160a01b03821615155b6137145760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610abc565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a26137578261327f565b5050565b604080518082018252600a81526922b4b3b2b72630bcb2b960b11b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea81840152466060820152306080808301919091528351808303909101815260a0909101909252815191012090565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62034bc08111156138fd5760405162461bcd60e51b815260206004820152607160248201527f44656c65676174696f6e4d616e616765722e5f7365744d696e5769746864726160448201527f77616c44656c6179426c6f636b733a205f6d696e5769746864726177616c446560648201527f6c6179426c6f636b732063616e6e6f74206265203e204d41585f5749544844526084820152704157414c5f44454c41595f424c4f434b5360781b60a482015260c401610abc565b609d5460408051918252602082018390527fafa003cd76f87ff9d62b35beea889920f33c0c42b8d45b74954d61d50f4b6b69910160405180910390a1609d55565b6001600160a01b0380851660009081526098602090815260408083209386168352929052908120805483929061397590849061578a565b92505081905550836001600160a01b03167f1ec042c965e2edd7107b51188ee0f383e22e76179041ab3a9d18ff151405166c848484604051610f30939291906157b9565b60006139c76105f387615896565b6000818152609e602052604090205490915060ff16613a485760405162461bcd60e51b815260206004820152604360248201526000805160206159c883398151915260448201527f645769746864726177616c3a20616374696f6e206973206e6f7420696e20717560648201526265756560e81b608482015260a401610abc565b609d544390613a5d60a0890160808a016157f6565b63ffffffff16613a6d919061578a565b1115613af55760405162461bcd60e51b815260206004820152605f60248201526000805160206159c883398151915260448201527f645769746864726177616c3a206d696e5769746864726177616c44656c61794260648201527f6c6f636b7320706572696f6420686173206e6f74207965742070617373656400608482015260a401610abc565b613b0560608701604088016149ff565b6001600160a01b0316336001600160a01b031614613b925760405162461bcd60e51b815260206004820152605060248201526000805160206159c883398151915260448201527f645769746864726177616c3a206f6e6c7920776974686472617765722063616e60648201526f1031b7b6b83632ba329030b1ba34b7b760811b608482015260a401610abc565b8115613c1457613ba560a08701876153af565b85149050613c145760405162461bcd60e51b815260206004820152604260248201526000805160206159c883398151915260448201527f645769746864726177616c3a20696e707574206c656e677468206d69736d61746064820152610c6d60f31b608482015260a401610abc565b6000818152609e60205260409020805460ff191690558115613d795760005b613c4060a08801886153af565b9050811015613d73574360a16000613c5b60a08b018b6153af565b85818110613c6b57613c6b615311565b9050602002016020810190613c8091906149ff565b6001600160a01b03168152602081019190915260400160002054613caa60a08a0160808b016157f6565b63ffffffff16613cba919061578a565b1115613cd85760405162461bcd60e51b8152600401610abc906158a2565b613d6b613ce860208901896149ff565b33613cf660a08b018b6153af565b85818110613d0657613d06615311565b9050602002016020810190613d1b91906149ff565b613d2860c08c018c6153af565b86818110613d3857613d38615311565b905060200201358a8a87818110613d5157613d51615311565b9050602002016020810190613d6691906149ff565b61435d565b600101613c33565b50614168565b336000908152609a60205260408120546001600160a01b0316905b613da160a08901896153af565b9050811015614165574360a16000613dbc60a08c018c6153af565b85818110613dcc57613dcc615311565b9050602002016020810190613de191906149ff565b6001600160a01b03168152602081019190915260400160002054613e0b60a08b0160808c016157f6565b63ffffffff16613e1b919061578a565b1115613e395760405162461bcd60e51b8152600401610abc906158a2565b73beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0613e5b60a08a018a6153af565b83818110613e6b57613e6b615311565b9050602002016020810190613e8091906149ff565b6001600160a01b03161415613fd0576000613e9e60208a018a6149ff565b905060006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016630e81073c83613edf60c08e018e6153af565b87818110613eef57613eef615311565b6040516001600160e01b031960e087901b1681526001600160a01b03909416600485015260200291909101356024830152506044016020604051808303816000875af1158015613f43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f67919061565c565b6001600160a01b038084166000908152609a6020526040902054919250168015613fc857613fc88184613f9d60a08f018f6153af565b88818110613fad57613fad615311565b9050602002016020810190613fc291906149ff565b8561393e565b50505061415d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c4623ea13389898581811061401257614012615311565b905060200201602081019061402791906149ff565b61403460a08d018d6153af565b8681811061404457614044615311565b905060200201602081019061405991906149ff565b61406660c08e018e6153af565b8781811061407657614076615311565b60405160e088901b6001600160e01b03191681526001600160a01b03968716600482015294861660248601529290941660448401526020909102013560648201526084019050600060405180830381600087803b1580156140d657600080fd5b505af11580156140ea573d6000803e3d6000fd5b505050506001600160a01b0382161561415d5761415d823361410f60a08c018c6153af565b8581811061411f5761411f615311565b905060200201602081019061413491906149ff565b61414160c08d018d6153af565b8681811061415157614151615311565b9050602002013561393e565b600101613d94565b50505b6040518181527fc97098c2f658800b4df29001527f7324bcdffcf6e8751a699ab920a1eced5b1d9060200160405180910390a1505050505050565b6001600160a01b0383163b156142bd57604051630b135d3f60e11b808252906001600160a01b03851690631626ba7e906141e3908690869060040161592a565b602060405180830381865afa158015614200573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142249190615987565b6001600160e01b031916146110a35760405162461bcd60e51b815260206004820152605360248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a2045524331323731207369676e6174757265206064820152721d995c9a599a58d85d1a5bdb8819985a5b1959606a1b608482015260a401610abc565b826001600160a01b03166142d1838361449d565b6001600160a01b0316146110a35760405162461bcd60e51b815260206004820152604760248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a207369676e6174757265206e6f742066726f6d6064820152661039b4b3b732b960c91b608482015260a401610abc565b6001600160a01b03831673beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac014156144085760405162387b1360e81b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063387b1300906143d1908890889087906004016157b9565b600060405180830381600087803b1580156143eb57600080fd5b505af11580156143ff573d6000803e3d6000fd5b50505050614496565b60405163c608c7f360e01b81526001600160a01b03858116600483015284811660248301526044820184905282811660648301527f0000000000000000000000000000000000000000000000000000000000000000169063c608c7f390608401600060405180830381600087803b15801561448257600080fd5b505af1158015611362573d6000803e3d6000fd5b5050505050565b60008060006144ac85856144b9565b915091506109c681614529565b6000808251604114156144f05760208301516040840151606085015160001a6144e4878285856146e4565b94509450505050614522565b82516040141561451a576020830151604084015161450f8683836147d1565b935093505050614522565b506000905060025b9250929050565b600081600481111561453d5761453d6159b1565b14156145465750565b600181600481111561455a5761455a6159b1565b14156145a85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610abc565b60028160048111156145bc576145bc6159b1565b141561460a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610abc565b600381600481111561461e5761461e6159b1565b14156146775760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610abc565b600481600481111561468b5761468b6159b1565b1415610fee5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610abc565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561471b57506000905060036147c8565b8460ff16601b1415801561473357508460ff16601c14155b1561474457506000905060046147c8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614798573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166147c1576000600192509250506147c8565b9150600090505b94509492505050565b6000806001600160ff1b038316816147ee60ff86901c601b61578a565b90506147fc878288856146e4565b935093505050935093915050565b60008083601f84011261481c57600080fd5b5081356001600160401b0381111561483357600080fd5b6020830191508360208260051b850101111561452257600080fd5b6000806020838503121561486157600080fd5b82356001600160401b0381111561487757600080fd5b6148838582860161480a565b90969095509350505050565b6001600160a01b0381168114610fee57600080fd5b80356148af8161488f565b919050565b600080600080600060a086880312156148cc57600080fd5b85356148d78161488f565b945060208601356148e78161488f565b935060408601356148f78161488f565b94979396509394606081013594506080013592915050565b6020808252825182820181905260009190848201906040850190845b818110156149475783518352928401929184019160010161492b565b50909695505050505050565b60006060828403121561496557600080fd5b50919050565b60008083601f84011261497d57600080fd5b5081356001600160401b0381111561499457600080fd5b60208301915083602082850101111561452257600080fd5b6000806000608084860312156149c157600080fd5b6149cb8585614953565b925060608401356001600160401b038111156149e657600080fd5b6149f28682870161496b565b9497909650939450505050565b600060208284031215614a1157600080fd5b8135614a1c8161488f565b9392505050565b600080600060608486031215614a3857600080fd5b8335614a438161488f565b92506020840135614a538161488f565b929592945050506040919091013590565b600060208284031215614a7657600080fd5b5035919050565b60008060008060408587031215614a9357600080fd5b84356001600160401b0380821115614aaa57600080fd5b614ab68883890161480a565b90965094506020870135915080821115614acf57600080fd5b50614adc8782880161480a565b95989497509550505050565b60008060008060008060008060c0898b031215614b0457600080fd5b8835614b0f8161488f565b97506020890135614b1f8161488f565b9650604089013595506060890135945060808901356001600160401b0380821115614b4957600080fd5b614b558c838d0161480a565b909650945060a08b0135915080821115614b6e57600080fd5b50614b7b8b828c0161480a565b999c989b5096995094979396929594505050565b6000806000806000806000806080898b031215614bab57600080fd5b88356001600160401b0380821115614bc257600080fd5b614bce8c838d0161480a565b909a50985060208b0135915080821115614be757600080fd5b614bf38c838d0161480a565b909850965060408b0135915080821115614c0c57600080fd5b614c188c838d0161480a565b909650945060608b0135915080821115614b6e57600080fd5b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b0381118282101715614c6957614c69614c31565b60405290565b604080519081016001600160401b0381118282101715614c6957614c69614c31565b604051601f8201601f191681016001600160401b0381118282101715614cb957614cb9614c31565b604052919050565b63ffffffff81168114610fee57600080fd5b80356148af81614cc1565b60006001600160401b03821115614cf757614cf7614c31565b5060051b60200190565b600082601f830112614d1257600080fd5b81356020614d27614d2283614cde565b614c91565b82815260059290921b84018101918181019086841115614d4657600080fd5b8286015b84811015614d6a578035614d5d8161488f565b8352918301918301614d4a565b509695505050505050565b600082601f830112614d8657600080fd5b81356020614d96614d2283614cde565b82815260059290921b84018101918181019086841115614db557600080fd5b8286015b84811015614d6a5780358352918301918301614db9565b600060e08284031215614de257600080fd5b614dea614c47565b9050614df5826148a4565b8152614e03602083016148a4565b6020820152614e14604083016148a4565b604082015260608201356060820152614e2f60808301614cd3565b608082015260a08201356001600160401b0380821115614e4e57600080fd5b614e5a85838601614d01565b60a084015260c0840135915080821115614e7357600080fd5b50614e8084828501614d75565b60c08301525092915050565b600060208284031215614e9e57600080fd5b81356001600160401b03811115614eb457600080fd5b614ec084828501614dd0565b949350505050565b600060208284031215614eda57600080fd5b813560ff81168114614a1c57600080fd5b8015158114610fee57600080fd5b600080600080600060808688031215614f1157600080fd5b85356001600160401b0380821115614f2857600080fd5b9087019060e0828a031215614f3c57600080fd5b90955060208701359080821115614f5257600080fd5b50614f5f8882890161480a565b909550935050604086013591506060860135614f7a81614eeb565b809150509295509295909350565b60008060408385031215614f9b57600080fd5b8235614fa68161488f565b91506020830135614fb68161488f565b809150509250929050565b600060408284031215614fd357600080fd5b614fdb614c6f565b905081356001600160401b0380821115614ff457600080fd5b818401915084601f83011261500857600080fd5b813560208282111561501c5761501c614c31565b61502e601f8301601f19168201614c91565b9250818352868183860101111561504457600080fd5b8181850182850137600081838501015282855280860135818601525050505092915050565b600080600080600060a0868803121561508157600080fd5b853561508c8161488f565b9450602086013561509c8161488f565b935060408601356001600160401b03808211156150b857600080fd5b6150c489838a01614fc1565b945060608801359150808211156150da57600080fd5b506150e788828901614fc1565b95989497509295608001359392505050565b6000806040838503121561510c57600080fd5b82356151178161488f565b915060208301356001600160401b0381111561513257600080fd5b61513e85828601614d01565b9150509250929050565b600081518084526020808501945080840160005b838110156151785781518752958201959082019060010161515c565b509495945050505050565b602081526000614a1c6020830184615148565b600080602083850312156151a957600080fd5b82356001600160401b038111156151bf57600080fd5b6148838582860161496b565b600080604083850312156151de57600080fd5b82356151e98161488f565b946020939093013593505050565b6000806000806080858703121561520d57600080fd5b84356152188161488f565b935060208501359250604085013561522f8161488f565b9396929550929360600135925050565b600081518084526020808501945080840160005b838110156151785781516001600160a01b031687529582019590820190600101615253565b60408152600061528b604083018561523f565b82810360208401526112208185615148565b6000806000606084860312156152b257600080fd5b83356152bd8161488f565b925060208401356001600160401b038111156152d857600080fd5b6152e486828701614fc1565b925050604084013590509250925092565b60006060828403121561530757600080fd5b614a1c8383614953565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561535157615351615327565b5060010190565b60208082526019908201527f5061757361626c653a20696e6465782069732070617573656400000000000000604082015260600190565b60008235605e198336030181126153a557600080fd5b9190910192915050565b6000808335601e198436030181126153c657600080fd5b8301803591506001600160401b038211156153e057600080fd5b6020019150600581901b360382131561452257600080fd5b6060810182356154078161488f565b6001600160a01b0390811683526020840135906154238261488f565b166020830152604083013561543781614cc1565b63ffffffff811660408401525092915050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561548b57600080fd5b8151614a1c8161488f565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b60208082526037908201527f44656c65676174696f6e4d616e616765723a206f6e6c7953747261746567794d60408201527f616e616765724f72456967656e506f644d616e61676572000000000000000000606082015260800190565b60006020828403121561554f57600080fd5b8151614a1c81614eeb565b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b6000823560de198336030181126153a557600080fd5b6000602082840312156155ca57600080fd5b8135614a1c81614eeb565b600060018060a01b03808351168452806020840151166020850152806040840151166040850152506060820151606084015263ffffffff608083015116608084015260a082015160e060a085015261563060e085018261523f565b905060c083015184820360c08601526112208282615148565b602081526000614a1c60208301846155d5565b60006020828403121561566e57600080fd5b5051919050565b600082601f83011261568657600080fd5b81516020615696614d2283614cde565b82815260059290921b840181019181810190868411156156b557600080fd5b8286015b84811015614d6a57805183529183019183016156b9565b600080604083850312156156e357600080fd5b82516001600160401b03808211156156fa57600080fd5b818501915085601f83011261570e57600080fd5b8151602061571e614d2283614cde565b82815260059290921b8401810191818101908984111561573d57600080fd5b948201945b838610156157645785516157558161488f565b82529482019490820190615742565b9188015191965090935050508082111561577d57600080fd5b5061513e85828601615675565b6000821982111561579d5761579d615327565b500190565b6000828210156157b4576157b4615327565b500390565b6001600160a01b039384168152919092166020820152604081019190915260600190565b828152604060208201526000614ec060408301846155d5565b60006020828403121561580857600080fd5b8135614a1c81614cc1565b80546001600160a01b0319166001600160a01b0392909216919091179055565b813561583e8161488f565b6158488183615813565b5060018101602083013561585b8161488f565b6158658183615813565b50604083013561587481614cc1565b815463ffffffff60a01b191660a09190911b63ffffffff60a01b161790555050565b60006117513683614dd0565b6020808252606e908201526000805160206159c883398151915260408201527f645769746864726177616c3a207769746864726177616c44656c6179426c6f6360608201527f6b7320706572696f6420686173206e6f74207965742070617373656420666f7260808201526d207468697320737472617465677960901b60a082015260c00190565b82815260006020604081840152835180604085015260005b8181101561595e57858101830151858201606001528201615942565b81811115615970576000606083870101525b50601f01601f191692909201606001949350505050565b60006020828403121561599957600080fd5b81516001600160e01b031981168114614a1c57600080fd5b634e487b7160e01b600052602160045260246000fdfe44656c65676174696f6e4d616e616765722e5f636f6d706c6574655175657565a264697066735822122046f59d0774fea296e76e107662bfe5a0f076e0013aabe21beb6ded4a9b0f61a864736f6c634300080c0033", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"},{\"name\":\"_slasher\",\"type\":\"address\",\"internalType\":\"contractISlasher\"},{\"name\":\"_eigenPodManager\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"},{\"name\":\"_avsDirectory\",\"type\":\"address\",\"internalType\":\"contractIAVSDirectory\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"DELEGATION_APPROVAL_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\":\"MAX_STAKER_OPT_OUT_WINDOW_BLOCKS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_WITHDRAWAL_DELAY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_WITHDRAWAL_DELAY_BLOCKS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"STAKER_DELEGATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"avsDirectory\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIAVSDirectory\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateCurrentStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateDelegationApprovalDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_stakerNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateWithdrawalRoot\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawals\",\"inputs\":[{\"name\":\"withdrawals\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.Withdrawal[]\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[][]\",\"internalType\":\"contractIERC20[][]\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool[]\",\"internalType\":\"bool[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeWithdrawalsQueued\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseDelegatedShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"removedShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateTo\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateToBySignature\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegatedTo\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApprover\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApproverSaltIsSpent\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getDelegatableShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWithdrawableStakerShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWithdrawalDelay\",\"inputs\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseDelegatedShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"existingShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"addedShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"initialPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_minWithdrawalDelayBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"_withdrawalDelayBlocks\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeAllocationDelay\",\"inputs\":[{\"name\":\"delay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minWithdrawalDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minWithdrawalDelayBlocks\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"modifyOperatorDetails\",\"inputs\":[{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorAllocationDelay\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.AllocationDelayDetails\",\"components\":[{\"name\":\"isSet\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"allocationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorDetails\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorScaledShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorShares\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"pendingWithdrawals\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"queueWithdrawals\",\"inputs\":[{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerAsOperator\",\"inputs\":[{\"name\":\"registeringOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"allocationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMinWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"newMinWithdrawalDelayBlocks\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setStrategyWithdrawalDelay\",\"inputs\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"withdrawalDelays\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setStrategyWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"withdrawalDelayBlocks\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerNonce\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerOptOutWindowBlocks\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerScalingFactors\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWithdrawalDelays\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"undelegate\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"withdrawalRoots\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOperatorMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MinWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorDetailsModified\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorMetadataURIUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRegistered\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesDecreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesIncreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\":\"StakerDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerForceUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWithdrawalDelaySet\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\":\"WithdrawalCompleted\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalQueued\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"withdrawal\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false}]", + Bin: "0x6101206040523480156200001257600080fd5b506040516200745438038062007454833981016040819052620000359162000149565b6001600160a01b0380851660a05280831660e05280841660c05281166080526200005e6200006e565b5050466101005250620001b19050565b600054610100900460ff1615620000db5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156200012e576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200014657600080fd5b50565b600080600080608085870312156200016057600080fd5b84516200016d8162000130565b6020860151909450620001808162000130565b6040860151909350620001938162000130565b6060860151909250620001a68162000130565b939692955090935050565b60805160a05160c05160e051610100516171af620002a56000396000612ba601526000818161062a0152818161117d0152818161158f01528181611f8601528181612c750152818161327301528181613603015281816155d50152615b72015260006108f401526000818161055f0152818161114b0152818161155d0152818161201a01528181612d1c015281816132fe01528181613681015281816137f2015281816156bd0152615c1801526000818161074e01528181610e810152818161120501528181611617015281816119d8015281816126bd01528181612e12015281816147780152614f6a01526171af6000f3fe608060405234801561001057600080fd5b50600436106103c55760003560e01c806365da1264116101ff578063b7f06ebe1161011a578063da8be864116100ad578063f2fde38b1161007c578063f2fde38b14610abe578063f698da2514610ad1578063f878776e14610ad9578063fabc1cbc14610af957600080fd5b8063da8be86414610a72578063e4cc3f9014610a85578063eea9064b14610a98578063f16172b014610aab57600080fd5b8063c5e480db116100e9578063c5e480db14610990578063c94b511114610a36578063ca661c0414610a49578063cf80873e14610a5157600080fd5b8063b7f06ebe14610916578063bb45fef214610939578063c448feb814610967578063c488375a1461097057600080fd5b80638da5cb5b116101925780639fb4ee32116101615780639fb4ee321461089a578063a1788484146108c5578063a238f9df146108e5578063b1344271146108ef57600080fd5b80638da5cb5b146108485780639104c319146108595780639435bb431461087457806399be81c81461088757600080fd5b8063778e55f3116101ce578063778e55f31461078b5780637f5480711461079e578063886f1195146107b157806389829397146107c457600080fd5b806365da1264146107205780636b3aa72e146107495780636d70f7ae14610770578063715018a61461078357600080fd5b806339b70e38116102ef57806350739be3116102825780635ac86ab7116102515780635ac86ab7146106cf5780635c975abb146106f2578063635bbd10146106fa578063651878101461070d57600080fd5b806350739be31461066957806351260e2314610689578063595c6a67146106b4578063597b36da146106bc57600080fd5b806343377382116102be57806343377382146105fe5780634665bcda14610625578063497300601461064c5780634fc40b611461065f57600080fd5b806339b70e381461055a5780633c651cf2146105995780633cdeb5e0146105ac5780633e28391d146105db57600080fd5b8063132d4967116103675780631bbce091116103365780631bbce091146104ed57806320606b701461050057806322bf40e41461052757806329c77d4f1461053a57600080fd5b8063132d49671461047b578063136439dd1461048e5780631522bf02146104a157806316928365146104b457600080fd5b80630d5b0067116103a35780630d5b00671461042a5780630dd8dd02146104335780630de5495d1461045357806310d67a2f1461046857600080fd5b80630449ca39146103ca57806304a4f979146103f05780630b9f487a14610417575b600080fd5b6103dd6103d8366004615dda565b610b0c565b6040519081526020015b60405180910390f35b6103dd7f14bde674c9f64b2ad00eaaee4a8bed1fabef35c7507e3c5b9cfc9436909a2dad81565b6103dd610425366004615e40565b610b91565b6103dd60a25481565b610446610441366004615dda565b610c53565b6040516103e79190615e9b565b610466610461366004615efc565b611084565b005b610466610476366004615f19565b611090565b610466610489366004615f36565b611140565b61046661049c366004615f77565b611287565b6104666104af366004615f90565b6113c6565b6103dd6104c2366004615f19565b6001600160a01b0316600090815260996020526040902060010154600160a01b900463ffffffff1690565b6103dd6104fb366004615f36565b6113e0565b6103dd7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b610466610535366004615ffb565b61140e565b6103dd610548366004615f19565b609b6020526000908152604090205481565b6105817f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016103e7565b6104666105a73660046160a2565b611552565b6105816105ba366004615f19565b6001600160a01b039081166000908152609960205260409020600101541690565b6105ee6105e9366004615f19565b6116d3565b60405190151581526020016103e7565b6103dd7f39111bc4a4d688e1f685123d7497d4615370152a8ee4a0593e647bd06ad8bb0b81565b6105817f000000000000000000000000000000000000000000000000000000000000000081565b61046661065a366004616141565b6116f3565b6103dd6213c68081565b6103dd610677366004615f19565b60a36020526000908152604090205481565b6103dd610697366004616198565b60a460209081526000928352604080842090915290825290205481565b610466611842565b6103dd6106ca36600461640f565b611909565b6105ee6106dd366004616443565b606654600160ff9092169190911b9081161490565b6066546103dd565b610466610708366004615f77565b611939565b61046661071b366004615f90565b61194a565b61058161072e366004615f19565b609a602052600090815260409020546001600160a01b031681565b6105817f000000000000000000000000000000000000000000000000000000000000000081565b6105ee61077e366004615f19565b61195e565b610466611998565b6103dd610799366004616198565b6119ac565b6104666107ac36600461650e565b611a7e565b606554610581906001600160a01b031681565b6108256107d2366004615f19565b6040805180820190915260008082526020820152506001600160a01b0316600090815260a5602090815260409182902082518084019093525460ff811615158352610100900463ffffffff169082015290565b6040805182511515815260209283015163ffffffff1692810192909252016103e7565b6033546001600160a01b0316610581565b61058173beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac081565b61046661088236600461659e565b611ca1565b610466610895366004616637565b611dc3565b6103dd6108a8366004616198565b609860209081526000928352604080842090915290825290205481565b6103dd6108d3366004615f19565b609f6020526000908152604090205481565b6103dd62278d0081565b6105817f000000000000000000000000000000000000000000000000000000000000000081565b6105ee610924366004615f77565b609e6020526000908152604090205460ff1681565b6105ee61094736600461666c565b609c60209081526000928352604080842090915290825290205460ff1681565b6103dd609d5481565b6103dd61097e366004615f19565b60a16020526000908152604090205481565b610a0061099e366004615f19565b6040805160608082018352600080835260208084018290529284018190526001600160a01b03948516815260998352839020835191820184528054851682526001015493841691810191909152600160a01b90920463ffffffff169082015290565b6040805182516001600160a01b039081168252602080850151909116908201529181015163ffffffff16908201526060016103e7565b6103dd610a44366004616698565b611e95565b6103dd611f4e565b610a64610a5f366004615f19565b611f5f565b6040516103e7929190616754565b610446610a80366004615f19565b612317565b610466610a93366004616787565b6128e5565b610466610aa636600461680a565b61297e565b610466610ab9366004616862565b612a9b565b610466610acc366004615f19565b612b2c565b6103dd612ba2565b610aec610ae736600461687e565b612be0565b6040516103e791906168d2565b610466610b07366004615f77565b612f5c565b609d54600090815b83811015610b8957600060a16000878785818110610b3457610b346168e5565b9050602002016020810190610b499190615f19565b6001600160a01b03166001600160a01b0316815260200190815260200160002054905082811115610b78578092505b50610b8281616911565b9050610b14565b509392505050565b604080517f14bde674c9f64b2ad00eaaee4a8bed1fabef35c7507e3c5b9cfc9436909a2dad6020808301919091526001600160a01b038681168385015288811660608401528716608083015260a0820185905260c08083018590528351808403909101815260e0909201909252805191012060009081610c0f612ba2565b60405161190160f01b602082015260228101919091526042810183905260620160408051808303601f19018152919052805160209091012098975050505050505050565b60665460609060019060029081161415610c885760405162461bcd60e51b8152600401610c7f9061692c565b60405180910390fd5b6000836001600160401b03811115610ca257610ca26161d1565b604051908082528060200260200182016040528015610ccb578160200160208202803683370190505b50336000908152609a60205260408120549192506001600160a01b03909116905b8581101561107957868682818110610d0657610d066168e5565b9050602002810190610d189190616963565b610d26906020810190616983565b9050878783818110610d3a57610d3a6168e5565b9050602002810190610d4c9190616963565b610d569080616983565b905014610dcb5760405162461bcd60e51b815260206004820152603860248201527f44656c65676174696f6e4d616e616765722e717565756557697468647261776160448201527f6c3a20696e707574206c656e677468206d69736d6174636800000000000000006064820152608401610c7f565b33878783818110610dde57610dde6168e5565b9050602002810190610df09190616963565b610e01906060810190604001615f19565b6001600160a01b031614610e7d5760405162461bcd60e51b815260206004820152603c60248201527f44656c65676174696f6e4d616e616765722e717565756557697468647261776160448201527f6c3a2077697468647261776572206d757374206265207374616b6572000000006064820152608401610c7f565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166339a9a3ed848a8a86818110610ec157610ec16168e5565b9050602002810190610ed39190616963565b610edd9080616983565b6040518463ffffffff1660e01b8152600401610efb93929190616a0a565b600060405180830381865afa158015610f18573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f409190810190616a46565b905061104933848a8a86818110610f5957610f596168e5565b9050602002810190610f6b9190616963565b610f7c906060810190604001615f19565b8b8b87818110610f8e57610f8e6168e5565b9050602002810190610fa09190616963565b610faa9080616983565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508f92508e9150899050818110610ff057610ff06168e5565b90506020028101906110029190616963565b611010906020810190616983565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508992506130b8915050565b84838151811061105b5761105b6168e5565b6020908102919091010152508061107181616911565b915050610cec565b509095945050505050565b61108d8161398f565b50565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111079190616add565b6001600160a01b0316336001600160a01b0316146111375760405162461bcd60e51b8152600401610c7f90616afa565b61108d81613b24565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061119f5750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b6111bb5760405162461bcd60e51b8152600401610c7f90616b44565b6111c4836116d3565b15611282576001600160a01b038381166000908152609a6020526040808220549051635a3932f160e11b8152908316600482018190528584166024830152927f0000000000000000000000000000000000000000000000000000000000000000169063b47265e290604401602060405180830381865afa15801561124c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112709190616ba1565b905061127f8286868685613c1b565b50505b505050565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156112cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f39190616bbc565b61130f5760405162461bcd60e51b8152600401610c7f90616bd9565b606654818116146113885760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610c7f565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b6113ce613cb7565b6113da84848484613d11565b50505050565b6001600160a01b0383166000908152609b602052604081205461140585828686611e95565b95945050505050565b600054610100900460ff161580801561142e5750600054600160ff909116105b806114485750303b158015611448575060005460ff166001145b6114ab5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c7f565b6000805460ff1916600117905580156114ce576000805461ff0019166101001790555b6114d88888613f1f565b6114e0614009565b6097556114ec896140a0565b6114f5866140f2565b61150185858585613d11565b8015611547576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806115b15750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b6115cd5760405162461bcd60e51b8152600401610c7f90616b44565b6115d6846116d3565b156113da576001600160a01b038481166000908152609a6020526040808220549051635a3932f160e11b8152908316600482018190528684166024830152927f0000000000000000000000000000000000000000000000000000000000000000169063b47265e290604401602060405180830381865afa15801561165e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116829190616ba1565b9050600061169387878488886141f6565b6001600160a01b03808916600090815260a460209081526040808320938b1683529290522081905590506116ca83888887866142b1565b50505050505050565b6001600160a01b039081166000908152609a602052604090205416151590565b6116fc336116d3565b156117825760405162461bcd60e51b815260206004820152604a60248201527f44656c65676174696f6e4d616e616765722e726567697374657241734f70657260448201527f61746f723a2063616c6c657220697320616c7265616479206163746976656c796064820152690819195b1959d85d195960b21b608482015260a401610c7f565b61178c338561433d565b6040805180820190915260608152600060208201526117ae3380836000614530565b6117b78461398f565b336001600160a01b03167f8e8485583a2310d41f7c82b9427d0bd49bad74bb9cff9d3402a29d8f9b28a0e2866040516117f09190616c21565b60405180910390a2336001600160a01b03167f02a919ed0e2acad1dd90f17ef2fa4ae5462ee1339170034a8531cca4b67080908484604051611833929190616c73565b60405180910390a25050505050565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa15801561188a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ae9190616bbc565b6118ca5760405162461bcd60e51b8152600401610c7f90616bd9565b600019606681905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b60008160405160200161191c9190616d16565b604051602081830303815290604052805190602001209050919050565b611941613cb7565b61108d816140f2565b611952613cb7565b6113da84848484614947565b60006001600160a01b0382161580159061199257506001600160a01b038083166000818152609a6020526040902054909116145b92915050565b6119a0613cb7565b6119aa60006140a0565b565b604051635a3932f160e11b81526001600160a01b038381166004830152828116602483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063b47265e290604401602060405180830381865afa158015611a1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a439190616ba1565b6001600160a01b03808616600090815260986020908152604080832093881683529290522054909150611a769082614b20565b949350505050565b4283602001511015611b025760405162461bcd60e51b815260206004820152604160248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f4279536960448201527f676e61747572653a207374616b6572207369676e6174757265206578706972656064820152601960fa1b608482015260a401610c7f565b611b0b856116d3565b15611b945760405162461bcd60e51b815260206004820152604d60248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f4279536960448201527f676e61747572653a207374616b657220697320616c726561647920616374697660648201526c195b1e4819195b1959d85d1959609a1b608482015260a401610c7f565b611b9d8461195e565b611c295760405162461bcd60e51b815260206004820152605160248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f4279536960448201527f676e61747572653a206f70657261746f72206973206e6f7420726567697374656064820152703932b21034b71022b4b3b2b72630bcb2b960791b608482015260a401610c7f565b6000609b6000876001600160a01b03166001600160a01b031681526020019081526020016000205490506000611c658783888860200151611e95565b6001600160a01b0388166000908152609b602052604090206001840190558551909150611c959088908390614b4f565b6116ca87878686614530565b60665460029060049081161415611cca5760405162461bcd60e51b8152600401610c7f9061692c565b600260cb541415611d1d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c7f565b600260cb5560005b86811015611db457611da4888883818110611d4257611d426168e5565b9050602002810190611d549190616d29565b878784818110611d6657611d666168e5565b9050602002810190611d789190616983565b878786818110611d8a57611d8a6168e5565b9050602002016020810190611d9f9190616d3f565b614d09565b611dad81616911565b9050611d25565b5050600160cb55505050505050565b611dcc3361195e565b611e4e5760405162461bcd60e51b815260206004820152604760248201527f44656c65676174696f6e4d616e616765722e7570646174654f70657261746f7260448201527f4d657461646174615552493a2063616c6c6572206d75737420626520616e206f6064820152663832b930ba37b960c91b608482015260a401610c7f565b336001600160a01b03167f02a919ed0e2acad1dd90f17ef2fa4ae5462ee1339170034a8531cca4b67080908383604051611e89929190616c73565b60405180910390a25050565b604080517f39111bc4a4d688e1f685123d7497d4615370152a8ee4a0593e647bd06ad8bb0b6020808301919091526001600160a01b0387811683850152851660608301526080820186905260a08083018590528351808403909101815260c0909201909252805191012060009081611f0b612ba2565b60405161190160f01b602082015260228101919091526042810183905260620160408051808303601f190181529190528051602090910120979650505050505050565b611f5c600c62278d00616d5c565b81565b6040516360f4062b60e01b81526001600160a01b03828116600483015260609182916000917f0000000000000000000000000000000000000000000000000000000000000000909116906360f4062b90602401602060405180830381865afa158015611fcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff39190616d7e565b6040516394f649dd60e01b81526001600160a01b03868116600483015291925060009182917f0000000000000000000000000000000000000000000000000000000000000000909116906394f649dd90602401600060405180830381865afa158015612063573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261208b9190810190616df2565b91509150600083136120a257909590945092505050565b60608083516000141561215c576040805160018082528183019092529060208083019080368337505060408051600180825281830190925292945090506020808301908036833701905050905073beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac082600081518110612117576121176168e5565b60200260200101906001600160a01b031690816001600160a01b031681525050848160008151811061214b5761214b6168e5565b60200260200101818152505061230a565b8351612169906001616eb6565b6001600160401b03811115612180576121806161d1565b6040519080825280602002602001820160405280156121a9578160200160208202803683370190505b50915081516001600160401b038111156121c5576121c56161d1565b6040519080825280602002602001820160405280156121ee578160200160208202803683370190505b50905060005b84518110156122885784818151811061220f5761220f6168e5565b6020026020010151838281518110612229576122296168e5565b60200260200101906001600160a01b031690816001600160a01b03168152505083818151811061225b5761225b6168e5565b6020026020010151828281518110612275576122756168e5565b60209081029190910101526001016121f4565b5073beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac082600184516122ad9190616ece565b815181106122bd576122bd6168e5565b60200260200101906001600160a01b031690816001600160a01b0316815250508481600184516122ed9190616ece565b815181106122fd576122fd6168e5565b6020026020010181815250505b9097909650945050505050565b606654606090600190600290811614156123435760405162461bcd60e51b8152600401610c7f9061692c565b61234c836116d3565b6123cc5760405162461bcd60e51b8152602060048201526044602482018190527f44656c65676174696f6e4d616e616765722e756e64656c65676174653a207374908201527f616b6572206d7573742062652064656c65676174656420746f20756e64656c656064820152636761746560e01b608482015260a401610c7f565b6123d58361195e565b156124485760405162461bcd60e51b815260206004820152603d60248201527f44656c65676174696f6e4d616e616765722e756e64656c65676174653a206f7060448201527f657261746f72732063616e6e6f7420626520756e64656c6567617465640000006064820152608401610c7f565b6001600160a01b0383166124c45760405162461bcd60e51b815260206004820152603c60248201527f44656c65676174696f6e4d616e616765722e756e64656c65676174653a20636160448201527f6e6e6f7420756e64656c6567617465207a65726f2061646472657373000000006064820152608401610c7f565b6001600160a01b038084166000818152609a6020526040902054909116903314806124f75750336001600160a01b038216145b8061251e57506001600160a01b038181166000908152609960205260409020600101541633145b6125905760405162461bcd60e51b815260206004820152603d60248201527f44656c65676174696f6e4d616e616765722e756e64656c65676174653a20636160448201527f6c6c65722063616e6e6f7420756e64656c6567617465207374616b65720000006064820152608401610c7f565b60008061259c86611f5f565b9092509050336001600160a01b038716146125f257826001600160a01b0316866001600160a01b03167ff0eddf07e6ea14f388b47e1e94a0f464ecbd9eed4171130e0fc0e99fb4030a8a60405160405180910390a35b826001600160a01b0316866001600160a01b03167ffee30966a256b71e14bc0ebfc94315e28ef4a97a7131a9e2b7a310a73af4467660405160405180910390a36001600160a01b0386166000908152609a6020526040902080546001600160a01b031916905581516126745760408051600081526020810190915294506128dc565b81516001600160401b0381111561268d5761268d6161d1565b6040519080825280602002602001820160405280156126b6578160200160208202803683370190505b50945060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166339a9a3ed85856040518363ffffffff1660e01b8152600401612709929190616ee5565b600060405180830381865afa158015612726573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261274e9190810190616a46565b905060005b83518110156128d95760408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833750506040805160018082528183019092529293506000929150602080830190803683370190505090508684815181106127d6576127d66168e5565b6020026020010151836000815181106127f1576127f16168e5565b60200260200101906001600160a01b031690816001600160a01b031681525050858481518110612823576128236168e5565b60200260200101518260008151811061283e5761283e6168e5565b60200260200101818152505084848151811061285c5761285c6168e5565b602002602001015181600081518110612877576128776168e5565b60200260200101906001600160401b031690816001600160401b0316815250506128a58b898d8686866130b8565b8a85815181106128b7576128b76168e5565b60200260200101818152505050505080806128d190616911565b915050612753565b50505b50505050919050565b6066546002906004908116141561290e5760405162461bcd60e51b8152600401610c7f9061692c565b600260cb5414156129615760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c7f565b600260cb5561297285858585614d09565b5050600160cb55505050565b612987336116d3565b15612a055760405162461bcd60e51b815260206004820152604260248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f3a20737460448201527f616b657220697320616c7265616479206163746976656c792064656c65676174606482015261195960f21b608482015260a401610c7f565b612a0e8361195e565b612a8f5760405162461bcd60e51b815260206004820152604660248201527f44656c65676174696f6e4d616e616765722e64656c6567617465546f3a206f7060448201527f657261746f72206973206e6f74207265676973746572656420696e2045696765606482015265372630bcb2b960d11b608482015260a401610c7f565b61128233848484614530565b612aa43361195e565b612b225760405162461bcd60e51b815260206004820152604360248201527f44656c65676174696f6e4d616e616765722e6d6f646966794f70657261746f7260448201527f44657461696c733a2063616c6c6572206d75737420626520616e206f706572616064820152623a37b960e91b608482015260a401610c7f565b61108d338261433d565b612b34613cb7565b6001600160a01b038116612b995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c7f565b61108d816140a0565b60007f0000000000000000000000000000000000000000000000000000000000000000461415612bd3575060975490565b612bdb614009565b905090565b6001600160a01b038084166000908152609a602052604081205460609216905b83811015612f535773beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0858583818110612c2f57612c2f6168e5565b9050602002016020810190612c449190615f19565b6001600160a01b03161415612d1a576040516360f4062b60e01b81526001600160a01b0387811660048301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906360f4062b90602401602060405180830381865afa158015612cbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce29190616d7e565b90506000811315612cf35780612cf6565b60005b848381518110612d0857612d086168e5565b60200260200101818152505050612dff565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637a7e0d9287878785818110612d5c57612d5c6168e5565b9050602002016020810190612d719190615f19565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381865afa158015612dbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612de09190616d7e565b838281518110612df257612df26168e5565b6020026020010181815250505b6001600160a01b03821615612f435760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b47265e284888886818110612e5257612e526168e5565b9050602002016020810190612e679190615f19565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381865afa158015612eb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ed69190616ba1565b9050612f2387878785818110612eee57612eee6168e5565b9050602002016020810190612f039190615f19565b868581518110612f1557612f156168e5565b6020026020010151846150ab565b848381518110612f3557612f356168e5565b602002602001018181525050505b612f4c81616911565b9050612c00565b50509392505050565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612faf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd39190616add565b6001600160a01b0316336001600160a01b0316146130035760405162461bcd60e51b8152600401610c7f90616afa565b6066541981196066541916146130815760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610c7f565b606681905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c906020016113bb565b60006001600160a01b03871661313d5760405162461bcd60e51b8152602060048201526050602482015260008051602061711a83398151915260448201527f6e6451756575655769746864726177616c3a207374616b65722063616e6e6f7460648201526f206265207a65726f206164647265737360801b608482015260a401610c7f565b83516131b55760405162461bcd60e51b815260206004820152604d602482015260008051602061711a83398151915260448201527f6e6451756575655769746864726177616c3a207374726174656769657320636160648201526c6e6e6f7420626520656d70747960981b608482015260a401610c7f565b600084516001600160401b038111156131d0576131d06161d1565b6040519080825280602002602001820160405280156131f9578160200160208202803683370190505b50905060005b855181101561389b57600073beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac06001600160a01b031687838151811061323a5761323a6168e5565b60200260200101516001600160a01b031614156132fc576040516360f4062b60e01b81526001600160a01b038b811660048301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906360f4062b90602401602060405180830381865afa1580156132bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132e09190616d7e565b905060008113156132f157806132f4565b60005b9150506133bc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637a7e0d928b89858151811061333e5761333e6168e5565b60200260200101516040518363ffffffff1660e01b81526004016133789291906001600160a01b0392831681529116602082015260400190565b602060405180830381865afa158015613395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b99190616d7e565b90505b6133fa8a8884815181106133d2576133d26168e5565b6020026020010151838886815181106133ed576133ed6168e5565b60200260200101516150ab565b86838151811061340c5761340c6168e5565b602002602001015111156134a65760405162461bcd60e51b8152602060048201526061602482015260008051602061711a83398151915260448201527f6e6451756575655769746864726177616c3a2073686172657320746f2077697460648201527f6864726177206578636565647320776974686472617761626c652073686172656084820152607360f81b60a482015260c401610c7f565b60006134cb8b8985815181106134be576134be6168e5565b60200260200101516150eb565b905060008061350d8986815181106134e5576134e56168e5565b6020026020010151848a8881518110613500576135006168e5565b6020026020010151615129565b9150915080868681518110613524576135246168e5565b60209081029190910101526001600160a01b038c1615613596576135968c8e8c8881518110613555576135556168e5565b60200260200101518c898151811061356f5761356f6168e5565b60200260200101518c8a81518110613589576135896168e5565b6020026020010151613c1b565b73beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac06001600160a01b03168a86815181106135c6576135c66168e5565b60200260200101516001600160a01b031614156136645760405163beffbb8960e01b81526001600160a01b038e81166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063beffbb8990604401600060405180830381600087803b15801561364757600080fd5b505af115801561365b573d6000803e3d6000fd5b5050505061388c565b8a6001600160a01b03168d6001600160a01b0316148061373657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639b4da03d8b87815181106136c0576136c06168e5565b60200260200101516040518263ffffffff1660e01b81526004016136f391906001600160a01b0391909116815260200190565b602060405180830381865afa158015613710573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137349190616bbc565b155b6137f05760405162461bcd60e51b81526020600482015260846024820181905260008051602061711a83398151915260448301527f6e6451756575655769746864726177616c3a2077697468647261776572206d7560648301527f73742062652073616d652061646472657373206173207374616b657220696620908201527f746869726450617274795472616e7366657273466f7262696464656e2061726560a482015263081cd95d60e21b60c482015260e401610c7f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638c80d4e58e8c8881518110613832576138326168e5565b6020026020010151856040518463ffffffff1660e01b815260040161385993929190616f09565b600060405180830381600087803b15801561387357600080fd5b505af1158015613887573d6000803e3d6000fd5b505050505b846001019450505050506131ff565b506001600160a01b0388166000908152609f602052604081208054918291906138c383616911565b919050555060006040518060e001604052808b6001600160a01b031681526020018a6001600160a01b03168152602001896001600160a01b031681526020018381526020014263ffffffff168152602001888152602001848152509050600061392b82611909565b6000818152609e602052604090819020805460ff19166001179055519091507f9009ab153e8014fbfb02f2217f5cde7aa7f9ad734ae85ca3ee3f4ca2fdd499f9906139799083908590616f2d565b60405180910390a19a9950505050505050505050565b6139983361195e565b613a305760405162461bcd60e51b815260206004820152605760248201527f44656c65676174696f6e4d616e616765722e5f696e697469616c697a65416c6c60448201527f6f636174696f6e44656c61793a206f70657261746f72206e6f7420726567697360648201527f746572656420746f20456967656e4c6179657220796574000000000000000000608482015260a401610c7f565b33600090815260a5602052604090205460ff1615613ac95760405162461bcd60e51b815260206004820152604a60248201527f44656c65676174696f6e4d616e616765722e5f696e697469616c697a65416c6c60448201527f6f636174696f6e44656c61793a20616c6c6f636174696f6e2064656c617920616064820152691b1c9958591e481cd95d60b21b608482015260a401610c7f565b6040805180820182526001815263ffffffff928316602080830191825233600090815260a59091529290922090518154925164ffffffffff1990931690151564ffffffff001916176101009290931691909102919091179055565b6001600160a01b038116613bb25760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610c7f565b606554604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b6000613c27838361518b565b6001600160a01b038088166000908152609860209081526040808320938916835292905290812080549293508392909190613c63908490616ece565b92505081905550856001600160a01b03167f6909600037b75d7b4733aedd815442b5ec018a827751c832aaff64eba5d6d2dd868684604051613ca793929190616f09565b60405180910390a2505050505050565b6033546001600160a01b031633146119aa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c7f565b828114613d875760405162461bcd60e51b815260206004820152604a602482015260008051602061715a83398151915260448201527f746864726177616c44656c6179426c6f636b733a20696e707574206c656e67746064820152690d040dad2e6dac2e8c6d60b31b608482015260a401610c7f565b8260005b81811015613f17576000868683818110613da757613da76168e5565b9050602002016020810190613dbc9190615f19565b6001600160a01b038116600090815260a16020526040812054919250868685818110613dea57613dea6168e5565b905060200201359050600c62278d00613e039190616d5c565b811115613ea85760405162461bcd60e51b8152602060048201526073602482015260008051602061715a83398151915260448201527f746864726177616c44656c6179426c6f636b733a205f7769746864726177616c60648201527f44656c6179426c6f636b732063616e6e6f74206265203e204d41585f5749544860848201527244524157414c5f44454c41595f424c4f434b5360681b60a482015260c401610c7f565b6001600160a01b038316600081815260a160209081526040918290208490558151928352820184905281018290527f0e7efa738e8b0ce6376a0c1af471655540d2e9a81647d7b09ed823018426576d9060600160405180910390a150505080613f1090616911565b9050613d8b565b505050505050565b6065546001600160a01b0316158015613f4057506001600160a01b03821615155b613fc25760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610c7f565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a261400582613b24565b5050565b604080518082018252600a81526922b4b3b2b72630bcb2b960b11b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea81840152466060820152306080808301919091528351808303909101815260a0909101909252815191012090565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b614100600c62278d00616d5c565b8111156141b55760405162461bcd60e51b815260206004820152607160248201527f44656c65676174696f6e4d616e616765722e5f7365744d696e5769746864726160448201527f77616c44656c6179426c6f636b733a205f6d696e5769746864726177616c446560648201527f6c6179426c6f636b732063616e6e6f74206265203e204d41585f5749544844526084820152704157414c5f44454c41595f424c4f434b5360781b60a482015260c401610c7f565b609d5460408051918252602082018390527fafa003cd76f87ff9d62b35beea889920f33c0c42b8d45b74954d61d50f4b6b69910160405180910390a1609d55565b60008083614220576142196001600160401b038616670de0b6b3a7640000616d5c565b90506142a7565b600061422c88886150eb565b90506001600160401b0386166142428587616eb6565b61424c9190616f46565b61425e670de0b6b3a764000086616f46565b670de0b6b3a76400006001600160401b03891661427b8986616f46565b6142859190616f46565b61428f9190616d5c565b6142999190616eb6565b6142a39190616d5c565b9150505b9695505050505050565b60006142bd838361518b565b6001600160a01b0380881660009081526098602090815260408083209389168352929052908120805492935083929091906142f9908490616eb6565b92505081905550856001600160a01b03167f1ec042c965e2edd7107b51188ee0f383e22e76179041ab3a9d18ff151405166c868684604051613ca793929190616f09565b6213c6806143516060830160408401615efc565b63ffffffff1611156144065760405162461bcd60e51b815260206004820152606c60248201527f44656c65676174696f6e4d616e616765722e5f7365744f70657261746f72446560448201527f7461696c733a207374616b65724f70744f757457696e646f77426c6f636b732060648201527f63616e6e6f74206265203e204d41585f5354414b45525f4f50545f4f55545f5760848201526b494e444f575f424c4f434b5360a01b60a482015260c401610c7f565b6001600160a01b0382166000908152609960205260409081902060010154600160a01b900463ffffffff16906144429060608401908401615efc565b63ffffffff1610156144d85760405162461bcd60e51b815260206004820152605360248201527f44656c65676174696f6e4d616e616765722e5f7365744f70657261746f72446560448201527f7461696c733a207374616b65724f70744f757457696e646f77426c6f636b732060648201527218d85b9b9bdd08189948191958dc99585cd959606a1b608482015260a401610c7f565b6001600160a01b038216600090815260996020526040902081906144fc8282616f85565b505060405133907ffebe5cd24b2cbc7b065b9d0fdeb904461e4afcff57dd57acda1e7832031ba7ac90611e89908490616c21565b606654600090600190811614156145595760405162461bcd60e51b8152600401610c7f9061692c565b6001600160a01b0380851660009081526099602052604090206001015416801580159061458f5750336001600160a01b03821614155b80156145a45750336001600160a01b03861614155b156147115742846020015110156146235760405162461bcd60e51b815260206004820152603760248201527f44656c65676174696f6e4d616e616765722e5f64656c65676174653a2061707060448201527f726f766572207369676e617475726520657870697265640000000000000000006064820152608401610c7f565b6001600160a01b0381166000908152609c6020908152604080832086845290915290205460ff16156146bd5760405162461bcd60e51b815260206004820152603760248201527f44656c65676174696f6e4d616e616765722e5f64656c65676174653a2061707060448201527f726f76657253616c7420616c7265616479207370656e740000000000000000006064820152608401610c7f565b6001600160a01b0381166000908152609c6020908152604080832086845282528220805460ff191660011790558501516146fe908890889085908890610b91565b905061470f82828760000151614b4f565b505b6001600160a01b038681166000818152609a602052604080822080546001600160a01b031916948a169485179055517fc3ee9f2e5fda98e8066a1f745b2df9285f416fe98cf2559cd21484b3d87433049190a360008061477088611f5f565b9150915060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166339a9a3ed89856040518363ffffffff1660e01b81526004016147c4929190616ee5565b600060405180830381865afa1580156147e1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526148099190810190616a46565b905060005b835181101561493b5760006148728b86848151811061482f5761482f6168e5565b6020026020010151858581518110614849576148496168e5565b60200260200101516000888781518110614865576148656168e5565b60200260200101516141f6565b90508060a460008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008785815181106148ae576148ae6168e5565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055506149328a8c8785815181106148f1576148f16168e5565b602002602001015187868151811061490b5761490b6168e5565b6020026020010151878781518110614925576149256168e5565b60200260200101516142b1565b5060010161480e565b50505050505050505050565b8281146149b85760405162461bcd60e51b81526020600482015260446024820181905260008051602061715a833981519152908201527f746864726177616c44656c61793a20696e707574206c656e677468206d69736d6064820152630c2e8c6d60e31b608482015260a401610c7f565b8260005b81811015613f175760008686838181106149d8576149d86168e5565b90506020020160208101906149ed9190615f19565b6001600160a01b038116600090815260a36020526040812054919250868685818110614a1b57614a1b6168e5565b90506020020135905062278d00811115614ab15760405162461bcd60e51b8152602060048201526060602482015260008051602061715a83398151915260448201527f746864726177616c44656c61793a205f7769746864726177616c44656c61792060648201527f63616e6e6f74206265203e204d41585f5749544844524157414c5f44454c4159608482015260a401610c7f565b6001600160a01b038316600081815260a360209081526040918290208490558151928352820184905281018290527f4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e59060600160405180910390a150505080614b1990616911565b90506149bc565b6000670de0b6b3a7640000614b3e6001600160401b03841685616f46565b614b489190616d5c565b9392505050565b6001600160a01b0383163b15614c6957604051630b135d3f60e11b808252906001600160a01b03851690631626ba7e90614b8f9086908690600401616fe8565b602060405180830381865afa158015614bac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614bd09190617045565b6001600160e01b031916146112825760405162461bcd60e51b815260206004820152605360248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a2045524331323731207369676e6174757265206064820152721d995c9a599a58d85d1a5bdb8819985a5b1959606a1b608482015260a401610c7f565b826001600160a01b0316614c7d83836151a9565b6001600160a01b0316146112825760405162461bcd60e51b815260206004820152604760248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a207369676e6174757265206e6f742066726f6d6064820152661039b4b3b732b960c91b608482015260a401610c7f565b6000614d176106ca8661706f565b6000818152609e602052604090205490915060ff16614d985760405162461bcd60e51b8152602060048201526043602482015260008051602061713a83398151915260448201527f645769746864726177616c3a20616374696f6e206973206e6f7420696e20717560648201526265756560e81b608482015260a401610c7f565b60a2544390614dad60a0880160808901615efc565b63ffffffff16614dbd9190616eb6565b1115614e455760405162461bcd60e51b8152602060048201526059602482015260008051602061713a83398151915260448201527f645769746864726177616c3a206d696e5769746864726177616c44656c61792060648201527f706572696f6420686173206e6f74207965742070617373656400000000000000608482015260a401610c7f565b614e556060860160408701615f19565b6001600160a01b0316336001600160a01b031614614ee25760405162461bcd60e51b8152602060048201526050602482015260008051602061713a83398151915260448201527f645769746864726177616c3a206f6e6c7920776974686472617765722063616e60648201526f1031b7b6b83632ba329030b1ba34b7b760811b608482015260a401610c7f565b614eef60a0860186616983565b84149050614f5e5760405162461bcd60e51b8152602060048201526042602482015260008051602061713a83398151915260448201527f645769746864726177616c3a20696e707574206c656e677468206d69736d61746064820152610c6d60f31b608482015260a401610c7f565b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663858d0b47614f9f6040890160208a01615f19565b614fac60a08a018a616983565b62171240614fc060a08d0160808e01615efc565b614fca919061707b565b6040518563ffffffff1660e01b8152600401614fe994939291906170a3565b600060405180830381865afa158015615006573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261502e9190810190616a46565b9050821561504757615042868686846151c5565b615053565b615053868686846153bc565b6000828152609e602052604090819020805460ff19169055517fc97098c2f658800b4df29001527f7324bcdffcf6e8751a699ab920a1eced5b1d9061509b9084815260200190565b60405180910390a1505050505050565b6000806150b886866150eb565b9050670de0b6b3a76400006001600160401b0384166150d78684616f46565b6150e19190616f46565b6142a79190616d5c565b6001600160a01b03808316600090815260a46020908152604080832093851683529290529081205480614b485750670de0b6b3a76400009392505050565b60008061513f6001600160401b03841685616f46565b6151586ec097ce7bc90715b34b9f100000000087616f46565b6151629190616d5c565b9150670de0b6b3a76400006151778587616f46565b6151819190616d5c565b9050935093915050565b60006001600160401b038216614b3e670de0b6b3a764000085616f46565b60008060006151b8858561590c565b91509150610b898161597c565b60005b6151d560a0860186616983565b905081101561127f574260a360006151f060a0890189616983565b85818110615200576152006168e5565b90506020020160208101906152159190615f19565b6001600160a01b0316815260208101919091526040016000205461523f60a0880160808901615efc565b63ffffffff1661524f9190616eb6565b11156152f95760405162461bcd60e51b815260206004820152606760248201527f44656c65676174696f6e4d616e616765722e5f636f6d706c657465526563656960448201527f76654173546f6b656e733a207769746864726177616c44656c6179207065726960648201527f6f6420686173206e6f74207965742070617373656420666f72207468697320736084820152667472617465677960c81b60a482015260c401610c7f565b600061534161530b60c0880188616983565b8481811061531b5761531b6168e5565b90506020020135848481518110615334576153346168e5565b6020026020010151614b20565b90506153b36153536020880188615f19565b3361536160a08a018a616983565b86818110615371576153716168e5565b90506020020160208101906153869190615f19565b84898988818110615399576153996168e5565b90506020020160208101906153ae9190615f19565b615b37565b506001016151c8565b336000908152609a60205260408120546001600160a01b0316905b6153e460a0870187616983565b9050811015613f17574360a360006153ff60a08a018a616983565b8581811061540f5761540f6168e5565b90506020020160208101906154249190615f19565b6001600160a01b0316815260208101919091526040016000205461544e60a0890160808a01615efc565b63ffffffff1661545e9190616eb6565b11156155085760405162461bcd60e51b815260206004820152606760248201527f44656c65676174696f6e4d616e616765722e5f636f6d706c657465526563656960448201527f766541735368617265733a207769746864726177616c44656c6179207065726960648201527f6f6420686173206e6f74207965742070617373656420666f72207468697320736084820152667472617465677960c81b60a482015260c401610c7f565b600061554361551a60c0890189616983565b8481811061552a5761552a6168e5565b90506020020135858481518110615334576153346168e5565b9050600073beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac061556960a08a018a616983565b85818110615579576155796168e5565b905060200201602081019061558e9190615f19565b6001600160a01b031614156156bb5760006155ac60208a018a615f19565b6040516303a041cf60e21b81526001600160a01b038083166004830152602482018690529192507f000000000000000000000000000000000000000000000000000000000000000090911690630e81073c9060440160408051808303816000875af115801561561f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061564391906170df565b6001600160a01b038084166000908152609a60205260409020549295509093501680156156b4576156b4818361567c60a08e018e616983565b8981811061568c5761568c6168e5565b90506020020160208101906156a19190615f19565b878b8a81518110614925576149256168e5565b5050615820565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c4623ea1338989878181106156fd576156fd6168e5565b90506020020160208101906157129190615f19565b61571f60a08d018d616983565b8881811061572f5761572f6168e5565b90506020020160208101906157449190615f19565b60405160e085901b6001600160e01b03191681526001600160a01b03938416600482015291831660248301529091166044820152606481018590526084016020604051808303816000875af11580156157a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906157c59190616d7e565b90506001600160a01b038416156158205761582084336157e860a08c018c616983565b878181106157f8576157f86168e5565b905060200201602081019061580d9190615f19565b85898881518110614925576149256168e5565b600061588561583260208b018b615f19565b61583f60a08c018c616983565b8781811061584f5761584f6168e5565b90506020020160208101906158649190615f19565b888781518110615876576158766168e5565b602002602001015185876141f6565b90508060a4600061589960208d018d615f19565b6001600160a01b0316815260208101919091526040016000908120906158c260a08d018d616983565b888181106158d2576158d26168e5565b90506020020160208101906158e79190615f19565b6001600160a01b031681526020810191909152604001600020555050506001016153d7565b6000808251604114156159435760208301516040840151606085015160001a61593787828585615c70565b94509450505050615975565b82516040141561596d5760208301516040840151615962868383615d5d565b935093505050615975565b506000905060025b9250929050565b600081600481111561599057615990617103565b14156159995750565b60018160048111156159ad576159ad617103565b14156159fb5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c7f565b6002816004811115615a0f57615a0f617103565b1415615a5d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c7f565b6003816004811115615a7157615a71617103565b1415615aca5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c7f565b6004816004811115615ade57615ade617103565b141561108d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610c7f565b6001600160a01b03831673beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac01415615be25760405162387b1360e81b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063387b130090615bab90889088908790600401616f09565b600060405180830381600087803b158015615bc557600080fd5b505af1158015615bd9573d6000803e3d6000fd5b5050505061127f565b60405163c608c7f360e01b81526001600160a01b03858116600483015284811660248301526044820184905282811660648301527f0000000000000000000000000000000000000000000000000000000000000000169063c608c7f390608401600060405180830381600087803b158015615c5c57600080fd5b505af1158015611547573d6000803e3d6000fd5b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115615ca75750600090506003615d54565b8460ff16601b14158015615cbf57508460ff16601c14155b15615cd05750600090506004615d54565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015615d24573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116615d4d57600060019250925050615d54565b9150600090505b94509492505050565b6000806001600160ff1b03831681615d7a60ff86901c601b616eb6565b9050615d8887828885615c70565b935093505050935093915050565b60008083601f840112615da857600080fd5b5081356001600160401b03811115615dbf57600080fd5b6020830191508360208260051b850101111561597557600080fd5b60008060208385031215615ded57600080fd5b82356001600160401b03811115615e0357600080fd5b615e0f85828601615d96565b90969095509350505050565b6001600160a01b038116811461108d57600080fd5b8035615e3b81615e1b565b919050565b600080600080600060a08688031215615e5857600080fd5b8535615e6381615e1b565b94506020860135615e7381615e1b565b93506040860135615e8381615e1b565b94979396509394606081013594506080013592915050565b6020808252825182820181905260009190848201906040850190845b81811015615ed357835183529284019291840191600101615eb7565b50909695505050505050565b63ffffffff8116811461108d57600080fd5b8035615e3b81615edf565b600060208284031215615f0e57600080fd5b8135614b4881615edf565b600060208284031215615f2b57600080fd5b8135614b4881615e1b565b600080600060608486031215615f4b57600080fd5b8335615f5681615e1b565b92506020840135615f6681615e1b565b929592945050506040919091013590565b600060208284031215615f8957600080fd5b5035919050565b60008060008060408587031215615fa657600080fd5b84356001600160401b0380821115615fbd57600080fd5b615fc988838901615d96565b90965094506020870135915080821115615fe257600080fd5b50615fef87828801615d96565b95989497509550505050565b60008060008060008060008060c0898b03121561601757600080fd5b883561602281615e1b565b9750602089013561603281615e1b565b9650604089013595506060890135945060808901356001600160401b038082111561605c57600080fd5b6160688c838d01615d96565b909650945060a08b013591508082111561608157600080fd5b5061608e8b828c01615d96565b999c989b5096995094979396929594505050565b600080600080608085870312156160b857600080fd5b84356160c381615e1b565b935060208501356160d381615e1b565b93969395505050506040820135916060013590565b6000606082840312156160fa57600080fd5b50919050565b60008083601f84011261611257600080fd5b5081356001600160401b0381111561612957600080fd5b60208301915083602082850101111561597557600080fd5b60008060008060a0858703121561615757600080fd5b61616186866160e8565b9350606085013561617181615edf565b925060808501356001600160401b0381111561618c57600080fd5b615fef87828801616100565b600080604083850312156161ab57600080fd5b82356161b681615e1b565b915060208301356161c681615e1b565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b0381118282101715616209576162096161d1565b60405290565b604080519081016001600160401b0381118282101715616209576162096161d1565b604051601f8201601f191681016001600160401b0381118282101715616259576162596161d1565b604052919050565b60006001600160401b0382111561627a5761627a6161d1565b5060051b60200190565b600082601f83011261629557600080fd5b813560206162aa6162a583616261565b616231565b82815260059290921b840181019181810190868411156162c957600080fd5b8286015b848110156162ed5780356162e081615e1b565b83529183019183016162cd565b509695505050505050565b600082601f83011261630957600080fd5b813560206163196162a583616261565b82815260059290921b8401810191818101908684111561633857600080fd5b8286015b848110156162ed578035835291830191830161633c565b600060e0828403121561636557600080fd5b61636d6161e7565b905061637882615e30565b815261638660208301615e30565b602082015261639760408301615e30565b6040820152606082013560608201526163b260808301615ef1565b608082015260a08201356001600160401b03808211156163d157600080fd5b6163dd85838601616284565b60a084015260c08401359150808211156163f657600080fd5b50616403848285016162f8565b60c08301525092915050565b60006020828403121561642157600080fd5b81356001600160401b0381111561643757600080fd5b611a7684828501616353565b60006020828403121561645557600080fd5b813560ff81168114614b4857600080fd5b60006040828403121561647857600080fd5b61648061620f565b905081356001600160401b038082111561649957600080fd5b818401915084601f8301126164ad57600080fd5b81356020828211156164c1576164c16161d1565b6164d3601f8301601f19168201616231565b925081835286818386010111156164e957600080fd5b8181850182850137600081838501015282855280860135818601525050505092915050565b600080600080600060a0868803121561652657600080fd5b853561653181615e1b565b9450602086013561654181615e1b565b935060408601356001600160401b038082111561655d57600080fd5b61656989838a01616466565b9450606088013591508082111561657f57600080fd5b5061658c88828901616466565b95989497509295608001359392505050565b600080600080600080606087890312156165b757600080fd5b86356001600160401b03808211156165ce57600080fd5b6165da8a838b01615d96565b909850965060208901359150808211156165f357600080fd5b6165ff8a838b01615d96565b9096509450604089013591508082111561661857600080fd5b5061662589828a01615d96565b979a9699509497509295939492505050565b6000806020838503121561664a57600080fd5b82356001600160401b0381111561666057600080fd5b615e0f85828601616100565b6000806040838503121561667f57600080fd5b823561668a81615e1b565b946020939093013593505050565b600080600080608085870312156166ae57600080fd5b84356166b981615e1b565b93506020850135925060408501356166d081615e1b565b9396929550929360600135925050565b600081518084526020808501945080840160005b838110156167195781516001600160a01b0316875295820195908201906001016166f4565b509495945050505050565b600081518084526020808501945080840160005b8381101561671957815187529582019590820190600101616738565b60408152600061676760408301856166e0565b82810360208401526114058185616724565b801515811461108d57600080fd5b6000806000806060858703121561679d57600080fd5b84356001600160401b03808211156167b457600080fd5b9086019060e082890312156167c857600080fd5b909450602086013590808211156167de57600080fd5b506167eb87828801615d96565b90945092505060408501356167ff81616779565b939692955090935050565b60008060006060848603121561681f57600080fd5b833561682a81615e1b565b925060208401356001600160401b0381111561684557600080fd5b61685186828701616466565b925050604084013590509250925092565b60006060828403121561687457600080fd5b614b4883836160e8565b60008060006040848603121561689357600080fd5b833561689e81615e1b565b925060208401356001600160401b038111156168b957600080fd5b6168c586828701615d96565b9497909650939450505050565b602081526000614b486020830184616724565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415616925576169256168fb565b5060010190565b60208082526019908201527f5061757361626c653a20696e6465782069732070617573656400000000000000604082015260600190565b60008235605e1983360301811261697957600080fd5b9190910192915050565b6000808335601e1984360301811261699a57600080fd5b8301803591506001600160401b038211156169b457600080fd5b6020019150600581901b360382131561597557600080fd5b8183526000602080850194508260005b858110156167195781356169ef81615e1b565b6001600160a01b0316875295820195908201906001016169dc565b6001600160a01b038416815260406020820181905260009061140590830184866169cc565b80516001600160401b0381168114615e3b57600080fd5b60006020808385031215616a5957600080fd5b82516001600160401b03811115616a6f57600080fd5b8301601f81018513616a8057600080fd5b8051616a8e6162a582616261565b81815260059190911b82018301908381019087831115616aad57600080fd5b928401925b82841015616ad257616ac384616a2f565b82529284019290840190616ab2565b979650505050505050565b600060208284031215616aef57600080fd5b8151614b4881615e1b565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b60208082526037908201527f44656c65676174696f6e4d616e616765723a206f6e6c7953747261746567794d60408201527f616e616765724f72456967656e506f644d616e61676572000000000000000000606082015260800190565b600060208284031215616bb357600080fd5b614b4882616a2f565b600060208284031215616bce57600080fd5b8151614b4881616779565b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b606081018235616c3081615e1b565b6001600160a01b039081168352602084013590616c4c82615e1b565b1660208301526040830135616c6081615edf565b63ffffffff811660408401525092915050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600060018060a01b03808351168452806020840151166020850152806040840151166040850152506060820151606084015263ffffffff608083015116608084015260a082015160e060a0850152616cfd60e08501826166e0565b905060c083015184820360c08601526114058282616724565b602081526000614b486020830184616ca2565b6000823560de1983360301811261697957600080fd5b600060208284031215616d5157600080fd5b8135614b4881616779565b600082616d7957634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215616d9057600080fd5b5051919050565b600082601f830112616da857600080fd5b81516020616db86162a583616261565b82815260059290921b84018101918181019086841115616dd757600080fd5b8286015b848110156162ed5780518352918301918301616ddb565b60008060408385031215616e0557600080fd5b82516001600160401b0380821115616e1c57600080fd5b818501915085601f830112616e3057600080fd5b81516020616e406162a583616261565b82815260059290921b84018101918181019089841115616e5f57600080fd5b948201945b83861015616e86578551616e7781615e1b565b82529482019490820190616e64565b91880151919650909350505080821115616e9f57600080fd5b50616eac85828601616d97565b9150509250929050565b60008219821115616ec957616ec96168fb565b500190565b600082821015616ee057616ee06168fb565b500390565b6001600160a01b0383168152604060208201819052600090611a76908301846166e0565b6001600160a01b039384168152919092166020820152604081019190915260600190565b828152604060208201526000611a766040830184616ca2565b6000816000190483118215151615616f6057616f606168fb565b500290565b80546001600160a01b0319166001600160a01b0392909216919091179055565b8135616f9081615e1b565b616f9a8183616f65565b50600181016020830135616fad81615e1b565b616fb78183616f65565b506040830135616fc681615edf565b815463ffffffff60a01b191660a09190911b63ffffffff60a01b161790555050565b82815260006020604081840152835180604085015260005b8181101561701c57858101830151858201606001528201617000565b8181111561702e576000606083870101525b50601f01601f191692909201606001949350505050565b60006020828403121561705757600080fd5b81516001600160e01b031981168114614b4857600080fd5b60006119923683616353565b600063ffffffff80831681851680830382111561709a5761709a6168fb565b01949350505050565b6001600160a01b03851681526060602082018190526000906170c890830185876169cc565b905063ffffffff8316604083015295945050505050565b600080604083850312156170f257600080fd5b505080516020909101519092909150565b634e487b7160e01b600052602160045260246000fdfe44656c65676174696f6e4d616e616765722e5f72656d6f76655368617265734144656c65676174696f6e4d616e616765722e5f636f6d706c657465517565756544656c65676174696f6e4d616e616765722e5f73657453747261746567795769a2646970667358221220ba649443e45a93abe956d2562b7180994d60197a942bf86d641a4808199648da64736f6c634300080c0033", } // DelegationManagerABI is the input ABI used to generate the binding from. @@ -75,7 +81,7 @@ var DelegationManagerABI = DelegationManagerMetaData.ABI var DelegationManagerBin = DelegationManagerMetaData.Bin // DeployDelegationManager deploys a new Ethereum contract, binding an instance of DelegationManager to it. -func DeployDelegationManager(auth *bind.TransactOpts, backend bind.ContractBackend, _strategyManager common.Address, _slasher common.Address, _eigenPodManager common.Address) (common.Address, *types.Transaction, *DelegationManager, error) { +func DeployDelegationManager(auth *bind.TransactOpts, backend bind.ContractBackend, _strategyManager common.Address, _slasher common.Address, _eigenPodManager common.Address, _avsDirectory common.Address) (common.Address, *types.Transaction, *DelegationManager, error) { parsed, err := DelegationManagerMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -84,7 +90,7 @@ func DeployDelegationManager(auth *bind.TransactOpts, backend bind.ContractBacke return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DelegationManagerBin), backend, _strategyManager, _slasher, _eigenPodManager) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DelegationManagerBin), backend, _strategyManager, _slasher, _eigenPodManager, _avsDirectory) if err != nil { return common.Address{}, nil, nil, err } @@ -326,6 +332,37 @@ func (_DelegationManager *DelegationManagerCallerSession) MAXSTAKEROPTOUTWINDOWB return _DelegationManager.Contract.MAXSTAKEROPTOUTWINDOWBLOCKS(&_DelegationManager.CallOpts) } +// MAXWITHDRAWALDELAY is a free data retrieval call binding the contract method 0xa238f9df. +// +// Solidity: function MAX_WITHDRAWAL_DELAY() view returns(uint256) +func (_DelegationManager *DelegationManagerCaller) MAXWITHDRAWALDELAY(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DelegationManager.contract.Call(opts, &out, "MAX_WITHDRAWAL_DELAY") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MAXWITHDRAWALDELAY is a free data retrieval call binding the contract method 0xa238f9df. +// +// Solidity: function MAX_WITHDRAWAL_DELAY() view returns(uint256) +func (_DelegationManager *DelegationManagerSession) MAXWITHDRAWALDELAY() (*big.Int, error) { + return _DelegationManager.Contract.MAXWITHDRAWALDELAY(&_DelegationManager.CallOpts) +} + +// MAXWITHDRAWALDELAY is a free data retrieval call binding the contract method 0xa238f9df. +// +// Solidity: function MAX_WITHDRAWAL_DELAY() view returns(uint256) +func (_DelegationManager *DelegationManagerCallerSession) MAXWITHDRAWALDELAY() (*big.Int, error) { + return _DelegationManager.Contract.MAXWITHDRAWALDELAY(&_DelegationManager.CallOpts) +} + // MAXWITHDRAWALDELAYBLOCKS is a free data retrieval call binding the contract method 0xca661c04. // // Solidity: function MAX_WITHDRAWAL_DELAY_BLOCKS() view returns(uint256) @@ -388,6 +425,37 @@ func (_DelegationManager *DelegationManagerCallerSession) STAKERDELEGATIONTYPEHA return _DelegationManager.Contract.STAKERDELEGATIONTYPEHASH(&_DelegationManager.CallOpts) } +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_DelegationManager *DelegationManagerCaller) AvsDirectory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _DelegationManager.contract.Call(opts, &out, "avsDirectory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_DelegationManager *DelegationManagerSession) AvsDirectory() (common.Address, error) { + return _DelegationManager.Contract.AvsDirectory(&_DelegationManager.CallOpts) +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_DelegationManager *DelegationManagerCallerSession) AvsDirectory() (common.Address, error) { + return _DelegationManager.Contract.AvsDirectory(&_DelegationManager.CallOpts) +} + // BeaconChainETHStrategy is a free data retrieval call binding the contract method 0x9104c319. // // Solidity: function beaconChainETHStrategy() view returns(address) @@ -761,12 +829,12 @@ func (_DelegationManager *DelegationManagerCallerSession) GetDelegatableShares(s return _DelegationManager.Contract.GetDelegatableShares(&_DelegationManager.CallOpts, staker) } -// GetOperatorShares is a free data retrieval call binding the contract method 0x90041347. +// GetWithdrawableStakerShares is a free data retrieval call binding the contract method 0xf878776e. // -// Solidity: function getOperatorShares(address operator, address[] strategies) view returns(uint256[]) -func (_DelegationManager *DelegationManagerCaller) GetOperatorShares(opts *bind.CallOpts, operator common.Address, strategies []common.Address) ([]*big.Int, error) { +// Solidity: function getWithdrawableStakerShares(address staker, address[] strategies) view returns(uint256[] shares) +func (_DelegationManager *DelegationManagerCaller) GetWithdrawableStakerShares(opts *bind.CallOpts, staker common.Address, strategies []common.Address) ([]*big.Int, error) { var out []interface{} - err := _DelegationManager.contract.Call(opts, &out, "getOperatorShares", operator, strategies) + err := _DelegationManager.contract.Call(opts, &out, "getWithdrawableStakerShares", staker, strategies) if err != nil { return *new([]*big.Int), err @@ -778,18 +846,18 @@ func (_DelegationManager *DelegationManagerCaller) GetOperatorShares(opts *bind. } -// GetOperatorShares is a free data retrieval call binding the contract method 0x90041347. +// GetWithdrawableStakerShares is a free data retrieval call binding the contract method 0xf878776e. // -// Solidity: function getOperatorShares(address operator, address[] strategies) view returns(uint256[]) -func (_DelegationManager *DelegationManagerSession) GetOperatorShares(operator common.Address, strategies []common.Address) ([]*big.Int, error) { - return _DelegationManager.Contract.GetOperatorShares(&_DelegationManager.CallOpts, operator, strategies) +// Solidity: function getWithdrawableStakerShares(address staker, address[] strategies) view returns(uint256[] shares) +func (_DelegationManager *DelegationManagerSession) GetWithdrawableStakerShares(staker common.Address, strategies []common.Address) ([]*big.Int, error) { + return _DelegationManager.Contract.GetWithdrawableStakerShares(&_DelegationManager.CallOpts, staker, strategies) } -// GetOperatorShares is a free data retrieval call binding the contract method 0x90041347. +// GetWithdrawableStakerShares is a free data retrieval call binding the contract method 0xf878776e. // -// Solidity: function getOperatorShares(address operator, address[] strategies) view returns(uint256[]) -func (_DelegationManager *DelegationManagerCallerSession) GetOperatorShares(operator common.Address, strategies []common.Address) ([]*big.Int, error) { - return _DelegationManager.Contract.GetOperatorShares(&_DelegationManager.CallOpts, operator, strategies) +// Solidity: function getWithdrawableStakerShares(address staker, address[] strategies) view returns(uint256[] shares) +func (_DelegationManager *DelegationManagerCallerSession) GetWithdrawableStakerShares(staker common.Address, strategies []common.Address) ([]*big.Int, error) { + return _DelegationManager.Contract.GetWithdrawableStakerShares(&_DelegationManager.CallOpts, staker, strategies) } // GetWithdrawalDelay is a free data retrieval call binding the contract method 0x0449ca39. @@ -885,6 +953,37 @@ func (_DelegationManager *DelegationManagerCallerSession) IsOperator(operator co return _DelegationManager.Contract.IsOperator(&_DelegationManager.CallOpts, operator) } +// MinWithdrawalDelay is a free data retrieval call binding the contract method 0x0d5b0067. +// +// Solidity: function minWithdrawalDelay() view returns(uint256) +func (_DelegationManager *DelegationManagerCaller) MinWithdrawalDelay(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DelegationManager.contract.Call(opts, &out, "minWithdrawalDelay") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MinWithdrawalDelay is a free data retrieval call binding the contract method 0x0d5b0067. +// +// Solidity: function minWithdrawalDelay() view returns(uint256) +func (_DelegationManager *DelegationManagerSession) MinWithdrawalDelay() (*big.Int, error) { + return _DelegationManager.Contract.MinWithdrawalDelay(&_DelegationManager.CallOpts) +} + +// MinWithdrawalDelay is a free data retrieval call binding the contract method 0x0d5b0067. +// +// Solidity: function minWithdrawalDelay() view returns(uint256) +func (_DelegationManager *DelegationManagerCallerSession) MinWithdrawalDelay() (*big.Int, error) { + return _DelegationManager.Contract.MinWithdrawalDelay(&_DelegationManager.CallOpts) +} + // MinWithdrawalDelayBlocks is a free data retrieval call binding the contract method 0xc448feb8. // // Solidity: function minWithdrawalDelayBlocks() view returns(uint256) @@ -916,6 +1015,37 @@ func (_DelegationManager *DelegationManagerCallerSession) MinWithdrawalDelayBloc return _DelegationManager.Contract.MinWithdrawalDelayBlocks(&_DelegationManager.CallOpts) } +// OperatorAllocationDelay is a free data retrieval call binding the contract method 0x89829397. +// +// Solidity: function operatorAllocationDelay(address operator) view returns((bool,uint32)) +func (_DelegationManager *DelegationManagerCaller) OperatorAllocationDelay(opts *bind.CallOpts, operator common.Address) (IDelegationManagerAllocationDelayDetails, error) { + var out []interface{} + err := _DelegationManager.contract.Call(opts, &out, "operatorAllocationDelay", operator) + + if err != nil { + return *new(IDelegationManagerAllocationDelayDetails), err + } + + out0 := *abi.ConvertType(out[0], new(IDelegationManagerAllocationDelayDetails)).(*IDelegationManagerAllocationDelayDetails) + + return out0, err + +} + +// OperatorAllocationDelay is a free data retrieval call binding the contract method 0x89829397. +// +// Solidity: function operatorAllocationDelay(address operator) view returns((bool,uint32)) +func (_DelegationManager *DelegationManagerSession) OperatorAllocationDelay(operator common.Address) (IDelegationManagerAllocationDelayDetails, error) { + return _DelegationManager.Contract.OperatorAllocationDelay(&_DelegationManager.CallOpts, operator) +} + +// OperatorAllocationDelay is a free data retrieval call binding the contract method 0x89829397. +// +// Solidity: function operatorAllocationDelay(address operator) view returns((bool,uint32)) +func (_DelegationManager *DelegationManagerCallerSession) OperatorAllocationDelay(operator common.Address) (IDelegationManagerAllocationDelayDetails, error) { + return _DelegationManager.Contract.OperatorAllocationDelay(&_DelegationManager.CallOpts, operator) +} + // OperatorDetails is a free data retrieval call binding the contract method 0xc5e480db. // // Solidity: function operatorDetails(address operator) view returns((address,address,uint32)) @@ -947,12 +1077,43 @@ func (_DelegationManager *DelegationManagerCallerSession) OperatorDetails(operat return _DelegationManager.Contract.OperatorDetails(&_DelegationManager.CallOpts, operator) } +// OperatorScaledShares is a free data retrieval call binding the contract method 0x9fb4ee32. +// +// Solidity: function operatorScaledShares(address , address ) view returns(uint256) +func (_DelegationManager *DelegationManagerCaller) OperatorScaledShares(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _DelegationManager.contract.Call(opts, &out, "operatorScaledShares", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// OperatorScaledShares is a free data retrieval call binding the contract method 0x9fb4ee32. +// +// Solidity: function operatorScaledShares(address , address ) view returns(uint256) +func (_DelegationManager *DelegationManagerSession) OperatorScaledShares(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelegationManager.Contract.OperatorScaledShares(&_DelegationManager.CallOpts, arg0, arg1) +} + +// OperatorScaledShares is a free data retrieval call binding the contract method 0x9fb4ee32. +// +// Solidity: function operatorScaledShares(address , address ) view returns(uint256) +func (_DelegationManager *DelegationManagerCallerSession) OperatorScaledShares(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelegationManager.Contract.OperatorScaledShares(&_DelegationManager.CallOpts, arg0, arg1) +} + // OperatorShares is a free data retrieval call binding the contract method 0x778e55f3. // -// Solidity: function operatorShares(address , address ) view returns(uint256) -func (_DelegationManager *DelegationManagerCaller) OperatorShares(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { +// Solidity: function operatorShares(address operator, address strategy) view returns(uint256) +func (_DelegationManager *DelegationManagerCaller) OperatorShares(opts *bind.CallOpts, operator common.Address, strategy common.Address) (*big.Int, error) { var out []interface{} - err := _DelegationManager.contract.Call(opts, &out, "operatorShares", arg0, arg1) + err := _DelegationManager.contract.Call(opts, &out, "operatorShares", operator, strategy) if err != nil { return *new(*big.Int), err @@ -966,16 +1127,16 @@ func (_DelegationManager *DelegationManagerCaller) OperatorShares(opts *bind.Cal // OperatorShares is a free data retrieval call binding the contract method 0x778e55f3. // -// Solidity: function operatorShares(address , address ) view returns(uint256) -func (_DelegationManager *DelegationManagerSession) OperatorShares(arg0 common.Address, arg1 common.Address) (*big.Int, error) { - return _DelegationManager.Contract.OperatorShares(&_DelegationManager.CallOpts, arg0, arg1) +// Solidity: function operatorShares(address operator, address strategy) view returns(uint256) +func (_DelegationManager *DelegationManagerSession) OperatorShares(operator common.Address, strategy common.Address) (*big.Int, error) { + return _DelegationManager.Contract.OperatorShares(&_DelegationManager.CallOpts, operator, strategy) } // OperatorShares is a free data retrieval call binding the contract method 0x778e55f3. // -// Solidity: function operatorShares(address , address ) view returns(uint256) -func (_DelegationManager *DelegationManagerCallerSession) OperatorShares(arg0 common.Address, arg1 common.Address) (*big.Int, error) { - return _DelegationManager.Contract.OperatorShares(&_DelegationManager.CallOpts, arg0, arg1) +// Solidity: function operatorShares(address operator, address strategy) view returns(uint256) +func (_DelegationManager *DelegationManagerCallerSession) OperatorShares(operator common.Address, strategy common.Address) (*big.Int, error) { + return _DelegationManager.Contract.OperatorShares(&_DelegationManager.CallOpts, operator, strategy) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. @@ -1226,6 +1387,37 @@ func (_DelegationManager *DelegationManagerCallerSession) StakerOptOutWindowBloc return _DelegationManager.Contract.StakerOptOutWindowBlocks(&_DelegationManager.CallOpts, operator) } +// StakerScalingFactors is a free data retrieval call binding the contract method 0x51260e23. +// +// Solidity: function stakerScalingFactors(address , address ) view returns(uint256) +func (_DelegationManager *DelegationManagerCaller) StakerScalingFactors(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _DelegationManager.contract.Call(opts, &out, "stakerScalingFactors", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StakerScalingFactors is a free data retrieval call binding the contract method 0x51260e23. +// +// Solidity: function stakerScalingFactors(address , address ) view returns(uint256) +func (_DelegationManager *DelegationManagerSession) StakerScalingFactors(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelegationManager.Contract.StakerScalingFactors(&_DelegationManager.CallOpts, arg0, arg1) +} + +// StakerScalingFactors is a free data retrieval call binding the contract method 0x51260e23. +// +// Solidity: function stakerScalingFactors(address , address ) view returns(uint256) +func (_DelegationManager *DelegationManagerCallerSession) StakerScalingFactors(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelegationManager.Contract.StakerScalingFactors(&_DelegationManager.CallOpts, arg0, arg1) +} + // StrategyManager is a free data retrieval call binding the contract method 0x39b70e38. // // Solidity: function strategyManager() view returns(address) @@ -1288,67 +1480,98 @@ func (_DelegationManager *DelegationManagerCallerSession) StrategyWithdrawalDela return _DelegationManager.Contract.StrategyWithdrawalDelayBlocks(&_DelegationManager.CallOpts, arg0) } -// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0x60d7faed. +// StrategyWithdrawalDelays is a free data retrieval call binding the contract method 0x50739be3. +// +// Solidity: function strategyWithdrawalDelays(address ) view returns(uint256) +func (_DelegationManager *DelegationManagerCaller) StrategyWithdrawalDelays(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _DelegationManager.contract.Call(opts, &out, "strategyWithdrawalDelays", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StrategyWithdrawalDelays is a free data retrieval call binding the contract method 0x50739be3. // -// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) returns() -func (_DelegationManager *DelegationManagerTransactor) CompleteQueuedWithdrawal(opts *bind.TransactOpts, withdrawal IDelegationManagerWithdrawal, tokens []common.Address, middlewareTimesIndex *big.Int, receiveAsTokens bool) (*types.Transaction, error) { - return _DelegationManager.contract.Transact(opts, "completeQueuedWithdrawal", withdrawal, tokens, middlewareTimesIndex, receiveAsTokens) +// Solidity: function strategyWithdrawalDelays(address ) view returns(uint256) +func (_DelegationManager *DelegationManagerSession) StrategyWithdrawalDelays(arg0 common.Address) (*big.Int, error) { + return _DelegationManager.Contract.StrategyWithdrawalDelays(&_DelegationManager.CallOpts, arg0) } -// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0x60d7faed. +// StrategyWithdrawalDelays is a free data retrieval call binding the contract method 0x50739be3. // -// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) returns() -func (_DelegationManager *DelegationManagerSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, middlewareTimesIndex *big.Int, receiveAsTokens bool) (*types.Transaction, error) { - return _DelegationManager.Contract.CompleteQueuedWithdrawal(&_DelegationManager.TransactOpts, withdrawal, tokens, middlewareTimesIndex, receiveAsTokens) +// Solidity: function strategyWithdrawalDelays(address ) view returns(uint256) +func (_DelegationManager *DelegationManagerCallerSession) StrategyWithdrawalDelays(arg0 common.Address) (*big.Int, error) { + return _DelegationManager.Contract.StrategyWithdrawalDelays(&_DelegationManager.CallOpts, arg0) } -// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0x60d7faed. +// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0xe4cc3f90. // -// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) returns() -func (_DelegationManager *DelegationManagerTransactorSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, middlewareTimesIndex *big.Int, receiveAsTokens bool) (*types.Transaction, error) { - return _DelegationManager.Contract.CompleteQueuedWithdrawal(&_DelegationManager.TransactOpts, withdrawal, tokens, middlewareTimesIndex, receiveAsTokens) +// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, bool receiveAsTokens) returns() +func (_DelegationManager *DelegationManagerTransactor) CompleteQueuedWithdrawal(opts *bind.TransactOpts, withdrawal IDelegationManagerWithdrawal, tokens []common.Address, receiveAsTokens bool) (*types.Transaction, error) { + return _DelegationManager.contract.Transact(opts, "completeQueuedWithdrawal", withdrawal, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x33404396. +// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0xe4cc3f90. // -// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) returns() -func (_DelegationManager *DelegationManagerTransactor) CompleteQueuedWithdrawals(opts *bind.TransactOpts, withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, middlewareTimesIndexes []*big.Int, receiveAsTokens []bool) (*types.Transaction, error) { - return _DelegationManager.contract.Transact(opts, "completeQueuedWithdrawals", withdrawals, tokens, middlewareTimesIndexes, receiveAsTokens) +// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, bool receiveAsTokens) returns() +func (_DelegationManager *DelegationManagerSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, receiveAsTokens bool) (*types.Transaction, error) { + return _DelegationManager.Contract.CompleteQueuedWithdrawal(&_DelegationManager.TransactOpts, withdrawal, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x33404396. +// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0xe4cc3f90. // -// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) returns() -func (_DelegationManager *DelegationManagerSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, middlewareTimesIndexes []*big.Int, receiveAsTokens []bool) (*types.Transaction, error) { - return _DelegationManager.Contract.CompleteQueuedWithdrawals(&_DelegationManager.TransactOpts, withdrawals, tokens, middlewareTimesIndexes, receiveAsTokens) +// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, bool receiveAsTokens) returns() +func (_DelegationManager *DelegationManagerTransactorSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, receiveAsTokens bool) (*types.Transaction, error) { + return _DelegationManager.Contract.CompleteQueuedWithdrawal(&_DelegationManager.TransactOpts, withdrawal, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x33404396. +// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x9435bb43. // -// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) returns() -func (_DelegationManager *DelegationManagerTransactorSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, middlewareTimesIndexes []*big.Int, receiveAsTokens []bool) (*types.Transaction, error) { - return _DelegationManager.Contract.CompleteQueuedWithdrawals(&_DelegationManager.TransactOpts, withdrawals, tokens, middlewareTimesIndexes, receiveAsTokens) +// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, bool[] receiveAsTokens) returns() +func (_DelegationManager *DelegationManagerTransactor) CompleteQueuedWithdrawals(opts *bind.TransactOpts, withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, receiveAsTokens []bool) (*types.Transaction, error) { + return _DelegationManager.contract.Transact(opts, "completeQueuedWithdrawals", withdrawals, tokens, receiveAsTokens) +} + +// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x9435bb43. +// +// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, bool[] receiveAsTokens) returns() +func (_DelegationManager *DelegationManagerSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, receiveAsTokens []bool) (*types.Transaction, error) { + return _DelegationManager.Contract.CompleteQueuedWithdrawals(&_DelegationManager.TransactOpts, withdrawals, tokens, receiveAsTokens) +} + +// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x9435bb43. +// +// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, bool[] receiveAsTokens) returns() +func (_DelegationManager *DelegationManagerTransactorSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, receiveAsTokens []bool) (*types.Transaction, error) { + return _DelegationManager.Contract.CompleteQueuedWithdrawals(&_DelegationManager.TransactOpts, withdrawals, tokens, receiveAsTokens) } // DecreaseDelegatedShares is a paid mutator transaction binding the contract method 0x132d4967. // -// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManager *DelegationManagerTransactor) DecreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManager.contract.Transact(opts, "decreaseDelegatedShares", staker, strategy, shares) +// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 removedShares) returns() +func (_DelegationManager *DelegationManagerTransactor) DecreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, removedShares *big.Int) (*types.Transaction, error) { + return _DelegationManager.contract.Transact(opts, "decreaseDelegatedShares", staker, strategy, removedShares) } // DecreaseDelegatedShares is a paid mutator transaction binding the contract method 0x132d4967. // -// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManager *DelegationManagerSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManager.Contract.DecreaseDelegatedShares(&_DelegationManager.TransactOpts, staker, strategy, shares) +// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 removedShares) returns() +func (_DelegationManager *DelegationManagerSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, removedShares *big.Int) (*types.Transaction, error) { + return _DelegationManager.Contract.DecreaseDelegatedShares(&_DelegationManager.TransactOpts, staker, strategy, removedShares) } // DecreaseDelegatedShares is a paid mutator transaction binding the contract method 0x132d4967. // -// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManager *DelegationManagerTransactorSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManager.Contract.DecreaseDelegatedShares(&_DelegationManager.TransactOpts, staker, strategy, shares) +// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 removedShares) returns() +func (_DelegationManager *DelegationManagerTransactorSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, removedShares *big.Int) (*types.Transaction, error) { + return _DelegationManager.Contract.DecreaseDelegatedShares(&_DelegationManager.TransactOpts, staker, strategy, removedShares) } // DelegateTo is a paid mutator transaction binding the contract method 0xeea9064b. @@ -1393,25 +1616,25 @@ func (_DelegationManager *DelegationManagerTransactorSession) DelegateToBySignat return _DelegationManager.Contract.DelegateToBySignature(&_DelegationManager.TransactOpts, staker, operator, stakerSignatureAndExpiry, approverSignatureAndExpiry, approverSalt) } -// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x28a573ae. +// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x3c651cf2. // -// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManager *DelegationManagerTransactor) IncreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManager.contract.Transact(opts, "increaseDelegatedShares", staker, strategy, shares) +// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 existingShares, uint256 addedShares) returns() +func (_DelegationManager *DelegationManagerTransactor) IncreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, existingShares *big.Int, addedShares *big.Int) (*types.Transaction, error) { + return _DelegationManager.contract.Transact(opts, "increaseDelegatedShares", staker, strategy, existingShares, addedShares) } -// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x28a573ae. +// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x3c651cf2. // -// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManager *DelegationManagerSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManager.Contract.IncreaseDelegatedShares(&_DelegationManager.TransactOpts, staker, strategy, shares) +// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 existingShares, uint256 addedShares) returns() +func (_DelegationManager *DelegationManagerSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, existingShares *big.Int, addedShares *big.Int) (*types.Transaction, error) { + return _DelegationManager.Contract.IncreaseDelegatedShares(&_DelegationManager.TransactOpts, staker, strategy, existingShares, addedShares) } -// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x28a573ae. +// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x3c651cf2. // -// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManager *DelegationManagerTransactorSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManager.Contract.IncreaseDelegatedShares(&_DelegationManager.TransactOpts, staker, strategy, shares) +// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 existingShares, uint256 addedShares) returns() +func (_DelegationManager *DelegationManagerTransactorSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, existingShares *big.Int, addedShares *big.Int) (*types.Transaction, error) { + return _DelegationManager.Contract.IncreaseDelegatedShares(&_DelegationManager.TransactOpts, staker, strategy, existingShares, addedShares) } // Initialize is a paid mutator transaction binding the contract method 0x22bf40e4. @@ -1435,6 +1658,27 @@ func (_DelegationManager *DelegationManagerTransactorSession) Initialize(initial return _DelegationManager.Contract.Initialize(&_DelegationManager.TransactOpts, initialOwner, _pauserRegistry, initialPausedStatus, _minWithdrawalDelayBlocks, _strategies, _withdrawalDelayBlocks) } +// InitializeAllocationDelay is a paid mutator transaction binding the contract method 0x0de5495d. +// +// Solidity: function initializeAllocationDelay(uint32 delay) returns() +func (_DelegationManager *DelegationManagerTransactor) InitializeAllocationDelay(opts *bind.TransactOpts, delay uint32) (*types.Transaction, error) { + return _DelegationManager.contract.Transact(opts, "initializeAllocationDelay", delay) +} + +// InitializeAllocationDelay is a paid mutator transaction binding the contract method 0x0de5495d. +// +// Solidity: function initializeAllocationDelay(uint32 delay) returns() +func (_DelegationManager *DelegationManagerSession) InitializeAllocationDelay(delay uint32) (*types.Transaction, error) { + return _DelegationManager.Contract.InitializeAllocationDelay(&_DelegationManager.TransactOpts, delay) +} + +// InitializeAllocationDelay is a paid mutator transaction binding the contract method 0x0de5495d. +// +// Solidity: function initializeAllocationDelay(uint32 delay) returns() +func (_DelegationManager *DelegationManagerTransactorSession) InitializeAllocationDelay(delay uint32) (*types.Transaction, error) { + return _DelegationManager.Contract.InitializeAllocationDelay(&_DelegationManager.TransactOpts, delay) +} + // ModifyOperatorDetails is a paid mutator transaction binding the contract method 0xf16172b0. // // Solidity: function modifyOperatorDetails((address,address,uint32) newOperatorDetails) returns() @@ -1519,25 +1763,25 @@ func (_DelegationManager *DelegationManagerTransactorSession) QueueWithdrawals(q return _DelegationManager.Contract.QueueWithdrawals(&_DelegationManager.TransactOpts, queuedWithdrawalParams) } -// RegisterAsOperator is a paid mutator transaction binding the contract method 0x0f589e59. +// RegisterAsOperator is a paid mutator transaction binding the contract method 0x49730060. // -// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, string metadataURI) returns() -func (_DelegationManager *DelegationManagerTransactor) RegisterAsOperator(opts *bind.TransactOpts, registeringOperatorDetails IDelegationManagerOperatorDetails, metadataURI string) (*types.Transaction, error) { - return _DelegationManager.contract.Transact(opts, "registerAsOperator", registeringOperatorDetails, metadataURI) +// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, uint32 allocationDelay, string metadataURI) returns() +func (_DelegationManager *DelegationManagerTransactor) RegisterAsOperator(opts *bind.TransactOpts, registeringOperatorDetails IDelegationManagerOperatorDetails, allocationDelay uint32, metadataURI string) (*types.Transaction, error) { + return _DelegationManager.contract.Transact(opts, "registerAsOperator", registeringOperatorDetails, allocationDelay, metadataURI) } -// RegisterAsOperator is a paid mutator transaction binding the contract method 0x0f589e59. +// RegisterAsOperator is a paid mutator transaction binding the contract method 0x49730060. // -// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, string metadataURI) returns() -func (_DelegationManager *DelegationManagerSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, metadataURI string) (*types.Transaction, error) { - return _DelegationManager.Contract.RegisterAsOperator(&_DelegationManager.TransactOpts, registeringOperatorDetails, metadataURI) +// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, uint32 allocationDelay, string metadataURI) returns() +func (_DelegationManager *DelegationManagerSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, allocationDelay uint32, metadataURI string) (*types.Transaction, error) { + return _DelegationManager.Contract.RegisterAsOperator(&_DelegationManager.TransactOpts, registeringOperatorDetails, allocationDelay, metadataURI) } -// RegisterAsOperator is a paid mutator transaction binding the contract method 0x0f589e59. +// RegisterAsOperator is a paid mutator transaction binding the contract method 0x49730060. // -// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, string metadataURI) returns() -func (_DelegationManager *DelegationManagerTransactorSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, metadataURI string) (*types.Transaction, error) { - return _DelegationManager.Contract.RegisterAsOperator(&_DelegationManager.TransactOpts, registeringOperatorDetails, metadataURI) +// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, uint32 allocationDelay, string metadataURI) returns() +func (_DelegationManager *DelegationManagerTransactorSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, allocationDelay uint32, metadataURI string) (*types.Transaction, error) { + return _DelegationManager.Contract.RegisterAsOperator(&_DelegationManager.TransactOpts, registeringOperatorDetails, allocationDelay, metadataURI) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -1603,6 +1847,27 @@ func (_DelegationManager *DelegationManagerTransactorSession) SetPauserRegistry( return _DelegationManager.Contract.SetPauserRegistry(&_DelegationManager.TransactOpts, newPauserRegistry) } +// SetStrategyWithdrawalDelay is a paid mutator transaction binding the contract method 0x65187810. +// +// Solidity: function setStrategyWithdrawalDelay(address[] strategies, uint256[] withdrawalDelays) returns() +func (_DelegationManager *DelegationManagerTransactor) SetStrategyWithdrawalDelay(opts *bind.TransactOpts, strategies []common.Address, withdrawalDelays []*big.Int) (*types.Transaction, error) { + return _DelegationManager.contract.Transact(opts, "setStrategyWithdrawalDelay", strategies, withdrawalDelays) +} + +// SetStrategyWithdrawalDelay is a paid mutator transaction binding the contract method 0x65187810. +// +// Solidity: function setStrategyWithdrawalDelay(address[] strategies, uint256[] withdrawalDelays) returns() +func (_DelegationManager *DelegationManagerSession) SetStrategyWithdrawalDelay(strategies []common.Address, withdrawalDelays []*big.Int) (*types.Transaction, error) { + return _DelegationManager.Contract.SetStrategyWithdrawalDelay(&_DelegationManager.TransactOpts, strategies, withdrawalDelays) +} + +// SetStrategyWithdrawalDelay is a paid mutator transaction binding the contract method 0x65187810. +// +// Solidity: function setStrategyWithdrawalDelay(address[] strategies, uint256[] withdrawalDelays) returns() +func (_DelegationManager *DelegationManagerTransactorSession) SetStrategyWithdrawalDelay(strategies []common.Address, withdrawalDelays []*big.Int) (*types.Transaction, error) { + return _DelegationManager.Contract.SetStrategyWithdrawalDelay(&_DelegationManager.TransactOpts, strategies, withdrawalDelays) +} + // SetStrategyWithdrawalDelayBlocks is a paid mutator transaction binding the contract method 0x1522bf02. // // Solidity: function setStrategyWithdrawalDelayBlocks(address[] strategies, uint256[] withdrawalDelayBlocks) returns() @@ -3734,6 +3999,142 @@ func (_DelegationManager *DelegationManagerFilterer) ParseStrategyWithdrawalDela return event, nil } +// DelegationManagerStrategyWithdrawalDelaySetIterator is returned from FilterStrategyWithdrawalDelaySet and is used to iterate over the raw logs and unpacked data for StrategyWithdrawalDelaySet events raised by the DelegationManager contract. +type DelegationManagerStrategyWithdrawalDelaySetIterator struct { + Event *DelegationManagerStrategyWithdrawalDelaySet // 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 *DelegationManagerStrategyWithdrawalDelaySetIterator) 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(DelegationManagerStrategyWithdrawalDelaySet) + 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(DelegationManagerStrategyWithdrawalDelaySet) + 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 *DelegationManagerStrategyWithdrawalDelaySetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelegationManagerStrategyWithdrawalDelaySetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelegationManagerStrategyWithdrawalDelaySet represents a StrategyWithdrawalDelaySet event raised by the DelegationManager contract. +type DelegationManagerStrategyWithdrawalDelaySet struct { + Strategy common.Address + PreviousValue *big.Int + NewValue *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStrategyWithdrawalDelaySet is a free log retrieval operation binding the contract event 0x4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e5. +// +// Solidity: event StrategyWithdrawalDelaySet(address strategy, uint256 previousValue, uint256 newValue) +func (_DelegationManager *DelegationManagerFilterer) FilterStrategyWithdrawalDelaySet(opts *bind.FilterOpts) (*DelegationManagerStrategyWithdrawalDelaySetIterator, error) { + + logs, sub, err := _DelegationManager.contract.FilterLogs(opts, "StrategyWithdrawalDelaySet") + if err != nil { + return nil, err + } + return &DelegationManagerStrategyWithdrawalDelaySetIterator{contract: _DelegationManager.contract, event: "StrategyWithdrawalDelaySet", logs: logs, sub: sub}, nil +} + +// WatchStrategyWithdrawalDelaySet is a free log subscription operation binding the contract event 0x4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e5. +// +// Solidity: event StrategyWithdrawalDelaySet(address strategy, uint256 previousValue, uint256 newValue) +func (_DelegationManager *DelegationManagerFilterer) WatchStrategyWithdrawalDelaySet(opts *bind.WatchOpts, sink chan<- *DelegationManagerStrategyWithdrawalDelaySet) (event.Subscription, error) { + + logs, sub, err := _DelegationManager.contract.WatchLogs(opts, "StrategyWithdrawalDelaySet") + 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(DelegationManagerStrategyWithdrawalDelaySet) + if err := _DelegationManager.contract.UnpackLog(event, "StrategyWithdrawalDelaySet", 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 +} + +// ParseStrategyWithdrawalDelaySet is a log parse operation binding the contract event 0x4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e5. +// +// Solidity: event StrategyWithdrawalDelaySet(address strategy, uint256 previousValue, uint256 newValue) +func (_DelegationManager *DelegationManagerFilterer) ParseStrategyWithdrawalDelaySet(log types.Log) (*DelegationManagerStrategyWithdrawalDelaySet, error) { + event := new(DelegationManagerStrategyWithdrawalDelaySet) + if err := _DelegationManager.contract.UnpackLog(event, "StrategyWithdrawalDelaySet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // DelegationManagerUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the DelegationManager contract. type DelegationManagerUnpausedIterator struct { Event *DelegationManagerUnpaused // Event containing the contract specifics and raw log diff --git a/pkg/bindings/DelegationManagerStorage/binding.go b/pkg/bindings/DelegationManagerStorage/binding.go index 3930e4310..529f8f7ec 100644 --- a/pkg/bindings/DelegationManagerStorage/binding.go +++ b/pkg/bindings/DelegationManagerStorage/binding.go @@ -29,6 +29,12 @@ var ( _ = abi.ConvertType ) +// IDelegationManagerAllocationDelayDetails is an auto generated low-level Go binding around an user-defined struct. +type IDelegationManagerAllocationDelayDetails struct { + IsSet bool + AllocationDelay uint32 +} + // IDelegationManagerOperatorDetails is an auto generated low-level Go binding around an user-defined struct. type IDelegationManagerOperatorDetails struct { DeprecatedEarningsReceiver common.Address @@ -45,13 +51,13 @@ type IDelegationManagerQueuedWithdrawalParams struct { // IDelegationManagerWithdrawal is an auto generated low-level Go binding around an user-defined struct. type IDelegationManagerWithdrawal struct { - Staker common.Address - DelegatedTo common.Address - Withdrawer common.Address - Nonce *big.Int - StartBlock uint32 - Strategies []common.Address - Shares []*big.Int + Staker common.Address + DelegatedTo common.Address + Withdrawer common.Address + Nonce *big.Int + StartTimestamp uint32 + Strategies []common.Address + ScaledShares []*big.Int } // ISignatureUtilsSignatureWithExpiry is an auto generated low-level Go binding around an user-defined struct. @@ -62,7 +68,7 @@ type ISignatureUtilsSignatureWithExpiry struct { // DelegationManagerStorageMetaData contains all meta data concerning the DelegationManagerStorage contract. var DelegationManagerStorageMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"DELEGATION_APPROVAL_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\":\"MAX_WITHDRAWAL_DELAY_BLOCKS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"STAKER_DELEGATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateCurrentStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateDelegationApprovalDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_stakerNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateWithdrawalRoot\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"middlewareTimesIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawals\",\"inputs\":[{\"name\":\"withdrawals\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.Withdrawal[]\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[][]\",\"internalType\":\"contractIERC20[][]\"},{\"name\":\"middlewareTimesIndexes\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool[]\",\"internalType\":\"bool[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeWithdrawalsQueued\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseDelegatedShares\",\"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\":\"delegateTo\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateToBySignature\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegatedTo\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApprover\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApproverSaltIsSpent\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorShares\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWithdrawalDelay\",\"inputs\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseDelegatedShares\",\"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\":\"isDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minWithdrawalDelayBlocks\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"modifyOperatorDetails\",\"inputs\":[{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorDetails\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pendingWithdrawals\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"queueWithdrawals\",\"inputs\":[{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerAsOperator\",\"inputs\":[{\"name\":\"registeringOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerNonce\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerOptOutWindowBlocks\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"undelegate\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOperatorMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"MinWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorDetailsModified\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorMetadataURIUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRegistered\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesDecreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesIncreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerForceUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalCompleted\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalQueued\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"withdrawal\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false}]", + ABI: "[{\"type\":\"function\",\"name\":\"DELEGATION_APPROVAL_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\":\"STAKER_DELEGATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"avsDirectory\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIAVSDirectory\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateCurrentStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateDelegationApprovalDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_stakerNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateWithdrawalRoot\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawals\",\"inputs\":[{\"name\":\"withdrawals\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.Withdrawal[]\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[][]\",\"internalType\":\"contractIERC20[][]\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool[]\",\"internalType\":\"bool[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeWithdrawalsQueued\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseDelegatedShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"removedShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateTo\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateToBySignature\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegatedTo\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApprover\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApproverSaltIsSpent\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWithdrawalDelay\",\"inputs\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseDelegatedShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"existingShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"addedShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeAllocationDelay\",\"inputs\":[{\"name\":\"delay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minWithdrawalDelay\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minWithdrawalDelayBlocks\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"modifyOperatorDetails\",\"inputs\":[{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorAllocationDelay\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.AllocationDelayDetails\",\"components\":[{\"name\":\"isSet\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"allocationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorDetails\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorScaledShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pendingWithdrawals\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"queueWithdrawals\",\"inputs\":[{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerAsOperator\",\"inputs\":[{\"name\":\"registeringOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"allocationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerNonce\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerOptOutWindowBlocks\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerScalingFactors\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWithdrawalDelays\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"undelegate\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOperatorMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"MinWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorDetailsModified\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorMetadataURIUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRegistered\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesDecreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesIncreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerForceUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWithdrawalDelaySet\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalCompleted\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalQueued\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"withdrawal\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false}]", } // DelegationManagerStorageABI is the input ABI used to generate the binding from. @@ -273,66 +279,66 @@ func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) DOMAINTY return _DelegationManagerStorage.Contract.DOMAINTYPEHASH(&_DelegationManagerStorage.CallOpts) } -// MAXWITHDRAWALDELAYBLOCKS is a free data retrieval call binding the contract method 0xca661c04. +// STAKERDELEGATIONTYPEHASH is a free data retrieval call binding the contract method 0x43377382. // -// Solidity: function MAX_WITHDRAWAL_DELAY_BLOCKS() view returns(uint256) -func (_DelegationManagerStorage *DelegationManagerStorageCaller) MAXWITHDRAWALDELAYBLOCKS(opts *bind.CallOpts) (*big.Int, error) { +// Solidity: function STAKER_DELEGATION_TYPEHASH() view returns(bytes32) +func (_DelegationManagerStorage *DelegationManagerStorageCaller) STAKERDELEGATIONTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} - err := _DelegationManagerStorage.contract.Call(opts, &out, "MAX_WITHDRAWAL_DELAY_BLOCKS") + err := _DelegationManagerStorage.contract.Call(opts, &out, "STAKER_DELEGATION_TYPEHASH") if err != nil { - return *new(*big.Int), err + return *new([32]byte), err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } -// MAXWITHDRAWALDELAYBLOCKS is a free data retrieval call binding the contract method 0xca661c04. +// STAKERDELEGATIONTYPEHASH is a free data retrieval call binding the contract method 0x43377382. // -// Solidity: function MAX_WITHDRAWAL_DELAY_BLOCKS() view returns(uint256) -func (_DelegationManagerStorage *DelegationManagerStorageSession) MAXWITHDRAWALDELAYBLOCKS() (*big.Int, error) { - return _DelegationManagerStorage.Contract.MAXWITHDRAWALDELAYBLOCKS(&_DelegationManagerStorage.CallOpts) +// Solidity: function STAKER_DELEGATION_TYPEHASH() view returns(bytes32) +func (_DelegationManagerStorage *DelegationManagerStorageSession) STAKERDELEGATIONTYPEHASH() ([32]byte, error) { + return _DelegationManagerStorage.Contract.STAKERDELEGATIONTYPEHASH(&_DelegationManagerStorage.CallOpts) } -// MAXWITHDRAWALDELAYBLOCKS is a free data retrieval call binding the contract method 0xca661c04. +// STAKERDELEGATIONTYPEHASH is a free data retrieval call binding the contract method 0x43377382. // -// Solidity: function MAX_WITHDRAWAL_DELAY_BLOCKS() view returns(uint256) -func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) MAXWITHDRAWALDELAYBLOCKS() (*big.Int, error) { - return _DelegationManagerStorage.Contract.MAXWITHDRAWALDELAYBLOCKS(&_DelegationManagerStorage.CallOpts) +// Solidity: function STAKER_DELEGATION_TYPEHASH() view returns(bytes32) +func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) STAKERDELEGATIONTYPEHASH() ([32]byte, error) { + return _DelegationManagerStorage.Contract.STAKERDELEGATIONTYPEHASH(&_DelegationManagerStorage.CallOpts) } -// STAKERDELEGATIONTYPEHASH is a free data retrieval call binding the contract method 0x43377382. +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. // -// Solidity: function STAKER_DELEGATION_TYPEHASH() view returns(bytes32) -func (_DelegationManagerStorage *DelegationManagerStorageCaller) STAKERDELEGATIONTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { +// Solidity: function avsDirectory() view returns(address) +func (_DelegationManagerStorage *DelegationManagerStorageCaller) AvsDirectory(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _DelegationManagerStorage.contract.Call(opts, &out, "STAKER_DELEGATION_TYPEHASH") + err := _DelegationManagerStorage.contract.Call(opts, &out, "avsDirectory") if err != nil { - return *new([32]byte), err + return *new(common.Address), err } - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } -// STAKERDELEGATIONTYPEHASH is a free data retrieval call binding the contract method 0x43377382. +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. // -// Solidity: function STAKER_DELEGATION_TYPEHASH() view returns(bytes32) -func (_DelegationManagerStorage *DelegationManagerStorageSession) STAKERDELEGATIONTYPEHASH() ([32]byte, error) { - return _DelegationManagerStorage.Contract.STAKERDELEGATIONTYPEHASH(&_DelegationManagerStorage.CallOpts) +// Solidity: function avsDirectory() view returns(address) +func (_DelegationManagerStorage *DelegationManagerStorageSession) AvsDirectory() (common.Address, error) { + return _DelegationManagerStorage.Contract.AvsDirectory(&_DelegationManagerStorage.CallOpts) } -// STAKERDELEGATIONTYPEHASH is a free data retrieval call binding the contract method 0x43377382. +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. // -// Solidity: function STAKER_DELEGATION_TYPEHASH() view returns(bytes32) -func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) STAKERDELEGATIONTYPEHASH() ([32]byte, error) { - return _DelegationManagerStorage.Contract.STAKERDELEGATIONTYPEHASH(&_DelegationManagerStorage.CallOpts) +// Solidity: function avsDirectory() view returns(address) +func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) AvsDirectory() (common.Address, error) { + return _DelegationManagerStorage.Contract.AvsDirectory(&_DelegationManagerStorage.CallOpts) } // BeaconChainETHStrategy is a free data retrieval call binding the contract method 0x9104c319. @@ -676,37 +682,6 @@ func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) EigenPod return _DelegationManagerStorage.Contract.EigenPodManager(&_DelegationManagerStorage.CallOpts) } -// GetOperatorShares is a free data retrieval call binding the contract method 0x90041347. -// -// Solidity: function getOperatorShares(address operator, address[] strategies) view returns(uint256[]) -func (_DelegationManagerStorage *DelegationManagerStorageCaller) GetOperatorShares(opts *bind.CallOpts, operator common.Address, strategies []common.Address) ([]*big.Int, error) { - var out []interface{} - err := _DelegationManagerStorage.contract.Call(opts, &out, "getOperatorShares", operator, strategies) - - if err != nil { - return *new([]*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) - - return out0, err - -} - -// GetOperatorShares is a free data retrieval call binding the contract method 0x90041347. -// -// Solidity: function getOperatorShares(address operator, address[] strategies) view returns(uint256[]) -func (_DelegationManagerStorage *DelegationManagerStorageSession) GetOperatorShares(operator common.Address, strategies []common.Address) ([]*big.Int, error) { - return _DelegationManagerStorage.Contract.GetOperatorShares(&_DelegationManagerStorage.CallOpts, operator, strategies) -} - -// GetOperatorShares is a free data retrieval call binding the contract method 0x90041347. -// -// Solidity: function getOperatorShares(address operator, address[] strategies) view returns(uint256[]) -func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) GetOperatorShares(operator common.Address, strategies []common.Address) ([]*big.Int, error) { - return _DelegationManagerStorage.Contract.GetOperatorShares(&_DelegationManagerStorage.CallOpts, operator, strategies) -} - // GetWithdrawalDelay is a free data retrieval call binding the contract method 0x0449ca39. // // Solidity: function getWithdrawalDelay(address[] strategies) view returns(uint256) @@ -800,6 +775,37 @@ func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) IsOperat return _DelegationManagerStorage.Contract.IsOperator(&_DelegationManagerStorage.CallOpts, operator) } +// MinWithdrawalDelay is a free data retrieval call binding the contract method 0x0d5b0067. +// +// Solidity: function minWithdrawalDelay() view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageCaller) MinWithdrawalDelay(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DelegationManagerStorage.contract.Call(opts, &out, "minWithdrawalDelay") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MinWithdrawalDelay is a free data retrieval call binding the contract method 0x0d5b0067. +// +// Solidity: function minWithdrawalDelay() view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageSession) MinWithdrawalDelay() (*big.Int, error) { + return _DelegationManagerStorage.Contract.MinWithdrawalDelay(&_DelegationManagerStorage.CallOpts) +} + +// MinWithdrawalDelay is a free data retrieval call binding the contract method 0x0d5b0067. +// +// Solidity: function minWithdrawalDelay() view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) MinWithdrawalDelay() (*big.Int, error) { + return _DelegationManagerStorage.Contract.MinWithdrawalDelay(&_DelegationManagerStorage.CallOpts) +} + // MinWithdrawalDelayBlocks is a free data retrieval call binding the contract method 0xc448feb8. // // Solidity: function minWithdrawalDelayBlocks() view returns(uint256) @@ -831,6 +837,37 @@ func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) MinWithd return _DelegationManagerStorage.Contract.MinWithdrawalDelayBlocks(&_DelegationManagerStorage.CallOpts) } +// OperatorAllocationDelay is a free data retrieval call binding the contract method 0x89829397. +// +// Solidity: function operatorAllocationDelay(address operator) view returns((bool,uint32)) +func (_DelegationManagerStorage *DelegationManagerStorageCaller) OperatorAllocationDelay(opts *bind.CallOpts, operator common.Address) (IDelegationManagerAllocationDelayDetails, error) { + var out []interface{} + err := _DelegationManagerStorage.contract.Call(opts, &out, "operatorAllocationDelay", operator) + + if err != nil { + return *new(IDelegationManagerAllocationDelayDetails), err + } + + out0 := *abi.ConvertType(out[0], new(IDelegationManagerAllocationDelayDetails)).(*IDelegationManagerAllocationDelayDetails) + + return out0, err + +} + +// OperatorAllocationDelay is a free data retrieval call binding the contract method 0x89829397. +// +// Solidity: function operatorAllocationDelay(address operator) view returns((bool,uint32)) +func (_DelegationManagerStorage *DelegationManagerStorageSession) OperatorAllocationDelay(operator common.Address) (IDelegationManagerAllocationDelayDetails, error) { + return _DelegationManagerStorage.Contract.OperatorAllocationDelay(&_DelegationManagerStorage.CallOpts, operator) +} + +// OperatorAllocationDelay is a free data retrieval call binding the contract method 0x89829397. +// +// Solidity: function operatorAllocationDelay(address operator) view returns((bool,uint32)) +func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) OperatorAllocationDelay(operator common.Address) (IDelegationManagerAllocationDelayDetails, error) { + return _DelegationManagerStorage.Contract.OperatorAllocationDelay(&_DelegationManagerStorage.CallOpts, operator) +} + // OperatorDetails is a free data retrieval call binding the contract method 0xc5e480db. // // Solidity: function operatorDetails(address operator) view returns((address,address,uint32)) @@ -862,12 +899,12 @@ func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) Operator return _DelegationManagerStorage.Contract.OperatorDetails(&_DelegationManagerStorage.CallOpts, operator) } -// OperatorShares is a free data retrieval call binding the contract method 0x778e55f3. +// OperatorScaledShares is a free data retrieval call binding the contract method 0x9fb4ee32. // -// Solidity: function operatorShares(address , address ) view returns(uint256) -func (_DelegationManagerStorage *DelegationManagerStorageCaller) OperatorShares(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { +// Solidity: function operatorScaledShares(address , address ) view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageCaller) OperatorScaledShares(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { var out []interface{} - err := _DelegationManagerStorage.contract.Call(opts, &out, "operatorShares", arg0, arg1) + err := _DelegationManagerStorage.contract.Call(opts, &out, "operatorScaledShares", arg0, arg1) if err != nil { return *new(*big.Int), err @@ -879,18 +916,18 @@ func (_DelegationManagerStorage *DelegationManagerStorageCaller) OperatorShares( } -// OperatorShares is a free data retrieval call binding the contract method 0x778e55f3. +// OperatorScaledShares is a free data retrieval call binding the contract method 0x9fb4ee32. // -// Solidity: function operatorShares(address , address ) view returns(uint256) -func (_DelegationManagerStorage *DelegationManagerStorageSession) OperatorShares(arg0 common.Address, arg1 common.Address) (*big.Int, error) { - return _DelegationManagerStorage.Contract.OperatorShares(&_DelegationManagerStorage.CallOpts, arg0, arg1) +// Solidity: function operatorScaledShares(address , address ) view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageSession) OperatorScaledShares(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelegationManagerStorage.Contract.OperatorScaledShares(&_DelegationManagerStorage.CallOpts, arg0, arg1) } -// OperatorShares is a free data retrieval call binding the contract method 0x778e55f3. +// OperatorScaledShares is a free data retrieval call binding the contract method 0x9fb4ee32. // -// Solidity: function operatorShares(address , address ) view returns(uint256) -func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) OperatorShares(arg0 common.Address, arg1 common.Address) (*big.Int, error) { - return _DelegationManagerStorage.Contract.OperatorShares(&_DelegationManagerStorage.CallOpts, arg0, arg1) +// Solidity: function operatorScaledShares(address , address ) view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) OperatorScaledShares(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelegationManagerStorage.Contract.OperatorScaledShares(&_DelegationManagerStorage.CallOpts, arg0, arg1) } // PendingWithdrawals is a free data retrieval call binding the contract method 0xb7f06ebe. @@ -1017,6 +1054,37 @@ func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) StakerOp return _DelegationManagerStorage.Contract.StakerOptOutWindowBlocks(&_DelegationManagerStorage.CallOpts, operator) } +// StakerScalingFactors is a free data retrieval call binding the contract method 0x51260e23. +// +// Solidity: function stakerScalingFactors(address , address ) view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageCaller) StakerScalingFactors(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _DelegationManagerStorage.contract.Call(opts, &out, "stakerScalingFactors", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StakerScalingFactors is a free data retrieval call binding the contract method 0x51260e23. +// +// Solidity: function stakerScalingFactors(address , address ) view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageSession) StakerScalingFactors(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelegationManagerStorage.Contract.StakerScalingFactors(&_DelegationManagerStorage.CallOpts, arg0, arg1) +} + +// StakerScalingFactors is a free data retrieval call binding the contract method 0x51260e23. +// +// Solidity: function stakerScalingFactors(address , address ) view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) StakerScalingFactors(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _DelegationManagerStorage.Contract.StakerScalingFactors(&_DelegationManagerStorage.CallOpts, arg0, arg1) +} + // StrategyManager is a free data retrieval call binding the contract method 0x39b70e38. // // Solidity: function strategyManager() view returns(address) @@ -1079,67 +1147,98 @@ func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) Strategy return _DelegationManagerStorage.Contract.StrategyWithdrawalDelayBlocks(&_DelegationManagerStorage.CallOpts, arg0) } -// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0x60d7faed. +// StrategyWithdrawalDelays is a free data retrieval call binding the contract method 0x50739be3. +// +// Solidity: function strategyWithdrawalDelays(address ) view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageCaller) StrategyWithdrawalDelays(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _DelegationManagerStorage.contract.Call(opts, &out, "strategyWithdrawalDelays", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StrategyWithdrawalDelays is a free data retrieval call binding the contract method 0x50739be3. +// +// Solidity: function strategyWithdrawalDelays(address ) view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageSession) StrategyWithdrawalDelays(arg0 common.Address) (*big.Int, error) { + return _DelegationManagerStorage.Contract.StrategyWithdrawalDelays(&_DelegationManagerStorage.CallOpts, arg0) +} + +// StrategyWithdrawalDelays is a free data retrieval call binding the contract method 0x50739be3. // -// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactor) CompleteQueuedWithdrawal(opts *bind.TransactOpts, withdrawal IDelegationManagerWithdrawal, tokens []common.Address, middlewareTimesIndex *big.Int, receiveAsTokens bool) (*types.Transaction, error) { - return _DelegationManagerStorage.contract.Transact(opts, "completeQueuedWithdrawal", withdrawal, tokens, middlewareTimesIndex, receiveAsTokens) +// Solidity: function strategyWithdrawalDelays(address ) view returns(uint256) +func (_DelegationManagerStorage *DelegationManagerStorageCallerSession) StrategyWithdrawalDelays(arg0 common.Address) (*big.Int, error) { + return _DelegationManagerStorage.Contract.StrategyWithdrawalDelays(&_DelegationManagerStorage.CallOpts, arg0) } -// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0x60d7faed. +// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0xe4cc3f90. // -// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) returns() -func (_DelegationManagerStorage *DelegationManagerStorageSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, middlewareTimesIndex *big.Int, receiveAsTokens bool) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.CompleteQueuedWithdrawal(&_DelegationManagerStorage.TransactOpts, withdrawal, tokens, middlewareTimesIndex, receiveAsTokens) +// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, bool receiveAsTokens) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactor) CompleteQueuedWithdrawal(opts *bind.TransactOpts, withdrawal IDelegationManagerWithdrawal, tokens []common.Address, receiveAsTokens bool) (*types.Transaction, error) { + return _DelegationManagerStorage.contract.Transact(opts, "completeQueuedWithdrawal", withdrawal, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0x60d7faed. +// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0xe4cc3f90. // -// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, middlewareTimesIndex *big.Int, receiveAsTokens bool) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.CompleteQueuedWithdrawal(&_DelegationManagerStorage.TransactOpts, withdrawal, tokens, middlewareTimesIndex, receiveAsTokens) +// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, bool receiveAsTokens) returns() +func (_DelegationManagerStorage *DelegationManagerStorageSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, receiveAsTokens bool) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.CompleteQueuedWithdrawal(&_DelegationManagerStorage.TransactOpts, withdrawal, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x33404396. +// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0xe4cc3f90. // -// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactor) CompleteQueuedWithdrawals(opts *bind.TransactOpts, withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, middlewareTimesIndexes []*big.Int, receiveAsTokens []bool) (*types.Transaction, error) { - return _DelegationManagerStorage.contract.Transact(opts, "completeQueuedWithdrawals", withdrawals, tokens, middlewareTimesIndexes, receiveAsTokens) +// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, bool receiveAsTokens) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, receiveAsTokens bool) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.CompleteQueuedWithdrawal(&_DelegationManagerStorage.TransactOpts, withdrawal, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x33404396. +// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x9435bb43. // -// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) returns() -func (_DelegationManagerStorage *DelegationManagerStorageSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, middlewareTimesIndexes []*big.Int, receiveAsTokens []bool) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.CompleteQueuedWithdrawals(&_DelegationManagerStorage.TransactOpts, withdrawals, tokens, middlewareTimesIndexes, receiveAsTokens) +// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, bool[] receiveAsTokens) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactor) CompleteQueuedWithdrawals(opts *bind.TransactOpts, withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, receiveAsTokens []bool) (*types.Transaction, error) { + return _DelegationManagerStorage.contract.Transact(opts, "completeQueuedWithdrawals", withdrawals, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x33404396. +// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x9435bb43. // -// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, middlewareTimesIndexes []*big.Int, receiveAsTokens []bool) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.CompleteQueuedWithdrawals(&_DelegationManagerStorage.TransactOpts, withdrawals, tokens, middlewareTimesIndexes, receiveAsTokens) +// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, bool[] receiveAsTokens) returns() +func (_DelegationManagerStorage *DelegationManagerStorageSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, receiveAsTokens []bool) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.CompleteQueuedWithdrawals(&_DelegationManagerStorage.TransactOpts, withdrawals, tokens, receiveAsTokens) +} + +// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x9435bb43. +// +// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, bool[] receiveAsTokens) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, receiveAsTokens []bool) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.CompleteQueuedWithdrawals(&_DelegationManagerStorage.TransactOpts, withdrawals, tokens, receiveAsTokens) } // DecreaseDelegatedShares is a paid mutator transaction binding the contract method 0x132d4967. // -// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactor) DecreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManagerStorage.contract.Transact(opts, "decreaseDelegatedShares", staker, strategy, shares) +// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 removedShares) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactor) DecreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, removedShares *big.Int) (*types.Transaction, error) { + return _DelegationManagerStorage.contract.Transact(opts, "decreaseDelegatedShares", staker, strategy, removedShares) } // DecreaseDelegatedShares is a paid mutator transaction binding the contract method 0x132d4967. // -// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManagerStorage *DelegationManagerStorageSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.DecreaseDelegatedShares(&_DelegationManagerStorage.TransactOpts, staker, strategy, shares) +// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 removedShares) returns() +func (_DelegationManagerStorage *DelegationManagerStorageSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, removedShares *big.Int) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.DecreaseDelegatedShares(&_DelegationManagerStorage.TransactOpts, staker, strategy, removedShares) } // DecreaseDelegatedShares is a paid mutator transaction binding the contract method 0x132d4967. // -// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.DecreaseDelegatedShares(&_DelegationManagerStorage.TransactOpts, staker, strategy, shares) +// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 removedShares) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, removedShares *big.Int) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.DecreaseDelegatedShares(&_DelegationManagerStorage.TransactOpts, staker, strategy, removedShares) } // DelegateTo is a paid mutator transaction binding the contract method 0xeea9064b. @@ -1184,25 +1283,46 @@ func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) Dele return _DelegationManagerStorage.Contract.DelegateToBySignature(&_DelegationManagerStorage.TransactOpts, staker, operator, stakerSignatureAndExpiry, approverSignatureAndExpiry, approverSalt) } -// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x28a573ae. +// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x3c651cf2. +// +// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 existingShares, uint256 addedShares) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactor) IncreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, existingShares *big.Int, addedShares *big.Int) (*types.Transaction, error) { + return _DelegationManagerStorage.contract.Transact(opts, "increaseDelegatedShares", staker, strategy, existingShares, addedShares) +} + +// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x3c651cf2. +// +// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 existingShares, uint256 addedShares) returns() +func (_DelegationManagerStorage *DelegationManagerStorageSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, existingShares *big.Int, addedShares *big.Int) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.IncreaseDelegatedShares(&_DelegationManagerStorage.TransactOpts, staker, strategy, existingShares, addedShares) +} + +// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x3c651cf2. +// +// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 existingShares, uint256 addedShares) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, existingShares *big.Int, addedShares *big.Int) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.IncreaseDelegatedShares(&_DelegationManagerStorage.TransactOpts, staker, strategy, existingShares, addedShares) +} + +// InitializeAllocationDelay is a paid mutator transaction binding the contract method 0x0de5495d. // -// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactor) IncreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManagerStorage.contract.Transact(opts, "increaseDelegatedShares", staker, strategy, shares) +// Solidity: function initializeAllocationDelay(uint32 delay) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactor) InitializeAllocationDelay(opts *bind.TransactOpts, delay uint32) (*types.Transaction, error) { + return _DelegationManagerStorage.contract.Transact(opts, "initializeAllocationDelay", delay) } -// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x28a573ae. +// InitializeAllocationDelay is a paid mutator transaction binding the contract method 0x0de5495d. // -// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManagerStorage *DelegationManagerStorageSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.IncreaseDelegatedShares(&_DelegationManagerStorage.TransactOpts, staker, strategy, shares) +// Solidity: function initializeAllocationDelay(uint32 delay) returns() +func (_DelegationManagerStorage *DelegationManagerStorageSession) InitializeAllocationDelay(delay uint32) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.InitializeAllocationDelay(&_DelegationManagerStorage.TransactOpts, delay) } -// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x28a573ae. +// InitializeAllocationDelay is a paid mutator transaction binding the contract method 0x0de5495d. // -// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.IncreaseDelegatedShares(&_DelegationManagerStorage.TransactOpts, staker, strategy, shares) +// Solidity: function initializeAllocationDelay(uint32 delay) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) InitializeAllocationDelay(delay uint32) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.InitializeAllocationDelay(&_DelegationManagerStorage.TransactOpts, delay) } // ModifyOperatorDetails is a paid mutator transaction binding the contract method 0xf16172b0. @@ -1247,25 +1367,25 @@ func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) Queu return _DelegationManagerStorage.Contract.QueueWithdrawals(&_DelegationManagerStorage.TransactOpts, queuedWithdrawalParams) } -// RegisterAsOperator is a paid mutator transaction binding the contract method 0x0f589e59. +// RegisterAsOperator is a paid mutator transaction binding the contract method 0x49730060. // -// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, string metadataURI) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactor) RegisterAsOperator(opts *bind.TransactOpts, registeringOperatorDetails IDelegationManagerOperatorDetails, metadataURI string) (*types.Transaction, error) { - return _DelegationManagerStorage.contract.Transact(opts, "registerAsOperator", registeringOperatorDetails, metadataURI) +// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, uint32 allocationDelay, string metadataURI) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactor) RegisterAsOperator(opts *bind.TransactOpts, registeringOperatorDetails IDelegationManagerOperatorDetails, allocationDelay uint32, metadataURI string) (*types.Transaction, error) { + return _DelegationManagerStorage.contract.Transact(opts, "registerAsOperator", registeringOperatorDetails, allocationDelay, metadataURI) } -// RegisterAsOperator is a paid mutator transaction binding the contract method 0x0f589e59. +// RegisterAsOperator is a paid mutator transaction binding the contract method 0x49730060. // -// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, string metadataURI) returns() -func (_DelegationManagerStorage *DelegationManagerStorageSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, metadataURI string) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.RegisterAsOperator(&_DelegationManagerStorage.TransactOpts, registeringOperatorDetails, metadataURI) +// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, uint32 allocationDelay, string metadataURI) returns() +func (_DelegationManagerStorage *DelegationManagerStorageSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, allocationDelay uint32, metadataURI string) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.RegisterAsOperator(&_DelegationManagerStorage.TransactOpts, registeringOperatorDetails, allocationDelay, metadataURI) } -// RegisterAsOperator is a paid mutator transaction binding the contract method 0x0f589e59. +// RegisterAsOperator is a paid mutator transaction binding the contract method 0x49730060. // -// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, string metadataURI) returns() -func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, metadataURI string) (*types.Transaction, error) { - return _DelegationManagerStorage.Contract.RegisterAsOperator(&_DelegationManagerStorage.TransactOpts, registeringOperatorDetails, metadataURI) +// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, uint32 allocationDelay, string metadataURI) returns() +func (_DelegationManagerStorage *DelegationManagerStorageTransactorSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, allocationDelay uint32, metadataURI string) (*types.Transaction, error) { + return _DelegationManagerStorage.Contract.RegisterAsOperator(&_DelegationManagerStorage.TransactOpts, registeringOperatorDetails, allocationDelay, metadataURI) } // Undelegate is a paid mutator transaction binding the contract method 0xda8be864. @@ -2769,6 +2889,142 @@ func (_DelegationManagerStorage *DelegationManagerStorageFilterer) ParseStrategy return event, nil } +// DelegationManagerStorageStrategyWithdrawalDelaySetIterator is returned from FilterStrategyWithdrawalDelaySet and is used to iterate over the raw logs and unpacked data for StrategyWithdrawalDelaySet events raised by the DelegationManagerStorage contract. +type DelegationManagerStorageStrategyWithdrawalDelaySetIterator struct { + Event *DelegationManagerStorageStrategyWithdrawalDelaySet // 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 *DelegationManagerStorageStrategyWithdrawalDelaySetIterator) 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(DelegationManagerStorageStrategyWithdrawalDelaySet) + 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(DelegationManagerStorageStrategyWithdrawalDelaySet) + 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 *DelegationManagerStorageStrategyWithdrawalDelaySetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DelegationManagerStorageStrategyWithdrawalDelaySetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DelegationManagerStorageStrategyWithdrawalDelaySet represents a StrategyWithdrawalDelaySet event raised by the DelegationManagerStorage contract. +type DelegationManagerStorageStrategyWithdrawalDelaySet struct { + Strategy common.Address + PreviousValue *big.Int + NewValue *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStrategyWithdrawalDelaySet is a free log retrieval operation binding the contract event 0x4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e5. +// +// Solidity: event StrategyWithdrawalDelaySet(address strategy, uint256 previousValue, uint256 newValue) +func (_DelegationManagerStorage *DelegationManagerStorageFilterer) FilterStrategyWithdrawalDelaySet(opts *bind.FilterOpts) (*DelegationManagerStorageStrategyWithdrawalDelaySetIterator, error) { + + logs, sub, err := _DelegationManagerStorage.contract.FilterLogs(opts, "StrategyWithdrawalDelaySet") + if err != nil { + return nil, err + } + return &DelegationManagerStorageStrategyWithdrawalDelaySetIterator{contract: _DelegationManagerStorage.contract, event: "StrategyWithdrawalDelaySet", logs: logs, sub: sub}, nil +} + +// WatchStrategyWithdrawalDelaySet is a free log subscription operation binding the contract event 0x4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e5. +// +// Solidity: event StrategyWithdrawalDelaySet(address strategy, uint256 previousValue, uint256 newValue) +func (_DelegationManagerStorage *DelegationManagerStorageFilterer) WatchStrategyWithdrawalDelaySet(opts *bind.WatchOpts, sink chan<- *DelegationManagerStorageStrategyWithdrawalDelaySet) (event.Subscription, error) { + + logs, sub, err := _DelegationManagerStorage.contract.WatchLogs(opts, "StrategyWithdrawalDelaySet") + 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(DelegationManagerStorageStrategyWithdrawalDelaySet) + if err := _DelegationManagerStorage.contract.UnpackLog(event, "StrategyWithdrawalDelaySet", 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 +} + +// ParseStrategyWithdrawalDelaySet is a log parse operation binding the contract event 0x4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e5. +// +// Solidity: event StrategyWithdrawalDelaySet(address strategy, uint256 previousValue, uint256 newValue) +func (_DelegationManagerStorage *DelegationManagerStorageFilterer) ParseStrategyWithdrawalDelaySet(log types.Log) (*DelegationManagerStorageStrategyWithdrawalDelaySet, error) { + event := new(DelegationManagerStorageStrategyWithdrawalDelaySet) + if err := _DelegationManagerStorage.contract.UnpackLog(event, "StrategyWithdrawalDelaySet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // DelegationManagerStorageWithdrawalCompletedIterator is returned from FilterWithdrawalCompleted and is used to iterate over the raw logs and unpacked data for WithdrawalCompleted events raised by the DelegationManagerStorage contract. type DelegationManagerStorageWithdrawalCompletedIterator struct { Event *DelegationManagerStorageWithdrawalCompleted // Event containing the contract specifics and raw log diff --git a/pkg/bindings/EigenPod/binding.go b/pkg/bindings/EigenPod/binding.go index 7016ff63f..726b49877 100644 --- a/pkg/bindings/EigenPod/binding.go +++ b/pkg/bindings/EigenPod/binding.go @@ -73,7 +73,7 @@ type IEigenPodValidatorInfo struct { // EigenPodMetaData contains all meta data concerning the EigenPod contract. var EigenPodMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_ethPOS\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"},{\"name\":\"_eigenPodManager\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"},{\"name\":\"_GENESIS_TIME\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"GENESIS_TIME\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"activeValidatorCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"checkpointBalanceExitedGwei\",\"inputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentCheckpoint\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIEigenPod.Checkpoint\",\"components\":[{\"name\":\"beaconBlockRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proofsRemaining\",\"type\":\"uint24\",\"internalType\":\"uint24\"},{\"name\":\"podBalanceGwei\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"balanceDeltasGwei\",\"type\":\"int128\",\"internalType\":\"int128\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentCheckpointTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getParentBlockRoot\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastCheckpointTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"podOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proofSubmitter\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recoverTokens\",\"inputs\":[{\"name\":\"tokenList\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"amountsToWithdraw\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setProofSubmitter\",\"inputs\":[{\"name\":\"newProofSubmitter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"startCheckpoint\",\"inputs\":[{\"name\":\"revertIfNoBalance\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validatorPubkeyHashToInfo\",\"inputs\":[{\"name\":\"validatorPubkeyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIEigenPod.ValidatorInfo\",\"components\":[{\"name\":\"validatorIndex\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"restakedBalanceGwei\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"lastCheckpointedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorPubkeyToInfo\",\"inputs\":[{\"name\":\"validatorPubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIEigenPod.ValidatorInfo\",\"components\":[{\"name\":\"validatorIndex\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"restakedBalanceGwei\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"lastCheckpointedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorStatus\",\"inputs\":[{\"name\":\"validatorPubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorStatus\",\"inputs\":[{\"name\":\"pubkeyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyCheckpointProofs\",\"inputs\":[{\"name\":\"balanceContainerProof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.BalanceContainerProof\",\"components\":[{\"name\":\"balanceContainerRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"proofs\",\"type\":\"tuple[]\",\"internalType\":\"structBeaconChainProofs.BalanceProof[]\",\"components\":[{\"name\":\"pubkeyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"balanceRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyStaleBalance\",\"inputs\":[{\"name\":\"beaconTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"stateRootProof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.StateRootProof\",\"components\":[{\"name\":\"beaconStateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"proof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.ValidatorProof\",\"components\":[{\"name\":\"validatorFields\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyWithdrawalCredentials\",\"inputs\":[{\"name\":\"beaconTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"stateRootProof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.StateRootProof\",\"components\":[{\"name\":\"beaconStateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"validatorIndices\",\"type\":\"uint40[]\",\"internalType\":\"uint40[]\"},{\"name\":\"validatorFieldsProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"validatorFields\",\"type\":\"bytes32[][]\",\"internalType\":\"bytes32[][]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawRestakedBeaconChainETH\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amountWei\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawableRestakedExecutionLayerGwei\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"CheckpointCreated\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"beaconBlockRoot\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validatorCount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"CheckpointFinalized\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"totalShareDeltaWei\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EigenPodStaked\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NonBeaconChainETHReceived\",\"inputs\":[{\"name\":\"amountReceived\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ProofSubmitterUpdated\",\"inputs\":[{\"name\":\"prevProofSubmitter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newProofSubmitter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RestakedBeaconChainETHWithdrawn\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorBalanceUpdated\",\"inputs\":[{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"},{\"name\":\"balanceTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"newValidatorBalanceGwei\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorCheckpointed\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":true,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRestaked\",\"inputs\":[{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorWithdrawn\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":true,\"internalType\":\"uint40\"}],\"anonymous\":false}]", - Bin: "0x60e06040523480156200001157600080fd5b5060405162004ad038038062004ad0833981016040819052620000349162000142565b6001600160a01b03808416608052821660a0526001600160401b03811660c0526200005e62000067565b505050620001a1565b600054610100900460ff1615620000d45760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000127576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200013f57600080fd5b50565b6000806000606084860312156200015857600080fd5b8351620001658162000129565b6020850151909350620001788162000129565b60408501519092506001600160401b03811681146200019657600080fd5b809150509250925092565b60805160a05160c0516148b26200021e60003960006105ff0152600081816102bd0152818161063a015281816106ec01528181610abf01528181610d6c015281816110f40152818161119c0152818161143c015281816118db01528181611a8401526131250152600081816104b8015261126701526148b26000f3fe60806040526004361061016a5760003560e01c80636fcd0e53116100d1578063c49074421161008a578063dda3346c11610064578063dda3346c1461058d578063ee94d67c146105ad578063f074ba62146105cd578063f2882461146105ed57600080fd5b8063c49074421461052d578063c4d66de81461054d578063d06d55871461056d57600080fd5b80636fcd0e53146104425780637439841f1461046f57806374cdd798146104a657806388676cad146104da5780639b4e4634146104fa578063b522538a1461050d57600080fd5b80634665bcda116101235780634665bcda146102ab57806347d28372146102df57806352396a591461039f57806358753357146103d557806358eaee79146103f55780636c0d2d5a1461042257600080fd5b8063039157d2146101a95780630b18ff66146101cb5780632340e8d3146102085780633474aa161461022c5780633f65cf191461026457806342ecff2a1461028457600080fd5b366101a4576040513481527f6fdd3dbdb173299608c0aa9f368735857c8842b581f8389238bf05bd04b3bf499060200160405180910390a1005b600080fd5b3480156101b557600080fd5b506101c96101c4366004613b66565b610621565b005b3480156101d757600080fd5b506033546101eb906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561021457600080fd5b5061021e60395481565b6040519081526020016101ff565b34801561023857600080fd5b5060345461024c906001600160401b031681565b6040516001600160401b0390911681526020016101ff565b34801561027057600080fd5b506101c961027f366004613c24565b610a67565b34801561029057600080fd5b50603a5461024c90600160401b90046001600160401b031681565b3480156102b757600080fd5b506101eb7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102eb57600080fd5b5061035b6040805160808101825260008082526020820181905291810182905260608101919091525060408051608081018252603c548152603d5462ffffff811660208301526001600160401b03630100000082041692820192909252600160581b909104600f0b606082015290565b6040516101ff91908151815260208083015162ffffff16908201526040808301516001600160401b031690820152606091820151600f0b9181019190915260800190565b3480156103ab57600080fd5b5061024c6103ba366004613cf2565b603b602052600090815260409020546001600160401b031681565b3480156103e157600080fd5b50603e546101eb906001600160a01b031681565b34801561040157600080fd5b50610415610410366004613d4e565b610dd6565b6040516101ff9190613dc7565b34801561042e57600080fd5b5061021e61043d366004613cf2565b610e3b565b34801561044e57600080fd5b5061046261045d366004613dd5565b610fef565b6040516101ff9190613dee565b34801561047b57600080fd5b5061041561048a366004613dd5565b600090815260366020526040902054600160c01b900460ff1690565b3480156104b257600080fd5b506101eb7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104e657600080fd5b506101c96104f5366004613e44565b61109c565b6101c9610508366004613e61565b611191565b34801561051957600080fd5b50610462610528366004613d4e565b61133e565b34801561053957600080fd5b506101c9610548366004613ef4565b611431565b34801561055957600080fd5b506101c9610568366004613f20565b61166e565b34801561057957600080fd5b506101c9610588366004613f20565b611805565b34801561059957600080fd5b506101c96105a8366004614011565b611898565b3480156105b957600080fd5b50603a5461024c906001600160401b031681565b3480156105d957600080fd5b506101c96105e83660046140e2565b611a6b565b3480156105f957600080fd5b5061024c7f000000000000000000000000000000000000000000000000000000000000000081565b604051635ac86ab760e01b8152600660048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ad919061414a565b156106d35760405162461bcd60e51b81526004016106ca90614167565b60405180910390fd5b604051635ac86ab760e01b8152600860048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f919061414a565b1561077c5760405162461bcd60e51b81526004016106ca90614167565b60006107c261078b85806141c4565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611ebe92505050565b6000818152603660209081526040808320815160808101835281546001600160401b038082168352600160401b8204811695830195909552600160801b8104909416928101929092529394509192906060830190600160c01b900460ff16600281111561083157610831613d8f565b600281111561084257610842613d8f565b81525050905080604001516001600160401b0316876001600160401b0316116108d5576040805162461bcd60e51b81526020600482015260248101919091527f456967656e506f642e7665726966795374616c6542616c616e63653a2070726f60448201527f6f66206973206f6c646572207468616e206c61737420636865636b706f696e7460648201526084016106ca565b6001816060015160028111156108ed576108ed613d8f565b146109575760405162461bcd60e51b815260206004820152603460248201527f456967656e506f642e7665726966795374616c6542616c616e63653a2076616c604482015273696461746f72206973206e6f742061637469766560601b60648201526084016106ca565b61099b61096486806141c4565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611ee292505050565b610a1f5760405162461bcd60e51b815260206004820152604960248201527f456967656e506f642e7665726966795374616c6542616c616e63653a2076616c60448201527f696461746f72206d75737420626520736c617368656420746f206265206d61726064820152686b6564207374616c6560b81b608482015260a4016106ca565b610a31610a2b88610e3b565b87611f0c565b610a548635610a4087806141c4565b610a4d60208a018a61420d565b8651612067565b610a5e600061227e565b50505050505050565b6033546001600160a01b0316331480610a8a5750603e546001600160a01b031633145b610aa65760405162461bcd60e51b81526004016106ca90614253565b604051635ac86ab760e01b8152600260048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b32919061414a565b15610b4f5760405162461bcd60e51b81526004016106ca90614167565b8584148015610b5d57508382145b610bed5760405162461bcd60e51b815260206004820152605560248201527f456967656e506f642e7665726966795769746864726177616c43726564656e7460448201527f69616c733a2076616c696461746f72496e646963657320616e642070726f6f666064820152740e640daeae6e840c4ca40e6c2daca40d8cadccee8d605b1b608482015260a4016106ca565b603a546001600160401b03600160401b9091048116908a1611610c8d5760405162461bcd60e51b815260206004820152604c60248201527f456967656e506f642e7665726966795769746864726177616c43726564656e7460448201527f69616c733a207370656369666965642074696d657374616d7020697320746f6f60648201526b0819985c881a5b881c185cdd60a21b608482015260a4016106ca565b610c9f610c998a610e3b565b89611f0c565b6000805b87811015610d4257610d248a358a8a84818110610cc257610cc26142c7565b9050602002016020810190610cd791906142dd565b898985818110610ce957610ce96142c7565b9050602002810190610cfb919061420d565b898987818110610d0d57610d0d6142c7565b9050602002810190610d1f91906141c4565b612514565b610d2e908361431a565b915080610d3a81614332565b915050610ca3565b5060335460405163030b147160e61b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063c2c51c4090604401600060405180830381600087803b158015610db257600080fd5b505af1158015610dc6573d6000803e3d6000fd5b5050505050505050505050505050565b600080610e1884848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612afa92505050565b600090815260366020526040902054600160c01b900460ff169150505b92915050565b6000610e4a611fff600c61434d565b610e5d6001600160401b0384164261436c565b10610ec65760405162461bcd60e51b815260206004820152603360248201527f456967656e506f642e676574506172656e74426c6f636b526f6f743a2074696d604482015272657374616d70206f7574206f662072616e676560681b60648201526084016106ca565b604080516001600160401b03841660208201526000918291720f3df6d732807ef1319fb7b8bb8522d0beac02910160408051601f1981840301815290829052610f0e916143b3565b600060405180830381855afa9150503d8060008114610f49576040519150601f19603f3d011682016040523d82523d6000602084013e610f4e565b606091505b5091509150818015610f61575060008151115b610fd35760405162461bcd60e51b815260206004820152603860248201527f456967656e506f642e676574506172656e74426c6f636b526f6f743a20696e7660448201527f616c696420626c6f636b20726f6f742072657475726e6564000000000000000060648201526084016106ca565b80806020019051810190610fe791906143cf565b949350505050565b6110176040805160808101825260008082526020820181905291810182905290606082015290565b600082815260366020908152604091829020825160808101845281546001600160401b038082168352600160401b8204811694830194909452600160801b810490931693810193909352906060830190600160c01b900460ff16600281111561108257611082613d8f565b600281111561109357611093613d8f565b90525092915050565b6033546001600160a01b03163314806110bf5750603e546001600160a01b031633145b6110db5760405162461bcd60e51b81526004016106ca90614253565b604051635ac86ab760e01b8152600660048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa158015611143573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611167919061414a565b156111845760405162461bcd60e51b81526004016106ca90614167565b61118d8261227e565b5050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111d95760405162461bcd60e51b81526004016106ca906143e8565b346801bc16d674ec800000146112655760405162461bcd60e51b8152602060048201526044602482018190527f456967656e506f642e7374616b653a206d75737420696e697469616c6c792073908201527f74616b6520666f7220616e792076616c696461746f72207769746820333220656064820152633a3432b960e11b608482015260a4016106ca565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663228951186801bc16d674ec80000087876112a8612bf4565b8888886040518863ffffffff1660e01b81526004016112cc9695949392919061448e565b6000604051808303818588803b1580156112e557600080fd5b505af11580156112f9573d6000803e3d6000fd5b50505050507f606865b7934a25d4aed43f6cdb426403353fa4b3009c4d228407474581b01e23858560405161132f9291906144dd565b60405180910390a15050505050565b6113666040805160808101825260008082526020820181905291810182905290606082015290565b603660006113a985858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612afa92505050565b81526020808201929092526040908101600020815160808101835281546001600160401b038082168352600160401b8204811695830195909552600160801b81049094169281019290925290916060830190600160c01b900460ff16600281111561141657611416613d8f565b600281111561142757611427613d8f565b9052509392505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114795760405162461bcd60e51b81526004016106ca906143e8565b611487633b9aca0082614507565b156115115760405162461bcd60e51b815260206004820152604e60248201527f456967656e506f642e776974686472617752657374616b6564426561636f6e4360448201527f6861696e4554483a20616d6f756e74576569206d75737420626520612077686f60648201526d1b194811ddd95a48185b5bdd5b9d60921b608482015260a4016106ca565b6000611521633b9aca008361451b565b6034549091506001600160401b0390811690821611156115da5760405162461bcd60e51b815260206004820152606260248201527f456967656e506f642e776974686472617752657374616b6564426561636f6e4360448201527f6861696e4554483a20616d6f756e74477765692065786365656473207769746860648201527f6472617761626c6552657374616b6564457865637574696f6e4c617965724777608482015261656960f01b60a482015260c4016106ca565b603480548291906000906115f89084906001600160401b031661452f565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550826001600160a01b03167f8947fd2ce07ef9cc302c4e8f0461015615d91ce851564839e91cc804c2f49d8e8360405161165791815260200190565b60405180910390a26116698383612c39565b505050565b600054610100900460ff161580801561168e5750600054600160ff909116105b806116a85750303b1580156116a8575060005460ff166001145b61170b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106ca565b6000805460ff19166001179055801561172e576000805461ff0019166101001790555b6001600160a01b0382166117a15760405162461bcd60e51b815260206004820152603460248201527f456967656e506f642e696e697469616c697a653a20706f644f776e65722063616044820152736e6e6f74206265207a65726f206164647265737360601b60648201526084016106ca565b603380546001600160a01b0319166001600160a01b038416179055801561118d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6033546001600160a01b0316331461182f5760405162461bcd60e51b81526004016106ca90614557565b603e54604080516001600160a01b03928316815291831660208301527ffb8129080a19d34dceac04ba253fc50304dc86c729bd63cdca4a969ad19a5eac910160405180910390a1603e80546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b031633146118c25760405162461bcd60e51b81526004016106ca90614557565b604051635ac86ab760e01b8152600560048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa15801561192a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194e919061414a565b1561196b5760405162461bcd60e51b81526004016106ca90614167565b82518451146119f65760405162461bcd60e51b815260206004820152604b60248201527f456967656e506f642e7265636f766572546f6b656e733a20746f6b656e4c697360448201527f7420616e6420616d6f756e7473546f5769746864726177206d7573742062652060648201526a0e6c2daca40d8cadccee8d60ab1b608482015260a4016106ca565b60005b8451811015611a6457611a5283858381518110611a1857611a186142c7565b6020026020010151878481518110611a3257611a326142c7565b60200260200101516001600160a01b0316612d529092919063ffffffff16565b80611a5c81614332565b9150506119f9565b5050505050565b604051635ac86ab760e01b8152600760048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa158015611ad3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af7919061414a565b15611b145760405162461bcd60e51b81526004016106ca90614167565b603a54600160401b90046001600160401b031680611bc05760405162461bcd60e51b815260206004820152605860248201527f456967656e506f642e766572696679436865636b706f696e7450726f6f66733a60448201527f206d75737420686176652061637469766520636865636b706f696e7420746f2060648201527f706572666f726d20636865636b706f696e742070726f6f660000000000000000608482015260a4016106ca565b60408051608081018252603c54808252603d5462ffffff811660208401526001600160401b03630100000082041693830193909352600160581b909204600f0b606082015290611c109087612da4565b6000805b85811015611e645736878783818110611c2f57611c2f6142c7565b9050602002810190611c41919061459f565b80356000908152603660209081526040808320815160808101835281546001600160401b038082168352600160401b8204811695830195909552600160801b8104909416928101929092529394509192906060830190600160c01b900460ff166002811115611cb257611cb2613d8f565b6002811115611cc357611cc3613d8f565b9052509050600181606001516002811115611ce057611ce0613d8f565b14611cec575050611e52565b856001600160401b031681604001516001600160401b031610611d10575050611e52565b600080611d2083898e3587612f20565b602089018051929450909250611d35826145b5565b62ffffff16905250606087018051839190611d519083906145d4565b600f0b905250611d618187614623565b84356000908152603660209081526040918290208651815492880151938801516001600160401b03908116600160801b0267ffffffffffffffff60801b19958216600160401b026001600160801b0319909516919092161792909217928316821781556060870151939950869390929091839160ff60c01b1990911668ffffffffffffffffff60801b1990911617600160c01b836002811115611e0657611e06613d8f565b021790555050835160405164ffffffffff90911691506001600160401b038a16907fa91c59033c3423e18b54d0acecebb4972f9ea95aedf5f4cae3b677b02eaf3a3f90600090a3505050505b80611e5c81614332565b915050611c14565b506001600160401b038084166000908152603b6020526040812080548493919291611e9191859116614623565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550610a5e82613042565b600081600081518110611ed357611ed36142c7565b60200260200101519050919050565b600081600381518110611ef757611ef76142c7565b60200260200101516000801b14159050919050565b611f186003602061434d565b611f25602083018361420d565b905014611f9a5760405162461bcd60e51b815260206004820152603d60248201527f426561636f6e436861696e50726f6f66732e7665726966795374617465526f6f60448201527f743a2050726f6f662068617320696e636f7272656374206c656e67746800000060648201526084016106ca565b611fea611faa602083018361420d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525086925050843590506003613249565b61118d5760405162461bcd60e51b815260206004820152604260248201527f426561636f6e436861696e50726f6f66732e7665726966795374617465526f6f60448201527f743a20496e76616c696420737461746520726f6f74206d65726b6c652070726f60648201526137b360f11b608482015260a4016106ca565b600884146120e25760405162461bcd60e51b815260206004820152604e602482015260008051602061485d83398151915260448201527f724669656c64733a2056616c696461746f72206669656c64732068617320696e60648201526d0c6dee4e4cac6e840d8cadccee8d60931b608482015260a4016106ca565b60056120f06028600161431a565b6120fa919061431a565b61210590602061434d565b82146121735760405162461bcd60e51b8152602060048201526043602482015260008051602061485d83398151915260448201527f724669656c64733a2050726f6f662068617320696e636f7272656374206c656e6064820152620cee8d60eb1b608482015260a4016106ca565b60006121b186868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061326192505050565b9050600064ffffffffff83166121c96028600161431a565b600b901b17905061221485858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c9250869150859050613249565b6122745760405162461bcd60e51b815260206004820152603d602482015260008051602061485d83398151915260448201527f724669656c64733a20496e76616c6964206d65726b6c652070726f6f6600000060648201526084016106ca565b5050505050505050565b603a54600160401b90046001600160401b03161561231f5760405162461bcd60e51b815260206004820152605260248201527f456967656e506f642e5f7374617274436865636b706f696e743a206d7573742060448201527f66696e6973682070726576696f757320636865636b706f696e74206265666f72606482015271329039ba30b93a34b7339030b737ba3432b960711b608482015260a4016106ca565b603a54426001600160401b03908116911614156123a45760405162461bcd60e51b815260206004820152603f60248201527f456967656e506f642e5f7374617274436865636b706f696e743a2063616e6e6f60448201527f7420636865636b706f696e7420747769636520696e206f6e6520626c6f636b0060648201526084016106ca565b6034546000906001600160401b03166123c1633b9aca004761451b565b6123cb919061452f565b90508180156123e157506001600160401b038116155b156124545760405162461bcd60e51b815260206004820152603d60248201527f456967656e506f642e5f7374617274436865636b706f696e743a206e6f20626160448201527f6c616e636520617661696c61626c6520746f20636865636b706f696e7400000060648201526084016106ca565b6000604051806080016040528061246a42610e3b565b815260200160395462ffffff168152602001836001600160401b031681526020016000600f0b815250905042603a60086101000a8154816001600160401b0302191690836001600160401b031602179055506124c581613042565b805160208083015160405162ffffff90911681526001600160401b034216917f575796133bbed337e5b39aa49a30dc2556a91e0c6c2af4b7b886ae77ebef1076910160405180910390a3505050565b600080612553848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611ebe92505050565b6000818152603660209081526040808320815160808101835281546001600160401b038082168352600160401b8204811695830195909552600160801b8104909416928101929092529394509192906060830190600160c01b900460ff1660028111156125c2576125c2613d8f565b60028111156125d3576125d3613d8f565b90525090506000816060015160028111156125f0576125f0613d8f565b146126815760405162461bcd60e51b8152602060048201526061602482015260008051602061483d83398151915260448201527f7469616c733a2076616c696461746f72206d75737420626520696e616374697660648201527f6520746f2070726f7665207769746864726177616c2063726564656e7469616c6084820152607360f81b60a482015260c4016106ca565b6001600160401b0380166126c786868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061350e92505050565b6001600160401b031614156127505760405162461bcd60e51b8152602060048201526055602482015260008051602061483d83398151915260448201527f7469616c733a2076616c696461746f72206d75737420626520696e207468652060648201527470726f63657373206f662061637469766174696e6760581b608482015260a4016106ca565b6001600160401b03801661279686868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061353392505050565b6001600160401b03161461280e5760405162461bcd60e51b81526020600482015260446024820181905260008051602061483d833981519152908201527f7469616c733a2076616c696461746f72206d757374206e6f742062652065786960648201526374696e6760e01b608482015260a4016106ca565b612816612bf4565b61281f9061464e565b61285b86868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061354b92505050565b146128ca5760405162461bcd60e51b8152602060048201526045602482015260008051602061483d83398151915260448201527f7469616c733a2070726f6f66206973206e6f7420666f72207468697320456967606482015264195b941bd960da1b608482015260a4016106ca565b600061290886868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061356092505050565b90506129188a87878b8b8e612067565b6039805490600061292883614332565b9091555050603a54600090600160401b90046001600160401b03161561296057603a54600160401b90046001600160401b031661296d565b603a546001600160401b03165b6040805160808101825264ffffffffff8d1681526001600160401b03858116602083015283169181019190915290915060608101600190526000858152603660209081526040918290208351815492850151938501516001600160401b03908116600160801b0267ffffffffffffffff60801b19958216600160401b026001600160801b031990951691909216179290921792831682178155606084015190929091839160ff60c01b1990911668ffffffffffffffffff60801b1990911617600160c01b836002811115612a4357612a43613d8f565b02179055505060405164ffffffffff8c1681527f2d0800bbc377ea54a08c5db6a87aafff5e3e9c8fead0eda110e40e0c10441449915060200160405180910390a16040805164ffffffffff8c1681526001600160401b03838116602083015284168183015290517f0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df9181900360600190a1612aeb633b9aca006001600160401b03841661434d565b9b9a5050505050505050505050565b60008151603014612b835760405162461bcd60e51b815260206004820152604760248201527f456967656e506f642e5f63616c63756c61746556616c696461746f725075626b60448201527f657948617368206d75737420626520612034382d6279746520424c53207075626064820152666c6963206b657960c81b608482015260a4016106ca565b604051600290612b9a908490600090602001614672565b60408051601f1981840301815290829052612bb4916143b3565b602060405180830381855afa158015612bd1573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610e3591906143cf565b60408051600160f81b60208201526000602182015230606090811b6bffffffffffffffffffffffff1916602c8301529101604051602081830303815290604052905090565b80471015612c895760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016106ca565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612cd6576040519150601f19603f3d011682016040523d82523d6000602084013e612cdb565b606091505b50509050806116695760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016106ca565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611669908490613578565b612db06005600361431a565b612dbb90602061434d565b612dc8602083018361420d565b905014612e4b5760405162461bcd60e51b8152602060048201526044602482018190527f426561636f6e436861696e50726f6f66732e76657269667942616c616e636543908201527f6f6e7461696e65723a2050726f6f662068617320696e636f7272656374206c656064820152630dccee8d60e31b608482015260a4016106ca565b606c612e9c612e5d602084018461420d565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250508535905084613249565b6116695760405162461bcd60e51b815260206004820152604960248201527f426561636f6e436861696e50726f6f66732e76657269667942616c616e63654360448201527f6f6e7461696e65723a20696e76616c69642062616c616e636520636f6e7461696064820152683732b910383937b7b360b91b608482015260a4016106ca565b83516020850151600091829182612f3887848861364a565b9050816001600160401b0316816001600160401b031614612fb257612f5d81836137c1565b6040805164ffffffffff861681526001600160401b038b8116602083015284168183015290519196507f0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df919081900360600190a15b6001600160401b0380821660208b0181905290891660408b01526130365760398054906000612fe0836146a1565b9091555050600260608a0152612ff5856146b8565b93508264ffffffffff16886001600160401b03167f2a02361ffa66cf2c2da4682c2355a6adcaa9f6c227b6e6563e68480f9587626a60405160405180910390a35b50505094509492505050565b602081015162ffffff166131c9576000633b9aca00826060015183604001516001600160401b031661307491906145d4565b600f0b61308191906146df565b60408301516034805492935090916000906130a69084906001600160401b0316614623565b82546101009290920a6001600160401b03818102199093169183160217909155603a8054600160401b81049092166001600160801b0319909216919091179055506000603c55603d80546001600160d81b031916905560335460405163030b147160e61b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063c2c51c4090604401600060405180830381600087803b15801561316b57600080fd5b505af115801561317f573d6000803e3d6000fd5b5050603a546040518481526001600160401b0390911692507f525408c201bc1576eb44116f6478f1c2a54775b19a043bcfdc708364f74f8e44915060200160405180910390a25050565b8051603c556020810151603d8054604084015160608501516fffffffffffffffffffffffffffffffff16600160581b026fffffffffffffffffffffffffffffffff60581b196001600160401b039092166301000000026affffffffffffffffffffff1990931662ffffff9095169490941791909117169190911790555b50565b6000836132578685856137d9565b1495945050505050565b60008060028351613272919061451b565b90506000816001600160401b0381111561328e5761328e613f3d565b6040519080825280602002602001820160405280156132b7578160200160208202803683370190505b50905060005b828110156133be576002856132d2838361434d565b815181106132e2576132e26142c7565b6020026020010151868360026132f8919061434d565b61330390600161431a565b81518110613313576133136142c7565b6020026020010151604051602001613335929190918252602082015260400190565b60408051601f198184030181529082905261334f916143b3565b602060405180830381855afa15801561336c573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061338f91906143cf565b8282815181106133a1576133a16142c7565b6020908102919091010152806133b681614332565b9150506132bd565b506133ca60028361451b565b91505b81156134ea5760005b828110156134d7576002826133eb838361434d565b815181106133fb576133fb6142c7565b602002602001015183836002613411919061434d565b61341c90600161431a565b8151811061342c5761342c6142c7565b602002602001015160405160200161344e929190918252602082015260400190565b60408051601f1981840301815290829052613468916143b3565b602060405180830381855afa158015613485573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906134a891906143cf565b8282815181106134ba576134ba6142c7565b6020908102919091010152806134cf81614332565b9150506133d6565b506134e360028361451b565b91506133cd565b806000815181106134fd576134fd6142c7565b602002602001015192505050919050565b6000610e3582600581518110613526576135266142c7565b6020026020010151613925565b6000610e3582600681518110613526576135266142c7565b600081600181518110611ed357611ed36142c7565b6000610e3582600281518110613526576135266142c7565b60006135cd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661398c9092919063ffffffff16565b80519091501561166957808060200190518101906135eb919061414a565b6116695760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106ca565b60006136586026600161431a565b61366390602061434d565b613670604084018461420d565b9050146136e15760405162461bcd60e51b81526020600482015260446024820181905260008051602061485d833981519152908201527f7242616c616e63653a2050726f6f662068617320696e636f7272656374206c656064820152630dccee8d60e31b608482015260a4016106ca565b60006136ee600485614764565b64ffffffffff169050613748613707604085018561420d565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508992505050602086013584613249565b6137a85760405162461bcd60e51b815260206004820152603e602482015260008051602061485d83398151915260448201527f7242616c616e63653a20496e76616c6964206d65726b6c652070726f6f66000060648201526084016106ca565b6137b683602001358561399b565b9150505b9392505050565b60006137ba6001600160401b03808416908516614788565b600083516000141580156137f85750602084516137f69190614507565b155b6138875760405162461bcd60e51b815260206004820152605460248201527f4d65726b6c652e70726f63657373496e636c7573696f6e50726f6f665368613260448201527f35363a2070726f6f66206c656e6774682073686f756c642062652061206e6f6e60648201527316bd32b9379036bab63a34b836329037b310199960611b608482015260a4016106ca565b604080516020808201909252848152905b8551811161391b576138ab600285614507565b6138de578151600052808601516020526020826040600060026107d05a03fa6138d357600080fd5b600284049350613909565b8086015160005281516020526020826040600060026107d05a03fa61390257600080fd5b6002840493505b61391460208261431a565b9050613898565b5051949350505050565b60f881901c60e882901c61ff00161760d882901c62ff0000161760c882901c63ff000000161764ff0000000060b883901c161765ff000000000060a883901c161766ff000000000000609883901c161767ff0000000000000060889290921c919091161790565b6060610fe784846000856139c8565b6000806139a96004846147d8565b6139b49060406147fc565b64ffffffffff169050610fe784821b613925565b606082471015613a295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106ca565b6001600160a01b0385163b613a805760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106ca565b600080866001600160a01b03168587604051613a9c91906143b3565b60006040518083038185875af1925050503d8060008114613ad9576040519150601f19603f3d011682016040523d82523d6000602084013e613ade565b606091505b5091509150613aee828286613af9565b979650505050505050565b60608315613b085750816137ba565b825115613b185782518084602001fd5b8160405162461bcd60e51b81526004016106ca9190614829565b80356001600160401b0381168114613b4957600080fd5b919050565b600060408284031215613b6057600080fd5b50919050565b600080600060608486031215613b7b57600080fd5b613b8484613b32565b925060208401356001600160401b0380821115613ba057600080fd5b613bac87838801613b4e565b93506040860135915080821115613bc257600080fd5b50613bcf86828701613b4e565b9150509250925092565b60008083601f840112613beb57600080fd5b5081356001600160401b03811115613c0257600080fd5b6020830191508360208260051b8501011115613c1d57600080fd5b9250929050565b60008060008060008060008060a0898b031215613c4057600080fd5b613c4989613b32565b975060208901356001600160401b0380821115613c6557600080fd5b613c718c838d01613b4e565b985060408b0135915080821115613c8757600080fd5b613c938c838d01613bd9565b909850965060608b0135915080821115613cac57600080fd5b613cb88c838d01613bd9565b909650945060808b0135915080821115613cd157600080fd5b50613cde8b828c01613bd9565b999c989b5096995094979396929594505050565b600060208284031215613d0457600080fd5b6137ba82613b32565b60008083601f840112613d1f57600080fd5b5081356001600160401b03811115613d3657600080fd5b602083019150836020828501011115613c1d57600080fd5b60008060208385031215613d6157600080fd5b82356001600160401b03811115613d7757600080fd5b613d8385828601613d0d565b90969095509350505050565b634e487b7160e01b600052602160045260246000fd5b60038110613dc357634e487b7160e01b600052602160045260246000fd5b9052565b60208101610e358284613da5565b600060208284031215613de757600080fd5b5035919050565b60006080820190506001600160401b03808451168352806020850151166020840152806040850151166040840152506060830151613e2f6060840182613da5565b5092915050565b801515811461324657600080fd5b600060208284031215613e5657600080fd5b81356137ba81613e36565b600080600080600060608688031215613e7957600080fd5b85356001600160401b0380821115613e9057600080fd5b613e9c89838a01613d0d565b90975095506020880135915080821115613eb557600080fd5b50613ec288828901613d0d565b96999598509660400135949350505050565b6001600160a01b038116811461324657600080fd5b8035613b4981613ed4565b60008060408385031215613f0757600080fd5b8235613f1281613ed4565b946020939093013593505050565b600060208284031215613f3257600080fd5b81356137ba81613ed4565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613f7b57613f7b613f3d565b604052919050565b60006001600160401b03821115613f9c57613f9c613f3d565b5060051b60200190565b600082601f830112613fb757600080fd5b81356020613fcc613fc783613f83565b613f53565b82815260059290921b84018101918181019086841115613feb57600080fd5b8286015b848110156140065780358352918301918301613fef565b509695505050505050565b60008060006060848603121561402657600080fd5b83356001600160401b038082111561403d57600080fd5b818601915086601f83011261405157600080fd5b81356020614061613fc783613f83565b82815260059290921b8401810191818101908a84111561408057600080fd5b948201945b838610156140a757853561409881613ed4565b82529482019490820190614085565b975050870135925050808211156140bd57600080fd5b506140ca86828701613fa6565b9250506140d960408501613ee9565b90509250925092565b6000806000604084860312156140f757600080fd5b83356001600160401b038082111561410e57600080fd5b61411a87838801613b4e565b9450602086013591508082111561413057600080fd5b5061413d86828701613bd9565b9497909650939450505050565b60006020828403121561415c57600080fd5b81516137ba81613e36565b6020808252603e908201527f456967656e506f642e6f6e6c795768656e4e6f745061757365643a20696e646560408201527f782069732070617573656420696e20456967656e506f644d616e616765720000606082015260800190565b6000808335601e198436030181126141db57600080fd5b8301803591506001600160401b038211156141f557600080fd5b6020019150600581901b3603821315613c1d57600080fd5b6000808335601e1984360301811261422457600080fd5b8301803591506001600160401b0382111561423e57600080fd5b602001915036819003821315613c1d57600080fd5b6020808252604e908201527f456967656e506f642e6f6e6c794f776e65724f7250726f6f665375626d69747460408201527f65723a2063616c6c6572206973206e6f7420706f64206f776e6572206f72207060608201526d3937b7b31039bab136b4ba3a32b960911b608082015260a00190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156142ef57600080fd5b813564ffffffffff811681146137ba57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111561432d5761432d614304565b500190565b600060001982141561434657614346614304565b5060010190565b600081600019048311821515161561436757614367614304565b500290565b60008282101561437e5761437e614304565b500390565b60005b8381101561439e578181015183820152602001614386565b838111156143ad576000848401525b50505050565b600082516143c5818460208701614383565b9190910192915050565b6000602082840312156143e157600080fd5b5051919050565b60208082526031908201527f456967656e506f642e6f6e6c79456967656e506f644d616e616765723a206e6f6040820152703a1032b4b3b2b72837b226b0b730b3b2b960791b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845261447a816020860160208601614383565b601f01601f19169290920160200192915050565b6080815260006144a260808301888a614439565b82810360208401526144b48188614462565b905082810360408401526144c9818688614439565b915050826060830152979650505050505050565b602081526000610fe7602083018486614439565b634e487b7160e01b600052601260045260246000fd5b600082614516576145166144f1565b500690565b60008261452a5761452a6144f1565b500490565b60006001600160401b038381169083168181101561454f5761454f614304565b039392505050565b60208082526028908201527f456967656e506f642e6f6e6c79456967656e506f644f776e65723a206e6f74206040820152673837b227bbb732b960c11b606082015260800190565b60008235605e198336030181126143c557600080fd5b600062ffffff8216806145ca576145ca614304565b6000190192915050565b600081600f0b83600f0b600082128260016001607f1b03038213811516156145fe576145fe614304565b8260016001607f1b031903821281161561461a5761461a614304565b50019392505050565b60006001600160401b0380831681851680830382111561464557614645614304565b01949350505050565b80516020808301519190811015613b605760001960209190910360031b1b16919050565b60008351614684818460208801614383565b6001600160801b0319939093169190920190815260100192915050565b6000816146b0576146b0614304565b506000190190565b600081600f0b60016001607f1b03198114156146d6576146d6614304565b60000392915050565b60006001600160ff1b038184138284138082168684048611161561470557614705614304565b600160ff1b600087128281168783058912161561472457614724614304565b6000871292508782058712848416161561474057614740614304565b8785058712818416161561475657614756614304565b505050929093029392505050565b600064ffffffffff8084168061477c5761477c6144f1565b92169190910492915050565b600081600f0b83600f0b600081128160016001607f1b0319018312811516156147b3576147b3614304565b8160016001607f1b030183138116156147ce576147ce614304565b5090039392505050565b600064ffffffffff808416806147f0576147f06144f1565b92169190910692915050565b600064ffffffffff8083168185168183048111821515161561482057614820614304565b02949350505050565b6020815260006137ba602083018461446256fe456967656e506f642e5f7665726966795769746864726177616c43726564656e426561636f6e436861696e50726f6f66732e76657269667956616c696461746fa2646970667358221220721ae261e7ea8172633ca39b5c47509345abd9d23c9a1d07374863ca537d102264736f6c634300080c0033", + Bin: "0x60e06040523480156200001157600080fd5b5060405162004ad038038062004ad0833981016040819052620000349162000142565b6001600160a01b03808416608052821660a0526001600160401b03811660c0526200005e62000067565b505050620001a1565b600054610100900460ff1615620000d45760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000127576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200013f57600080fd5b50565b6000806000606084860312156200015857600080fd5b8351620001658162000129565b6020850151909350620001788162000129565b60408501519092506001600160401b03811681146200019657600080fd5b809150509250925092565b60805160a05160c0516148b26200021e60003960006105ff0152600081816102bd0152818161063a015281816106ec01528181610abf01528181610d6c015281816110f40152818161119c0152818161143c015281816118db01528181611a8401526131250152600081816104b8015261126701526148b26000f3fe60806040526004361061016a5760003560e01c80636fcd0e53116100d1578063c49074421161008a578063dda3346c11610064578063dda3346c1461058d578063ee94d67c146105ad578063f074ba62146105cd578063f2882461146105ed57600080fd5b8063c49074421461052d578063c4d66de81461054d578063d06d55871461056d57600080fd5b80636fcd0e53146104425780637439841f1461046f57806374cdd798146104a657806388676cad146104da5780639b4e4634146104fa578063b522538a1461050d57600080fd5b80634665bcda116101235780634665bcda146102ab57806347d28372146102df57806352396a591461039f57806358753357146103d557806358eaee79146103f55780636c0d2d5a1461042257600080fd5b8063039157d2146101a95780630b18ff66146101cb5780632340e8d3146102085780633474aa161461022c5780633f65cf191461026457806342ecff2a1461028457600080fd5b366101a4576040513481527f6fdd3dbdb173299608c0aa9f368735857c8842b581f8389238bf05bd04b3bf499060200160405180910390a1005b600080fd5b3480156101b557600080fd5b506101c96101c4366004613b66565b610621565b005b3480156101d757600080fd5b506033546101eb906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561021457600080fd5b5061021e60395481565b6040519081526020016101ff565b34801561023857600080fd5b5060345461024c906001600160401b031681565b6040516001600160401b0390911681526020016101ff565b34801561027057600080fd5b506101c961027f366004613c24565b610a67565b34801561029057600080fd5b50603a5461024c90600160401b90046001600160401b031681565b3480156102b757600080fd5b506101eb7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102eb57600080fd5b5061035b6040805160808101825260008082526020820181905291810182905260608101919091525060408051608081018252603c548152603d5462ffffff811660208301526001600160401b03630100000082041692820192909252600160581b909104600f0b606082015290565b6040516101ff91908151815260208083015162ffffff16908201526040808301516001600160401b031690820152606091820151600f0b9181019190915260800190565b3480156103ab57600080fd5b5061024c6103ba366004613cf2565b603b602052600090815260409020546001600160401b031681565b3480156103e157600080fd5b50603e546101eb906001600160a01b031681565b34801561040157600080fd5b50610415610410366004613d4e565b610dd6565b6040516101ff9190613dc7565b34801561042e57600080fd5b5061021e61043d366004613cf2565b610e3b565b34801561044e57600080fd5b5061046261045d366004613dd5565b610fef565b6040516101ff9190613dee565b34801561047b57600080fd5b5061041561048a366004613dd5565b600090815260366020526040902054600160c01b900460ff1690565b3480156104b257600080fd5b506101eb7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104e657600080fd5b506101c96104f5366004613e44565b61109c565b6101c9610508366004613e61565b611191565b34801561051957600080fd5b50610462610528366004613d4e565b61133e565b34801561053957600080fd5b506101c9610548366004613ef4565b611431565b34801561055957600080fd5b506101c9610568366004613f20565b61166e565b34801561057957600080fd5b506101c9610588366004613f20565b611805565b34801561059957600080fd5b506101c96105a8366004614011565b611898565b3480156105b957600080fd5b50603a5461024c906001600160401b031681565b3480156105d957600080fd5b506101c96105e83660046140e2565b611a6b565b3480156105f957600080fd5b5061024c7f000000000000000000000000000000000000000000000000000000000000000081565b604051635ac86ab760e01b8152600660048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ad919061414a565b156106d35760405162461bcd60e51b81526004016106ca90614167565b60405180910390fd5b604051635ac86ab760e01b8152600860048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f919061414a565b1561077c5760405162461bcd60e51b81526004016106ca90614167565b60006107c261078b85806141c4565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611ebe92505050565b6000818152603660209081526040808320815160808101835281546001600160401b038082168352600160401b8204811695830195909552600160801b8104909416928101929092529394509192906060830190600160c01b900460ff16600281111561083157610831613d8f565b600281111561084257610842613d8f565b81525050905080604001516001600160401b0316876001600160401b0316116108d5576040805162461bcd60e51b81526020600482015260248101919091527f456967656e506f642e7665726966795374616c6542616c616e63653a2070726f60448201527f6f66206973206f6c646572207468616e206c61737420636865636b706f696e7460648201526084016106ca565b6001816060015160028111156108ed576108ed613d8f565b146109575760405162461bcd60e51b815260206004820152603460248201527f456967656e506f642e7665726966795374616c6542616c616e63653a2076616c604482015273696461746f72206973206e6f742061637469766560601b60648201526084016106ca565b61099b61096486806141c4565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611ee292505050565b610a1f5760405162461bcd60e51b815260206004820152604960248201527f456967656e506f642e7665726966795374616c6542616c616e63653a2076616c60448201527f696461746f72206d75737420626520736c617368656420746f206265206d61726064820152686b6564207374616c6560b81b608482015260a4016106ca565b610a31610a2b88610e3b565b87611f0c565b610a548635610a4087806141c4565b610a4d60208a018a61420d565b8651612067565b610a5e600061227e565b50505050505050565b6033546001600160a01b0316331480610a8a5750603e546001600160a01b031633145b610aa65760405162461bcd60e51b81526004016106ca90614253565b604051635ac86ab760e01b8152600260048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b32919061414a565b15610b4f5760405162461bcd60e51b81526004016106ca90614167565b8584148015610b5d57508382145b610bed5760405162461bcd60e51b815260206004820152605560248201527f456967656e506f642e7665726966795769746864726177616c43726564656e7460448201527f69616c733a2076616c696461746f72496e646963657320616e642070726f6f666064820152740e640daeae6e840c4ca40e6c2daca40d8cadccee8d605b1b608482015260a4016106ca565b603a546001600160401b03600160401b9091048116908a1611610c8d5760405162461bcd60e51b815260206004820152604c60248201527f456967656e506f642e7665726966795769746864726177616c43726564656e7460448201527f69616c733a207370656369666965642074696d657374616d7020697320746f6f60648201526b0819985c881a5b881c185cdd60a21b608482015260a4016106ca565b610c9f610c998a610e3b565b89611f0c565b6000805b87811015610d4257610d248a358a8a84818110610cc257610cc26142c7565b9050602002016020810190610cd791906142dd565b898985818110610ce957610ce96142c7565b9050602002810190610cfb919061420d565b898987818110610d0d57610d0d6142c7565b9050602002810190610d1f91906141c4565b612514565b610d2e908361431a565b915080610d3a81614332565b915050610ca3565b5060335460405163030b147160e61b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063c2c51c4090604401600060405180830381600087803b158015610db257600080fd5b505af1158015610dc6573d6000803e3d6000fd5b5050505050505050505050505050565b600080610e1884848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612afa92505050565b600090815260366020526040902054600160c01b900460ff169150505b92915050565b6000610e4a611fff600c61434d565b610e5d6001600160401b0384164261436c565b10610ec65760405162461bcd60e51b815260206004820152603360248201527f456967656e506f642e676574506172656e74426c6f636b526f6f743a2074696d604482015272657374616d70206f7574206f662072616e676560681b60648201526084016106ca565b604080516001600160401b03841660208201526000918291720f3df6d732807ef1319fb7b8bb8522d0beac02910160408051601f1981840301815290829052610f0e916143b3565b600060405180830381855afa9150503d8060008114610f49576040519150601f19603f3d011682016040523d82523d6000602084013e610f4e565b606091505b5091509150818015610f61575060008151115b610fd35760405162461bcd60e51b815260206004820152603860248201527f456967656e506f642e676574506172656e74426c6f636b526f6f743a20696e7660448201527f616c696420626c6f636b20726f6f742072657475726e6564000000000000000060648201526084016106ca565b80806020019051810190610fe791906143cf565b949350505050565b6110176040805160808101825260008082526020820181905291810182905290606082015290565b600082815260366020908152604091829020825160808101845281546001600160401b038082168352600160401b8204811694830194909452600160801b810490931693810193909352906060830190600160c01b900460ff16600281111561108257611082613d8f565b600281111561109357611093613d8f565b90525092915050565b6033546001600160a01b03163314806110bf5750603e546001600160a01b031633145b6110db5760405162461bcd60e51b81526004016106ca90614253565b604051635ac86ab760e01b8152600660048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa158015611143573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611167919061414a565b156111845760405162461bcd60e51b81526004016106ca90614167565b61118d8261227e565b5050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111d95760405162461bcd60e51b81526004016106ca906143e8565b346801bc16d674ec800000146112655760405162461bcd60e51b8152602060048201526044602482018190527f456967656e506f642e7374616b653a206d75737420696e697469616c6c792073908201527f74616b6520666f7220616e792076616c696461746f72207769746820333220656064820152633a3432b960e11b608482015260a4016106ca565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663228951186801bc16d674ec80000087876112a8612bf4565b8888886040518863ffffffff1660e01b81526004016112cc9695949392919061448e565b6000604051808303818588803b1580156112e557600080fd5b505af11580156112f9573d6000803e3d6000fd5b50505050507f606865b7934a25d4aed43f6cdb426403353fa4b3009c4d228407474581b01e23858560405161132f9291906144dd565b60405180910390a15050505050565b6113666040805160808101825260008082526020820181905291810182905290606082015290565b603660006113a985858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612afa92505050565b81526020808201929092526040908101600020815160808101835281546001600160401b038082168352600160401b8204811695830195909552600160801b81049094169281019290925290916060830190600160c01b900460ff16600281111561141657611416613d8f565b600281111561142757611427613d8f565b9052509392505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114795760405162461bcd60e51b81526004016106ca906143e8565b611487633b9aca0082614507565b156115115760405162461bcd60e51b815260206004820152604e60248201527f456967656e506f642e776974686472617752657374616b6564426561636f6e4360448201527f6861696e4554483a20616d6f756e74576569206d75737420626520612077686f60648201526d1b194811ddd95a48185b5bdd5b9d60921b608482015260a4016106ca565b6000611521633b9aca008361451b565b6034549091506001600160401b0390811690821611156115da5760405162461bcd60e51b815260206004820152606260248201527f456967656e506f642e776974686472617752657374616b6564426561636f6e4360448201527f6861696e4554483a20616d6f756e74477765692065786365656473207769746860648201527f6472617761626c6552657374616b6564457865637574696f6e4c617965724777608482015261656960f01b60a482015260c4016106ca565b603480548291906000906115f89084906001600160401b031661452f565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550826001600160a01b03167f8947fd2ce07ef9cc302c4e8f0461015615d91ce851564839e91cc804c2f49d8e8360405161165791815260200190565b60405180910390a26116698383612c39565b505050565b600054610100900460ff161580801561168e5750600054600160ff909116105b806116a85750303b1580156116a8575060005460ff166001145b61170b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106ca565b6000805460ff19166001179055801561172e576000805461ff0019166101001790555b6001600160a01b0382166117a15760405162461bcd60e51b815260206004820152603460248201527f456967656e506f642e696e697469616c697a653a20706f644f776e65722063616044820152736e6e6f74206265207a65726f206164647265737360601b60648201526084016106ca565b603380546001600160a01b0319166001600160a01b038416179055801561118d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6033546001600160a01b0316331461182f5760405162461bcd60e51b81526004016106ca90614557565b603e54604080516001600160a01b03928316815291831660208301527ffb8129080a19d34dceac04ba253fc50304dc86c729bd63cdca4a969ad19a5eac910160405180910390a1603e80546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b031633146118c25760405162461bcd60e51b81526004016106ca90614557565b604051635ac86ab760e01b8152600560048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa15801561192a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194e919061414a565b1561196b5760405162461bcd60e51b81526004016106ca90614167565b82518451146119f65760405162461bcd60e51b815260206004820152604b60248201527f456967656e506f642e7265636f766572546f6b656e733a20746f6b656e4c697360448201527f7420616e6420616d6f756e7473546f5769746864726177206d7573742062652060648201526a0e6c2daca40d8cadccee8d60ab1b608482015260a4016106ca565b60005b8451811015611a6457611a5283858381518110611a1857611a186142c7565b6020026020010151878481518110611a3257611a326142c7565b60200260200101516001600160a01b0316612d529092919063ffffffff16565b80611a5c81614332565b9150506119f9565b5050505050565b604051635ac86ab760e01b8152600760048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635ac86ab790602401602060405180830381865afa158015611ad3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af7919061414a565b15611b145760405162461bcd60e51b81526004016106ca90614167565b603a54600160401b90046001600160401b031680611bc05760405162461bcd60e51b815260206004820152605860248201527f456967656e506f642e766572696679436865636b706f696e7450726f6f66733a60448201527f206d75737420686176652061637469766520636865636b706f696e7420746f2060648201527f706572666f726d20636865636b706f696e742070726f6f660000000000000000608482015260a4016106ca565b60408051608081018252603c54808252603d5462ffffff811660208401526001600160401b03630100000082041693830193909352600160581b909204600f0b606082015290611c109087612da4565b6000805b85811015611e645736878783818110611c2f57611c2f6142c7565b9050602002810190611c41919061459f565b80356000908152603660209081526040808320815160808101835281546001600160401b038082168352600160401b8204811695830195909552600160801b8104909416928101929092529394509192906060830190600160c01b900460ff166002811115611cb257611cb2613d8f565b6002811115611cc357611cc3613d8f565b9052509050600181606001516002811115611ce057611ce0613d8f565b14611cec575050611e52565b856001600160401b031681604001516001600160401b031610611d10575050611e52565b600080611d2083898e3587612f20565b602089018051929450909250611d35826145b5565b62ffffff16905250606087018051839190611d519083906145d4565b600f0b905250611d618187614623565b84356000908152603660209081526040918290208651815492880151938801516001600160401b03908116600160801b0267ffffffffffffffff60801b19958216600160401b026001600160801b0319909516919092161792909217928316821781556060870151939950869390929091839160ff60c01b1990911668ffffffffffffffffff60801b1990911617600160c01b836002811115611e0657611e06613d8f565b021790555050835160405164ffffffffff90911691506001600160401b038a16907fa91c59033c3423e18b54d0acecebb4972f9ea95aedf5f4cae3b677b02eaf3a3f90600090a3505050505b80611e5c81614332565b915050611c14565b506001600160401b038084166000908152603b6020526040812080548493919291611e9191859116614623565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550610a5e82613042565b600081600081518110611ed357611ed36142c7565b60200260200101519050919050565b600081600381518110611ef757611ef76142c7565b60200260200101516000801b14159050919050565b611f186003602061434d565b611f25602083018361420d565b905014611f9a5760405162461bcd60e51b815260206004820152603d60248201527f426561636f6e436861696e50726f6f66732e7665726966795374617465526f6f60448201527f743a2050726f6f662068617320696e636f7272656374206c656e67746800000060648201526084016106ca565b611fea611faa602083018361420d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525086925050843590506003613249565b61118d5760405162461bcd60e51b815260206004820152604260248201527f426561636f6e436861696e50726f6f66732e7665726966795374617465526f6f60448201527f743a20496e76616c696420737461746520726f6f74206d65726b6c652070726f60648201526137b360f11b608482015260a4016106ca565b600884146120e25760405162461bcd60e51b815260206004820152604e602482015260008051602061485d83398151915260448201527f724669656c64733a2056616c696461746f72206669656c64732068617320696e60648201526d0c6dee4e4cac6e840d8cadccee8d60931b608482015260a4016106ca565b60056120f06028600161431a565b6120fa919061431a565b61210590602061434d565b82146121735760405162461bcd60e51b8152602060048201526043602482015260008051602061485d83398151915260448201527f724669656c64733a2050726f6f662068617320696e636f7272656374206c656e6064820152620cee8d60eb1b608482015260a4016106ca565b60006121b186868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061326192505050565b9050600064ffffffffff83166121c96028600161431a565b600b901b17905061221485858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c9250869150859050613249565b6122745760405162461bcd60e51b815260206004820152603d602482015260008051602061485d83398151915260448201527f724669656c64733a20496e76616c6964206d65726b6c652070726f6f6600000060648201526084016106ca565b5050505050505050565b603a54600160401b90046001600160401b03161561231f5760405162461bcd60e51b815260206004820152605260248201527f456967656e506f642e5f7374617274436865636b706f696e743a206d7573742060448201527f66696e6973682070726576696f757320636865636b706f696e74206265666f72606482015271329039ba30b93a34b7339030b737ba3432b960711b608482015260a4016106ca565b603a54426001600160401b03908116911614156123a45760405162461bcd60e51b815260206004820152603f60248201527f456967656e506f642e5f7374617274436865636b706f696e743a2063616e6e6f60448201527f7420636865636b706f696e7420747769636520696e206f6e6520626c6f636b0060648201526084016106ca565b6034546000906001600160401b03166123c1633b9aca004761451b565b6123cb919061452f565b90508180156123e157506001600160401b038116155b156124545760405162461bcd60e51b815260206004820152603d60248201527f456967656e506f642e5f7374617274436865636b706f696e743a206e6f20626160448201527f6c616e636520617661696c61626c6520746f20636865636b706f696e7400000060648201526084016106ca565b6000604051806080016040528061246a42610e3b565b815260200160395462ffffff168152602001836001600160401b031681526020016000600f0b815250905042603a60086101000a8154816001600160401b0302191690836001600160401b031602179055506124c581613042565b805160208083015160405162ffffff90911681526001600160401b034216917f575796133bbed337e5b39aa49a30dc2556a91e0c6c2af4b7b886ae77ebef1076910160405180910390a3505050565b600080612553848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611ebe92505050565b6000818152603660209081526040808320815160808101835281546001600160401b038082168352600160401b8204811695830195909552600160801b8104909416928101929092529394509192906060830190600160c01b900460ff1660028111156125c2576125c2613d8f565b60028111156125d3576125d3613d8f565b90525090506000816060015160028111156125f0576125f0613d8f565b146126815760405162461bcd60e51b8152602060048201526061602482015260008051602061483d83398151915260448201527f7469616c733a2076616c696461746f72206d75737420626520696e616374697660648201527f6520746f2070726f7665207769746864726177616c2063726564656e7469616c6084820152607360f81b60a482015260c4016106ca565b6001600160401b0380166126c786868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061350e92505050565b6001600160401b031614156127505760405162461bcd60e51b8152602060048201526055602482015260008051602061483d83398151915260448201527f7469616c733a2076616c696461746f72206d75737420626520696e207468652060648201527470726f63657373206f662061637469766174696e6760581b608482015260a4016106ca565b6001600160401b03801661279686868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061353392505050565b6001600160401b03161461280e5760405162461bcd60e51b81526020600482015260446024820181905260008051602061483d833981519152908201527f7469616c733a2076616c696461746f72206d757374206e6f742062652065786960648201526374696e6760e01b608482015260a4016106ca565b612816612bf4565b61281f9061464e565b61285b86868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061354b92505050565b146128ca5760405162461bcd60e51b8152602060048201526045602482015260008051602061483d83398151915260448201527f7469616c733a2070726f6f66206973206e6f7420666f72207468697320456967606482015264195b941bd960da1b608482015260a4016106ca565b600061290886868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061356092505050565b90506129188a87878b8b8e612067565b6039805490600061292883614332565b9091555050603a54600090600160401b90046001600160401b03161561296057603a54600160401b90046001600160401b031661296d565b603a546001600160401b03165b6040805160808101825264ffffffffff8d1681526001600160401b03858116602083015283169181019190915290915060608101600190526000858152603660209081526040918290208351815492850151938501516001600160401b03908116600160801b0267ffffffffffffffff60801b19958216600160401b026001600160801b031990951691909216179290921792831682178155606084015190929091839160ff60c01b1990911668ffffffffffffffffff60801b1990911617600160c01b836002811115612a4357612a43613d8f565b02179055505060405164ffffffffff8c1681527f2d0800bbc377ea54a08c5db6a87aafff5e3e9c8fead0eda110e40e0c10441449915060200160405180910390a16040805164ffffffffff8c1681526001600160401b03838116602083015284168183015290517f0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df9181900360600190a1612aeb633b9aca006001600160401b03841661434d565b9b9a5050505050505050505050565b60008151603014612b835760405162461bcd60e51b815260206004820152604760248201527f456967656e506f642e5f63616c63756c61746556616c696461746f725075626b60448201527f657948617368206d75737420626520612034382d6279746520424c53207075626064820152666c6963206b657960c81b608482015260a4016106ca565b604051600290612b9a908490600090602001614672565b60408051601f1981840301815290829052612bb4916143b3565b602060405180830381855afa158015612bd1573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610e3591906143cf565b60408051600160f81b60208201526000602182015230606090811b6bffffffffffffffffffffffff1916602c8301529101604051602081830303815290604052905090565b80471015612c895760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016106ca565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612cd6576040519150601f19603f3d011682016040523d82523d6000602084013e612cdb565b606091505b50509050806116695760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016106ca565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611669908490613578565b612db06005600361431a565b612dbb90602061434d565b612dc8602083018361420d565b905014612e4b5760405162461bcd60e51b8152602060048201526044602482018190527f426561636f6e436861696e50726f6f66732e76657269667942616c616e636543908201527f6f6e7461696e65723a2050726f6f662068617320696e636f7272656374206c656064820152630dccee8d60e31b608482015260a4016106ca565b606c612e9c612e5d602084018461420d565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250508535905084613249565b6116695760405162461bcd60e51b815260206004820152604960248201527f426561636f6e436861696e50726f6f66732e76657269667942616c616e63654360448201527f6f6e7461696e65723a20696e76616c69642062616c616e636520636f6e7461696064820152683732b910383937b7b360b91b608482015260a4016106ca565b83516020850151600091829182612f3887848861364a565b9050816001600160401b0316816001600160401b031614612fb257612f5d81836137c1565b6040805164ffffffffff861681526001600160401b038b8116602083015284168183015290519196507f0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df919081900360600190a15b6001600160401b0380821660208b0181905290891660408b01526130365760398054906000612fe0836146a1565b9091555050600260608a0152612ff5856146b8565b93508264ffffffffff16886001600160401b03167f2a02361ffa66cf2c2da4682c2355a6adcaa9f6c227b6e6563e68480f9587626a60405160405180910390a35b50505094509492505050565b602081015162ffffff166131c9576000633b9aca00826060015183604001516001600160401b031661307491906145d4565b600f0b61308191906146df565b60408301516034805492935090916000906130a69084906001600160401b0316614623565b82546101009290920a6001600160401b03818102199093169183160217909155603a8054600160401b81049092166001600160801b0319909216919091179055506000603c55603d80546001600160d81b031916905560335460405163030b147160e61b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063c2c51c4090604401600060405180830381600087803b15801561316b57600080fd5b505af115801561317f573d6000803e3d6000fd5b5050603a546040518481526001600160401b0390911692507f525408c201bc1576eb44116f6478f1c2a54775b19a043bcfdc708364f74f8e44915060200160405180910390a25050565b8051603c556020810151603d8054604084015160608501516fffffffffffffffffffffffffffffffff16600160581b026fffffffffffffffffffffffffffffffff60581b196001600160401b039092166301000000026affffffffffffffffffffff1990931662ffffff9095169490941791909117169190911790555b50565b6000836132578685856137d9565b1495945050505050565b60008060028351613272919061451b565b90506000816001600160401b0381111561328e5761328e613f3d565b6040519080825280602002602001820160405280156132b7578160200160208202803683370190505b50905060005b828110156133be576002856132d2838361434d565b815181106132e2576132e26142c7565b6020026020010151868360026132f8919061434d565b61330390600161431a565b81518110613313576133136142c7565b6020026020010151604051602001613335929190918252602082015260400190565b60408051601f198184030181529082905261334f916143b3565b602060405180830381855afa15801561336c573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061338f91906143cf565b8282815181106133a1576133a16142c7565b6020908102919091010152806133b681614332565b9150506132bd565b506133ca60028361451b565b91505b81156134ea5760005b828110156134d7576002826133eb838361434d565b815181106133fb576133fb6142c7565b602002602001015183836002613411919061434d565b61341c90600161431a565b8151811061342c5761342c6142c7565b602002602001015160405160200161344e929190918252602082015260400190565b60408051601f1981840301815290829052613468916143b3565b602060405180830381855afa158015613485573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906134a891906143cf565b8282815181106134ba576134ba6142c7565b6020908102919091010152806134cf81614332565b9150506133d6565b506134e360028361451b565b91506133cd565b806000815181106134fd576134fd6142c7565b602002602001015192505050919050565b6000610e3582600581518110613526576135266142c7565b6020026020010151613925565b6000610e3582600681518110613526576135266142c7565b600081600181518110611ed357611ed36142c7565b6000610e3582600281518110613526576135266142c7565b60006135cd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661398c9092919063ffffffff16565b80519091501561166957808060200190518101906135eb919061414a565b6116695760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106ca565b60006136586026600161431a565b61366390602061434d565b613670604084018461420d565b9050146136e15760405162461bcd60e51b81526020600482015260446024820181905260008051602061485d833981519152908201527f7242616c616e63653a2050726f6f662068617320696e636f7272656374206c656064820152630dccee8d60e31b608482015260a4016106ca565b60006136ee600485614764565b64ffffffffff169050613748613707604085018561420d565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508992505050602086013584613249565b6137a85760405162461bcd60e51b815260206004820152603e602482015260008051602061485d83398151915260448201527f7242616c616e63653a20496e76616c6964206d65726b6c652070726f6f66000060648201526084016106ca565b6137b683602001358561399b565b9150505b9392505050565b60006137ba6001600160401b03808416908516614788565b600083516000141580156137f85750602084516137f69190614507565b155b6138875760405162461bcd60e51b815260206004820152605460248201527f4d65726b6c652e70726f63657373496e636c7573696f6e50726f6f665368613260448201527f35363a2070726f6f66206c656e6774682073686f756c642062652061206e6f6e60648201527316bd32b9379036bab63a34b836329037b310199960611b608482015260a4016106ca565b604080516020808201909252848152905b8551811161391b576138ab600285614507565b6138de578151600052808601516020526020826040600060026107d05a03fa6138d357600080fd5b600284049350613909565b8086015160005281516020526020826040600060026107d05a03fa61390257600080fd5b6002840493505b61391460208261431a565b9050613898565b5051949350505050565b60f881901c60e882901c61ff00161760d882901c62ff0000161760c882901c63ff000000161764ff0000000060b883901c161765ff000000000060a883901c161766ff000000000000609883901c161767ff0000000000000060889290921c919091161790565b6060610fe784846000856139c8565b6000806139a96004846147d8565b6139b49060406147fc565b64ffffffffff169050610fe784821b613925565b606082471015613a295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106ca565b6001600160a01b0385163b613a805760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106ca565b600080866001600160a01b03168587604051613a9c91906143b3565b60006040518083038185875af1925050503d8060008114613ad9576040519150601f19603f3d011682016040523d82523d6000602084013e613ade565b606091505b5091509150613aee828286613af9565b979650505050505050565b60608315613b085750816137ba565b825115613b185782518084602001fd5b8160405162461bcd60e51b81526004016106ca9190614829565b80356001600160401b0381168114613b4957600080fd5b919050565b600060408284031215613b6057600080fd5b50919050565b600080600060608486031215613b7b57600080fd5b613b8484613b32565b925060208401356001600160401b0380821115613ba057600080fd5b613bac87838801613b4e565b93506040860135915080821115613bc257600080fd5b50613bcf86828701613b4e565b9150509250925092565b60008083601f840112613beb57600080fd5b5081356001600160401b03811115613c0257600080fd5b6020830191508360208260051b8501011115613c1d57600080fd5b9250929050565b60008060008060008060008060a0898b031215613c4057600080fd5b613c4989613b32565b975060208901356001600160401b0380821115613c6557600080fd5b613c718c838d01613b4e565b985060408b0135915080821115613c8757600080fd5b613c938c838d01613bd9565b909850965060608b0135915080821115613cac57600080fd5b613cb88c838d01613bd9565b909650945060808b0135915080821115613cd157600080fd5b50613cde8b828c01613bd9565b999c989b5096995094979396929594505050565b600060208284031215613d0457600080fd5b6137ba82613b32565b60008083601f840112613d1f57600080fd5b5081356001600160401b03811115613d3657600080fd5b602083019150836020828501011115613c1d57600080fd5b60008060208385031215613d6157600080fd5b82356001600160401b03811115613d7757600080fd5b613d8385828601613d0d565b90969095509350505050565b634e487b7160e01b600052602160045260246000fd5b60038110613dc357634e487b7160e01b600052602160045260246000fd5b9052565b60208101610e358284613da5565b600060208284031215613de757600080fd5b5035919050565b60006080820190506001600160401b03808451168352806020850151166020840152806040850151166040840152506060830151613e2f6060840182613da5565b5092915050565b801515811461324657600080fd5b600060208284031215613e5657600080fd5b81356137ba81613e36565b600080600080600060608688031215613e7957600080fd5b85356001600160401b0380821115613e9057600080fd5b613e9c89838a01613d0d565b90975095506020880135915080821115613eb557600080fd5b50613ec288828901613d0d565b96999598509660400135949350505050565b6001600160a01b038116811461324657600080fd5b8035613b4981613ed4565b60008060408385031215613f0757600080fd5b8235613f1281613ed4565b946020939093013593505050565b600060208284031215613f3257600080fd5b81356137ba81613ed4565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613f7b57613f7b613f3d565b604052919050565b60006001600160401b03821115613f9c57613f9c613f3d565b5060051b60200190565b600082601f830112613fb757600080fd5b81356020613fcc613fc783613f83565b613f53565b82815260059290921b84018101918181019086841115613feb57600080fd5b8286015b848110156140065780358352918301918301613fef565b509695505050505050565b60008060006060848603121561402657600080fd5b83356001600160401b038082111561403d57600080fd5b818601915086601f83011261405157600080fd5b81356020614061613fc783613f83565b82815260059290921b8401810191818101908a84111561408057600080fd5b948201945b838610156140a757853561409881613ed4565b82529482019490820190614085565b975050870135925050808211156140bd57600080fd5b506140ca86828701613fa6565b9250506140d960408501613ee9565b90509250925092565b6000806000604084860312156140f757600080fd5b83356001600160401b038082111561410e57600080fd5b61411a87838801613b4e565b9450602086013591508082111561413057600080fd5b5061413d86828701613bd9565b9497909650939450505050565b60006020828403121561415c57600080fd5b81516137ba81613e36565b6020808252603e908201527f456967656e506f642e6f6e6c795768656e4e6f745061757365643a20696e646560408201527f782069732070617573656420696e20456967656e506f644d616e616765720000606082015260800190565b6000808335601e198436030181126141db57600080fd5b8301803591506001600160401b038211156141f557600080fd5b6020019150600581901b3603821315613c1d57600080fd5b6000808335601e1984360301811261422457600080fd5b8301803591506001600160401b0382111561423e57600080fd5b602001915036819003821315613c1d57600080fd5b6020808252604e908201527f456967656e506f642e6f6e6c794f776e65724f7250726f6f665375626d69747460408201527f65723a2063616c6c6572206973206e6f7420706f64206f776e6572206f72207060608201526d3937b7b31039bab136b4ba3a32b960911b608082015260a00190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156142ef57600080fd5b813564ffffffffff811681146137ba57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111561432d5761432d614304565b500190565b600060001982141561434657614346614304565b5060010190565b600081600019048311821515161561436757614367614304565b500290565b60008282101561437e5761437e614304565b500390565b60005b8381101561439e578181015183820152602001614386565b838111156143ad576000848401525b50505050565b600082516143c5818460208701614383565b9190910192915050565b6000602082840312156143e157600080fd5b5051919050565b60208082526031908201527f456967656e506f642e6f6e6c79456967656e506f644d616e616765723a206e6f6040820152703a1032b4b3b2b72837b226b0b730b3b2b960791b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845261447a816020860160208601614383565b601f01601f19169290920160200192915050565b6080815260006144a260808301888a614439565b82810360208401526144b48188614462565b905082810360408401526144c9818688614439565b915050826060830152979650505050505050565b602081526000610fe7602083018486614439565b634e487b7160e01b600052601260045260246000fd5b600082614516576145166144f1565b500690565b60008261452a5761452a6144f1565b500490565b60006001600160401b038381169083168181101561454f5761454f614304565b039392505050565b60208082526028908201527f456967656e506f642e6f6e6c79456967656e506f644f776e65723a206e6f74206040820152673837b227bbb732b960c11b606082015260800190565b60008235605e198336030181126143c557600080fd5b600062ffffff8216806145ca576145ca614304565b6000190192915050565b600081600f0b83600f0b600082128260016001607f1b03038213811516156145fe576145fe614304565b8260016001607f1b031903821281161561461a5761461a614304565b50019392505050565b60006001600160401b0380831681851680830382111561464557614645614304565b01949350505050565b80516020808301519190811015613b605760001960209190910360031b1b16919050565b60008351614684818460208801614383565b6001600160801b0319939093169190920190815260100192915050565b6000816146b0576146b0614304565b506000190190565b600081600f0b60016001607f1b03198114156146d6576146d6614304565b60000392915050565b60006001600160ff1b038184138284138082168684048611161561470557614705614304565b600160ff1b600087128281168783058912161561472457614724614304565b6000871292508782058712848416161561474057614740614304565b8785058712818416161561475657614756614304565b505050929093029392505050565b600064ffffffffff8084168061477c5761477c6144f1565b92169190910492915050565b600081600f0b83600f0b600081128160016001607f1b0319018312811516156147b3576147b3614304565b8160016001607f1b030183138116156147ce576147ce614304565b5090039392505050565b600064ffffffffff808416806147f0576147f06144f1565b92169190910692915050565b600064ffffffffff8083168185168183048111821515161561482057614820614304565b02949350505050565b6020815260006137ba602083018461446256fe456967656e506f642e5f7665726966795769746864726177616c43726564656e426561636f6e436861696e50726f6f66732e76657269667956616c696461746fa2646970667358221220a0086843155bf8ad45b1fbb808fe5513b931055366683586125d522ebf1d1f9c64736f6c634300080c0033", } // EigenPodABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/EigenPodManager/binding.go b/pkg/bindings/EigenPodManager/binding.go index 9b44ba82d..394bf5ae7 100644 --- a/pkg/bindings/EigenPodManager/binding.go +++ b/pkg/bindings/EigenPodManager/binding.go @@ -31,8 +31,8 @@ var ( // EigenPodManagerMetaData contains all meta data concerning the EigenPodManager contract. var EigenPodManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_ethPOS\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"},{\"name\":\"_eigenPodBeacon\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"},{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"},{\"name\":\"_slasher\",\"type\":\"address\",\"internalType\":\"contractISlasher\"},{\"name\":\"_delegationManager\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createPod\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodBeacon\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"_initPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"numPods\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownerToPod\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"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\":\"podOwnerShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordBeaconChainETHBalanceUpdate\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"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\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destination\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BeaconChainETHDeposited\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconChainETHWithdrawalCompleted\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"},{\"name\":\"delegatedAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewTotalShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newTotalShares\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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\":\"PodDeployed\",\"inputs\":[{\"name\":\"eigenPod\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodSharesUpdated\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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}]", - Bin: "0x6101206040523480156200001257600080fd5b50604051620031693803806200316983398101604081905262000035916200014b565b6001600160a01b0380861660805280851660a05280841660c05280831660e0528116610100526200006562000070565b5050505050620001cb565b600054610100900460ff1615620000dd5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000130576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200014857600080fd5b50565b600080600080600060a086880312156200016457600080fd5b8551620001718162000132565b6020870151909550620001848162000132565b6040870151909450620001978162000132565b6060870151909350620001aa8162000132565b6080870151909250620001bd8162000132565b809150509295509295909350565b60805160a05160c05160e05161010051612f286200024160003960008181610551015281816105fb01528181610b7901528181611313015281816117bf01526118af015260006104dd015260006102cf015260008181610263015281816112920152611e64015260006103af0152612f286000f3fe6080604052600436106101b75760003560e01c8063886f1195116100ec578063b13442711161008a578063ea4d3c9b11610064578063ea4d3c9b1461053f578063f2fde38b14610573578063f6848d2414610593578063fabc1cbc146105ce57600080fd5b8063b1344271146104cb578063beffbb89146104ff578063c2c51c401461051f57600080fd5b80639b4e4634116100c65780639b4e46341461044c5780639ba062751461045f578063a38406a314610495578063a6a509be146104b557600080fd5b8063886f1195146103e65780638da5cb5b146104065780639104c3191461042457600080fd5b8063595c6a671161015957806360f4062b1161013357806360f4062b1461035b578063715018a61461038857806374cdd7981461039d57806384d81062146103d157600080fd5b8063595c6a67146102f15780635ac86ab7146103065780635c975abb1461034657600080fd5b80631794bb3c116101955780631794bb3c14610231578063292b7b2b14610251578063387b13001461029d57806339b70e38146102bd57600080fd5b80630e81073c146101bc57806310d67a2f146101ef578063136439dd14610211575b600080fd5b3480156101c857600080fd5b506101dc6101d73660046120fc565b6105ee565b6040519081526020015b60405180910390f35b3480156101fb57600080fd5b5061020f61020a366004612128565b61085d565b005b34801561021d57600080fd5b5061020f61022c366004612145565b610910565b34801561023d57600080fd5b5061020f61024c36600461215e565b610a4f565b34801561025d57600080fd5b506102857f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101e6565b3480156102a957600080fd5b5061020f6102b836600461215e565b610b6e565b3480156102c957600080fd5b506102857f000000000000000000000000000000000000000000000000000000000000000081565b3480156102fd57600080fd5b5061020f610f82565b34801561031257600080fd5b5061033661032136600461219f565b606654600160ff9092169190911b9081161490565b60405190151581526020016101e6565b34801561035257600080fd5b506066546101dc565b34801561036757600080fd5b506101dc610376366004612128565b609b6020526000908152604090205481565b34801561039457600080fd5b5061020f611049565b3480156103a957600080fd5b506102857f000000000000000000000000000000000000000000000000000000000000000081565b3480156103dd57600080fd5b5061028561105d565b3480156103f257600080fd5b50606554610285906001600160a01b031681565b34801561041257600080fd5b506033546001600160a01b0316610285565b34801561043057600080fd5b5061028573beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac081565b61020f61045a36600461220b565b611147565b34801561046b57600080fd5b5061028561047a366004612128565b6098602052600090815260409020546001600160a01b031681565b3480156104a157600080fd5b506102856104b0366004612128565b611236565b3480156104c157600080fd5b506101dc60995481565b3480156104d757600080fd5b506102857f000000000000000000000000000000000000000000000000000000000000000081565b34801561050b57600080fd5b5061020f61051a3660046120fc565b611308565b34801561052b57600080fd5b5061020f61053a3660046120fc565b611547565b34801561054b57600080fd5b506102857f000000000000000000000000000000000000000000000000000000000000000081565b34801561057f57600080fd5b5061020f61058e366004612128565b61197b565b34801561059f57600080fd5b506103366105ae366004612128565b6001600160a01b0390811660009081526098602052604090205416151590565b3480156105da57600080fd5b5061020f6105e9366004612145565b6119f1565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106415760405162461bcd60e51b81526004016106389061227f565b60405180910390fd5b6001600160a01b0383166106bd5760405162461bcd60e51b815260206004820152603a60248201527f456967656e506f644d616e616765722e6164645368617265733a20706f644f7760448201527f6e65722063616e6e6f74206265207a65726f20616464726573730000000000006064820152608401610638565b600082121561072b5760405162461bcd60e51b815260206004820152603460248201527f456967656e506f644d616e616765722e6164645368617265733a207368617265604482015273732063616e6e6f74206265206e6567617469766560601b6064820152608401610638565b610739633b9aca00836122f3565b156107ac5760405162461bcd60e51b815260206004820152603d60248201527f456967656e506f644d616e616765722e6164645368617265733a20736861726560448201527f73206d75737420626520612077686f6c65204777656920616d6f756e740000006064820152608401610638565b6001600160a01b0383166000908152609b6020526040812054906107d0848361231d565b6001600160a01b0386166000818152609b6020526040908190208390555191925090600080516020612eb38339815191529061080f9087815260200190565b60405180910390a2846001600160a01b03166000805160206125858339815191528260405161084091815260200190565b60405180910390a26108528282611b4d565b925050505b92915050565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d4919061235e565b6001600160a01b0316336001600160a01b0316146109045760405162461bcd60e51b81526004016106389061237b565b61090d81611b8f565b50565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c91906123c5565b6109985760405162461bcd60e51b8152600401610638906123e7565b60665481811614610a115760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610638565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600054610100900460ff1615808015610a6f5750600054600160ff909116105b80610a895750303b158015610a89575060005460ff166001145b610aec5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610638565b6000805460ff191660011790558015610b0f576000805461ff0019166101001790555b610b1884611c86565b610b228383611cd8565b8015610b68576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bb65760405162461bcd60e51b81526004016106389061227f565b6001600160a01b038316610c305760405162461bcd60e51b81526020600482015260476024820152600080516020612ed383398151915260448201527f546f6b656e733a20706f644f776e65722063616e6e6f74206265207a65726f206064820152666164647265737360c81b608482015260a401610638565b6001600160a01b038216610cad5760405162461bcd60e51b815260206004820152604a6024820152600080516020612ed383398151915260448201527f546f6b656e733a2064657374696e6174696f6e2063616e6e6f74206265207a65606482015269726f206164647265737360b01b608482015260a401610638565b6000811215610d1c5760405162461bcd60e51b81526020600482015260416024820152600080516020612ed383398151915260448201527f546f6b656e733a207368617265732063616e6e6f74206265206e6567617469766064820152606560f81b608482015260a401610638565b610d2a633b9aca00826122f3565b15610d9e5760405162461bcd60e51b815260206004820152604a6024820152600080516020612ed383398151915260448201527f546f6b656e733a20736861726573206d75737420626520612077686f6c6520476064820152691dd95a48185b5bdd5b9d60b21b608482015260a401610638565b6001600160a01b0383166000908152609b602052604081205490811215610f07576000610dca8261242f565b905080831115610e61576001600160a01b0385166000908152609b6020526040812055610df7818461244c565b9250846001600160a01b0316600080516020612eb383398151915282604051610e2291815260200190565b60405180910390a2846001600160a01b03166000805160206125858339815191526000604051610e5491815260200190565b60405180910390a2610f05565b6001600160a01b0385166000908152609b6020526040812054610e8590859061231d565b6001600160a01b0387166000818152609b6020526040908190208390555191925090600080516020612eb383398151915290610ec49087815260200190565b60405180910390a2856001600160a01b031660008051602061258583398151915282604051610ef591815260200190565b60405180910390a2505050505050565b505b6001600160a01b03848116600090815260986020526040908190205490516362483a2160e11b815285831660048201526024810185905291169063c490744290604401600060405180830381600087803b158015610f6457600080fd5b505af1158015610f78573d6000803e3d6000fd5b5050505050505050565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee91906123c5565b61100a5760405162461bcd60e51b8152600401610638906123e7565b600019606681905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b611051611dc2565b61105b6000611c86565b565b6066546000908190600190811614156110b45760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610638565b336000908152609860205260409020546001600160a01b0316156111365760405162461bcd60e51b815260206004820152603360248201527f456967656e506f644d616e616765722e637265617465506f643a2053656e64656044820152721c88185b1c9958591e481a185cc818481c1bd9606a1b6064820152608401610638565b6000611140611e1c565b9250505090565b6066546000906001908116141561119c5760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610638565b336000908152609860205260409020546001600160a01b0316806111c5576111c2611e1c565b90505b6040516326d3918d60e21b81526001600160a01b03821690639b4e46349034906111fb908b908b908b908b908b9060040161248c565b6000604051808303818588803b15801561121457600080fd5b505af1158015611228573d6000803e3d6000fd5b505050505050505050505050565b6001600160a01b038082166000908152609860205260408120549091168061085757611301836001600160a01b031660001b60405180610940016040528061090e81526020016125a561090e9139604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166020820152808201919091526000606082015260800160408051601f19818403018152908290526112e69291602001612501565b60405160208183030381529060405280519060200120611f81565b9392505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146113505760405162461bcd60e51b81526004016106389061227f565b60008112156113c75760405162461bcd60e51b815260206004820152603760248201527f456967656e506f644d616e616765722e72656d6f76655368617265733a20736860448201527f617265732063616e6e6f74206265206e656761746976650000000000000000006064820152608401610638565b6113d5633b9aca00826122f3565b1561144a576040805162461bcd60e51b81526020600482015260248101919091527f456967656e506f644d616e616765722e72656d6f76655368617265733a20736860448201527f61726573206d75737420626520612077686f6c65204777656920616d6f756e746064820152608401610638565b6001600160a01b0382166000908152609b602052604081205461146e908390612516565b905060008112156114ff5760405162461bcd60e51b815260206004820152604f60248201527f456967656e506f644d616e616765722e72656d6f76655368617265733a20636160448201527f6e6e6f7420726573756c7420696e20706f64206f776e657220686176696e672060648201526e6e656761746976652073686172657360881b608482015260a401610638565b6001600160a01b0383166000818152609b602052604090819020839055516000805160206125858339815191529061153a9084815260200190565b60405180910390a2505050565b6001600160a01b0380831660009081526098602052604090205483911633146115c25760405162461bcd60e51b815260206004820152602760248201527f456967656e506f644d616e616765722e6f6e6c79456967656e506f643a206e6f6044820152661d0818481c1bd960ca1b6064820152608401610638565b600260c95414156116155760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610638565b600260c9556001600160a01b0383166116b15760405162461bcd60e51b815260206004820152605260248201527f456967656e506f644d616e616765722e7265636f7264426561636f6e4368616960448201527f6e45544842616c616e63655570646174653a20706f644f776e65722063616e6e6064820152716f74206265207a65726f206164647265737360701b608482015260a401610638565b6116bf633b9aca0083612555565b156117585760405162461bcd60e51b815260206004820152605a60248201527f456967656e506f644d616e616765722e7265636f7264426561636f6e4368616960448201527f6e45544842616c616e63655570646174653a2073686172657344656c7461206d60648201527f75737420626520612077686f6c65204777656920616d6f756e74000000000000608482015260a401610638565b6001600160a01b0383166000908152609b60205260408120549061177c848361231d565b6001600160a01b0386166000908152609b602052604081208290559091506117a48383611b4d565b9050801561190c57600081121561186f576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663132d49678773beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac06118038561242f565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561185257600080fd5b505af1158015611866573d6000803e3d6000fd5b5050505061190c565b604051631452b9d760e11b81526001600160a01b03878116600483015273beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac06024830152604482018390527f000000000000000000000000000000000000000000000000000000000000000016906328a573ae90606401600060405180830381600087803b1580156118f357600080fd5b505af1158015611907573d6000803e3d6000fd5b505050505b856001600160a01b0316600080516020612eb38339815191528660405161193591815260200190565b60405180910390a2856001600160a01b03166000805160206125858339815191528360405161196691815260200190565b60405180910390a25050600160c95550505050565b611983611dc2565b6001600160a01b0381166119e85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610638565b61090d81611c86565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a68919061235e565b6001600160a01b0316336001600160a01b031614611a985760405162461bcd60e51b81526004016106389061237b565b606654198119606654191614611b165760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610638565b606681905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610a44565b6000808313611b6d5760008213611b6657506000610857565b5080610857565b60008213611b8557611b7e8361242f565b9050610857565b611b7e8383612516565b6001600160a01b038116611c1d5760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610638565b606554604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6065546001600160a01b0316158015611cf957506001600160a01b03821615155b611d7b5760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610638565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2611dbe82611b8f565b5050565b6033546001600160a01b0316331461105b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610638565b6000609960008154611e2d90612569565b9091555060408051610940810190915261090e808252600091611ecc91839133916125a56020830139604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166020820152808201919091526000606082015260800160408051601f1981840301815290829052611eb89291602001612501565b604051602081830303815290604052611fdd565b60405163189acdbd60e31b81523360048201529091506001600160a01b0382169063c4d66de890602401600060405180830381600087803b158015611f1057600080fd5b505af1158015611f24573d6000803e3d6000fd5b50503360008181526098602052604080822080546001600160a01b0319166001600160a01b038816908117909155905192945092507f21c99d0db02213c32fff5b05cf0a718ab5f858802b91498f80d82270289d856a91a3919050565b604080516001600160f81b03196020808301919091526bffffffffffffffffffffffff193060601b1660218301526035820185905260558083018590528351808403909101815260759092019092528051910120600090611301565b600080844710156120305760405162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e63650000006044820152606401610638565b825161207e5760405162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152606401610638565b8383516020850187f590506001600160a01b0381166120df5760405162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152606401610638565b949350505050565b6001600160a01b038116811461090d57600080fd5b6000806040838503121561210f57600080fd5b823561211a816120e7565b946020939093013593505050565b60006020828403121561213a57600080fd5b8135611301816120e7565b60006020828403121561215757600080fd5b5035919050565b60008060006060848603121561217357600080fd5b833561217e816120e7565b9250602084013561218e816120e7565b929592945050506040919091013590565b6000602082840312156121b157600080fd5b813560ff8116811461130157600080fd5b60008083601f8401126121d457600080fd5b50813567ffffffffffffffff8111156121ec57600080fd5b60208301915083602082850101111561220457600080fd5b9250929050565b60008060008060006060868803121561222357600080fd5b853567ffffffffffffffff8082111561223b57600080fd5b61224789838a016121c2565b9097509550602088013591508082111561226057600080fd5b5061226d888289016121c2565b96999598509660400135949350505050565b602080825260409082018190527f456967656e506f644d616e616765722e6f6e6c7944656c65676174696f6e4d61908201527f6e616765723a206e6f74207468652044656c65676174696f6e4d616e61676572606082015260800190565b634e487b7160e01b600052601260045260246000fd5b600082612302576123026122dd565b500690565b634e487b7160e01b600052601160045260246000fd5b600080821280156001600160ff1b038490038513161561233f5761233f612307565b600160ff1b839003841281161561235857612358612307565b50500190565b60006020828403121561237057600080fd5b8151611301816120e7565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b6000602082840312156123d757600080fd5b8151801515811461130157600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b6000600160ff1b82141561244557612445612307565b5060000390565b60008282101561245e5761245e612307565b500390565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006124a0606083018789612463565b82810360208401526124b3818688612463565b9150508260408301529695505050505050565b6000815160005b818110156124e757602081850181015186830152016124cd565b818111156124f6576000828601525b509290920192915050565b60006120df61251083866124c6565b846124c6565b60008083128015600160ff1b85018412161561253457612534612307565b6001600160ff1b038401831381161561254f5761254f612307565b50500390565b600082612564576125646122dd565b500790565b600060001982141561257d5761257d612307565b506001019056fed4def76d6d2bed6f14d5cd9af73cc2913d618d00edde42432e81c09bfe077098608060405260405161090e38038061090e83398101604081905261002291610460565b61002e82826000610035565b505061058a565b61003e83610100565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100fb576100f9836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e99190610520565b836102a360201b6100291760201c565b505b505050565b610113816102cf60201b6100551760201c565b6101725760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101e6816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610520565b6102cf60201b6100551760201c565b61024b5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610169565b806102827fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5060001b6102de60201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606102c883836040518060600160405280602781526020016108e7602791396102e1565b9392505050565b6001600160a01b03163b151590565b90565b6060600080856001600160a01b0316856040516102fe919061053b565b600060405180830381855af49150503d8060008114610339576040519150601f19603f3d011682016040523d82523d6000602084013e61033e565b606091505b5090925090506103508683838761035a565b9695505050505050565b606083156103c65782516103bf576001600160a01b0385163b6103bf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610169565b50816103d0565b6103d083836103d8565b949350505050565b8151156103e85781518083602001fd5b8060405162461bcd60e51b81526004016101699190610557565b80516001600160a01b038116811461041957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561044f578181015183820152602001610437565b838111156100f95750506000910152565b6000806040838503121561047357600080fd5b61047c83610402565b60208401519092506001600160401b038082111561049957600080fd5b818501915085601f8301126104ad57600080fd5b8151818111156104bf576104bf61041e565b604051601f8201601f19908116603f011681019083821181831017156104e7576104e761041e565b8160405282815288602084870101111561050057600080fd5b610511836020830160208801610434565b80955050505050509250929050565b60006020828403121561053257600080fd5b6102c882610402565b6000825161054d818460208701610434565b9190910192915050565b6020815260008251806020840152610576816040850160208701610434565b601f01601f19169190910160400192915050565b61034e806105996000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b610100565b565b606061004e83836040518060600160405280602781526020016102f260279139610124565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fb9190610249565b905090565b3660008037600080366000845af43d6000803e80801561011f573d6000f35b3d6000fd5b6060600080856001600160a01b03168560405161014191906102a2565b600060405180830381855af49150503d806000811461017c576040519150601f19603f3d011682016040523d82523d6000602084013e610181565b606091505b50915091506101928683838761019c565b9695505050505050565b6060831561020d578251610206576001600160a01b0385163b6102065760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610217565b610217838361021f565b949350505050565b81511561022f5781518083602001fd5b8060405162461bcd60e51b81526004016101fd91906102be565b60006020828403121561025b57600080fd5b81516001600160a01b038116811461004e57600080fd5b60005b8381101561028d578181015183820152602001610275565b8381111561029c576000848401525b50505050565b600082516102b4818460208701610272565b9190910192915050565b60208152600082518060208401526102dd816040850160208701610272565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d51e81d3bc5ed20a26aeb05dce7e825c503b2061aa78628027300c8d65b9d89a64736f6c634300080c0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65644e2b791dedccd9fb30141b088cabf5c14a8912b52f59375c95c010700b8c6193456967656e506f644d616e616765722e77697468647261775368617265734173a264697066735822122069d3a03119733341cd267e296785e37b1c350fc350d796fc97aa45c1e8213da664736f6c634300080c0033", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_ethPOS\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"},{\"name\":\"_eigenPodBeacon\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"},{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"},{\"name\":\"_slasher\",\"type\":\"address\",\"internalType\":\"contractISlasher\"},{\"name\":\"_delegationManager\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"increaseInDelegateableShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"existingPodShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createPod\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodBeacon\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"_initPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"numPods\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownerToPod\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"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\":\"podOwnerShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordBeaconChainETHBalanceUpdate\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"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\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destination\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BeaconChainETHDeposited\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconChainETHWithdrawalCompleted\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"},{\"name\":\"delegatedAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewTotalShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newTotalShares\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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\":\"PodDeployed\",\"inputs\":[{\"name\":\"eigenPod\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodSharesUpdated\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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}]", + Bin: "0x6101206040523480156200001257600080fd5b50604051620031b9380380620031b983398101604081905262000035916200014b565b6001600160a01b0380861660805280851660a05280841660c05280831660e0528116610100526200006562000070565b5050505050620001cb565b600054610100900460ff1615620000dd5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000130576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200014857600080fd5b50565b600080600080600060a086880312156200016457600080fd5b8551620001718162000132565b6020870151909550620001848162000132565b6040870151909450620001978162000132565b6060870151909350620001aa8162000132565b6080870151909250620001bd8162000132565b809150509295509295909350565b60805160a05160c05160e05161010051612f7862000241600039600081816105620152818161060d01528181610b9f0152818161133b015281816117e70152611899015260006104ee015260006102d601526000818161026a015281816112b80152611eb4015260006103c00152612f786000f3fe6080604052600436106101b75760003560e01c8063886f1195116100ec578063b13442711161008a578063ea4d3c9b11610064578063ea4d3c9b14610550578063f2fde38b14610584578063f6848d24146105a4578063fabc1cbc146105df57600080fd5b8063b1344271146104dc578063beffbb8914610510578063c2c51c401461053057600080fd5b80639b4e4634116100c65780639b4e46341461045d5780639ba0627514610470578063a38406a3146104a6578063a6a509be146104c657600080fd5b8063886f1195146103f75780638da5cb5b146104175780639104c3191461043557600080fd5b8063595c6a671161015957806360f4062b1161013357806360f4062b1461036c578063715018a61461039957806374cdd798146103ae57806384d81062146103e257600080fd5b8063595c6a67146102f85780635ac86ab71461030d5780635c975abb1461034d57600080fd5b80631794bb3c116101955780631794bb3c14610238578063292b7b2b14610258578063387b1300146102a457806339b70e38146102c457600080fd5b80630e81073c146101bc57806310d67a2f146101f6578063136439dd14610218575b600080fd5b3480156101c857600080fd5b506101dc6101d736600461214c565b6105ff565b604080519283526020830191909152015b60405180910390f35b34801561020257600080fd5b50610216610211366004612178565b610883565b005b34801561022457600080fd5b5061021661023336600461219c565b610936565b34801561024457600080fd5b506102166102533660046121b5565b610a75565b34801561026457600080fd5b5061028c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101ed565b3480156102b057600080fd5b506102166102bf3660046121b5565b610b94565b3480156102d057600080fd5b5061028c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561030457600080fd5b50610216610fa8565b34801561031957600080fd5b5061033d6103283660046121f6565b606654600160ff9092169190911b9081161490565b60405190151581526020016101ed565b34801561035957600080fd5b506066545b6040519081526020016101ed565b34801561037857600080fd5b5061035e610387366004612178565b609b6020526000908152604090205481565b3480156103a557600080fd5b5061021661106f565b3480156103ba57600080fd5b5061028c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156103ee57600080fd5b5061028c611083565b34801561040357600080fd5b5060655461028c906001600160a01b031681565b34801561042357600080fd5b506033546001600160a01b031661028c565b34801561044157600080fd5b5061028c73beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac081565b61021661046b36600461225b565b61116d565b34801561047c57600080fd5b5061028c61048b366004612178565b6098602052600090815260409020546001600160a01b031681565b3480156104b257600080fd5b5061028c6104c1366004612178565b61125c565b3480156104d257600080fd5b5061035e60995481565b3480156104e857600080fd5b5061028c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561051c57600080fd5b5061021661052b36600461214c565b611330565b34801561053c57600080fd5b5061021661054b36600461214c565b61156f565b34801561055c57600080fd5b5061028c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561059057600080fd5b5061021661059f366004612178565b6119cb565b3480156105b057600080fd5b5061033d6105bf366004612178565b6001600160a01b0390811660009081526098602052604090205416151590565b3480156105eb57600080fd5b506102166105fa36600461219c565b611a41565b600080336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106535760405162461bcd60e51b815260040161064a906122cf565b60405180910390fd5b6001600160a01b0384166106cf5760405162461bcd60e51b815260206004820152603a60248201527f456967656e506f644d616e616765722e6164645368617265733a20706f644f7760448201527f6e65722063616e6e6f74206265207a65726f2061646472657373000000000000606482015260840161064a565b600083121561073d5760405162461bcd60e51b815260206004820152603460248201527f456967656e506f644d616e616765722e6164645368617265733a207368617265604482015273732063616e6e6f74206265206e6567617469766560601b606482015260840161064a565b61074b633b9aca0084612343565b156107be5760405162461bcd60e51b815260206004820152603d60248201527f456967656e506f644d616e616765722e6164645368617265733a20736861726560448201527f73206d75737420626520612077686f6c65204777656920616d6f756e74000000606482015260840161064a565b6001600160a01b0384166000908152609b6020526040812054906107e2858361236d565b6001600160a01b0387166000818152609b6020526040908190208390555191925090600080516020612f03833981519152906108219088815260200190565b60405180910390a2856001600160a01b03166000805160206125d58339815191528260405161085291815260200190565b60405180910390a26108648282611b9d565b9350600082126108745781610877565b60005b925050505b9250929050565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fa91906123ae565b6001600160a01b0316336001600160a01b03161461092a5760405162461bcd60e51b815260040161064a906123cb565b61093381611bdf565b50565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa15801561097e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a29190612415565b6109be5760405162461bcd60e51b815260040161064a90612437565b60665481811614610a375760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c6974790000000000000000606482015260840161064a565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600054610100900460ff1615808015610a955750600054600160ff909116105b80610aaf5750303b158015610aaf575060005460ff166001145b610b125760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161064a565b6000805460ff191660011790558015610b35576000805461ff0019166101001790555b610b3e84611cd6565b610b488383611d28565b8015610b8e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bdc5760405162461bcd60e51b815260040161064a906122cf565b6001600160a01b038316610c565760405162461bcd60e51b81526020600482015260476024820152600080516020612f2383398151915260448201527f546f6b656e733a20706f644f776e65722063616e6e6f74206265207a65726f206064820152666164647265737360c81b608482015260a40161064a565b6001600160a01b038216610cd35760405162461bcd60e51b815260206004820152604a6024820152600080516020612f2383398151915260448201527f546f6b656e733a2064657374696e6174696f6e2063616e6e6f74206265207a65606482015269726f206164647265737360b01b608482015260a40161064a565b6000811215610d425760405162461bcd60e51b81526020600482015260416024820152600080516020612f2383398151915260448201527f546f6b656e733a207368617265732063616e6e6f74206265206e6567617469766064820152606560f81b608482015260a40161064a565b610d50633b9aca0082612343565b15610dc45760405162461bcd60e51b815260206004820152604a6024820152600080516020612f2383398151915260448201527f546f6b656e733a20736861726573206d75737420626520612077686f6c6520476064820152691dd95a48185b5bdd5b9d60b21b608482015260a40161064a565b6001600160a01b0383166000908152609b602052604081205490811215610f2d576000610df08261247f565b905080831115610e87576001600160a01b0385166000908152609b6020526040812055610e1d818461249c565b9250846001600160a01b0316600080516020612f0383398151915282604051610e4891815260200190565b60405180910390a2846001600160a01b03166000805160206125d58339815191526000604051610e7a91815260200190565b60405180910390a2610f2b565b6001600160a01b0385166000908152609b6020526040812054610eab90859061236d565b6001600160a01b0387166000818152609b6020526040908190208390555191925090600080516020612f0383398151915290610eea9087815260200190565b60405180910390a2856001600160a01b03166000805160206125d583398151915282604051610f1b91815260200190565b60405180910390a2505050505050565b505b6001600160a01b03848116600090815260986020526040908190205490516362483a2160e11b815285831660048201526024810185905291169063c490744290604401600060405180830381600087803b158015610f8a57600080fd5b505af1158015610f9e573d6000803e3d6000fd5b5050505050505050565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610ff0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110149190612415565b6110305760405162461bcd60e51b815260040161064a90612437565b600019606681905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b611077611e12565b6110816000611cd6565b565b6066546000908190600190811614156110da5760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b604482015260640161064a565b336000908152609860205260409020546001600160a01b03161561115c5760405162461bcd60e51b815260206004820152603360248201527f456967656e506f644d616e616765722e637265617465506f643a2053656e64656044820152721c88185b1c9958591e481a185cc818481c1bd9606a1b606482015260840161064a565b6000611166611e6c565b9250505090565b606654600090600190811614156111c25760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b604482015260640161064a565b336000908152609860205260409020546001600160a01b0316806111eb576111e8611e6c565b90505b6040516326d3918d60e21b81526001600160a01b03821690639b4e4634903490611221908b908b908b908b908b906004016124dc565b6000604051808303818588803b15801561123a57600080fd5b505af115801561124e573d6000803e3d6000fd5b505050505050505050505050565b6001600160a01b038082166000908152609860205260408120549091168061132a57611327836001600160a01b031660001b60405180610940016040528061090e81526020016125f561090e9139604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166020820152808201919091526000606082015260800160408051601f198184030181529082905261130c9291602001612551565b60405160208183030381529060405280519060200120611fd1565b90505b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146113785760405162461bcd60e51b815260040161064a906122cf565b60008112156113ef5760405162461bcd60e51b815260206004820152603760248201527f456967656e506f644d616e616765722e72656d6f76655368617265733a20736860448201527f617265732063616e6e6f74206265206e65676174697665000000000000000000606482015260840161064a565b6113fd633b9aca0082612343565b15611472576040805162461bcd60e51b81526020600482015260248101919091527f456967656e506f644d616e616765722e72656d6f76655368617265733a20736860448201527f61726573206d75737420626520612077686f6c65204777656920616d6f756e74606482015260840161064a565b6001600160a01b0382166000908152609b6020526040812054611496908390612566565b905060008112156115275760405162461bcd60e51b815260206004820152604f60248201527f456967656e506f644d616e616765722e72656d6f76655368617265733a20636160448201527f6e6e6f7420726573756c7420696e20706f64206f776e657220686176696e672060648201526e6e656761746976652073686172657360881b608482015260a40161064a565b6001600160a01b0383166000818152609b602052604090819020839055516000805160206125d5833981519152906115629084815260200190565b60405180910390a2505050565b6001600160a01b0380831660009081526098602052604090205483911633146115ea5760405162461bcd60e51b815260206004820152602760248201527f456967656e506f644d616e616765722e6f6e6c79456967656e506f643a206e6f6044820152661d0818481c1bd960ca1b606482015260840161064a565b600260c954141561163d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161064a565b600260c9556001600160a01b0383166116d95760405162461bcd60e51b815260206004820152605260248201527f456967656e506f644d616e616765722e7265636f7264426561636f6e4368616960448201527f6e45544842616c616e63655570646174653a20706f644f776e65722063616e6e6064820152716f74206265207a65726f206164647265737360701b608482015260a40161064a565b6116e7633b9aca00836125a5565b156117805760405162461bcd60e51b815260206004820152605a60248201527f456967656e506f644d616e616765722e7265636f7264426561636f6e4368616960448201527f6e45544842616c616e63655570646174653a2073686172657344656c7461206d60648201527f75737420626520612077686f6c65204777656920616d6f756e74000000000000608482015260a40161064a565b6001600160a01b0383166000908152609b6020526040812054906117a4848361236d565b6001600160a01b0386166000908152609b602052604081208290559091506117cc8383611b9d565b9050801561195c576000811215611897576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663132d49678773beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac061182b8561247f565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561187a57600080fd5b505af115801561188e573d6000803e3d6000fd5b5050505061195c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633c651cf28773beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0600087126118ea57866118ed565b60005b6040516001600160e01b031960e086901b1681526001600160a01b039384166004820152929091166024830152604482015260648101849052608401600060405180830381600087803b15801561194357600080fd5b505af1158015611957573d6000803e3d6000fd5b505050505b856001600160a01b0316600080516020612f038339815191528660405161198591815260200190565b60405180910390a2856001600160a01b03166000805160206125d5833981519152836040516119b691815260200190565b60405180910390a25050600160c95550505050565b6119d3611e12565b6001600160a01b038116611a385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161064a565b61093381611cd6565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab891906123ae565b6001600160a01b0316336001600160a01b031614611ae85760405162461bcd60e51b815260040161064a906123cb565b606654198119606654191614611b665760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c6974790000000000000000606482015260840161064a565b606681905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610a6a565b6000808313611bbd5760008213611bb65750600061132a565b508061132a565b60008213611bd557611bce8361247f565b905061132a565b611bce8383612566565b6001600160a01b038116611c6d5760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a40161064a565b606554604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6065546001600160a01b0316158015611d4957506001600160a01b03821615155b611dcb5760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a40161064a565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2611e0e82611bdf565b5050565b6033546001600160a01b031633146110815760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161064a565b6000609960008154611e7d906125b9565b9091555060408051610940810190915261090e808252600091611f1c91839133916125f56020830139604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166020820152808201919091526000606082015260800160408051601f1981840301815290829052611f089291602001612551565b60405160208183030381529060405261202d565b60405163189acdbd60e31b81523360048201529091506001600160a01b0382169063c4d66de890602401600060405180830381600087803b158015611f6057600080fd5b505af1158015611f74573d6000803e3d6000fd5b50503360008181526098602052604080822080546001600160a01b0319166001600160a01b038816908117909155905192945092507f21c99d0db02213c32fff5b05cf0a718ab5f858802b91498f80d82270289d856a91a3919050565b604080516001600160f81b03196020808301919091526bffffffffffffffffffffffff193060601b1660218301526035820185905260558083018590528351808403909101815260759092019092528051910120600090611327565b600080844710156120805760405162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015260640161064a565b82516120ce5760405162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015260640161064a565b8383516020850187f590506001600160a01b03811661212f5760405162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015260640161064a565b949350505050565b6001600160a01b038116811461093357600080fd5b6000806040838503121561215f57600080fd5b823561216a81612137565b946020939093013593505050565b60006020828403121561218a57600080fd5b813561219581612137565b9392505050565b6000602082840312156121ae57600080fd5b5035919050565b6000806000606084860312156121ca57600080fd5b83356121d581612137565b925060208401356121e581612137565b929592945050506040919091013590565b60006020828403121561220857600080fd5b813560ff8116811461219557600080fd5b60008083601f84011261222b57600080fd5b50813567ffffffffffffffff81111561224357600080fd5b60208301915083602082850101111561087c57600080fd5b60008060008060006060868803121561227357600080fd5b853567ffffffffffffffff8082111561228b57600080fd5b61229789838a01612219565b909750955060208801359150808211156122b057600080fd5b506122bd88828901612219565b96999598509660400135949350505050565b602080825260409082018190527f456967656e506f644d616e616765722e6f6e6c7944656c65676174696f6e4d61908201527f6e616765723a206e6f74207468652044656c65676174696f6e4d616e61676572606082015260800190565b634e487b7160e01b600052601260045260246000fd5b6000826123525761235261232d565b500690565b634e487b7160e01b600052601160045260246000fd5b600080821280156001600160ff1b038490038513161561238f5761238f612357565b600160ff1b83900384128116156123a8576123a8612357565b50500190565b6000602082840312156123c057600080fd5b815161219581612137565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b60006020828403121561242757600080fd5b8151801515811461219557600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b6000600160ff1b82141561249557612495612357565b5060000390565b6000828210156124ae576124ae612357565b500390565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006124f06060830187896124b3565b82810360208401526125038186886124b3565b9150508260408301529695505050505050565b6000815160005b81811015612537576020818501810151868301520161251d565b81811115612546576000828601525b509290920192915050565b600061212f6125608386612516565b84612516565b60008083128015600160ff1b85018412161561258457612584612357565b6001600160ff1b038401831381161561259f5761259f612357565b50500390565b6000826125b4576125b461232d565b500790565b60006000198214156125cd576125cd612357565b506001019056fed4def76d6d2bed6f14d5cd9af73cc2913d618d00edde42432e81c09bfe077098608060405260405161090e38038061090e83398101604081905261002291610460565b61002e82826000610035565b505061058a565b61003e83610100565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100fb576100f9836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e99190610520565b836102a360201b6100291760201c565b505b505050565b610113816102cf60201b6100551760201c565b6101725760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101e6816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610520565b6102cf60201b6100551760201c565b61024b5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610169565b806102827fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5060001b6102de60201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606102c883836040518060600160405280602781526020016108e7602791396102e1565b9392505050565b6001600160a01b03163b151590565b90565b6060600080856001600160a01b0316856040516102fe919061053b565b600060405180830381855af49150503d8060008114610339576040519150601f19603f3d011682016040523d82523d6000602084013e61033e565b606091505b5090925090506103508683838761035a565b9695505050505050565b606083156103c65782516103bf576001600160a01b0385163b6103bf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610169565b50816103d0565b6103d083836103d8565b949350505050565b8151156103e85781518083602001fd5b8060405162461bcd60e51b81526004016101699190610557565b80516001600160a01b038116811461041957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561044f578181015183820152602001610437565b838111156100f95750506000910152565b6000806040838503121561047357600080fd5b61047c83610402565b60208401519092506001600160401b038082111561049957600080fd5b818501915085601f8301126104ad57600080fd5b8151818111156104bf576104bf61041e565b604051601f8201601f19908116603f011681019083821181831017156104e7576104e761041e565b8160405282815288602084870101111561050057600080fd5b610511836020830160208801610434565b80955050505050509250929050565b60006020828403121561053257600080fd5b6102c882610402565b6000825161054d818460208701610434565b9190910192915050565b6020815260008251806020840152610576816040850160208701610434565b601f01601f19169190910160400192915050565b61034e806105996000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b610100565b565b606061004e83836040518060600160405280602781526020016102f260279139610124565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fb9190610249565b905090565b3660008037600080366000845af43d6000803e80801561011f573d6000f35b3d6000fd5b6060600080856001600160a01b03168560405161014191906102a2565b600060405180830381855af49150503d806000811461017c576040519150601f19603f3d011682016040523d82523d6000602084013e610181565b606091505b50915091506101928683838761019c565b9695505050505050565b6060831561020d578251610206576001600160a01b0385163b6102065760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610217565b610217838361021f565b949350505050565b81511561022f5781518083602001fd5b8060405162461bcd60e51b81526004016101fd91906102be565b60006020828403121561025b57600080fd5b81516001600160a01b038116811461004e57600080fd5b60005b8381101561028d578181015183820152602001610275565b8381111561029c576000848401525b50505050565b600082516102b4818460208701610272565b9190910192915050565b60208152600082518060208401526102dd816040850160208701610272565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d51e81d3bc5ed20a26aeb05dce7e825c503b2061aa78628027300c8d65b9d89a64736f6c634300080c0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65644e2b791dedccd9fb30141b088cabf5c14a8912b52f59375c95c010700b8c6193456967656e506f644d616e616765722e77697468647261775368617265734173a2646970667358221220589d2421fd1a2806ed6524a3f40bea05ae2be9f1769c5fd5b724f497f6146b6164736f6c634300080c0033", } // EigenPodManagerABI is the input ABI used to generate the binding from. @@ -669,21 +669,21 @@ func (_EigenPodManager *EigenPodManagerCallerSession) StrategyManager() (common. // AddShares is a paid mutator transaction binding the contract method 0x0e81073c. // -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256 increaseInDelegateableShares, uint256 existingPodShares) func (_EigenPodManager *EigenPodManagerTransactor) AddShares(opts *bind.TransactOpts, podOwner common.Address, shares *big.Int) (*types.Transaction, error) { return _EigenPodManager.contract.Transact(opts, "addShares", podOwner, shares) } // AddShares is a paid mutator transaction binding the contract method 0x0e81073c. // -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256 increaseInDelegateableShares, uint256 existingPodShares) func (_EigenPodManager *EigenPodManagerSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { return _EigenPodManager.Contract.AddShares(&_EigenPodManager.TransactOpts, podOwner, shares) } // AddShares is a paid mutator transaction binding the contract method 0x0e81073c. // -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256 increaseInDelegateableShares, uint256 existingPodShares) func (_EigenPodManager *EigenPodManagerTransactorSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { return _EigenPodManager.Contract.AddShares(&_EigenPodManager.TransactOpts, podOwner, shares) } diff --git a/pkg/bindings/EigenPodManagerStorage/binding.go b/pkg/bindings/EigenPodManagerStorage/binding.go index 446bf1a74..9c6a798f7 100644 --- a/pkg/bindings/EigenPodManagerStorage/binding.go +++ b/pkg/bindings/EigenPodManagerStorage/binding.go @@ -31,7 +31,7 @@ var ( // EigenPodManagerStorageMetaData contains all meta data concerning the EigenPodManagerStorage contract. var EigenPodManagerStorageMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createPod\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodBeacon\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"numPods\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownerToPod\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"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\":\"podOwnerShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordBeaconChainETHBalanceUpdate\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destination\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BeaconChainETHDeposited\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconChainETHWithdrawalCompleted\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"},{\"name\":\"delegatedAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewTotalShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newTotalShares\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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\":\"PodDeployed\",\"inputs\":[{\"name\":\"eigenPod\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodSharesUpdated\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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}]", + ABI: "[{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"increaseInDelegateableShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"existingPodShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createPod\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodBeacon\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"numPods\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownerToPod\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"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\":\"podOwnerShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordBeaconChainETHBalanceUpdate\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destination\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BeaconChainETHDeposited\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconChainETHWithdrawalCompleted\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"},{\"name\":\"delegatedAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewTotalShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newTotalShares\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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\":\"PodDeployed\",\"inputs\":[{\"name\":\"eigenPod\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodSharesUpdated\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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}]", } // EigenPodManagerStorageABI is the input ABI used to generate the binding from. @@ -616,21 +616,21 @@ func (_EigenPodManagerStorage *EigenPodManagerStorageCallerSession) StrategyMana // AddShares is a paid mutator transaction binding the contract method 0x0e81073c. // -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256 increaseInDelegateableShares, uint256 existingPodShares) func (_EigenPodManagerStorage *EigenPodManagerStorageTransactor) AddShares(opts *bind.TransactOpts, podOwner common.Address, shares *big.Int) (*types.Transaction, error) { return _EigenPodManagerStorage.contract.Transact(opts, "addShares", podOwner, shares) } // AddShares is a paid mutator transaction binding the contract method 0x0e81073c. // -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256 increaseInDelegateableShares, uint256 existingPodShares) func (_EigenPodManagerStorage *EigenPodManagerStorageSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { return _EigenPodManagerStorage.Contract.AddShares(&_EigenPodManagerStorage.TransactOpts, podOwner, shares) } // AddShares is a paid mutator transaction binding the contract method 0x0e81073c. // -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256 increaseInDelegateableShares, uint256 existingPodShares) func (_EigenPodManagerStorage *EigenPodManagerStorageTransactorSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { return _EigenPodManagerStorage.Contract.AddShares(&_EigenPodManagerStorage.TransactOpts, podOwner, shares) } diff --git a/pkg/bindings/EigenStrategy/binding.go b/pkg/bindings/EigenStrategy/binding.go index 2070a2d17..1b559e7f5 100644 --- a/pkg/bindings/EigenStrategy/binding.go +++ b/pkg/bindings/EigenStrategy/binding.go @@ -32,7 +32,7 @@ var ( // EigenStrategyMetaData contains all meta data concerning the EigenStrategy contract. var EigenStrategyMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"EIGEN\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigen\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"newShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"explanation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_underlyingToken\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_EIGEN\",\"type\":\"address\",\"internalType\":\"contractIEigen\"},{\"name\":\"_bEIGEN\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"shares\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sharesToUnderlying\",\"inputs\":[{\"name\":\"amountShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sharesToUnderlyingView\",\"inputs\":[{\"name\":\"amountShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalShares\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"underlyingToShares\",\"inputs\":[{\"name\":\"amountUnderlying\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"underlyingToSharesView\",\"inputs\":[{\"name\":\"amountUnderlying\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"underlyingToken\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"userUnderlying\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"userUnderlyingView\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amountShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"ExchangeRateEmitted\",\"inputs\":[{\"name\":\"rate\",\"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\":\"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\":\"StrategyTokenSet\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"decimals\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"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}]", - Bin: "0x60a06040523480156200001157600080fd5b5060405162001dc338038062001dc3833981016040819052620000349162000116565b6001600160a01b038116608052806200004c62000054565b505062000148565b600054610100900460ff1615620000c15760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000114576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012957600080fd5b81516001600160a01b03811681146200014157600080fd5b9392505050565b608051611c4a62000179600039600081816101af015281816105ac01528181610ad40152610b9f0152611c4a6000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c80637a8b2637116100c3578063ce7c2ac21161007c578063ce7c2ac2146102da578063d9caed12146102ed578063e3dae51c14610300578063f3e7387514610313578063fabc1cbc14610326578063fdc371ce1461033957600080fd5b80637a8b263714610260578063886f1195146102735780638c8710191461028c5780638f6a62401461029f578063ab5921e1146102b2578063c0c53b8b146102c757600080fd5b806347e7ef241161011557806347e7ef24146101e8578063485cc955146101fb578063553ca5f81461020e578063595c6a67146102215780635ac86ab7146102295780635c975abb1461025857600080fd5b806310d67a2f14610152578063136439dd146101675780632495a5991461017a57806339b70e38146101aa5780633a98ef39146101d1575b600080fd5b61016561016036600461181e565b61034c565b005b61016561017536600461183b565b610408565b60325461018d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61018d7f000000000000000000000000000000000000000000000000000000000000000081565b6101da60335481565b6040519081526020016101a1565b6101da6101f6366004611854565b61054c565b610165610209366004611880565b610790565b6101da61021c36600461181e565b61085e565b610165610872565b6102486102373660046118c8565b6001805460ff9092161b9081161490565b60405190151581526020016101a1565b6001546101da565b6101da61026e36600461183b565b61093e565b60005461018d906201000090046001600160a01b031681565b6101da61029a36600461183b565b610989565b6101da6102ad36600461181e565b610994565b6102ba6109a2565b6040516101a19190611911565b6101656102d5366004611944565b6109c2565b6101da6102e836600461181e565b610aac565b6101656102fb36600461198f565b610b41565b6101da61030e36600461183b565b610d27565b6101da61032136600461183b565b610d60565b61016561033436600461183b565b610d6b565b60645461018d906001600160a01b031681565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c391906119d0565b6001600160a01b0316336001600160a01b0316146103fc5760405162461bcd60e51b81526004016103f3906119ed565b60405180910390fd5b61040581610ec7565b50565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa158015610455573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104799190611a37565b6104955760405162461bcd60e51b81526004016103f390611a59565b6001548181161461050e5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c697479000000000000000060648201526084016103f3565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600180546000918291811614156105a15760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b60448201526064016103f3565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106195760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e6167657260448201526064016103f3565b6106238484610fcc565b60335460006106346103e883611ab7565b905060006103e86106436110e0565b61064d9190611ab7565b9050600061065b8783611acf565b9050806106688489611ae6565b6106729190611b05565b9550856106d85760405162461bcd60e51b815260206004820152602e60248201527f5374726174656779426173652e6465706f7369743a206e65775368617265732060448201526d63616e6e6f74206265207a65726f60901b60648201526084016103f3565b6106e28685611ab7565b60338190556f4b3b4ca85a86c47a098a223fffffffff101561076c5760405162461bcd60e51b815260206004820152603c60248201527f5374726174656779426173652e6465706f7369743a20746f74616c536861726560448201527f73206578636565647320604d41585f544f54414c5f534841524553600000000060648201526084016103f3565b610785826103e86033546107809190611ab7565b611152565b505050505092915050565b600054610100900460ff16158080156107b05750600054600160ff909116105b806107ca5750303b1580156107ca575060005460ff166001145b6107e65760405162461bcd60e51b81526004016103f390611b27565b6000805460ff191660011790558015610809576000805461ff0019166101001790555b61081383836111a6565b8015610859576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b600061086c61026e83610aac565b92915050565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e39190611a37565b6108ff5760405162461bcd60e51b81526004016103f390611a59565b600019600181905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b6000806103e86033546109519190611ab7565b905060006103e86109606110e0565b61096a9190611ab7565b9050816109778583611ae6565b6109819190611b05565b949350505050565b600061086c82610d27565b600061086c61032183610aac565b60606040518060800160405280604d8152602001611bc8604d9139905090565b600054610100900460ff16158080156109e25750600054600160ff909116105b806109fc5750303b1580156109fc575060005460ff166001145b610a185760405162461bcd60e51b81526004016103f390611b27565b6000805460ff191660011790558015610a3b576000805461ff0019166101001790555b606480546001600160a01b0319166001600160a01b038616179055610a6083836111a6565b8015610aa6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b604051633d3f06c960e11b81526001600160a01b0382811660048301523060248301526000917f000000000000000000000000000000000000000000000000000000000000000090911690637a7e0d9290604401602060405180830381865afa158015610b1d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086c9190611b75565b6001805460029081161415610b945760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b60448201526064016103f3565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c0c5760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e6167657260448201526064016103f3565b610c178484846112f1565b60335480831115610ca65760405162461bcd60e51b815260206004820152604d60248201527f5374726174656779426173652e77697468647261773a20616d6f756e7453686160448201527f726573206d757374206265206c657373207468616e206f7220657175616c207460648201526c6f20746f74616c53686172657360981b608482015260a4016103f3565b6000610cb46103e883611ab7565b905060006103e8610cc36110e0565b610ccd9190611ab7565b9050600082610cdc8784611ae6565b610ce69190611b05565b9050610cf28685611acf565b603355610d12610d028284611acf565b6103e86033546107809190611ab7565b610d1d88888361138c565b5050505050505050565b6000806103e8603354610d3a9190611ab7565b905060006103e8610d496110e0565b610d539190611ab7565b9050806109778386611ae6565b600061086c8261093e565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906119d0565b6001600160a01b0316336001600160a01b031614610e125760405162461bcd60e51b81526004016103f3906119ed565b600154198119600154191614610e905760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c697479000000000000000060648201526084016103f3565b600181905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610541565b6001600160a01b038116610f555760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a4016103f3565b600054604080516001600160a01b03620100009093048316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b6032546001600160a01b0383811691161480610ff557506064546001600160a01b038381169116145b6110675760405162461bcd60e51b815260206004820152603760248201527f456967656e53747261746567792e6465706f7369743a2043616e206f6e6c792060448201527f6465706f7369742062454947454e206f7220454947454e00000000000000000060648201526084016103f3565b6064546001600160a01b03838116911614156110dc57606454604051636f074d1f60e11b8152600481018390526001600160a01b039091169063de0e9a3e90602401600060405180830381600087803b1580156110c357600080fd5b505af11580156110d7573d6000803e3d6000fd5b505050505b5050565b6032546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114d9190611b75565b905090565b7fd2494f3479e5da49d386657c292c610b5b01df313d07c62eb0cfa49924a31be88161118684670de0b6b3a7640000611ae6565b6111909190611b05565b6040519081526020015b60405180910390a15050565b600054610100900460ff166112115760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016103f3565b603280546001600160a01b0319166001600160a01b03841617905561123781600061148d565b7f1c540707b00eb5427b6b774fc799d756516a54aee108b64b327acc55af557507603260009054906101000a90046001600160a01b0316836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d09190611b8e565b604080516001600160a01b03909316835260ff90911660208301520161119a565b6032546001600160a01b038381169116148061131a57506064546001600160a01b038381169116145b6108595760405162461bcd60e51b815260206004820152603960248201527f456967656e53747261746567792e77697468647261773a2043616e206f6e6c7960448201527f2077697468647261772062454947454e206f7220454947454e0000000000000060648201526084016103f3565b6064546001600160a01b03838116911614156114795760325460405163095ea7b360e01b81526001600160a01b038481166004830152602482018490529091169063095ea7b3906044016020604051808303816000875af11580156113f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114199190611a37565b50606454604051630ea598cb60e41b8152600481018390526001600160a01b039091169063ea598cb090602401600060405180830381600087803b15801561146057600080fd5b505af1158015611474573d6000803e3d6000fd5b505050505b6108596001600160a01b0383168483611579565b6000546201000090046001600160a01b03161580156114b457506001600160a01b03821615155b6115365760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a4016103f3565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a26110dc82610ec7565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65649084015261085992869291600091611609918516908490611686565b80519091501561085957808060200190518101906116279190611a37565b6108595760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103f3565b6060611695848460008561169f565b90505b9392505050565b6060824710156117005760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103f3565b6001600160a01b0385163b6117575760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103f3565b600080866001600160a01b031685876040516117739190611bab565b60006040518083038185875af1925050503d80600081146117b0576040519150601f19603f3d011682016040523d82523d6000602084013e6117b5565b606091505b50915091506117c58282866117d0565b979650505050505050565b606083156117df575081611698565b8251156117ef5782518084602001fd5b8160405162461bcd60e51b81526004016103f39190611911565b6001600160a01b038116811461040557600080fd5b60006020828403121561183057600080fd5b813561169881611809565b60006020828403121561184d57600080fd5b5035919050565b6000806040838503121561186757600080fd5b823561187281611809565b946020939093013593505050565b6000806040838503121561189357600080fd5b823561189e81611809565b915060208301356118ae81611809565b809150509250929050565b60ff8116811461040557600080fd5b6000602082840312156118da57600080fd5b8135611698816118b9565b60005b838110156119005781810151838201526020016118e8565b83811115610aa65750506000910152565b60208152600082518060208401526119308160408501602087016118e5565b601f01601f19169190910160400192915050565b60008060006060848603121561195957600080fd5b833561196481611809565b9250602084013561197481611809565b9150604084013561198481611809565b809150509250925092565b6000806000606084860312156119a457600080fd5b83356119af81611809565b925060208401356119bf81611809565b929592945050506040919091013590565b6000602082840312156119e257600080fd5b815161169881611809565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b600060208284031215611a4957600080fd5b8151801515811461169857600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115611aca57611aca611aa1565b500190565b600082821015611ae157611ae1611aa1565b500390565b6000816000190483118215151615611b0057611b00611aa1565b500290565b600082611b2257634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600060208284031215611b8757600080fd5b5051919050565b600060208284031215611ba057600080fd5b8151611698816118b9565b60008251611bbd8184602087016118e5565b919091019291505056fe4261736520537472617465677920696d706c656d656e746174696f6e20746f20696e68657269742066726f6d20666f72206d6f726520636f6d706c657820696d706c656d656e746174696f6e73a26469706673582212209f0a5f3b361d82437f0c321794900a7aead1b85f77f12d7038cbafbf9ebeb3f164736f6c634300080c0033", + Bin: "0x60a06040523480156200001157600080fd5b5060405162001dc338038062001dc3833981016040819052620000349162000116565b6001600160a01b038116608052806200004c62000054565b505062000148565b600054610100900460ff1615620000c15760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000114576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012957600080fd5b81516001600160a01b03811681146200014157600080fd5b9392505050565b608051611c4a62000179600039600081816101af015281816105ac01528181610ad40152610b9f0152611c4a6000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c80637a8b2637116100c3578063ce7c2ac21161007c578063ce7c2ac2146102da578063d9caed12146102ed578063e3dae51c14610300578063f3e7387514610313578063fabc1cbc14610326578063fdc371ce1461033957600080fd5b80637a8b263714610260578063886f1195146102735780638c8710191461028c5780638f6a62401461029f578063ab5921e1146102b2578063c0c53b8b146102c757600080fd5b806347e7ef241161011557806347e7ef24146101e8578063485cc955146101fb578063553ca5f81461020e578063595c6a67146102215780635ac86ab7146102295780635c975abb1461025857600080fd5b806310d67a2f14610152578063136439dd146101675780632495a5991461017a57806339b70e38146101aa5780633a98ef39146101d1575b600080fd5b61016561016036600461181e565b61034c565b005b61016561017536600461183b565b610408565b60325461018d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61018d7f000000000000000000000000000000000000000000000000000000000000000081565b6101da60335481565b6040519081526020016101a1565b6101da6101f6366004611854565b61054c565b610165610209366004611880565b610790565b6101da61021c36600461181e565b61085e565b610165610872565b6102486102373660046118c8565b6001805460ff9092161b9081161490565b60405190151581526020016101a1565b6001546101da565b6101da61026e36600461183b565b61093e565b60005461018d906201000090046001600160a01b031681565b6101da61029a36600461183b565b610989565b6101da6102ad36600461181e565b610994565b6102ba6109a2565b6040516101a19190611911565b6101656102d5366004611944565b6109c2565b6101da6102e836600461181e565b610aac565b6101656102fb36600461198f565b610b41565b6101da61030e36600461183b565b610d27565b6101da61032136600461183b565b610d60565b61016561033436600461183b565b610d6b565b60645461018d906001600160a01b031681565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c391906119d0565b6001600160a01b0316336001600160a01b0316146103fc5760405162461bcd60e51b81526004016103f3906119ed565b60405180910390fd5b61040581610ec7565b50565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa158015610455573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104799190611a37565b6104955760405162461bcd60e51b81526004016103f390611a59565b6001548181161461050e5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c697479000000000000000060648201526084016103f3565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600180546000918291811614156105a15760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b60448201526064016103f3565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106195760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e6167657260448201526064016103f3565b6106238484610fcc565b60335460006106346103e883611ab7565b905060006103e86106436110e0565b61064d9190611ab7565b9050600061065b8783611acf565b9050806106688489611ae6565b6106729190611b05565b9550856106d85760405162461bcd60e51b815260206004820152602e60248201527f5374726174656779426173652e6465706f7369743a206e65775368617265732060448201526d63616e6e6f74206265207a65726f60901b60648201526084016103f3565b6106e28685611ab7565b60338190556f4b3b4ca85a86c47a098a223fffffffff101561076c5760405162461bcd60e51b815260206004820152603c60248201527f5374726174656779426173652e6465706f7369743a20746f74616c536861726560448201527f73206578636565647320604d41585f544f54414c5f534841524553600000000060648201526084016103f3565b610785826103e86033546107809190611ab7565b611152565b505050505092915050565b600054610100900460ff16158080156107b05750600054600160ff909116105b806107ca5750303b1580156107ca575060005460ff166001145b6107e65760405162461bcd60e51b81526004016103f390611b27565b6000805460ff191660011790558015610809576000805461ff0019166101001790555b61081383836111a6565b8015610859576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b600061086c61026e83610aac565b92915050565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e39190611a37565b6108ff5760405162461bcd60e51b81526004016103f390611a59565b600019600181905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b6000806103e86033546109519190611ab7565b905060006103e86109606110e0565b61096a9190611ab7565b9050816109778583611ae6565b6109819190611b05565b949350505050565b600061086c82610d27565b600061086c61032183610aac565b60606040518060800160405280604d8152602001611bc8604d9139905090565b600054610100900460ff16158080156109e25750600054600160ff909116105b806109fc5750303b1580156109fc575060005460ff166001145b610a185760405162461bcd60e51b81526004016103f390611b27565b6000805460ff191660011790558015610a3b576000805461ff0019166101001790555b606480546001600160a01b0319166001600160a01b038616179055610a6083836111a6565b8015610aa6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b604051633d3f06c960e11b81526001600160a01b0382811660048301523060248301526000917f000000000000000000000000000000000000000000000000000000000000000090911690637a7e0d9290604401602060405180830381865afa158015610b1d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086c9190611b75565b6001805460029081161415610b945760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b60448201526064016103f3565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c0c5760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e6167657260448201526064016103f3565b610c178484846112f1565b60335480831115610ca65760405162461bcd60e51b815260206004820152604d60248201527f5374726174656779426173652e77697468647261773a20616d6f756e7453686160448201527f726573206d757374206265206c657373207468616e206f7220657175616c207460648201526c6f20746f74616c53686172657360981b608482015260a4016103f3565b6000610cb46103e883611ab7565b905060006103e8610cc36110e0565b610ccd9190611ab7565b9050600082610cdc8784611ae6565b610ce69190611b05565b9050610cf28685611acf565b603355610d12610d028284611acf565b6103e86033546107809190611ab7565b610d1d88888361138c565b5050505050505050565b6000806103e8603354610d3a9190611ab7565b905060006103e8610d496110e0565b610d539190611ab7565b9050806109778386611ae6565b600061086c8261093e565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906119d0565b6001600160a01b0316336001600160a01b031614610e125760405162461bcd60e51b81526004016103f3906119ed565b600154198119600154191614610e905760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c697479000000000000000060648201526084016103f3565b600181905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610541565b6001600160a01b038116610f555760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a4016103f3565b600054604080516001600160a01b03620100009093048316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b6032546001600160a01b0383811691161480610ff557506064546001600160a01b038381169116145b6110675760405162461bcd60e51b815260206004820152603760248201527f456967656e53747261746567792e6465706f7369743a2043616e206f6e6c792060448201527f6465706f7369742062454947454e206f7220454947454e00000000000000000060648201526084016103f3565b6064546001600160a01b03838116911614156110dc57606454604051636f074d1f60e11b8152600481018390526001600160a01b039091169063de0e9a3e90602401600060405180830381600087803b1580156110c357600080fd5b505af11580156110d7573d6000803e3d6000fd5b505050505b5050565b6032546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114d9190611b75565b905090565b7fd2494f3479e5da49d386657c292c610b5b01df313d07c62eb0cfa49924a31be88161118684670de0b6b3a7640000611ae6565b6111909190611b05565b6040519081526020015b60405180910390a15050565b600054610100900460ff166112115760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016103f3565b603280546001600160a01b0319166001600160a01b03841617905561123781600061148d565b7f1c540707b00eb5427b6b774fc799d756516a54aee108b64b327acc55af557507603260009054906101000a90046001600160a01b0316836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d09190611b8e565b604080516001600160a01b03909316835260ff90911660208301520161119a565b6032546001600160a01b038381169116148061131a57506064546001600160a01b038381169116145b6108595760405162461bcd60e51b815260206004820152603960248201527f456967656e53747261746567792e77697468647261773a2043616e206f6e6c7960448201527f2077697468647261772062454947454e206f7220454947454e0000000000000060648201526084016103f3565b6064546001600160a01b03838116911614156114795760325460405163095ea7b360e01b81526001600160a01b038481166004830152602482018490529091169063095ea7b3906044016020604051808303816000875af11580156113f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114199190611a37565b50606454604051630ea598cb60e41b8152600481018390526001600160a01b039091169063ea598cb090602401600060405180830381600087803b15801561146057600080fd5b505af1158015611474573d6000803e3d6000fd5b505050505b6108596001600160a01b0383168483611579565b6000546201000090046001600160a01b03161580156114b457506001600160a01b03821615155b6115365760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a4016103f3565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a26110dc82610ec7565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65649084015261085992869291600091611609918516908490611686565b80519091501561085957808060200190518101906116279190611a37565b6108595760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103f3565b6060611695848460008561169f565b90505b9392505050565b6060824710156117005760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103f3565b6001600160a01b0385163b6117575760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103f3565b600080866001600160a01b031685876040516117739190611bab565b60006040518083038185875af1925050503d80600081146117b0576040519150601f19603f3d011682016040523d82523d6000602084013e6117b5565b606091505b50915091506117c58282866117d0565b979650505050505050565b606083156117df575081611698565b8251156117ef5782518084602001fd5b8160405162461bcd60e51b81526004016103f39190611911565b6001600160a01b038116811461040557600080fd5b60006020828403121561183057600080fd5b813561169881611809565b60006020828403121561184d57600080fd5b5035919050565b6000806040838503121561186757600080fd5b823561187281611809565b946020939093013593505050565b6000806040838503121561189357600080fd5b823561189e81611809565b915060208301356118ae81611809565b809150509250929050565b60ff8116811461040557600080fd5b6000602082840312156118da57600080fd5b8135611698816118b9565b60005b838110156119005781810151838201526020016118e8565b83811115610aa65750506000910152565b60208152600082518060208401526119308160408501602087016118e5565b601f01601f19169190910160400192915050565b60008060006060848603121561195957600080fd5b833561196481611809565b9250602084013561197481611809565b9150604084013561198481611809565b809150509250925092565b6000806000606084860312156119a457600080fd5b83356119af81611809565b925060208401356119bf81611809565b929592945050506040919091013590565b6000602082840312156119e257600080fd5b815161169881611809565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b600060208284031215611a4957600080fd5b8151801515811461169857600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115611aca57611aca611aa1565b500190565b600082821015611ae157611ae1611aa1565b500390565b6000816000190483118215151615611b0057611b00611aa1565b500290565b600082611b2257634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600060208284031215611b8757600080fd5b5051919050565b600060208284031215611ba057600080fd5b8151611698816118b9565b60008251611bbd8184602087016118e5565b919091019291505056fe4261736520537472617465677920696d706c656d656e746174696f6e20746f20696e68657269742066726f6d20666f72206d6f726520636f6d706c657820696d706c656d656e746174696f6e73a264697066735822122046ac09ffa1e9c2f65fc030660bad3c9c5eabc3f1c7f98ca353039d438ba30c0d64736f6c634300080c0033", } // EigenStrategyABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/IAVSDirectory/binding.go b/pkg/bindings/IAVSDirectory/binding.go index 6ee8f3ce0..63f096b72 100644 --- a/pkg/bindings/IAVSDirectory/binding.go +++ b/pkg/bindings/IAVSDirectory/binding.go @@ -29,6 +29,20 @@ var ( _ = abi.ConvertType ) +// IAVSDirectoryMagnitudeAllocation is an auto generated low-level Go binding around an user-defined struct. +type IAVSDirectoryMagnitudeAllocation struct { + Strategy common.Address + ExpectedTotalMagnitude uint64 + OperatorSets []IAVSDirectoryOperatorSet + Magnitudes []uint64 +} + +// IAVSDirectoryOperatorSet is an auto generated low-level Go binding around an user-defined struct. +type IAVSDirectoryOperatorSet struct { + Avs common.Address + OperatorSetId uint32 +} + // ISignatureUtilsSignatureWithSaltAndExpiry is an auto generated low-level Go binding around an user-defined struct. type ISignatureUtilsSignatureWithSaltAndExpiry struct { Signature []byte @@ -38,7 +52,7 @@ type ISignatureUtilsSignatureWithSaltAndExpiry struct { // IAVSDirectoryMetaData contains all meta data concerning the IAVSDirectory contract. var IAVSDirectoryMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"OPERATOR_AVS_REGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorAVSRegistrationDigestHash\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deregisterOperatorFromAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorSaltIsSpent\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerOperatorToAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateAVSMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSMetadataURIUpdated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAVSRegistrationStatusUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"anonymous\":false}]", + ABI: "[{\"type\":\"function\",\"name\":\"OPERATOR_AVS_REGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_SET_REGISTRATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"becomeOperatorSetAVS\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"calculateMagnitudeAllocationDigestHash\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"allocations\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.MagnitudeAllocation[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"expectedTotalMagnitude\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudes\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}]},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorAVSRegistrationDigestHash\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorSetForceDeregistrationTypehash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateOperatorSetRegistrationDigestHash\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"cancelSalt\",\"inputs\":[{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createOperatorSets\",\"inputs\":[{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deregisterOperatorFromAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deregisterOperatorFromOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"forceDeregisterFromOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getAllocatableMagnitude\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"numToComplete\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentSlashableMagnitudes\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"\",\"type\":\"uint64[][]\",\"internalType\":\"uint64[][]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNumOperatorsInOperatorSet\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorSetsOfOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"start\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorsInOperatorSet\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"start\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"operators\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSlashableMagnitudes\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"\",\"type\":\"uint64[][]\",\"internalType\":\"uint64[][]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getSlashablePPM\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"linear\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint24[]\",\"internalType\":\"uint24[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalMagnitude\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalMagnitudeAtTimestamp\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalMagnitudes\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalMagnitudesAtTimestamp\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"timestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"inTotalOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isMember\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorSet\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorSetAVS\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperatorSlashable\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"migrateOperatorsToOperatorSets\",\"inputs\":[{\"name\":\"operators\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[][]\",\"internalType\":\"uint32[][]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"modifyAllocations\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"allocations\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.MagnitudeAllocation[]\",\"components\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"expectedTotalMagnitude\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"operatorSets\",\"type\":\"tuple[]\",\"internalType\":\"structIAVSDirectory.OperatorSet[]\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudes\",\"type\":\"uint64[]\",\"internalType\":\"uint64[]\"}]},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorSaltIsSpent\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSetMemberAtIndex\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorSetsMemberOfAtIndex\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerOperatorToAVS\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerOperatorToOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"internalType\":\"uint32[]\"},{\"name\":\"operatorSignature\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithSaltAndExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slashOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"bipsToSlash\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateAVSMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateFreeMagnitude\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"numToComplete\",\"type\":\"uint16[]\",\"internalType\":\"uint16[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AVSMetadataURIUpdated\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AVSMigratedToOperatorSets\",\"inputs\":[{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MagnitudeAllocated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudeToAllocate\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"effectTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MagnitudeDeallocationCompleted\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"freeMagnitudeAdded\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MagnitudeQueueDeallocated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"magnitudeToDeallocate\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"completableTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAVSRegistrationStatusUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIAVSDirectory.OperatorAVSRegistrationStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorAddedToOperatorSet\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorMigratedToOperatorSets\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"avs\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSetIds\",\"type\":\"uint32[]\",\"indexed\":false,\"internalType\":\"uint32[]\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRemovedFromOperatorSet\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetCreated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSlashed\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"bipsToSlash\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false}]", } // IAVSDirectoryABI is the input ABI used to generate the binding from. @@ -218,6 +232,68 @@ func (_IAVSDirectory *IAVSDirectoryCallerSession) OPERATORAVSREGISTRATIONTYPEHAS return _IAVSDirectory.Contract.OPERATORAVSREGISTRATIONTYPEHASH(&_IAVSDirectory.CallOpts) } +// OPERATORSETREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xc825fe68. +// +// Solidity: function OPERATOR_SET_REGISTRATION_TYPEHASH() view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCaller) OPERATORSETREGISTRATIONTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "OPERATOR_SET_REGISTRATION_TYPEHASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// OPERATORSETREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xc825fe68. +// +// Solidity: function OPERATOR_SET_REGISTRATION_TYPEHASH() view returns(bytes32) +func (_IAVSDirectory *IAVSDirectorySession) OPERATORSETREGISTRATIONTYPEHASH() ([32]byte, error) { + return _IAVSDirectory.Contract.OPERATORSETREGISTRATIONTYPEHASH(&_IAVSDirectory.CallOpts) +} + +// OPERATORSETREGISTRATIONTYPEHASH is a free data retrieval call binding the contract method 0xc825fe68. +// +// Solidity: function OPERATOR_SET_REGISTRATION_TYPEHASH() view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCallerSession) OPERATORSETREGISTRATIONTYPEHASH() ([32]byte, error) { + return _IAVSDirectory.Contract.OPERATORSETREGISTRATIONTYPEHASH(&_IAVSDirectory.CallOpts) +} + +// CalculateMagnitudeAllocationDigestHash is a free data retrieval call binding the contract method 0x686b686e. +// +// Solidity: function calculateMagnitudeAllocationDigestHash(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCaller) CalculateMagnitudeAllocationDigestHash(opts *bind.CallOpts, operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, salt [32]byte, expiry *big.Int) ([32]byte, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "calculateMagnitudeAllocationDigestHash", operator, allocations, salt, expiry) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateMagnitudeAllocationDigestHash is a free data retrieval call binding the contract method 0x686b686e. +// +// Solidity: function calculateMagnitudeAllocationDigestHash(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_IAVSDirectory *IAVSDirectorySession) CalculateMagnitudeAllocationDigestHash(operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _IAVSDirectory.Contract.CalculateMagnitudeAllocationDigestHash(&_IAVSDirectory.CallOpts, operator, allocations, salt, expiry) +} + +// CalculateMagnitudeAllocationDigestHash is a free data retrieval call binding the contract method 0x686b686e. +// +// Solidity: function calculateMagnitudeAllocationDigestHash(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCallerSession) CalculateMagnitudeAllocationDigestHash(operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _IAVSDirectory.Contract.CalculateMagnitudeAllocationDigestHash(&_IAVSDirectory.CallOpts, operator, allocations, salt, expiry) +} + // CalculateOperatorAVSRegistrationDigestHash is a free data retrieval call binding the contract method 0xa1060c88. // // Solidity: function calculateOperatorAVSRegistrationDigestHash(address operator, address avs, bytes32 salt, uint256 expiry) view returns(bytes32) @@ -249,216 +325,2089 @@ func (_IAVSDirectory *IAVSDirectoryCallerSession) CalculateOperatorAVSRegistrati return _IAVSDirectory.Contract.CalculateOperatorAVSRegistrationDigestHash(&_IAVSDirectory.CallOpts, operator, avs, salt, expiry) } -// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// CalculateOperatorSetForceDeregistrationTypehash is a free data retrieval call binding the contract method 0xb2841d48. // -// Solidity: function operatorSaltIsSpent(address operator, bytes32 salt) view returns(bool) -func (_IAVSDirectory *IAVSDirectoryCaller) OperatorSaltIsSpent(opts *bind.CallOpts, operator common.Address, salt [32]byte) (bool, error) { +// Solidity: function calculateOperatorSetForceDeregistrationTypehash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCaller) CalculateOperatorSetForceDeregistrationTypehash(opts *bind.CallOpts, avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { var out []interface{} - err := _IAVSDirectory.contract.Call(opts, &out, "operatorSaltIsSpent", operator, salt) + err := _IAVSDirectory.contract.Call(opts, &out, "calculateOperatorSetForceDeregistrationTypehash", avs, operatorSetIds, salt, expiry) if err != nil { - return *new(bool), err + return *new([32]byte), err } - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } -// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// CalculateOperatorSetForceDeregistrationTypehash is a free data retrieval call binding the contract method 0xb2841d48. // -// Solidity: function operatorSaltIsSpent(address operator, bytes32 salt) view returns(bool) -func (_IAVSDirectory *IAVSDirectorySession) OperatorSaltIsSpent(operator common.Address, salt [32]byte) (bool, error) { - return _IAVSDirectory.Contract.OperatorSaltIsSpent(&_IAVSDirectory.CallOpts, operator, salt) +// Solidity: function calculateOperatorSetForceDeregistrationTypehash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_IAVSDirectory *IAVSDirectorySession) CalculateOperatorSetForceDeregistrationTypehash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _IAVSDirectory.Contract.CalculateOperatorSetForceDeregistrationTypehash(&_IAVSDirectory.CallOpts, avs, operatorSetIds, salt, expiry) } -// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// CalculateOperatorSetForceDeregistrationTypehash is a free data retrieval call binding the contract method 0xb2841d48. // -// Solidity: function operatorSaltIsSpent(address operator, bytes32 salt) view returns(bool) -func (_IAVSDirectory *IAVSDirectoryCallerSession) OperatorSaltIsSpent(operator common.Address, salt [32]byte) (bool, error) { - return _IAVSDirectory.Contract.OperatorSaltIsSpent(&_IAVSDirectory.CallOpts, operator, salt) +// Solidity: function calculateOperatorSetForceDeregistrationTypehash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCallerSession) CalculateOperatorSetForceDeregistrationTypehash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _IAVSDirectory.Contract.CalculateOperatorSetForceDeregistrationTypehash(&_IAVSDirectory.CallOpts, avs, operatorSetIds, salt, expiry) } -// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// CalculateOperatorSetRegistrationDigestHash is a free data retrieval call binding the contract method 0x955e6696. // -// Solidity: function deregisterOperatorFromAVS(address operator) returns() -func (_IAVSDirectory *IAVSDirectoryTransactor) DeregisterOperatorFromAVS(opts *bind.TransactOpts, operator common.Address) (*types.Transaction, error) { - return _IAVSDirectory.contract.Transact(opts, "deregisterOperatorFromAVS", operator) +// Solidity: function calculateOperatorSetRegistrationDigestHash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCaller) CalculateOperatorSetRegistrationDigestHash(opts *bind.CallOpts, avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "calculateOperatorSetRegistrationDigestHash", avs, operatorSetIds, salt, expiry) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + } -// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// CalculateOperatorSetRegistrationDigestHash is a free data retrieval call binding the contract method 0x955e6696. // -// Solidity: function deregisterOperatorFromAVS(address operator) returns() -func (_IAVSDirectory *IAVSDirectorySession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { - return _IAVSDirectory.Contract.DeregisterOperatorFromAVS(&_IAVSDirectory.TransactOpts, operator) +// Solidity: function calculateOperatorSetRegistrationDigestHash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_IAVSDirectory *IAVSDirectorySession) CalculateOperatorSetRegistrationDigestHash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _IAVSDirectory.Contract.CalculateOperatorSetRegistrationDigestHash(&_IAVSDirectory.CallOpts, avs, operatorSetIds, salt, expiry) } -// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// CalculateOperatorSetRegistrationDigestHash is a free data retrieval call binding the contract method 0x955e6696. // -// Solidity: function deregisterOperatorFromAVS(address operator) returns() -func (_IAVSDirectory *IAVSDirectoryTransactorSession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { - return _IAVSDirectory.Contract.DeregisterOperatorFromAVS(&_IAVSDirectory.TransactOpts, operator) +// Solidity: function calculateOperatorSetRegistrationDigestHash(address avs, uint32[] operatorSetIds, bytes32 salt, uint256 expiry) view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCallerSession) CalculateOperatorSetRegistrationDigestHash(avs common.Address, operatorSetIds []uint32, salt [32]byte, expiry *big.Int) ([32]byte, error) { + return _IAVSDirectory.Contract.CalculateOperatorSetRegistrationDigestHash(&_IAVSDirectory.CallOpts, avs, operatorSetIds, salt, expiry) } -// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. // -// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() -func (_IAVSDirectory *IAVSDirectoryTransactor) RegisterOperatorToAVS(opts *bind.TransactOpts, operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { - return _IAVSDirectory.contract.Transact(opts, "registerOperatorToAVS", operator, operatorSignature) +// Solidity: function domainSeparator() view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCaller) DomainSeparator(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "domainSeparator") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + } -// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. // -// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() -func (_IAVSDirectory *IAVSDirectorySession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { - return _IAVSDirectory.Contract.RegisterOperatorToAVS(&_IAVSDirectory.TransactOpts, operator, operatorSignature) +// Solidity: function domainSeparator() view returns(bytes32) +func (_IAVSDirectory *IAVSDirectorySession) DomainSeparator() ([32]byte, error) { + return _IAVSDirectory.Contract.DomainSeparator(&_IAVSDirectory.CallOpts) } -// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. // -// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() -func (_IAVSDirectory *IAVSDirectoryTransactorSession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { - return _IAVSDirectory.Contract.RegisterOperatorToAVS(&_IAVSDirectory.TransactOpts, operator, operatorSignature) +// Solidity: function domainSeparator() view returns(bytes32) +func (_IAVSDirectory *IAVSDirectoryCallerSession) DomainSeparator() ([32]byte, error) { + return _IAVSDirectory.Contract.DomainSeparator(&_IAVSDirectory.CallOpts) } -// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// GetAllocatableMagnitude is a free data retrieval call binding the contract method 0x3f78612f. // -// Solidity: function updateAVSMetadataURI(string metadataURI) returns() -func (_IAVSDirectory *IAVSDirectoryTransactor) UpdateAVSMetadataURI(opts *bind.TransactOpts, metadataURI string) (*types.Transaction, error) { - return _IAVSDirectory.contract.Transact(opts, "updateAVSMetadataURI", metadataURI) +// Solidity: function getAllocatableMagnitude(address operator, address strategy, uint16 numToComplete) view returns(uint64) +func (_IAVSDirectory *IAVSDirectoryCaller) GetAllocatableMagnitude(opts *bind.CallOpts, operator common.Address, strategy common.Address, numToComplete uint16) (uint64, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getAllocatableMagnitude", operator, strategy, numToComplete) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + } -// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// GetAllocatableMagnitude is a free data retrieval call binding the contract method 0x3f78612f. // -// Solidity: function updateAVSMetadataURI(string metadataURI) returns() -func (_IAVSDirectory *IAVSDirectorySession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { - return _IAVSDirectory.Contract.UpdateAVSMetadataURI(&_IAVSDirectory.TransactOpts, metadataURI) +// Solidity: function getAllocatableMagnitude(address operator, address strategy, uint16 numToComplete) view returns(uint64) +func (_IAVSDirectory *IAVSDirectorySession) GetAllocatableMagnitude(operator common.Address, strategy common.Address, numToComplete uint16) (uint64, error) { + return _IAVSDirectory.Contract.GetAllocatableMagnitude(&_IAVSDirectory.CallOpts, operator, strategy, numToComplete) } -// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// GetAllocatableMagnitude is a free data retrieval call binding the contract method 0x3f78612f. // -// Solidity: function updateAVSMetadataURI(string metadataURI) returns() -func (_IAVSDirectory *IAVSDirectoryTransactorSession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { - return _IAVSDirectory.Contract.UpdateAVSMetadataURI(&_IAVSDirectory.TransactOpts, metadataURI) +// Solidity: function getAllocatableMagnitude(address operator, address strategy, uint16 numToComplete) view returns(uint64) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetAllocatableMagnitude(operator common.Address, strategy common.Address, numToComplete uint16) (uint64, error) { + return _IAVSDirectory.Contract.GetAllocatableMagnitude(&_IAVSDirectory.CallOpts, operator, strategy, numToComplete) } -// IAVSDirectoryAVSMetadataURIUpdatedIterator is returned from FilterAVSMetadataURIUpdated and is used to iterate over the raw logs and unpacked data for AVSMetadataURIUpdated events raised by the IAVSDirectory contract. -type IAVSDirectoryAVSMetadataURIUpdatedIterator struct { - Event *IAVSDirectoryAVSMetadataURIUpdated // Event containing the contract specifics and raw log +// GetCurrentSlashableMagnitudes is a free data retrieval call binding the contract method 0x1d95b524. +// +// Solidity: function getCurrentSlashableMagnitudes(address operator, address[] strategies) view returns((address,uint32)[], uint64[][]) +func (_IAVSDirectory *IAVSDirectoryCaller) GetCurrentSlashableMagnitudes(opts *bind.CallOpts, operator common.Address, strategies []common.Address) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getCurrentSlashableMagnitudes", operator, strategies) - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data + if err != nil { + return *new([]IAVSDirectoryOperatorSet), *new([][]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]IAVSDirectoryOperatorSet)).(*[]IAVSDirectoryOperatorSet) + out1 := *abi.ConvertType(out[1], new([][]uint64)).(*[][]uint64) + + return out0, out1, err - 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 *IAVSDirectoryAVSMetadataURIUpdatedIterator) 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(IAVSDirectoryAVSMetadataURIUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true +// GetCurrentSlashableMagnitudes is a free data retrieval call binding the contract method 0x1d95b524. +// +// Solidity: function getCurrentSlashableMagnitudes(address operator, address[] strategies) view returns((address,uint32)[], uint64[][]) +func (_IAVSDirectory *IAVSDirectorySession) GetCurrentSlashableMagnitudes(operator common.Address, strategies []common.Address) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + return _IAVSDirectory.Contract.GetCurrentSlashableMagnitudes(&_IAVSDirectory.CallOpts, operator, strategies) +} - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAVSDirectoryAVSMetadataURIUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true +// GetCurrentSlashableMagnitudes is a free data retrieval call binding the contract method 0x1d95b524. +// +// Solidity: function getCurrentSlashableMagnitudes(address operator, address[] strategies) view returns((address,uint32)[], uint64[][]) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetCurrentSlashableMagnitudes(operator common.Address, strategies []common.Address) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + return _IAVSDirectory.Contract.GetCurrentSlashableMagnitudes(&_IAVSDirectory.CallOpts, operator, strategies) +} - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() +// GetNumOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x1023aa35. +// +// Solidity: function getNumOperatorsInOperatorSet((address,uint32) operatorSet) view returns(uint256) +func (_IAVSDirectory *IAVSDirectoryCaller) GetNumOperatorsInOperatorSet(opts *bind.CallOpts, operatorSet IAVSDirectoryOperatorSet) (*big.Int, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getNumOperatorsInOperatorSet", operatorSet) + + if err != nil { + return *new(*big.Int), err } -} -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAVSDirectoryAVSMetadataURIUpdatedIterator) Error() error { - return it.fail + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + } -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAVSDirectoryAVSMetadataURIUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil +// GetNumOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x1023aa35. +// +// Solidity: function getNumOperatorsInOperatorSet((address,uint32) operatorSet) view returns(uint256) +func (_IAVSDirectory *IAVSDirectorySession) GetNumOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet) (*big.Int, error) { + return _IAVSDirectory.Contract.GetNumOperatorsInOperatorSet(&_IAVSDirectory.CallOpts, operatorSet) } -// IAVSDirectoryAVSMetadataURIUpdated represents a AVSMetadataURIUpdated event raised by the IAVSDirectory contract. -type IAVSDirectoryAVSMetadataURIUpdated struct { - Avs common.Address - MetadataURI string - Raw types.Log // Blockchain specific contextual infos +// GetNumOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x1023aa35. +// +// Solidity: function getNumOperatorsInOperatorSet((address,uint32) operatorSet) view returns(uint256) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetNumOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet) (*big.Int, error) { + return _IAVSDirectory.Contract.GetNumOperatorsInOperatorSet(&_IAVSDirectory.CallOpts, operatorSet) } -// FilterAVSMetadataURIUpdated is a free log retrieval operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// GetOperatorSetsOfOperator is a free data retrieval call binding the contract method 0x16ae76cb. // -// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) -func (_IAVSDirectory *IAVSDirectoryFilterer) FilterAVSMetadataURIUpdated(opts *bind.FilterOpts, avs []common.Address) (*IAVSDirectoryAVSMetadataURIUpdatedIterator, error) { +// Solidity: function getOperatorSetsOfOperator(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_IAVSDirectory *IAVSDirectoryCaller) GetOperatorSetsOfOperator(opts *bind.CallOpts, operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getOperatorSetsOfOperator", operator, start, length) - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) + if err != nil { + return *new([]IAVSDirectoryOperatorSet), err } - logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "AVSMetadataURIUpdated", avsRule) + out0 := *abi.ConvertType(out[0], new([]IAVSDirectoryOperatorSet)).(*[]IAVSDirectoryOperatorSet) + + return out0, err + +} + +// GetOperatorSetsOfOperator is a free data retrieval call binding the contract method 0x16ae76cb. +// +// Solidity: function getOperatorSetsOfOperator(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_IAVSDirectory *IAVSDirectorySession) GetOperatorSetsOfOperator(operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + return _IAVSDirectory.Contract.GetOperatorSetsOfOperator(&_IAVSDirectory.CallOpts, operator, start, length) +} + +// GetOperatorSetsOfOperator is a free data retrieval call binding the contract method 0x16ae76cb. +// +// Solidity: function getOperatorSetsOfOperator(address operator, uint256 start, uint256 length) view returns((address,uint32)[] operatorSets) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetOperatorSetsOfOperator(operator common.Address, start *big.Int, length *big.Int) ([]IAVSDirectoryOperatorSet, error) { + return _IAVSDirectory.Contract.GetOperatorSetsOfOperator(&_IAVSDirectory.CallOpts, operator, start, length) +} + +// GetOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x7357723b. +// +// Solidity: function getOperatorsInOperatorSet((address,uint32) operatorSet, uint256 start, uint256 length) view returns(address[] operators) +func (_IAVSDirectory *IAVSDirectoryCaller) GetOperatorsInOperatorSet(opts *bind.CallOpts, operatorSet IAVSDirectoryOperatorSet, start *big.Int, length *big.Int) ([]common.Address, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getOperatorsInOperatorSet", operatorSet, start, length) + if err != nil { - return nil, err + return *new([]common.Address), err } - return &IAVSDirectoryAVSMetadataURIUpdatedIterator{contract: _IAVSDirectory.contract, event: "AVSMetadataURIUpdated", logs: logs, sub: sub}, nil + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + } -// WatchAVSMetadataURIUpdated is a free log subscription operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// GetOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x7357723b. // -// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) -func (_IAVSDirectory *IAVSDirectoryFilterer) WatchAVSMetadataURIUpdated(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryAVSMetadataURIUpdated, avs []common.Address) (event.Subscription, error) { +// Solidity: function getOperatorsInOperatorSet((address,uint32) operatorSet, uint256 start, uint256 length) view returns(address[] operators) +func (_IAVSDirectory *IAVSDirectorySession) GetOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet, start *big.Int, length *big.Int) ([]common.Address, error) { + return _IAVSDirectory.Contract.GetOperatorsInOperatorSet(&_IAVSDirectory.CallOpts, operatorSet, start, length) +} - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) - } +// GetOperatorsInOperatorSet is a free data retrieval call binding the contract method 0x7357723b. +// +// Solidity: function getOperatorsInOperatorSet((address,uint32) operatorSet, uint256 start, uint256 length) view returns(address[] operators) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetOperatorsInOperatorSet(operatorSet IAVSDirectoryOperatorSet, start *big.Int, length *big.Int) ([]common.Address, error) { + return _IAVSDirectory.Contract.GetOperatorsInOperatorSet(&_IAVSDirectory.CallOpts, operatorSet, start, length) +} + +// GetSlashableMagnitudes is a free data retrieval call binding the contract method 0x43b0592d. +// +// Solidity: function getSlashableMagnitudes(address operator, address[] strategies, uint32 timestamp) view returns((address,uint32)[], uint64[][]) +func (_IAVSDirectory *IAVSDirectoryCaller) GetSlashableMagnitudes(opts *bind.CallOpts, operator common.Address, strategies []common.Address, timestamp uint32) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getSlashableMagnitudes", operator, strategies, timestamp) - logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "AVSMetadataURIUpdated", avsRule) if err != nil { - return nil, err + return *new([]IAVSDirectoryOperatorSet), *new([][]uint64), 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(IAVSDirectoryAVSMetadataURIUpdated) - if err := _IAVSDirectory.contract.UnpackLog(event, "AVSMetadataURIUpdated", log); err != nil { - return err - } - event.Raw = log + + out0 := *abi.ConvertType(out[0], new([]IAVSDirectoryOperatorSet)).(*[]IAVSDirectoryOperatorSet) + out1 := *abi.ConvertType(out[1], new([][]uint64)).(*[][]uint64) + + return out0, out1, err + +} + +// GetSlashableMagnitudes is a free data retrieval call binding the contract method 0x43b0592d. +// +// Solidity: function getSlashableMagnitudes(address operator, address[] strategies, uint32 timestamp) view returns((address,uint32)[], uint64[][]) +func (_IAVSDirectory *IAVSDirectorySession) GetSlashableMagnitudes(operator common.Address, strategies []common.Address, timestamp uint32) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + return _IAVSDirectory.Contract.GetSlashableMagnitudes(&_IAVSDirectory.CallOpts, operator, strategies, timestamp) +} + +// GetSlashableMagnitudes is a free data retrieval call binding the contract method 0x43b0592d. +// +// Solidity: function getSlashableMagnitudes(address operator, address[] strategies, uint32 timestamp) view returns((address,uint32)[], uint64[][]) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetSlashableMagnitudes(operator common.Address, strategies []common.Address, timestamp uint32) ([]IAVSDirectoryOperatorSet, [][]uint64, error) { + return _IAVSDirectory.Contract.GetSlashableMagnitudes(&_IAVSDirectory.CallOpts, operator, strategies, timestamp) +} + +// GetSlashablePPM is a free data retrieval call binding the contract method 0x1c699d65. +// +// Solidity: function getSlashablePPM(address operator, (address,uint32) operatorSet, address[] strategies, uint32 timestamp, bool linear) view returns(uint24[]) +func (_IAVSDirectory *IAVSDirectoryCaller) GetSlashablePPM(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet, strategies []common.Address, timestamp uint32, linear bool) ([]*big.Int, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getSlashablePPM", operator, operatorSet, strategies, timestamp, linear) + + if err != nil { + return *new([]*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) + + return out0, err + +} + +// GetSlashablePPM is a free data retrieval call binding the contract method 0x1c699d65. +// +// Solidity: function getSlashablePPM(address operator, (address,uint32) operatorSet, address[] strategies, uint32 timestamp, bool linear) view returns(uint24[]) +func (_IAVSDirectory *IAVSDirectorySession) GetSlashablePPM(operator common.Address, operatorSet IAVSDirectoryOperatorSet, strategies []common.Address, timestamp uint32, linear bool) ([]*big.Int, error) { + return _IAVSDirectory.Contract.GetSlashablePPM(&_IAVSDirectory.CallOpts, operator, operatorSet, strategies, timestamp, linear) +} + +// GetSlashablePPM is a free data retrieval call binding the contract method 0x1c699d65. +// +// Solidity: function getSlashablePPM(address operator, (address,uint32) operatorSet, address[] strategies, uint32 timestamp, bool linear) view returns(uint24[]) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetSlashablePPM(operator common.Address, operatorSet IAVSDirectoryOperatorSet, strategies []common.Address, timestamp uint32, linear bool) ([]*big.Int, error) { + return _IAVSDirectory.Contract.GetSlashablePPM(&_IAVSDirectory.CallOpts, operator, operatorSet, strategies, timestamp, linear) +} + +// GetTotalMagnitude is a free data retrieval call binding the contract method 0xb47265e2. +// +// Solidity: function getTotalMagnitude(address operator, address strategy) view returns(uint64) +func (_IAVSDirectory *IAVSDirectoryCaller) GetTotalMagnitude(opts *bind.CallOpts, operator common.Address, strategy common.Address) (uint64, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getTotalMagnitude", operator, strategy) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// GetTotalMagnitude is a free data retrieval call binding the contract method 0xb47265e2. +// +// Solidity: function getTotalMagnitude(address operator, address strategy) view returns(uint64) +func (_IAVSDirectory *IAVSDirectorySession) GetTotalMagnitude(operator common.Address, strategy common.Address) (uint64, error) { + return _IAVSDirectory.Contract.GetTotalMagnitude(&_IAVSDirectory.CallOpts, operator, strategy) +} + +// GetTotalMagnitude is a free data retrieval call binding the contract method 0xb47265e2. +// +// Solidity: function getTotalMagnitude(address operator, address strategy) view returns(uint64) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetTotalMagnitude(operator common.Address, strategy common.Address) (uint64, error) { + return _IAVSDirectory.Contract.GetTotalMagnitude(&_IAVSDirectory.CallOpts, operator, strategy) +} + +// GetTotalMagnitudeAtTimestamp is a free data retrieval call binding the contract method 0xdabe97c7. +// +// Solidity: function getTotalMagnitudeAtTimestamp(address operator, address strategy, uint32 timestamp) view returns(uint64) +func (_IAVSDirectory *IAVSDirectoryCaller) GetTotalMagnitudeAtTimestamp(opts *bind.CallOpts, operator common.Address, strategy common.Address, timestamp uint32) (uint64, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getTotalMagnitudeAtTimestamp", operator, strategy, timestamp) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// GetTotalMagnitudeAtTimestamp is a free data retrieval call binding the contract method 0xdabe97c7. +// +// Solidity: function getTotalMagnitudeAtTimestamp(address operator, address strategy, uint32 timestamp) view returns(uint64) +func (_IAVSDirectory *IAVSDirectorySession) GetTotalMagnitudeAtTimestamp(operator common.Address, strategy common.Address, timestamp uint32) (uint64, error) { + return _IAVSDirectory.Contract.GetTotalMagnitudeAtTimestamp(&_IAVSDirectory.CallOpts, operator, strategy, timestamp) +} + +// GetTotalMagnitudeAtTimestamp is a free data retrieval call binding the contract method 0xdabe97c7. +// +// Solidity: function getTotalMagnitudeAtTimestamp(address operator, address strategy, uint32 timestamp) view returns(uint64) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetTotalMagnitudeAtTimestamp(operator common.Address, strategy common.Address, timestamp uint32) (uint64, error) { + return _IAVSDirectory.Contract.GetTotalMagnitudeAtTimestamp(&_IAVSDirectory.CallOpts, operator, strategy, timestamp) +} + +// GetTotalMagnitudes is a free data retrieval call binding the contract method 0x39a9a3ed. +// +// Solidity: function getTotalMagnitudes(address operator, address[] strategies) view returns(uint64[]) +func (_IAVSDirectory *IAVSDirectoryCaller) GetTotalMagnitudes(opts *bind.CallOpts, operator common.Address, strategies []common.Address) ([]uint64, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getTotalMagnitudes", operator, strategies) + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +// GetTotalMagnitudes is a free data retrieval call binding the contract method 0x39a9a3ed. +// +// Solidity: function getTotalMagnitudes(address operator, address[] strategies) view returns(uint64[]) +func (_IAVSDirectory *IAVSDirectorySession) GetTotalMagnitudes(operator common.Address, strategies []common.Address) ([]uint64, error) { + return _IAVSDirectory.Contract.GetTotalMagnitudes(&_IAVSDirectory.CallOpts, operator, strategies) +} + +// GetTotalMagnitudes is a free data retrieval call binding the contract method 0x39a9a3ed. +// +// Solidity: function getTotalMagnitudes(address operator, address[] strategies) view returns(uint64[]) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetTotalMagnitudes(operator common.Address, strategies []common.Address) ([]uint64, error) { + return _IAVSDirectory.Contract.GetTotalMagnitudes(&_IAVSDirectory.CallOpts, operator, strategies) +} + +// GetTotalMagnitudesAtTimestamp is a free data retrieval call binding the contract method 0x858d0b47. +// +// Solidity: function getTotalMagnitudesAtTimestamp(address operator, address[] strategies, uint32 timestamp) view returns(uint64[]) +func (_IAVSDirectory *IAVSDirectoryCaller) GetTotalMagnitudesAtTimestamp(opts *bind.CallOpts, operator common.Address, strategies []common.Address, timestamp uint32) ([]uint64, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "getTotalMagnitudesAtTimestamp", operator, strategies, timestamp) + + if err != nil { + return *new([]uint64), err + } + + out0 := *abi.ConvertType(out[0], new([]uint64)).(*[]uint64) + + return out0, err + +} + +// GetTotalMagnitudesAtTimestamp is a free data retrieval call binding the contract method 0x858d0b47. +// +// Solidity: function getTotalMagnitudesAtTimestamp(address operator, address[] strategies, uint32 timestamp) view returns(uint64[]) +func (_IAVSDirectory *IAVSDirectorySession) GetTotalMagnitudesAtTimestamp(operator common.Address, strategies []common.Address, timestamp uint32) ([]uint64, error) { + return _IAVSDirectory.Contract.GetTotalMagnitudesAtTimestamp(&_IAVSDirectory.CallOpts, operator, strategies, timestamp) +} + +// GetTotalMagnitudesAtTimestamp is a free data retrieval call binding the contract method 0x858d0b47. +// +// Solidity: function getTotalMagnitudesAtTimestamp(address operator, address[] strategies, uint32 timestamp) view returns(uint64[]) +func (_IAVSDirectory *IAVSDirectoryCallerSession) GetTotalMagnitudesAtTimestamp(operator common.Address, strategies []common.Address, timestamp uint32) ([]uint64, error) { + return _IAVSDirectory.Contract.GetTotalMagnitudesAtTimestamp(&_IAVSDirectory.CallOpts, operator, strategies, timestamp) +} + +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. +// +// Solidity: function inTotalOperatorSets(address operator) view returns(uint256) +func (_IAVSDirectory *IAVSDirectoryCaller) InTotalOperatorSets(opts *bind.CallOpts, operator common.Address) (*big.Int, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "inTotalOperatorSets", operator) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. +// +// Solidity: function inTotalOperatorSets(address operator) view returns(uint256) +func (_IAVSDirectory *IAVSDirectorySession) InTotalOperatorSets(operator common.Address) (*big.Int, error) { + return _IAVSDirectory.Contract.InTotalOperatorSets(&_IAVSDirectory.CallOpts, operator) +} + +// InTotalOperatorSets is a free data retrieval call binding the contract method 0xcbdf0e42. +// +// Solidity: function inTotalOperatorSets(address operator) view returns(uint256) +func (_IAVSDirectory *IAVSDirectoryCallerSession) InTotalOperatorSets(operator common.Address) (*big.Int, error) { + return _IAVSDirectory.Contract.InTotalOperatorSets(&_IAVSDirectory.CallOpts, operator) +} + +// IsMember is a free data retrieval call binding the contract method 0xda2ff05d. +// +// Solidity: function isMember(address operator, (address,uint32) operatorSet) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCaller) IsMember(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "isMember", operator, operatorSet) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsMember is a free data retrieval call binding the contract method 0xda2ff05d. +// +// Solidity: function isMember(address operator, (address,uint32) operatorSet) view returns(bool) +func (_IAVSDirectory *IAVSDirectorySession) IsMember(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _IAVSDirectory.Contract.IsMember(&_IAVSDirectory.CallOpts, operator, operatorSet) +} + +// IsMember is a free data retrieval call binding the contract method 0xda2ff05d. +// +// Solidity: function isMember(address operator, (address,uint32) operatorSet) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCallerSession) IsMember(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _IAVSDirectory.Contract.IsMember(&_IAVSDirectory.CallOpts, operator, operatorSet) +} + +// IsOperatorSet is a free data retrieval call binding the contract method 0x84d76f7b. +// +// Solidity: function isOperatorSet(address avs, uint32 operatorSetId) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCaller) IsOperatorSet(opts *bind.CallOpts, avs common.Address, operatorSetId uint32) (bool, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "isOperatorSet", avs, operatorSetId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOperatorSet is a free data retrieval call binding the contract method 0x84d76f7b. +// +// Solidity: function isOperatorSet(address avs, uint32 operatorSetId) view returns(bool) +func (_IAVSDirectory *IAVSDirectorySession) IsOperatorSet(avs common.Address, operatorSetId uint32) (bool, error) { + return _IAVSDirectory.Contract.IsOperatorSet(&_IAVSDirectory.CallOpts, avs, operatorSetId) +} + +// IsOperatorSet is a free data retrieval call binding the contract method 0x84d76f7b. +// +// Solidity: function isOperatorSet(address avs, uint32 operatorSetId) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCallerSession) IsOperatorSet(avs common.Address, operatorSetId uint32) (bool, error) { + return _IAVSDirectory.Contract.IsOperatorSet(&_IAVSDirectory.CallOpts, avs, operatorSetId) +} + +// IsOperatorSetAVS is a free data retrieval call binding the contract method 0x7673e93a. +// +// Solidity: function isOperatorSetAVS(address avs) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCaller) IsOperatorSetAVS(opts *bind.CallOpts, avs common.Address) (bool, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "isOperatorSetAVS", avs) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOperatorSetAVS is a free data retrieval call binding the contract method 0x7673e93a. +// +// Solidity: function isOperatorSetAVS(address avs) view returns(bool) +func (_IAVSDirectory *IAVSDirectorySession) IsOperatorSetAVS(avs common.Address) (bool, error) { + return _IAVSDirectory.Contract.IsOperatorSetAVS(&_IAVSDirectory.CallOpts, avs) +} + +// IsOperatorSetAVS is a free data retrieval call binding the contract method 0x7673e93a. +// +// Solidity: function isOperatorSetAVS(address avs) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCallerSession) IsOperatorSetAVS(avs common.Address) (bool, error) { + return _IAVSDirectory.Contract.IsOperatorSetAVS(&_IAVSDirectory.CallOpts, avs) +} + +// IsOperatorSlashable is a free data retrieval call binding the contract method 0x1352c3e6. +// +// Solidity: function isOperatorSlashable(address operator, (address,uint32) operatorSet) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCaller) IsOperatorSlashable(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "isOperatorSlashable", operator, operatorSet) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOperatorSlashable is a free data retrieval call binding the contract method 0x1352c3e6. +// +// Solidity: function isOperatorSlashable(address operator, (address,uint32) operatorSet) view returns(bool) +func (_IAVSDirectory *IAVSDirectorySession) IsOperatorSlashable(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _IAVSDirectory.Contract.IsOperatorSlashable(&_IAVSDirectory.CallOpts, operator, operatorSet) +} + +// IsOperatorSlashable is a free data retrieval call binding the contract method 0x1352c3e6. +// +// Solidity: function isOperatorSlashable(address operator, (address,uint32) operatorSet) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCallerSession) IsOperatorSlashable(operator common.Address, operatorSet IAVSDirectoryOperatorSet) (bool, error) { + return _IAVSDirectory.Contract.IsOperatorSlashable(&_IAVSDirectory.CallOpts, operator, operatorSet) +} + +// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// +// Solidity: function operatorSaltIsSpent(address operator, bytes32 salt) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCaller) OperatorSaltIsSpent(opts *bind.CallOpts, operator common.Address, salt [32]byte) (bool, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "operatorSaltIsSpent", operator, salt) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// +// Solidity: function operatorSaltIsSpent(address operator, bytes32 salt) view returns(bool) +func (_IAVSDirectory *IAVSDirectorySession) OperatorSaltIsSpent(operator common.Address, salt [32]byte) (bool, error) { + return _IAVSDirectory.Contract.OperatorSaltIsSpent(&_IAVSDirectory.CallOpts, operator, salt) +} + +// OperatorSaltIsSpent is a free data retrieval call binding the contract method 0x374823b5. +// +// Solidity: function operatorSaltIsSpent(address operator, bytes32 salt) view returns(bool) +func (_IAVSDirectory *IAVSDirectoryCallerSession) OperatorSaltIsSpent(operator common.Address, salt [32]byte) (bool, error) { + return _IAVSDirectory.Contract.OperatorSaltIsSpent(&_IAVSDirectory.CallOpts, operator, salt) +} + +// OperatorSetMemberAtIndex is a free data retrieval call binding the contract method 0x411d415b. +// +// Solidity: function operatorSetMemberAtIndex((address,uint32) operatorSet, uint256 index) view returns(address) +func (_IAVSDirectory *IAVSDirectoryCaller) OperatorSetMemberAtIndex(opts *bind.CallOpts, operatorSet IAVSDirectoryOperatorSet, index *big.Int) (common.Address, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "operatorSetMemberAtIndex", operatorSet, index) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OperatorSetMemberAtIndex is a free data retrieval call binding the contract method 0x411d415b. +// +// Solidity: function operatorSetMemberAtIndex((address,uint32) operatorSet, uint256 index) view returns(address) +func (_IAVSDirectory *IAVSDirectorySession) OperatorSetMemberAtIndex(operatorSet IAVSDirectoryOperatorSet, index *big.Int) (common.Address, error) { + return _IAVSDirectory.Contract.OperatorSetMemberAtIndex(&_IAVSDirectory.CallOpts, operatorSet, index) +} + +// OperatorSetMemberAtIndex is a free data retrieval call binding the contract method 0x411d415b. +// +// Solidity: function operatorSetMemberAtIndex((address,uint32) operatorSet, uint256 index) view returns(address) +func (_IAVSDirectory *IAVSDirectoryCallerSession) OperatorSetMemberAtIndex(operatorSet IAVSDirectoryOperatorSet, index *big.Int) (common.Address, error) { + return _IAVSDirectory.Contract.OperatorSetMemberAtIndex(&_IAVSDirectory.CallOpts, operatorSet, index) +} + +// OperatorSetsMemberOfAtIndex is a free data retrieval call binding the contract method 0xb5a768ca. +// +// Solidity: function operatorSetsMemberOfAtIndex(address operator, uint256 index) view returns((address,uint32)) +func (_IAVSDirectory *IAVSDirectoryCaller) OperatorSetsMemberOfAtIndex(opts *bind.CallOpts, operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + var out []interface{} + err := _IAVSDirectory.contract.Call(opts, &out, "operatorSetsMemberOfAtIndex", operator, index) + + if err != nil { + return *new(IAVSDirectoryOperatorSet), err + } + + out0 := *abi.ConvertType(out[0], new(IAVSDirectoryOperatorSet)).(*IAVSDirectoryOperatorSet) + + return out0, err + +} + +// OperatorSetsMemberOfAtIndex is a free data retrieval call binding the contract method 0xb5a768ca. +// +// Solidity: function operatorSetsMemberOfAtIndex(address operator, uint256 index) view returns((address,uint32)) +func (_IAVSDirectory *IAVSDirectorySession) OperatorSetsMemberOfAtIndex(operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + return _IAVSDirectory.Contract.OperatorSetsMemberOfAtIndex(&_IAVSDirectory.CallOpts, operator, index) +} + +// OperatorSetsMemberOfAtIndex is a free data retrieval call binding the contract method 0xb5a768ca. +// +// Solidity: function operatorSetsMemberOfAtIndex(address operator, uint256 index) view returns((address,uint32)) +func (_IAVSDirectory *IAVSDirectoryCallerSession) OperatorSetsMemberOfAtIndex(operator common.Address, index *big.Int) (IAVSDirectoryOperatorSet, error) { + return _IAVSDirectory.Contract.OperatorSetsMemberOfAtIndex(&_IAVSDirectory.CallOpts, operator, index) +} + +// BecomeOperatorSetAVS is a paid mutator transaction binding the contract method 0xaec205c5. +// +// Solidity: function becomeOperatorSetAVS() returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) BecomeOperatorSetAVS(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "becomeOperatorSetAVS") +} + +// BecomeOperatorSetAVS is a paid mutator transaction binding the contract method 0xaec205c5. +// +// Solidity: function becomeOperatorSetAVS() returns() +func (_IAVSDirectory *IAVSDirectorySession) BecomeOperatorSetAVS() (*types.Transaction, error) { + return _IAVSDirectory.Contract.BecomeOperatorSetAVS(&_IAVSDirectory.TransactOpts) +} + +// BecomeOperatorSetAVS is a paid mutator transaction binding the contract method 0xaec205c5. +// +// Solidity: function becomeOperatorSetAVS() returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) BecomeOperatorSetAVS() (*types.Transaction, error) { + return _IAVSDirectory.Contract.BecomeOperatorSetAVS(&_IAVSDirectory.TransactOpts) +} + +// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// +// Solidity: function cancelSalt(bytes32 salt) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) CancelSalt(opts *bind.TransactOpts, salt [32]byte) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "cancelSalt", salt) +} + +// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// +// Solidity: function cancelSalt(bytes32 salt) returns() +func (_IAVSDirectory *IAVSDirectorySession) CancelSalt(salt [32]byte) (*types.Transaction, error) { + return _IAVSDirectory.Contract.CancelSalt(&_IAVSDirectory.TransactOpts, salt) +} + +// CancelSalt is a paid mutator transaction binding the contract method 0xec76f442. +// +// Solidity: function cancelSalt(bytes32 salt) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) CancelSalt(salt [32]byte) (*types.Transaction, error) { + return _IAVSDirectory.Contract.CancelSalt(&_IAVSDirectory.TransactOpts, salt) +} + +// CreateOperatorSets is a paid mutator transaction binding the contract method 0xafe02ed5. +// +// Solidity: function createOperatorSets(uint32[] operatorSetIds) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) CreateOperatorSets(opts *bind.TransactOpts, operatorSetIds []uint32) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "createOperatorSets", operatorSetIds) +} + +// CreateOperatorSets is a paid mutator transaction binding the contract method 0xafe02ed5. +// +// Solidity: function createOperatorSets(uint32[] operatorSetIds) returns() +func (_IAVSDirectory *IAVSDirectorySession) CreateOperatorSets(operatorSetIds []uint32) (*types.Transaction, error) { + return _IAVSDirectory.Contract.CreateOperatorSets(&_IAVSDirectory.TransactOpts, operatorSetIds) +} + +// CreateOperatorSets is a paid mutator transaction binding the contract method 0xafe02ed5. +// +// Solidity: function createOperatorSets(uint32[] operatorSetIds) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) CreateOperatorSets(operatorSetIds []uint32) (*types.Transaction, error) { + return _IAVSDirectory.Contract.CreateOperatorSets(&_IAVSDirectory.TransactOpts, operatorSetIds) +} + +// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// +// Solidity: function deregisterOperatorFromAVS(address operator) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) DeregisterOperatorFromAVS(opts *bind.TransactOpts, operator common.Address) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "deregisterOperatorFromAVS", operator) +} + +// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// +// Solidity: function deregisterOperatorFromAVS(address operator) returns() +func (_IAVSDirectory *IAVSDirectorySession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { + return _IAVSDirectory.Contract.DeregisterOperatorFromAVS(&_IAVSDirectory.TransactOpts, operator) +} + +// DeregisterOperatorFromAVS is a paid mutator transaction binding the contract method 0xa364f4da. +// +// Solidity: function deregisterOperatorFromAVS(address operator) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) DeregisterOperatorFromAVS(operator common.Address) (*types.Transaction, error) { + return _IAVSDirectory.Contract.DeregisterOperatorFromAVS(&_IAVSDirectory.TransactOpts, operator) +} + +// DeregisterOperatorFromOperatorSets is a paid mutator transaction binding the contract method 0xc1a8e2c5. +// +// Solidity: function deregisterOperatorFromOperatorSets(address operator, uint32[] operatorSetIds) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) DeregisterOperatorFromOperatorSets(opts *bind.TransactOpts, operator common.Address, operatorSetIds []uint32) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "deregisterOperatorFromOperatorSets", operator, operatorSetIds) +} + +// DeregisterOperatorFromOperatorSets is a paid mutator transaction binding the contract method 0xc1a8e2c5. +// +// Solidity: function deregisterOperatorFromOperatorSets(address operator, uint32[] operatorSetIds) returns() +func (_IAVSDirectory *IAVSDirectorySession) DeregisterOperatorFromOperatorSets(operator common.Address, operatorSetIds []uint32) (*types.Transaction, error) { + return _IAVSDirectory.Contract.DeregisterOperatorFromOperatorSets(&_IAVSDirectory.TransactOpts, operator, operatorSetIds) +} + +// DeregisterOperatorFromOperatorSets is a paid mutator transaction binding the contract method 0xc1a8e2c5. +// +// Solidity: function deregisterOperatorFromOperatorSets(address operator, uint32[] operatorSetIds) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) DeregisterOperatorFromOperatorSets(operator common.Address, operatorSetIds []uint32) (*types.Transaction, error) { + return _IAVSDirectory.Contract.DeregisterOperatorFromOperatorSets(&_IAVSDirectory.TransactOpts, operator, operatorSetIds) +} + +// ForceDeregisterFromOperatorSets is a paid mutator transaction binding the contract method 0x3fee332d. +// +// Solidity: function forceDeregisterFromOperatorSets(address operator, address avs, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) ForceDeregisterFromOperatorSets(opts *bind.TransactOpts, operator common.Address, avs common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "forceDeregisterFromOperatorSets", operator, avs, operatorSetIds, operatorSignature) +} + +// ForceDeregisterFromOperatorSets is a paid mutator transaction binding the contract method 0x3fee332d. +// +// Solidity: function forceDeregisterFromOperatorSets(address operator, address avs, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectorySession) ForceDeregisterFromOperatorSets(operator common.Address, avs common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.Contract.ForceDeregisterFromOperatorSets(&_IAVSDirectory.TransactOpts, operator, avs, operatorSetIds, operatorSignature) +} + +// ForceDeregisterFromOperatorSets is a paid mutator transaction binding the contract method 0x3fee332d. +// +// Solidity: function forceDeregisterFromOperatorSets(address operator, address avs, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) ForceDeregisterFromOperatorSets(operator common.Address, avs common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.Contract.ForceDeregisterFromOperatorSets(&_IAVSDirectory.TransactOpts, operator, avs, operatorSetIds, operatorSignature) +} + +// MigrateOperatorsToOperatorSets is a paid mutator transaction binding the contract method 0xef2dfa8d. +// +// Solidity: function migrateOperatorsToOperatorSets(address[] operators, uint32[][] operatorSetIds) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) MigrateOperatorsToOperatorSets(opts *bind.TransactOpts, operators []common.Address, operatorSetIds [][]uint32) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "migrateOperatorsToOperatorSets", operators, operatorSetIds) +} + +// MigrateOperatorsToOperatorSets is a paid mutator transaction binding the contract method 0xef2dfa8d. +// +// Solidity: function migrateOperatorsToOperatorSets(address[] operators, uint32[][] operatorSetIds) returns() +func (_IAVSDirectory *IAVSDirectorySession) MigrateOperatorsToOperatorSets(operators []common.Address, operatorSetIds [][]uint32) (*types.Transaction, error) { + return _IAVSDirectory.Contract.MigrateOperatorsToOperatorSets(&_IAVSDirectory.TransactOpts, operators, operatorSetIds) +} + +// MigrateOperatorsToOperatorSets is a paid mutator transaction binding the contract method 0xef2dfa8d. +// +// Solidity: function migrateOperatorsToOperatorSets(address[] operators, uint32[][] operatorSetIds) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) MigrateOperatorsToOperatorSets(operators []common.Address, operatorSetIds [][]uint32) (*types.Transaction, error) { + return _IAVSDirectory.Contract.MigrateOperatorsToOperatorSets(&_IAVSDirectory.TransactOpts, operators, operatorSetIds) +} + +// ModifyAllocations is a paid mutator transaction binding the contract method 0xf8e91d16. +// +// Solidity: function modifyAllocations(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) ModifyAllocations(opts *bind.TransactOpts, operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "modifyAllocations", operator, allocations, operatorSignature) +} + +// ModifyAllocations is a paid mutator transaction binding the contract method 0xf8e91d16. +// +// Solidity: function modifyAllocations(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectorySession) ModifyAllocations(operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.Contract.ModifyAllocations(&_IAVSDirectory.TransactOpts, operator, allocations, operatorSignature) +} + +// ModifyAllocations is a paid mutator transaction binding the contract method 0xf8e91d16. +// +// Solidity: function modifyAllocations(address operator, (address,uint64,(address,uint32)[],uint64[])[] allocations, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) ModifyAllocations(operator common.Address, allocations []IAVSDirectoryMagnitudeAllocation, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.Contract.ModifyAllocations(&_IAVSDirectory.TransactOpts, operator, allocations, operatorSignature) +} + +// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// +// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) RegisterOperatorToAVS(opts *bind.TransactOpts, operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "registerOperatorToAVS", operator, operatorSignature) +} + +// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// +// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectorySession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.Contract.RegisterOperatorToAVS(&_IAVSDirectory.TransactOpts, operator, operatorSignature) +} + +// RegisterOperatorToAVS is a paid mutator transaction binding the contract method 0x9926ee7d. +// +// Solidity: function registerOperatorToAVS(address operator, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) RegisterOperatorToAVS(operator common.Address, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.Contract.RegisterOperatorToAVS(&_IAVSDirectory.TransactOpts, operator, operatorSignature) +} + +// RegisterOperatorToOperatorSets is a paid mutator transaction binding the contract method 0x1e2199e2. +// +// Solidity: function registerOperatorToOperatorSets(address operator, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) RegisterOperatorToOperatorSets(opts *bind.TransactOpts, operator common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "registerOperatorToOperatorSets", operator, operatorSetIds, operatorSignature) +} + +// RegisterOperatorToOperatorSets is a paid mutator transaction binding the contract method 0x1e2199e2. +// +// Solidity: function registerOperatorToOperatorSets(address operator, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectorySession) RegisterOperatorToOperatorSets(operator common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.Contract.RegisterOperatorToOperatorSets(&_IAVSDirectory.TransactOpts, operator, operatorSetIds, operatorSignature) +} + +// RegisterOperatorToOperatorSets is a paid mutator transaction binding the contract method 0x1e2199e2. +// +// Solidity: function registerOperatorToOperatorSets(address operator, uint32[] operatorSetIds, (bytes,bytes32,uint256) operatorSignature) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) RegisterOperatorToOperatorSets(operator common.Address, operatorSetIds []uint32, operatorSignature ISignatureUtilsSignatureWithSaltAndExpiry) (*types.Transaction, error) { + return _IAVSDirectory.Contract.RegisterOperatorToOperatorSets(&_IAVSDirectory.TransactOpts, operator, operatorSetIds, operatorSignature) +} + +// SlashOperator is a paid mutator transaction binding the contract method 0xbd74a06c. +// +// Solidity: function slashOperator(address operator, uint32 operatorSetId, address[] strategies, uint16 bipsToSlash) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) SlashOperator(opts *bind.TransactOpts, operator common.Address, operatorSetId uint32, strategies []common.Address, bipsToSlash uint16) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "slashOperator", operator, operatorSetId, strategies, bipsToSlash) +} + +// SlashOperator is a paid mutator transaction binding the contract method 0xbd74a06c. +// +// Solidity: function slashOperator(address operator, uint32 operatorSetId, address[] strategies, uint16 bipsToSlash) returns() +func (_IAVSDirectory *IAVSDirectorySession) SlashOperator(operator common.Address, operatorSetId uint32, strategies []common.Address, bipsToSlash uint16) (*types.Transaction, error) { + return _IAVSDirectory.Contract.SlashOperator(&_IAVSDirectory.TransactOpts, operator, operatorSetId, strategies, bipsToSlash) +} + +// SlashOperator is a paid mutator transaction binding the contract method 0xbd74a06c. +// +// Solidity: function slashOperator(address operator, uint32 operatorSetId, address[] strategies, uint16 bipsToSlash) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) SlashOperator(operator common.Address, operatorSetId uint32, strategies []common.Address, bipsToSlash uint16) (*types.Transaction, error) { + return _IAVSDirectory.Contract.SlashOperator(&_IAVSDirectory.TransactOpts, operator, operatorSetId, strategies, bipsToSlash) +} + +// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// +// Solidity: function updateAVSMetadataURI(string metadataURI) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) UpdateAVSMetadataURI(opts *bind.TransactOpts, metadataURI string) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "updateAVSMetadataURI", metadataURI) +} + +// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// +// Solidity: function updateAVSMetadataURI(string metadataURI) returns() +func (_IAVSDirectory *IAVSDirectorySession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { + return _IAVSDirectory.Contract.UpdateAVSMetadataURI(&_IAVSDirectory.TransactOpts, metadataURI) +} + +// UpdateAVSMetadataURI is a paid mutator transaction binding the contract method 0xa98fb355. +// +// Solidity: function updateAVSMetadataURI(string metadataURI) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) UpdateAVSMetadataURI(metadataURI string) (*types.Transaction, error) { + return _IAVSDirectory.Contract.UpdateAVSMetadataURI(&_IAVSDirectory.TransactOpts, metadataURI) +} + +// UpdateFreeMagnitude is a paid mutator transaction binding the contract method 0xce770388. +// +// Solidity: function updateFreeMagnitude(address operator, address[] strategies, uint16[] numToComplete) returns() +func (_IAVSDirectory *IAVSDirectoryTransactor) UpdateFreeMagnitude(opts *bind.TransactOpts, operator common.Address, strategies []common.Address, numToComplete []uint16) (*types.Transaction, error) { + return _IAVSDirectory.contract.Transact(opts, "updateFreeMagnitude", operator, strategies, numToComplete) +} + +// UpdateFreeMagnitude is a paid mutator transaction binding the contract method 0xce770388. +// +// Solidity: function updateFreeMagnitude(address operator, address[] strategies, uint16[] numToComplete) returns() +func (_IAVSDirectory *IAVSDirectorySession) UpdateFreeMagnitude(operator common.Address, strategies []common.Address, numToComplete []uint16) (*types.Transaction, error) { + return _IAVSDirectory.Contract.UpdateFreeMagnitude(&_IAVSDirectory.TransactOpts, operator, strategies, numToComplete) +} + +// UpdateFreeMagnitude is a paid mutator transaction binding the contract method 0xce770388. +// +// Solidity: function updateFreeMagnitude(address operator, address[] strategies, uint16[] numToComplete) returns() +func (_IAVSDirectory *IAVSDirectoryTransactorSession) UpdateFreeMagnitude(operator common.Address, strategies []common.Address, numToComplete []uint16) (*types.Transaction, error) { + return _IAVSDirectory.Contract.UpdateFreeMagnitude(&_IAVSDirectory.TransactOpts, operator, strategies, numToComplete) +} + +// IAVSDirectoryAVSMetadataURIUpdatedIterator is returned from FilterAVSMetadataURIUpdated and is used to iterate over the raw logs and unpacked data for AVSMetadataURIUpdated events raised by the IAVSDirectory contract. +type IAVSDirectoryAVSMetadataURIUpdatedIterator struct { + Event *IAVSDirectoryAVSMetadataURIUpdated // 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 *IAVSDirectoryAVSMetadataURIUpdatedIterator) 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(IAVSDirectoryAVSMetadataURIUpdated) + 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(IAVSDirectoryAVSMetadataURIUpdated) + 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 *IAVSDirectoryAVSMetadataURIUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryAVSMetadataURIUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryAVSMetadataURIUpdated represents a AVSMetadataURIUpdated event raised by the IAVSDirectory contract. +type IAVSDirectoryAVSMetadataURIUpdated struct { + Avs common.Address + MetadataURI string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAVSMetadataURIUpdated is a free log retrieval operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// +// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterAVSMetadataURIUpdated(opts *bind.FilterOpts, avs []common.Address) (*IAVSDirectoryAVSMetadataURIUpdatedIterator, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "AVSMetadataURIUpdated", avsRule) + if err != nil { + return nil, err + } + return &IAVSDirectoryAVSMetadataURIUpdatedIterator{contract: _IAVSDirectory.contract, event: "AVSMetadataURIUpdated", logs: logs, sub: sub}, nil +} + +// WatchAVSMetadataURIUpdated is a free log subscription operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// +// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchAVSMetadataURIUpdated(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryAVSMetadataURIUpdated, avs []common.Address) (event.Subscription, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "AVSMetadataURIUpdated", avsRule) + 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(IAVSDirectoryAVSMetadataURIUpdated) + if err := _IAVSDirectory.contract.UnpackLog(event, "AVSMetadataURIUpdated", 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 +} + +// ParseAVSMetadataURIUpdated is a log parse operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// +// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseAVSMetadataURIUpdated(log types.Log) (*IAVSDirectoryAVSMetadataURIUpdated, error) { + event := new(IAVSDirectoryAVSMetadataURIUpdated) + if err := _IAVSDirectory.contract.UnpackLog(event, "AVSMetadataURIUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IAVSDirectoryAVSMigratedToOperatorSetsIterator is returned from FilterAVSMigratedToOperatorSets and is used to iterate over the raw logs and unpacked data for AVSMigratedToOperatorSets events raised by the IAVSDirectory contract. +type IAVSDirectoryAVSMigratedToOperatorSetsIterator struct { + Event *IAVSDirectoryAVSMigratedToOperatorSets // 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 *IAVSDirectoryAVSMigratedToOperatorSetsIterator) 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(IAVSDirectoryAVSMigratedToOperatorSets) + 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(IAVSDirectoryAVSMigratedToOperatorSets) + 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 *IAVSDirectoryAVSMigratedToOperatorSetsIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryAVSMigratedToOperatorSetsIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryAVSMigratedToOperatorSets represents a AVSMigratedToOperatorSets event raised by the IAVSDirectory contract. +type IAVSDirectoryAVSMigratedToOperatorSets struct { + Avs common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAVSMigratedToOperatorSets is a free log retrieval operation binding the contract event 0x702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf. +// +// Solidity: event AVSMigratedToOperatorSets(address indexed avs) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterAVSMigratedToOperatorSets(opts *bind.FilterOpts, avs []common.Address) (*IAVSDirectoryAVSMigratedToOperatorSetsIterator, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "AVSMigratedToOperatorSets", avsRule) + if err != nil { + return nil, err + } + return &IAVSDirectoryAVSMigratedToOperatorSetsIterator{contract: _IAVSDirectory.contract, event: "AVSMigratedToOperatorSets", logs: logs, sub: sub}, nil +} + +// WatchAVSMigratedToOperatorSets is a free log subscription operation binding the contract event 0x702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf. +// +// Solidity: event AVSMigratedToOperatorSets(address indexed avs) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchAVSMigratedToOperatorSets(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryAVSMigratedToOperatorSets, avs []common.Address) (event.Subscription, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "AVSMigratedToOperatorSets", avsRule) + 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(IAVSDirectoryAVSMigratedToOperatorSets) + if err := _IAVSDirectory.contract.UnpackLog(event, "AVSMigratedToOperatorSets", 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 +} + +// ParseAVSMigratedToOperatorSets is a log parse operation binding the contract event 0x702b0c1f6cb1cf511aaa81f72bc05a215bb3497632d72c690c822b044ab494bf. +// +// Solidity: event AVSMigratedToOperatorSets(address indexed avs) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseAVSMigratedToOperatorSets(log types.Log) (*IAVSDirectoryAVSMigratedToOperatorSets, error) { + event := new(IAVSDirectoryAVSMigratedToOperatorSets) + if err := _IAVSDirectory.contract.UnpackLog(event, "AVSMigratedToOperatorSets", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IAVSDirectoryMagnitudeAllocatedIterator is returned from FilterMagnitudeAllocated and is used to iterate over the raw logs and unpacked data for MagnitudeAllocated events raised by the IAVSDirectory contract. +type IAVSDirectoryMagnitudeAllocatedIterator struct { + Event *IAVSDirectoryMagnitudeAllocated // 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 *IAVSDirectoryMagnitudeAllocatedIterator) 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(IAVSDirectoryMagnitudeAllocated) + 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(IAVSDirectoryMagnitudeAllocated) + 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 *IAVSDirectoryMagnitudeAllocatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryMagnitudeAllocatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryMagnitudeAllocated represents a MagnitudeAllocated event raised by the IAVSDirectory contract. +type IAVSDirectoryMagnitudeAllocated struct { + Operator common.Address + Strategy common.Address + OperatorSet IAVSDirectoryOperatorSet + MagnitudeToAllocate uint64 + EffectTimestamp uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMagnitudeAllocated is a free log retrieval operation binding the contract event 0x6d7d0079582cb2c5e70d4135b37f36711415ee6c260778b716bd65e026eb4f1a. +// +// Solidity: event MagnitudeAllocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToAllocate, uint32 effectTimestamp) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterMagnitudeAllocated(opts *bind.FilterOpts) (*IAVSDirectoryMagnitudeAllocatedIterator, error) { + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "MagnitudeAllocated") + if err != nil { + return nil, err + } + return &IAVSDirectoryMagnitudeAllocatedIterator{contract: _IAVSDirectory.contract, event: "MagnitudeAllocated", logs: logs, sub: sub}, nil +} + +// WatchMagnitudeAllocated is a free log subscription operation binding the contract event 0x6d7d0079582cb2c5e70d4135b37f36711415ee6c260778b716bd65e026eb4f1a. +// +// Solidity: event MagnitudeAllocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToAllocate, uint32 effectTimestamp) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchMagnitudeAllocated(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryMagnitudeAllocated) (event.Subscription, error) { + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "MagnitudeAllocated") + 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(IAVSDirectoryMagnitudeAllocated) + if err := _IAVSDirectory.contract.UnpackLog(event, "MagnitudeAllocated", 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 +} + +// ParseMagnitudeAllocated is a log parse operation binding the contract event 0x6d7d0079582cb2c5e70d4135b37f36711415ee6c260778b716bd65e026eb4f1a. +// +// Solidity: event MagnitudeAllocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToAllocate, uint32 effectTimestamp) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseMagnitudeAllocated(log types.Log) (*IAVSDirectoryMagnitudeAllocated, error) { + event := new(IAVSDirectoryMagnitudeAllocated) + if err := _IAVSDirectory.contract.UnpackLog(event, "MagnitudeAllocated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IAVSDirectoryMagnitudeDeallocationCompletedIterator is returned from FilterMagnitudeDeallocationCompleted and is used to iterate over the raw logs and unpacked data for MagnitudeDeallocationCompleted events raised by the IAVSDirectory contract. +type IAVSDirectoryMagnitudeDeallocationCompletedIterator struct { + Event *IAVSDirectoryMagnitudeDeallocationCompleted // 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 *IAVSDirectoryMagnitudeDeallocationCompletedIterator) 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(IAVSDirectoryMagnitudeDeallocationCompleted) + 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(IAVSDirectoryMagnitudeDeallocationCompleted) + 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 *IAVSDirectoryMagnitudeDeallocationCompletedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryMagnitudeDeallocationCompletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryMagnitudeDeallocationCompleted represents a MagnitudeDeallocationCompleted event raised by the IAVSDirectory contract. +type IAVSDirectoryMagnitudeDeallocationCompleted struct { + Operator common.Address + Strategy common.Address + OperatorSet IAVSDirectoryOperatorSet + FreeMagnitudeAdded uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMagnitudeDeallocationCompleted is a free log retrieval operation binding the contract event 0x1e5c8e13c62c31d6252ac205e592477d643c7e95831d5b46d99a3c60c2fad8db. +// +// Solidity: event MagnitudeDeallocationCompleted(address operator, address strategy, (address,uint32) operatorSet, uint64 freeMagnitudeAdded) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterMagnitudeDeallocationCompleted(opts *bind.FilterOpts) (*IAVSDirectoryMagnitudeDeallocationCompletedIterator, error) { + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "MagnitudeDeallocationCompleted") + if err != nil { + return nil, err + } + return &IAVSDirectoryMagnitudeDeallocationCompletedIterator{contract: _IAVSDirectory.contract, event: "MagnitudeDeallocationCompleted", logs: logs, sub: sub}, nil +} + +// WatchMagnitudeDeallocationCompleted is a free log subscription operation binding the contract event 0x1e5c8e13c62c31d6252ac205e592477d643c7e95831d5b46d99a3c60c2fad8db. +// +// Solidity: event MagnitudeDeallocationCompleted(address operator, address strategy, (address,uint32) operatorSet, uint64 freeMagnitudeAdded) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchMagnitudeDeallocationCompleted(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryMagnitudeDeallocationCompleted) (event.Subscription, error) { + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "MagnitudeDeallocationCompleted") + 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(IAVSDirectoryMagnitudeDeallocationCompleted) + if err := _IAVSDirectory.contract.UnpackLog(event, "MagnitudeDeallocationCompleted", 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 +} + +// ParseMagnitudeDeallocationCompleted is a log parse operation binding the contract event 0x1e5c8e13c62c31d6252ac205e592477d643c7e95831d5b46d99a3c60c2fad8db. +// +// Solidity: event MagnitudeDeallocationCompleted(address operator, address strategy, (address,uint32) operatorSet, uint64 freeMagnitudeAdded) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseMagnitudeDeallocationCompleted(log types.Log) (*IAVSDirectoryMagnitudeDeallocationCompleted, error) { + event := new(IAVSDirectoryMagnitudeDeallocationCompleted) + if err := _IAVSDirectory.contract.UnpackLog(event, "MagnitudeDeallocationCompleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IAVSDirectoryMagnitudeQueueDeallocatedIterator is returned from FilterMagnitudeQueueDeallocated and is used to iterate over the raw logs and unpacked data for MagnitudeQueueDeallocated events raised by the IAVSDirectory contract. +type IAVSDirectoryMagnitudeQueueDeallocatedIterator struct { + Event *IAVSDirectoryMagnitudeQueueDeallocated // 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 *IAVSDirectoryMagnitudeQueueDeallocatedIterator) 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(IAVSDirectoryMagnitudeQueueDeallocated) + 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(IAVSDirectoryMagnitudeQueueDeallocated) + 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 *IAVSDirectoryMagnitudeQueueDeallocatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryMagnitudeQueueDeallocatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryMagnitudeQueueDeallocated represents a MagnitudeQueueDeallocated event raised by the IAVSDirectory contract. +type IAVSDirectoryMagnitudeQueueDeallocated struct { + Operator common.Address + Strategy common.Address + OperatorSet IAVSDirectoryOperatorSet + MagnitudeToDeallocate uint64 + CompletableTimestamp uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMagnitudeQueueDeallocated is a free log retrieval operation binding the contract event 0x2e68db1fe51107d7e451ae268d1631796989ab9d7925054e9b247854cb5be950. +// +// Solidity: event MagnitudeQueueDeallocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToDeallocate, uint32 completableTimestamp) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterMagnitudeQueueDeallocated(opts *bind.FilterOpts) (*IAVSDirectoryMagnitudeQueueDeallocatedIterator, error) { + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "MagnitudeQueueDeallocated") + if err != nil { + return nil, err + } + return &IAVSDirectoryMagnitudeQueueDeallocatedIterator{contract: _IAVSDirectory.contract, event: "MagnitudeQueueDeallocated", logs: logs, sub: sub}, nil +} + +// WatchMagnitudeQueueDeallocated is a free log subscription operation binding the contract event 0x2e68db1fe51107d7e451ae268d1631796989ab9d7925054e9b247854cb5be950. +// +// Solidity: event MagnitudeQueueDeallocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToDeallocate, uint32 completableTimestamp) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchMagnitudeQueueDeallocated(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryMagnitudeQueueDeallocated) (event.Subscription, error) { + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "MagnitudeQueueDeallocated") + 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(IAVSDirectoryMagnitudeQueueDeallocated) + if err := _IAVSDirectory.contract.UnpackLog(event, "MagnitudeQueueDeallocated", 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 +} + +// ParseMagnitudeQueueDeallocated is a log parse operation binding the contract event 0x2e68db1fe51107d7e451ae268d1631796989ab9d7925054e9b247854cb5be950. +// +// Solidity: event MagnitudeQueueDeallocated(address operator, address strategy, (address,uint32) operatorSet, uint64 magnitudeToDeallocate, uint32 completableTimestamp) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseMagnitudeQueueDeallocated(log types.Log) (*IAVSDirectoryMagnitudeQueueDeallocated, error) { + event := new(IAVSDirectoryMagnitudeQueueDeallocated) + if err := _IAVSDirectory.contract.UnpackLog(event, "MagnitudeQueueDeallocated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator is returned from FilterOperatorAVSRegistrationStatusUpdated and is used to iterate over the raw logs and unpacked data for OperatorAVSRegistrationStatusUpdated events raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator struct { + Event *IAVSDirectoryOperatorAVSRegistrationStatusUpdated // 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 *IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) 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(IAVSDirectoryOperatorAVSRegistrationStatusUpdated) + 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(IAVSDirectoryOperatorAVSRegistrationStatusUpdated) + 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 *IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryOperatorAVSRegistrationStatusUpdated represents a OperatorAVSRegistrationStatusUpdated event raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorAVSRegistrationStatusUpdated struct { + Operator common.Address + Avs common.Address + Status uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorAVSRegistrationStatusUpdated is a free log retrieval operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// +// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterOperatorAVSRegistrationStatusUpdated(opts *bind.FilterOpts, operator []common.Address, avs []common.Address) (*IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + if err != nil { + return nil, err + } + return &IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator{contract: _IAVSDirectory.contract, event: "OperatorAVSRegistrationStatusUpdated", logs: logs, sub: sub}, nil +} + +// WatchOperatorAVSRegistrationStatusUpdated is a free log subscription operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// +// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchOperatorAVSRegistrationStatusUpdated(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryOperatorAVSRegistrationStatusUpdated, operator []common.Address, avs []common.Address) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + 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(IAVSDirectoryOperatorAVSRegistrationStatusUpdated) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", 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 +} + +// ParseOperatorAVSRegistrationStatusUpdated is a log parse operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// +// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseOperatorAVSRegistrationStatusUpdated(log types.Log) (*IAVSDirectoryOperatorAVSRegistrationStatusUpdated, error) { + event := new(IAVSDirectoryOperatorAVSRegistrationStatusUpdated) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IAVSDirectoryOperatorAddedToOperatorSetIterator is returned from FilterOperatorAddedToOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorAddedToOperatorSet events raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorAddedToOperatorSetIterator struct { + Event *IAVSDirectoryOperatorAddedToOperatorSet // 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 *IAVSDirectoryOperatorAddedToOperatorSetIterator) 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(IAVSDirectoryOperatorAddedToOperatorSet) + 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(IAVSDirectoryOperatorAddedToOperatorSet) + 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 *IAVSDirectoryOperatorAddedToOperatorSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryOperatorAddedToOperatorSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryOperatorAddedToOperatorSet represents a OperatorAddedToOperatorSet event raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorAddedToOperatorSet struct { + Operator common.Address + OperatorSet IAVSDirectoryOperatorSet + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorAddedToOperatorSet is a free log retrieval operation binding the contract event 0x43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e. +// +// Solidity: event OperatorAddedToOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterOperatorAddedToOperatorSet(opts *bind.FilterOpts, operator []common.Address) (*IAVSDirectoryOperatorAddedToOperatorSetIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "OperatorAddedToOperatorSet", operatorRule) + if err != nil { + return nil, err + } + return &IAVSDirectoryOperatorAddedToOperatorSetIterator{contract: _IAVSDirectory.contract, event: "OperatorAddedToOperatorSet", logs: logs, sub: sub}, nil +} + +// WatchOperatorAddedToOperatorSet is a free log subscription operation binding the contract event 0x43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e. +// +// Solidity: event OperatorAddedToOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchOperatorAddedToOperatorSet(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryOperatorAddedToOperatorSet, operator []common.Address) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "OperatorAddedToOperatorSet", operatorRule) + 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(IAVSDirectoryOperatorAddedToOperatorSet) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorAddedToOperatorSet", 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 +} + +// ParseOperatorAddedToOperatorSet is a log parse operation binding the contract event 0x43232edf9071753d2321e5fa7e018363ee248e5f2142e6c08edd3265bfb4895e. +// +// Solidity: event OperatorAddedToOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseOperatorAddedToOperatorSet(log types.Log) (*IAVSDirectoryOperatorAddedToOperatorSet, error) { + event := new(IAVSDirectoryOperatorAddedToOperatorSet) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorAddedToOperatorSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IAVSDirectoryOperatorMigratedToOperatorSetsIterator is returned from FilterOperatorMigratedToOperatorSets and is used to iterate over the raw logs and unpacked data for OperatorMigratedToOperatorSets events raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorMigratedToOperatorSetsIterator struct { + Event *IAVSDirectoryOperatorMigratedToOperatorSets // 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 *IAVSDirectoryOperatorMigratedToOperatorSetsIterator) 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(IAVSDirectoryOperatorMigratedToOperatorSets) + 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(IAVSDirectoryOperatorMigratedToOperatorSets) + 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 *IAVSDirectoryOperatorMigratedToOperatorSetsIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryOperatorMigratedToOperatorSetsIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryOperatorMigratedToOperatorSets represents a OperatorMigratedToOperatorSets event raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorMigratedToOperatorSets struct { + Operator common.Address + Avs common.Address + OperatorSetIds []uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorMigratedToOperatorSets is a free log retrieval operation binding the contract event 0x54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01. +// +// Solidity: event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterOperatorMigratedToOperatorSets(opts *bind.FilterOpts, operator []common.Address, avs []common.Address) (*IAVSDirectoryOperatorMigratedToOperatorSetsIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "OperatorMigratedToOperatorSets", operatorRule, avsRule) + if err != nil { + return nil, err + } + return &IAVSDirectoryOperatorMigratedToOperatorSetsIterator{contract: _IAVSDirectory.contract, event: "OperatorMigratedToOperatorSets", logs: logs, sub: sub}, nil +} + +// WatchOperatorMigratedToOperatorSets is a free log subscription operation binding the contract event 0x54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01. +// +// Solidity: event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchOperatorMigratedToOperatorSets(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryOperatorMigratedToOperatorSets, operator []common.Address, avs []common.Address) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "OperatorMigratedToOperatorSets", operatorRule, avsRule) + 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(IAVSDirectoryOperatorMigratedToOperatorSets) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorMigratedToOperatorSets", log); err != nil { + return err + } + event.Raw = log select { case sink <- event: @@ -476,21 +2425,21 @@ func (_IAVSDirectory *IAVSDirectoryFilterer) WatchAVSMetadataURIUpdated(opts *bi }), nil } -// ParseAVSMetadataURIUpdated is a log parse operation binding the contract event 0xa89c1dc243d8908a96dd84944bcc97d6bc6ac00dd78e20621576be6a3c943713. +// ParseOperatorMigratedToOperatorSets is a log parse operation binding the contract event 0x54f33cfdd1ca703d795986b986fd47d742eab1904ecd2a5fdb8d6595e5904a01. // -// Solidity: event AVSMetadataURIUpdated(address indexed avs, string metadataURI) -func (_IAVSDirectory *IAVSDirectoryFilterer) ParseAVSMetadataURIUpdated(log types.Log) (*IAVSDirectoryAVSMetadataURIUpdated, error) { - event := new(IAVSDirectoryAVSMetadataURIUpdated) - if err := _IAVSDirectory.contract.UnpackLog(event, "AVSMetadataURIUpdated", log); err != nil { +// Solidity: event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseOperatorMigratedToOperatorSets(log types.Log) (*IAVSDirectoryOperatorMigratedToOperatorSets, error) { + event := new(IAVSDirectoryOperatorMigratedToOperatorSets) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorMigratedToOperatorSets", log); err != nil { return nil, err } event.Raw = log return event, nil } -// IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator is returned from FilterOperatorAVSRegistrationStatusUpdated and is used to iterate over the raw logs and unpacked data for OperatorAVSRegistrationStatusUpdated events raised by the IAVSDirectory contract. -type IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator struct { - Event *IAVSDirectoryOperatorAVSRegistrationStatusUpdated // Event containing the contract specifics and raw log +// IAVSDirectoryOperatorRemovedFromOperatorSetIterator is returned from FilterOperatorRemovedFromOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorRemovedFromOperatorSet events raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorRemovedFromOperatorSetIterator struct { + Event *IAVSDirectoryOperatorRemovedFromOperatorSet // 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 @@ -504,7 +2453,7 @@ type IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Next() bool { +func (it *IAVSDirectoryOperatorRemovedFromOperatorSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -513,7 +2462,7 @@ func (it *IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Next() bool if it.done { select { case log := <-it.logs: - it.Event = new(IAVSDirectoryOperatorAVSRegistrationStatusUpdated) + it.Event = new(IAVSDirectoryOperatorRemovedFromOperatorSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -528,7 +2477,7 @@ func (it *IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Next() bool // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(IAVSDirectoryOperatorAVSRegistrationStatusUpdated) + it.Event = new(IAVSDirectoryOperatorRemovedFromOperatorSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -544,61 +2493,186 @@ func (it *IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Next() bool } // Error returns any retrieval or parsing error occurred during filtering. -func (it *IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Error() error { +func (it *IAVSDirectoryOperatorRemovedFromOperatorSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator) Close() error { +func (it *IAVSDirectoryOperatorRemovedFromOperatorSetIterator) Close() error { it.sub.Unsubscribe() return nil } -// IAVSDirectoryOperatorAVSRegistrationStatusUpdated represents a OperatorAVSRegistrationStatusUpdated event raised by the IAVSDirectory contract. -type IAVSDirectoryOperatorAVSRegistrationStatusUpdated struct { - Operator common.Address - Avs common.Address - Status uint8 - Raw types.Log // Blockchain specific contextual infos +// IAVSDirectoryOperatorRemovedFromOperatorSet represents a OperatorRemovedFromOperatorSet event raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorRemovedFromOperatorSet struct { + Operator common.Address + OperatorSet IAVSDirectoryOperatorSet + Raw types.Log // Blockchain specific contextual infos } -// FilterOperatorAVSRegistrationStatusUpdated is a free log retrieval operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// FilterOperatorRemovedFromOperatorSet is a free log retrieval operation binding the contract event 0xad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe. // -// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) -func (_IAVSDirectory *IAVSDirectoryFilterer) FilterOperatorAVSRegistrationStatusUpdated(opts *bind.FilterOpts, operator []common.Address, avs []common.Address) (*IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator, error) { +// Solidity: event OperatorRemovedFromOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterOperatorRemovedFromOperatorSet(opts *bind.FilterOpts, operator []common.Address) (*IAVSDirectoryOperatorRemovedFromOperatorSetIterator, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) - } - logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "OperatorRemovedFromOperatorSet", operatorRule) if err != nil { return nil, err } - return &IAVSDirectoryOperatorAVSRegistrationStatusUpdatedIterator{contract: _IAVSDirectory.contract, event: "OperatorAVSRegistrationStatusUpdated", logs: logs, sub: sub}, nil + return &IAVSDirectoryOperatorRemovedFromOperatorSetIterator{contract: _IAVSDirectory.contract, event: "OperatorRemovedFromOperatorSet", logs: logs, sub: sub}, nil } -// WatchOperatorAVSRegistrationStatusUpdated is a free log subscription operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// WatchOperatorRemovedFromOperatorSet is a free log subscription operation binding the contract event 0xad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe. // -// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) -func (_IAVSDirectory *IAVSDirectoryFilterer) WatchOperatorAVSRegistrationStatusUpdated(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryOperatorAVSRegistrationStatusUpdated, operator []common.Address, avs []common.Address) (event.Subscription, error) { +// Solidity: event OperatorRemovedFromOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchOperatorRemovedFromOperatorSet(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryOperatorRemovedFromOperatorSet, operator []common.Address) (event.Subscription, error) { var operatorRule []interface{} for _, operatorItem := range operator { operatorRule = append(operatorRule, operatorItem) } - var avsRule []interface{} - for _, avsItem := range avs { - avsRule = append(avsRule, avsItem) + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "OperatorRemovedFromOperatorSet", operatorRule) + 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(IAVSDirectoryOperatorRemovedFromOperatorSet) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorRemovedFromOperatorSet", log); err != nil { + return err + } + event.Raw = log - logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "OperatorAVSRegistrationStatusUpdated", operatorRule, avsRule) + 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 +} + +// ParseOperatorRemovedFromOperatorSet is a log parse operation binding the contract event 0xad34c3070be1dffbcaa499d000ba2b8d9848aefcac3059df245dd95c4ece14fe. +// +// Solidity: event OperatorRemovedFromOperatorSet(address indexed operator, (address,uint32) operatorSet) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseOperatorRemovedFromOperatorSet(log types.Log) (*IAVSDirectoryOperatorRemovedFromOperatorSet, error) { + event := new(IAVSDirectoryOperatorRemovedFromOperatorSet) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorRemovedFromOperatorSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IAVSDirectoryOperatorSetCreatedIterator is returned from FilterOperatorSetCreated and is used to iterate over the raw logs and unpacked data for OperatorSetCreated events raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorSetCreatedIterator struct { + Event *IAVSDirectoryOperatorSetCreated // 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 *IAVSDirectoryOperatorSetCreatedIterator) 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(IAVSDirectoryOperatorSetCreated) + 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(IAVSDirectoryOperatorSetCreated) + 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 *IAVSDirectoryOperatorSetCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryOperatorSetCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryOperatorSetCreated represents a OperatorSetCreated event raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorSetCreated struct { + OperatorSet IAVSDirectoryOperatorSet + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorSetCreated is a free log retrieval operation binding the contract event 0x31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c. +// +// Solidity: event OperatorSetCreated((address,uint32) operatorSet) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterOperatorSetCreated(opts *bind.FilterOpts) (*IAVSDirectoryOperatorSetCreatedIterator, error) { + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "OperatorSetCreated") + if err != nil { + return nil, err + } + return &IAVSDirectoryOperatorSetCreatedIterator{contract: _IAVSDirectory.contract, event: "OperatorSetCreated", logs: logs, sub: sub}, nil +} + +// WatchOperatorSetCreated is a free log subscription operation binding the contract event 0x31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c. +// +// Solidity: event OperatorSetCreated((address,uint32) operatorSet) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchOperatorSetCreated(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryOperatorSetCreated) (event.Subscription, error) { + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "OperatorSetCreated") if err != nil { return nil, err } @@ -608,8 +2682,8 @@ func (_IAVSDirectory *IAVSDirectoryFilterer) WatchOperatorAVSRegistrationStatusU select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(IAVSDirectoryOperatorAVSRegistrationStatusUpdated) - if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", log); err != nil { + event := new(IAVSDirectoryOperatorSetCreated) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorSetCreated", log); err != nil { return err } event.Raw = log @@ -630,12 +2704,149 @@ func (_IAVSDirectory *IAVSDirectoryFilterer) WatchOperatorAVSRegistrationStatusU }), nil } -// ParseOperatorAVSRegistrationStatusUpdated is a log parse operation binding the contract event 0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41. +// ParseOperatorSetCreated is a log parse operation binding the contract event 0x31629285ead2335ae0933f86ed2ae63321f7af77b4e6eaabc42c057880977e6c. // -// Solidity: event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, uint8 status) -func (_IAVSDirectory *IAVSDirectoryFilterer) ParseOperatorAVSRegistrationStatusUpdated(log types.Log) (*IAVSDirectoryOperatorAVSRegistrationStatusUpdated, error) { - event := new(IAVSDirectoryOperatorAVSRegistrationStatusUpdated) - if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorAVSRegistrationStatusUpdated", log); err != nil { +// Solidity: event OperatorSetCreated((address,uint32) operatorSet) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseOperatorSetCreated(log types.Log) (*IAVSDirectoryOperatorSetCreated, error) { + event := new(IAVSDirectoryOperatorSetCreated) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorSetCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IAVSDirectoryOperatorSlashedIterator is returned from FilterOperatorSlashed and is used to iterate over the raw logs and unpacked data for OperatorSlashed events raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorSlashedIterator struct { + Event *IAVSDirectoryOperatorSlashed // 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 *IAVSDirectoryOperatorSlashedIterator) 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(IAVSDirectoryOperatorSlashed) + 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(IAVSDirectoryOperatorSlashed) + 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 *IAVSDirectoryOperatorSlashedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IAVSDirectoryOperatorSlashedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IAVSDirectoryOperatorSlashed represents a OperatorSlashed event raised by the IAVSDirectory contract. +type IAVSDirectoryOperatorSlashed struct { + Operator common.Address + OperatorSetId uint32 + Strategy common.Address + BipsToSlash uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorSlashed is a free log retrieval operation binding the contract event 0xe672839d3c371691acdb52de9fefc94b3dbf407dc0920ef566c7c059ad575b1c. +// +// Solidity: event OperatorSlashed(address operator, uint32 operatorSetId, address strategy, uint16 bipsToSlash) +func (_IAVSDirectory *IAVSDirectoryFilterer) FilterOperatorSlashed(opts *bind.FilterOpts) (*IAVSDirectoryOperatorSlashedIterator, error) { + + logs, sub, err := _IAVSDirectory.contract.FilterLogs(opts, "OperatorSlashed") + if err != nil { + return nil, err + } + return &IAVSDirectoryOperatorSlashedIterator{contract: _IAVSDirectory.contract, event: "OperatorSlashed", logs: logs, sub: sub}, nil +} + +// WatchOperatorSlashed is a free log subscription operation binding the contract event 0xe672839d3c371691acdb52de9fefc94b3dbf407dc0920ef566c7c059ad575b1c. +// +// Solidity: event OperatorSlashed(address operator, uint32 operatorSetId, address strategy, uint16 bipsToSlash) +func (_IAVSDirectory *IAVSDirectoryFilterer) WatchOperatorSlashed(opts *bind.WatchOpts, sink chan<- *IAVSDirectoryOperatorSlashed) (event.Subscription, error) { + + logs, sub, err := _IAVSDirectory.contract.WatchLogs(opts, "OperatorSlashed") + 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(IAVSDirectoryOperatorSlashed) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorSlashed", 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 +} + +// ParseOperatorSlashed is a log parse operation binding the contract event 0xe672839d3c371691acdb52de9fefc94b3dbf407dc0920ef566c7c059ad575b1c. +// +// Solidity: event OperatorSlashed(address operator, uint32 operatorSetId, address strategy, uint16 bipsToSlash) +func (_IAVSDirectory *IAVSDirectoryFilterer) ParseOperatorSlashed(log types.Log) (*IAVSDirectoryOperatorSlashed, error) { + event := new(IAVSDirectoryOperatorSlashed) + if err := _IAVSDirectory.contract.UnpackLog(event, "OperatorSlashed", log); err != nil { return nil, err } event.Raw = log diff --git a/pkg/bindings/IDelegationFaucet/binding.go b/pkg/bindings/IDelegationFaucet/binding.go index 9486264d0..c66653df5 100644 --- a/pkg/bindings/IDelegationFaucet/binding.go +++ b/pkg/bindings/IDelegationFaucet/binding.go @@ -38,13 +38,13 @@ type IDelegationManagerQueuedWithdrawalParams struct { // IDelegationManagerWithdrawal is an auto generated low-level Go binding around an user-defined struct. type IDelegationManagerWithdrawal struct { - Staker common.Address - DelegatedTo common.Address - Withdrawer common.Address - Nonce *big.Int - StartBlock uint32 - Strategies []common.Address - Shares []*big.Int + Staker common.Address + DelegatedTo common.Address + Withdrawer common.Address + Nonce *big.Int + StartTimestamp uint32 + Strategies []common.Address + ScaledShares []*big.Int } // ISignatureUtilsSignatureWithExpiry is an auto generated low-level Go binding around an user-defined struct. @@ -55,7 +55,7 @@ type ISignatureUtilsSignatureWithExpiry struct { // IDelegationFaucetMetaData contains all meta data concerning the IDelegationFaucet contract. var IDelegationFaucetMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"callAddress\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"queuedWithdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"middlewareTimesIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositIntoStrategy\",\"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\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getStaker\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"mintDepositAndDelegate\",\"inputs\":[{\"name\":\"_operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_depositAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"queueWithdrawal\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"}]", + ABI: "[{\"type\":\"function\",\"name\":\"callAddress\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"queuedWithdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"middlewareTimesIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositIntoStrategy\",\"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\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getStaker\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"mintDepositAndDelegate\",\"inputs\":[{\"name\":\"_operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_depositAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"queueWithdrawal\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"}]", } // IDelegationFaucetABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/IDelegationManager/binding.go b/pkg/bindings/IDelegationManager/binding.go index 3d9a84301..b0fec4e53 100644 --- a/pkg/bindings/IDelegationManager/binding.go +++ b/pkg/bindings/IDelegationManager/binding.go @@ -29,6 +29,12 @@ var ( _ = abi.ConvertType ) +// IDelegationManagerAllocationDelayDetails is an auto generated low-level Go binding around an user-defined struct. +type IDelegationManagerAllocationDelayDetails struct { + IsSet bool + AllocationDelay uint32 +} + // IDelegationManagerOperatorDetails is an auto generated low-level Go binding around an user-defined struct. type IDelegationManagerOperatorDetails struct { DeprecatedEarningsReceiver common.Address @@ -45,13 +51,13 @@ type IDelegationManagerQueuedWithdrawalParams struct { // IDelegationManagerWithdrawal is an auto generated low-level Go binding around an user-defined struct. type IDelegationManagerWithdrawal struct { - Staker common.Address - DelegatedTo common.Address - Withdrawer common.Address - Nonce *big.Int - StartBlock uint32 - Strategies []common.Address - Shares []*big.Int + Staker common.Address + DelegatedTo common.Address + Withdrawer common.Address + Nonce *big.Int + StartTimestamp uint32 + Strategies []common.Address + ScaledShares []*big.Int } // ISignatureUtilsSignatureWithExpiry is an auto generated low-level Go binding around an user-defined struct. @@ -62,7 +68,7 @@ type ISignatureUtilsSignatureWithExpiry struct { // IDelegationManagerMetaData contains all meta data concerning the IDelegationManager contract. var IDelegationManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"DELEGATION_APPROVAL_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\":\"STAKER_DELEGATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateCurrentStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateDelegationApprovalDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_stakerNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateWithdrawalRoot\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"middlewareTimesIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawals\",\"inputs\":[{\"name\":\"withdrawals\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.Withdrawal[]\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[][]\",\"internalType\":\"contractIERC20[][]\"},{\"name\":\"middlewareTimesIndexes\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool[]\",\"internalType\":\"bool[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeWithdrawalsQueued\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseDelegatedShares\",\"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\":\"delegateTo\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateToBySignature\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegatedTo\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApprover\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApproverSaltIsSpent\",\"inputs\":[{\"name\":\"_delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorShares\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWithdrawalDelay\",\"inputs\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseDelegatedShares\",\"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\":\"isDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minWithdrawalDelayBlocks\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"modifyOperatorDetails\",\"inputs\":[{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorDetails\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorShares\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"queueWithdrawals\",\"inputs\":[{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerAsOperator\",\"inputs\":[{\"name\":\"registeringOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"stakerNonce\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerOptOutWindowBlocks\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"undelegate\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOperatorMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"MinWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorDetailsModified\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorMetadataURIUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRegistered\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesDecreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesIncreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerForceUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalCompleted\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalQueued\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"withdrawal\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false}]", + ABI: "[{\"type\":\"function\",\"name\":\"DELEGATION_APPROVAL_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\":\"STAKER_DELEGATION_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateCurrentStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateDelegationApprovalDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateStakerDelegationDigestHash\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_stakerNonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateWithdrawalRoot\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"withdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawals\",\"inputs\":[{\"name\":\"withdrawals\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.Withdrawal[]\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[][]\",\"internalType\":\"contractIERC20[][]\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool[]\",\"internalType\":\"bool[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cumulativeWithdrawalsQueued\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseDelegatedShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"removedShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateTo\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegateToBySignature\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSignatureAndExpiry\",\"type\":\"tuple\",\"internalType\":\"structISignatureUtils.SignatureWithExpiry\",\"components\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expiry\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"approverSalt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegatedTo\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApprover\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"delegationApproverSaltIsSpent\",\"inputs\":[{\"name\":\"_delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWithdrawalDelay\",\"inputs\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseDelegatedShares\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"existingShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"addedShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeAllocationDelay\",\"inputs\":[{\"name\":\"delay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isOperator\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"minWithdrawalDelayBlocks\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"modifyOperatorDetails\",\"inputs\":[{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"operatorAllocationDelay\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.AllocationDelayDetails\",\"components\":[{\"name\":\"isSet\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"allocationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorDetails\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorScaledShares\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"queueWithdrawals\",\"inputs\":[{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerAsOperator\",\"inputs\":[{\"name\":\"registeringOperatorDetails\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"allocationDelay\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"stakerNonce\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerOptOutWindowBlocks\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyWithdrawalDelayBlocks\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"undelegate\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOperatorMetadataURI\",\"inputs\":[{\"name\":\"metadataURI\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"MinWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorDetailsModified\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOperatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorMetadataURIUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"metadataURI\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorRegistered\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorDetails\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.OperatorDetails\",\"components\":[{\"name\":\"__deprecated_earningsReceiver\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegationApprover\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"stakerOptOutWindowBlocks\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesDecreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSharesIncreased\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"staker\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerDelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerForceUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StakerUndelegated\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWithdrawalDelayBlocksSet\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategyWithdrawalDelaySet\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"},{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalCompleted\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WithdrawalQueued\",\"inputs\":[{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"withdrawal\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false}]", } // IDelegationManagerABI is the input ABI used to generate the binding from. @@ -614,37 +620,6 @@ func (_IDelegationManager *IDelegationManagerCallerSession) DomainSeparator() ([ return _IDelegationManager.Contract.DomainSeparator(&_IDelegationManager.CallOpts) } -// GetOperatorShares is a free data retrieval call binding the contract method 0x90041347. -// -// Solidity: function getOperatorShares(address operator, address[] strategies) view returns(uint256[]) -func (_IDelegationManager *IDelegationManagerCaller) GetOperatorShares(opts *bind.CallOpts, operator common.Address, strategies []common.Address) ([]*big.Int, error) { - var out []interface{} - err := _IDelegationManager.contract.Call(opts, &out, "getOperatorShares", operator, strategies) - - if err != nil { - return *new([]*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) - - return out0, err - -} - -// GetOperatorShares is a free data retrieval call binding the contract method 0x90041347. -// -// Solidity: function getOperatorShares(address operator, address[] strategies) view returns(uint256[]) -func (_IDelegationManager *IDelegationManagerSession) GetOperatorShares(operator common.Address, strategies []common.Address) ([]*big.Int, error) { - return _IDelegationManager.Contract.GetOperatorShares(&_IDelegationManager.CallOpts, operator, strategies) -} - -// GetOperatorShares is a free data retrieval call binding the contract method 0x90041347. -// -// Solidity: function getOperatorShares(address operator, address[] strategies) view returns(uint256[]) -func (_IDelegationManager *IDelegationManagerCallerSession) GetOperatorShares(operator common.Address, strategies []common.Address) ([]*big.Int, error) { - return _IDelegationManager.Contract.GetOperatorShares(&_IDelegationManager.CallOpts, operator, strategies) -} - // GetWithdrawalDelay is a free data retrieval call binding the contract method 0x0449ca39. // // Solidity: function getWithdrawalDelay(address[] strategies) view returns(uint256) @@ -769,6 +744,37 @@ func (_IDelegationManager *IDelegationManagerCallerSession) MinWithdrawalDelayBl return _IDelegationManager.Contract.MinWithdrawalDelayBlocks(&_IDelegationManager.CallOpts) } +// OperatorAllocationDelay is a free data retrieval call binding the contract method 0x89829397. +// +// Solidity: function operatorAllocationDelay(address operator) view returns((bool,uint32)) +func (_IDelegationManager *IDelegationManagerCaller) OperatorAllocationDelay(opts *bind.CallOpts, operator common.Address) (IDelegationManagerAllocationDelayDetails, error) { + var out []interface{} + err := _IDelegationManager.contract.Call(opts, &out, "operatorAllocationDelay", operator) + + if err != nil { + return *new(IDelegationManagerAllocationDelayDetails), err + } + + out0 := *abi.ConvertType(out[0], new(IDelegationManagerAllocationDelayDetails)).(*IDelegationManagerAllocationDelayDetails) + + return out0, err + +} + +// OperatorAllocationDelay is a free data retrieval call binding the contract method 0x89829397. +// +// Solidity: function operatorAllocationDelay(address operator) view returns((bool,uint32)) +func (_IDelegationManager *IDelegationManagerSession) OperatorAllocationDelay(operator common.Address) (IDelegationManagerAllocationDelayDetails, error) { + return _IDelegationManager.Contract.OperatorAllocationDelay(&_IDelegationManager.CallOpts, operator) +} + +// OperatorAllocationDelay is a free data retrieval call binding the contract method 0x89829397. +// +// Solidity: function operatorAllocationDelay(address operator) view returns((bool,uint32)) +func (_IDelegationManager *IDelegationManagerCallerSession) OperatorAllocationDelay(operator common.Address) (IDelegationManagerAllocationDelayDetails, error) { + return _IDelegationManager.Contract.OperatorAllocationDelay(&_IDelegationManager.CallOpts, operator) +} + // OperatorDetails is a free data retrieval call binding the contract method 0xc5e480db. // // Solidity: function operatorDetails(address operator) view returns((address,address,uint32)) @@ -800,12 +806,12 @@ func (_IDelegationManager *IDelegationManagerCallerSession) OperatorDetails(oper return _IDelegationManager.Contract.OperatorDetails(&_IDelegationManager.CallOpts, operator) } -// OperatorShares is a free data retrieval call binding the contract method 0x778e55f3. +// OperatorScaledShares is a free data retrieval call binding the contract method 0x9fb4ee32. // -// Solidity: function operatorShares(address operator, address strategy) view returns(uint256) -func (_IDelegationManager *IDelegationManagerCaller) OperatorShares(opts *bind.CallOpts, operator common.Address, strategy common.Address) (*big.Int, error) { +// Solidity: function operatorScaledShares(address operator, address strategy) view returns(uint256) +func (_IDelegationManager *IDelegationManagerCaller) OperatorScaledShares(opts *bind.CallOpts, operator common.Address, strategy common.Address) (*big.Int, error) { var out []interface{} - err := _IDelegationManager.contract.Call(opts, &out, "operatorShares", operator, strategy) + err := _IDelegationManager.contract.Call(opts, &out, "operatorScaledShares", operator, strategy) if err != nil { return *new(*big.Int), err @@ -817,18 +823,18 @@ func (_IDelegationManager *IDelegationManagerCaller) OperatorShares(opts *bind.C } -// OperatorShares is a free data retrieval call binding the contract method 0x778e55f3. +// OperatorScaledShares is a free data retrieval call binding the contract method 0x9fb4ee32. // -// Solidity: function operatorShares(address operator, address strategy) view returns(uint256) -func (_IDelegationManager *IDelegationManagerSession) OperatorShares(operator common.Address, strategy common.Address) (*big.Int, error) { - return _IDelegationManager.Contract.OperatorShares(&_IDelegationManager.CallOpts, operator, strategy) +// Solidity: function operatorScaledShares(address operator, address strategy) view returns(uint256) +func (_IDelegationManager *IDelegationManagerSession) OperatorScaledShares(operator common.Address, strategy common.Address) (*big.Int, error) { + return _IDelegationManager.Contract.OperatorScaledShares(&_IDelegationManager.CallOpts, operator, strategy) } -// OperatorShares is a free data retrieval call binding the contract method 0x778e55f3. +// OperatorScaledShares is a free data retrieval call binding the contract method 0x9fb4ee32. // -// Solidity: function operatorShares(address operator, address strategy) view returns(uint256) -func (_IDelegationManager *IDelegationManagerCallerSession) OperatorShares(operator common.Address, strategy common.Address) (*big.Int, error) { - return _IDelegationManager.Contract.OperatorShares(&_IDelegationManager.CallOpts, operator, strategy) +// Solidity: function operatorScaledShares(address operator, address strategy) view returns(uint256) +func (_IDelegationManager *IDelegationManagerCallerSession) OperatorScaledShares(operator common.Address, strategy common.Address) (*big.Int, error) { + return _IDelegationManager.Contract.OperatorScaledShares(&_IDelegationManager.CallOpts, operator, strategy) } // StakerNonce is a free data retrieval call binding the contract method 0x29c77d4f. @@ -924,67 +930,67 @@ func (_IDelegationManager *IDelegationManagerCallerSession) StrategyWithdrawalDe return _IDelegationManager.Contract.StrategyWithdrawalDelayBlocks(&_IDelegationManager.CallOpts, strategy) } -// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0x60d7faed. +// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0xe4cc3f90. // -// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) returns() -func (_IDelegationManager *IDelegationManagerTransactor) CompleteQueuedWithdrawal(opts *bind.TransactOpts, withdrawal IDelegationManagerWithdrawal, tokens []common.Address, middlewareTimesIndex *big.Int, receiveAsTokens bool) (*types.Transaction, error) { - return _IDelegationManager.contract.Transact(opts, "completeQueuedWithdrawal", withdrawal, tokens, middlewareTimesIndex, receiveAsTokens) +// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, bool receiveAsTokens) returns() +func (_IDelegationManager *IDelegationManagerTransactor) CompleteQueuedWithdrawal(opts *bind.TransactOpts, withdrawal IDelegationManagerWithdrawal, tokens []common.Address, receiveAsTokens bool) (*types.Transaction, error) { + return _IDelegationManager.contract.Transact(opts, "completeQueuedWithdrawal", withdrawal, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0x60d7faed. +// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0xe4cc3f90. // -// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) returns() -func (_IDelegationManager *IDelegationManagerSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, middlewareTimesIndex *big.Int, receiveAsTokens bool) (*types.Transaction, error) { - return _IDelegationManager.Contract.CompleteQueuedWithdrawal(&_IDelegationManager.TransactOpts, withdrawal, tokens, middlewareTimesIndex, receiveAsTokens) +// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, bool receiveAsTokens) returns() +func (_IDelegationManager *IDelegationManagerSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, receiveAsTokens bool) (*types.Transaction, error) { + return _IDelegationManager.Contract.CompleteQueuedWithdrawal(&_IDelegationManager.TransactOpts, withdrawal, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0x60d7faed. +// CompleteQueuedWithdrawal is a paid mutator transaction binding the contract method 0xe4cc3f90. // -// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) returns() -func (_IDelegationManager *IDelegationManagerTransactorSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, middlewareTimesIndex *big.Int, receiveAsTokens bool) (*types.Transaction, error) { - return _IDelegationManager.Contract.CompleteQueuedWithdrawal(&_IDelegationManager.TransactOpts, withdrawal, tokens, middlewareTimesIndex, receiveAsTokens) +// Solidity: function completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]) withdrawal, address[] tokens, bool receiveAsTokens) returns() +func (_IDelegationManager *IDelegationManagerTransactorSession) CompleteQueuedWithdrawal(withdrawal IDelegationManagerWithdrawal, tokens []common.Address, receiveAsTokens bool) (*types.Transaction, error) { + return _IDelegationManager.Contract.CompleteQueuedWithdrawal(&_IDelegationManager.TransactOpts, withdrawal, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x33404396. +// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x9435bb43. // -// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) returns() -func (_IDelegationManager *IDelegationManagerTransactor) CompleteQueuedWithdrawals(opts *bind.TransactOpts, withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, middlewareTimesIndexes []*big.Int, receiveAsTokens []bool) (*types.Transaction, error) { - return _IDelegationManager.contract.Transact(opts, "completeQueuedWithdrawals", withdrawals, tokens, middlewareTimesIndexes, receiveAsTokens) +// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, bool[] receiveAsTokens) returns() +func (_IDelegationManager *IDelegationManagerTransactor) CompleteQueuedWithdrawals(opts *bind.TransactOpts, withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, receiveAsTokens []bool) (*types.Transaction, error) { + return _IDelegationManager.contract.Transact(opts, "completeQueuedWithdrawals", withdrawals, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x33404396. +// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x9435bb43. // -// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) returns() -func (_IDelegationManager *IDelegationManagerSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, middlewareTimesIndexes []*big.Int, receiveAsTokens []bool) (*types.Transaction, error) { - return _IDelegationManager.Contract.CompleteQueuedWithdrawals(&_IDelegationManager.TransactOpts, withdrawals, tokens, middlewareTimesIndexes, receiveAsTokens) +// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, bool[] receiveAsTokens) returns() +func (_IDelegationManager *IDelegationManagerSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, receiveAsTokens []bool) (*types.Transaction, error) { + return _IDelegationManager.Contract.CompleteQueuedWithdrawals(&_IDelegationManager.TransactOpts, withdrawals, tokens, receiveAsTokens) } -// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x33404396. +// CompleteQueuedWithdrawals is a paid mutator transaction binding the contract method 0x9435bb43. // -// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) returns() -func (_IDelegationManager *IDelegationManagerTransactorSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, middlewareTimesIndexes []*big.Int, receiveAsTokens []bool) (*types.Transaction, error) { - return _IDelegationManager.Contract.CompleteQueuedWithdrawals(&_IDelegationManager.TransactOpts, withdrawals, tokens, middlewareTimesIndexes, receiveAsTokens) +// Solidity: function completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[] withdrawals, address[][] tokens, bool[] receiveAsTokens) returns() +func (_IDelegationManager *IDelegationManagerTransactorSession) CompleteQueuedWithdrawals(withdrawals []IDelegationManagerWithdrawal, tokens [][]common.Address, receiveAsTokens []bool) (*types.Transaction, error) { + return _IDelegationManager.Contract.CompleteQueuedWithdrawals(&_IDelegationManager.TransactOpts, withdrawals, tokens, receiveAsTokens) } // DecreaseDelegatedShares is a paid mutator transaction binding the contract method 0x132d4967. // -// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_IDelegationManager *IDelegationManagerTransactor) DecreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _IDelegationManager.contract.Transact(opts, "decreaseDelegatedShares", staker, strategy, shares) +// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 removedShares) returns() +func (_IDelegationManager *IDelegationManagerTransactor) DecreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, removedShares *big.Int) (*types.Transaction, error) { + return _IDelegationManager.contract.Transact(opts, "decreaseDelegatedShares", staker, strategy, removedShares) } // DecreaseDelegatedShares is a paid mutator transaction binding the contract method 0x132d4967. // -// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_IDelegationManager *IDelegationManagerSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _IDelegationManager.Contract.DecreaseDelegatedShares(&_IDelegationManager.TransactOpts, staker, strategy, shares) +// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 removedShares) returns() +func (_IDelegationManager *IDelegationManagerSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, removedShares *big.Int) (*types.Transaction, error) { + return _IDelegationManager.Contract.DecreaseDelegatedShares(&_IDelegationManager.TransactOpts, staker, strategy, removedShares) } // DecreaseDelegatedShares is a paid mutator transaction binding the contract method 0x132d4967. // -// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_IDelegationManager *IDelegationManagerTransactorSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _IDelegationManager.Contract.DecreaseDelegatedShares(&_IDelegationManager.TransactOpts, staker, strategy, shares) +// Solidity: function decreaseDelegatedShares(address staker, address strategy, uint256 removedShares) returns() +func (_IDelegationManager *IDelegationManagerTransactorSession) DecreaseDelegatedShares(staker common.Address, strategy common.Address, removedShares *big.Int) (*types.Transaction, error) { + return _IDelegationManager.Contract.DecreaseDelegatedShares(&_IDelegationManager.TransactOpts, staker, strategy, removedShares) } // DelegateTo is a paid mutator transaction binding the contract method 0xeea9064b. @@ -1029,25 +1035,46 @@ func (_IDelegationManager *IDelegationManagerTransactorSession) DelegateToBySign return _IDelegationManager.Contract.DelegateToBySignature(&_IDelegationManager.TransactOpts, staker, operator, stakerSignatureAndExpiry, approverSignatureAndExpiry, approverSalt) } -// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x28a573ae. +// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x3c651cf2. +// +// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 existingShares, uint256 addedShares) returns() +func (_IDelegationManager *IDelegationManagerTransactor) IncreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, existingShares *big.Int, addedShares *big.Int) (*types.Transaction, error) { + return _IDelegationManager.contract.Transact(opts, "increaseDelegatedShares", staker, strategy, existingShares, addedShares) +} + +// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x3c651cf2. // -// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_IDelegationManager *IDelegationManagerTransactor) IncreaseDelegatedShares(opts *bind.TransactOpts, staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _IDelegationManager.contract.Transact(opts, "increaseDelegatedShares", staker, strategy, shares) +// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 existingShares, uint256 addedShares) returns() +func (_IDelegationManager *IDelegationManagerSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, existingShares *big.Int, addedShares *big.Int) (*types.Transaction, error) { + return _IDelegationManager.Contract.IncreaseDelegatedShares(&_IDelegationManager.TransactOpts, staker, strategy, existingShares, addedShares) } -// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x28a573ae. +// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x3c651cf2. // -// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_IDelegationManager *IDelegationManagerSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _IDelegationManager.Contract.IncreaseDelegatedShares(&_IDelegationManager.TransactOpts, staker, strategy, shares) +// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 existingShares, uint256 addedShares) returns() +func (_IDelegationManager *IDelegationManagerTransactorSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, existingShares *big.Int, addedShares *big.Int) (*types.Transaction, error) { + return _IDelegationManager.Contract.IncreaseDelegatedShares(&_IDelegationManager.TransactOpts, staker, strategy, existingShares, addedShares) } -// IncreaseDelegatedShares is a paid mutator transaction binding the contract method 0x28a573ae. +// InitializeAllocationDelay is a paid mutator transaction binding the contract method 0x0de5495d. // -// Solidity: function increaseDelegatedShares(address staker, address strategy, uint256 shares) returns() -func (_IDelegationManager *IDelegationManagerTransactorSession) IncreaseDelegatedShares(staker common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { - return _IDelegationManager.Contract.IncreaseDelegatedShares(&_IDelegationManager.TransactOpts, staker, strategy, shares) +// Solidity: function initializeAllocationDelay(uint32 delay) returns() +func (_IDelegationManager *IDelegationManagerTransactor) InitializeAllocationDelay(opts *bind.TransactOpts, delay uint32) (*types.Transaction, error) { + return _IDelegationManager.contract.Transact(opts, "initializeAllocationDelay", delay) +} + +// InitializeAllocationDelay is a paid mutator transaction binding the contract method 0x0de5495d. +// +// Solidity: function initializeAllocationDelay(uint32 delay) returns() +func (_IDelegationManager *IDelegationManagerSession) InitializeAllocationDelay(delay uint32) (*types.Transaction, error) { + return _IDelegationManager.Contract.InitializeAllocationDelay(&_IDelegationManager.TransactOpts, delay) +} + +// InitializeAllocationDelay is a paid mutator transaction binding the contract method 0x0de5495d. +// +// Solidity: function initializeAllocationDelay(uint32 delay) returns() +func (_IDelegationManager *IDelegationManagerTransactorSession) InitializeAllocationDelay(delay uint32) (*types.Transaction, error) { + return _IDelegationManager.Contract.InitializeAllocationDelay(&_IDelegationManager.TransactOpts, delay) } // ModifyOperatorDetails is a paid mutator transaction binding the contract method 0xf16172b0. @@ -1092,25 +1119,25 @@ func (_IDelegationManager *IDelegationManagerTransactorSession) QueueWithdrawals return _IDelegationManager.Contract.QueueWithdrawals(&_IDelegationManager.TransactOpts, queuedWithdrawalParams) } -// RegisterAsOperator is a paid mutator transaction binding the contract method 0x0f589e59. +// RegisterAsOperator is a paid mutator transaction binding the contract method 0x49730060. // -// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, string metadataURI) returns() -func (_IDelegationManager *IDelegationManagerTransactor) RegisterAsOperator(opts *bind.TransactOpts, registeringOperatorDetails IDelegationManagerOperatorDetails, metadataURI string) (*types.Transaction, error) { - return _IDelegationManager.contract.Transact(opts, "registerAsOperator", registeringOperatorDetails, metadataURI) +// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, uint32 allocationDelay, string metadataURI) returns() +func (_IDelegationManager *IDelegationManagerTransactor) RegisterAsOperator(opts *bind.TransactOpts, registeringOperatorDetails IDelegationManagerOperatorDetails, allocationDelay uint32, metadataURI string) (*types.Transaction, error) { + return _IDelegationManager.contract.Transact(opts, "registerAsOperator", registeringOperatorDetails, allocationDelay, metadataURI) } -// RegisterAsOperator is a paid mutator transaction binding the contract method 0x0f589e59. +// RegisterAsOperator is a paid mutator transaction binding the contract method 0x49730060. // -// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, string metadataURI) returns() -func (_IDelegationManager *IDelegationManagerSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, metadataURI string) (*types.Transaction, error) { - return _IDelegationManager.Contract.RegisterAsOperator(&_IDelegationManager.TransactOpts, registeringOperatorDetails, metadataURI) +// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, uint32 allocationDelay, string metadataURI) returns() +func (_IDelegationManager *IDelegationManagerSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, allocationDelay uint32, metadataURI string) (*types.Transaction, error) { + return _IDelegationManager.Contract.RegisterAsOperator(&_IDelegationManager.TransactOpts, registeringOperatorDetails, allocationDelay, metadataURI) } -// RegisterAsOperator is a paid mutator transaction binding the contract method 0x0f589e59. +// RegisterAsOperator is a paid mutator transaction binding the contract method 0x49730060. // -// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, string metadataURI) returns() -func (_IDelegationManager *IDelegationManagerTransactorSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, metadataURI string) (*types.Transaction, error) { - return _IDelegationManager.Contract.RegisterAsOperator(&_IDelegationManager.TransactOpts, registeringOperatorDetails, metadataURI) +// Solidity: function registerAsOperator((address,address,uint32) registeringOperatorDetails, uint32 allocationDelay, string metadataURI) returns() +func (_IDelegationManager *IDelegationManagerTransactorSession) RegisterAsOperator(registeringOperatorDetails IDelegationManagerOperatorDetails, allocationDelay uint32, metadataURI string) (*types.Transaction, error) { + return _IDelegationManager.Contract.RegisterAsOperator(&_IDelegationManager.TransactOpts, registeringOperatorDetails, allocationDelay, metadataURI) } // Undelegate is a paid mutator transaction binding the contract method 0xda8be864. @@ -2614,6 +2641,142 @@ func (_IDelegationManager *IDelegationManagerFilterer) ParseStrategyWithdrawalDe return event, nil } +// IDelegationManagerStrategyWithdrawalDelaySetIterator is returned from FilterStrategyWithdrawalDelaySet and is used to iterate over the raw logs and unpacked data for StrategyWithdrawalDelaySet events raised by the IDelegationManager contract. +type IDelegationManagerStrategyWithdrawalDelaySetIterator struct { + Event *IDelegationManagerStrategyWithdrawalDelaySet // 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 *IDelegationManagerStrategyWithdrawalDelaySetIterator) 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(IDelegationManagerStrategyWithdrawalDelaySet) + 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(IDelegationManagerStrategyWithdrawalDelaySet) + 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 *IDelegationManagerStrategyWithdrawalDelaySetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IDelegationManagerStrategyWithdrawalDelaySetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IDelegationManagerStrategyWithdrawalDelaySet represents a StrategyWithdrawalDelaySet event raised by the IDelegationManager contract. +type IDelegationManagerStrategyWithdrawalDelaySet struct { + Strategy common.Address + PreviousValue *big.Int + NewValue *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStrategyWithdrawalDelaySet is a free log retrieval operation binding the contract event 0x4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e5. +// +// Solidity: event StrategyWithdrawalDelaySet(address strategy, uint256 previousValue, uint256 newValue) +func (_IDelegationManager *IDelegationManagerFilterer) FilterStrategyWithdrawalDelaySet(opts *bind.FilterOpts) (*IDelegationManagerStrategyWithdrawalDelaySetIterator, error) { + + logs, sub, err := _IDelegationManager.contract.FilterLogs(opts, "StrategyWithdrawalDelaySet") + if err != nil { + return nil, err + } + return &IDelegationManagerStrategyWithdrawalDelaySetIterator{contract: _IDelegationManager.contract, event: "StrategyWithdrawalDelaySet", logs: logs, sub: sub}, nil +} + +// WatchStrategyWithdrawalDelaySet is a free log subscription operation binding the contract event 0x4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e5. +// +// Solidity: event StrategyWithdrawalDelaySet(address strategy, uint256 previousValue, uint256 newValue) +func (_IDelegationManager *IDelegationManagerFilterer) WatchStrategyWithdrawalDelaySet(opts *bind.WatchOpts, sink chan<- *IDelegationManagerStrategyWithdrawalDelaySet) (event.Subscription, error) { + + logs, sub, err := _IDelegationManager.contract.WatchLogs(opts, "StrategyWithdrawalDelaySet") + 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(IDelegationManagerStrategyWithdrawalDelaySet) + if err := _IDelegationManager.contract.UnpackLog(event, "StrategyWithdrawalDelaySet", 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 +} + +// ParseStrategyWithdrawalDelaySet is a log parse operation binding the contract event 0x4be295c8d739bae6e60f607ccde1aa068970dc43209682f7290d10726efc02e5. +// +// Solidity: event StrategyWithdrawalDelaySet(address strategy, uint256 previousValue, uint256 newValue) +func (_IDelegationManager *IDelegationManagerFilterer) ParseStrategyWithdrawalDelaySet(log types.Log) (*IDelegationManagerStrategyWithdrawalDelaySet, error) { + event := new(IDelegationManagerStrategyWithdrawalDelaySet) + if err := _IDelegationManager.contract.UnpackLog(event, "StrategyWithdrawalDelaySet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // IDelegationManagerWithdrawalCompletedIterator is returned from FilterWithdrawalCompleted and is used to iterate over the raw logs and unpacked data for WithdrawalCompleted events raised by the IDelegationManager contract. type IDelegationManagerWithdrawalCompletedIterator struct { Event *IDelegationManagerWithdrawalCompleted // Event containing the contract specifics and raw log diff --git a/pkg/bindings/IEigenPodManager/binding.go b/pkg/bindings/IEigenPodManager/binding.go index 8574aafa1..af41b61b0 100644 --- a/pkg/bindings/IEigenPodManager/binding.go +++ b/pkg/bindings/IEigenPodManager/binding.go @@ -31,7 +31,7 @@ var ( // IEigenPodManagerMetaData contains all meta data concerning the IEigenPodManager contract. var IEigenPodManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createPod\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"eigenPodBeacon\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"numPods\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownerToPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"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\":\"podOwnerShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordBeaconChainETHBalanceUpdate\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destination\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BeaconChainETHDeposited\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconChainETHWithdrawalCompleted\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"},{\"name\":\"delegatedAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewTotalShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newTotalShares\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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\":\"PodDeployed\",\"inputs\":[{\"name\":\"eigenPod\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodSharesUpdated\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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}]", + ABI: "[{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"increaseInDelegateableShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"existingPodShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createPod\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"eigenPodBeacon\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"numPods\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownerToPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"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\":\"podOwnerShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordBeaconChainETHBalanceUpdate\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destination\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BeaconChainETHDeposited\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconChainETHWithdrawalCompleted\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"},{\"name\":\"delegatedAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewTotalShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newTotalShares\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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\":\"PodDeployed\",\"inputs\":[{\"name\":\"eigenPod\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodSharesUpdated\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"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}]", } // IEigenPodManagerABI is the input ABI used to generate the binding from. @@ -585,21 +585,21 @@ func (_IEigenPodManager *IEigenPodManagerCallerSession) StrategyManager() (commo // AddShares is a paid mutator transaction binding the contract method 0x0e81073c. // -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256 increaseInDelegateableShares, uint256 existingPodShares) func (_IEigenPodManager *IEigenPodManagerTransactor) AddShares(opts *bind.TransactOpts, podOwner common.Address, shares *big.Int) (*types.Transaction, error) { return _IEigenPodManager.contract.Transact(opts, "addShares", podOwner, shares) } // AddShares is a paid mutator transaction binding the contract method 0x0e81073c. // -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256 increaseInDelegateableShares, uint256 existingPodShares) func (_IEigenPodManager *IEigenPodManagerSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { return _IEigenPodManager.Contract.AddShares(&_IEigenPodManager.TransactOpts, podOwner, shares) } // AddShares is a paid mutator transaction binding the contract method 0x0e81073c. // -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256 increaseInDelegateableShares, uint256 existingPodShares) func (_IEigenPodManager *IEigenPodManagerTransactorSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { return _IEigenPodManager.Contract.AddShares(&_IEigenPodManager.TransactOpts, podOwner, shares) } diff --git a/pkg/bindings/IRewardsCoordinator/binding.go b/pkg/bindings/IRewardsCoordinator/binding.go index e5163571a..f19f93005 100644 --- a/pkg/bindings/IRewardsCoordinator/binding.go +++ b/pkg/bindings/IRewardsCoordinator/binding.go @@ -29,6 +29,12 @@ var ( _ = abi.ConvertType ) +// IAVSDirectoryOperatorSet is an auto generated low-level Go binding around an user-defined struct. +type IAVSDirectoryOperatorSet struct { + Avs common.Address + OperatorSetId uint32 +} + // IRewardsCoordinatorDistributionRoot is an auto generated low-level Go binding around an user-defined struct. type IRewardsCoordinatorDistributionRoot struct { Root [32]byte @@ -43,6 +49,17 @@ type IRewardsCoordinatorEarnerTreeMerkleLeaf struct { EarnerTokenRoot [32]byte } +// IRewardsCoordinatorOperatorSetRewardsSubmission is an auto generated low-level Go binding around an user-defined struct. +type IRewardsCoordinatorOperatorSetRewardsSubmission struct { + RewardType uint8 + OperatorSetId uint32 + StrategiesAndMultipliers []IRewardsCoordinatorStrategyAndMultiplier + Token common.Address + Amount *big.Int + StartTimestamp uint32 + Duration uint32 +} + // IRewardsCoordinatorRewardsMerkleClaim is an auto generated low-level Go binding around an user-defined struct. type IRewardsCoordinatorRewardsMerkleClaim struct { RootIndex uint32 @@ -77,7 +94,7 @@ type IRewardsCoordinatorTokenTreeMerkleLeaf struct { // IRewardsCoordinatorMetaData contains all meta data concerning the IRewardsCoordinator contract. var IRewardsCoordinatorMetaData = &bind.MetaData{ - 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\":\"earner\",\"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\":\"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\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"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\":\"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\":\"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\":\"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\":\"RewardsUpdaterSet\",\"inputs\":[{\"name\":\"oldRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + 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\":\"earner\",\"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\":\"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\":\"claimer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"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\":\"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\":\"getOperatorCommissionBips\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorCommissionUpdateHistoryLength\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"}],\"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\":\"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\":\"rewardOperatorSetForRange\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.OperatorSetRewardsSubmission[]\",\"components\":[{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"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\":\"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\":\"setOperatorCommissionBips\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"commissionBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"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\":\"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\":\"OperatorCommissionUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":true,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"newCommissionBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"effectTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetRewardCreated\",\"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.OperatorSetRewardsSubmission\",\"components\":[{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"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\":\"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\":\"RewardsUpdaterSet\",\"inputs\":[{\"name\":\"oldRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", } // IRewardsCoordinatorABI is the input ABI used to generate the binding from. @@ -722,6 +739,68 @@ func (_IRewardsCoordinator *IRewardsCoordinatorCallerSession) GetDistributionRoo return _IRewardsCoordinator.Contract.GetDistributionRootsLength(&_IRewardsCoordinator.CallOpts) } +// GetOperatorCommissionBips is a free data retrieval call binding the contract method 0x4d7a80d4. +// +// Solidity: function getOperatorCommissionBips(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint16) +func (_IRewardsCoordinator *IRewardsCoordinatorCaller) GetOperatorCommissionBips(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (uint16, error) { + var out []interface{} + err := _IRewardsCoordinator.contract.Call(opts, &out, "getOperatorCommissionBips", operator, operatorSet, rewardType) + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +// GetOperatorCommissionBips is a free data retrieval call binding the contract method 0x4d7a80d4. +// +// Solidity: function getOperatorCommissionBips(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint16) +func (_IRewardsCoordinator *IRewardsCoordinatorSession) GetOperatorCommissionBips(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (uint16, error) { + return _IRewardsCoordinator.Contract.GetOperatorCommissionBips(&_IRewardsCoordinator.CallOpts, operator, operatorSet, rewardType) +} + +// GetOperatorCommissionBips is a free data retrieval call binding the contract method 0x4d7a80d4. +// +// Solidity: function getOperatorCommissionBips(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint16) +func (_IRewardsCoordinator *IRewardsCoordinatorCallerSession) GetOperatorCommissionBips(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (uint16, error) { + return _IRewardsCoordinator.Contract.GetOperatorCommissionBips(&_IRewardsCoordinator.CallOpts, operator, operatorSet, rewardType) +} + +// GetOperatorCommissionUpdateHistoryLength is a free data retrieval call binding the contract method 0xc336f19d. +// +// Solidity: function getOperatorCommissionUpdateHistoryLength(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint256) +func (_IRewardsCoordinator *IRewardsCoordinatorCaller) GetOperatorCommissionUpdateHistoryLength(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (*big.Int, error) { + var out []interface{} + err := _IRewardsCoordinator.contract.Call(opts, &out, "getOperatorCommissionUpdateHistoryLength", operator, operatorSet, rewardType) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetOperatorCommissionUpdateHistoryLength is a free data retrieval call binding the contract method 0xc336f19d. +// +// Solidity: function getOperatorCommissionUpdateHistoryLength(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint256) +func (_IRewardsCoordinator *IRewardsCoordinatorSession) GetOperatorCommissionUpdateHistoryLength(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (*big.Int, error) { + return _IRewardsCoordinator.Contract.GetOperatorCommissionUpdateHistoryLength(&_IRewardsCoordinator.CallOpts, operator, operatorSet, rewardType) +} + +// GetOperatorCommissionUpdateHistoryLength is a free data retrieval call binding the contract method 0xc336f19d. +// +// Solidity: function getOperatorCommissionUpdateHistoryLength(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint256) +func (_IRewardsCoordinator *IRewardsCoordinatorCallerSession) GetOperatorCommissionUpdateHistoryLength(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (*big.Int, error) { + return _IRewardsCoordinator.Contract.GetOperatorCommissionUpdateHistoryLength(&_IRewardsCoordinator.CallOpts, operator, operatorSet, rewardType) +} + // GetRootIndexFromHash is a free data retrieval call binding the contract method 0xe810ce21. // // Solidity: function getRootIndexFromHash(bytes32 rootHash) view returns(uint32) @@ -784,37 +863,6 @@ func (_IRewardsCoordinator *IRewardsCoordinatorCallerSession) GlobalOperatorComm return _IRewardsCoordinator.Contract.GlobalOperatorCommissionBips(&_IRewardsCoordinator.CallOpts) } -// OperatorCommissionBips is a free data retrieval call binding the contract method 0x22f19a64. -// -// Solidity: function operatorCommissionBips(address operator, address avs) view returns(uint16) -func (_IRewardsCoordinator *IRewardsCoordinatorCaller) OperatorCommissionBips(opts *bind.CallOpts, operator common.Address, avs common.Address) (uint16, error) { - var out []interface{} - err := _IRewardsCoordinator.contract.Call(opts, &out, "operatorCommissionBips", operator, avs) - - if err != nil { - return *new(uint16), err - } - - out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) - - return out0, err - -} - -// OperatorCommissionBips is a free data retrieval call binding the contract method 0x22f19a64. -// -// Solidity: function operatorCommissionBips(address operator, address avs) view returns(uint16) -func (_IRewardsCoordinator *IRewardsCoordinatorSession) OperatorCommissionBips(operator common.Address, avs common.Address) (uint16, error) { - return _IRewardsCoordinator.Contract.OperatorCommissionBips(&_IRewardsCoordinator.CallOpts, operator, avs) -} - -// OperatorCommissionBips is a free data retrieval call binding the contract method 0x22f19a64. -// -// Solidity: function operatorCommissionBips(address operator, address avs) view returns(uint16) -func (_IRewardsCoordinator *IRewardsCoordinatorCallerSession) OperatorCommissionBips(operator common.Address, avs common.Address) (uint16, error) { - return _IRewardsCoordinator.Contract.OperatorCommissionBips(&_IRewardsCoordinator.CallOpts, operator, avs) -} - // RewardsUpdater is a free data retrieval call binding the contract method 0xfbf1e2c1. // // Solidity: function rewardsUpdater() view returns(address) @@ -930,6 +978,27 @@ func (_IRewardsCoordinator *IRewardsCoordinatorTransactorSession) ProcessClaim(c return _IRewardsCoordinator.Contract.ProcessClaim(&_IRewardsCoordinator.TransactOpts, claim, recipient) } +// RewardOperatorSetForRange is a paid mutator transaction binding the contract method 0x2c9c60cf. +// +// Solidity: function rewardOperatorSetForRange((uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32)[] rewardsSubmissions) returns() +func (_IRewardsCoordinator *IRewardsCoordinatorTransactor) RewardOperatorSetForRange(opts *bind.TransactOpts, rewardsSubmissions []IRewardsCoordinatorOperatorSetRewardsSubmission) (*types.Transaction, error) { + return _IRewardsCoordinator.contract.Transact(opts, "rewardOperatorSetForRange", rewardsSubmissions) +} + +// RewardOperatorSetForRange is a paid mutator transaction binding the contract method 0x2c9c60cf. +// +// Solidity: function rewardOperatorSetForRange((uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32)[] rewardsSubmissions) returns() +func (_IRewardsCoordinator *IRewardsCoordinatorSession) RewardOperatorSetForRange(rewardsSubmissions []IRewardsCoordinatorOperatorSetRewardsSubmission) (*types.Transaction, error) { + return _IRewardsCoordinator.Contract.RewardOperatorSetForRange(&_IRewardsCoordinator.TransactOpts, rewardsSubmissions) +} + +// RewardOperatorSetForRange is a paid mutator transaction binding the contract method 0x2c9c60cf. +// +// Solidity: function rewardOperatorSetForRange((uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32)[] rewardsSubmissions) returns() +func (_IRewardsCoordinator *IRewardsCoordinatorTransactorSession) RewardOperatorSetForRange(rewardsSubmissions []IRewardsCoordinatorOperatorSetRewardsSubmission) (*types.Transaction, error) { + return _IRewardsCoordinator.Contract.RewardOperatorSetForRange(&_IRewardsCoordinator.TransactOpts, rewardsSubmissions) +} + // SetActivationDelay is a paid mutator transaction binding the contract method 0x58baaa3e. // // Solidity: function setActivationDelay(uint32 _activationDelay) returns() @@ -993,6 +1062,27 @@ func (_IRewardsCoordinator *IRewardsCoordinatorTransactorSession) SetGlobalOpera return _IRewardsCoordinator.Contract.SetGlobalOperatorCommission(&_IRewardsCoordinator.TransactOpts, _globalCommissionBips) } +// SetOperatorCommissionBips is a paid mutator transaction binding the contract method 0x3c8fcf7c. +// +// Solidity: function setOperatorCommissionBips((address,uint32) operatorSet, uint8 rewardType, uint16 commissionBips) returns(uint32) +func (_IRewardsCoordinator *IRewardsCoordinatorTransactor) SetOperatorCommissionBips(opts *bind.TransactOpts, operatorSet IAVSDirectoryOperatorSet, rewardType uint8, commissionBips uint16) (*types.Transaction, error) { + return _IRewardsCoordinator.contract.Transact(opts, "setOperatorCommissionBips", operatorSet, rewardType, commissionBips) +} + +// SetOperatorCommissionBips is a paid mutator transaction binding the contract method 0x3c8fcf7c. +// +// Solidity: function setOperatorCommissionBips((address,uint32) operatorSet, uint8 rewardType, uint16 commissionBips) returns(uint32) +func (_IRewardsCoordinator *IRewardsCoordinatorSession) SetOperatorCommissionBips(operatorSet IAVSDirectoryOperatorSet, rewardType uint8, commissionBips uint16) (*types.Transaction, error) { + return _IRewardsCoordinator.Contract.SetOperatorCommissionBips(&_IRewardsCoordinator.TransactOpts, operatorSet, rewardType, commissionBips) +} + +// SetOperatorCommissionBips is a paid mutator transaction binding the contract method 0x3c8fcf7c. +// +// Solidity: function setOperatorCommissionBips((address,uint32) operatorSet, uint8 rewardType, uint16 commissionBips) returns(uint32) +func (_IRewardsCoordinator *IRewardsCoordinatorTransactorSession) SetOperatorCommissionBips(operatorSet IAVSDirectoryOperatorSet, rewardType uint8, commissionBips uint16) (*types.Transaction, error) { + return _IRewardsCoordinator.Contract.SetOperatorCommissionBips(&_IRewardsCoordinator.TransactOpts, operatorSet, rewardType, commissionBips) +} + // SetRewardsForAllSubmitter is a paid mutator transaction binding the contract method 0x0eb38345. // // Solidity: function setRewardsForAllSubmitter(address _submitter, bool _newValue) returns() @@ -1958,6 +2048,325 @@ func (_IRewardsCoordinator *IRewardsCoordinatorFilterer) ParseGlobalCommissionBi return event, nil } +// IRewardsCoordinatorOperatorCommissionUpdatedIterator is returned from FilterOperatorCommissionUpdated and is used to iterate over the raw logs and unpacked data for OperatorCommissionUpdated events raised by the IRewardsCoordinator contract. +type IRewardsCoordinatorOperatorCommissionUpdatedIterator struct { + Event *IRewardsCoordinatorOperatorCommissionUpdated // 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 *IRewardsCoordinatorOperatorCommissionUpdatedIterator) 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(IRewardsCoordinatorOperatorCommissionUpdated) + 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(IRewardsCoordinatorOperatorCommissionUpdated) + 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 *IRewardsCoordinatorOperatorCommissionUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IRewardsCoordinatorOperatorCommissionUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IRewardsCoordinatorOperatorCommissionUpdated represents a OperatorCommissionUpdated event raised by the IRewardsCoordinator contract. +type IRewardsCoordinatorOperatorCommissionUpdated struct { + Operator common.Address + OperatorSet IAVSDirectoryOperatorSet + RewardType uint8 + NewCommissionBips uint16 + EffectTimestamp uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorCommissionUpdated is a free log retrieval operation binding the contract event 0x811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba. +// +// Solidity: event OperatorCommissionUpdated(address indexed operator, (address,uint32) indexed operatorSet, uint8 rewardType, uint16 newCommissionBips, uint32 effectTimestamp) +func (_IRewardsCoordinator *IRewardsCoordinatorFilterer) FilterOperatorCommissionUpdated(opts *bind.FilterOpts, operator []common.Address, operatorSet []IAVSDirectoryOperatorSet) (*IRewardsCoordinatorOperatorCommissionUpdatedIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var operatorSetRule []interface{} + for _, operatorSetItem := range operatorSet { + operatorSetRule = append(operatorSetRule, operatorSetItem) + } + + logs, sub, err := _IRewardsCoordinator.contract.FilterLogs(opts, "OperatorCommissionUpdated", operatorRule, operatorSetRule) + if err != nil { + return nil, err + } + return &IRewardsCoordinatorOperatorCommissionUpdatedIterator{contract: _IRewardsCoordinator.contract, event: "OperatorCommissionUpdated", logs: logs, sub: sub}, nil +} + +// WatchOperatorCommissionUpdated is a free log subscription operation binding the contract event 0x811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba. +// +// Solidity: event OperatorCommissionUpdated(address indexed operator, (address,uint32) indexed operatorSet, uint8 rewardType, uint16 newCommissionBips, uint32 effectTimestamp) +func (_IRewardsCoordinator *IRewardsCoordinatorFilterer) WatchOperatorCommissionUpdated(opts *bind.WatchOpts, sink chan<- *IRewardsCoordinatorOperatorCommissionUpdated, operator []common.Address, operatorSet []IAVSDirectoryOperatorSet) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var operatorSetRule []interface{} + for _, operatorSetItem := range operatorSet { + operatorSetRule = append(operatorSetRule, operatorSetItem) + } + + logs, sub, err := _IRewardsCoordinator.contract.WatchLogs(opts, "OperatorCommissionUpdated", operatorRule, operatorSetRule) + 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(IRewardsCoordinatorOperatorCommissionUpdated) + if err := _IRewardsCoordinator.contract.UnpackLog(event, "OperatorCommissionUpdated", 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 +} + +// ParseOperatorCommissionUpdated is a log parse operation binding the contract event 0x811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba. +// +// Solidity: event OperatorCommissionUpdated(address indexed operator, (address,uint32) indexed operatorSet, uint8 rewardType, uint16 newCommissionBips, uint32 effectTimestamp) +func (_IRewardsCoordinator *IRewardsCoordinatorFilterer) ParseOperatorCommissionUpdated(log types.Log) (*IRewardsCoordinatorOperatorCommissionUpdated, error) { + event := new(IRewardsCoordinatorOperatorCommissionUpdated) + if err := _IRewardsCoordinator.contract.UnpackLog(event, "OperatorCommissionUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IRewardsCoordinatorOperatorSetRewardCreatedIterator is returned from FilterOperatorSetRewardCreated and is used to iterate over the raw logs and unpacked data for OperatorSetRewardCreated events raised by the IRewardsCoordinator contract. +type IRewardsCoordinatorOperatorSetRewardCreatedIterator struct { + Event *IRewardsCoordinatorOperatorSetRewardCreated // 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 *IRewardsCoordinatorOperatorSetRewardCreatedIterator) 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(IRewardsCoordinatorOperatorSetRewardCreated) + 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(IRewardsCoordinatorOperatorSetRewardCreated) + 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 *IRewardsCoordinatorOperatorSetRewardCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IRewardsCoordinatorOperatorSetRewardCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IRewardsCoordinatorOperatorSetRewardCreated represents a OperatorSetRewardCreated event raised by the IRewardsCoordinator contract. +type IRewardsCoordinatorOperatorSetRewardCreated struct { + Avs common.Address + SubmissionNonce *big.Int + RewardsSubmissionHash [32]byte + RewardsSubmission IRewardsCoordinatorOperatorSetRewardsSubmission + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorSetRewardCreated is a free log retrieval operation binding the contract event 0x29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b2. +// +// Solidity: event OperatorSetRewardCreated(address indexed avs, uint256 indexed submissionNonce, bytes32 indexed rewardsSubmissionHash, (uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32) rewardsSubmission) +func (_IRewardsCoordinator *IRewardsCoordinatorFilterer) FilterOperatorSetRewardCreated(opts *bind.FilterOpts, avs []common.Address, submissionNonce []*big.Int, rewardsSubmissionHash [][32]byte) (*IRewardsCoordinatorOperatorSetRewardCreatedIterator, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + var submissionNonceRule []interface{} + for _, submissionNonceItem := range submissionNonce { + submissionNonceRule = append(submissionNonceRule, submissionNonceItem) + } + var rewardsSubmissionHashRule []interface{} + for _, rewardsSubmissionHashItem := range rewardsSubmissionHash { + rewardsSubmissionHashRule = append(rewardsSubmissionHashRule, rewardsSubmissionHashItem) + } + + logs, sub, err := _IRewardsCoordinator.contract.FilterLogs(opts, "OperatorSetRewardCreated", avsRule, submissionNonceRule, rewardsSubmissionHashRule) + if err != nil { + return nil, err + } + return &IRewardsCoordinatorOperatorSetRewardCreatedIterator{contract: _IRewardsCoordinator.contract, event: "OperatorSetRewardCreated", logs: logs, sub: sub}, nil +} + +// WatchOperatorSetRewardCreated is a free log subscription operation binding the contract event 0x29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b2. +// +// Solidity: event OperatorSetRewardCreated(address indexed avs, uint256 indexed submissionNonce, bytes32 indexed rewardsSubmissionHash, (uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32) rewardsSubmission) +func (_IRewardsCoordinator *IRewardsCoordinatorFilterer) WatchOperatorSetRewardCreated(opts *bind.WatchOpts, sink chan<- *IRewardsCoordinatorOperatorSetRewardCreated, avs []common.Address, submissionNonce []*big.Int, rewardsSubmissionHash [][32]byte) (event.Subscription, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + var submissionNonceRule []interface{} + for _, submissionNonceItem := range submissionNonce { + submissionNonceRule = append(submissionNonceRule, submissionNonceItem) + } + var rewardsSubmissionHashRule []interface{} + for _, rewardsSubmissionHashItem := range rewardsSubmissionHash { + rewardsSubmissionHashRule = append(rewardsSubmissionHashRule, rewardsSubmissionHashItem) + } + + logs, sub, err := _IRewardsCoordinator.contract.WatchLogs(opts, "OperatorSetRewardCreated", avsRule, submissionNonceRule, rewardsSubmissionHashRule) + 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(IRewardsCoordinatorOperatorSetRewardCreated) + if err := _IRewardsCoordinator.contract.UnpackLog(event, "OperatorSetRewardCreated", 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 +} + +// ParseOperatorSetRewardCreated is a log parse operation binding the contract event 0x29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b2. +// +// Solidity: event OperatorSetRewardCreated(address indexed avs, uint256 indexed submissionNonce, bytes32 indexed rewardsSubmissionHash, (uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32) rewardsSubmission) +func (_IRewardsCoordinator *IRewardsCoordinatorFilterer) ParseOperatorSetRewardCreated(log types.Log) (*IRewardsCoordinatorOperatorSetRewardCreated, error) { + event := new(IRewardsCoordinatorOperatorSetRewardCreated) + if err := _IRewardsCoordinator.contract.UnpackLog(event, "OperatorSetRewardCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // IRewardsCoordinatorRewardsClaimedIterator is returned from FilterRewardsClaimed and is used to iterate over the raw logs and unpacked data for RewardsClaimed events raised by the IRewardsCoordinator contract. type IRewardsCoordinatorRewardsClaimedIterator struct { Event *IRewardsCoordinatorRewardsClaimed // Event containing the contract specifics and raw log diff --git a/pkg/bindings/IStrategyManager/binding.go b/pkg/bindings/IStrategyManager/binding.go index 5dc38621c..47dc52580 100644 --- a/pkg/bindings/IStrategyManager/binding.go +++ b/pkg/bindings/IStrategyManager/binding.go @@ -31,7 +31,7 @@ var ( // IStrategyManagerMetaData contains all meta data concerning the IStrategyManager contract. var IStrategyManagerMetaData = &bind.MetaData{ - ABI: "[{\"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\":\"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\":\"stakerStrategyListLength\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerStrategyShares\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyIsWhitelistedForDeposit\",\"inputs\":[{\"name\":\"strategy\",\"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\":\"strategy\",\"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}]", + ABI: "[{\"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\":[{\"name\":\"existingShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"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\":\"stakerStrategyListLength\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stakerStrategyShares\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"outputs\":[{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyIsWhitelistedForDeposit\",\"inputs\":[{\"name\":\"strategy\",\"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\":\"strategy\",\"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}]", } // IStrategyManagerABI is the input ABI used to generate the binding from. @@ -462,21 +462,21 @@ func (_IStrategyManager *IStrategyManagerCallerSession) ThirdPartyTransfersForbi // AddShares is a paid mutator transaction binding the contract method 0xc4623ea1. // -// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns() +// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns(uint256 existingShares) func (_IStrategyManager *IStrategyManagerTransactor) AddShares(opts *bind.TransactOpts, staker common.Address, token common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { return _IStrategyManager.contract.Transact(opts, "addShares", staker, token, strategy, shares) } // AddShares is a paid mutator transaction binding the contract method 0xc4623ea1. // -// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns() +// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns(uint256 existingShares) func (_IStrategyManager *IStrategyManagerSession) AddShares(staker common.Address, token common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { return _IStrategyManager.Contract.AddShares(&_IStrategyManager.TransactOpts, staker, token, strategy, shares) } // AddShares is a paid mutator transaction binding the contract method 0xc4623ea1. // -// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns() +// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns(uint256 existingShares) func (_IStrategyManager *IStrategyManagerTransactorSession) AddShares(staker common.Address, token common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { return _IStrategyManager.Contract.AddShares(&_IStrategyManager.TransactOpts, staker, token, strategy, shares) } diff --git a/pkg/bindings/IWhitelister/binding.go b/pkg/bindings/IWhitelister/binding.go index e4afb3731..487579bb7 100644 --- a/pkg/bindings/IWhitelister/binding.go +++ b/pkg/bindings/IWhitelister/binding.go @@ -38,18 +38,18 @@ type IDelegationManagerQueuedWithdrawalParams struct { // IDelegationManagerWithdrawal is an auto generated low-level Go binding around an user-defined struct. type IDelegationManagerWithdrawal struct { - Staker common.Address - DelegatedTo common.Address - Withdrawer common.Address - Nonce *big.Int - StartBlock uint32 - Strategies []common.Address - Shares []*big.Int + Staker common.Address + DelegatedTo common.Address + Withdrawer common.Address + Nonce *big.Int + StartTimestamp uint32 + Strategies []common.Address + ScaledShares []*big.Int } // IWhitelisterMetaData contains all meta data concerning the IWhitelister contract. var IWhitelisterMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"callAddress\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"queuedWithdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startBlock\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"middlewareTimesIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositIntoStrategy\",\"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\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getStaker\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"queueWithdrawal\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"whitelist\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"}]", + ABI: "[{\"type\":\"function\",\"name\":\"callAddress\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"completeQueuedWithdrawal\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"queuedWithdrawal\",\"type\":\"tuple\",\"internalType\":\"structIDelegationManager.Withdrawal\",\"components\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"delegatedTo\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"startTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"scaledShares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"middlewareTimesIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"receiveAsTokens\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"depositIntoStrategy\",\"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\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getStaker\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"queueWithdrawal\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"queuedWithdrawalParams\",\"type\":\"tuple[]\",\"internalType\":\"structIDelegationManager.QueuedWithdrawalParams[]\",\"components\":[{\"name\":\"strategies\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"shares\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"staker\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"whitelist\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"}]", } // IWhitelisterABI is the input ABI used to generate the binding from. 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 8cbb2cefc..4c3aab35e 100644 --- a/pkg/bindings/RewardsCoordinator/binding.go +++ b/pkg/bindings/RewardsCoordinator/binding.go @@ -29,6 +29,12 @@ var ( _ = abi.ConvertType ) +// IAVSDirectoryOperatorSet is an auto generated low-level Go binding around an user-defined struct. +type IAVSDirectoryOperatorSet struct { + Avs common.Address + OperatorSetId uint32 +} + // IRewardsCoordinatorDistributionRoot is an auto generated low-level Go binding around an user-defined struct. type IRewardsCoordinatorDistributionRoot struct { Root [32]byte @@ -43,6 +49,17 @@ type IRewardsCoordinatorEarnerTreeMerkleLeaf struct { EarnerTokenRoot [32]byte } +// IRewardsCoordinatorOperatorSetRewardsSubmission is an auto generated low-level Go binding around an user-defined struct. +type IRewardsCoordinatorOperatorSetRewardsSubmission struct { + RewardType uint8 + OperatorSetId uint32 + StrategiesAndMultipliers []IRewardsCoordinatorStrategyAndMultiplier + Token common.Address + Amount *big.Int + StartTimestamp uint32 + Duration uint32 +} + // IRewardsCoordinatorRewardsMerkleClaim is an auto generated low-level Go binding around an user-defined struct. type IRewardsCoordinatorRewardsMerkleClaim struct { RootIndex uint32 @@ -77,8 +94,8 @@ type IRewardsCoordinatorTokenTreeMerkleLeaf struct { // RewardsCoordinatorMetaData contains all meta data concerning the RewardsCoordinator contract. var RewardsCoordinatorMetaData = &bind.MetaData{ - 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\":\"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\":\"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\":\"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}]", - Bin: "0x6101806040523480156200001257600080fd5b5060405162004367380380620043678339810160408190526200003591620002e4565b868686868686866200004885826200037e565b63ffffffff1615620000ed5760405162461bcd60e51b815260206004820152606060248201527f52657761726473436f6f7264696e61746f723a2047454e455349535f5245574160448201527f5244535f54494d455354414d50206d7573742062652061206d756c7469706c6560648201527f206f662043414c43554c4154494f4e5f494e54455256414c5f5345434f4e4453608482015260a4015b60405180910390fd5b620000fc62015180866200037e565b63ffffffff16156200019d5760405162461bcd60e51b815260206004820152605760248201527f52657761726473436f6f7264696e61746f723a2043414c43554c4154494f4e5f60448201527f494e54455256414c5f5345434f4e4453206d7573742062652061206d756c746960648201527f706c65206f6620534e415053484f545f434144454e4345000000000000000000608482015260a401620000e4565b6001600160a01b0396871661012052949095166101405263ffffffff92831660805290821660a052811660c05291821660e0521661010052620001df620001f2565b5050466101605250620003b09350505050565b600054610100900460ff16156200025c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401620000e4565b60005460ff9081161015620002af576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b0381168114620002c757600080fd5b50565b805163ffffffff81168114620002df57600080fd5b919050565b600080600080600080600060e0888a0312156200030057600080fd5b87516200030d81620002b1565b60208901519097506200032081620002b1565b95506200033060408901620002ca565b94506200034060608901620002ca565b93506200035060808901620002ca565b92506200036060a08901620002ca565b91506200037060c08901620002ca565b905092959891949750929550565b600063ffffffff80841680620003a457634e487b7160e01b600052601260045260246000fd5b92169190910692915050565b60805160a05160c05160e05161010051610120516101405161016051613f20620004476000396000611a640152600081816104c7015261271e015260006107590152600081816103d0015261254d0152600081816102fc01526125f90152600081816104a001526124fc0152600081816106b8015261227301526000818161065e0152818161232a01526124050152613f206000f3fe608060405234801561001057600080fd5b50600436106102ba5760003560e01c8063715018a611610182578063c46db606116100e9578063f2fde38b116100a2578063f96abf2e1161007c578063f96abf2e146107a9578063fabc1cbc146107bc578063fbf1e2c1146107cf578063fce36c7d146107e257600080fd5b8063f2fde38b1461077b578063f698da251461078e578063f8cd84481461079657600080fd5b8063c46db606146106da578063d4540a5514610708578063de02e5031461071b578063e221b2451461072e578063e810ce2114610741578063ea4d3c9b1461075457600080fd5b80639104c3191161013b5780639104c319146106365780639be3d4e4146106515780639d45c28114610659578063a0169ddd14610680578063bb7e451f14610693578063bf21a8aa146106b357600080fd5b8063715018a6146105c45780637b8f8b05146105cc578063863cb9a9146105d4578063865c6953146105e7578063886f1195146106125780638da5cb5b1461062557600080fd5b806337838ed01161022657806358baaa3e116101df57806358baaa3e1461053d578063595c6a67146105505780635ac86ab7146105585780635c975abb1461057b5780635e9d8348146105835780636d21117e1461059657600080fd5b806337838ed01461049b57806339b70e38146104c25780633a8c0786146104e95780633ccc861d146105005780633efe1db6146105135780634d18cc351461052657600080fd5b8063131433b411610278578063131433b4146103cb578063136439dd146103f2578063149bc8721461040557806322f19a64146104265780632b9f64a41461044757806336af41fa1461048857600080fd5b806218572c146102bf57806304a0c502146102f7578063092db007146103335780630e9a53cf1461035b5780630eb38345146103a357806310d67a2f146103b8575b600080fd5b6102e26102cd3660046135a9565b60d16020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61031e7f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020016102ee565b60cb5461034890600160e01b900461ffff1681565b60405161ffff90911681526020016102ee565b6103636107f5565b604080518251815260208084015163ffffffff908116918301919091528383015116918101919091526060918201511515918101919091526080016102ee565b6103b66103b13660046135d4565b6108d4565b005b6103b66103c63660046135a9565b610956565b61031e7f000000000000000000000000000000000000000000000000000000000000000081565b6103b661040036600461360d565b610a12565b61041861041336600461363e565b610b51565b6040519081526020016102ee565b61034861043436600461365a565b505060cb54600160e01b900461ffff1690565b6104706104553660046135a9565b60cc602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016102ee565b6103b6610496366004613688565b610bc7565b61031e7f000000000000000000000000000000000000000000000000000000000000000081565b6104707f000000000000000000000000000000000000000000000000000000000000000081565b60cb5461031e90600160a01b900463ffffffff1681565b6103b661050e366004613710565b610e01565b6103b6610521366004613770565b6111c5565b60cb5461031e90600160c01b900463ffffffff1681565b6103b661054b36600461379c565b611496565b6103b66114a7565b6102e26105663660046137b7565b606654600160ff9092169190911b9081161490565b606654610418565b6102e26105913660046137da565b61156e565b6102e26105a436600461380f565b60cf60209081526000928352604080842090915290825290205460ff1681565b6103b66115fb565b60ca54610418565b6103b66105e23660046135a9565b61160f565b6104186105f536600461365a565b60cd60209081526000928352604080842090915290825290205481565b606554610470906001600160a01b031681565b6033546001600160a01b0316610470565b61047073beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac081565b610363611620565b61031e7f000000000000000000000000000000000000000000000000000000000000000081565b6103b661068e3660046135a9565b6116be565b6104186106a13660046135a9565b60ce6020526000908152604090205481565b61031e7f000000000000000000000000000000000000000000000000000000000000000081565b6102e26106e836600461380f565b60d060209081526000928352604080842090915290825290205460ff1681565b6103b6610716366004613858565b61171d565b61036361072936600461360d565b611865565b6103b661073c3660046138cb565b6118f7565b61031e61074f36600461360d565b611908565b6104707f000000000000000000000000000000000000000000000000000000000000000081565b6103b66107893660046135a9565b6119ea565b610418611a60565b6104186107a436600461363e565b611a9e565b6103b66107b736600461379c565b611aaf565b6103b66107ca36600461360d565b611ce5565b60cb54610470906001600160a01b031681565b6103b66107f0366004613688565b611e41565b60408051608081018252600080825260208201819052918101829052606081019190915260ca545b80156108d057600060ca6108326001846138fc565b8154811061084257610842613913565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff1615801560608301819052919250906108b25750806040015163ffffffff164210155b156108bd5792915050565b50806108c881613929565b91505061081d565b5090565b6108dc611fc0565b6001600160a01b038216600081815260d1602052604080822054905160ff9091169284151592841515927f4de6293e668df1398422e1def12118052c1539a03cbfedc145895d48d7685f1c9190a4506001600160a01b0391909116600090815260d160205260409020805460ff1916911515919091179055565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cd9190613940565b6001600160a01b0316336001600160a01b031614610a065760405162461bcd60e51b81526004016109fd9061395d565b60405180910390fd5b610a0f8161201a565b50565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e91906139a7565b610a9a5760405162461bcd60e51b81526004016109fd906139c4565b60665481811614610b135760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c697479000000000000000060648201526084016109fd565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600080610b6160208401846135a9565b8360200135604051602001610baa9392919060f89390931b6001600160f81b031916835260609190911b6bffffffffffffffffffffffff19166001830152601582015260350190565b604051602081830303815290604052805190602001209050919050565b60665460019060029081161415610bf05760405162461bcd60e51b81526004016109fd90613a0c565b33600090815260d1602052604090205460ff16610c8f5760405162461bcd60e51b815260206004820152605160248201527f52657761726473436f6f7264696e61746f723a2063616c6c6572206973206e6f60448201527f7420612076616c69642063726561746552657761726473466f72416c6c53756260648201527036b4b9b9b4b7b71039bab136b4ba3a32b960791b608482015260a4016109fd565b60026097541415610cb25760405162461bcd60e51b81526004016109fd90613a43565b600260975560005b82811015610df65736848483818110610cd557610cd5613913565b9050602002810190610ce79190613a7a565b33600081815260ce60209081526040808320549051949550939192610d129290918591879101613bbf565b604051602081830303815290604052805190602001209050610d3383612111565b33600090815260d0602090815260408083208484529091529020805460ff19166001908117909155610d66908390613bef565b33600081815260ce602052604090819020929092559051829184917f51088b8c89628df3a8174002c2a034d0152fce6af8415d651b2a4734bf27048290610dae908890613c07565b60405180910390a4610de0333060408601803590610dcf90602089016135a9565b6001600160a01b03169291906128e9565b5050508080610dee90613c1a565b915050610cba565b505060016097555050565b60665460029060049081161415610e2a5760405162461bcd60e51b81526004016109fd90613a0c565b60026097541415610e4d5760405162461bcd60e51b81526004016109fd90613a43565b6002609755600060ca610e63602086018661379c565b63ffffffff1681548110610e7957610e79613913565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff16151560608201529050610eda848261295a565b6000610eec60808601606087016135a9565b6001600160a01b03808216600090815260cc60205260409020549192501680610f125750805b336001600160a01b03821614610f905760405162461bcd60e51b815260206004820152603c60248201527f52657761726473436f6f7264696e61746f722e70726f63657373436c61696d3a60448201527f2063616c6c6572206973206e6f742076616c696420636c61696d65720000000060648201526084016109fd565b60005b610fa060a0880188613c35565b90508110156111b75736610fb760e0890189613c86565b83818110610fc757610fc7613913565b6001600160a01b038716600090815260cd602090815260408083209302949094019450929091508290610ffc908501856135a9565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050808260200135116110b65760405162461bcd60e51b815260206004820152605560248201527f52657761726473436f6f7264696e61746f722e70726f63657373436c61696d3a60448201527f2063756d756c61746976654561726e696e6773206d75737420626520677420746064820152741a185b8818dd5b5d5b185d1a5d9950db185a5b5959605a1b608482015260a4016109fd565b60006110c68260208501356138fc565b6001600160a01b038716600090815260cd602090815260408220929350850180359291906110f490876135a9565b6001600160a01b0316815260208082019290925260400160002091909155611136908a908390611126908701876135a9565b6001600160a01b03169190612c26565b86516001600160a01b03808b1691878216918916907f9543dbd55580842586a951f0386e24d68a5df99ae29e3b216588b45fd684ce319061117a60208901896135a9565b604080519283526001600160a01b039091166020830152810186905260600160405180910390a450505080806111af90613c1a565b915050610f93565b505060016097555050505050565b606654600390600890811614156111ee5760405162461bcd60e51b81526004016109fd90613a0c565b60cb546001600160a01b031633146112185760405162461bcd60e51b81526004016109fd90613cd0565b60cb5463ffffffff600160c01b9091048116908316116112b45760405162461bcd60e51b815260206004820152604b60248201527f52657761726473436f6f7264696e61746f722e7375626d6974526f6f743a206e60448201527f657720726f6f74206d75737420626520666f72206e657765722063616c63756c60648201526a185d1959081c195c9a5bd960aa1b608482015260a4016109fd565b428263ffffffff161061134d5760405162461bcd60e51b815260206004820152605560248201527f52657761726473436f6f7264696e61746f722e7375626d6974526f6f743a207260448201527f65776172647343616c63756c6174696f6e456e6454696d657374616d702063616064820152746e6e6f7420626520696e207468652066757475726560581b608482015260a4016109fd565b60ca5460cb5460009061136d90600160a01b900463ffffffff1642613d24565b6040805160808101825287815263ffffffff878116602080840182815286841685870181815260006060880181815260ca8054600181018255925297517f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee160029092029182015592517f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee290930180549151975193871667ffffffffffffffff1990921691909117600160201b978716979097029690961760ff60401b1916600160401b921515929092029190911790945560cb805463ffffffff60c01b1916600160c01b840217905593519283529394508892908616917fecd866c3c158fa00bf34d803d5f6023000b57080bcb48af004c2b4b46b3afd08910160405180910390a45050505050565b61149e611fc0565b610a0f81612c56565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156114ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151391906139a7565b61152f5760405162461bcd60e51b81526004016109fd906139c4565b600019606681905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b60006115f38260ca611583602083018361379c565b63ffffffff168154811061159957611599613913565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff161515606082015261295a565b506001919050565b611603611fc0565b61160d6000612cc7565b565b611617611fc0565b610a0f81612d19565b60408051608081018252600080825260208201819052918101829052606081019190915260ca8054611654906001906138fc565b8154811061166457611664613913565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff1615156060820152919050565b33600081815260cc602052604080822080546001600160a01b031981166001600160a01b038781169182179093559251911692839185917fbab947934d42e0ad206f25c9cab18b5bb6ae144acfb00f40b4e3aa59590ca31291a4505050565b600054610100900460ff161580801561173d5750600054600160ff909116105b806117575750303b158015611757575060005460ff166001145b6117ba5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016109fd565b6000805460ff1916600117905580156117dd576000805461ff0019166101001790555b6117e5612d75565b60c9556117f28686612e0c565b6117fb87612cc7565b61180484612d19565b61180d83612c56565b61181682612ef6565b801561185c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b60408051608081018252600080825260208201819052918101829052606081019190915260ca828154811061189c5761189c613913565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff161515606082015292915050565b6118ff611fc0565b610a0f81612ef6565b60ca546000905b63ffffffff81161561197b578260ca611929600184613d4c565b63ffffffff168154811061193f5761193f613913565b906000526020600020906002020160000154141561196957611962600182613d4c565b9392505050565b8061197381613d71565b91505061190f565b5060405162461bcd60e51b815260206004820152603760248201527f52657761726473436f6f7264696e61746f722e676574526f6f74496e6465784660448201527f726f6d486173683a20726f6f74206e6f7420666f756e6400000000000000000060648201526084016109fd565b6119f2611fc0565b6001600160a01b038116611a575760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109fd565b610a0f81612cc7565b60007f0000000000000000000000000000000000000000000000000000000000000000461415611a91575060c95490565b611a99612d75565b905090565b60006001610b6160208401846135a9565b60665460039060089081161415611ad85760405162461bcd60e51b81526004016109fd90613a0c565b60cb546001600160a01b03163314611b025760405162461bcd60e51b81526004016109fd90613cd0565b60ca5463ffffffff831610611b735760405162461bcd60e51b815260206004820152603160248201527f52657761726473436f6f7264696e61746f722e64697361626c65526f6f743a206044820152700d2dcecc2d8d2c840e4dedee892dcc8caf607b1b60648201526084016109fd565b600060ca8363ffffffff1681548110611b8e57611b8e613913565b906000526020600020906002020190508060010160089054906101000a900460ff1615611c1b5760405162461bcd60e51b815260206004820152603560248201527f52657761726473436f6f7264696e61746f722e64697361626c65526f6f743a206044820152741c9bdbdd08185b1c9958591e48191a5cd8589b1959605a1b60648201526084016109fd565b6001810154600160201b900463ffffffff164210611c9a5760405162461bcd60e51b815260206004820152603660248201527f52657761726473436f6f7264696e61746f722e64697361626c65526f6f743a206044820152751c9bdbdd08185b1c9958591e481858dd1a5d985d195960521b60648201526084016109fd565b60018101805460ff60401b1916600160401b17905560405163ffffffff8416907fd850e6e5dfa497b72661fa73df2923464eaed9dc2ff1d3cb82bccbfeabe5c41e90600090a2505050565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5c9190613940565b6001600160a01b0316336001600160a01b031614611d8c5760405162461bcd60e51b81526004016109fd9061395d565b606654198119606654191614611e0a5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c697479000000000000000060648201526084016109fd565b606681905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610b46565b60665460009060019081161415611e6a5760405162461bcd60e51b81526004016109fd90613a0c565b60026097541415611e8d5760405162461bcd60e51b81526004016109fd90613a43565b600260975560005b82811015610df65736848483818110611eb057611eb0613913565b9050602002810190611ec29190613a7a565b33600081815260ce60209081526040808320549051949550939192611eed9290918591879101613bbf565b604051602081830303815290604052805190602001209050611f0e83612111565b33600090815260cf602090815260408083208484529091529020805460ff19166001908117909155611f41908390613bef565b33600081815260ce602052604090819020929092559051829184917f450a367a380c4e339e5ae7340c8464ef27af7781ad9945cfe8abd828f89e628190611f89908890613c07565b60405180910390a4611faa333060408601803590610dcf90602089016135a9565b5050508080611fb890613c1a565b915050611e95565b6033546001600160a01b0316331461160d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109fd565b6001600160a01b0381166120a85760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a4016109fd565b606554604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b600061211d8280613c86565b905011612182576040805162461bcd60e51b8152602060048201526024810191909152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a206e6f20737472617465676965732073657460648201526084016109fd565b60008160400135116121f45760405162461bcd60e51b81526020600482015260416024820152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a20616d6f756e742063616e6e6f74206265206064820152600360fc1b608482015260a4016109fd565b6f4b3b4ca85a86c47a098a223fffffffff8160400135111561226c5760405162461bcd60e51b815260206004820152603f6024820152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a20616d6f756e7420746f6f206c617267650060648201526084016109fd565b63ffffffff7f0000000000000000000000000000000000000000000000000000000000000000166122a360a083016080840161379c565b63ffffffff1611156123285760405162461bcd60e51b81526020600482015260546024820152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a206475726174696f6e20657863656564732060648201527326a0ac2fa922aba0a92229afa22aa920aa24a7a760611b608482015260a4016109fd565b7f000000000000000000000000000000000000000000000000000000000000000061235960a083016080840161379c565b6123639190613da7565b63ffffffff16156124035760405162461bcd60e51b815260206004820152606a6024820152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a206475726174696f6e206d7573742062652060648201527f61206d756c7469706c65206f662043414c43554c4154494f4e5f494e54455256608482015269414c5f5345434f4e445360b01b60a482015260c4016109fd565b7f0000000000000000000000000000000000000000000000000000000000000000612434608083016060840161379c565b61243e9190613da7565b63ffffffff16156124e45760405162461bcd60e51b81526020600482015260706024820152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a20737461727454696d657374616d70206d7560648201527f73742062652061206d756c7469706c65206f662043414c43554c4154494f4e5f60848201526f494e54455256414c5f5345434f4e445360801b60a482015260c4016109fd565b6124f4608082016060830161379c565b63ffffffff167f000000000000000000000000000000000000000000000000000000000000000063ffffffff164261252c91906138fc565b111580156125755750612545608082016060830161379c565b63ffffffff167f000000000000000000000000000000000000000000000000000000000000000063ffffffff1611155b6125ef5760405162461bcd60e51b81526020600482015260516024820152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a20737461727454696d657374616d7020746f6064820152701bc819985c881a5b881d1a19481c185cdd607a1b608482015260a4016109fd565b61261f63ffffffff7f00000000000000000000000000000000000000000000000000000000000000001642613bef565b61262f608083016060840161379c565b63ffffffff1611156126b35760405162461bcd60e51b81526020600482015260536024820152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a20737461727454696d657374616d7020746f6064820152726f2066617220696e207468652066757475726560681b608482015260a4016109fd565b6000805b6126c18380613c86565b90508110156128e45760006126d68480613c86565b838181106126e6576126e6613913565b6126fc92602060409092020190810191506135a9565b60405163198f077960e21b81526001600160a01b0380831660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063663c1de490602401602060405180830381865afa158015612767573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061278b91906139a7565b806127b257506001600160a01b03811673beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0145b6128255760405162461bcd60e51b815260206004820152604a6024820152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a20696e76616c69642073747261746567792060648201526918dbdb9cda59195c995960b21b608482015260a4016109fd565b806001600160a01b0316836001600160a01b0316106128d25760405162461bcd60e51b81526020600482015260696024820152600080516020613ecb83398151915260448201527f7264735375626d697373696f6e3a2073747261746567696573206d757374206260648201527f6520696e20617363656e64696e67206f7264657220746f2068616e646c65206460848201526875706c69636174657360b81b60a482015260c4016109fd565b91506128dd81613c1a565b90506126b7565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526129549085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612f61565b50505050565b8060600151156129b35760405162461bcd60e51b81526020600482015260306024820152600080516020613eab83398151915260448201526f1c9bdbdd081a5cc8191a5cd8589b195960821b60648201526084016109fd565b806040015163ffffffff16421015612a1a5760405162461bcd60e51b81526020600482015260366024820152600080516020613eab8339815191526044820152751c9bdbdd081b9bdd081858dd1a5d985d1959081e595d60521b60648201526084016109fd565b612a2760c0830183613c35565b9050612a3660a0840184613c35565b905014612aae5760405162461bcd60e51b815260206004820152604c6024820152600080516020613eab83398151915260448201527f746f6b656e496e646963657320616e6420746f6b656e50726f6f6673206c656e60648201526b0cee8d040dad2e6dac2e8c6d60a31b608482015260a4016109fd565b612abb60e0830183613c86565b9050612aca60c0840184613c35565b905014612b405760405162461bcd60e51b815260206004820152604a6024820152600080516020613eab83398151915260448201527f746f6b656e5472656550726f6f667320616e64206c6561766573206c656e67746064820152690d040dad2e6dac2e8c6d60b31b608482015260a4016109fd565b8051612b6c90612b56604085016020860161379c565b612b636040860186613dca565b86606001613033565b60005b612b7c60a0840184613c35565b90508110156128e457612c166080840135612b9a60a0860186613c35565b84818110612baa57612baa613913565b9050602002016020810190612bbf919061379c565b612bcc60c0870187613c35565b85818110612bdc57612bdc613913565b9050602002810190612bee9190613dca565b612bfb60e0890189613c86565b87818110612c0b57612c0b613913565b9050604002016131a7565b612c1f81613c1a565b9050612b6f565b6040516001600160a01b0383166024820152604481018290526128e490849063a9059cbb60e01b9060640161291d565b60cb546040805163ffffffff600160a01b9093048316815291831660208301527faf557c6c02c208794817a705609cfa935f827312a1adfdd26494b6b95dd2b4b3910160405180910390a160cb805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60cb546040516001600160a01b038084169216907f237b82f438d75fc568ebab484b75b01d9287b9e98b490b7c23221623b6705dbb90600090a360cb80546001600160a01b0319166001600160a01b0392909216919091179055565b604080518082018252600a81526922b4b3b2b72630bcb2b960b11b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea81840152466060820152306080808301919091528351808303909101815260a0909101909252815191012090565b6065546001600160a01b0316158015612e2d57506001600160a01b03821615155b612eaf5760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a4016109fd565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2612ef28261201a565b5050565b60cb546040805161ffff600160e01b9093048316815291831660208301527f8cdc428b0431b82d1619763f443a48197db344ba96905f3949643acd1c863a06910160405180910390a160cb805461ffff909216600160e01b0261ffff60e01b19909216919091179055565b6000612fb6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166132f89092919063ffffffff16565b8051909150156128e45780806020019051810190612fd491906139a7565b6128e45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016109fd565b61303e602083613e11565b6001901b8463ffffffff16106130c85760405162461bcd60e51b815260206004820152604360248201527f52657761726473436f6f7264696e61746f722e5f7665726966794561726e657260448201527f436c61696d50726f6f663a20696e76616c6964206561726e65724c656166496e6064820152620c8caf60eb1b608482015260a4016109fd565b60006130d382610b51565b905061311e84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92508591505063ffffffff891661330f565b61319f5760405162461bcd60e51b815260206004820152604660248201527f52657761726473436f6f7264696e61746f722e5f7665726966794561726e657260448201527f436c61696d50726f6f663a20696e76616c6964206561726e657220636c61696d60648201526510383937b7b360d11b608482015260a4016109fd565b505050505050565b6131b2602083613e11565b6001901b8463ffffffff16106132305760405162461bcd60e51b815260206004820152603c60248201527f52657761726473436f6f7264696e61746f722e5f766572696679546f6b656e4360448201527f6c61696d3a20696e76616c696420746f6b656e4c656166496e6465780000000060648201526084016109fd565b600061323b82611a9e565b905061328684848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92508591505063ffffffff891661330f565b61319f5760405162461bcd60e51b815260206004820152603f60248201527f52657761726473436f6f7264696e61746f722e5f766572696679546f6b656e4360448201527f6c61696d3a20696e76616c696420746f6b656e20636c61696d2070726f6f660060648201526084016109fd565b60606133078484600085613327565b949350505050565b60008361331d868585613458565b1495945050505050565b6060824710156133885760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016109fd565b6001600160a01b0385163b6133df5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109fd565b600080866001600160a01b031685876040516133fb9190613e51565b60006040518083038185875af1925050503d8060008114613438576040519150601f19603f3d011682016040523d82523d6000602084013e61343d565b606091505b509150915061344d82828661355b565b979650505050505050565b6000602084516134689190613e63565b156134ef5760405162461bcd60e51b815260206004820152604b60248201527f4d65726b6c652e70726f63657373496e636c7573696f6e50726f6f664b65636360448201527f616b3a2070726f6f66206c656e6774682073686f756c642062652061206d756c60648201526a3a34b836329037b310199960a91b608482015260a4016109fd565b8260205b8551811161355257613506600285613e63565b61352757816000528086015160205260406000209150600284049350613540565b8086015160005281602052604060002091506002840493505b61354b602082613bef565b90506134f3565b50949350505050565b6060831561356a575081611962565b82511561357a5782518084602001fd5b8160405162461bcd60e51b81526004016109fd9190613e77565b6001600160a01b0381168114610a0f57600080fd5b6000602082840312156135bb57600080fd5b813561196281613594565b8015158114610a0f57600080fd5b600080604083850312156135e757600080fd5b82356135f281613594565b91506020830135613602816135c6565b809150509250929050565b60006020828403121561361f57600080fd5b5035919050565b60006040828403121561363857600080fd5b50919050565b60006040828403121561365057600080fd5b6119628383613626565b6000806040838503121561366d57600080fd5b823561367881613594565b9150602083013561360281613594565b6000806020838503121561369b57600080fd5b823567ffffffffffffffff808211156136b357600080fd5b818501915085601f8301126136c757600080fd5b8135818111156136d657600080fd5b8660208260051b85010111156136eb57600080fd5b60209290920196919550909350505050565b6000610100828403121561363857600080fd5b6000806040838503121561372357600080fd5b823567ffffffffffffffff81111561373a57600080fd5b613746858286016136fd565b925050602083013561360281613594565b803563ffffffff8116811461376b57600080fd5b919050565b6000806040838503121561378357600080fd5b8235915061379360208401613757565b90509250929050565b6000602082840312156137ae57600080fd5b61196282613757565b6000602082840312156137c957600080fd5b813560ff8116811461196257600080fd5b6000602082840312156137ec57600080fd5b813567ffffffffffffffff81111561380357600080fd5b613307848285016136fd565b6000806040838503121561382257600080fd5b823561382d81613594565b946020939093013593505050565b803561376b81613594565b803561ffff8116811461376b57600080fd5b60008060008060008060c0878903121561387157600080fd5b863561387c81613594565b9550602087013561388c81613594565b94506040870135935060608701356138a381613594565b92506138b160808801613757565b91506138bf60a08801613846565b90509295509295509295565b6000602082840312156138dd57600080fd5b61196282613846565b634e487b7160e01b600052601160045260246000fd5b60008282101561390e5761390e6138e6565b500390565b634e487b7160e01b600052603260045260246000fd5b600081613938576139386138e6565b506000190190565b60006020828403121561395257600080fd5b815161196281613594565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b6000602082840312156139b957600080fd5b8151611962816135c6565b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b60208082526019908201527f5061757361626c653a20696e6465782069732070617573656400000000000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008235609e19833603018112613a9057600080fd5b9190910192915050565b818352600060208085019450826000805b86811015613aff578235613abe81613594565b6001600160a01b03168852828401356bffffffffffffffffffffffff8116808214613ae7578384fd5b89860152506040978801979290920191600101613aab565b50959695505050505050565b60008135601e19833603018112613b2157600080fd5b8201803567ffffffffffffffff811115613b3a57600080fd5b8060061b3603841315613b4c57600080fd5b60a08552613b6160a086018260208501613a9a565b915050613b706020840161383b565b6001600160a01b0316602085015260408381013590850152613b9460608401613757565b63ffffffff166060850152613bab60808401613757565b63ffffffff81166080860152509392505050565b60018060a01b0384168152826020820152606060408201526000613be66060830184613b0b565b95945050505050565b60008219821115613c0257613c026138e6565b500190565b6020815260006119626020830184613b0b565b6000600019821415613c2e57613c2e6138e6565b5060010190565b6000808335601e19843603018112613c4c57600080fd5b83018035915067ffffffffffffffff821115613c6757600080fd5b6020019150600581901b3603821315613c7f57600080fd5b9250929050565b6000808335601e19843603018112613c9d57600080fd5b83018035915067ffffffffffffffff821115613cb857600080fd5b6020019150600681901b3603821315613c7f57600080fd5b60208082526034908201527f52657761726473436f6f7264696e61746f723a2063616c6c6572206973206e6f6040820152733a103a3432903932bbb0b93239aab83230ba32b960611b606082015260800190565b600063ffffffff808316818516808303821115613d4357613d436138e6565b01949350505050565b600063ffffffff83811690831681811015613d6957613d696138e6565b039392505050565b600063ffffffff821680613d8757613d876138e6565b6000190192915050565b634e487b7160e01b600052601260045260246000fd5b600063ffffffff80841680613dbe57613dbe613d91565b92169190910692915050565b6000808335601e19843603018112613de157600080fd5b83018035915067ffffffffffffffff821115613dfc57600080fd5b602001915036819003821315613c7f57600080fd5b600082613e2057613e20613d91565b500490565b60005b83811015613e40578181015183820152602001613e28565b838111156129545750506000910152565b60008251613a90818460208701613e25565b600082613e7257613e72613d91565b500690565b6020815260008251806020840152613e96816040850160208701613e25565b601f01601f1916919091016040019291505056fe52657761726473436f6f7264696e61746f722e5f636865636b436c61696d3a2052657761726473436f6f7264696e61746f722e5f76616c696461746552657761a26469706673582212206e1c7ffbc44e160aa4dfbce68ac84c87a709926daf34ffdd46bb6bbef7a2c10564736f6c634300080c0033", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_delegationManager\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"},{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"},{\"name\":\"_avsDirectory\",\"type\":\"address\",\"internalType\":\"contractIAVSDirectory\"},{\"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\"},{\"name\":\"_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_OPERATOR_SET_MAX_RETROACTIVE_LENGTH\",\"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\":\"OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_SET_MAX_RETROACTIVE_LENGTH\",\"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\":\"avsDirectory\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIAVSDirectory\"}],\"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\":\"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\":\"getOperatorCommissionBips\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorCommissionUpdateHistoryLength\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"}],\"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\":\"isRewardsSubmissionForAllHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorCommissionUpdates\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"commissionBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"effectTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"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\":\"rewardOperatorSetForRange\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.OperatorSetRewardsSubmission[]\",\"components\":[{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"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\":\"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\":\"setOperatorCommissionBips\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"commissionBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[{\"name\":\"effectTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"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\":\"OperatorCommissionUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":true,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"newCommissionBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"effectTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetRewardCreated\",\"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.OperatorSetRewardsSubmission\",\"components\":[{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"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\":\"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\":\"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}]", + Bin: "0x6101e06040523480156200001257600080fd5b506040516200511f3803806200511f8339810160408190526200003591620003c0565b898989898989898989896200004b878462000497565b63ffffffff1615620000f05760405162461bcd60e51b815260206004820152606060248201527f52657761726473436f6f7264696e61746f723a2047454e455349535f5245574160448201527f5244535f54494d455354414d50206d7573742062652061206d756c7469706c6560648201527f206f662043414c43554c4154494f4e5f494e54455256414c5f5345434f4e4453608482015260a4015b60405180910390fd5b620000ff620151808862000497565b63ffffffff1615620001a05760405162461bcd60e51b815260206004820152605760248201527f52657761726473436f6f7264696e61746f723a2043414c43554c4154494f4e5f60448201527f494e54455256414c5f5345434f4e4453206d7573742062652061206d756c746960648201527f706c65206f6620534e415053484f545f434144454e4345000000000000000000608482015260a401620000e7565b620001ac878362000497565b63ffffffff1615620002635760405162461bcd60e51b815260206004820152606d60248201527f52657761726473436f6f7264696e61746f723a204f50455241544f525f53455460448201527f5f47454e455349535f524557415244535f54494d455354414d50206d7573742060648201527f62652061206d756c7469706c65206f662043414c43554c4154494f4e5f494e5460848201526c455256414c5f5345434f4e445360981b60a482015260c401620000e7565b6001600160a01b03998a166101605297891661018052959097166101a05263ffffffff93841660805291831660a052821661010052811660c05292831660e0528216610120521661014052620002b8620002ce565b5050466101c05250620004c99650505050505050565b600054610100900460ff1615620003385760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401620000e7565b60005460ff90811610156200038b576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b0381168114620003a357600080fd5b50565b805163ffffffff81168114620003bb57600080fd5b919050565b6000806000806000806000806000806101408b8d031215620003e157600080fd5b8a51620003ee816200038d565b60208c0151909a5062000401816200038d565b60408c015190995062000414816200038d565b97506200042460608c01620003a6565b96506200043460808c01620003a6565b95506200044460a08c01620003a6565b94506200045460c08c01620003a6565b93506200046460e08c01620003a6565b9250620004756101008c01620003a6565b9150620004866101208c01620003a6565b90509295989b9194979a5092959850565b600063ffffffff80841680620004bd57634e487b7160e01b600052601260045260246000fd5b92169190910692915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051614b896200059660003960006124e80152600081816106970152610e1c01526000818161059d01526130d9015260006108e801526000818161053c0152610f930152600081816108750152610fb4015260008181610576015261124701526000818161048d01526112680152600081816103b90152612fd601526000818161080d0152612cda0152600081816107b301528181612d8a0152612e540152614b896000f3fe608060405234801561001057600080fd5b50600436106103775760003560e01c8063715018a6116101d3578063c46db60611610104578063f2fde38b116100a2578063f96abf2e1161007c578063f96abf2e14610938578063fabc1cbc1461094b578063fbf1e2c11461095e578063fce36c7d1461097157600080fd5b8063f2fde38b1461090a578063f698da251461091d578063f8cd84481461092557600080fd5b8063de02e503116100de578063de02e503146108aa578063e221b245146108bd578063e810ce21146108d0578063ea4d3c9b146108e357600080fd5b8063c46db60614610842578063d11e9ae514610870578063d4540a551461089757600080fd5b80639104c31911610171578063a0169ddd1161014b578063a0169ddd146107d5578063bb7e451f146107e8578063bf21a8aa14610808578063c336f19d1461082f57600080fd5b80639104c3191461078b5780639be3d4e4146107a65780639d45c281146107ae57600080fd5b8063863cb9a9116101ad578063863cb9a914610729578063865c69531461073c578063886f1195146107675780638da5cb5b1461077a57600080fd5b8063715018a6146106e75780637adace91146106ef5780637b8f8b051461072157600080fd5b806339b70e38116102ad57806358baaa3e1161024b5780635c975abb116102255780635c975abb146106775780635e9d83481461067f5780636b3aa72e146106925780636d21117e146106b957600080fd5b806358baaa3e14610639578063595c6a671461064c5780635ac86ab71461065457600080fd5b80633ccc861d116102875780633ccc861d146105e95780633efe1db6146105fc5780634d18cc351461060f5780634d7a80d41461062657600080fd5b806339b70e38146105985780633a8c0786146105bf5780633c8fcf7c146105d657600080fd5b8063136439dd1161031a5780632c9c60cf116102f45780632c9c60cf146105245780633486e32e1461053757806336af41fa1461055e57806337838ed01461057157600080fd5b8063136439dd146104af578063149bc872146104c25780632b9f64a4146104e357600080fd5b80630e9a53cf116103565780630e9a53cf146104185780630eb383451461046057806310d67a2f14610475578063131433b41461048857600080fd5b806218572c1461037c57806304a0c502146103b4578063092db007146103f0575b600080fd5b61039f61038a366004613f70565b60d16020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020016103ab565b60cb5461040590600160e01b900461ffff1681565b60405161ffff90911681526020016103ab565b610420610984565b604080518251815260208084015163ffffffff908116918301919091528383015116918101919091526060918201511515918101919091526080016103ab565b61047361046e366004613f9b565b610a63565b005b610473610483366004613f70565b610ae5565b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b6104736104bd366004613fd4565b610ba1565b6104d56104d0366004614005565b610ce0565b6040519081526020016103ab565b61050c6104f1366004613f70565b60cc602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016103ab565b61047361053236600461406d565b610d56565b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b61047361056c36600461406d565b61109e565b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b61050c7f000000000000000000000000000000000000000000000000000000000000000081565b60cb546103db90600160a01b900463ffffffff1681565b6103db6105e43660046140d5565b611336565b6104736105f736600461412c565b6115c4565b61047361060a366004614187565b611986565b60cb546103db90600160c01b900463ffffffff1681565b6104056106343660046141b3565b611c57565b6104736106473660046141f0565b611e06565b610473611e17565b61039f61066236600461420b565b606654600160ff9092169190911b9081161490565b6066546104d5565b61039f61068d36600461422e565b611ede565b61050c7f000000000000000000000000000000000000000000000000000000000000000081565b61039f6106c7366004614263565b60cf60209081526000928352604080842090915290825290205460ff1681565b610473611f6b565b6107026106fd36600461428f565b611f7f565b6040805161ffff909316835263ffffffff9091166020830152016103ab565b60ca546104d5565b610473610737366004613f70565b611fe7565b6104d561074a3660046142ef565b60cd60209081526000928352604080842090915290825290205481565b60655461050c906001600160a01b031681565b6033546001600160a01b031661050c565b61050c73beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac081565b610420611ff8565b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b6104736107e3366004613f70565b612096565b6104d56107f6366004613f70565b60ce6020526000908152604090205481565b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b6104d561083d3660046141b3565b6120f5565b61039f610850366004614263565b60d060209081526000928352604080842090915290825290205460ff1681565b6103db7f000000000000000000000000000000000000000000000000000000000000000081565b6104736108a536600461431d565b6121a8565b6104206108b8366004613fd4565b6122f0565b6104736108cb366004614390565b612382565b6103db6108de366004613fd4565b612393565b61050c7f000000000000000000000000000000000000000000000000000000000000000081565b610473610918366004613f70565b61246e565b6104d56124e4565b6104d5610933366004614005565b612522565b6104736109463660046141f0565b612533565b610473610959366004613fd4565b612769565b60cb5461050c906001600160a01b031681565b61047361097f36600461406d565b6128c5565b60408051608081018252600080825260208201819052918101829052606081019190915260ca545b8015610a5f57600060ca6109c16001846143c1565b815481106109d1576109d16143d8565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff161580156060830181905291925090610a415750806040015163ffffffff164210155b15610a4c5792915050565b5080610a57816143ee565b9150506109ac565b5090565b610a6b612a42565b6001600160a01b038216600081815260d1602052604080822054905160ff9091169284151592841515927f4de6293e668df1398422e1def12118052c1539a03cbfedc145895d48d7685f1c9190a4506001600160a01b0391909116600090815260d160205260409020805460ff1916911515919091179055565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5c9190614405565b6001600160a01b0316336001600160a01b031614610b955760405162461bcd60e51b8152600401610b8c90614422565b60405180910390fd5b610b9e81612a9c565b50565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d919061446c565b610c295760405162461bcd60e51b8152600401610b8c90614489565b60665481811614610ca25760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610b8c565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600080610cf06020840184613f70565b8360200135604051602001610d399392919060f89390931b6001600160f81b031916835260609190911b6bffffffffffffffffffffffff19166001830152601582015260350190565b604051602081830303815290604052805190602001209050919050565b60665460049060109081161415610d7f5760405162461bcd60e51b8152600401610b8c906144d1565b60026097541415610da25760405162461bcd60e51b8152600401610b8c90614508565b600260975560005b828110156110935736848483818110610dc557610dc56143d8565b9050602002810190610dd7919061453f565b33600081815260ce60209081526040808320549051949550939192610e0292909185918791016146fc565b6040516020818303038152906040528051906020012090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166384d76f7b33856020016020810190610e5d91906141f0565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015263ffffffff166024820152604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061446c565b610f4c5760405162461bcd60e51b815260206004820152604160248201527f52657761726473436f6f7264696e61746f722e7265776172644f70657261746f60448201527f72536574466f7252616e67653a20696e76616c6964206f70657261746f7253656064820152601d60fa1b608482015260a401610b8c565b610fd8610f5c604085018561472c565b610f6c6080870160608801613f70565b6080870135610f8160c0890160a08a016141f0565b610f9160e08a0160c08b016141f0565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b93565b33600090815260cf602090815260408083208484529091529020805460ff1916600190811790915561100b908390614776565b33600081815260ce602052604090819020929092559051829184917f29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b29061105390889061478e565b60405180910390a46110853330608086018035906110749060608901613f70565b6001600160a01b03169291906132ab565b836001019350505050610daa565b505060016097555050565b606654600190600290811614156110c75760405162461bcd60e51b8152600401610b8c906144d1565b33600090815260d1602052604090205460ff166111665760405162461bcd60e51b815260206004820152605160248201527f52657761726473436f6f7264696e61746f723a2063616c6c6572206973206e6f60448201527f7420612076616c69642063726561746552657761726473466f72416c6c53756260648201527036b4b9b9b4b7b71039bab136b4ba3a32b960791b608482015260a401610b8c565b600260975414156111895760405162461bcd60e51b8152600401610b8c90614508565b600260975560005b8281101561109357368484838181106111ac576111ac6143d8565b90506020028101906111be91906147a1565b33600081815260ce602090815260408083205490519495509391926111e99290918591879101614836565b60408051601f198184030181529190528051602090910120905061128c611210848061472c565b6112206040870160208801613f70565b60408701356112356080890160608a016141f0565b61124560a08a0160808b016141f0565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612b93565b33600090815260d0602090815260408083208484529091529020805460ff191660019081179091556112bf908390614776565b33600081815260ce602052604090819020929092559051829184917f51088b8c89628df3a8174002c2a034d0152fce6af8415d651b2a4734bf2704829061130790889061485d565b60405180910390a46113283330604086018035906110749060208901613f70565b836001019350505050611191565b600061271061ffff831611156113c25760405162461bcd60e51b815260206004820152604560248201527f52657761726473436f6f7264696e61746f722e7365744f70657261746f72436f60448201527f6d6d697373696f6e426970733a20636f6d6d697373696f6e4269707320746f6f606482015264040d0d2ced60db1b608482015260a401610b8c565b6113cf62093a8042614776565b33600090815260d360209081526040822092935090919082906113f490880188613f70565b6001600160a01b03166001600160a01b03168152602001908152602001600020600086602001602081019061142991906141f0565b63ffffffff1663ffffffff16815260200190815260200160002060008560008111156114575761145761455f565b80156114655761146561455f565b8152602081019190915260400160002080549091508015806114c0575063ffffffff8316826114956001846143c1565b815481106114a5576114a56143d8565b60009182526020909120015462010000900463ffffffff1614155b15611523576040805180820190915261ffff808616825263ffffffff808616602080850191825286546001810188556000888152919091209451940180549151909216620100000265ffffffffffff199091169390921692909217179055611560565b83826115306001846143c1565b81548110611540576115406143d8565b6000918252602090912001805461ffff191661ffff929092169190911790555b8560405161156e9190614870565b6040518091039020336001600160a01b03167f811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba8787876040516115b3939291906148a8565b60405180910390a350509392505050565b606654600290600490811614156115ed5760405162461bcd60e51b8152600401610b8c906144d1565b600260975414156116105760405162461bcd60e51b8152600401610b8c90614508565b6002609755600060ca61162660208601866141f0565b63ffffffff168154811061163c5761163c6143d8565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff1615156060820152905061169d848261331c565b60006116af6080860160608701613f70565b6001600160a01b03808216600090815260cc602052604090205491925016806116d55750805b336001600160a01b038216146117535760405162461bcd60e51b815260206004820152603c60248201527f52657761726473436f6f7264696e61746f722e70726f63657373436c61696d3a60448201527f2063616c6c6572206973206e6f742076616c696420636c61696d6572000000006064820152608401610b8c565b60005b61176360a08801886148d4565b9050811015611978573661177a60e089018961472c565b8381811061178a5761178a6143d8565b6001600160a01b038716600090815260cd6020908152604080832093029490940194509290915082906117bf90850185613f70565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050808260200135116118795760405162461bcd60e51b815260206004820152605560248201527f52657761726473436f6f7264696e61746f722e70726f63657373436c61696d3a60448201527f2063756d756c61746976654561726e696e6773206d75737420626520677420746064820152741a185b8818dd5b5d5b185d1a5d9950db185a5b5959605a1b608482015260a401610b8c565b60006118898260208501356143c1565b6001600160a01b038716600090815260cd602090815260408220929350850180359291906118b79087613f70565b6001600160a01b03168152602080820192909252604001600020919091556118f9908a9083906118e990870187613f70565b6001600160a01b031691906135ed565b86516001600160a01b03808b1691878216918916907f9543dbd55580842586a951f0386e24d68a5df99ae29e3b216588b45fd684ce319061193d6020890189613f70565b604080519283526001600160a01b039091166020830152810186905260600160405180910390a4505050806119719061491e565b9050611756565b505060016097555050505050565b606654600390600890811614156119af5760405162461bcd60e51b8152600401610b8c906144d1565b60cb546001600160a01b031633146119d95760405162461bcd60e51b8152600401610b8c90614939565b60cb5463ffffffff600160c01b909104811690831611611a755760405162461bcd60e51b815260206004820152604b60248201527f52657761726473436f6f7264696e61746f722e7375626d6974526f6f743a206e60448201527f657720726f6f74206d75737420626520666f72206e657765722063616c63756c60648201526a185d1959081c195c9a5bd960aa1b608482015260a401610b8c565b428263ffffffff1610611b0e5760405162461bcd60e51b815260206004820152605560248201527f52657761726473436f6f7264696e61746f722e7375626d6974526f6f743a207260448201527f65776172647343616c63756c6174696f6e456e6454696d657374616d702063616064820152746e6e6f7420626520696e207468652066757475726560581b608482015260a401610b8c565b60ca5460cb54600090611b2e90600160a01b900463ffffffff164261498d565b6040805160808101825287815263ffffffff878116602080840182815286841685870181815260006060880181815260ca8054600181018255925297517f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee160029092029182015592517f42d72674974f694b5f5159593243114d38a5c39c89d6b62fee061ff523240ee290930180549151975193871667ffffffffffffffff1990921691909117600160201b978716979097029690961760ff60401b1916600160401b921515929092029190911790945560cb805463ffffffff60c01b1916600160c01b840217905593519283529394508892908616917fecd866c3c158fa00bf34d803d5f6023000b57080bcb48af004c2b4b46b3afd08910160405180910390a45050505050565b60cb546001600160a01b038416600090815260d36020908152604082209192600160e01b900461ffff169183918290611c9290880188613f70565b6001600160a01b03166001600160a01b031681526020019081526020016000206000866020016020810190611cc791906141f0565b63ffffffff1663ffffffff1681526020019081526020016000206000856000811115611cf557611cf561455f565b8015611d0357611d0361455f565b8152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611d77576000848152602090819020604080518082019091529084015461ffff8116825262010000900463ffffffff1681830152825260019092019101611d31565b5050825192935050505b8015611df95763ffffffff421682611d9a6001846143c1565b81518110611daa57611daa6143d8565b60200260200101516020015163ffffffff1611611df05781611dcd6001836143c1565b81518110611ddd57611ddd6143d8565b6020026020010151600001519250611df9565b60001901611d81565b50909150505b9392505050565b611e0e612a42565b610b9e8161361d565b60655460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015611e5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e83919061446c565b611e9f5760405162461bcd60e51b8152600401610b8c90614489565b600019606681905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b6000611f638260ca611ef360208301836141f0565b63ffffffff1681548110611f0957611f096143d8565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff161515606082015261331c565b506001919050565b611f73612a42565b611f7d600061368e565b565b60d36020528460005260406000206020528360005260406000206020528260005260406000206020528160005260406000208181548110611fbf57600080fd5b60009182526020909120015461ffff8116955062010000900463ffffffff1693508592505050565b611fef612a42565b610b9e816136e0565b60408051608081018252600080825260208201819052918101829052606081019190915260ca805461202c906001906143c1565b8154811061203c5761203c6143d8565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff1615156060820152919050565b33600081815260cc602052604080822080546001600160a01b031981166001600160a01b038781169182179093559251911692839185917fbab947934d42e0ad206f25c9cab18b5bb6ae144acfb00f40b4e3aa59590ca31291a4505050565b6001600160a01b038316600090815260d360209081526040822090829061211e90860186613f70565b6001600160a01b03166001600160a01b03168152602001908152602001600020600084602001602081019061215391906141f0565b63ffffffff1663ffffffff16815260200190815260200160002060008360008111156121815761218161455f565b801561218f5761218f61455f565b8152602081019190915260400160002054949350505050565b600054610100900460ff16158080156121c85750600054600160ff909116105b806121e25750303b1580156121e2575060005460ff166001145b6122455760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b8c565b6000805460ff191660011790558015612268576000805461ff0019166101001790555b61227061373c565b60c95561227d86866137d3565b6122868761368e565b61228f846136e0565b6122988361361d565b6122a1826138bd565b80156122e7576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b60408051608081018252600080825260208201819052918101829052606081019190915260ca8281548110612327576123276143d8565b600091825260209182902060408051608081018252600293909302909101805483526001015463ffffffff80821694840194909452600160201b810490931690820152600160401b90910460ff161515606082015292915050565b61238a612a42565b610b9e816138bd565b60ca546000905b63ffffffff8116156123ff578260ca6123b46001846149b5565b63ffffffff16815481106123ca576123ca6143d8565b90600052602060002090600202016000015414156123ed57611dff6001826149b5565b806123f7816149da565b91505061239a565b5060405162461bcd60e51b815260206004820152603760248201527f52657761726473436f6f7264696e61746f722e676574526f6f74496e6465784660448201527f726f6d486173683a20726f6f74206e6f7420666f756e640000000000000000006064820152608401610b8c565b612476612a42565b6001600160a01b0381166124db5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b8c565b610b9e8161368e565b60007f0000000000000000000000000000000000000000000000000000000000000000461415612515575060c95490565b61251d61373c565b905090565b60006001610cf06020840184613f70565b6066546003906008908116141561255c5760405162461bcd60e51b8152600401610b8c906144d1565b60cb546001600160a01b031633146125865760405162461bcd60e51b8152600401610b8c90614939565b60ca5463ffffffff8316106125f75760405162461bcd60e51b815260206004820152603160248201527f52657761726473436f6f7264696e61746f722e64697361626c65526f6f743a206044820152700d2dcecc2d8d2c840e4dedee892dcc8caf607b1b6064820152608401610b8c565b600060ca8363ffffffff1681548110612612576126126143d8565b906000526020600020906002020190508060010160089054906101000a900460ff161561269f5760405162461bcd60e51b815260206004820152603560248201527f52657761726473436f6f7264696e61746f722e64697361626c65526f6f743a206044820152741c9bdbdd08185b1c9958591e48191a5cd8589b1959605a1b6064820152608401610b8c565b6001810154600160201b900463ffffffff16421061271e5760405162461bcd60e51b815260206004820152603660248201527f52657761726473436f6f7264696e61746f722e64697361626c65526f6f743a206044820152751c9bdbdd08185b1c9958591e481858dd1a5d985d195960521b6064820152608401610b8c565b60018101805460ff60401b1916600160401b17905560405163ffffffff8416907fd850e6e5dfa497b72661fa73df2923464eaed9dc2ff1d3cb82bccbfeabe5c41e90600090a2505050565b606560009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156127bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e09190614405565b6001600160a01b0316336001600160a01b0316146128105760405162461bcd60e51b8152600401610b8c90614422565b60665419811960665419161461288e5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610b8c565b606681905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610cd5565b606654600090600190811614156128ee5760405162461bcd60e51b8152600401610b8c906144d1565b600260975414156129115760405162461bcd60e51b8152600401610b8c90614508565b600260975560005b828110156110935736848483818110612934576129346143d8565b905060200281019061294691906147a1565b33600081815260ce602090815260408083205490519495509391926129719290918591879101614836565b60408051601f1981840301815291905280516020909101209050612998611210848061472c565b33600090815260cf602090815260408083208484529091529020805460ff191660019081179091556129cb908390614776565b33600081815260ce602052604090819020929092559051829184917f450a367a380c4e339e5ae7340c8464ef27af7781ad9945cfe8abd828f89e628190612a1390889061485d565b60405180910390a4612a343330604086018035906110749060208901613f70565b836001019350505050612919565b6033546001600160a01b03163314611f7d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b8c565b6001600160a01b038116612b2a5760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610b8c565b606554604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b86612bf6576040805162461bcd60e51b8152602060048201526024810191909152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a206e6f2073747261746567696573207365746064820152608401610b8c565b60008511612c645760405162461bcd60e51b81526020600482015260416024820152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a20616d6f756e742063616e6e6f74206265206064820152600360fc1b608482015260a401610b8c565b6f4b3b4ca85a86c47a098a223fffffffff851115612cd85760405162461bcd60e51b815260206004820152603f6024820152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a20616d6f756e7420746f6f206c61726765006064820152608401610b8c565b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168363ffffffff161115612d855760405162461bcd60e51b81526020600482015260546024820152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a206475726174696f6e20657863656564732060648201527326a0ac2fa922aba0a92229afa22aa920aa24a7a760611b608482015260a401610b8c565b612daf7f000000000000000000000000000000000000000000000000000000000000000084614a10565b63ffffffff1615612e4f5760405162461bcd60e51b815260206004820152606a6024820152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a206475726174696f6e206d7573742062652060648201527f61206d756c7469706c65206f662043414c43554c4154494f4e5f494e54455256608482015269414c5f5345434f4e445360b01b60a482015260c401610b8c565b612e797f000000000000000000000000000000000000000000000000000000000000000085614a10565b63ffffffff1615612f1f5760405162461bcd60e51b81526020600482015260706024820152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a20737461727454696d657374616d70206d7560648201527f73742062652061206d756c7469706c65206f662043414c43554c4154494f4e5f60848201526f494e54455256414c5f5345434f4e445360801b60a482015260c401610b8c565b8363ffffffff168263ffffffff1642612f3891906143c1565b11158015612f5257508363ffffffff168163ffffffff1611155b612fcc5760405162461bcd60e51b81526020600482015260516024820152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a20737461727454696d657374616d7020746f6064820152701bc819985c881a5b881d1a19481c185cdd607a1b608482015260a401610b8c565b612ffc63ffffffff7f00000000000000000000000000000000000000000000000000000000000000001642614776565b8463ffffffff1611156130815760405162461bcd60e51b81526020600482015260536024820152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a20737461727454696d657374616d7020746f6064820152726f2066617220696e207468652066757475726560681b608482015260a401610b8c565b6000805b8881101561329f5760008a8a838181106130a1576130a16143d8565b6130b79260206040909202019081019150613f70565b60405163198f077960e21b81526001600160a01b0380831660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063663c1de490602401602060405180830381865afa158015613122573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613146919061446c565b8061316d57506001600160a01b03811673beac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0145b6131e05760405162461bcd60e51b815260206004820152604a6024820152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a20696e76616c69642073747261746567792060648201526918dbdb9cda59195c995960b21b608482015260a401610b8c565b806001600160a01b0316836001600160a01b03161061328d5760405162461bcd60e51b81526020600482015260696024820152600080516020614b3483398151915260448201527f7264735375626d697373696f6e3a2073747261746567696573206d757374206260648201527f6520696e20617363656e64696e67206f7264657220746f2068616e646c65206460848201526875706c69636174657360b81b60a482015260c401610b8c565b91506132988161491e565b9050613085565b50505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526133169085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613928565b50505050565b8060600151156133755760405162461bcd60e51b81526020600482015260306024820152600080516020614b1483398151915260448201526f1c9bdbdd081a5cc8191a5cd8589b195960821b6064820152608401610b8c565b806040015163ffffffff164210156133dc5760405162461bcd60e51b81526020600482015260366024820152600080516020614b148339815191526044820152751c9bdbdd081b9bdd081858dd1a5d985d1959081e595d60521b6064820152608401610b8c565b6133e960c08301836148d4565b90506133f860a08401846148d4565b9050146134705760405162461bcd60e51b815260206004820152604c6024820152600080516020614b1483398151915260448201527f746f6b656e496e646963657320616e6420746f6b656e50726f6f6673206c656e60648201526b0cee8d040dad2e6dac2e8c6d60a31b608482015260a401610b8c565b61347d60e083018361472c565b905061348c60c08401846148d4565b9050146135025760405162461bcd60e51b815260206004820152604a6024820152600080516020614b1483398151915260448201527f746f6b656e5472656550726f6f667320616e64206c6561766573206c656e67746064820152690d040dad2e6dac2e8c6d60b31b608482015260a401610b8c565b805161352e9061351860408501602086016141f0565b6135256040860186614a33565b866060016139fa565b60005b61353e60a08401846148d4565b90508110156135e8576135d8608084013561355c60a08601866148d4565b8481811061356c5761356c6143d8565b905060200201602081019061358191906141f0565b61358e60c08701876148d4565b8581811061359e5761359e6143d8565b90506020028101906135b09190614a33565b6135bd60e089018961472c565b878181106135cd576135cd6143d8565b905060400201613b6e565b6135e18161491e565b9050613531565b505050565b6040516001600160a01b0383166024820152604481018290526135e890849063a9059cbb60e01b906064016132df565b60cb546040805163ffffffff600160a01b9093048316815291831660208301527faf557c6c02c208794817a705609cfa935f827312a1adfdd26494b6b95dd2b4b3910160405180910390a160cb805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60cb546040516001600160a01b038084169216907f237b82f438d75fc568ebab484b75b01d9287b9e98b490b7c23221623b6705dbb90600090a360cb80546001600160a01b0319166001600160a01b0392909216919091179055565b604080518082018252600a81526922b4b3b2b72630bcb2b960b11b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea81840152466060820152306080808301919091528351808303909101815260a0909101909252815191012090565b6065546001600160a01b03161580156137f457506001600160a01b03821615155b6138765760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610b8c565b606681905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a26138b982612a9c565b5050565b60cb546040805161ffff600160e01b9093048316815291831660208301527f8cdc428b0431b82d1619763f443a48197db344ba96905f3949643acd1c863a06910160405180910390a160cb805461ffff909216600160e01b0261ffff60e01b19909216919091179055565b600061397d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613cbf9092919063ffffffff16565b8051909150156135e8578080602001905181019061399b919061446c565b6135e85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b8c565b613a05602083614a7a565b6001901b8463ffffffff1610613a8f5760405162461bcd60e51b815260206004820152604360248201527f52657761726473436f6f7264696e61746f722e5f7665726966794561726e657260448201527f436c61696d50726f6f663a20696e76616c6964206561726e65724c656166496e6064820152620c8caf60eb1b608482015260a401610b8c565b6000613a9a82610ce0565b9050613ae584848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92508591505063ffffffff8916613cd6565b613b665760405162461bcd60e51b815260206004820152604660248201527f52657761726473436f6f7264696e61746f722e5f7665726966794561726e657260448201527f436c61696d50726f6f663a20696e76616c6964206561726e657220636c61696d60648201526510383937b7b360d11b608482015260a401610b8c565b505050505050565b613b79602083614a7a565b6001901b8463ffffffff1610613bf75760405162461bcd60e51b815260206004820152603c60248201527f52657761726473436f6f7264696e61746f722e5f766572696679546f6b656e4360448201527f6c61696d3a20696e76616c696420746f6b656e4c656166496e646578000000006064820152608401610b8c565b6000613c0282612522565b9050613c4d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92508591505063ffffffff8916613cd6565b613b665760405162461bcd60e51b815260206004820152603f60248201527f52657761726473436f6f7264696e61746f722e5f766572696679546f6b656e4360448201527f6c61696d3a20696e76616c696420746f6b656e20636c61696d2070726f6f66006064820152608401610b8c565b6060613cce8484600085613cee565b949350505050565b600083613ce4868585613e1f565b1495945050505050565b606082471015613d4f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610b8c565b6001600160a01b0385163b613da65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b8c565b600080866001600160a01b03168587604051613dc29190614aba565b60006040518083038185875af1925050503d8060008114613dff576040519150601f19603f3d011682016040523d82523d6000602084013e613e04565b606091505b5091509150613e14828286613f22565b979650505050505050565b600060208451613e2f9190614acc565b15613eb65760405162461bcd60e51b815260206004820152604b60248201527f4d65726b6c652e70726f63657373496e636c7573696f6e50726f6f664b65636360448201527f616b3a2070726f6f66206c656e6774682073686f756c642062652061206d756c60648201526a3a34b836329037b310199960a91b608482015260a401610b8c565b8260205b85518111613f1957613ecd600285614acc565b613eee57816000528086015160205260406000209150600284049350613f07565b8086015160005281602052604060002091506002840493505b613f12602082614776565b9050613eba565b50949350505050565b60608315613f31575081611dff565b825115613f415782518084602001fd5b8160405162461bcd60e51b8152600401610b8c9190614ae0565b6001600160a01b0381168114610b9e57600080fd5b600060208284031215613f8257600080fd5b8135611dff81613f5b565b8015158114610b9e57600080fd5b60008060408385031215613fae57600080fd5b8235613fb981613f5b565b91506020830135613fc981613f8d565b809150509250929050565b600060208284031215613fe657600080fd5b5035919050565b600060408284031215613fff57600080fd5b50919050565b60006040828403121561401757600080fd5b611dff8383613fed565b60008083601f84011261403357600080fd5b50813567ffffffffffffffff81111561404b57600080fd5b6020830191508360208260051b850101111561406657600080fd5b9250929050565b6000806020838503121561408057600080fd5b823567ffffffffffffffff81111561409757600080fd5b6140a385828601614021565b90969095509350505050565b8035600181106140be57600080fd5b919050565b803561ffff811681146140be57600080fd5b6000806000608084860312156140ea57600080fd5b6140f48585613fed565b9250614102604085016140af565b9150614110606085016140c3565b90509250925092565b60006101008284031215613fff57600080fd5b6000806040838503121561413f57600080fd5b823567ffffffffffffffff81111561415657600080fd5b61416285828601614119565b9250506020830135613fc981613f5b565b803563ffffffff811681146140be57600080fd5b6000806040838503121561419a57600080fd5b823591506141aa60208401614173565b90509250929050565b6000806000608084860312156141c857600080fd5b83356141d381613f5b565b92506141e28560208601613fed565b9150614110606085016140af565b60006020828403121561420257600080fd5b611dff82614173565b60006020828403121561421d57600080fd5b813560ff81168114611dff57600080fd5b60006020828403121561424057600080fd5b813567ffffffffffffffff81111561425757600080fd5b613cce84828501614119565b6000806040838503121561427657600080fd5b823561428181613f5b565b946020939093013593505050565b600080600080600060a086880312156142a757600080fd5b85356142b281613f5b565b945060208601356142c281613f5b565b93506142d060408701614173565b92506142de606087016140af565b949793965091946080013592915050565b6000806040838503121561430257600080fd5b823561430d81613f5b565b91506020830135613fc981613f5b565b60008060008060008060c0878903121561433657600080fd5b863561434181613f5b565b9550602087013561435181613f5b565b945060408701359350606087013561436881613f5b565b925061437660808801614173565b915061438460a088016140c3565b90509295509295509295565b6000602082840312156143a257600080fd5b611dff826140c3565b634e487b7160e01b600052601160045260246000fd5b6000828210156143d3576143d36143ab565b500390565b634e487b7160e01b600052603260045260246000fd5b6000816143fd576143fd6143ab565b506000190190565b60006020828403121561441757600080fd5b8151611dff81613f5b565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b60006020828403121561447e57600080fd5b8151611dff81613f8d565b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b60208082526019908201527f5061757361626c653a20696e6465782069732070617573656400000000000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000823560de1983360301811261455557600080fd5b9190910192915050565b634e487b7160e01b600052602160045260246000fd5b6001811061459357634e487b7160e01b600052602160045260246000fd5b9052565b6000808335601e198436030181126145ae57600080fd5b830160208101925035905067ffffffffffffffff8111156145ce57600080fd5b8060061b360383131561406657600080fd5b818352600060208085019450826000805b8681101561464557823561460481613f5b565b6001600160a01b03168852828401356bffffffffffffffffffffffff811680821461462d578384fd5b898601525060409788019792909201916001016145f1565b50959695505050505050565b6146638261465e836140af565b614575565b600061467160208301614173565b63ffffffff808216602086015261468b6040850185614597565b925060e060408701526146a260e0870184836145e0565b92505060608401356146b381613f5b565b6001600160a01b0316606086015260808481013590860152806146d860a08601614173565b1660a0860152806146eb60c08601614173565b1660c0860152508091505092915050565b60018060a01b03841681528260208201526060604082015260006147236060830184614651565b95945050505050565b6000808335601e1984360301811261474357600080fd5b83018035915067ffffffffffffffff82111561475e57600080fd5b6020019150600681901b360382131561406657600080fd5b60008219821115614789576147896143ab565b500190565b602081526000611dff6020830184614651565b60008235609e1983360301811261455557600080fd5b60006147c38283614597565b60a085526147d560a0860182846145e0565b91505060208301356147e681613f5b565b6001600160a01b031660208501526040838101359085015261480a60608401614173565b63ffffffff80821660608701528061482460808701614173565b16608087015250508091505092915050565b60018060a01b038416815282602082015260606040820152600061472360608301846147b7565b602081526000611dff60208301846147b7565b6000823561487d81613f5b565b6001600160a01b0316825263ffffffff61489960208501614173565b16602083015250604001919050565b606081016148b68286614575565b61ffff8416602083015263ffffffff83166040830152949350505050565b6000808335601e198436030181126148eb57600080fd5b83018035915067ffffffffffffffff82111561490657600080fd5b6020019150600581901b360382131561406657600080fd5b6000600019821415614932576149326143ab565b5060010190565b60208082526034908201527f52657761726473436f6f7264696e61746f723a2063616c6c6572206973206e6f6040820152733a103a3432903932bbb0b93239aab83230ba32b960611b606082015260800190565b600063ffffffff8083168185168083038211156149ac576149ac6143ab565b01949350505050565b600063ffffffff838116908316818110156149d2576149d26143ab565b039392505050565b600063ffffffff8216806149f0576149f06143ab565b6000190192915050565b634e487b7160e01b600052601260045260246000fd5b600063ffffffff80841680614a2757614a276149fa565b92169190910692915050565b6000808335601e19843603018112614a4a57600080fd5b83018035915067ffffffffffffffff821115614a6557600080fd5b60200191503681900382131561406657600080fd5b600082614a8957614a896149fa565b500490565b60005b83811015614aa9578181015183820152602001614a91565b838111156133165750506000910152565b60008251614555818460208701614a8e565b600082614adb57614adb6149fa565b500690565b6020815260008251806020840152614aff816040850160208701614a8e565b601f01601f1916919091016040019291505056fe52657761726473436f6f7264696e61746f722e5f636865636b436c61696d3a2052657761726473436f6f7264696e61746f722e5f76616c696461746552657761a26469706673582212209fbf169b47bf96bbb3405672cc24dbc2e1d0fa3a971f3ebcf4a73b67b9764b2664736f6c634300080c0033", } // RewardsCoordinatorABI is the input ABI used to generate the binding from. @@ -90,7 +107,7 @@ var RewardsCoordinatorABI = RewardsCoordinatorMetaData.ABI var RewardsCoordinatorBin = RewardsCoordinatorMetaData.Bin // DeployRewardsCoordinator deploys a new Ethereum contract, binding an instance of RewardsCoordinator to it. -func DeployRewardsCoordinator(auth *bind.TransactOpts, backend bind.ContractBackend, _delegationManager common.Address, _strategyManager common.Address, _CALCULATION_INTERVAL_SECONDS uint32, _MAX_REWARDS_DURATION uint32, _MAX_RETROACTIVE_LENGTH uint32, _MAX_FUTURE_LENGTH uint32, __GENESIS_REWARDS_TIMESTAMP uint32) (common.Address, *types.Transaction, *RewardsCoordinator, error) { +func DeployRewardsCoordinator(auth *bind.TransactOpts, backend bind.ContractBackend, _delegationManager common.Address, _strategyManager common.Address, _avsDirectory common.Address, _CALCULATION_INTERVAL_SECONDS uint32, _MAX_REWARDS_DURATION uint32, _MAX_RETROACTIVE_LENGTH uint32, _MAX_FUTURE_LENGTH uint32, _GENESIS_REWARDS_TIMESTAMP uint32, _OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP uint32, _OPERATOR_SET_MAX_RETROACTIVE_LENGTH uint32) (common.Address, *types.Transaction, *RewardsCoordinator, error) { parsed, err := RewardsCoordinatorMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -99,7 +116,7 @@ func DeployRewardsCoordinator(auth *bind.TransactOpts, backend bind.ContractBack return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(RewardsCoordinatorBin), backend, _delegationManager, _strategyManager, _CALCULATION_INTERVAL_SECONDS, _MAX_REWARDS_DURATION, _MAX_RETROACTIVE_LENGTH, _MAX_FUTURE_LENGTH, __GENESIS_REWARDS_TIMESTAMP) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(RewardsCoordinatorBin), backend, _delegationManager, _strategyManager, _avsDirectory, _CALCULATION_INTERVAL_SECONDS, _MAX_REWARDS_DURATION, _MAX_RETROACTIVE_LENGTH, _MAX_FUTURE_LENGTH, _GENESIS_REWARDS_TIMESTAMP, _OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, _OPERATOR_SET_MAX_RETROACTIVE_LENGTH) if err != nil { return common.Address{}, nil, nil, err } @@ -403,6 +420,68 @@ func (_RewardsCoordinator *RewardsCoordinatorCallerSession) MAXREWARDSDURATION() return _RewardsCoordinator.Contract.MAXREWARDSDURATION(&_RewardsCoordinator.CallOpts) } +// OPERATORSETGENESISREWARDSTIMESTAMP is a free data retrieval call binding the contract method 0xd11e9ae5. +// +// Solidity: function OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP() view returns(uint32) +func (_RewardsCoordinator *RewardsCoordinatorCaller) OPERATORSETGENESISREWARDSTIMESTAMP(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RewardsCoordinator.contract.Call(opts, &out, "OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// OPERATORSETGENESISREWARDSTIMESTAMP is a free data retrieval call binding the contract method 0xd11e9ae5. +// +// Solidity: function OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP() view returns(uint32) +func (_RewardsCoordinator *RewardsCoordinatorSession) OPERATORSETGENESISREWARDSTIMESTAMP() (uint32, error) { + return _RewardsCoordinator.Contract.OPERATORSETGENESISREWARDSTIMESTAMP(&_RewardsCoordinator.CallOpts) +} + +// OPERATORSETGENESISREWARDSTIMESTAMP is a free data retrieval call binding the contract method 0xd11e9ae5. +// +// Solidity: function OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP() view returns(uint32) +func (_RewardsCoordinator *RewardsCoordinatorCallerSession) OPERATORSETGENESISREWARDSTIMESTAMP() (uint32, error) { + return _RewardsCoordinator.Contract.OPERATORSETGENESISREWARDSTIMESTAMP(&_RewardsCoordinator.CallOpts) +} + +// OPERATORSETMAXRETROACTIVELENGTH is a free data retrieval call binding the contract method 0x3486e32e. +// +// Solidity: function OPERATOR_SET_MAX_RETROACTIVE_LENGTH() view returns(uint32) +func (_RewardsCoordinator *RewardsCoordinatorCaller) OPERATORSETMAXRETROACTIVELENGTH(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RewardsCoordinator.contract.Call(opts, &out, "OPERATOR_SET_MAX_RETROACTIVE_LENGTH") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// OPERATORSETMAXRETROACTIVELENGTH is a free data retrieval call binding the contract method 0x3486e32e. +// +// Solidity: function OPERATOR_SET_MAX_RETROACTIVE_LENGTH() view returns(uint32) +func (_RewardsCoordinator *RewardsCoordinatorSession) OPERATORSETMAXRETROACTIVELENGTH() (uint32, error) { + return _RewardsCoordinator.Contract.OPERATORSETMAXRETROACTIVELENGTH(&_RewardsCoordinator.CallOpts) +} + +// OPERATORSETMAXRETROACTIVELENGTH is a free data retrieval call binding the contract method 0x3486e32e. +// +// Solidity: function OPERATOR_SET_MAX_RETROACTIVE_LENGTH() view returns(uint32) +func (_RewardsCoordinator *RewardsCoordinatorCallerSession) OPERATORSETMAXRETROACTIVELENGTH() (uint32, error) { + return _RewardsCoordinator.Contract.OPERATORSETMAXRETROACTIVELENGTH(&_RewardsCoordinator.CallOpts) +} + // ActivationDelay is a free data retrieval call binding the contract method 0x3a8c0786. // // Solidity: function activationDelay() view returns(uint32) @@ -434,6 +513,37 @@ func (_RewardsCoordinator *RewardsCoordinatorCallerSession) ActivationDelay() (u return _RewardsCoordinator.Contract.ActivationDelay(&_RewardsCoordinator.CallOpts) } +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_RewardsCoordinator *RewardsCoordinatorCaller) AvsDirectory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RewardsCoordinator.contract.Call(opts, &out, "avsDirectory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_RewardsCoordinator *RewardsCoordinatorSession) AvsDirectory() (common.Address, error) { + return _RewardsCoordinator.Contract.AvsDirectory(&_RewardsCoordinator.CallOpts) +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_RewardsCoordinator *RewardsCoordinatorCallerSession) AvsDirectory() (common.Address, error) { + return _RewardsCoordinator.Contract.AvsDirectory(&_RewardsCoordinator.CallOpts) +} + // BeaconChainETHStrategy is a free data retrieval call binding the contract method 0x9104c319. // // Solidity: function beaconChainETHStrategy() view returns(address) @@ -837,6 +947,68 @@ func (_RewardsCoordinator *RewardsCoordinatorCallerSession) GetDistributionRoots return _RewardsCoordinator.Contract.GetDistributionRootsLength(&_RewardsCoordinator.CallOpts) } +// GetOperatorCommissionBips is a free data retrieval call binding the contract method 0x4d7a80d4. +// +// Solidity: function getOperatorCommissionBips(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint16) +func (_RewardsCoordinator *RewardsCoordinatorCaller) GetOperatorCommissionBips(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (uint16, error) { + var out []interface{} + err := _RewardsCoordinator.contract.Call(opts, &out, "getOperatorCommissionBips", operator, operatorSet, rewardType) + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +// GetOperatorCommissionBips is a free data retrieval call binding the contract method 0x4d7a80d4. +// +// Solidity: function getOperatorCommissionBips(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint16) +func (_RewardsCoordinator *RewardsCoordinatorSession) GetOperatorCommissionBips(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (uint16, error) { + return _RewardsCoordinator.Contract.GetOperatorCommissionBips(&_RewardsCoordinator.CallOpts, operator, operatorSet, rewardType) +} + +// GetOperatorCommissionBips is a free data retrieval call binding the contract method 0x4d7a80d4. +// +// Solidity: function getOperatorCommissionBips(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint16) +func (_RewardsCoordinator *RewardsCoordinatorCallerSession) GetOperatorCommissionBips(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (uint16, error) { + return _RewardsCoordinator.Contract.GetOperatorCommissionBips(&_RewardsCoordinator.CallOpts, operator, operatorSet, rewardType) +} + +// GetOperatorCommissionUpdateHistoryLength is a free data retrieval call binding the contract method 0xc336f19d. +// +// Solidity: function getOperatorCommissionUpdateHistoryLength(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint256) +func (_RewardsCoordinator *RewardsCoordinatorCaller) GetOperatorCommissionUpdateHistoryLength(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (*big.Int, error) { + var out []interface{} + err := _RewardsCoordinator.contract.Call(opts, &out, "getOperatorCommissionUpdateHistoryLength", operator, operatorSet, rewardType) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetOperatorCommissionUpdateHistoryLength is a free data retrieval call binding the contract method 0xc336f19d. +// +// Solidity: function getOperatorCommissionUpdateHistoryLength(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint256) +func (_RewardsCoordinator *RewardsCoordinatorSession) GetOperatorCommissionUpdateHistoryLength(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (*big.Int, error) { + return _RewardsCoordinator.Contract.GetOperatorCommissionUpdateHistoryLength(&_RewardsCoordinator.CallOpts, operator, operatorSet, rewardType) +} + +// GetOperatorCommissionUpdateHistoryLength is a free data retrieval call binding the contract method 0xc336f19d. +// +// Solidity: function getOperatorCommissionUpdateHistoryLength(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint256) +func (_RewardsCoordinator *RewardsCoordinatorCallerSession) GetOperatorCommissionUpdateHistoryLength(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (*big.Int, error) { + return _RewardsCoordinator.Contract.GetOperatorCommissionUpdateHistoryLength(&_RewardsCoordinator.CallOpts, operator, operatorSet, rewardType) +} + // GetRootIndexFromHash is a free data retrieval call binding the contract method 0xe810ce21. // // Solidity: function getRootIndexFromHash(bytes32 rootHash) view returns(uint32) @@ -992,35 +1164,49 @@ func (_RewardsCoordinator *RewardsCoordinatorCallerSession) IsRewardsSubmissionF return _RewardsCoordinator.Contract.IsRewardsSubmissionForAllHash(&_RewardsCoordinator.CallOpts, arg0, arg1) } -// OperatorCommissionBips is a free data retrieval call binding the contract method 0x22f19a64. +// OperatorCommissionUpdates is a free data retrieval call binding the contract method 0x7adace91. // -// Solidity: function operatorCommissionBips(address operator, address avs) view returns(uint16) -func (_RewardsCoordinator *RewardsCoordinatorCaller) OperatorCommissionBips(opts *bind.CallOpts, operator common.Address, avs common.Address) (uint16, error) { +// Solidity: function operatorCommissionUpdates(address , address , uint32 , uint8 , uint256 ) view returns(uint16 commissionBips, uint32 effectTimestamp) +func (_RewardsCoordinator *RewardsCoordinatorCaller) OperatorCommissionUpdates(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 uint32, arg3 uint8, arg4 *big.Int) (struct { + CommissionBips uint16 + EffectTimestamp uint32 +}, error) { var out []interface{} - err := _RewardsCoordinator.contract.Call(opts, &out, "operatorCommissionBips", operator, avs) + err := _RewardsCoordinator.contract.Call(opts, &out, "operatorCommissionUpdates", arg0, arg1, arg2, arg3, arg4) + outstruct := new(struct { + CommissionBips uint16 + EffectTimestamp uint32 + }) if err != nil { - return *new(uint16), err + return *outstruct, err } - out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + outstruct.CommissionBips = *abi.ConvertType(out[0], new(uint16)).(*uint16) + outstruct.EffectTimestamp = *abi.ConvertType(out[1], new(uint32)).(*uint32) - return out0, err + return *outstruct, err } -// OperatorCommissionBips is a free data retrieval call binding the contract method 0x22f19a64. +// OperatorCommissionUpdates is a free data retrieval call binding the contract method 0x7adace91. // -// Solidity: function operatorCommissionBips(address operator, address avs) view returns(uint16) -func (_RewardsCoordinator *RewardsCoordinatorSession) OperatorCommissionBips(operator common.Address, avs common.Address) (uint16, error) { - return _RewardsCoordinator.Contract.OperatorCommissionBips(&_RewardsCoordinator.CallOpts, operator, avs) +// Solidity: function operatorCommissionUpdates(address , address , uint32 , uint8 , uint256 ) view returns(uint16 commissionBips, uint32 effectTimestamp) +func (_RewardsCoordinator *RewardsCoordinatorSession) OperatorCommissionUpdates(arg0 common.Address, arg1 common.Address, arg2 uint32, arg3 uint8, arg4 *big.Int) (struct { + CommissionBips uint16 + EffectTimestamp uint32 +}, error) { + return _RewardsCoordinator.Contract.OperatorCommissionUpdates(&_RewardsCoordinator.CallOpts, arg0, arg1, arg2, arg3, arg4) } -// OperatorCommissionBips is a free data retrieval call binding the contract method 0x22f19a64. +// OperatorCommissionUpdates is a free data retrieval call binding the contract method 0x7adace91. // -// Solidity: function operatorCommissionBips(address operator, address avs) view returns(uint16) -func (_RewardsCoordinator *RewardsCoordinatorCallerSession) OperatorCommissionBips(operator common.Address, avs common.Address) (uint16, error) { - return _RewardsCoordinator.Contract.OperatorCommissionBips(&_RewardsCoordinator.CallOpts, operator, avs) +// Solidity: function operatorCommissionUpdates(address , address , uint32 , uint8 , uint256 ) view returns(uint16 commissionBips, uint32 effectTimestamp) +func (_RewardsCoordinator *RewardsCoordinatorCallerSession) OperatorCommissionUpdates(arg0 common.Address, arg1 common.Address, arg2 uint32, arg3 uint8, arg4 *big.Int) (struct { + CommissionBips uint16 + EffectTimestamp uint32 +}, error) { + return _RewardsCoordinator.Contract.OperatorCommissionUpdates(&_RewardsCoordinator.CallOpts, arg0, arg1, arg2, arg3, arg4) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. @@ -1408,6 +1594,27 @@ func (_RewardsCoordinator *RewardsCoordinatorTransactorSession) RenounceOwnershi return _RewardsCoordinator.Contract.RenounceOwnership(&_RewardsCoordinator.TransactOpts) } +// RewardOperatorSetForRange is a paid mutator transaction binding the contract method 0x2c9c60cf. +// +// Solidity: function rewardOperatorSetForRange((uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32)[] rewardsSubmissions) returns() +func (_RewardsCoordinator *RewardsCoordinatorTransactor) RewardOperatorSetForRange(opts *bind.TransactOpts, rewardsSubmissions []IRewardsCoordinatorOperatorSetRewardsSubmission) (*types.Transaction, error) { + return _RewardsCoordinator.contract.Transact(opts, "rewardOperatorSetForRange", rewardsSubmissions) +} + +// RewardOperatorSetForRange is a paid mutator transaction binding the contract method 0x2c9c60cf. +// +// Solidity: function rewardOperatorSetForRange((uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32)[] rewardsSubmissions) returns() +func (_RewardsCoordinator *RewardsCoordinatorSession) RewardOperatorSetForRange(rewardsSubmissions []IRewardsCoordinatorOperatorSetRewardsSubmission) (*types.Transaction, error) { + return _RewardsCoordinator.Contract.RewardOperatorSetForRange(&_RewardsCoordinator.TransactOpts, rewardsSubmissions) +} + +// RewardOperatorSetForRange is a paid mutator transaction binding the contract method 0x2c9c60cf. +// +// Solidity: function rewardOperatorSetForRange((uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32)[] rewardsSubmissions) returns() +func (_RewardsCoordinator *RewardsCoordinatorTransactorSession) RewardOperatorSetForRange(rewardsSubmissions []IRewardsCoordinatorOperatorSetRewardsSubmission) (*types.Transaction, error) { + return _RewardsCoordinator.Contract.RewardOperatorSetForRange(&_RewardsCoordinator.TransactOpts, rewardsSubmissions) +} + // SetActivationDelay is a paid mutator transaction binding the contract method 0x58baaa3e. // // Solidity: function setActivationDelay(uint32 _activationDelay) returns() @@ -1471,6 +1678,27 @@ func (_RewardsCoordinator *RewardsCoordinatorTransactorSession) SetGlobalOperato return _RewardsCoordinator.Contract.SetGlobalOperatorCommission(&_RewardsCoordinator.TransactOpts, _globalCommissionBips) } +// SetOperatorCommissionBips is a paid mutator transaction binding the contract method 0x3c8fcf7c. +// +// Solidity: function setOperatorCommissionBips((address,uint32) operatorSet, uint8 rewardType, uint16 commissionBips) returns(uint32 effectTimestamp) +func (_RewardsCoordinator *RewardsCoordinatorTransactor) SetOperatorCommissionBips(opts *bind.TransactOpts, operatorSet IAVSDirectoryOperatorSet, rewardType uint8, commissionBips uint16) (*types.Transaction, error) { + return _RewardsCoordinator.contract.Transact(opts, "setOperatorCommissionBips", operatorSet, rewardType, commissionBips) +} + +// SetOperatorCommissionBips is a paid mutator transaction binding the contract method 0x3c8fcf7c. +// +// Solidity: function setOperatorCommissionBips((address,uint32) operatorSet, uint8 rewardType, uint16 commissionBips) returns(uint32 effectTimestamp) +func (_RewardsCoordinator *RewardsCoordinatorSession) SetOperatorCommissionBips(operatorSet IAVSDirectoryOperatorSet, rewardType uint8, commissionBips uint16) (*types.Transaction, error) { + return _RewardsCoordinator.Contract.SetOperatorCommissionBips(&_RewardsCoordinator.TransactOpts, operatorSet, rewardType, commissionBips) +} + +// SetOperatorCommissionBips is a paid mutator transaction binding the contract method 0x3c8fcf7c. +// +// Solidity: function setOperatorCommissionBips((address,uint32) operatorSet, uint8 rewardType, uint16 commissionBips) returns(uint32 effectTimestamp) +func (_RewardsCoordinator *RewardsCoordinatorTransactorSession) SetOperatorCommissionBips(operatorSet IAVSDirectoryOperatorSet, rewardType uint8, commissionBips uint16) (*types.Transaction, error) { + return _RewardsCoordinator.Contract.SetOperatorCommissionBips(&_RewardsCoordinator.TransactOpts, operatorSet, rewardType, commissionBips) +} + // SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. // // Solidity: function setPauserRegistry(address newPauserRegistry) returns() @@ -2633,6 +2861,325 @@ func (_RewardsCoordinator *RewardsCoordinatorFilterer) ParseInitialized(log type return event, nil } +// RewardsCoordinatorOperatorCommissionUpdatedIterator is returned from FilterOperatorCommissionUpdated and is used to iterate over the raw logs and unpacked data for OperatorCommissionUpdated events raised by the RewardsCoordinator contract. +type RewardsCoordinatorOperatorCommissionUpdatedIterator struct { + Event *RewardsCoordinatorOperatorCommissionUpdated // 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 *RewardsCoordinatorOperatorCommissionUpdatedIterator) 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(RewardsCoordinatorOperatorCommissionUpdated) + 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(RewardsCoordinatorOperatorCommissionUpdated) + 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 *RewardsCoordinatorOperatorCommissionUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RewardsCoordinatorOperatorCommissionUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RewardsCoordinatorOperatorCommissionUpdated represents a OperatorCommissionUpdated event raised by the RewardsCoordinator contract. +type RewardsCoordinatorOperatorCommissionUpdated struct { + Operator common.Address + OperatorSet IAVSDirectoryOperatorSet + RewardType uint8 + NewCommissionBips uint16 + EffectTimestamp uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorCommissionUpdated is a free log retrieval operation binding the contract event 0x811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba. +// +// Solidity: event OperatorCommissionUpdated(address indexed operator, (address,uint32) indexed operatorSet, uint8 rewardType, uint16 newCommissionBips, uint32 effectTimestamp) +func (_RewardsCoordinator *RewardsCoordinatorFilterer) FilterOperatorCommissionUpdated(opts *bind.FilterOpts, operator []common.Address, operatorSet []IAVSDirectoryOperatorSet) (*RewardsCoordinatorOperatorCommissionUpdatedIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var operatorSetRule []interface{} + for _, operatorSetItem := range operatorSet { + operatorSetRule = append(operatorSetRule, operatorSetItem) + } + + logs, sub, err := _RewardsCoordinator.contract.FilterLogs(opts, "OperatorCommissionUpdated", operatorRule, operatorSetRule) + if err != nil { + return nil, err + } + return &RewardsCoordinatorOperatorCommissionUpdatedIterator{contract: _RewardsCoordinator.contract, event: "OperatorCommissionUpdated", logs: logs, sub: sub}, nil +} + +// WatchOperatorCommissionUpdated is a free log subscription operation binding the contract event 0x811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba. +// +// Solidity: event OperatorCommissionUpdated(address indexed operator, (address,uint32) indexed operatorSet, uint8 rewardType, uint16 newCommissionBips, uint32 effectTimestamp) +func (_RewardsCoordinator *RewardsCoordinatorFilterer) WatchOperatorCommissionUpdated(opts *bind.WatchOpts, sink chan<- *RewardsCoordinatorOperatorCommissionUpdated, operator []common.Address, operatorSet []IAVSDirectoryOperatorSet) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var operatorSetRule []interface{} + for _, operatorSetItem := range operatorSet { + operatorSetRule = append(operatorSetRule, operatorSetItem) + } + + logs, sub, err := _RewardsCoordinator.contract.WatchLogs(opts, "OperatorCommissionUpdated", operatorRule, operatorSetRule) + 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(RewardsCoordinatorOperatorCommissionUpdated) + if err := _RewardsCoordinator.contract.UnpackLog(event, "OperatorCommissionUpdated", 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 +} + +// ParseOperatorCommissionUpdated is a log parse operation binding the contract event 0x811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba. +// +// Solidity: event OperatorCommissionUpdated(address indexed operator, (address,uint32) indexed operatorSet, uint8 rewardType, uint16 newCommissionBips, uint32 effectTimestamp) +func (_RewardsCoordinator *RewardsCoordinatorFilterer) ParseOperatorCommissionUpdated(log types.Log) (*RewardsCoordinatorOperatorCommissionUpdated, error) { + event := new(RewardsCoordinatorOperatorCommissionUpdated) + if err := _RewardsCoordinator.contract.UnpackLog(event, "OperatorCommissionUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RewardsCoordinatorOperatorSetRewardCreatedIterator is returned from FilterOperatorSetRewardCreated and is used to iterate over the raw logs and unpacked data for OperatorSetRewardCreated events raised by the RewardsCoordinator contract. +type RewardsCoordinatorOperatorSetRewardCreatedIterator struct { + Event *RewardsCoordinatorOperatorSetRewardCreated // 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 *RewardsCoordinatorOperatorSetRewardCreatedIterator) 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(RewardsCoordinatorOperatorSetRewardCreated) + 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(RewardsCoordinatorOperatorSetRewardCreated) + 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 *RewardsCoordinatorOperatorSetRewardCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RewardsCoordinatorOperatorSetRewardCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RewardsCoordinatorOperatorSetRewardCreated represents a OperatorSetRewardCreated event raised by the RewardsCoordinator contract. +type RewardsCoordinatorOperatorSetRewardCreated struct { + Avs common.Address + SubmissionNonce *big.Int + RewardsSubmissionHash [32]byte + RewardsSubmission IRewardsCoordinatorOperatorSetRewardsSubmission + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorSetRewardCreated is a free log retrieval operation binding the contract event 0x29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b2. +// +// Solidity: event OperatorSetRewardCreated(address indexed avs, uint256 indexed submissionNonce, bytes32 indexed rewardsSubmissionHash, (uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32) rewardsSubmission) +func (_RewardsCoordinator *RewardsCoordinatorFilterer) FilterOperatorSetRewardCreated(opts *bind.FilterOpts, avs []common.Address, submissionNonce []*big.Int, rewardsSubmissionHash [][32]byte) (*RewardsCoordinatorOperatorSetRewardCreatedIterator, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + var submissionNonceRule []interface{} + for _, submissionNonceItem := range submissionNonce { + submissionNonceRule = append(submissionNonceRule, submissionNonceItem) + } + var rewardsSubmissionHashRule []interface{} + for _, rewardsSubmissionHashItem := range rewardsSubmissionHash { + rewardsSubmissionHashRule = append(rewardsSubmissionHashRule, rewardsSubmissionHashItem) + } + + logs, sub, err := _RewardsCoordinator.contract.FilterLogs(opts, "OperatorSetRewardCreated", avsRule, submissionNonceRule, rewardsSubmissionHashRule) + if err != nil { + return nil, err + } + return &RewardsCoordinatorOperatorSetRewardCreatedIterator{contract: _RewardsCoordinator.contract, event: "OperatorSetRewardCreated", logs: logs, sub: sub}, nil +} + +// WatchOperatorSetRewardCreated is a free log subscription operation binding the contract event 0x29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b2. +// +// Solidity: event OperatorSetRewardCreated(address indexed avs, uint256 indexed submissionNonce, bytes32 indexed rewardsSubmissionHash, (uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32) rewardsSubmission) +func (_RewardsCoordinator *RewardsCoordinatorFilterer) WatchOperatorSetRewardCreated(opts *bind.WatchOpts, sink chan<- *RewardsCoordinatorOperatorSetRewardCreated, avs []common.Address, submissionNonce []*big.Int, rewardsSubmissionHash [][32]byte) (event.Subscription, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + var submissionNonceRule []interface{} + for _, submissionNonceItem := range submissionNonce { + submissionNonceRule = append(submissionNonceRule, submissionNonceItem) + } + var rewardsSubmissionHashRule []interface{} + for _, rewardsSubmissionHashItem := range rewardsSubmissionHash { + rewardsSubmissionHashRule = append(rewardsSubmissionHashRule, rewardsSubmissionHashItem) + } + + logs, sub, err := _RewardsCoordinator.contract.WatchLogs(opts, "OperatorSetRewardCreated", avsRule, submissionNonceRule, rewardsSubmissionHashRule) + 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(RewardsCoordinatorOperatorSetRewardCreated) + if err := _RewardsCoordinator.contract.UnpackLog(event, "OperatorSetRewardCreated", 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 +} + +// ParseOperatorSetRewardCreated is a log parse operation binding the contract event 0x29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b2. +// +// Solidity: event OperatorSetRewardCreated(address indexed avs, uint256 indexed submissionNonce, bytes32 indexed rewardsSubmissionHash, (uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32) rewardsSubmission) +func (_RewardsCoordinator *RewardsCoordinatorFilterer) ParseOperatorSetRewardCreated(log types.Log) (*RewardsCoordinatorOperatorSetRewardCreated, error) { + event := new(RewardsCoordinatorOperatorSetRewardCreated) + if err := _RewardsCoordinator.contract.UnpackLog(event, "OperatorSetRewardCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // RewardsCoordinatorOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the RewardsCoordinator contract. type RewardsCoordinatorOwnershipTransferredIterator struct { Event *RewardsCoordinatorOwnershipTransferred // Event containing the contract specifics and raw log diff --git a/pkg/bindings/RewardsCoordinatorStorage/binding.go b/pkg/bindings/RewardsCoordinatorStorage/binding.go index 86e0a7e51..8df917060 100644 --- a/pkg/bindings/RewardsCoordinatorStorage/binding.go +++ b/pkg/bindings/RewardsCoordinatorStorage/binding.go @@ -29,6 +29,12 @@ var ( _ = abi.ConvertType ) +// IAVSDirectoryOperatorSet is an auto generated low-level Go binding around an user-defined struct. +type IAVSDirectoryOperatorSet struct { + Avs common.Address + OperatorSetId uint32 +} + // IRewardsCoordinatorDistributionRoot is an auto generated low-level Go binding around an user-defined struct. type IRewardsCoordinatorDistributionRoot struct { Root [32]byte @@ -43,6 +49,17 @@ type IRewardsCoordinatorEarnerTreeMerkleLeaf struct { EarnerTokenRoot [32]byte } +// IRewardsCoordinatorOperatorSetRewardsSubmission is an auto generated low-level Go binding around an user-defined struct. +type IRewardsCoordinatorOperatorSetRewardsSubmission struct { + RewardType uint8 + OperatorSetId uint32 + StrategiesAndMultipliers []IRewardsCoordinatorStrategyAndMultiplier + Token common.Address + Amount *big.Int + StartTimestamp uint32 + Duration uint32 +} + // IRewardsCoordinatorRewardsMerkleClaim is an auto generated low-level Go binding around an user-defined struct. type IRewardsCoordinatorRewardsMerkleClaim struct { RootIndex uint32 @@ -77,7 +94,7 @@ type IRewardsCoordinatorTokenTreeMerkleLeaf struct { // RewardsCoordinatorStorageMetaData contains all meta data concerning the RewardsCoordinatorStorage contract. var RewardsCoordinatorStorageMetaData = &bind.MetaData{ - 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\":\"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\":\"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\":\"RewardsUpdaterSet\",\"inputs\":[{\"name\":\"oldRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + 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\":\"OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPERATOR_SET_MAX_RETROACTIVE_LENGTH\",\"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\":\"avsDirectory\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIAVSDirectory\"}],\"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\":\"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\":\"getOperatorCommissionBips\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorCommissionUpdateHistoryLength\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"}],\"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\":\"isRewardsSubmissionForAllHash\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorCommissionUpdates\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"commissionBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"effectTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"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\":\"rewardOperatorSetForRange\",\"inputs\":[{\"name\":\"rewardsSubmissions\",\"type\":\"tuple[]\",\"internalType\":\"structIRewardsCoordinator.OperatorSetRewardsSubmission[]\",\"components\":[{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"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\":\"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\":\"setOperatorCommissionBips\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"commissionBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"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\":\"OperatorCommissionUpdated\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":true,\"internalType\":\"structIAVSDirectory.OperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"rewardType\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"newCommissionBips\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"},{\"name\":\"effectTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetRewardCreated\",\"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.OperatorSetRewardsSubmission\",\"components\":[{\"name\":\"rewardType\",\"type\":\"uint8\",\"internalType\":\"enumIRewardsCoordinator.RewardType\"},{\"name\":\"operatorSetId\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"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\":\"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\":\"RewardsUpdaterSet\",\"inputs\":[{\"name\":\"oldRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newRewardsUpdater\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", } // RewardsCoordinatorStorageABI is the input ABI used to generate the binding from. @@ -381,6 +398,68 @@ func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) MAXREW return _RewardsCoordinatorStorage.Contract.MAXREWARDSDURATION(&_RewardsCoordinatorStorage.CallOpts) } +// OPERATORSETGENESISREWARDSTIMESTAMP is a free data retrieval call binding the contract method 0xd11e9ae5. +// +// Solidity: function OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP() view returns(uint32) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCaller) OPERATORSETGENESISREWARDSTIMESTAMP(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RewardsCoordinatorStorage.contract.Call(opts, &out, "OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// OPERATORSETGENESISREWARDSTIMESTAMP is a free data retrieval call binding the contract method 0xd11e9ae5. +// +// Solidity: function OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP() view returns(uint32) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageSession) OPERATORSETGENESISREWARDSTIMESTAMP() (uint32, error) { + return _RewardsCoordinatorStorage.Contract.OPERATORSETGENESISREWARDSTIMESTAMP(&_RewardsCoordinatorStorage.CallOpts) +} + +// OPERATORSETGENESISREWARDSTIMESTAMP is a free data retrieval call binding the contract method 0xd11e9ae5. +// +// Solidity: function OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP() view returns(uint32) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) OPERATORSETGENESISREWARDSTIMESTAMP() (uint32, error) { + return _RewardsCoordinatorStorage.Contract.OPERATORSETGENESISREWARDSTIMESTAMP(&_RewardsCoordinatorStorage.CallOpts) +} + +// OPERATORSETMAXRETROACTIVELENGTH is a free data retrieval call binding the contract method 0x3486e32e. +// +// Solidity: function OPERATOR_SET_MAX_RETROACTIVE_LENGTH() view returns(uint32) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCaller) OPERATORSETMAXRETROACTIVELENGTH(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RewardsCoordinatorStorage.contract.Call(opts, &out, "OPERATOR_SET_MAX_RETROACTIVE_LENGTH") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// OPERATORSETMAXRETROACTIVELENGTH is a free data retrieval call binding the contract method 0x3486e32e. +// +// Solidity: function OPERATOR_SET_MAX_RETROACTIVE_LENGTH() view returns(uint32) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageSession) OPERATORSETMAXRETROACTIVELENGTH() (uint32, error) { + return _RewardsCoordinatorStorage.Contract.OPERATORSETMAXRETROACTIVELENGTH(&_RewardsCoordinatorStorage.CallOpts) +} + +// OPERATORSETMAXRETROACTIVELENGTH is a free data retrieval call binding the contract method 0x3486e32e. +// +// Solidity: function OPERATOR_SET_MAX_RETROACTIVE_LENGTH() view returns(uint32) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) OPERATORSETMAXRETROACTIVELENGTH() (uint32, error) { + return _RewardsCoordinatorStorage.Contract.OPERATORSETMAXRETROACTIVELENGTH(&_RewardsCoordinatorStorage.CallOpts) +} + // ActivationDelay is a free data retrieval call binding the contract method 0x3a8c0786. // // Solidity: function activationDelay() view returns(uint32) @@ -412,6 +491,37 @@ func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) Activa return _RewardsCoordinatorStorage.Contract.ActivationDelay(&_RewardsCoordinatorStorage.CallOpts) } +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCaller) AvsDirectory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RewardsCoordinatorStorage.contract.Call(opts, &out, "avsDirectory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageSession) AvsDirectory() (common.Address, error) { + return _RewardsCoordinatorStorage.Contract.AvsDirectory(&_RewardsCoordinatorStorage.CallOpts) +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) AvsDirectory() (common.Address, error) { + return _RewardsCoordinatorStorage.Contract.AvsDirectory(&_RewardsCoordinatorStorage.CallOpts) +} + // CalculateEarnerLeafHash is a free data retrieval call binding the contract method 0x149bc872. // // Solidity: function calculateEarnerLeafHash((address,bytes32) leaf) pure returns(bytes32) @@ -753,6 +863,68 @@ func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) GetDis return _RewardsCoordinatorStorage.Contract.GetDistributionRootsLength(&_RewardsCoordinatorStorage.CallOpts) } +// GetOperatorCommissionBips is a free data retrieval call binding the contract method 0x4d7a80d4. +// +// Solidity: function getOperatorCommissionBips(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint16) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCaller) GetOperatorCommissionBips(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (uint16, error) { + var out []interface{} + err := _RewardsCoordinatorStorage.contract.Call(opts, &out, "getOperatorCommissionBips", operator, operatorSet, rewardType) + + if err != nil { + return *new(uint16), err + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, err + +} + +// GetOperatorCommissionBips is a free data retrieval call binding the contract method 0x4d7a80d4. +// +// Solidity: function getOperatorCommissionBips(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint16) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageSession) GetOperatorCommissionBips(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (uint16, error) { + return _RewardsCoordinatorStorage.Contract.GetOperatorCommissionBips(&_RewardsCoordinatorStorage.CallOpts, operator, operatorSet, rewardType) +} + +// GetOperatorCommissionBips is a free data retrieval call binding the contract method 0x4d7a80d4. +// +// Solidity: function getOperatorCommissionBips(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint16) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) GetOperatorCommissionBips(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (uint16, error) { + return _RewardsCoordinatorStorage.Contract.GetOperatorCommissionBips(&_RewardsCoordinatorStorage.CallOpts, operator, operatorSet, rewardType) +} + +// GetOperatorCommissionUpdateHistoryLength is a free data retrieval call binding the contract method 0xc336f19d. +// +// Solidity: function getOperatorCommissionUpdateHistoryLength(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint256) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCaller) GetOperatorCommissionUpdateHistoryLength(opts *bind.CallOpts, operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (*big.Int, error) { + var out []interface{} + err := _RewardsCoordinatorStorage.contract.Call(opts, &out, "getOperatorCommissionUpdateHistoryLength", operator, operatorSet, rewardType) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetOperatorCommissionUpdateHistoryLength is a free data retrieval call binding the contract method 0xc336f19d. +// +// Solidity: function getOperatorCommissionUpdateHistoryLength(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint256) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageSession) GetOperatorCommissionUpdateHistoryLength(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (*big.Int, error) { + return _RewardsCoordinatorStorage.Contract.GetOperatorCommissionUpdateHistoryLength(&_RewardsCoordinatorStorage.CallOpts, operator, operatorSet, rewardType) +} + +// GetOperatorCommissionUpdateHistoryLength is a free data retrieval call binding the contract method 0xc336f19d. +// +// Solidity: function getOperatorCommissionUpdateHistoryLength(address operator, (address,uint32) operatorSet, uint8 rewardType) view returns(uint256) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) GetOperatorCommissionUpdateHistoryLength(operator common.Address, operatorSet IAVSDirectoryOperatorSet, rewardType uint8) (*big.Int, error) { + return _RewardsCoordinatorStorage.Contract.GetOperatorCommissionUpdateHistoryLength(&_RewardsCoordinatorStorage.CallOpts, operator, operatorSet, rewardType) +} + // GetRootIndexFromHash is a free data retrieval call binding the contract method 0xe810ce21. // // Solidity: function getRootIndexFromHash(bytes32 rootHash) view returns(uint32) @@ -908,35 +1080,49 @@ func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) IsRewa return _RewardsCoordinatorStorage.Contract.IsRewardsSubmissionForAllHash(&_RewardsCoordinatorStorage.CallOpts, arg0, arg1) } -// OperatorCommissionBips is a free data retrieval call binding the contract method 0x22f19a64. +// OperatorCommissionUpdates is a free data retrieval call binding the contract method 0x7adace91. // -// Solidity: function operatorCommissionBips(address operator, address avs) view returns(uint16) -func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCaller) OperatorCommissionBips(opts *bind.CallOpts, operator common.Address, avs common.Address) (uint16, error) { +// Solidity: function operatorCommissionUpdates(address , address , uint32 , uint8 , uint256 ) view returns(uint16 commissionBips, uint32 effectTimestamp) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCaller) OperatorCommissionUpdates(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address, arg2 uint32, arg3 uint8, arg4 *big.Int) (struct { + CommissionBips uint16 + EffectTimestamp uint32 +}, error) { var out []interface{} - err := _RewardsCoordinatorStorage.contract.Call(opts, &out, "operatorCommissionBips", operator, avs) + err := _RewardsCoordinatorStorage.contract.Call(opts, &out, "operatorCommissionUpdates", arg0, arg1, arg2, arg3, arg4) + outstruct := new(struct { + CommissionBips uint16 + EffectTimestamp uint32 + }) if err != nil { - return *new(uint16), err + return *outstruct, err } - out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + outstruct.CommissionBips = *abi.ConvertType(out[0], new(uint16)).(*uint16) + outstruct.EffectTimestamp = *abi.ConvertType(out[1], new(uint32)).(*uint32) - return out0, err + return *outstruct, err } -// OperatorCommissionBips is a free data retrieval call binding the contract method 0x22f19a64. +// OperatorCommissionUpdates is a free data retrieval call binding the contract method 0x7adace91. // -// Solidity: function operatorCommissionBips(address operator, address avs) view returns(uint16) -func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageSession) OperatorCommissionBips(operator common.Address, avs common.Address) (uint16, error) { - return _RewardsCoordinatorStorage.Contract.OperatorCommissionBips(&_RewardsCoordinatorStorage.CallOpts, operator, avs) +// Solidity: function operatorCommissionUpdates(address , address , uint32 , uint8 , uint256 ) view returns(uint16 commissionBips, uint32 effectTimestamp) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageSession) OperatorCommissionUpdates(arg0 common.Address, arg1 common.Address, arg2 uint32, arg3 uint8, arg4 *big.Int) (struct { + CommissionBips uint16 + EffectTimestamp uint32 +}, error) { + return _RewardsCoordinatorStorage.Contract.OperatorCommissionUpdates(&_RewardsCoordinatorStorage.CallOpts, arg0, arg1, arg2, arg3, arg4) } -// OperatorCommissionBips is a free data retrieval call binding the contract method 0x22f19a64. +// OperatorCommissionUpdates is a free data retrieval call binding the contract method 0x7adace91. // -// Solidity: function operatorCommissionBips(address operator, address avs) view returns(uint16) -func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) OperatorCommissionBips(operator common.Address, avs common.Address) (uint16, error) { - return _RewardsCoordinatorStorage.Contract.OperatorCommissionBips(&_RewardsCoordinatorStorage.CallOpts, operator, avs) +// Solidity: function operatorCommissionUpdates(address , address , uint32 , uint8 , uint256 ) view returns(uint16 commissionBips, uint32 effectTimestamp) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageCallerSession) OperatorCommissionUpdates(arg0 common.Address, arg1 common.Address, arg2 uint32, arg3 uint8, arg4 *big.Int) (struct { + CommissionBips uint16 + EffectTimestamp uint32 +}, error) { + return _RewardsCoordinatorStorage.Contract.OperatorCommissionUpdates(&_RewardsCoordinatorStorage.CallOpts, arg0, arg1, arg2, arg3, arg4) } // RewardsUpdater is a free data retrieval call binding the contract method 0xfbf1e2c1. @@ -1116,6 +1302,27 @@ func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageTransactorSession) Pr return _RewardsCoordinatorStorage.Contract.ProcessClaim(&_RewardsCoordinatorStorage.TransactOpts, claim, recipient) } +// RewardOperatorSetForRange is a paid mutator transaction binding the contract method 0x2c9c60cf. +// +// Solidity: function rewardOperatorSetForRange((uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32)[] rewardsSubmissions) returns() +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageTransactor) RewardOperatorSetForRange(opts *bind.TransactOpts, rewardsSubmissions []IRewardsCoordinatorOperatorSetRewardsSubmission) (*types.Transaction, error) { + return _RewardsCoordinatorStorage.contract.Transact(opts, "rewardOperatorSetForRange", rewardsSubmissions) +} + +// RewardOperatorSetForRange is a paid mutator transaction binding the contract method 0x2c9c60cf. +// +// Solidity: function rewardOperatorSetForRange((uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32)[] rewardsSubmissions) returns() +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageSession) RewardOperatorSetForRange(rewardsSubmissions []IRewardsCoordinatorOperatorSetRewardsSubmission) (*types.Transaction, error) { + return _RewardsCoordinatorStorage.Contract.RewardOperatorSetForRange(&_RewardsCoordinatorStorage.TransactOpts, rewardsSubmissions) +} + +// RewardOperatorSetForRange is a paid mutator transaction binding the contract method 0x2c9c60cf. +// +// Solidity: function rewardOperatorSetForRange((uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32)[] rewardsSubmissions) returns() +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageTransactorSession) RewardOperatorSetForRange(rewardsSubmissions []IRewardsCoordinatorOperatorSetRewardsSubmission) (*types.Transaction, error) { + return _RewardsCoordinatorStorage.Contract.RewardOperatorSetForRange(&_RewardsCoordinatorStorage.TransactOpts, rewardsSubmissions) +} + // SetActivationDelay is a paid mutator transaction binding the contract method 0x58baaa3e. // // Solidity: function setActivationDelay(uint32 _activationDelay) returns() @@ -1179,6 +1386,27 @@ func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageTransactorSession) Se return _RewardsCoordinatorStorage.Contract.SetGlobalOperatorCommission(&_RewardsCoordinatorStorage.TransactOpts, _globalCommissionBips) } +// SetOperatorCommissionBips is a paid mutator transaction binding the contract method 0x3c8fcf7c. +// +// Solidity: function setOperatorCommissionBips((address,uint32) operatorSet, uint8 rewardType, uint16 commissionBips) returns(uint32) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageTransactor) SetOperatorCommissionBips(opts *bind.TransactOpts, operatorSet IAVSDirectoryOperatorSet, rewardType uint8, commissionBips uint16) (*types.Transaction, error) { + return _RewardsCoordinatorStorage.contract.Transact(opts, "setOperatorCommissionBips", operatorSet, rewardType, commissionBips) +} + +// SetOperatorCommissionBips is a paid mutator transaction binding the contract method 0x3c8fcf7c. +// +// Solidity: function setOperatorCommissionBips((address,uint32) operatorSet, uint8 rewardType, uint16 commissionBips) returns(uint32) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageSession) SetOperatorCommissionBips(operatorSet IAVSDirectoryOperatorSet, rewardType uint8, commissionBips uint16) (*types.Transaction, error) { + return _RewardsCoordinatorStorage.Contract.SetOperatorCommissionBips(&_RewardsCoordinatorStorage.TransactOpts, operatorSet, rewardType, commissionBips) +} + +// SetOperatorCommissionBips is a paid mutator transaction binding the contract method 0x3c8fcf7c. +// +// Solidity: function setOperatorCommissionBips((address,uint32) operatorSet, uint8 rewardType, uint16 commissionBips) returns(uint32) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageTransactorSession) SetOperatorCommissionBips(operatorSet IAVSDirectoryOperatorSet, rewardType uint8, commissionBips uint16) (*types.Transaction, error) { + return _RewardsCoordinatorStorage.Contract.SetOperatorCommissionBips(&_RewardsCoordinatorStorage.TransactOpts, operatorSet, rewardType, commissionBips) +} + // SetRewardsForAllSubmitter is a paid mutator transaction binding the contract method 0x0eb38345. // // Solidity: function setRewardsForAllSubmitter(address _submitter, bool _newValue) returns() @@ -2144,6 +2372,325 @@ func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageFilterer) ParseGlobal return event, nil } +// RewardsCoordinatorStorageOperatorCommissionUpdatedIterator is returned from FilterOperatorCommissionUpdated and is used to iterate over the raw logs and unpacked data for OperatorCommissionUpdated events raised by the RewardsCoordinatorStorage contract. +type RewardsCoordinatorStorageOperatorCommissionUpdatedIterator struct { + Event *RewardsCoordinatorStorageOperatorCommissionUpdated // 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 *RewardsCoordinatorStorageOperatorCommissionUpdatedIterator) 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(RewardsCoordinatorStorageOperatorCommissionUpdated) + 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(RewardsCoordinatorStorageOperatorCommissionUpdated) + 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 *RewardsCoordinatorStorageOperatorCommissionUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RewardsCoordinatorStorageOperatorCommissionUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RewardsCoordinatorStorageOperatorCommissionUpdated represents a OperatorCommissionUpdated event raised by the RewardsCoordinatorStorage contract. +type RewardsCoordinatorStorageOperatorCommissionUpdated struct { + Operator common.Address + OperatorSet IAVSDirectoryOperatorSet + RewardType uint8 + NewCommissionBips uint16 + EffectTimestamp uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorCommissionUpdated is a free log retrieval operation binding the contract event 0x811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba. +// +// Solidity: event OperatorCommissionUpdated(address indexed operator, (address,uint32) indexed operatorSet, uint8 rewardType, uint16 newCommissionBips, uint32 effectTimestamp) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageFilterer) FilterOperatorCommissionUpdated(opts *bind.FilterOpts, operator []common.Address, operatorSet []IAVSDirectoryOperatorSet) (*RewardsCoordinatorStorageOperatorCommissionUpdatedIterator, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var operatorSetRule []interface{} + for _, operatorSetItem := range operatorSet { + operatorSetRule = append(operatorSetRule, operatorSetItem) + } + + logs, sub, err := _RewardsCoordinatorStorage.contract.FilterLogs(opts, "OperatorCommissionUpdated", operatorRule, operatorSetRule) + if err != nil { + return nil, err + } + return &RewardsCoordinatorStorageOperatorCommissionUpdatedIterator{contract: _RewardsCoordinatorStorage.contract, event: "OperatorCommissionUpdated", logs: logs, sub: sub}, nil +} + +// WatchOperatorCommissionUpdated is a free log subscription operation binding the contract event 0x811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba. +// +// Solidity: event OperatorCommissionUpdated(address indexed operator, (address,uint32) indexed operatorSet, uint8 rewardType, uint16 newCommissionBips, uint32 effectTimestamp) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageFilterer) WatchOperatorCommissionUpdated(opts *bind.WatchOpts, sink chan<- *RewardsCoordinatorStorageOperatorCommissionUpdated, operator []common.Address, operatorSet []IAVSDirectoryOperatorSet) (event.Subscription, error) { + + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + var operatorSetRule []interface{} + for _, operatorSetItem := range operatorSet { + operatorSetRule = append(operatorSetRule, operatorSetItem) + } + + logs, sub, err := _RewardsCoordinatorStorage.contract.WatchLogs(opts, "OperatorCommissionUpdated", operatorRule, operatorSetRule) + 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(RewardsCoordinatorStorageOperatorCommissionUpdated) + if err := _RewardsCoordinatorStorage.contract.UnpackLog(event, "OperatorCommissionUpdated", 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 +} + +// ParseOperatorCommissionUpdated is a log parse operation binding the contract event 0x811b77cd39953efa46bbcbf8afd10756fac937e63667afdd6bab4dd69c788dba. +// +// Solidity: event OperatorCommissionUpdated(address indexed operator, (address,uint32) indexed operatorSet, uint8 rewardType, uint16 newCommissionBips, uint32 effectTimestamp) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageFilterer) ParseOperatorCommissionUpdated(log types.Log) (*RewardsCoordinatorStorageOperatorCommissionUpdated, error) { + event := new(RewardsCoordinatorStorageOperatorCommissionUpdated) + if err := _RewardsCoordinatorStorage.contract.UnpackLog(event, "OperatorCommissionUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RewardsCoordinatorStorageOperatorSetRewardCreatedIterator is returned from FilterOperatorSetRewardCreated and is used to iterate over the raw logs and unpacked data for OperatorSetRewardCreated events raised by the RewardsCoordinatorStorage contract. +type RewardsCoordinatorStorageOperatorSetRewardCreatedIterator struct { + Event *RewardsCoordinatorStorageOperatorSetRewardCreated // 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 *RewardsCoordinatorStorageOperatorSetRewardCreatedIterator) 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(RewardsCoordinatorStorageOperatorSetRewardCreated) + 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(RewardsCoordinatorStorageOperatorSetRewardCreated) + 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 *RewardsCoordinatorStorageOperatorSetRewardCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RewardsCoordinatorStorageOperatorSetRewardCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RewardsCoordinatorStorageOperatorSetRewardCreated represents a OperatorSetRewardCreated event raised by the RewardsCoordinatorStorage contract. +type RewardsCoordinatorStorageOperatorSetRewardCreated struct { + Avs common.Address + SubmissionNonce *big.Int + RewardsSubmissionHash [32]byte + RewardsSubmission IRewardsCoordinatorOperatorSetRewardsSubmission + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorSetRewardCreated is a free log retrieval operation binding the contract event 0x29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b2. +// +// Solidity: event OperatorSetRewardCreated(address indexed avs, uint256 indexed submissionNonce, bytes32 indexed rewardsSubmissionHash, (uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32) rewardsSubmission) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageFilterer) FilterOperatorSetRewardCreated(opts *bind.FilterOpts, avs []common.Address, submissionNonce []*big.Int, rewardsSubmissionHash [][32]byte) (*RewardsCoordinatorStorageOperatorSetRewardCreatedIterator, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + var submissionNonceRule []interface{} + for _, submissionNonceItem := range submissionNonce { + submissionNonceRule = append(submissionNonceRule, submissionNonceItem) + } + var rewardsSubmissionHashRule []interface{} + for _, rewardsSubmissionHashItem := range rewardsSubmissionHash { + rewardsSubmissionHashRule = append(rewardsSubmissionHashRule, rewardsSubmissionHashItem) + } + + logs, sub, err := _RewardsCoordinatorStorage.contract.FilterLogs(opts, "OperatorSetRewardCreated", avsRule, submissionNonceRule, rewardsSubmissionHashRule) + if err != nil { + return nil, err + } + return &RewardsCoordinatorStorageOperatorSetRewardCreatedIterator{contract: _RewardsCoordinatorStorage.contract, event: "OperatorSetRewardCreated", logs: logs, sub: sub}, nil +} + +// WatchOperatorSetRewardCreated is a free log subscription operation binding the contract event 0x29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b2. +// +// Solidity: event OperatorSetRewardCreated(address indexed avs, uint256 indexed submissionNonce, bytes32 indexed rewardsSubmissionHash, (uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32) rewardsSubmission) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageFilterer) WatchOperatorSetRewardCreated(opts *bind.WatchOpts, sink chan<- *RewardsCoordinatorStorageOperatorSetRewardCreated, avs []common.Address, submissionNonce []*big.Int, rewardsSubmissionHash [][32]byte) (event.Subscription, error) { + + var avsRule []interface{} + for _, avsItem := range avs { + avsRule = append(avsRule, avsItem) + } + var submissionNonceRule []interface{} + for _, submissionNonceItem := range submissionNonce { + submissionNonceRule = append(submissionNonceRule, submissionNonceItem) + } + var rewardsSubmissionHashRule []interface{} + for _, rewardsSubmissionHashItem := range rewardsSubmissionHash { + rewardsSubmissionHashRule = append(rewardsSubmissionHashRule, rewardsSubmissionHashItem) + } + + logs, sub, err := _RewardsCoordinatorStorage.contract.WatchLogs(opts, "OperatorSetRewardCreated", avsRule, submissionNonceRule, rewardsSubmissionHashRule) + 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(RewardsCoordinatorStorageOperatorSetRewardCreated) + if err := _RewardsCoordinatorStorage.contract.UnpackLog(event, "OperatorSetRewardCreated", 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 +} + +// ParseOperatorSetRewardCreated is a log parse operation binding the contract event 0x29a8ee4f31259a5f344a2cca256440ea6638a3278972b1ee9a7aab99b00aa3b2. +// +// Solidity: event OperatorSetRewardCreated(address indexed avs, uint256 indexed submissionNonce, bytes32 indexed rewardsSubmissionHash, (uint8,uint32,(address,uint96)[],address,uint256,uint32,uint32) rewardsSubmission) +func (_RewardsCoordinatorStorage *RewardsCoordinatorStorageFilterer) ParseOperatorSetRewardCreated(log types.Log) (*RewardsCoordinatorStorageOperatorSetRewardCreated, error) { + event := new(RewardsCoordinatorStorageOperatorSetRewardCreated) + if err := _RewardsCoordinatorStorage.contract.UnpackLog(event, "OperatorSetRewardCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // RewardsCoordinatorStorageRewardsClaimedIterator is returned from FilterRewardsClaimed and is used to iterate over the raw logs and unpacked data for RewardsClaimed events raised by the RewardsCoordinatorStorage contract. type RewardsCoordinatorStorageRewardsClaimedIterator struct { Event *RewardsCoordinatorStorageRewardsClaimed // Event containing the contract specifics and raw log 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/StrategyBase/binding.go b/pkg/bindings/StrategyBase/binding.go index 02377ad8a..7fc175d5b 100644 --- a/pkg/bindings/StrategyBase/binding.go +++ b/pkg/bindings/StrategyBase/binding.go @@ -32,7 +32,7 @@ var ( // StrategyBaseMetaData contains all meta data concerning the StrategyBase contract. var StrategyBaseMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"newShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"explanation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_underlyingToken\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"shares\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sharesToUnderlying\",\"inputs\":[{\"name\":\"amountShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sharesToUnderlyingView\",\"inputs\":[{\"name\":\"amountShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalShares\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"underlyingToShares\",\"inputs\":[{\"name\":\"amountUnderlying\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"underlyingToSharesView\",\"inputs\":[{\"name\":\"amountUnderlying\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"underlyingToken\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"userUnderlying\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"userUnderlyingView\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amountShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"ExchangeRateEmitted\",\"inputs\":[{\"name\":\"rate\",\"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\":\"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\":\"StrategyTokenSet\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"decimals\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"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}]", - Bin: "0x60a06040523480156200001157600080fd5b5060405162001ab438038062001ab4833981016040819052620000349162000114565b6001600160a01b0381166080526200004b62000052565b5062000146565b600054610100900460ff1615620000bf5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000112576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012757600080fd5b81516001600160a01b03811681146200013f57600080fd5b9392505050565b60805161193d620001776000396000818161019901528181610570015281816109f50152610ac0015261193d6000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80635c975abb116100b8578063ab5921e11161007c578063ab5921e11461029c578063ce7c2ac2146102b1578063d9caed12146102c4578063e3dae51c146102d7578063f3e73875146102ea578063fabc1cbc146102fd57600080fd5b80635c975abb146102425780637a8b26371461024a578063886f11951461025d5780638c871019146102765780638f6a62401461028957600080fd5b806347e7ef24116100ff57806347e7ef24146101d2578063485cc955146101e5578063553ca5f8146101f8578063595c6a671461020b5780635ac86ab71461021357600080fd5b806310d67a2f1461013c578063136439dd146101515780632495a5991461016457806339b70e38146101945780633a98ef39146101bb575b600080fd5b61014f61014a3660046115a6565b610310565b005b61014f61015f3660046115c3565b6103cc565b603254610177906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101777f000000000000000000000000000000000000000000000000000000000000000081565b6101c460335481565b60405190815260200161018b565b6101c46101e03660046115dc565b610510565b61014f6101f3366004611608565b610754565b6101c46102063660046115a6565b610869565b61014f61087d565b610232610221366004611650565b6001805460ff9092161b9081161490565b604051901515815260200161018b565b6001546101c4565b6101c46102583660046115c3565b610949565b600054610177906201000090046001600160a01b031681565b6101c46102843660046115c3565b610994565b6101c46102973660046115a6565b61099f565b6102a46109ad565b60405161018b919061169d565b6101c46102bf3660046115a6565b6109cd565b61014f6102d23660046116d0565b610a62565b6101c46102e53660046115c3565b610c48565b6101c46102f83660046115c3565b610c81565b61014f61030b3660046115c3565b610c8c565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611711565b6001600160a01b0316336001600160a01b0316146103c05760405162461bcd60e51b81526004016103b79061172e565b60405180910390fd5b6103c981610de8565b50565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa158015610419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043d9190611778565b6104595760405162461bcd60e51b81526004016103b79061179a565b600154818116146104d25760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c697479000000000000000060648201526084016103b7565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600180546000918291811614156105655760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b60448201526064016103b7565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105dd5760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e6167657260448201526064016103b7565b6105e78484610eed565b60335460006105f86103e8836117f8565b905060006103e8610607610f6d565b61061191906117f8565b9050600061061f8783611810565b90508061062c8489611827565b6106369190611846565b95508561069c5760405162461bcd60e51b815260206004820152602e60248201527f5374726174656779426173652e6465706f7369743a206e65775368617265732060448201526d63616e6e6f74206265207a65726f60901b60648201526084016103b7565b6106a686856117f8565b60338190556f4b3b4ca85a86c47a098a223fffffffff10156107305760405162461bcd60e51b815260206004820152603c60248201527f5374726174656779426173652e6465706f7369743a20746f74616c536861726560448201527f73206578636565647320604d41585f544f54414c5f534841524553600000000060648201526084016103b7565b610749826103e860335461074491906117f8565b610fdf565b505050505092915050565b600054610100900460ff16158080156107745750600054600160ff909116105b8061078e5750303b15801561078e575060005460ff166001145b6107f15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103b7565b6000805460ff191660011790558015610814576000805461ff0019166101001790555b61081e8383611033565b8015610864576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6000610877610258836109cd565b92915050565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190611778565b61090a5760405162461bcd60e51b81526004016103b79061179a565b600019600181905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b6000806103e860335461095c91906117f8565b905060006103e861096b610f6d565b61097591906117f8565b9050816109828583611827565b61098c9190611846565b949350505050565b600061087782610c48565b60006108776102f8836109cd565b60606040518060800160405280604d81526020016118bb604d9139905090565b604051633d3f06c960e11b81526001600160a01b0382811660048301523060248301526000917f000000000000000000000000000000000000000000000000000000000000000090911690637a7e0d9290604401602060405180830381865afa158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108779190611868565b6001805460029081161415610ab55760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b60448201526064016103b7565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b2d5760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e6167657260448201526064016103b7565b610b3884848461117e565b60335480831115610bc75760405162461bcd60e51b815260206004820152604d60248201527f5374726174656779426173652e77697468647261773a20616d6f756e7453686160448201527f726573206d757374206265206c657373207468616e206f7220657175616c207460648201526c6f20746f74616c53686172657360981b608482015260a4016103b7565b6000610bd56103e8836117f8565b905060006103e8610be4610f6d565b610bee91906117f8565b9050600082610bfd8784611827565b610c079190611846565b9050610c138685611810565b603355610c33610c238284611810565b6103e860335461074491906117f8565b610c3e888883611201565b5050505050505050565b6000806103e8603354610c5b91906117f8565b905060006103e8610c6a610f6d565b610c7491906117f8565b9050806109828386611827565b600061087782610949565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d039190611711565b6001600160a01b0316336001600160a01b031614610d335760405162461bcd60e51b81526004016103b79061172e565b600154198119600154191614610db15760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c697479000000000000000060648201526084016103b7565b600181905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610505565b6001600160a01b038116610e765760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a4016103b7565b600054604080516001600160a01b03620100009093048316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b6032546001600160a01b03838116911614610f695760405162461bcd60e51b815260206004820152603660248201527f5374726174656779426173652e6465706f7369743a2043616e206f6e6c79206460448201527532b837b9b4ba103ab73232b9363cb4b733aa37b5b2b760511b60648201526084016103b7565b5050565b6032546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610fb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fda9190611868565b905090565b7fd2494f3479e5da49d386657c292c610b5b01df313d07c62eb0cfa49924a31be88161101384670de0b6b3a7640000611827565b61101d9190611846565b6040519081526020015b60405180910390a15050565b600054610100900460ff1661109e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016103b7565b603280546001600160a01b0319166001600160a01b0384161790556110c4816000611215565b7f1c540707b00eb5427b6b774fc799d756516a54aee108b64b327acc55af557507603260009054906101000a90046001600160a01b0316836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611139573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115d9190611881565b604080516001600160a01b03909316835260ff909116602083015201611027565b6032546001600160a01b038381169116146108645760405162461bcd60e51b815260206004820152603b60248201527f5374726174656779426173652e77697468647261773a2043616e206f6e6c792060448201527f77697468647261772074686520737472617465677920746f6b656e000000000060648201526084016103b7565b6108646001600160a01b0383168483611301565b6000546201000090046001600160a01b031615801561123c57506001600160a01b03821615155b6112be5760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a4016103b7565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2610f6982610de8565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526108649286929160009161139191851690849061140e565b80519091501561086457808060200190518101906113af9190611778565b6108645760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103b7565b606061141d8484600085611427565b90505b9392505050565b6060824710156114885760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103b7565b6001600160a01b0385163b6114df5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103b7565b600080866001600160a01b031685876040516114fb919061189e565b60006040518083038185875af1925050503d8060008114611538576040519150601f19603f3d011682016040523d82523d6000602084013e61153d565b606091505b509150915061154d828286611558565b979650505050505050565b60608315611567575081611420565b8251156115775782518084602001fd5b8160405162461bcd60e51b81526004016103b7919061169d565b6001600160a01b03811681146103c957600080fd5b6000602082840312156115b857600080fd5b813561142081611591565b6000602082840312156115d557600080fd5b5035919050565b600080604083850312156115ef57600080fd5b82356115fa81611591565b946020939093013593505050565b6000806040838503121561161b57600080fd5b823561162681611591565b9150602083013561163681611591565b809150509250929050565b60ff811681146103c957600080fd5b60006020828403121561166257600080fd5b813561142081611641565b60005b83811015611688578181015183820152602001611670565b83811115611697576000848401525b50505050565b60208152600082518060208401526116bc81604085016020870161166d565b601f01601f19169190910160400192915050565b6000806000606084860312156116e557600080fd5b83356116f081611591565b9250602084013561170081611591565b929592945050506040919091013590565b60006020828403121561172357600080fd5b815161142081611591565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b60006020828403121561178a57600080fd5b8151801515811461142057600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561180b5761180b6117e2565b500190565b600082821015611822576118226117e2565b500390565b6000816000190483118215151615611841576118416117e2565b500290565b60008261186357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561187a57600080fd5b5051919050565b60006020828403121561189357600080fd5b815161142081611641565b600082516118b081846020870161166d565b919091019291505056fe4261736520537472617465677920696d706c656d656e746174696f6e20746f20696e68657269742066726f6d20666f72206d6f726520636f6d706c657820696d706c656d656e746174696f6e73a264697066735822122010a959346f6109c589a9783919e1f435adfbf8e6f523baaaa3307a9e4b75ffcb64736f6c634300080c0033", + Bin: "0x60a06040523480156200001157600080fd5b5060405162001ab438038062001ab4833981016040819052620000349162000114565b6001600160a01b0381166080526200004b62000052565b5062000146565b600054610100900460ff1615620000bf5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000112576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012757600080fd5b81516001600160a01b03811681146200013f57600080fd5b9392505050565b60805161193d620001776000396000818161019901528181610570015281816109f50152610ac0015261193d6000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80635c975abb116100b8578063ab5921e11161007c578063ab5921e11461029c578063ce7c2ac2146102b1578063d9caed12146102c4578063e3dae51c146102d7578063f3e73875146102ea578063fabc1cbc146102fd57600080fd5b80635c975abb146102425780637a8b26371461024a578063886f11951461025d5780638c871019146102765780638f6a62401461028957600080fd5b806347e7ef24116100ff57806347e7ef24146101d2578063485cc955146101e5578063553ca5f8146101f8578063595c6a671461020b5780635ac86ab71461021357600080fd5b806310d67a2f1461013c578063136439dd146101515780632495a5991461016457806339b70e38146101945780633a98ef39146101bb575b600080fd5b61014f61014a3660046115a6565b610310565b005b61014f61015f3660046115c3565b6103cc565b603254610177906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101777f000000000000000000000000000000000000000000000000000000000000000081565b6101c460335481565b60405190815260200161018b565b6101c46101e03660046115dc565b610510565b61014f6101f3366004611608565b610754565b6101c46102063660046115a6565b610869565b61014f61087d565b610232610221366004611650565b6001805460ff9092161b9081161490565b604051901515815260200161018b565b6001546101c4565b6101c46102583660046115c3565b610949565b600054610177906201000090046001600160a01b031681565b6101c46102843660046115c3565b610994565b6101c46102973660046115a6565b61099f565b6102a46109ad565b60405161018b919061169d565b6101c46102bf3660046115a6565b6109cd565b61014f6102d23660046116d0565b610a62565b6101c46102e53660046115c3565b610c48565b6101c46102f83660046115c3565b610c81565b61014f61030b3660046115c3565b610c8c565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103879190611711565b6001600160a01b0316336001600160a01b0316146103c05760405162461bcd60e51b81526004016103b79061172e565b60405180910390fd5b6103c981610de8565b50565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa158015610419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043d9190611778565b6104595760405162461bcd60e51b81526004016103b79061179a565b600154818116146104d25760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c697479000000000000000060648201526084016103b7565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b600180546000918291811614156105655760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b60448201526064016103b7565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105dd5760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e6167657260448201526064016103b7565b6105e78484610eed565b60335460006105f86103e8836117f8565b905060006103e8610607610f6d565b61061191906117f8565b9050600061061f8783611810565b90508061062c8489611827565b6106369190611846565b95508561069c5760405162461bcd60e51b815260206004820152602e60248201527f5374726174656779426173652e6465706f7369743a206e65775368617265732060448201526d63616e6e6f74206265207a65726f60901b60648201526084016103b7565b6106a686856117f8565b60338190556f4b3b4ca85a86c47a098a223fffffffff10156107305760405162461bcd60e51b815260206004820152603c60248201527f5374726174656779426173652e6465706f7369743a20746f74616c536861726560448201527f73206578636565647320604d41585f544f54414c5f534841524553600000000060648201526084016103b7565b610749826103e860335461074491906117f8565b610fdf565b505050505092915050565b600054610100900460ff16158080156107745750600054600160ff909116105b8061078e5750303b15801561078e575060005460ff166001145b6107f15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103b7565b6000805460ff191660011790558015610814576000805461ff0019166101001790555b61081e8383611033565b8015610864576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6000610877610258836109cd565b92915050565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190611778565b61090a5760405162461bcd60e51b81526004016103b79061179a565b600019600181905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b6000806103e860335461095c91906117f8565b905060006103e861096b610f6d565b61097591906117f8565b9050816109828583611827565b61098c9190611846565b949350505050565b600061087782610c48565b60006108776102f8836109cd565b60606040518060800160405280604d81526020016118bb604d9139905090565b604051633d3f06c960e11b81526001600160a01b0382811660048301523060248301526000917f000000000000000000000000000000000000000000000000000000000000000090911690637a7e0d9290604401602060405180830381865afa158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108779190611868565b6001805460029081161415610ab55760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b60448201526064016103b7565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b2d5760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e6167657260448201526064016103b7565b610b3884848461117e565b60335480831115610bc75760405162461bcd60e51b815260206004820152604d60248201527f5374726174656779426173652e77697468647261773a20616d6f756e7453686160448201527f726573206d757374206265206c657373207468616e206f7220657175616c207460648201526c6f20746f74616c53686172657360981b608482015260a4016103b7565b6000610bd56103e8836117f8565b905060006103e8610be4610f6d565b610bee91906117f8565b9050600082610bfd8784611827565b610c079190611846565b9050610c138685611810565b603355610c33610c238284611810565b6103e860335461074491906117f8565b610c3e888883611201565b5050505050505050565b6000806103e8603354610c5b91906117f8565b905060006103e8610c6a610f6d565b610c7491906117f8565b9050806109828386611827565b600061087782610949565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d039190611711565b6001600160a01b0316336001600160a01b031614610d335760405162461bcd60e51b81526004016103b79061172e565b600154198119600154191614610db15760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c697479000000000000000060648201526084016103b7565b600181905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c90602001610505565b6001600160a01b038116610e765760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a4016103b7565b600054604080516001600160a01b03620100009093048316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b6032546001600160a01b03838116911614610f695760405162461bcd60e51b815260206004820152603660248201527f5374726174656779426173652e6465706f7369743a2043616e206f6e6c79206460448201527532b837b9b4ba103ab73232b9363cb4b733aa37b5b2b760511b60648201526084016103b7565b5050565b6032546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610fb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fda9190611868565b905090565b7fd2494f3479e5da49d386657c292c610b5b01df313d07c62eb0cfa49924a31be88161101384670de0b6b3a7640000611827565b61101d9190611846565b6040519081526020015b60405180910390a15050565b600054610100900460ff1661109e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016103b7565b603280546001600160a01b0319166001600160a01b0384161790556110c4816000611215565b7f1c540707b00eb5427b6b774fc799d756516a54aee108b64b327acc55af557507603260009054906101000a90046001600160a01b0316836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611139573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115d9190611881565b604080516001600160a01b03909316835260ff909116602083015201611027565b6032546001600160a01b038381169116146108645760405162461bcd60e51b815260206004820152603b60248201527f5374726174656779426173652e77697468647261773a2043616e206f6e6c792060448201527f77697468647261772074686520737472617465677920746f6b656e000000000060648201526084016103b7565b6108646001600160a01b0383168483611301565b6000546201000090046001600160a01b031615801561123c57506001600160a01b03821615155b6112be5760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a4016103b7565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2610f6982610de8565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526108649286929160009161139191851690849061140e565b80519091501561086457808060200190518101906113af9190611778565b6108645760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103b7565b606061141d8484600085611427565b90505b9392505050565b6060824710156114885760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103b7565b6001600160a01b0385163b6114df5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103b7565b600080866001600160a01b031685876040516114fb919061189e565b60006040518083038185875af1925050503d8060008114611538576040519150601f19603f3d011682016040523d82523d6000602084013e61153d565b606091505b509150915061154d828286611558565b979650505050505050565b60608315611567575081611420565b8251156115775782518084602001fd5b8160405162461bcd60e51b81526004016103b7919061169d565b6001600160a01b03811681146103c957600080fd5b6000602082840312156115b857600080fd5b813561142081611591565b6000602082840312156115d557600080fd5b5035919050565b600080604083850312156115ef57600080fd5b82356115fa81611591565b946020939093013593505050565b6000806040838503121561161b57600080fd5b823561162681611591565b9150602083013561163681611591565b809150509250929050565b60ff811681146103c957600080fd5b60006020828403121561166257600080fd5b813561142081611641565b60005b83811015611688578181015183820152602001611670565b83811115611697576000848401525b50505050565b60208152600082518060208401526116bc81604085016020870161166d565b601f01601f19169190910160400192915050565b6000806000606084860312156116e557600080fd5b83356116f081611591565b9250602084013561170081611591565b929592945050506040919091013590565b60006020828403121561172357600080fd5b815161142081611591565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b60006020828403121561178a57600080fd5b8151801515811461142057600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561180b5761180b6117e2565b500190565b600082821015611822576118226117e2565b500390565b6000816000190483118215151615611841576118416117e2565b500290565b60008261186357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561187a57600080fd5b5051919050565b60006020828403121561189357600080fd5b815161142081611641565b600082516118b081846020870161166d565b919091019291505056fe4261736520537472617465677920696d706c656d656e746174696f6e20746f20696e68657269742066726f6d20666f72206d6f726520636f6d706c657820696d706c656d656e746174696f6e73a264697066735822122006f21d4b63087ea9ba894376ef19ed421b9946babf9d1d7f28ace9e5b848c1d864736f6c634300080c0033", } // StrategyBaseABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/StrategyBaseTVLLimits/binding.go b/pkg/bindings/StrategyBaseTVLLimits/binding.go index c0b5f85d3..ab7dd3f70 100644 --- a/pkg/bindings/StrategyBaseTVLLimits/binding.go +++ b/pkg/bindings/StrategyBaseTVLLimits/binding.go @@ -32,7 +32,7 @@ var ( // StrategyBaseTVLLimitsMetaData contains all meta data concerning the StrategyBaseTVLLimits contract. var StrategyBaseTVLLimitsMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"newShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"explanation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getTVLLimits\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_maxPerDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_maxTotalDeposits\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_underlyingToken\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_underlyingToken\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"maxPerDeposit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxTotalDeposits\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setTVLLimits\",\"inputs\":[{\"name\":\"newMaxPerDeposit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"newMaxTotalDeposits\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"shares\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sharesToUnderlying\",\"inputs\":[{\"name\":\"amountShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sharesToUnderlyingView\",\"inputs\":[{\"name\":\"amountShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"totalShares\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"underlyingToShares\",\"inputs\":[{\"name\":\"amountUnderlying\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"underlyingToSharesView\",\"inputs\":[{\"name\":\"amountUnderlying\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"underlyingToken\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"userUnderlying\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"userUnderlyingView\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"},{\"name\":\"amountShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"ExchangeRateEmitted\",\"inputs\":[{\"name\":\"rate\",\"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\":\"MaxPerDepositUpdated\",\"inputs\":[{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MaxTotalDepositsUpdated\",\"inputs\":[{\"name\":\"previousValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"newValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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\":\"StrategyTokenSet\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"decimals\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"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}]", - Bin: "0x60a06040523480156200001157600080fd5b5060405162001f4d38038062001f4d833981016040819052620000349162000116565b6001600160a01b038116608052806200004c62000054565b505062000148565b600054610100900460ff1615620000c15760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000114576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012957600080fd5b81516001600160a01b03811681146200014157600080fd5b9392505050565b608051611dd46200017960003960008181610216015281816107a901528181610be70152610cb20152611dd46000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80635c975abb116100de578063ab5921e111610097578063df6fadc111610071578063df6fadc114610366578063e3dae51c14610381578063f3e7387514610394578063fabc1cbc146103a757600080fd5b8063ab5921e11461032b578063ce7c2ac214610340578063d9caed121461035357600080fd5b80635c975abb146102c857806361b01b5d146102d05780637a8b2637146102d9578063886f1195146102ec5780638c871019146103055780638f6a62401461031857600080fd5b80633a98ef391161014b578063485cc95511610125578063485cc9551461026b578063553ca5f81461027e578063595c6a67146102915780635ac86ab71461029957600080fd5b80633a98ef391461023857806343fe08b01461024f57806347e7ef241461025857600080fd5b8063019e27291461019357806310d67a2f146101a857806311c70c9d146101bb578063136439dd146101ce5780632495a599146101e157806339b70e3814610211575b600080fd5b6101a66101a1366004611983565b6103ba565b005b6101a66101b63660046119cd565b61049d565b6101a66101c93660046119ea565b610550565b6101a66101dc366004611a0c565b610605565b6032546101f4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101f47f000000000000000000000000000000000000000000000000000000000000000081565b61024160335481565b604051908152602001610208565b61024160645481565b610241610266366004611a25565b610749565b6101a6610279366004611a51565b61098d565b61024161028c3660046119cd565b610a5b565b6101a6610a6f565b6102b86102a7366004611a99565b6001805460ff9092161b9081161490565b6040519015158152602001610208565b600154610241565b61024160655481565b6102416102e7366004611a0c565b610b3b565b6000546101f4906201000090046001600160a01b031681565b610241610313366004611a0c565b610b86565b6102416103263660046119cd565b610b91565b610333610b9f565b6040516102089190611ae6565b61024161034e3660046119cd565b610bbf565b6101a6610361366004611b19565b610c54565b60645460655460408051928352602083019190915201610208565b61024161038f366004611a0c565b610e3a565b6102416103a2366004611a0c565b610e73565b6101a66103b5366004611a0c565b610e7e565b600054610100900460ff16158080156103da5750600054600160ff909116105b806103f45750303b1580156103f4575060005460ff166001145b6104195760405162461bcd60e51b815260040161041090611b5a565b60405180910390fd5b6000805460ff19166001179055801561043c576000805461ff0019166101001790555b6104468585610fda565b61045083836110e7565b8015610496576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105149190611ba8565b6001600160a01b0316336001600160a01b0316146105445760405162461bcd60e51b815260040161041090611bc5565b61054d8161123a565b50565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c79190611ba8565b6001600160a01b0316336001600160a01b0316146105f75760405162461bcd60e51b815260040161041090611bc5565b6106018282610fda565b5050565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa158015610652573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106769190611c0f565b6106925760405162461bcd60e51b815260040161041090611c31565b6001548181161461070b5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610410565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b6001805460009182918116141561079e5760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610410565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108165760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e616765726044820152606401610410565b610820848461133f565b60335460006108316103e883611c8f565b905060006103e8610840611421565b61084a9190611c8f565b905060006108588783611ca7565b9050806108658489611cbe565b61086f9190611cdd565b9550856108d55760405162461bcd60e51b815260206004820152602e60248201527f5374726174656779426173652e6465706f7369743a206e65775368617265732060448201526d63616e6e6f74206265207a65726f60901b6064820152608401610410565b6108df8685611c8f565b60338190556f4b3b4ca85a86c47a098a223fffffffff10156109695760405162461bcd60e51b815260206004820152603c60248201527f5374726174656779426173652e6465706f7369743a20746f74616c536861726560448201527f73206578636565647320604d41585f544f54414c5f53484152455360000000006064820152608401610410565b610982826103e860335461097d9190611c8f565b611493565b505050505092915050565b600054610100900460ff16158080156109ad5750600054600160ff909116105b806109c75750303b1580156109c7575060005460ff166001145b6109e35760405162461bcd60e51b815260040161041090611b5a565b6000805460ff191660011790558015610a06576000805461ff0019166101001790555b610a1083836110e7565b8015610a56576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6000610a696102e783610bbf565b92915050565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae09190611c0f565b610afc5760405162461bcd60e51b815260040161041090611c31565b600019600181905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b6000806103e8603354610b4e9190611c8f565b905060006103e8610b5d611421565b610b679190611c8f565b905081610b748583611cbe565b610b7e9190611cdd565b949350505050565b6000610a6982610e3a565b6000610a696103a283610bbf565b60606040518060800160405280604d8152602001611d52604d9139905090565b604051633d3f06c960e11b81526001600160a01b0382811660048301523060248301526000917f000000000000000000000000000000000000000000000000000000000000000090911690637a7e0d9290604401602060405180830381865afa158015610c30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a699190611cff565b6001805460029081161415610ca75760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610410565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d1f5760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e616765726044820152606401610410565b610d2a8484846114df565b60335480831115610db95760405162461bcd60e51b815260206004820152604d60248201527f5374726174656779426173652e77697468647261773a20616d6f756e7453686160448201527f726573206d757374206265206c657373207468616e206f7220657175616c207460648201526c6f20746f74616c53686172657360981b608482015260a401610410565b6000610dc76103e883611c8f565b905060006103e8610dd6611421565b610de09190611c8f565b9050600082610def8784611cbe565b610df99190611cdd565b9050610e058685611ca7565b603355610e25610e158284611ca7565b6103e860335461097d9190611c8f565b610e30888883611562565b5050505050505050565b6000806103e8603354610e4d9190611c8f565b905060006103e8610e5c611421565b610e669190611c8f565b905080610b748386611cbe565b6000610a6982610b3b565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ed1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef59190611ba8565b6001600160a01b0316336001600160a01b031614610f255760405162461bcd60e51b815260040161041090611bc5565b600154198119600154191614610fa35760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610410565b600181905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c9060200161073e565b60645460408051918252602082018490527ff97ed4e083acac67830025ecbc756d8fe847cdbdca4cee3fe1e128e98b54ecb5910160405180910390a160655460408051918252602082018390527f6ab181e0440bfbf4bacdf2e99674735ce6638005490688c5f994f5399353e452910160405180910390a1808211156110dc5760405162461bcd60e51b815260206004820152604b60248201527f53747261746567794261736554564c4c696d6974732e5f73657454564c4c696d60448201527f6974733a206d61785065724465706f7369742065786365656473206d6178546f60648201526a74616c4465706f7369747360a81b608482015260a401610410565b606491909155606555565b600054610100900460ff166111525760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610410565b603280546001600160a01b0319166001600160a01b038416179055611178816000611576565b7f1c540707b00eb5427b6b774fc799d756516a54aee108b64b327acc55af557507603260009054906101000a90046001600160a01b0316836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112119190611d18565b604080516001600160a01b03909316835260ff9091166020830152015b60405180910390a15050565b6001600160a01b0381166112c85760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610410565b600054604080516001600160a01b03620100009093048316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b6064548111156113a95760405162461bcd60e51b815260206004820152602f60248201527f53747261746567794261736554564c4c696d6974733a206d617820706572206460448201526e195c1bdcda5d08195e18d959591959608a1b6064820152608401610410565b6065546113b4611421565b11156114175760405162461bcd60e51b815260206004820152602c60248201527f53747261746567794261736554564c4c696d6974733a206d6178206465706f7360448201526b1a5d1cc8195e18d95959195960a21b6064820152608401610410565b6106018282611662565b6032546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148e9190611cff565b905090565b7fd2494f3479e5da49d386657c292c610b5b01df313d07c62eb0cfa49924a31be8816114c784670de0b6b3a7640000611cbe565b6114d19190611cdd565b60405190815260200161122e565b6032546001600160a01b03838116911614610a565760405162461bcd60e51b815260206004820152603b60248201527f5374726174656779426173652e77697468647261773a2043616e206f6e6c792060448201527f77697468647261772074686520737472617465677920746f6b656e00000000006064820152608401610410565b610a566001600160a01b03831684836116de565b6000546201000090046001600160a01b031615801561159d57506001600160a01b03821615155b61161f5760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610410565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a26106018261123a565b6032546001600160a01b038381169116146106015760405162461bcd60e51b815260206004820152603660248201527f5374726174656779426173652e6465706f7369743a2043616e206f6e6c79206460448201527532b837b9b4ba103ab73232b9363cb4b733aa37b5b2b760511b6064820152608401610410565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490840152610a569286929160009161176e9185169084906117eb565b805190915015610a56578080602001905181019061178c9190611c0f565b610a565760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610410565b60606117fa8484600085611804565b90505b9392505050565b6060824710156118655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610410565b6001600160a01b0385163b6118bc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610410565b600080866001600160a01b031685876040516118d89190611d35565b60006040518083038185875af1925050503d8060008114611915576040519150601f19603f3d011682016040523d82523d6000602084013e61191a565b606091505b509150915061192a828286611935565b979650505050505050565b606083156119445750816117fd565b8251156119545782518084602001fd5b8160405162461bcd60e51b81526004016104109190611ae6565b6001600160a01b038116811461054d57600080fd5b6000806000806080858703121561199957600080fd5b843593506020850135925060408501356119b28161196e565b915060608501356119c28161196e565b939692955090935050565b6000602082840312156119df57600080fd5b81356117fd8161196e565b600080604083850312156119fd57600080fd5b50508035926020909101359150565b600060208284031215611a1e57600080fd5b5035919050565b60008060408385031215611a3857600080fd5b8235611a438161196e565b946020939093013593505050565b60008060408385031215611a6457600080fd5b8235611a6f8161196e565b91506020830135611a7f8161196e565b809150509250929050565b60ff8116811461054d57600080fd5b600060208284031215611aab57600080fd5b81356117fd81611a8a565b60005b83811015611ad1578181015183820152602001611ab9565b83811115611ae0576000848401525b50505050565b6020815260008251806020840152611b05816040850160208701611ab6565b601f01601f19169190910160400192915050565b600080600060608486031215611b2e57600080fd5b8335611b398161196e565b92506020840135611b498161196e565b929592945050506040919091013590565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600060208284031215611bba57600080fd5b81516117fd8161196e565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b600060208284031215611c2157600080fd5b815180151581146117fd57600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115611ca257611ca2611c79565b500190565b600082821015611cb957611cb9611c79565b500390565b6000816000190483118215151615611cd857611cd8611c79565b500290565b600082611cfa57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611d1157600080fd5b5051919050565b600060208284031215611d2a57600080fd5b81516117fd81611a8a565b60008251611d47818460208701611ab6565b919091019291505056fe4261736520537472617465677920696d706c656d656e746174696f6e20746f20696e68657269742066726f6d20666f72206d6f726520636f6d706c657820696d706c656d656e746174696f6e73a26469706673582212208549fd2100ff79e56d7fded410ac662be502dbe16e18a815844148c99c0b5bc864736f6c634300080c0033", + Bin: "0x60a06040523480156200001157600080fd5b5060405162001f4d38038062001f4d833981016040819052620000349162000116565b6001600160a01b038116608052806200004c62000054565b505062000148565b600054610100900460ff1615620000c15760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000114576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012957600080fd5b81516001600160a01b03811681146200014157600080fd5b9392505050565b608051611dd46200017960003960008181610216015281816107a901528181610be70152610cb20152611dd46000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80635c975abb116100de578063ab5921e111610097578063df6fadc111610071578063df6fadc114610366578063e3dae51c14610381578063f3e7387514610394578063fabc1cbc146103a757600080fd5b8063ab5921e11461032b578063ce7c2ac214610340578063d9caed121461035357600080fd5b80635c975abb146102c857806361b01b5d146102d05780637a8b2637146102d9578063886f1195146102ec5780638c871019146103055780638f6a62401461031857600080fd5b80633a98ef391161014b578063485cc95511610125578063485cc9551461026b578063553ca5f81461027e578063595c6a67146102915780635ac86ab71461029957600080fd5b80633a98ef391461023857806343fe08b01461024f57806347e7ef241461025857600080fd5b8063019e27291461019357806310d67a2f146101a857806311c70c9d146101bb578063136439dd146101ce5780632495a599146101e157806339b70e3814610211575b600080fd5b6101a66101a1366004611983565b6103ba565b005b6101a66101b63660046119cd565b61049d565b6101a66101c93660046119ea565b610550565b6101a66101dc366004611a0c565b610605565b6032546101f4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101f47f000000000000000000000000000000000000000000000000000000000000000081565b61024160335481565b604051908152602001610208565b61024160645481565b610241610266366004611a25565b610749565b6101a6610279366004611a51565b61098d565b61024161028c3660046119cd565b610a5b565b6101a6610a6f565b6102b86102a7366004611a99565b6001805460ff9092161b9081161490565b6040519015158152602001610208565b600154610241565b61024160655481565b6102416102e7366004611a0c565b610b3b565b6000546101f4906201000090046001600160a01b031681565b610241610313366004611a0c565b610b86565b6102416103263660046119cd565b610b91565b610333610b9f565b6040516102089190611ae6565b61024161034e3660046119cd565b610bbf565b6101a6610361366004611b19565b610c54565b60645460655460408051928352602083019190915201610208565b61024161038f366004611a0c565b610e3a565b6102416103a2366004611a0c565b610e73565b6101a66103b5366004611a0c565b610e7e565b600054610100900460ff16158080156103da5750600054600160ff909116105b806103f45750303b1580156103f4575060005460ff166001145b6104195760405162461bcd60e51b815260040161041090611b5a565b60405180910390fd5b6000805460ff19166001179055801561043c576000805461ff0019166101001790555b6104468585610fda565b61045083836110e7565b8015610496576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105149190611ba8565b6001600160a01b0316336001600160a01b0316146105445760405162461bcd60e51b815260040161041090611bc5565b61054d8161123a565b50565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c79190611ba8565b6001600160a01b0316336001600160a01b0316146105f75760405162461bcd60e51b815260040161041090611bc5565b6106018282610fda565b5050565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa158015610652573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106769190611c0f565b6106925760405162461bcd60e51b815260040161041090611c31565b6001548181161461070b5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610410565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b6001805460009182918116141561079e5760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610410565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108165760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e616765726044820152606401610410565b610820848461133f565b60335460006108316103e883611c8f565b905060006103e8610840611421565b61084a9190611c8f565b905060006108588783611ca7565b9050806108658489611cbe565b61086f9190611cdd565b9550856108d55760405162461bcd60e51b815260206004820152602e60248201527f5374726174656779426173652e6465706f7369743a206e65775368617265732060448201526d63616e6e6f74206265207a65726f60901b6064820152608401610410565b6108df8685611c8f565b60338190556f4b3b4ca85a86c47a098a223fffffffff10156109695760405162461bcd60e51b815260206004820152603c60248201527f5374726174656779426173652e6465706f7369743a20746f74616c536861726560448201527f73206578636565647320604d41585f544f54414c5f53484152455360000000006064820152608401610410565b610982826103e860335461097d9190611c8f565b611493565b505050505092915050565b600054610100900460ff16158080156109ad5750600054600160ff909116105b806109c75750303b1580156109c7575060005460ff166001145b6109e35760405162461bcd60e51b815260040161041090611b5a565b6000805460ff191660011790558015610a06576000805461ff0019166101001790555b610a1083836110e7565b8015610a56576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6000610a696102e783610bbf565b92915050565b60005460405163237dfb4760e11b8152336004820152620100009091046001600160a01b0316906346fbf68e90602401602060405180830381865afa158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae09190611c0f565b610afc5760405162461bcd60e51b815260040161041090611c31565b600019600181905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b6000806103e8603354610b4e9190611c8f565b905060006103e8610b5d611421565b610b679190611c8f565b905081610b748583611cbe565b610b7e9190611cdd565b949350505050565b6000610a6982610e3a565b6000610a696103a283610bbf565b60606040518060800160405280604d8152602001611d52604d9139905090565b604051633d3f06c960e11b81526001600160a01b0382811660048301523060248301526000917f000000000000000000000000000000000000000000000000000000000000000090911690637a7e0d9290604401602060405180830381865afa158015610c30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a699190611cff565b6001805460029081161415610ca75760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610410565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d1f5760405162461bcd60e51b815260206004820181905260248201527f5374726174656779426173652e6f6e6c7953747261746567794d616e616765726044820152606401610410565b610d2a8484846114df565b60335480831115610db95760405162461bcd60e51b815260206004820152604d60248201527f5374726174656779426173652e77697468647261773a20616d6f756e7453686160448201527f726573206d757374206265206c657373207468616e206f7220657175616c207460648201526c6f20746f74616c53686172657360981b608482015260a401610410565b6000610dc76103e883611c8f565b905060006103e8610dd6611421565b610de09190611c8f565b9050600082610def8784611cbe565b610df99190611cdd565b9050610e058685611ca7565b603355610e25610e158284611ca7565b6103e860335461097d9190611c8f565b610e30888883611562565b5050505050505050565b6000806103e8603354610e4d9190611c8f565b905060006103e8610e5c611421565b610e669190611c8f565b905080610b748386611cbe565b6000610a6982610b3b565b600060029054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ed1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef59190611ba8565b6001600160a01b0316336001600160a01b031614610f255760405162461bcd60e51b815260040161041090611bc5565b600154198119600154191614610fa35760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610410565b600181905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c9060200161073e565b60645460408051918252602082018490527ff97ed4e083acac67830025ecbc756d8fe847cdbdca4cee3fe1e128e98b54ecb5910160405180910390a160655460408051918252602082018390527f6ab181e0440bfbf4bacdf2e99674735ce6638005490688c5f994f5399353e452910160405180910390a1808211156110dc5760405162461bcd60e51b815260206004820152604b60248201527f53747261746567794261736554564c4c696d6974732e5f73657454564c4c696d60448201527f6974733a206d61785065724465706f7369742065786365656473206d6178546f60648201526a74616c4465706f7369747360a81b608482015260a401610410565b606491909155606555565b600054610100900460ff166111525760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610410565b603280546001600160a01b0319166001600160a01b038416179055611178816000611576565b7f1c540707b00eb5427b6b774fc799d756516a54aee108b64b327acc55af557507603260009054906101000a90046001600160a01b0316836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112119190611d18565b604080516001600160a01b03909316835260ff9091166020830152015b60405180910390a15050565b6001600160a01b0381166112c85760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610410565b600054604080516001600160a01b03620100009093048316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b6064548111156113a95760405162461bcd60e51b815260206004820152602f60248201527f53747261746567794261736554564c4c696d6974733a206d617820706572206460448201526e195c1bdcda5d08195e18d959591959608a1b6064820152608401610410565b6065546113b4611421565b11156114175760405162461bcd60e51b815260206004820152602c60248201527f53747261746567794261736554564c4c696d6974733a206d6178206465706f7360448201526b1a5d1cc8195e18d95959195960a21b6064820152608401610410565b6106018282611662565b6032546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148e9190611cff565b905090565b7fd2494f3479e5da49d386657c292c610b5b01df313d07c62eb0cfa49924a31be8816114c784670de0b6b3a7640000611cbe565b6114d19190611cdd565b60405190815260200161122e565b6032546001600160a01b03838116911614610a565760405162461bcd60e51b815260206004820152603b60248201527f5374726174656779426173652e77697468647261773a2043616e206f6e6c792060448201527f77697468647261772074686520737472617465677920746f6b656e00000000006064820152608401610410565b610a566001600160a01b03831684836116de565b6000546201000090046001600160a01b031615801561159d57506001600160a01b03821615155b61161f5760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610410565b600181905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a26106018261123a565b6032546001600160a01b038381169116146106015760405162461bcd60e51b815260206004820152603660248201527f5374726174656779426173652e6465706f7369743a2043616e206f6e6c79206460448201527532b837b9b4ba103ab73232b9363cb4b733aa37b5b2b760511b6064820152608401610410565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490840152610a569286929160009161176e9185169084906117eb565b805190915015610a56578080602001905181019061178c9190611c0f565b610a565760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610410565b60606117fa8484600085611804565b90505b9392505050565b6060824710156118655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610410565b6001600160a01b0385163b6118bc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610410565b600080866001600160a01b031685876040516118d89190611d35565b60006040518083038185875af1925050503d8060008114611915576040519150601f19603f3d011682016040523d82523d6000602084013e61191a565b606091505b509150915061192a828286611935565b979650505050505050565b606083156119445750816117fd565b8251156119545782518084602001fd5b8160405162461bcd60e51b81526004016104109190611ae6565b6001600160a01b038116811461054d57600080fd5b6000806000806080858703121561199957600080fd5b843593506020850135925060408501356119b28161196e565b915060608501356119c28161196e565b939692955090935050565b6000602082840312156119df57600080fd5b81356117fd8161196e565b600080604083850312156119fd57600080fd5b50508035926020909101359150565b600060208284031215611a1e57600080fd5b5035919050565b60008060408385031215611a3857600080fd5b8235611a438161196e565b946020939093013593505050565b60008060408385031215611a6457600080fd5b8235611a6f8161196e565b91506020830135611a7f8161196e565b809150509250929050565b60ff8116811461054d57600080fd5b600060208284031215611aab57600080fd5b81356117fd81611a8a565b60005b83811015611ad1578181015183820152602001611ab9565b83811115611ae0576000848401525b50505050565b6020815260008251806020840152611b05816040850160208701611ab6565b601f01601f19169190910160400192915050565b600080600060608486031215611b2e57600080fd5b8335611b398161196e565b92506020840135611b498161196e565b929592945050506040919091013590565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600060208284031215611bba57600080fd5b81516117fd8161196e565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b600060208284031215611c2157600080fd5b815180151581146117fd57600080fd5b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115611ca257611ca2611c79565b500190565b600082821015611cb957611cb9611c79565b500390565b6000816000190483118215151615611cd857611cd8611c79565b500290565b600082611cfa57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611d1157600080fd5b5051919050565b600060208284031215611d2a57600080fd5b81516117fd81611a8a565b60008251611d47818460208701611ab6565b919091019291505056fe4261736520537472617465677920696d706c656d656e746174696f6e20746f20696e68657269742066726f6d20666f72206d6f726520636f6d706c657820696d706c656d656e746174696f6e73a264697066735822122047c5f009962805b39fd6e7dd5a459c4ca361f275862473dc47f5e93c304615b164736f6c634300080c0033", } // StrategyBaseTVLLimitsABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/StrategyFactory/binding.go b/pkg/bindings/StrategyFactory/binding.go index cd0633c74..9bd068a34 100644 --- a/pkg/bindings/StrategyFactory/binding.go +++ b/pkg/bindings/StrategyFactory/binding.go @@ -32,7 +32,7 @@ var ( // StrategyFactoryMetaData contains all meta data concerning the StrategyFactory contract. var StrategyFactoryMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"blacklistTokens\",\"inputs\":[{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deployNewStrategy\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[{\"name\":\"newStrategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deployedStrategies\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"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\":\"_strategyBeacon\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isBlacklisted\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIERC20\"}],\"outputs\":[{\"name\":\"\",\"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\":\"removeStrategiesFromWhitelist\",\"inputs\":[{\"name\":\"strategiesToRemoveFromWhitelist\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"setThirdPartyTransfersForbidden\",\"inputs\":[{\"name\":\"strategy\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"},{\"name\":\"value\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"strategyBeacon\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"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\":\"whitelistStrategies\",\"inputs\":[{\"name\":\"strategiesToWhitelist\",\"type\":\"address[]\",\"internalType\":\"contractIStrategy[]\"},{\"name\":\"thirdPartyTransfersForbiddenValues\",\"type\":\"bool[]\",\"internalType\":\"bool[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"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\":\"StrategyBeaconModified\",\"inputs\":[{\"name\":\"previousBeacon\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIBeacon\"},{\"name\":\"newBeacon\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIBeacon\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"StrategySetForToken\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"},{\"name\":\"strategy\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIStrategy\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TokenBlacklisted\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIERC20\"}],\"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}]", - Bin: "0x60a06040523480156200001157600080fd5b50604051620024ae380380620024ae833981016040819052620000349162000114565b6001600160a01b0381166080526200004b62000052565b5062000146565b603354610100900460ff1615620000bf5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60335460ff908116101562000112576033805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012757600080fd5b81516001600160a01b03811681146200013f57600080fd5b9392505050565b608051612329620001856000396000818161019701528181610829015281816108cc01528181610a1d01528181610d4a015261111101526123296000f3fe60806040523480156200001157600080fd5b5060043610620001455760003560e01c80636b9b622911620000bb578063f0062d9a116200007a578063f0062d9a14620002e1578063f2fde38b14620002f5578063fabc1cbc146200030c578063fe38b32d1462000323578063fe575a87146200033a57600080fd5b80636b9b62291462000283578063715018a6146200029a578063886f119514620002a45780638da5cb5b14620002b8578063be20309414620002ca57600080fd5b8063581dfd651162000108578063581dfd6514620001ed578063595c6a6714620002195780635ac86ab714620002235780635c975abb146200025a578063697d54b4146200026c57600080fd5b806310d67a2f146200014a578063136439dd146200016357806323103c41146200017a57806339b70e3814620001915780634e5a426314620001d6575b600080fd5b620001616200015b366004620014d8565b62000360565b005b6200016162000174366004620014ff565b62000424565b620001616200018b36600462001568565b6200056b565b620001b97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b62000161620001e7366004620015bd565b6200089b565b620001b9620001fe366004620014d8565b6001602052600090815260409020546001600160a01b031681565b620001616200092f565b6200024962000234366004620015fb565b609954600160ff9092169190911b9081161490565b6040519015158152602001620001cd565b609954604051908152602001620001cd565b620001616200027d36600462001620565b620009fc565b620001b962000294366004620014d8565b62000a5a565b6200016162000dc1565b609854620001b9906001600160a01b031681565b6066546001600160a01b0316620001b9565b62000161620002db36600462001693565b62000dd9565b600054620001b9906001600160a01b031681565b6200016162000306366004620014d8565b62000f0f565b620001616200031d366004620014ff565b62000f8b565b620001616200033436600462001568565b620010f0565b620002496200034b366004620014d8565b60026020526000908152604090205460ff1681565b609860009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620003b4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003da9190620016ed565b6001600160a01b0316336001600160a01b031614620004165760405162461bcd60e51b81526004016200040d906200170d565b60405180910390fd5b62000421816200114a565b50565b60985460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156200046d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000493919062001757565b620004b25760405162461bcd60e51b81526004016200040d9062001777565b609954818116146200052d5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c697479000000000000000060648201526084016200040d565b609981905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b6200057562001243565b60008167ffffffffffffffff811115620005935762000593620017bf565b604051908082528060200260200182016040528015620005bd578160200160208202803683370190505b5090506000805b83811015620008075760026000868684818110620005e657620005e6620017d5565b9050602002016020810190620005fd9190620014d8565b6001600160a01b0316815260208101919091526040016000205460ff16156200069b5760405162461bcd60e51b815260206004820152604360248201527f5374726174656779466163746f72792e626c61636b6c697374546f6b656e733a60448201527f2043616e6e6f7420626c61636b6c697374206465706c6f79656420737472617460648201526265677960e81b608482015260a4016200040d565b600160026000878785818110620006b657620006b6620017d5565b9050602002016020810190620006cd9190620014d8565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f75519c51f39873ec0e27dd3bbc09549e4865a113f505393fb9eab5898f6418b38585838181106200072b576200072b620017d5565b9050602002016020810190620007429190620014d8565b6040516001600160a01b03909116815260200160405180910390a1600060016000878785818110620007785762000778620017d5565b90506020020160208101906200078f9190620014d8565b6001600160a01b0390811682526020820192909252604001600020541690508015620007f35780848481518110620007cb57620007cb620017d5565b6001600160a01b039092166020928302919091019091015282620007ef81620017eb565b9350505b50620007ff81620017eb565b9050620005c4565b50808252801562000895576040516316bb16b760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b5d8b5b890620008609085906004016200185b565b600060405180830381600087803b1580156200087b57600080fd5b505af115801562000890573d6000803e3d6000fd5b505050505b50505050565b620008a562001243565b604051634e5a426360e01b81526001600160a01b03838116600483015282151560248301527f00000000000000000000000000000000000000000000000000000000000000001690634e5a4263906044015b600060405180830381600087803b1580156200091257600080fd5b505af115801562000927573d6000803e3d6000fd5b505050505050565b60985460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa15801562000978573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200099e919062001757565b620009bd5760405162461bcd60e51b81526004016200040d9062001777565b600019609981905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b62000a0662001243565b60405163df5b354760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063df5b35479062000860908790879087908790600401620018b2565b60995460009081906001908116141562000ab75760405162461bcd60e51b815260206004820152601960248201527f5061757361626c653a20696e646578206973207061757365640000000000000060448201526064016200040d565b6001600160a01b03831660009081526002602052604090205460ff161562000b485760405162461bcd60e51b815260206004820152603760248201527f5374726174656779466163746f72792e6465706c6f794e65775374726174656760448201527f793a20546f6b656e20697320626c61636b6c697374656400000000000000000060648201526084016200040d565b6001600160a01b03838116600090815260016020526040902054161562000be65760405162461bcd60e51b8152602060048201526044602482018190527f5374726174656779466163746f72792e6465706c6f794e657753747261746567908201527f793a20537472617465677920616c72656164792065786973747320666f72207460648201526337b5b2b760e11b608482015260a4016200040d565b600080546098546040516001600160a01b038781166024830152918216604482015291169063485cc95560e01b9060640160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000c5690620014b4565b62000c6392919062001916565b604051809103906000f08015801562000c80573d6000803e3d6000fd5b50905062000c8f84826200129f565b604080516001808252818301909252600091602080830190803683375050604080516001808252818301909252929350600092915060208083019080368337019050509050828260008151811062000ceb5762000ceb620017d5565b60200260200101906001600160a01b031690816001600160a01b03168152505060008160008151811062000d235762000d23620017d5565b9115156020928302919091019091015260405163df5b354760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063df5b35479062000d8390859085906004016200197e565b600060405180830381600087803b15801562000d9e57600080fd5b505af115801562000db3573d6000803e3d6000fd5b509498975050505050505050565b62000dcb62001243565b62000dd760006200130a565b565b603354610100900460ff161580801562000dfa5750603354600160ff909116105b8062000e165750303b15801562000e16575060335460ff166001145b62000e7b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200040d565b6033805460ff19166001179055801562000e9f576033805461ff0019166101001790555b62000eaa856200130a565b62000eb684846200135c565b62000ec1826200144b565b801562000f08576033805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b62000f1962001243565b6001600160a01b03811662000f805760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200040d565b62000421816200130a565b609860009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000fdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010059190620016ed565b6001600160a01b0316336001600160a01b031614620010385760405162461bcd60e51b81526004016200040d906200170d565b609954198119609954191614620010b85760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c697479000000000000000060648201526084016200040d565b609981905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c9060200162000560565b620010fa62001243565b6040516316bb16b760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b5d8b5b890620008f79085908590600401620019db565b6001600160a01b038116620011da5760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a4016200040d565b609854604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1609880546001600160a01b0319166001600160a01b0392909216919091179055565b6066546001600160a01b0316331462000dd75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200040d565b6001600160a01b0382811660008181526001602090815260409182902080546001600160a01b031916948616948517905581519283528201929092527f6852a55230ef089d785bce7ffbf757985de34026df90a87d7b4a6e56f95d251f910160405180910390a15050565b606680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6098546001600160a01b03161580156200137e57506001600160a01b03821615155b620014025760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a4016200040d565b609981905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a262001447826200114a565b5050565b600054604080516001600160a01b03928316815291831660208301527fe21755962a7d7e100b59b9c3e4d4b54085b146313719955efb6a7a25c5c7feee910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6108fa80620019fa83390190565b6001600160a01b03811681146200042157600080fd5b600060208284031215620014eb57600080fd5b8135620014f881620014c2565b9392505050565b6000602082840312156200151257600080fd5b5035919050565b60008083601f8401126200152c57600080fd5b50813567ffffffffffffffff8111156200154557600080fd5b6020830191508360208260051b85010111156200156157600080fd5b9250929050565b600080602083850312156200157c57600080fd5b823567ffffffffffffffff8111156200159457600080fd5b620015a28582860162001519565b90969095509350505050565b80151581146200042157600080fd5b60008060408385031215620015d157600080fd5b8235620015de81620014c2565b91506020830135620015f081620015ae565b809150509250929050565b6000602082840312156200160e57600080fd5b813560ff81168114620014f857600080fd5b600080600080604085870312156200163757600080fd5b843567ffffffffffffffff808211156200165057600080fd5b6200165e8883890162001519565b909650945060208701359150808211156200167857600080fd5b50620016878782880162001519565b95989497509550505050565b60008060008060808587031215620016aa57600080fd5b8435620016b781620014c2565b93506020850135620016c981620014c2565b9250604085013591506060850135620016e281620014c2565b939692955090935050565b6000602082840312156200170057600080fd5b8151620014f881620014c2565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b6000602082840312156200176a57600080fd5b8151620014f881620015ae565b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006000198214156200180e57634e487b7160e01b600052601160045260246000fd5b5060010190565b600081518084526020808501945080840160005b83811015620018505781516001600160a01b03168752958201959082019060010162001829565b509495945050505050565b602081526000620014f8602083018462001815565b8183526000602080850194508260005b85811015620018505781356200189681620014c2565b6001600160a01b03168752958201959082019060010162001880565b604081526000620018c860408301868862001870565b8281036020848101919091528482528591810160005b8681101562001909578335620018f481620015ae565b151582529282019290820190600101620018de565b5098975050505050505050565b60018060a01b038316815260006020604081840152835180604085015260005b81811015620019545785810183015185820160600152820162001936565b8181111562001967576000606083870101525b50601f01601f191692909201606001949350505050565b60408152600062001993604083018562001815565b82810360208481019190915284518083528582019282019060005b81811015620019ce578451151583529383019391830191600101620019ae565b5090979650505050505050565b602081526000620019f160208301848662001870565b94935050505056fe60806040526040516108fa3803806108fa83398101604081905261002291610456565b61002e82826000610035565b5050610580565b61003e83610100565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100fb576100f9836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e99190610516565b836102a360201b6100291760201c565b505b505050565b610113816102cf60201b6100551760201c565b6101725760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101e6816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610516565b6102cf60201b6100551760201c565b61024b5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610169565b806102827fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5060001b6102de60201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606102c883836040518060600160405280602781526020016108d3602791396102e1565b9392505050565b6001600160a01b03163b151590565b90565b60606001600160a01b0384163b6103495760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610169565b600080856001600160a01b0316856040516103649190610531565b600060405180830381855af49150503d806000811461039f576040519150601f19603f3d011682016040523d82523d6000602084013e6103a4565b606091505b5090925090506103b58282866103bf565b9695505050505050565b606083156103ce5750816102c8565b8251156103de5782518084602001fd5b8160405162461bcd60e51b8152600401610169919061054d565b80516001600160a01b038116811461040f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561044557818101518382015260200161042d565b838111156100f95750506000910152565b6000806040838503121561046957600080fd5b610472836103f8565b60208401519092506001600160401b038082111561048f57600080fd5b818501915085601f8301126104a357600080fd5b8151818111156104b5576104b5610414565b604051601f8201601f19908116603f011681019083821181831017156104dd576104dd610414565b816040528281528860208487010111156104f657600080fd5b61050783602083016020880161042a565b80955050505050509250929050565b60006020828403121561052857600080fd5b6102c8826103f8565b6000825161054381846020870161042a565b9190910192915050565b602081526000825180602084015261056c81604085016020870161042a565b601f01601f19169190910160400192915050565b6103448061058f6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b610100565b565b606061004e83836040518060600160405280602781526020016102e860279139610124565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fb919061023f565b905090565b3660008037600080366000845af43d6000803e80801561011f573d6000f35b3d6000fd5b60606001600160a01b0384163b6101915760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101ac9190610298565b600060405180830381855af49150503d80600081146101e7576040519150601f19603f3d011682016040523d82523d6000602084013e6101ec565b606091505b50915091506101fc828286610206565b9695505050505050565b6060831561021557508161004e565b8251156102255782518084602001fd5b8160405162461bcd60e51b815260040161018891906102b4565b60006020828403121561025157600080fd5b81516001600160a01b038116811461004e57600080fd5b60005b8381101561028357818101518382015260200161026b565b83811115610292576000848401525b50505050565b600082516102aa818460208701610268565b9190910192915050565b60208152600082518060208401526102d3816040850160208701610268565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206225174df4b558257f66ac9aa53b52c29cdd29a561b03eb6d75a95018aff3e5864736f6c634300080c0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205ec4c51d66eda3a5cc6c4836684b038a334a62fe205ea7e8aaa91c0a44cd1bb364736f6c634300080c0033", + Bin: "0x60a06040523480156200001157600080fd5b50604051620024ae380380620024ae833981016040819052620000349162000114565b6001600160a01b0381166080526200004b62000052565b5062000146565b603354610100900460ff1615620000bf5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60335460ff908116101562000112576033805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012757600080fd5b81516001600160a01b03811681146200013f57600080fd5b9392505050565b608051612329620001856000396000818161019701528181610829015281816108cc01528181610a1d01528181610d4a015261111101526123296000f3fe60806040523480156200001157600080fd5b5060043610620001455760003560e01c80636b9b622911620000bb578063f0062d9a116200007a578063f0062d9a14620002e1578063f2fde38b14620002f5578063fabc1cbc146200030c578063fe38b32d1462000323578063fe575a87146200033a57600080fd5b80636b9b62291462000283578063715018a6146200029a578063886f119514620002a45780638da5cb5b14620002b8578063be20309414620002ca57600080fd5b8063581dfd651162000108578063581dfd6514620001ed578063595c6a6714620002195780635ac86ab714620002235780635c975abb146200025a578063697d54b4146200026c57600080fd5b806310d67a2f146200014a578063136439dd146200016357806323103c41146200017a57806339b70e3814620001915780634e5a426314620001d6575b600080fd5b620001616200015b366004620014d8565b62000360565b005b6200016162000174366004620014ff565b62000424565b620001616200018b36600462001568565b6200056b565b620001b97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b62000161620001e7366004620015bd565b6200089b565b620001b9620001fe366004620014d8565b6001602052600090815260409020546001600160a01b031681565b620001616200092f565b6200024962000234366004620015fb565b609954600160ff9092169190911b9081161490565b6040519015158152602001620001cd565b609954604051908152602001620001cd565b620001616200027d36600462001620565b620009fc565b620001b962000294366004620014d8565b62000a5a565b6200016162000dc1565b609854620001b9906001600160a01b031681565b6066546001600160a01b0316620001b9565b62000161620002db36600462001693565b62000dd9565b600054620001b9906001600160a01b031681565b6200016162000306366004620014d8565b62000f0f565b620001616200031d366004620014ff565b62000f8b565b620001616200033436600462001568565b620010f0565b620002496200034b366004620014d8565b60026020526000908152604090205460ff1681565b609860009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620003b4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003da9190620016ed565b6001600160a01b0316336001600160a01b031614620004165760405162461bcd60e51b81526004016200040d906200170d565b60405180910390fd5b62000421816200114a565b50565b60985460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156200046d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000493919062001757565b620004b25760405162461bcd60e51b81526004016200040d9062001777565b609954818116146200052d5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c697479000000000000000060648201526084016200040d565b609981905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b6200057562001243565b60008167ffffffffffffffff811115620005935762000593620017bf565b604051908082528060200260200182016040528015620005bd578160200160208202803683370190505b5090506000805b83811015620008075760026000868684818110620005e657620005e6620017d5565b9050602002016020810190620005fd9190620014d8565b6001600160a01b0316815260208101919091526040016000205460ff16156200069b5760405162461bcd60e51b815260206004820152604360248201527f5374726174656779466163746f72792e626c61636b6c697374546f6b656e733a60448201527f2043616e6e6f7420626c61636b6c697374206465706c6f79656420737472617460648201526265677960e81b608482015260a4016200040d565b600160026000878785818110620006b657620006b6620017d5565b9050602002016020810190620006cd9190620014d8565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f75519c51f39873ec0e27dd3bbc09549e4865a113f505393fb9eab5898f6418b38585838181106200072b576200072b620017d5565b9050602002016020810190620007429190620014d8565b6040516001600160a01b03909116815260200160405180910390a1600060016000878785818110620007785762000778620017d5565b90506020020160208101906200078f9190620014d8565b6001600160a01b0390811682526020820192909252604001600020541690508015620007f35780848481518110620007cb57620007cb620017d5565b6001600160a01b039092166020928302919091019091015282620007ef81620017eb565b9350505b50620007ff81620017eb565b9050620005c4565b50808252801562000895576040516316bb16b760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b5d8b5b890620008609085906004016200185b565b600060405180830381600087803b1580156200087b57600080fd5b505af115801562000890573d6000803e3d6000fd5b505050505b50505050565b620008a562001243565b604051634e5a426360e01b81526001600160a01b03838116600483015282151560248301527f00000000000000000000000000000000000000000000000000000000000000001690634e5a4263906044015b600060405180830381600087803b1580156200091257600080fd5b505af115801562000927573d6000803e3d6000fd5b505050505050565b60985460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa15801562000978573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200099e919062001757565b620009bd5760405162461bcd60e51b81526004016200040d9062001777565b600019609981905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b62000a0662001243565b60405163df5b354760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063df5b35479062000860908790879087908790600401620018b2565b60995460009081906001908116141562000ab75760405162461bcd60e51b815260206004820152601960248201527f5061757361626c653a20696e646578206973207061757365640000000000000060448201526064016200040d565b6001600160a01b03831660009081526002602052604090205460ff161562000b485760405162461bcd60e51b815260206004820152603760248201527f5374726174656779466163746f72792e6465706c6f794e65775374726174656760448201527f793a20546f6b656e20697320626c61636b6c697374656400000000000000000060648201526084016200040d565b6001600160a01b03838116600090815260016020526040902054161562000be65760405162461bcd60e51b8152602060048201526044602482018190527f5374726174656779466163746f72792e6465706c6f794e657753747261746567908201527f793a20537472617465677920616c72656164792065786973747320666f72207460648201526337b5b2b760e11b608482015260a4016200040d565b600080546098546040516001600160a01b038781166024830152918216604482015291169063485cc95560e01b9060640160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000c5690620014b4565b62000c6392919062001916565b604051809103906000f08015801562000c80573d6000803e3d6000fd5b50905062000c8f84826200129f565b604080516001808252818301909252600091602080830190803683375050604080516001808252818301909252929350600092915060208083019080368337019050509050828260008151811062000ceb5762000ceb620017d5565b60200260200101906001600160a01b031690816001600160a01b03168152505060008160008151811062000d235762000d23620017d5565b9115156020928302919091019091015260405163df5b354760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063df5b35479062000d8390859085906004016200197e565b600060405180830381600087803b15801562000d9e57600080fd5b505af115801562000db3573d6000803e3d6000fd5b509498975050505050505050565b62000dcb62001243565b62000dd760006200130a565b565b603354610100900460ff161580801562000dfa5750603354600160ff909116105b8062000e165750303b15801562000e16575060335460ff166001145b62000e7b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200040d565b6033805460ff19166001179055801562000e9f576033805461ff0019166101001790555b62000eaa856200130a565b62000eb684846200135c565b62000ec1826200144b565b801562000f08576033805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b62000f1962001243565b6001600160a01b03811662000f805760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200040d565b62000421816200130a565b609860009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000fdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010059190620016ed565b6001600160a01b0316336001600160a01b031614620010385760405162461bcd60e51b81526004016200040d906200170d565b609954198119609954191614620010b85760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c697479000000000000000060648201526084016200040d565b609981905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c9060200162000560565b620010fa62001243565b6040516316bb16b760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b5d8b5b890620008f79085908590600401620019db565b6001600160a01b038116620011da5760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a4016200040d565b609854604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1609880546001600160a01b0319166001600160a01b0392909216919091179055565b6066546001600160a01b0316331462000dd75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200040d565b6001600160a01b0382811660008181526001602090815260409182902080546001600160a01b031916948616948517905581519283528201929092527f6852a55230ef089d785bce7ffbf757985de34026df90a87d7b4a6e56f95d251f910160405180910390a15050565b606680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6098546001600160a01b03161580156200137e57506001600160a01b03821615155b620014025760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a4016200040d565b609981905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a262001447826200114a565b5050565b600054604080516001600160a01b03928316815291831660208301527fe21755962a7d7e100b59b9c3e4d4b54085b146313719955efb6a7a25c5c7feee910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6108fa80620019fa83390190565b6001600160a01b03811681146200042157600080fd5b600060208284031215620014eb57600080fd5b8135620014f881620014c2565b9392505050565b6000602082840312156200151257600080fd5b5035919050565b60008083601f8401126200152c57600080fd5b50813567ffffffffffffffff8111156200154557600080fd5b6020830191508360208260051b85010111156200156157600080fd5b9250929050565b600080602083850312156200157c57600080fd5b823567ffffffffffffffff8111156200159457600080fd5b620015a28582860162001519565b90969095509350505050565b80151581146200042157600080fd5b60008060408385031215620015d157600080fd5b8235620015de81620014c2565b91506020830135620015f081620015ae565b809150509250929050565b6000602082840312156200160e57600080fd5b813560ff81168114620014f857600080fd5b600080600080604085870312156200163757600080fd5b843567ffffffffffffffff808211156200165057600080fd5b6200165e8883890162001519565b909650945060208701359150808211156200167857600080fd5b50620016878782880162001519565b95989497509550505050565b60008060008060808587031215620016aa57600080fd5b8435620016b781620014c2565b93506020850135620016c981620014c2565b9250604085013591506060850135620016e281620014c2565b939692955090935050565b6000602082840312156200170057600080fd5b8151620014f881620014c2565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b6000602082840312156200176a57600080fd5b8151620014f881620015ae565b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006000198214156200180e57634e487b7160e01b600052601160045260246000fd5b5060010190565b600081518084526020808501945080840160005b83811015620018505781516001600160a01b03168752958201959082019060010162001829565b509495945050505050565b602081526000620014f8602083018462001815565b8183526000602080850194508260005b85811015620018505781356200189681620014c2565b6001600160a01b03168752958201959082019060010162001880565b604081526000620018c860408301868862001870565b8281036020848101919091528482528591810160005b8681101562001909578335620018f481620015ae565b151582529282019290820190600101620018de565b5098975050505050505050565b60018060a01b038316815260006020604081840152835180604085015260005b81811015620019545785810183015185820160600152820162001936565b8181111562001967576000606083870101525b50601f01601f191692909201606001949350505050565b60408152600062001993604083018562001815565b82810360208481019190915284518083528582019282019060005b81811015620019ce578451151583529383019391830191600101620019ae565b5090979650505050505050565b602081526000620019f160208301848662001870565b94935050505056fe60806040526040516108fa3803806108fa83398101604081905261002291610456565b61002e82826000610035565b5050610580565b61003e83610100565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100fb576100f9836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e99190610516565b836102a360201b6100291760201c565b505b505050565b610113816102cf60201b6100551760201c565b6101725760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101e6816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610516565b6102cf60201b6100551760201c565b61024b5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610169565b806102827fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5060001b6102de60201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606102c883836040518060600160405280602781526020016108d3602791396102e1565b9392505050565b6001600160a01b03163b151590565b90565b60606001600160a01b0384163b6103495760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610169565b600080856001600160a01b0316856040516103649190610531565b600060405180830381855af49150503d806000811461039f576040519150601f19603f3d011682016040523d82523d6000602084013e6103a4565b606091505b5090925090506103b58282866103bf565b9695505050505050565b606083156103ce5750816102c8565b8251156103de5782518084602001fd5b8160405162461bcd60e51b8152600401610169919061054d565b80516001600160a01b038116811461040f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561044557818101518382015260200161042d565b838111156100f95750506000910152565b6000806040838503121561046957600080fd5b610472836103f8565b60208401519092506001600160401b038082111561048f57600080fd5b818501915085601f8301126104a357600080fd5b8151818111156104b5576104b5610414565b604051601f8201601f19908116603f011681019083821181831017156104dd576104dd610414565b816040528281528860208487010111156104f657600080fd5b61050783602083016020880161042a565b80955050505050509250929050565b60006020828403121561052857600080fd5b6102c8826103f8565b6000825161054381846020870161042a565b9190910192915050565b602081526000825180602084015261056c81604085016020870161042a565b601f01601f19169190910160400192915050565b6103448061058f6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b610100565b565b606061004e83836040518060600160405280602781526020016102e860279139610124565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fb919061023f565b905090565b3660008037600080366000845af43d6000803e80801561011f573d6000f35b3d6000fd5b60606001600160a01b0384163b6101915760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101ac9190610298565b600060405180830381855af49150503d80600081146101e7576040519150601f19603f3d011682016040523d82523d6000602084013e6101ec565b606091505b50915091506101fc828286610206565b9695505050505050565b6060831561021557508161004e565b8251156102255782518084602001fd5b8160405162461bcd60e51b815260040161018891906102b4565b60006020828403121561025157600080fd5b81516001600160a01b038116811461004e57600080fd5b60005b8381101561028357818101518382015260200161026b565b83811115610292576000848401525b50505050565b600082516102aa818460208701610268565b9190910192915050565b60208152600082518060208401526102d3816040850160208701610268565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206225174df4b558257f66ac9aa53b52c29cdd29a561b03eb6d75a95018aff3e5864736f6c634300080c0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122049b0776895936109b43d8c8fbda70be80d17d1c73dd5d1ccb8dc7444388c624464736f6c634300080c0033", } // StrategyFactoryABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/StrategyManager/binding.go b/pkg/bindings/StrategyManager/binding.go index 65ecc0fdd..7f356a0f0 100644 --- a/pkg/bindings/StrategyManager/binding.go +++ b/pkg/bindings/StrategyManager/binding.go @@ -31,8 +31,8 @@ var ( // StrategyManagerMetaData contains all meta data concerning the StrategyManager contract. var StrategyManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_delegation\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"},{\"name\":\"_eigenPodManager\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"},{\"name\":\"_slasher\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"nonpayable\"},{\"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\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"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\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialStrategyWhitelister\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"initialPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"nonces\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"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\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setStrategyWhitelister\",\"inputs\":[{\"name\":\"newStrategyWhitelister\",\"type\":\"address\",\"internalType\":\"address\"}],\"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\":\"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\":\"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\":\"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\":\"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\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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}]", - Bin: "0x6101006040523480156200001257600080fd5b506040516200338a3803806200338a833981016040819052620000359162000140565b6001600160a01b0380841660805280831660a052811660c0526200005862000065565b50504660e0525062000194565b600054610100900460ff1615620000d25760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000125576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200013d57600080fd5b50565b6000806000606084860312156200015657600080fd5b8351620001638162000127565b6020850151909350620001768162000127565b6040850151909250620001898162000127565b809150509250925092565b60805160a05160c05160e0516131a0620001ea60003960006114bb0152600061046e0152600061028501526000818161051a01528181610b8401528181610ed101528181610f250152611a7101526131a06000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80638da5cb5b1161011a578063c6656702116100ad578063df5cf7231161007c578063df5cf72314610515578063e7a050aa1461053c578063f2fde38b1461054f578063f698da2514610562578063fabc1cbc1461056a57600080fd5b8063c6656702146104c9578063cbc2bd62146104dc578063cf756fdf146104ef578063df5b35471461050257600080fd5b8063b1344271116100e9578063b134427114610469578063b5d8b5b814610490578063c4623ea1146104a3578063c608c7f3146104b657600080fd5b80638da5cb5b1461040157806394f649dd14610412578063967fc0d2146104335780639b4da03d1461044657600080fd5b80635ac86ab71161019d5780637a7e0d921161016c5780637a7e0d92146103675780637ecebe0014610392578063886f1195146103b25780638b8aac3c146103c55780638c80d4e5146103ee57600080fd5b80635ac86ab7146103015780635c975abb14610334578063663c1de41461033c578063715018a61461035f57600080fd5b80634665bcda116101d95780634665bcda1461028057806348825e94146102bf5780634e5a4263146102e6578063595c6a67146102f957600080fd5b806310d67a2f1461020b578063136439dd1461022057806320606b701461023357806332e89ace1461026d575b600080fd5b61021e6102193660046129e8565b61057d565b005b61021e61022e366004612a05565b610639565b61025a7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6040519081526020015b60405180910390f35b61025a61027b366004612a34565b610778565b6102a77f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610264565b61025a7f4337f82d142e41f2a8c10547cd8c859bddb92262a61058e77842e24d9dea922481565b61021e6102f4366004612b3d565b610a66565b61021e610a9e565b61032461030f366004612b76565b609854600160ff9092169190911b9081161490565b6040519015158152602001610264565b60985461025a565b61032461034a3660046129e8565b60d16020526000908152604090205460ff1681565b61021e610b65565b61025a610375366004612b99565b60cd60209081526000928352604080842090915290825290205481565b61025a6103a03660046129e8565b60ca6020526000908152604090205481565b6097546102a7906001600160a01b031681565b61025a6103d33660046129e8565b6001600160a01b0316600090815260ce602052604090205490565b61021e6103fc366004612bc7565b610b79565b6033546001600160a01b03166102a7565b6104256104203660046129e8565b610bd2565b604051610264929190612c08565b60cb546102a7906001600160a01b031681565b6103246104543660046129e8565b60d36020526000908152604090205460ff1681565b6102a77f000000000000000000000000000000000000000000000000000000000000000081565b61021e61049e366004612cd1565b610d52565b61021e6104b1366004612d13565b610ec6565b61021e6104c4366004612d64565b610f1a565b61021e6104d73660046129e8565b610fd2565b6102a76104ea366004612db7565b610fe3565b61021e6104fd366004612d13565b61101b565b61021e610510366004612de3565b61114f565b6102a77f000000000000000000000000000000000000000000000000000000000000000081565b61025a61054a366004612bc7565b611378565b61021e61055d3660046129e8565b611441565b61025a6114b7565b61021e610578366004612a05565b6114f5565b609760009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f49190612e4f565b6001600160a01b0316336001600160a01b03161461062d5760405162461bcd60e51b815260040161062490612e6c565b60405180910390fd5b61063681611651565b50565b60975460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610681573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a59190612eb6565b6106c15760405162461bcd60e51b815260040161062490612ed3565b6098548181161461073a5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610624565b609881905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b6098546000908190600190811614156107cf5760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610624565b600260655414156108225760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610624565b60026065556001600160a01b038816600090815260d3602052604090205460ff16156108c95760405162461bcd60e51b815260206004820152604a60248201527f53747261746567794d616e616765722e6465706f736974496e746f537472617460448201527f656779576974685369676e61747572653a207468697264207472616e736665726064820152691cc8191a5cd8589b195960b21b608482015260a401610624565b4284101561094b5760405162461bcd60e51b815260206004820152604360248201527f53747261746567794d616e616765722e6465706f736974496e746f537472617460448201527f656779576974685369676e61747572653a207369676e617475726520657870696064820152621c995960ea1b608482015260a401610624565b6001600160a01b03858116600081815260ca602090815260408083205481517f4337f82d142e41f2a8c10547cd8c859bddb92262a61058e77842e24d9dea922493810193909352908201939093528b84166060820152928a16608084015260a0830189905260c0830182905260e0830187905290916101000160408051601f1981840301815291815281516020928301206001600160a01b038a16600090815260ca9093529082206001850190559150610a036114b7565b60405161190160f01b6020820152602281019190915260428101839052606201604051602081830303815290604052805190602001209050610a46888288611748565b610a52888c8c8c611907565b60016065559b9a5050505050505050505050565b60cb546001600160a01b03163314610a905760405162461bcd60e51b815260040161062490612f1b565b610a9a8282611ad6565b5050565b60975460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0a9190612eb6565b610b265760405162461bcd60e51b815260040161062490612ed3565b600019609881905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b610b6d611b44565b610b776000611b9e565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bc15760405162461bcd60e51b815260040161062490612f85565b610bcc838383611bf0565b50505050565b6001600160a01b038116600090815260ce60205260408120546060918291908167ffffffffffffffff811115610c0a57610c0a612a1e565b604051908082528060200260200182016040528015610c33578160200160208202803683370190505b50905060005b82811015610cc4576001600160a01b038616600090815260cd6020908152604080832060ce9092528220805491929184908110610c7857610c78612fe3565b60009182526020808320909101546001600160a01b031683528201929092526040019020548251839083908110610cb157610cb1612fe3565b6020908102919091010152600101610c39565b5060ce6000866001600160a01b03166001600160a01b031681526020019081526020016000208181805480602002602001604051908101604052809291908181526020018280548015610d4057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610d22575b50505050509150935093505050915091565b60cb546001600160a01b03163314610d7c5760405162461bcd60e51b815260040161062490612f1b565b8060005b81811015610bcc5760d16000858584818110610d9e57610d9e612fe3565b9050602002016020810190610db391906129e8565b6001600160a01b0316815260208101919091526040016000205460ff1615610ebe57600060d16000868685818110610ded57610ded612fe3565b9050602002016020810190610e0291906129e8565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f4074413b4b443e4e58019f2855a8765113358c7c72e39509c6af45fc0f5ba030848483818110610e5d57610e5d612fe3565b9050602002016020810190610e7291906129e8565b6040516001600160a01b03909116815260200160405180910390a1610ebe848483818110610ea257610ea2612fe3565b9050602002016020810190610eb791906129e8565b6000611ad6565b600101610d80565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f0e5760405162461bcd60e51b815260040161062490612f85565b610bcc84848484611d4c565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f625760405162461bcd60e51b815260040161062490612f85565b604051636ce5768960e11b81526001600160a01b03858116600483015282811660248301526044820184905284169063d9caed1290606401600060405180830381600087803b158015610fb457600080fd5b505af1158015610fc8573d6000803e3d6000fd5b5050505050505050565b610fda611b44565b61063681611fd9565b60ce6020528160005260406000208181548110610fff57600080fd5b6000918252602090912001546001600160a01b03169150829050565b600054610100900460ff161580801561103b5750600054600160ff909116105b806110555750303b158015611055575060005460ff166001145b6110b85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610624565b6000805460ff1916600117905580156110db576000805461ff0019166101001790555b6110e3612042565b60c9556110f083836120d9565b6110f985611b9e565b61110284611fd9565b8015611148576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60cb546001600160a01b031633146111795760405162461bcd60e51b815260040161062490612f1b565b8281146112025760405162461bcd60e51b815260206004820152604b60248201527f53747261746567794d616e616765722e61646453747261746567696573546f4460448201527f65706f73697457686974656c6973743a206172726179206c656e67746873206460648201526a0de40dcdee840dac2e8c6d60ab1b608482015260a401610624565b8260005b818110156113705760d1600087878481811061122457611224612fe3565b905060200201602081019061123991906129e8565b6001600160a01b0316815260208101919091526040016000205460ff1661136857600160d1600088888581811061127257611272612fe3565b905060200201602081019061128791906129e8565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f0c35b17d91c96eb2751cd456e1252f42a386e524ef9ff26ecc9950859fdc04fe8686838181106112e2576112e2612fe3565b90506020020160208101906112f791906129e8565b6040516001600160a01b03909116815260200160405180910390a161136886868381811061132757611327612fe3565b905060200201602081019061133c91906129e8565b85858481811061134e5761134e612fe3565b90506020020160208101906113639190612ff9565b611ad6565b600101611206565b505050505050565b6098546000908190600190811614156113cf5760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610624565b600260655414156114225760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610624565b600260655561143333868686611907565b600160655595945050505050565b611449611b44565b6001600160a01b0381166114ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610624565b61063681611b9e565b60007f00000000000000000000000000000000000000000000000000000000000000004614156114e8575060c95490565b6114f0612042565b905090565b609760009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611548573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156c9190612e4f565b6001600160a01b0316336001600160a01b03161461159c5760405162461bcd60e51b815260040161062490612e6c565b60985419811960985419161461161a5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610624565b609881905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c9060200161076d565b6001600160a01b0381166116df5760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610624565b609754604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1609780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383163b1561186757604051630b135d3f60e11b808252906001600160a01b03851690631626ba7e90611788908690869060040161306e565b602060405180830381865afa1580156117a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c99190613087565b6001600160e01b031916146118625760405162461bcd60e51b815260206004820152605360248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a2045524331323731207369676e6174757265206064820152721d995c9a599a58d85d1a5bdb8819985a5b1959606a1b608482015260a401610624565b505050565b826001600160a01b031661187b83836121bf565b6001600160a01b0316146118625760405162461bcd60e51b815260206004820152604760248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a207369676e6174757265206e6f742066726f6d6064820152661039b4b3b732b960c91b608482015260a401610624565b6001600160a01b038316600090815260d16020526040812054849060ff166119ad5760405162461bcd60e51b815260206004820152604d60248201527f53747261746567794d616e616765722e6f6e6c7953747261746567696573576860448201527f6974656c6973746564466f724465706f7369743a207374726174656779206e6f60648201526c1d081dda1a5d195b1a5cdd1959609a1b608482015260a401610624565b6119c26001600160a01b0385163387866121e3565b6040516311f9fbc960e21b81526001600160a01b038581166004830152602482018590528616906347e7ef24906044016020604051808303816000875af1158015611a11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3591906130b1565b9150611a4386858785611d4c565b604051631452b9d760e11b81526001600160a01b0387811660048301528681166024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906328a573ae90606401600060405180830381600087803b158015611ab557600080fd5b505af1158015611ac9573d6000803e3d6000fd5b5050505050949350505050565b604080516001600160a01b038416815282151560208201527f77d930df4937793473a95024d87a98fd2ccb9e92d3c2463b3dacd65d3e6a5786910160405180910390a16001600160a01b0391909116600090815260d360205260409020805460ff1916911515919091179055565b6033546001600160a01b03163314610b775760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610624565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081611c655760405162461bcd60e51b815260206004820152603e60248201527f53747261746567794d616e616765722e5f72656d6f76655368617265733a207360448201527f68617265416d6f756e742073686f756c64206e6f74206265207a65726f2100006064820152608401610624565b6001600160a01b03808516600090815260cd602090815260408083209387168352929052205480831115611cf75760405162461bcd60e51b815260206004820152603360248201527f53747261746567794d616e616765722e5f72656d6f76655368617265733a20736044820152720d0c2e4ca82dadeeadce840e8dede40d0d2ced606b1b6064820152608401610624565b6001600160a01b03808616600090815260cd602090815260408083209388168352929052208382039081905590831415611d3f57611d35858561223d565b6001915050611d45565b60009150505b9392505050565b6001600160a01b038416611dc85760405162461bcd60e51b815260206004820152603960248201527f53747261746567794d616e616765722e5f6164645368617265733a207374616b60448201527f65722063616e6e6f74206265207a65726f2061646472657373000000000000006064820152608401610624565b80611e345760405162461bcd60e51b815260206004820152603660248201527f53747261746567794d616e616765722e5f6164645368617265733a207368617260448201527565732073686f756c64206e6f74206265207a65726f2160501b6064820152608401610624565b6001600160a01b03808516600090815260cd6020908152604080832093861683529290522054611f45576001600160a01b038416600090815260ce602090815260409091205410611f065760405162461bcd60e51b815260206004820152605060248201527f53747261746567794d616e616765722e5f6164645368617265733a206465706f60448201527f73697420776f756c6420657863656564204d41585f5354414b45525f5354524160648201526f0a88a8eb2be9892a6a8be988a9c8ea8960831b608482015260a401610624565b6001600160a01b03848116600090815260ce602090815260408220805460018101825590835291200180546001600160a01b0319169184169190911790555b6001600160a01b03808516600090815260cd6020908152604080832093861683529290529081208054839290611f7c9084906130e0565b9091555050604080516001600160a01b03868116825285811660208301528416818301526060810183905290517f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a969181900360800190a150505050565b60cb54604080516001600160a01b03928316815291831660208301527f4264275e593955ff9d6146a51a4525f6ddace2e81db9391abcc9d1ca48047d29910160405180910390a160cb80546001600160a01b0319166001600160a01b0392909216919091179055565b604080518082018252600a81526922b4b3b2b72630bcb2b960b11b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea81840152466060820152306080808301919091528351808303909101815260a0909101909252815191012090565b6097546001600160a01b03161580156120fa57506001600160a01b03821615155b61217c5760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610624565b609881905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2610a9a82611651565b60008060006121ce858561242f565b915091506121db8161249f565b509392505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610bcc90859061265a565b6001600160a01b038216600090815260ce6020526040812054905b81811015612358576001600160a01b03848116600090815260ce602052604090208054918516918390811061228f5761228f612fe3565b6000918252602090912001546001600160a01b03161415612350576001600160a01b038416600090815260ce6020526040902080546122d0906001906130f8565b815481106122e0576122e0612fe3565b60009182526020808320909101546001600160a01b03878116845260ce909252604090922080549190921691908390811061231d5761231d612fe3565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550612358565b600101612258565b818114156123e05760405162461bcd60e51b815260206004820152604960248201527f53747261746567794d616e616765722e5f72656d6f766553747261746567794660448201527f726f6d5374616b657253747261746567794c6973743a207374726174656779206064820152681b9bdd08199bdd5b9960ba1b608482015260a401610624565b6001600160a01b038416600090815260ce602052604090208054806124075761240761310f565b600082815260209020810160001990810180546001600160a01b031916905501905550505050565b6000808251604114156124665760208301516040840151606085015160001a61245a8782858561272c565b94509450505050612498565b8251604014156124905760208301516040840151612485868383612819565b935093505050612498565b506000905060025b9250929050565b60008160048111156124b3576124b3613125565b14156124bc5750565b60018160048111156124d0576124d0613125565b141561251e5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610624565b600281600481111561253257612532613125565b14156125805760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610624565b600381600481111561259457612594613125565b14156125ed5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610624565b600481600481111561260157612601613125565b14156106365760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610624565b60006126af826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128529092919063ffffffff16565b80519091501561186257808060200190518101906126cd9190612eb6565b6118625760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610624565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156127635750600090506003612810565b8460ff16601b1415801561277b57508460ff16601c14155b1561278c5750600090506004612810565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156127e0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661280957600060019250925050612810565b9150600090505b94509492505050565b6000806001600160ff1b0383168161283660ff86901c601b6130e0565b90506128448782888561272c565b935093505050935093915050565b60606128618484600085612869565b949350505050565b6060824710156128ca5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610624565b6001600160a01b0385163b6129215760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610624565b600080866001600160a01b0316858760405161293d919061313b565b60006040518083038185875af1925050503d806000811461297a576040519150601f19603f3d011682016040523d82523d6000602084013e61297f565b606091505b509150915061298f82828661299a565b979650505050505050565b606083156129a9575081611d45565b8251156129b95782518084602001fd5b8160405162461bcd60e51b81526004016106249190613157565b6001600160a01b038116811461063657600080fd5b6000602082840312156129fa57600080fd5b8135611d45816129d3565b600060208284031215612a1757600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060c08789031215612a4d57600080fd5b8635612a58816129d3565b95506020870135612a68816129d3565b9450604087013593506060870135612a7f816129d3565b92506080870135915060a087013567ffffffffffffffff80821115612aa357600080fd5b818901915089601f830112612ab757600080fd5b813581811115612ac957612ac9612a1e565b604051601f8201601f19908116603f01168101908382118183101715612af157612af1612a1e565b816040528281528c6020848701011115612b0a57600080fd5b8260208601602083013760006020848301015280955050505050509295509295509295565b801515811461063657600080fd5b60008060408385031215612b5057600080fd5b8235612b5b816129d3565b91506020830135612b6b81612b2f565b809150509250929050565b600060208284031215612b8857600080fd5b813560ff81168114611d4557600080fd5b60008060408385031215612bac57600080fd5b8235612bb7816129d3565b91506020830135612b6b816129d3565b600080600060608486031215612bdc57600080fd5b8335612be7816129d3565b92506020840135612bf7816129d3565b929592945050506040919091013590565b604080825283519082018190526000906020906060840190828701845b82811015612c4a5781516001600160a01b031684529284019290840190600101612c25565b5050508381038285015284518082528583019183019060005b81811015612c7f57835183529284019291840191600101612c63565b5090979650505050505050565b60008083601f840112612c9e57600080fd5b50813567ffffffffffffffff811115612cb657600080fd5b6020830191508360208260051b850101111561249857600080fd5b60008060208385031215612ce457600080fd5b823567ffffffffffffffff811115612cfb57600080fd5b612d0785828601612c8c565b90969095509350505050565b60008060008060808587031215612d2957600080fd5b8435612d34816129d3565b93506020850135612d44816129d3565b92506040850135612d54816129d3565b9396929550929360600135925050565b60008060008060808587031215612d7a57600080fd5b8435612d85816129d3565b93506020850135612d95816129d3565b9250604085013591506060850135612dac816129d3565b939692955090935050565b60008060408385031215612dca57600080fd5b8235612dd5816129d3565b946020939093013593505050565b60008060008060408587031215612df957600080fd5b843567ffffffffffffffff80821115612e1157600080fd5b612e1d88838901612c8c565b90965094506020870135915080821115612e3657600080fd5b50612e4387828801612c8c565b95989497509550505050565b600060208284031215612e6157600080fd5b8151611d45816129d3565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b600060208284031215612ec857600080fd5b8151611d4581612b2f565b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b60208082526044908201527f53747261746567794d616e616765722e6f6e6c7953747261746567795768697460408201527f656c69737465723a206e6f742074686520737472617465677957686974656c6960608201526339ba32b960e11b608082015260a00190565b602080825260409082018190527f53747261746567794d616e616765722e6f6e6c7944656c65676174696f6e4d61908201527f6e616765723a206e6f74207468652044656c65676174696f6e4d616e61676572606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561300b57600080fd5b8135611d4581612b2f565b60005b83811015613031578181015183820152602001613019565b83811115610bcc5750506000910152565b6000815180845261305a816020860160208601613016565b601f01601f19169290920160200192915050565b8281526040602082015260006128616040830184613042565b60006020828403121561309957600080fd5b81516001600160e01b031981168114611d4557600080fd5b6000602082840312156130c357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156130f3576130f36130ca565b500190565b60008282101561310a5761310a6130ca565b500390565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6000825161314d818460208701613016565b9190910192915050565b602081526000611d45602083018461304256fea2646970667358221220e1eb2321685fb63a9aec2a407059955dbb014f9ba1598fed273d59a1889501d764736f6c634300080c0033", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_delegation\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"},{\"name\":\"_eigenPodManager\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"},{\"name\":\"_slasher\",\"type\":\"address\",\"internalType\":\"contractISlasher\"},{\"name\":\"_avsDirectory\",\"type\":\"address\",\"internalType\":\"contractIAVSDirectory\"}],\"stateMutability\":\"nonpayable\"},{\"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\":[{\"name\":\"existingShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"avsDirectory\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIAVSDirectory\"}],\"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\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"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\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialStrategyWhitelister\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"initialPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"nonces\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"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\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setStrategyWhitelister\",\"inputs\":[{\"name\":\"newStrategyWhitelister\",\"type\":\"address\",\"internalType\":\"address\"}],\"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\":\"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\":\"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\":\"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\":\"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\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"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}]", + Bin: "0x6101206040523480156200001257600080fd5b506040516200340d3803806200340d833981016040819052620000359162000149565b6001600160a01b0380851660805280841660a05280831660c052811660e0526200005e6200006e565b5050466101005250620001b19050565b600054610100900460ff1615620000db5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156200012e576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200014657600080fd5b50565b600080600080608085870312156200016057600080fd5b84516200016d8162000130565b6020860151909450620001808162000130565b6040860151909350620001938162000130565b6060860151909250620001a68162000130565b939692955090935050565b60805160a05160c05160e051610100516131fb6200021260003960006114fb0152600061036f015260006104a00152600061029001526000818161054c01528181610bb601528181610f0501528181610f650152611ac101526131fb6000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c80638c80d4e511610125578063c6656702116100ad578063df5cf7231161007c578063df5cf72314610547578063e7a050aa1461056e578063f2fde38b14610581578063f698da2514610594578063fabc1cbc1461059c57600080fd5b8063c6656702146104fb578063cbc2bd621461050e578063cf756fdf14610521578063df5b35471461053457600080fd5b80639b4da03d116100f45780639b4da03d14610478578063b13442711461049b578063b5d8b5b8146104c2578063c4623ea1146104d5578063c608c7f3146104e857600080fd5b80638c80d4e5146104205780638da5cb5b1461043357806394f649dd14610444578063967fc0d21461046557600080fd5b80635ac86ab7116101a8578063715018a611610177578063715018a6146103915780637a7e0d92146103995780637ecebe00146103c4578063886f1195146103e45780638b8aac3c146103f757600080fd5b80635ac86ab71461030c5780635c975abb1461033f578063663c1de4146103475780636b3aa72e1461036a57600080fd5b80634665bcda116101e45780634665bcda1461028b57806348825e94146102ca5780634e5a4263146102f1578063595c6a671461030457600080fd5b806310d67a2f14610216578063136439dd1461022b57806320606b701461023e57806332e89ace14610278575b600080fd5b610229610224366004612a43565b6105af565b005b610229610239366004612a60565b61066b565b6102657f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6040519081526020015b60405180910390f35b610265610286366004612a8f565b6107aa565b6102b27f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161026f565b6102657f4337f82d142e41f2a8c10547cd8c859bddb92262a61058e77842e24d9dea922481565b6102296102ff366004612b98565b610a98565b610229610ad0565b61032f61031a366004612bd1565b609854600160ff9092169190911b9081161490565b604051901515815260200161026f565b609854610265565b61032f610355366004612a43565b60d16020526000908152604090205460ff1681565b6102b27f000000000000000000000000000000000000000000000000000000000000000081565b610229610b97565b6102656103a7366004612bf4565b60cd60209081526000928352604080842090915290825290205481565b6102656103d2366004612a43565b60ca6020526000908152604090205481565b6097546102b2906001600160a01b031681565b610265610405366004612a43565b6001600160a01b0316600090815260ce602052604090205490565b61022961042e366004612c22565b610bab565b6033546001600160a01b03166102b2565b610457610452366004612a43565b610c04565b60405161026f929190612c63565b60cb546102b2906001600160a01b031681565b61032f610486366004612a43565b60d36020526000908152604090205460ff1681565b6102b27f000000000000000000000000000000000000000000000000000000000000000081565b6102296104d0366004612d2c565b610d84565b6102656104e3366004612d6e565b610ef8565b6102296104f6366004612dbf565b610f5a565b610229610509366004612a43565b611012565b6102b261051c366004612e12565b611023565b61022961052f366004612d6e565b61105b565b610229610542366004612e3e565b61118f565b6102b27f000000000000000000000000000000000000000000000000000000000000000081565b61026561057c366004612c22565b6113b8565b61022961058f366004612a43565b611481565b6102656114f7565b6102296105aa366004612a60565b611535565b609760009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610602573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106269190612eaa565b6001600160a01b0316336001600160a01b03161461065f5760405162461bcd60e51b815260040161065690612ec7565b60405180910390fd5b61066881611691565b50565b60975460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa1580156106b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d79190612f11565b6106f35760405162461bcd60e51b815260040161065690612f2e565b6098548181161461076c5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e70617573653a20696e76616c696420617474656d70742060448201527f746f20756e70617573652066756e6374696f6e616c69747900000000000000006064820152608401610656565b609881905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d906020015b60405180910390a250565b6098546000908190600190811614156108015760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610656565b600260655414156108545760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610656565b60026065556001600160a01b038816600090815260d3602052604090205460ff16156108fb5760405162461bcd60e51b815260206004820152604a60248201527f53747261746567794d616e616765722e6465706f736974496e746f537472617460448201527f656779576974685369676e61747572653a207468697264207472616e736665726064820152691cc8191a5cd8589b195960b21b608482015260a401610656565b4284101561097d5760405162461bcd60e51b815260206004820152604360248201527f53747261746567794d616e616765722e6465706f736974496e746f537472617460448201527f656779576974685369676e61747572653a207369676e617475726520657870696064820152621c995960ea1b608482015260a401610656565b6001600160a01b03858116600081815260ca602090815260408083205481517f4337f82d142e41f2a8c10547cd8c859bddb92262a61058e77842e24d9dea922493810193909352908201939093528b84166060820152928a16608084015260a0830189905260c0830182905260e0830187905290916101000160408051601f1981840301815291815281516020928301206001600160a01b038a16600090815260ca9093529082206001850190559150610a356114f7565b60405161190160f01b6020820152602281019190915260428101839052606201604051602081830303815290604052805190602001209050610a78888288611788565b610a84888c8c8c611947565b60016065559b9a5050505050505050505050565b60cb546001600160a01b03163314610ac25760405162461bcd60e51b815260040161065690612f76565b610acc8282611b2b565b5050565b60975460405163237dfb4760e11b81523360048201526001600160a01b03909116906346fbf68e90602401602060405180830381865afa158015610b18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3c9190612f11565b610b585760405162461bcd60e51b815260040161065690612f2e565b600019609881905560405190815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2565b610b9f611b99565b610ba96000611bf3565b565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bf35760405162461bcd60e51b815260040161065690612fe0565b610bfe838383611c45565b50505050565b6001600160a01b038116600090815260ce60205260408120546060918291908167ffffffffffffffff811115610c3c57610c3c612a79565b604051908082528060200260200182016040528015610c65578160200160208202803683370190505b50905060005b82811015610cf6576001600160a01b038616600090815260cd6020908152604080832060ce9092528220805491929184908110610caa57610caa61303e565b60009182526020808320909101546001600160a01b031683528201929092526040019020548251839083908110610ce357610ce361303e565b6020908102919091010152600101610c6b565b5060ce6000866001600160a01b03166001600160a01b031681526020019081526020016000208181805480602002602001604051908101604052809291908181526020018280548015610d7257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610d54575b50505050509150935093505050915091565b60cb546001600160a01b03163314610dae5760405162461bcd60e51b815260040161065690612f76565b8060005b81811015610bfe5760d16000858584818110610dd057610dd061303e565b9050602002016020810190610de59190612a43565b6001600160a01b0316815260208101919091526040016000205460ff1615610ef057600060d16000868685818110610e1f57610e1f61303e565b9050602002016020810190610e349190612a43565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f4074413b4b443e4e58019f2855a8765113358c7c72e39509c6af45fc0f5ba030848483818110610e8f57610e8f61303e565b9050602002016020810190610ea49190612a43565b6040516001600160a01b03909116815260200160405180910390a1610ef0848483818110610ed457610ed461303e565b9050602002016020810190610ee99190612a43565b6000611b2b565b600101610db2565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f425760405162461bcd60e51b815260040161065690612fe0565b6000610f5086868686611da2565b9695505050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610fa25760405162461bcd60e51b815260040161065690612fe0565b604051636ce5768960e11b81526001600160a01b03858116600483015282811660248301526044820184905284169063d9caed1290606401600060405180830381600087803b158015610ff457600080fd5b505af1158015611008573d6000803e3d6000fd5b5050505050505050565b61101a611b99565b61066881612034565b60ce602052816000526040600020818154811061103f57600080fd5b6000918252602090912001546001600160a01b03169150829050565b600054610100900460ff161580801561107b5750600054600160ff909116105b806110955750303b158015611095575060005460ff166001145b6110f85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610656565b6000805460ff19166001179055801561111b576000805461ff0019166101001790555b61112361209d565b60c9556111308383612134565b61113985611bf3565b61114284612034565b8015611188576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60cb546001600160a01b031633146111b95760405162461bcd60e51b815260040161065690612f76565b8281146112425760405162461bcd60e51b815260206004820152604b60248201527f53747261746567794d616e616765722e61646453747261746567696573546f4460448201527f65706f73697457686974656c6973743a206172726179206c656e67746873206460648201526a0de40dcdee840dac2e8c6d60ab1b608482015260a401610656565b8260005b818110156113b05760d160008787848181106112645761126461303e565b90506020020160208101906112799190612a43565b6001600160a01b0316815260208101919091526040016000205460ff166113a857600160d160008888858181106112b2576112b261303e565b90506020020160208101906112c79190612a43565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557f0c35b17d91c96eb2751cd456e1252f42a386e524ef9ff26ecc9950859fdc04fe8686838181106113225761132261303e565b90506020020160208101906113379190612a43565b6040516001600160a01b03909116815260200160405180910390a16113a88686838181106113675761136761303e565b905060200201602081019061137c9190612a43565b85858481811061138e5761138e61303e565b90506020020160208101906113a39190613054565b611b2b565b600101611246565b505050505050565b60985460009081906001908116141561140f5760405162461bcd60e51b815260206004820152601960248201527814185d5cd8589b194e881a5b99195e081a5cc81c185d5cd959603a1b6044820152606401610656565b600260655414156114625760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610656565b600260655561147333868686611947565b600160655595945050505050565b611489611b99565b6001600160a01b0381166114ee5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610656565b61066881611bf3565b60007f0000000000000000000000000000000000000000000000000000000000000000461415611528575060c95490565b61153061209d565b905090565b609760009054906101000a90046001600160a01b03166001600160a01b031663eab66d7a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611588573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ac9190612eaa565b6001600160a01b0316336001600160a01b0316146115dc5760405162461bcd60e51b815260040161065690612ec7565b60985419811960985419161461165a5760405162461bcd60e51b815260206004820152603860248201527f5061757361626c652e756e70617573653a20696e76616c696420617474656d7060448201527f7420746f2070617573652066756e6374696f6e616c69747900000000000000006064820152608401610656565b609881905560405181815233907f3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c9060200161079f565b6001600160a01b03811661171f5760405162461bcd60e51b815260206004820152604960248201527f5061757361626c652e5f73657450617573657252656769737472793a206e657760448201527f50617573657252656769737472792063616e6e6f7420626520746865207a65726064820152686f206164647265737360b81b608482015260a401610656565b609754604080516001600160a01b03928316815291831660208301527f6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6910160405180910390a1609780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383163b156118a757604051630b135d3f60e11b808252906001600160a01b03851690631626ba7e906117c890869086906004016130c9565b602060405180830381865afa1580156117e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180991906130e2565b6001600160e01b031916146118a25760405162461bcd60e51b815260206004820152605360248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a2045524331323731207369676e6174757265206064820152721d995c9a599a58d85d1a5bdb8819985a5b1959606a1b608482015260a401610656565b505050565b826001600160a01b03166118bb838361221a565b6001600160a01b0316146118a25760405162461bcd60e51b815260206004820152604760248201527f454950313237315369676e61747572655574696c732e636865636b5369676e6160448201527f747572655f454950313237313a207369676e6174757265206e6f742066726f6d6064820152661039b4b3b732b960c91b608482015260a401610656565b6001600160a01b038316600090815260d16020526040812054849060ff166119ed5760405162461bcd60e51b815260206004820152604d60248201527f53747261746567794d616e616765722e6f6e6c7953747261746567696573576860448201527f6974656c6973746564466f724465706f7369743a207374726174656779206e6f60648201526c1d081dda1a5d195b1a5cdd1959609a1b608482015260a401610656565b611a026001600160a01b03851633878661223e565b6040516311f9fbc960e21b81526001600160a01b03858116600483015260248201859052600091908716906347e7ef24906044016020604051808303816000875af1158015611a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a79919061310c565b90506000611a8988878985611da2565b604051631e328e7960e11b81526001600160a01b038a81166004830152898116602483015260448201839052606482018590529192507f000000000000000000000000000000000000000000000000000000000000000090911690633c651cf290608401600060405180830381600087803b158015611b0757600080fd5b505af1158015611b1b573d6000803e3d6000fd5b50939a9950505050505050505050565b604080516001600160a01b038416815282151560208201527f77d930df4937793473a95024d87a98fd2ccb9e92d3c2463b3dacd65d3e6a5786910160405180910390a16001600160a01b0391909116600090815260d360205260409020805460ff1916911515919091179055565b6033546001600160a01b03163314610ba95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610656565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081611cba5760405162461bcd60e51b815260206004820152603f60248201527f53747261746567794d616e616765722e5f72656d6f76655368617265733a207360448201527f6861726573416d6f756e742073686f756c64206e6f74206265207a65726f21006064820152608401610656565b6001600160a01b03808516600090815260cd602090815260408083209387168352929052205480831115611d4d5760405162461bcd60e51b815260206004820152603460248201527f53747261746567794d616e616765722e5f72656d6f76655368617265733a20736044820152730d0c2e4cae682dadeeadce840e8dede40d0d2ced60631b6064820152608401610656565b6001600160a01b03808616600090815260cd602090815260408083209388168352929052208382039081905590831415611d9557611d8b8585612298565b6001915050611d9b565b60009150505b9392505050565b60006001600160a01b038516611e205760405162461bcd60e51b815260206004820152603960248201527f53747261746567794d616e616765722e5f6164645368617265733a207374616b60448201527f65722063616e6e6f74206265207a65726f2061646472657373000000000000006064820152608401610656565b81611e8c5760405162461bcd60e51b815260206004820152603660248201527f53747261746567794d616e616765722e5f6164645368617265733a207368617260448201527565732073686f756c64206e6f74206265207a65726f2160501b6064820152608401610656565b6001600160a01b03808616600090815260cd6020908152604080832093871683529290522054611f9d576001600160a01b038516600090815260ce602090815260409091205410611f5e5760405162461bcd60e51b815260206004820152605060248201527f53747261746567794d616e616765722e5f6164645368617265733a206465706f60448201527f73697420776f756c6420657863656564204d41585f5354414b45525f5354524160648201526f0a88a8eb2be9892a6a8be988a9c8ea8960831b608482015260a401610656565b6001600160a01b03858116600090815260ce602090815260408220805460018101825590835291200180546001600160a01b0319169185169190911790555b6001600160a01b03858116600090815260cd602090815260408083209387168352929052908120805491849190611fd4838561313b565b9091555050604080516001600160a01b03888116825287811660208301528616818301526060810185905290517f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a969181900360800190a195945050505050565b60cb54604080516001600160a01b03928316815291831660208301527f4264275e593955ff9d6146a51a4525f6ddace2e81db9391abcc9d1ca48047d29910160405180910390a160cb80546001600160a01b0319166001600160a01b0392909216919091179055565b604080518082018252600a81526922b4b3b2b72630bcb2b960b11b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea81840152466060820152306080808301919091528351808303909101815260a0909101909252815191012090565b6097546001600160a01b031615801561215557506001600160a01b03821615155b6121d75760405162461bcd60e51b815260206004820152604760248201527f5061757361626c652e5f696e697469616c697a655061757365723a205f696e6960448201527f7469616c697a6550617573657228292063616e206f6e6c792062652063616c6c6064820152666564206f6e636560c81b608482015260a401610656565b609881905560405181815233907fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d9060200160405180910390a2610acc82611691565b6000806000612229858561248a565b91509150612236816124fa565b509392505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610bfe9085906126b5565b6001600160a01b038216600090815260ce6020526040812054905b818110156123b3576001600160a01b03848116600090815260ce60205260409020805491851691839081106122ea576122ea61303e565b6000918252602090912001546001600160a01b031614156123ab576001600160a01b038416600090815260ce60205260409020805461232b90600190613153565b8154811061233b5761233b61303e565b60009182526020808320909101546001600160a01b03878116845260ce90925260409092208054919092169190839081106123785761237861303e565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506123b3565b6001016122b3565b8181141561243b5760405162461bcd60e51b815260206004820152604960248201527f53747261746567794d616e616765722e5f72656d6f766553747261746567794660448201527f726f6d5374616b657253747261746567794c6973743a207374726174656779206064820152681b9bdd08199bdd5b9960ba1b608482015260a401610656565b6001600160a01b038416600090815260ce602052604090208054806124625761246261316a565b600082815260209020810160001990810180546001600160a01b031916905501905550505050565b6000808251604114156124c15760208301516040840151606085015160001a6124b587828585612787565b945094505050506124f3565b8251604014156124eb57602083015160408401516124e0868383612874565b9350935050506124f3565b506000905060025b9250929050565b600081600481111561250e5761250e613180565b14156125175750565b600181600481111561252b5761252b613180565b14156125795760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610656565b600281600481111561258d5761258d613180565b14156125db5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610656565b60038160048111156125ef576125ef613180565b14156126485760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610656565b600481600481111561265c5761265c613180565b14156106685760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610656565b600061270a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128ad9092919063ffffffff16565b8051909150156118a257808060200190518101906127289190612f11565b6118a25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610656565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156127be575060009050600361286b565b8460ff16601b141580156127d657508460ff16601c14155b156127e7575060009050600461286b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561283b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128645760006001925092505061286b565b9150600090505b94509492505050565b6000806001600160ff1b0383168161289160ff86901c601b61313b565b905061289f87828885612787565b935093505050935093915050565b60606128bc84846000856128c4565b949350505050565b6060824710156129255760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610656565b6001600160a01b0385163b61297c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610656565b600080866001600160a01b031685876040516129989190613196565b60006040518083038185875af1925050503d80600081146129d5576040519150601f19603f3d011682016040523d82523d6000602084013e6129da565b606091505b50915091506129ea8282866129f5565b979650505050505050565b60608315612a04575081611d9b565b825115612a145782518084602001fd5b8160405162461bcd60e51b815260040161065691906131b2565b6001600160a01b038116811461066857600080fd5b600060208284031215612a5557600080fd5b8135611d9b81612a2e565b600060208284031215612a7257600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060c08789031215612aa857600080fd5b8635612ab381612a2e565b95506020870135612ac381612a2e565b9450604087013593506060870135612ada81612a2e565b92506080870135915060a087013567ffffffffffffffff80821115612afe57600080fd5b818901915089601f830112612b1257600080fd5b813581811115612b2457612b24612a79565b604051601f8201601f19908116603f01168101908382118183101715612b4c57612b4c612a79565b816040528281528c6020848701011115612b6557600080fd5b8260208601602083013760006020848301015280955050505050509295509295509295565b801515811461066857600080fd5b60008060408385031215612bab57600080fd5b8235612bb681612a2e565b91506020830135612bc681612b8a565b809150509250929050565b600060208284031215612be357600080fd5b813560ff81168114611d9b57600080fd5b60008060408385031215612c0757600080fd5b8235612c1281612a2e565b91506020830135612bc681612a2e565b600080600060608486031215612c3757600080fd5b8335612c4281612a2e565b92506020840135612c5281612a2e565b929592945050506040919091013590565b604080825283519082018190526000906020906060840190828701845b82811015612ca55781516001600160a01b031684529284019290840190600101612c80565b5050508381038285015284518082528583019183019060005b81811015612cda57835183529284019291840191600101612cbe565b5090979650505050505050565b60008083601f840112612cf957600080fd5b50813567ffffffffffffffff811115612d1157600080fd5b6020830191508360208260051b85010111156124f357600080fd5b60008060208385031215612d3f57600080fd5b823567ffffffffffffffff811115612d5657600080fd5b612d6285828601612ce7565b90969095509350505050565b60008060008060808587031215612d8457600080fd5b8435612d8f81612a2e565b93506020850135612d9f81612a2e565b92506040850135612daf81612a2e565b9396929550929360600135925050565b60008060008060808587031215612dd557600080fd5b8435612de081612a2e565b93506020850135612df081612a2e565b9250604085013591506060850135612e0781612a2e565b939692955090935050565b60008060408385031215612e2557600080fd5b8235612e3081612a2e565b946020939093013593505050565b60008060008060408587031215612e5457600080fd5b843567ffffffffffffffff80821115612e6c57600080fd5b612e7888838901612ce7565b90965094506020870135915080821115612e9157600080fd5b50612e9e87828801612ce7565b95989497509550505050565b600060208284031215612ebc57600080fd5b8151611d9b81612a2e565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b606082015260800190565b600060208284031215612f2357600080fd5b8151611d9b81612b8a565b60208082526028908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526739903830bab9b2b960c11b606082015260800190565b60208082526044908201527f53747261746567794d616e616765722e6f6e6c7953747261746567795768697460408201527f656c69737465723a206e6f742074686520737472617465677957686974656c6960608201526339ba32b960e11b608082015260a00190565b602080825260409082018190527f53747261746567794d616e616765722e6f6e6c7944656c65676174696f6e4d61908201527f6e616765723a206e6f74207468652044656c65676174696f6e4d616e61676572606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561306657600080fd5b8135611d9b81612b8a565b60005b8381101561308c578181015183820152602001613074565b83811115610bfe5750506000910152565b600081518084526130b5816020860160208601613071565b601f01601f19169290920160200192915050565b8281526040602082015260006128bc604083018461309d565b6000602082840312156130f457600080fd5b81516001600160e01b031981168114611d9b57600080fd5b60006020828403121561311e57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561314e5761314e613125565b500190565b60008282101561316557613165613125565b500390565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b600082516131a8818460208701613071565b9190910192915050565b602081526000611d9b602083018461309d56fea264697066735822122092d3cd208c57d0f421ebf4d5321ef002546a3a5d7f6d5bf1e92419b67392e96064736f6c634300080c0033", } // StrategyManagerABI is the input ABI used to generate the binding from. @@ -44,7 +44,7 @@ var StrategyManagerABI = StrategyManagerMetaData.ABI var StrategyManagerBin = StrategyManagerMetaData.Bin // DeployStrategyManager deploys a new Ethereum contract, binding an instance of StrategyManager to it. -func DeployStrategyManager(auth *bind.TransactOpts, backend bind.ContractBackend, _delegation common.Address, _eigenPodManager common.Address, _slasher common.Address) (common.Address, *types.Transaction, *StrategyManager, error) { +func DeployStrategyManager(auth *bind.TransactOpts, backend bind.ContractBackend, _delegation common.Address, _eigenPodManager common.Address, _slasher common.Address, _avsDirectory common.Address) (common.Address, *types.Transaction, *StrategyManager, error) { parsed, err := StrategyManagerMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -53,7 +53,7 @@ func DeployStrategyManager(auth *bind.TransactOpts, backend bind.ContractBackend return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(StrategyManagerBin), backend, _delegation, _eigenPodManager, _slasher) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(StrategyManagerBin), backend, _delegation, _eigenPodManager, _slasher, _avsDirectory) if err != nil { return common.Address{}, nil, nil, err } @@ -264,6 +264,37 @@ func (_StrategyManager *StrategyManagerCallerSession) DOMAINTYPEHASH() ([32]byte return _StrategyManager.Contract.DOMAINTYPEHASH(&_StrategyManager.CallOpts) } +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_StrategyManager *StrategyManagerCaller) AvsDirectory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StrategyManager.contract.Call(opts, &out, "avsDirectory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_StrategyManager *StrategyManagerSession) AvsDirectory() (common.Address, error) { + return _StrategyManager.Contract.AvsDirectory(&_StrategyManager.CallOpts) +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_StrategyManager *StrategyManagerCallerSession) AvsDirectory() (common.Address, error) { + return _StrategyManager.Contract.AvsDirectory(&_StrategyManager.CallOpts) +} + // Delegation is a free data retrieval call binding the contract method 0xdf5cf723. // // Solidity: function delegation() view returns(address) @@ -763,21 +794,21 @@ func (_StrategyManager *StrategyManagerCallerSession) ThirdPartyTransfersForbidd // AddShares is a paid mutator transaction binding the contract method 0xc4623ea1. // -// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns() +// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns(uint256 existingShares) func (_StrategyManager *StrategyManagerTransactor) AddShares(opts *bind.TransactOpts, staker common.Address, token common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { return _StrategyManager.contract.Transact(opts, "addShares", staker, token, strategy, shares) } // AddShares is a paid mutator transaction binding the contract method 0xc4623ea1. // -// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns() +// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns(uint256 existingShares) func (_StrategyManager *StrategyManagerSession) AddShares(staker common.Address, token common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { return _StrategyManager.Contract.AddShares(&_StrategyManager.TransactOpts, staker, token, strategy, shares) } // AddShares is a paid mutator transaction binding the contract method 0xc4623ea1. // -// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns() +// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns(uint256 existingShares) func (_StrategyManager *StrategyManagerTransactorSession) AddShares(staker common.Address, token common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { return _StrategyManager.Contract.AddShares(&_StrategyManager.TransactOpts, staker, token, strategy, shares) } diff --git a/pkg/bindings/StrategyManagerStorage/binding.go b/pkg/bindings/StrategyManagerStorage/binding.go index 3dc3ddcac..32bbf02bc 100644 --- a/pkg/bindings/StrategyManagerStorage/binding.go +++ b/pkg/bindings/StrategyManagerStorage/binding.go @@ -31,7 +31,7 @@ var ( // StrategyManagerStorageMetaData contains all meta data concerning the StrategyManagerStorage contract. var StrategyManagerStorageMetaData = &bind.MetaData{ - 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}]", + 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\":[{\"name\":\"existingShares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"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\":\"avsDirectory\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIAVSDirectory\"}],\"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\":\"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}]", } // StrategyManagerStorageABI is the input ABI used to generate the binding from. @@ -242,6 +242,37 @@ func (_StrategyManagerStorage *StrategyManagerStorageCallerSession) DOMAINTYPEHA return _StrategyManagerStorage.Contract.DOMAINTYPEHASH(&_StrategyManagerStorage.CallOpts) } +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_StrategyManagerStorage *StrategyManagerStorageCaller) AvsDirectory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StrategyManagerStorage.contract.Call(opts, &out, "avsDirectory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_StrategyManagerStorage *StrategyManagerStorageSession) AvsDirectory() (common.Address, error) { + return _StrategyManagerStorage.Contract.AvsDirectory(&_StrategyManagerStorage.CallOpts) +} + +// AvsDirectory is a free data retrieval call binding the contract method 0x6b3aa72e. +// +// Solidity: function avsDirectory() view returns(address) +func (_StrategyManagerStorage *StrategyManagerStorageCallerSession) AvsDirectory() (common.Address, error) { + return _StrategyManagerStorage.Contract.AvsDirectory(&_StrategyManagerStorage.CallOpts) +} + // Delegation is a free data retrieval call binding the contract method 0xdf5cf723. // // Solidity: function delegation() view returns(address) @@ -586,21 +617,21 @@ func (_StrategyManagerStorage *StrategyManagerStorageCallerSession) ThirdPartyTr // AddShares is a paid mutator transaction binding the contract method 0xc4623ea1. // -// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns() +// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns(uint256 existingShares) func (_StrategyManagerStorage *StrategyManagerStorageTransactor) AddShares(opts *bind.TransactOpts, staker common.Address, token common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { return _StrategyManagerStorage.contract.Transact(opts, "addShares", staker, token, strategy, shares) } // AddShares is a paid mutator transaction binding the contract method 0xc4623ea1. // -// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns() +// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns(uint256 existingShares) func (_StrategyManagerStorage *StrategyManagerStorageSession) AddShares(staker common.Address, token common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { return _StrategyManagerStorage.Contract.AddShares(&_StrategyManagerStorage.TransactOpts, staker, token, strategy, shares) } // AddShares is a paid mutator transaction binding the contract method 0xc4623ea1. // -// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns() +// Solidity: function addShares(address staker, address token, address strategy, uint256 shares) returns(uint256 existingShares) func (_StrategyManagerStorage *StrategyManagerStorageTransactorSession) AddShares(staker common.Address, token common.Address, strategy common.Address, shares *big.Int) (*types.Transaction, error) { return _StrategyManagerStorage.Contract.AddShares(&_StrategyManagerStorage.TransactOpts, staker, token, strategy, shares) } diff --git a/script/configs/devnet/M2_deploy_from_scratch.anvil.config.json b/script/configs/devnet/M2_deploy_from_scratch.anvil.config.json index b4ccb27dc..8221dfaac 100644 --- a/script/configs/devnet/M2_deploy_from_scratch.anvil.config.json +++ b/script/configs/devnet/M2_deploy_from_scratch.anvil.config.json @@ -38,7 +38,9 @@ "rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4", "activation_delay": 7200, "calculation_interval_seconds": 604800, - "global_operator_commission_bips": 1000 + "global_operator_commission_bips": 1000, + "OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000, + "OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000 }, "ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa" } \ No newline at end of file diff --git a/script/configs/devnet/deploy_from_scratch.anvil.config.json b/script/configs/devnet/deploy_from_scratch.anvil.config.json new file mode 100644 index 000000000..96df127e1 --- /dev/null +++ b/script/configs/devnet/deploy_from_scratch.anvil.config.json @@ -0,0 +1,55 @@ +{ + "maintainer": "samlaf@eigenlabs.org", + "multisig_addresses": { + "operationsMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "communityMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pauserMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "executorMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "timelock": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + }, + "strategies": [ + { + "token_address": "0x0000000000000000000000000000000000000000", + "token_symbol": "WETH", + "max_per_deposit": 115792089237316195423570985008687907853269984665640564039457584007913129639935, + "max_deposits": 115792089237316195423570985008687907853269984665640564039457584007913129639935 + } + ], + "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 + }, + "ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa" +} \ No newline at end of file diff --git a/script/configs/devnet/deploy_from_scratch.holesky.config.json b/script/configs/devnet/deploy_from_scratch.holesky.config.json new file mode 100644 index 000000000..c34c93746 --- /dev/null +++ b/script/configs/devnet/deploy_from_scratch.holesky.config.json @@ -0,0 +1,58 @@ +{ + "maintainer": "samlaf@eigenlabs.org", + "multisig_addresses": { + "operationsMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "communityMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "pauserMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "executorMultisig": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "timelock": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479" + }, + "strategies": [ + { + "token_address": "0x0000000000000000000000000000000000000000", + "token_symbol": "WETH", + "max_per_deposit": 115792089237316195423570985008687907853269984665640564039457584007913129639935, + "max_deposits": 115792089237316195423570985008687907853269984665640564039457584007913129639935 + } + ], + "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": "0xDA29BB71669f46F2a779b4b62f03644A84eE3479", + "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 + }, + "ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa" +} \ 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 index 93a1ee271..ecd86e029 100644 --- a/script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json +++ b/script/configs/holesky/Deploy_RewardsCoordinator.holesky.config.json @@ -33,7 +33,9 @@ "rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4", "activation_delay": 7200, "calculation_interval_seconds": 604800, - "global_operator_commission_bips": 1000 + "global_operator_commission_bips": 1000, + "OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000, + "OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000 }, "avsDirectory": { "init_paused_status": 0 diff --git a/script/deploy/devnet/Deploy_From_Scratch.s.sol b/script/deploy/devnet/Deploy_From_Scratch.s.sol new file mode 100644 index 000000000..b8ae3ec92 --- /dev/null +++ b/script/deploy/devnet/Deploy_From_Scratch.s.sol @@ -0,0 +1,675 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +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/Slasher.sol"; +import "../../../src/contracts/core/DelegationManager.sol"; +import "../../../src/contracts/core/AVSDirectory.sol"; +import "../../../src/contracts/core/RewardsCoordinator.sol"; +import "../../../src/contracts/core/AllocationManager.sol"; + +import "../../../src/contracts/strategies/StrategyBaseTVLLimits.sol"; + +import "../../../src/contracts/pods/EigenPod.sol"; +import "../../../src/contracts/pods/EigenPodManager.sol"; + +import "../../../src/contracts/permissions/PauserRegistry.sol"; + +import "../../../src/test/mocks/EmptyContract.sol"; +import "../../../src/test/mocks/ETHDepositMock.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/devnet/Deploy_From_Scratch.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --sig "run(string memory configFile)" -- deploy_from_scratch.anvil.config.json +contract DeployFromScratch is Script, Test { + Vm cheats = Vm(HEVM_ADDRESS); + + // struct used to encode token info in config file + struct StrategyConfig { + uint256 maxDeposits; + uint256 maxPerDeposit; + address tokenAddress; + string tokenSymbol; + } + + string public deployConfigPath; + + // EigenLayer Contracts + ProxyAdmin public eigenLayerProxyAdmin; + PauserRegistry public eigenLayerPauserReg; + Slasher public slasher; + Slasher public slasherImplementation; + DelegationManager public delegation; + DelegationManager public delegationImplementation; + StrategyManager public strategyManager; + StrategyManager public strategyManagerImplementation; + RewardsCoordinator public rewardsCoordinator; + RewardsCoordinator public rewardsCoordinatorImplementation; + AVSDirectory public avsDirectory; + AVSDirectory public avsDirectoryImplementation; + EigenPodManager public eigenPodManager; + EigenPodManager public eigenPodManagerImplementation; + UpgradeableBeacon public eigenPodBeacon; + EigenPod public eigenPodImplementation; + StrategyBase public baseStrategyImplementation; + AllocationManager public allocationManagerImplementation; + AllocationManager public allocationManager; + + EmptyContract public emptyContract; + + address executorMultisig; + address operationsMultisig; + address pauserMultisig; + + // the ETH2 deposit contract -- if not on mainnet, we deploy a mock as stand-in + IETHPOSDeposit public ethPOSDeposit; + + // strategies deployed + StrategyBaseTVLLimits[] public deployedStrategyArray; + + // IMMUTABLES TO SET + uint64 GOERLI_GENESIS_TIME = 1616508000; + + // OTHER DEPLOYMENT PARAMETERS + uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS; + uint256 SLASHER_INIT_PAUSED_STATUS; + uint256 DELEGATION_INIT_PAUSED_STATUS; + uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS; + uint256 REWARDS_COORDINATOR_INIT_PAUSED_STATUS; + + // RewardsCoordinator + uint32 REWARDS_COORDINATOR_MAX_REWARDS_DURATION; + uint32 REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH; + uint32 REWARDS_COORDINATOR_MAX_FUTURE_LENGTH; + uint32 REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP; + address REWARDS_COORDINATOR_UPDATER; + uint32 REWARDS_COORDINATOR_ACTIVATION_DELAY; + uint32 REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS; + uint32 REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS; + uint32 REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP; + uint32 REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH; + + // AllocationManager + uint256 ALLOCATION_MANAGER_INIT_PAUSED_STATUS; + + // one week in blocks -- 50400 + uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS; + uint256 DELEGATION_WITHDRAWAL_DELAY_BLOCKS; + + function run(string memory configFileName) public { + // read and log the chainID + uint256 chainId = block.chainid; + emit log_named_uint("You are deploying on ChainID", chainId); + + // READ JSON CONFIG DATA + deployConfigPath = string(bytes(string.concat("script/configs/devnet/", configFileName))); + string memory config_data = vm.readFile(deployConfigPath); + // bytes memory parsedData = vm.parseJson(config_data); + + STRATEGY_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".strategyManager.init_paused_status"); + SLASHER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".slasher.init_paused_status"); + DELEGATION_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".delegation.init_paused_status"); + DELEGATION_WITHDRAWAL_DELAY_BLOCKS = stdJson.readUint(config_data, ".delegation.init_withdrawal_delay_blocks"); + EIGENPOD_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".eigenPodManager.init_paused_status"); + REWARDS_COORDINATOR_INIT_PAUSED_STATUS = stdJson.readUint( + config_data, + ".rewardsCoordinator.init_paused_status" + ); + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS = uint32( + stdJson.readUint(config_data, ".rewardsCoordinator.CALCULATION_INTERVAL_SECONDS") + ); + REWARDS_COORDINATOR_MAX_REWARDS_DURATION = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.MAX_REWARDS_DURATION")); + REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.MAX_RETROACTIVE_LENGTH")); + REWARDS_COORDINATOR_MAX_FUTURE_LENGTH = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.MAX_FUTURE_LENGTH")); + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.GENESIS_REWARDS_TIMESTAMP")); + REWARDS_COORDINATOR_UPDATER = stdJson.readAddress(config_data, ".rewardsCoordinator.rewards_updater_address"); + REWARDS_COORDINATOR_ACTIVATION_DELAY = uint32(stdJson.readUint(config_data, ".rewardsCoordinator.activation_delay")); + REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS = uint32( + stdJson.readUint(config_data, ".rewardsCoordinator.calculation_interval_seconds") + ); + REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS = uint32( + stdJson.readUint(config_data, ".rewardsCoordinator.global_operator_commission_bips") + ); + REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP = uint32( + stdJson.readUint(config_data, ".rewardsCoordinator.OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP") + ); + REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH = uint32( + stdJson.readUint(config_data, ".rewardsCoordinator.OPERATOR_SET_MAX_RETROACTIVE_LENGTH") + ); + + ALLOCATION_MANAGER_INIT_PAUSED_STATUS = uint32( + stdJson.readUint(config_data, ".allocationManager.init_paused_status") + ); + + STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = uint32( + stdJson.readUint(config_data, ".strategyManager.init_withdrawal_delay_blocks") + ); + + // tokens to deploy strategies for + StrategyConfig[] memory strategyConfigs; + + executorMultisig = stdJson.readAddress(config_data, ".multisig_addresses.executorMultisig"); + operationsMultisig = stdJson.readAddress(config_data, ".multisig_addresses.operationsMultisig"); + pauserMultisig = stdJson.readAddress(config_data, ".multisig_addresses.pauserMultisig"); + // load token list + bytes memory strategyConfigsRaw = stdJson.parseRaw(config_data, ".strategies"); + strategyConfigs = abi.decode(strategyConfigsRaw, (StrategyConfig[])); + + require(executorMultisig != address(0), "executorMultisig address not configured correctly!"); + require(operationsMultisig != address(0), "operationsMultisig address not configured correctly!"); + + // START RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.startBroadcast(); + + // deploy proxy admin for ability to upgrade proxy contracts + eigenLayerProxyAdmin = new ProxyAdmin(); + + //deploy pauser registry + { + address[] memory pausers = new address[](3); + pausers[0] = executorMultisig; + pausers[1] = operationsMultisig; + pausers[2] = pauserMultisig; + eigenLayerPauserReg = new PauserRegistry(pausers, executorMultisig); + } + + /** + * 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(); + delegation = DelegationManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + strategyManager = StrategyManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + avsDirectory = AVSDirectory( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + slasher = Slasher( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + eigenPodManager = EigenPodManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + rewardsCoordinator = RewardsCoordinator( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + allocationManager = AllocationManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + + // if on mainnet, use the ETH2 deposit contract address + if (chainId == 1) { + ethPOSDeposit = IETHPOSDeposit(0x00000000219ab540356cBB839Cbe05303d7705Fa); + // if not on mainnet, deploy a mock + } else { + ethPOSDeposit = IETHPOSDeposit(stdJson.readAddress(config_data, ".ethPOSDepositAddress")); + } + eigenPodImplementation = new EigenPod( + ethPOSDeposit, + eigenPodManager, + GOERLI_GENESIS_TIME + ); + + eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation)); + + // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs + delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager, avsDirectory, allocationManager); + strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher, avsDirectory); + avsDirectoryImplementation = new AVSDirectory(delegation); + slasherImplementation = new Slasher(strategyManager, delegation); + eigenPodManagerImplementation = new EigenPodManager( + ethPOSDeposit, + eigenPodBeacon, + strategyManager, + slasher, + delegation + ); + rewardsCoordinatorImplementation = new RewardsCoordinator( + delegation, + strategyManager, + avsDirectory, + 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, + REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH + ); + allocationManagerImplementation = new AllocationManager(delegation, avsDirectory); + + // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. + { + IStrategy[] memory _strategies; + uint256[] memory _withdrawalDelayBlocks; + eigenLayerProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(delegation))), + address(delegationImplementation), + abi.encodeWithSelector( + DelegationManager.initialize.selector, + executorMultisig, + eigenLayerPauserReg, + DELEGATION_INIT_PAUSED_STATUS, + DELEGATION_WITHDRAWAL_DELAY_BLOCKS, + _strategies, + _withdrawalDelayBlocks + ) + ); + } + eigenLayerProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(strategyManager))), + address(strategyManagerImplementation), + abi.encodeWithSelector( + StrategyManager.initialize.selector, + executorMultisig, + operationsMultisig, + eigenLayerPauserReg, + STRATEGY_MANAGER_INIT_PAUSED_STATUS + ) + ); + eigenLayerProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(slasher))), + address(slasherImplementation), + abi.encodeWithSelector( + Slasher.initialize.selector, + executorMultisig, + eigenLayerPauserReg, + SLASHER_INIT_PAUSED_STATUS + ) + ); + eigenLayerProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(avsDirectory))), + address(avsDirectoryImplementation), + abi.encodeWithSelector(AVSDirectory.initialize.selector, executorMultisig, eigenLayerPauserReg, 0) + ); + eigenLayerProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(eigenPodManager))), + address(eigenPodManagerImplementation), + abi.encodeWithSelector( + EigenPodManager.initialize.selector, + executorMultisig, + eigenLayerPauserReg, + EIGENPOD_MANAGER_INIT_PAUSED_STATUS + ) + ); + eigenLayerProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(rewardsCoordinator))), + address(rewardsCoordinatorImplementation), + abi.encodeWithSelector( + RewardsCoordinator.initialize.selector, + executorMultisig, + eigenLayerPauserReg, + REWARDS_COORDINATOR_INIT_PAUSED_STATUS, + REWARDS_COORDINATOR_UPDATER, + REWARDS_COORDINATOR_ACTIVATION_DELAY, + REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS + ) + ); + eigenLayerProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(payable(address(allocationManager))), + address(allocationManagerImplementation), + abi.encodeWithSelector( + AllocationManager.initialize.selector, + executorMultisig, + eigenLayerPauserReg, + ALLOCATION_MANAGER_INIT_PAUSED_STATUS + ) + ); + + // deploy StrategyBaseTVLLimits contract implementation + baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager); + // create upgradeable proxies that each point to the implementation and initialize them + for (uint256 i = 0; i < strategyConfigs.length; ++i) { + if (strategyConfigs[i].tokenAddress == address(0)) { + strategyConfigs[i].tokenAddress = address(new ERC20PresetFixedSupply("TestToken", "TEST", uint256(type(uint128).max), executorMultisig)); + } + deployedStrategyArray.push( + StrategyBaseTVLLimits( + address( + new TransparentUpgradeableProxy( + address(baseStrategyImplementation), + address(eigenLayerProxyAdmin), + abi.encodeWithSelector( + StrategyBaseTVLLimits.initialize.selector, + strategyConfigs[i].maxPerDeposit, + strategyConfigs[i].maxDeposits, + IERC20(strategyConfigs[i].tokenAddress), + eigenLayerPauserReg + ) + ) + ) + ) + ); + } + + eigenLayerProxyAdmin.transferOwnership(executorMultisig); + eigenPodBeacon.transferOwnership(executorMultisig); + + // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT + vm.stopBroadcast(); + + // CHECK CORRECTNESS OF DEPLOYMENT + _verifyContractsPointAtOneAnother( + delegationImplementation, + strategyManagerImplementation, + slasherImplementation, + eigenPodManagerImplementation, + rewardsCoordinatorImplementation + ); + _verifyContractsPointAtOneAnother( + delegation, + strategyManager, + slasher, + eigenPodManager, + rewardsCoordinator + ); + _verifyImplementationsSetCorrectly(); + _verifyInitialOwners(); + _checkPauserInitializations(); + _verifyInitializationParams(); + + // WRITE JSON DATA + string memory parent_object = "parent object"; + + string memory deployed_strategies = "strategies"; + for (uint256 i = 0; i < strategyConfigs.length; ++i) { + vm.serializeAddress(deployed_strategies, strategyConfigs[i].tokenSymbol, address(deployedStrategyArray[i])); + } + string memory deployed_strategies_output = strategyConfigs.length == 0 + ? "" + : vm.serializeAddress( + deployed_strategies, + strategyConfigs[strategyConfigs.length - 1].tokenSymbol, + address(deployedStrategyArray[strategyConfigs.length - 1]) + ); + + string memory deployed_addresses = "addresses"; + vm.serializeUint(deployed_addresses, "numStrategiesDeployed", 0); // for compatibility with other scripts + vm.serializeAddress(deployed_addresses, "eigenLayerProxyAdmin", address(eigenLayerProxyAdmin)); + vm.serializeAddress(deployed_addresses, "eigenLayerPauserReg", address(eigenLayerPauserReg)); + vm.serializeAddress(deployed_addresses, "slasher", address(slasher)); + vm.serializeAddress(deployed_addresses, "slasherImplementation", address(slasherImplementation)); + vm.serializeAddress(deployed_addresses, "delegationManager", address(delegation)); + vm.serializeAddress(deployed_addresses, "delegationManagerImplementation", address(delegationImplementation)); + vm.serializeAddress(deployed_addresses, "avsDirectory", address(avsDirectory)); + vm.serializeAddress(deployed_addresses, "avsDirectoryImplementation", address(avsDirectoryImplementation)); + vm.serializeAddress(deployed_addresses, "allocationManager", address(allocationManager)); + vm.serializeAddress(deployed_addresses, "allocationManagerImplementation", address(allocationManagerImplementation)); + vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); + vm.serializeAddress( + deployed_addresses, + "strategyManagerImplementation", + address(strategyManagerImplementation) + ); + vm.serializeAddress(deployed_addresses, "eigenPodManager", address(eigenPodManager)); + vm.serializeAddress( + deployed_addresses, + "eigenPodManagerImplementation", + address(eigenPodManagerImplementation) + ); + vm.serializeAddress(deployed_addresses, "rewardsCoordinator", address(rewardsCoordinator)); + vm.serializeAddress( + deployed_addresses, + "rewardsCoordinatorImplementation", + address(rewardsCoordinatorImplementation) + ); + vm.serializeAddress(deployed_addresses, "eigenPodBeacon", address(eigenPodBeacon)); + vm.serializeAddress(deployed_addresses, "eigenPodImplementation", address(eigenPodImplementation)); + vm.serializeAddress(deployed_addresses, "baseStrategyImplementation", address(baseStrategyImplementation)); + vm.serializeAddress(deployed_addresses, "emptyContract", address(emptyContract)); + + string memory deployed_addresses_output = vm.serializeString( + deployed_addresses, + "strategies", + deployed_strategies_output + ); + + { + // dummy token data + string memory token = '{"tokenProxyAdmin": "0x0000000000000000000000000000000000000000", "EIGEN": "0x0000000000000000000000000000000000000000","bEIGEN": "0x0000000000000000000000000000000000000000","EIGENImpl": "0x0000000000000000000000000000000000000000","bEIGENImpl": "0x0000000000000000000000000000000000000000","eigenStrategy": "0x0000000000000000000000000000000000000000","eigenStrategyImpl": "0x0000000000000000000000000000000000000000"}'; + deployed_addresses_output = vm.serializeString(deployed_addresses, "token", token); + } + + string memory parameters = "parameters"; + vm.serializeAddress(parameters, "executorMultisig", executorMultisig); + vm.serializeAddress(parameters, "communityMultisig", operationsMultisig); + vm.serializeAddress(parameters, "pauserMultisig", pauserMultisig); + vm.serializeAddress(parameters, "timelock", address(0)); + string memory parameters_output = vm.serializeAddress(parameters, "operationsMultisig", operationsMultisig); + + string memory chain_info = "chainInfo"; + vm.serializeUint(chain_info, "deploymentBlock", block.number); + string memory chain_info_output = vm.serializeUint(chain_info, "chainId", chainId); + + // serialize all the data + vm.serializeString(parent_object, deployed_addresses, deployed_addresses_output); + vm.serializeString(parent_object, chain_info, chain_info_output); + string memory finalJson = vm.serializeString(parent_object, parameters, parameters_output); + // TODO: should output to different file depending on configFile passed to run() + // so that we don't override mainnet output by deploying to goerli for eg. + vm.writeJson(finalJson, "script/output/devnet/M2_from_scratch_deployment_data.json"); + } + + function _verifyContractsPointAtOneAnother( + DelegationManager delegationContract, + StrategyManager strategyManagerContract, + Slasher /*slasherContract*/, + EigenPodManager eigenPodManagerContract, + RewardsCoordinator rewardsCoordinatorContract + ) internal view { + require(delegationContract.slasher() == slasher, "delegation: slasher address not set correctly"); + require( + delegationContract.strategyManager() == strategyManager, + "delegation: strategyManager address not set correctly" + ); + + require(strategyManagerContract.slasher() == slasher, "strategyManager: slasher address not set correctly"); + require( + strategyManagerContract.delegation() == delegation, + "strategyManager: delegation address not set correctly" + ); + require( + strategyManagerContract.eigenPodManager() == eigenPodManager, + "strategyManager: eigenPodManager address not set correctly" + ); + + // removing slasher requirements because there is no slasher as part of m2-mainnet release + // require(slasherContract.strategyManager() == strategyManager, "slasher: strategyManager not set correctly"); + // require(slasherContract.delegation() == delegation, "slasher: delegation not set correctly"); + + require( + eigenPodManagerContract.ethPOS() == ethPOSDeposit, + " eigenPodManager: ethPOSDeposit contract address not set correctly" + ); + require( + eigenPodManagerContract.eigenPodBeacon() == eigenPodBeacon, + "eigenPodManager: eigenPodBeacon contract address not set correctly" + ); + require( + eigenPodManagerContract.strategyManager() == strategyManager, + "eigenPodManager: strategyManager contract address not set correctly" + ); + require( + eigenPodManagerContract.slasher() == slasher, + "eigenPodManager: slasher contract address not set correctly" + ); + + require( + rewardsCoordinatorContract.delegationManager() == delegation, + "rewardsCoordinator: delegation address not set correctly" + ); + + require( + rewardsCoordinatorContract.strategyManager() == strategyManager, + "rewardsCoordinator: strategyManager address not set correctly" + ); + } + + function _verifyImplementationsSetCorrectly() internal view { + require( + eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(delegation)))) == + address(delegationImplementation), + "delegation: implementation set incorrectly" + ); + require( + eigenLayerProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(strategyManager))) + ) == address(strategyManagerImplementation), + "strategyManager: implementation set incorrectly" + ); + require( + eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(slasher)))) == + address(slasherImplementation), + "slasher: implementation set incorrectly" + ); + require( + eigenLayerProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(eigenPodManager))) + ) == address(eigenPodManagerImplementation), + "eigenPodManager: implementation set incorrectly" + ); + require( + eigenLayerProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(rewardsCoordinator))) + ) == address(rewardsCoordinatorImplementation), + "rewardsCoordinator: implementation set incorrectly" + ); + + require( + eigenLayerProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(allocationManager))) + ) == address(allocationManagerImplementation), + "allocationManager: implementation set incorrectly" + ); + + for (uint256 i = 0; i < deployedStrategyArray.length; ++i) { + require( + eigenLayerProxyAdmin.getProxyImplementation( + TransparentUpgradeableProxy(payable(address(deployedStrategyArray[i]))) + ) == address(baseStrategyImplementation), + "strategy: implementation set incorrectly" + ); + } + + require( + eigenPodBeacon.implementation() == address(eigenPodImplementation), + "eigenPodBeacon: implementation set incorrectly" + ); + } + + function _verifyInitialOwners() internal view { + require(strategyManager.owner() == executorMultisig, "strategyManager: owner not set correctly"); + require(delegation.owner() == executorMultisig, "delegation: owner not set correctly"); + // removing slasher requirements because there is no slasher as part of m2-mainnet release + // require(slasher.owner() == executorMultisig, "slasher: owner not set correctly"); + require(eigenPodManager.owner() == executorMultisig, "eigenPodManager: owner not set correctly"); + + require(eigenLayerProxyAdmin.owner() == executorMultisig, "eigenLayerProxyAdmin: owner not set correctly"); + require(eigenPodBeacon.owner() == executorMultisig, "eigenPodBeacon: owner not set correctly"); + } + + function _checkPauserInitializations() internal view { + require(delegation.pauserRegistry() == eigenLayerPauserReg, "delegation: pauser registry not set correctly"); + require( + strategyManager.pauserRegistry() == eigenLayerPauserReg, + "strategyManager: pauser registry not set correctly" + ); + // removing slasher requirements because there is no slasher as part of m2-mainnet release + // require(slasher.pauserRegistry() == eigenLayerPauserReg, "slasher: pauser registry not set correctly"); + require( + eigenPodManager.pauserRegistry() == eigenLayerPauserReg, + "eigenPodManager: pauser registry not set correctly" + ); + require( + rewardsCoordinator.pauserRegistry() == eigenLayerPauserReg, + "rewardsCoordinator: pauser registry not set correctly" + ); + + require(eigenLayerPauserReg.isPauser(operationsMultisig), "pauserRegistry: operationsMultisig is not pauser"); + require(eigenLayerPauserReg.isPauser(executorMultisig), "pauserRegistry: executorMultisig is not pauser"); + require(eigenLayerPauserReg.isPauser(pauserMultisig), "pauserRegistry: pauserMultisig is not pauser"); + require(eigenLayerPauserReg.unpauser() == executorMultisig, "pauserRegistry: unpauser not set correctly"); + + for (uint256 i = 0; i < deployedStrategyArray.length; ++i) { + require( + deployedStrategyArray[i].pauserRegistry() == eigenLayerPauserReg, + "StrategyBaseTVLLimits: pauser registry not set correctly" + ); + require( + deployedStrategyArray[i].paused() == 0, + "StrategyBaseTVLLimits: init paused status set incorrectly" + ); + } + + // // pause *nothing* + // uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS = 0; + // // pause *everything* + // uint256 SLASHER_INIT_PAUSED_STATUS = type(uint256).max; + // // pause *everything* + // uint256 DELEGATION_INIT_PAUSED_STATUS = type(uint256).max; + // // pause *all of the proof-related functionality* (everything that can be paused other than creation of EigenPods) + // uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS = (2**1) + (2**2) + (2**3) + (2**4); /* = 30 */ + // // pause *nothing* + // require(strategyManager.paused() == 0, "strategyManager: init paused status set incorrectly"); + // require(slasher.paused() == type(uint256).max, "slasher: init paused status set incorrectly"); + // require(delegation.paused() == type(uint256).max, "delegation: init paused status set incorrectly"); + // require(eigenPodManager.paused() == 30, "eigenPodManager: init paused status set incorrectly"); + } + + function _verifyInitializationParams() internal { + // // one week in blocks -- 50400 + // uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = 7 days / 12 seconds; + // require(strategyManager.withdrawalDelayBlocks() == 7 days / 12 seconds, + // "strategyManager: withdrawalDelayBlocks initialized incorrectly"); + // uint256 MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR = 32 ether; + + require( + strategyManager.strategyWhitelister() == operationsMultisig, + "strategyManager: strategyWhitelister address not set correctly" + ); + + require( + baseStrategyImplementation.strategyManager() == strategyManager, + "baseStrategyImplementation: strategyManager set incorrectly" + ); + + require( + eigenPodImplementation.ethPOS() == ethPOSDeposit, + "eigenPodImplementation: ethPOSDeposit contract address not set correctly" + ); + require( + eigenPodImplementation.eigenPodManager() == eigenPodManager, + " eigenPodImplementation: eigenPodManager contract address not set correctly" + ); + + string memory config_data = vm.readFile(deployConfigPath); + for (uint i = 0; i < deployedStrategyArray.length; i++) { + uint256 maxPerDeposit = stdJson.readUint( + config_data, + string.concat(".strategies[", vm.toString(i), "].max_per_deposit") + ); + uint256 maxDeposits = stdJson.readUint( + config_data, + string.concat(".strategies[", vm.toString(i), "].max_deposits") + ); + (uint256 setMaxPerDeposit, uint256 setMaxDeposits) = deployedStrategyArray[i].getTVLLimits(); + require(setMaxPerDeposit == maxPerDeposit, "setMaxPerDeposit not set correctly"); + require(setMaxDeposits == maxDeposits, "setMaxDeposits not set correctly"); + } + } +} diff --git a/script/deploy/devnet/M2_Deploy_From_Scratch.s.sol b/script/deploy/devnet/M2_Deploy_From_Scratch.s.sol index 55510a7c9..b0140e3cc 100644 --- a/script/deploy/devnet/M2_Deploy_From_Scratch.s.sol +++ b/script/deploy/devnet/M2_Deploy_From_Scratch.s.sol @@ -13,6 +13,7 @@ import "../../../src/contracts/core/Slasher.sol"; import "../../../src/contracts/core/DelegationManager.sol"; import "../../../src/contracts/core/AVSDirectory.sol"; import "../../../src/contracts/core/RewardsCoordinator.sol"; +import "../../../src/contracts/core/AllocationManager.sol"; import "../../../src/contracts/strategies/StrategyBaseTVLLimits.sol"; @@ -63,6 +64,8 @@ contract Deployer_M2 is Script, Test { UpgradeableBeacon public eigenPodBeacon; EigenPod public eigenPodImplementation; StrategyBase public baseStrategyImplementation; + AllocationManager public allocationManager; + AllocationManager public allocationManagerImplementation; EmptyContract public emptyContract; @@ -95,6 +98,8 @@ contract Deployer_M2 is Script, Test { uint32 REWARDS_COORDINATOR_ACTIVATION_DELAY; uint32 REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS; uint32 REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS; + uint32 REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP; + uint32 REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH; // one week in blocks -- 50400 uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS; @@ -134,6 +139,12 @@ contract Deployer_M2 is Script, Test { REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS = uint32( stdJson.readUint(config_data, ".rewardsCoordinator.global_operator_commission_bips") ); + REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP = uint32( + stdJson.readUint(config_data, ".rewardsCoordinator.OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP") + ); + REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH = uint32( + stdJson.readUint(config_data, ".rewardsCoordinator.OPERATOR_SET_MAX_RETROACTIVE_LENGTH") + ); STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = uint32( stdJson.readUint(config_data, ".strategyManager.init_withdrawal_delay_blocks") @@ -190,6 +201,9 @@ contract Deployer_M2 is Script, Test { rewardsCoordinator = RewardsCoordinator( address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) ); + allocationManager = AllocationManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); // if on mainnet, use the ETH2 deposit contract address if (chainId == 1) { @@ -207,8 +221,8 @@ contract Deployer_M2 is Script, Test { eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation)); // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs - delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher); + delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager, avsDirectory, allocationManager); + strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher, avsDirectory); avsDirectoryImplementation = new AVSDirectory(delegation); slasherImplementation = new Slasher(strategyManager, delegation); eigenPodManagerImplementation = new EigenPodManager( @@ -221,11 +235,14 @@ contract Deployer_M2 is Script, Test { rewardsCoordinatorImplementation = new RewardsCoordinator( delegation, strategyManager, + avsDirectory, 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 + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH ); // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. diff --git a/script/deploy/devnet/Upgrade.s.sol b/script/deploy/devnet/Upgrade.s.sol new file mode 100644 index 000000000..22f038899 --- /dev/null +++ b/script/deploy/devnet/Upgrade.s.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +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); + eigenLayerProxyAdmin.upgrade(TransparentUpgradeableProxy(payable(address(avsDirectory))), address(newAVSDirectoryImplementation)); + vm.stopBroadcast(); + + } +} \ No newline at end of file diff --git a/script/deploy/devnet/operatorSets/DeployStrategies.s.sol b/script/deploy/devnet/operatorSets/DeployStrategies.s.sol new file mode 100644 index 000000000..da3222c33 --- /dev/null +++ b/script/deploy/devnet/operatorSets/DeployStrategies.s.sol @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +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); + bool[] memory falses = new bool[](batchSize); + + 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, falses); + } + + 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/holesky/Deploy_Test_RewardsCoordinator.s.sol b/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol index d7776b454..ed876866e 100644 --- a/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol +++ b/script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol @@ -46,11 +46,14 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser { rewardsCoordinatorImplementation = new RewardsCoordinator( delegationManager, strategyManager, + avsDirectory, 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 + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH ); rewardsCoordinator = RewardsCoordinator( address( @@ -79,11 +82,14 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser { rewardsCoordinatorImplementation = new RewardsCoordinator( delegationManager, strategyManager, + avsDirectory, 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 + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH ); eigenLayerProxyAdmin.upgrade( diff --git a/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol b/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol index 1e7e371ea..90e9e81b4 100644 --- a/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol +++ b/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol @@ -67,6 +67,10 @@ contract M2_Deploy_Holesky_From_Scratch is ExistingDeploymentParser { 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), @@ -76,8 +80,8 @@ contract M2_Deploy_Holesky_From_Scratch is ExistingDeploymentParser { eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation)); avsDirectoryImplementation = new AVSDirectory(delegationManager); - delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher); + delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager, avsDirectory, allocationManager); + strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher, avsDirectory); slasherImplementation = new Slasher(strategyManager, delegationManager); eigenPodManagerImplementation = new EigenPodManager( IETHPOSDeposit(ETHPOSDepositAddress), @@ -86,6 +90,7 @@ contract M2_Deploy_Holesky_From_Scratch is ExistingDeploymentParser { slasher, delegationManager ); + allocationManagerImplementation = new AllocationManager(delegationManager, avsDirectory); // Third, upgrade the proxy contracts to point to the implementations IStrategy[] memory initializeStrategiesToSetDelayBlocks = new IStrategy[](0); @@ -149,6 +154,17 @@ contract M2_Deploy_Holesky_From_Scratch is ExistingDeploymentParser { EIGENPOD_MANAGER_INIT_PAUSED_STATUS ) ); + // AllocationManager + eigenLayerProxyAdmin.upgradeAndCall( + TransparentUpgradeableProxy(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 + ) + ); // Deploy Strategies baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager); 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..a056291c2 --- /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.12; + +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(); + _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 + ); + + + + } +} \ No newline at end of file diff --git a/script/deploy/mainnet/M1_Deploy.s.sol b/script/deploy/mainnet/M1_Deploy.s.sol index d765774a6..546b6f31d 100644 --- a/script/deploy/mainnet/M1_Deploy.s.sol +++ b/script/deploy/mainnet/M1_Deploy.s.sol @@ -1,509 +1,509 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -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/Slasher.sol"; -import "../../../src/contracts/core/DelegationManager.sol"; - -import "../../../src/contracts/strategies/StrategyBaseTVLLimits.sol"; - -import "../../../src/contracts/pods/EigenPod.sol"; -import "../../../src/contracts/pods/EigenPodManager.sol"; - -import "../../../src/contracts/permissions/PauserRegistry.sol"; - -import "../../../src/test/mocks/EmptyContract.sol"; -import "../../../src/test/mocks/ETHDepositMock.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/M1_Deploy.s.sol:Deployer_M1 --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv -contract Deployer_M1 is Script, Test { - Vm cheats = Vm(HEVM_ADDRESS); - - // struct used to encode token info in config file - struct StrategyConfig { - uint256 maxDeposits; - uint256 maxPerDeposit; - address tokenAddress; - string tokenSymbol; - } - - string public deployConfigPath = string(bytes("script/M1_deploy.config.json")); - - // EigenLayer Contracts - ProxyAdmin public eigenLayerProxyAdmin; - PauserRegistry public eigenLayerPauserReg; - Slasher public slasher; - Slasher public slasherImplementation; - DelegationManager public delegation; - DelegationManager public delegationImplementation; - StrategyManager public strategyManager; - StrategyManager public strategyManagerImplementation; - EigenPodManager public eigenPodManager; - EigenPodManager public eigenPodManagerImplementation; - UpgradeableBeacon public eigenPodBeacon; - EigenPod public eigenPodImplementation; - StrategyBase public baseStrategyImplementation; - - EmptyContract public emptyContract; - - address executorMultisig; - address operationsMultisig; - address pauserMultisig; - - // the ETH2 deposit contract -- if not on mainnet, we deploy a mock as stand-in - IETHPOSDeposit public ethPOSDeposit; - - // strategies deployed - StrategyBaseTVLLimits[] public deployedStrategyArray; - - // IMMUTABLES TO SET - uint256 REQUIRED_BALANCE_WEI; - uint256 MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR; - uint64 GOERLI_GENESIS_TIME = 1616508000; - - // OTHER DEPLOYMENT PARAMETERS - uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS; - uint256 SLASHER_INIT_PAUSED_STATUS; - uint256 DELEGATION_INIT_PAUSED_STATUS; - uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS; - uint256 EIGENPOD_MANAGER_MAX_PODS; - - // one week in blocks -- 50400 - uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS; - - function run() external { - // read and log the chainID - uint256 chainId = block.chainid; - emit log_named_uint("You are deploying on ChainID", chainId); - - // READ JSON CONFIG DATA - string memory config_data = vm.readFile(deployConfigPath); - // bytes memory parsedData = vm.parseJson(config_data); - - STRATEGY_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".strategyManager.init_paused_status"); - SLASHER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".slasher.init_paused_status"); - DELEGATION_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".delegation.init_paused_status"); - EIGENPOD_MANAGER_MAX_PODS = stdJson.readUint(config_data, ".eigenPodManager.max_pods"); - EIGENPOD_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".eigenPodManager.init_paused_status"); - - STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = uint32( - stdJson.readUint(config_data, ".strategyManager.init_withdrawal_delay_blocks") - ); - - REQUIRED_BALANCE_WEI = stdJson.readUint(config_data, ".eigenPod.REQUIRED_BALANCE_WEI"); - MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR = stdJson.readUint( - config_data, - ".eigenPod.MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR" - ); - - // tokens to deploy strategies for - StrategyConfig[] memory strategyConfigs; - - executorMultisig = stdJson.readAddress(config_data, ".multisig_addresses.executorMultisig"); - operationsMultisig = stdJson.readAddress(config_data, ".multisig_addresses.operationsMultisig"); - pauserMultisig = stdJson.readAddress(config_data, ".multisig_addresses.pauserMultisig"); - // load token list - bytes memory strategyConfigsRaw = stdJson.parseRaw(config_data, ".strategies"); - strategyConfigs = abi.decode(strategyConfigsRaw, (StrategyConfig[])); - - require(executorMultisig != address(0), "executorMultisig address not configured correctly!"); - require(operationsMultisig != address(0), "operationsMultisig address not configured correctly!"); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - // deploy proxy admin for ability to upgrade proxy contracts - eigenLayerProxyAdmin = new ProxyAdmin(); - - //deploy pauser registry - { - address[] memory pausers = new address[](3); - pausers[0] = executorMultisig; - pausers[1] = operationsMultisig; - pausers[2] = pauserMultisig; - eigenLayerPauserReg = new PauserRegistry(pausers, executorMultisig); - } - - /** - * 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(); - delegation = DelegationManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - strategyManager = StrategyManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - slasher = Slasher( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - eigenPodManager = EigenPodManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - - // if on mainnet, use the ETH2 deposit contract address - if (chainId == 1) { - ethPOSDeposit = IETHPOSDeposit(0x00000000219ab540356cBB839Cbe05303d7705Fa); - // if not on mainnet, deploy a mock - } else { - ethPOSDeposit = IETHPOSDeposit(stdJson.readAddress(config_data, ".ethPOSDepositAddress")); - } - eigenPodImplementation = new EigenPod( - ethPOSDeposit, - eigenPodManager, - GOERLI_GENESIS_TIME - ); - - eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation)); - - // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs - delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher); - slasherImplementation = new Slasher(strategyManager, delegation); - eigenPodManagerImplementation = new EigenPodManager( - ethPOSDeposit, - eigenPodBeacon, - strategyManager, - slasher, - delegation - ); - - // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(delegation))), - address(delegationImplementation), - abi.encodeWithSelector( - DelegationManager.initialize.selector, - executorMultisig, - eigenLayerPauserReg, - DELEGATION_INIT_PAUSED_STATUS - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(strategyManager))), - address(strategyManagerImplementation), - abi.encodeWithSelector( - StrategyManager.initialize.selector, - executorMultisig, - operationsMultisig, - eigenLayerPauserReg, - STRATEGY_MANAGER_INIT_PAUSED_STATUS - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(slasher))), - address(slasherImplementation), - abi.encodeWithSelector( - Slasher.initialize.selector, - executorMultisig, - eigenLayerPauserReg, - SLASHER_INIT_PAUSED_STATUS - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation), - abi.encodeWithSelector( - EigenPodManager.initialize.selector, - executorMultisig, - eigenLayerPauserReg, - EIGENPOD_MANAGER_INIT_PAUSED_STATUS - ) - ); - - // deploy StrategyBaseTVLLimits contract implementation - baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager); - // create upgradeable proxies that each point to the implementation and initialize them - for (uint256 i = 0; i < strategyConfigs.length; ++i) { - deployedStrategyArray.push( - StrategyBaseTVLLimits( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - StrategyBaseTVLLimits.initialize.selector, - strategyConfigs[i].maxPerDeposit, - strategyConfigs[i].maxDeposits, - IERC20(strategyConfigs[i].tokenAddress), - eigenLayerPauserReg - ) - ) - ) - ) - ); - } - - eigenLayerProxyAdmin.transferOwnership(executorMultisig); - eigenPodBeacon.transferOwnership(executorMultisig); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // CHECK CORRECTNESS OF DEPLOYMENT - _verifyContractsPointAtOneAnother( - delegationImplementation, - strategyManagerImplementation, - slasherImplementation, - eigenPodManagerImplementation - ); - _verifyContractsPointAtOneAnother( - delegation, - strategyManager, - slasher, - eigenPodManager - ); - _verifyImplementationsSetCorrectly(); - _verifyInitialOwners(); - _checkPauserInitializations(); - _verifyInitializationParams(); - - // WRITE JSON DATA - string memory parent_object = "parent object"; - - string memory deployed_strategies = "strategies"; - for (uint256 i = 0; i < strategyConfigs.length; ++i) { - vm.serializeAddress(deployed_strategies, strategyConfigs[i].tokenSymbol, address(deployedStrategyArray[i])); - } - string memory deployed_strategies_output = vm.serializeAddress( - deployed_strategies, - strategyConfigs[strategyConfigs.length - 1].tokenSymbol, - address(deployedStrategyArray[strategyConfigs.length - 1]) - ); - - string memory deployed_addresses = "addresses"; - vm.serializeAddress(deployed_addresses, "eigenLayerProxyAdmin", address(eigenLayerProxyAdmin)); - vm.serializeAddress(deployed_addresses, "eigenLayerPauserReg", address(eigenLayerPauserReg)); - vm.serializeAddress(deployed_addresses, "slasher", address(slasher)); - vm.serializeAddress(deployed_addresses, "slasherImplementation", address(slasherImplementation)); - vm.serializeAddress(deployed_addresses, "delegation", address(delegation)); - vm.serializeAddress(deployed_addresses, "delegationImplementation", address(delegationImplementation)); - vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); - vm.serializeAddress( - deployed_addresses, - "strategyManagerImplementation", - address(strategyManagerImplementation) - ); - vm.serializeAddress(deployed_addresses, "eigenPodManager", address(eigenPodManager)); - vm.serializeAddress( - deployed_addresses, - "eigenPodManagerImplementation", - address(eigenPodManagerImplementation) - ); - vm.serializeAddress(deployed_addresses, "eigenPodBeacon", address(eigenPodBeacon)); - vm.serializeAddress(deployed_addresses, "eigenPodImplementation", address(eigenPodImplementation)); - vm.serializeAddress(deployed_addresses, "baseStrategyImplementation", address(baseStrategyImplementation)); - vm.serializeAddress(deployed_addresses, "emptyContract", address(emptyContract)); - string memory deployed_addresses_output = vm.serializeString( - deployed_addresses, - "strategies", - deployed_strategies_output - ); - - string memory parameters = "parameters"; - vm.serializeAddress(parameters, "executorMultisig", executorMultisig); - string memory parameters_output = vm.serializeAddress(parameters, "operationsMultisig", operationsMultisig); - - string memory chain_info = "chainInfo"; - vm.serializeUint(chain_info, "deploymentBlock", block.number); - string memory chain_info_output = vm.serializeUint(chain_info, "chainId", chainId); - - // serialize all the data - vm.serializeString(parent_object, deployed_addresses, deployed_addresses_output); - vm.serializeString(parent_object, chain_info, chain_info_output); - string memory finalJson = vm.serializeString(parent_object, parameters, parameters_output); - vm.writeJson(finalJson, "script/output/M1_deployment_data.json"); - } - - function _verifyContractsPointAtOneAnother( - DelegationManager delegationContract, - StrategyManager strategyManagerContract, - Slasher slasherContract, - EigenPodManager eigenPodManagerContract - ) internal view { - require(delegationContract.slasher() == slasher, "delegation: slasher address not set correctly"); - require( - delegationContract.strategyManager() == strategyManager, - "delegation: strategyManager address not set correctly" - ); - - require(strategyManagerContract.slasher() == slasher, "strategyManager: slasher address not set correctly"); - require( - strategyManagerContract.delegation() == delegation, - "strategyManager: delegation address not set correctly" - ); - require( - strategyManagerContract.eigenPodManager() == eigenPodManager, - "strategyManager: eigenPodManager address not set correctly" - ); - - require(slasherContract.strategyManager() == strategyManager, "slasher: strategyManager not set correctly"); - require(slasherContract.delegation() == delegation, "slasher: delegation not set correctly"); - - require( - eigenPodManagerContract.ethPOS() == ethPOSDeposit, - " eigenPodManager: ethPOSDeposit contract address not set correctly" - ); - require( - eigenPodManagerContract.eigenPodBeacon() == eigenPodBeacon, - "eigenPodManager: eigenPodBeacon contract address not set correctly" - ); - require( - eigenPodManagerContract.strategyManager() == strategyManager, - "eigenPodManager: strategyManager contract address not set correctly" - ); - require( - eigenPodManagerContract.slasher() == slasher, - "eigenPodManager: slasher contract address not set correctly" - ); - } - - function _verifyImplementationsSetCorrectly() internal view { - require( - eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(delegation)))) == - address(delegationImplementation), - "delegation: implementation set incorrectly" - ); - require( - eigenLayerProxyAdmin.getProxyImplementation( - TransparentUpgradeableProxy(payable(address(strategyManager))) - ) == address(strategyManagerImplementation), - "strategyManager: implementation set incorrectly" - ); - require( - eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(slasher)))) == - address(slasherImplementation), - "slasher: implementation set incorrectly" - ); - require( - eigenLayerProxyAdmin.getProxyImplementation( - TransparentUpgradeableProxy(payable(address(eigenPodManager))) - ) == address(eigenPodManagerImplementation), - "eigenPodManager: implementation set incorrectly" - ); - - for (uint256 i = 0; i < deployedStrategyArray.length; ++i) { - require( - eigenLayerProxyAdmin.getProxyImplementation( - TransparentUpgradeableProxy(payable(address(deployedStrategyArray[i]))) - ) == address(baseStrategyImplementation), - "strategy: implementation set incorrectly" - ); - } - - require( - eigenPodBeacon.implementation() == address(eigenPodImplementation), - "eigenPodBeacon: implementation set incorrectly" - ); - } - - function _verifyInitialOwners() internal view { - require(strategyManager.owner() == executorMultisig, "strategyManager: owner not set correctly"); - require(delegation.owner() == executorMultisig, "delegation: owner not set correctly"); - require(slasher.owner() == executorMultisig, "slasher: owner not set correctly"); - require(eigenPodManager.owner() == executorMultisig, "delegation: owner not set correctly"); - - require(eigenLayerProxyAdmin.owner() == executorMultisig, "eigenLayerProxyAdmin: owner not set correctly"); - require(eigenPodBeacon.owner() == executorMultisig, "eigenPodBeacon: owner not set correctly"); - } - - function _checkPauserInitializations() internal view { - require(delegation.pauserRegistry() == eigenLayerPauserReg, "delegation: pauser registry not set correctly"); - require( - strategyManager.pauserRegistry() == eigenLayerPauserReg, - "strategyManager: pauser registry not set correctly" - ); - require(slasher.pauserRegistry() == eigenLayerPauserReg, "slasher: pauser registry not set correctly"); - require( - eigenPodManager.pauserRegistry() == eigenLayerPauserReg, - "eigenPodManager: pauser registry not set correctly" - ); - - require(eigenLayerPauserReg.isPauser(operationsMultisig), "pauserRegistry: operationsMultisig is not pauser"); - require(eigenLayerPauserReg.isPauser(executorMultisig), "pauserRegistry: executorMultisig is not pauser"); - require(eigenLayerPauserReg.isPauser(pauserMultisig), "pauserRegistry: pauserMultisig is not pauser"); - require(eigenLayerPauserReg.unpauser() == executorMultisig, "pauserRegistry: unpauser not set correctly"); - - for (uint256 i = 0; i < deployedStrategyArray.length; ++i) { - require( - deployedStrategyArray[i].pauserRegistry() == eigenLayerPauserReg, - "StrategyBaseTVLLimits: pauser registry not set correctly" - ); - require( - deployedStrategyArray[i].paused() == 0, - "StrategyBaseTVLLimits: init paused status set incorrectly" - ); - } - - // // pause *nothing* - // uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS = 0; - // // pause *everything* - // uint256 SLASHER_INIT_PAUSED_STATUS = type(uint256).max; - // // pause *everything* - // uint256 DELEGATION_INIT_PAUSED_STATUS = type(uint256).max; - // // pause *all of the proof-related functionality* (everything that can be paused other than creation of EigenPods) - // uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS = (2**1) + (2**2) + (2**3) + (2**4); /* = 30 */ - // // pause *nothing* - require(strategyManager.paused() == 0, "strategyManager: init paused status set incorrectly"); - require(slasher.paused() == type(uint256).max, "slasher: init paused status set incorrectly"); - require(delegation.paused() == type(uint256).max, "delegation: init paused status set incorrectly"); - require(eigenPodManager.paused() == 30, "eigenPodManager: init paused status set incorrectly"); - } - - function _verifyInitializationParams() internal { - // // one week in blocks -- 50400 - // uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = 7 days / 12 seconds; - // require(strategyManager.withdrawalDelayBlocks() == 7 days / 12 seconds, - // "strategyManager: withdrawalDelayBlocks initialized incorrectly"); - // uint256 REQUIRED_BALANCE_WEI = 32 ether; - - require( - strategyManager.strategyWhitelister() == operationsMultisig, - "strategyManager: strategyWhitelister address not set correctly" - ); - - require( - baseStrategyImplementation.strategyManager() == strategyManager, - "baseStrategyImplementation: strategyManager set incorrectly" - ); - - require( - eigenPodImplementation.ethPOS() == ethPOSDeposit, - "eigenPodImplementation: ethPOSDeposit contract address not set correctly" - ); - require( - eigenPodImplementation.eigenPodManager() == eigenPodManager, - " eigenPodImplementation: eigenPodManager contract address not set correctly" - ); - - string memory config_data = vm.readFile(deployConfigPath); - for (uint i = 0; i < deployedStrategyArray.length; i++) { - uint256 maxPerDeposit = stdJson.readUint( - config_data, - string.concat(".strategies[", vm.toString(i), "].max_per_deposit") - ); - uint256 maxDeposits = stdJson.readUint( - config_data, - string.concat(".strategies[", vm.toString(i), "].max_deposits") - ); - (uint256 setMaxPerDeposit, uint256 setMaxDeposits) = deployedStrategyArray[i].getTVLLimits(); - require(setMaxPerDeposit == maxPerDeposit, "setMaxPerDeposit not set correctly"); - require(setMaxDeposits == maxDeposits, "setMaxDeposits not set correctly"); - } - } -} +// // SPDX-License-Identifier: BUSL-1.1 +// pragma solidity ^0.8.12; + +// 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/Slasher.sol"; +// import "../../../src/contracts/core/DelegationManager.sol"; + +// import "../../../src/contracts/strategies/StrategyBaseTVLLimits.sol"; + +// import "../../../src/contracts/pods/EigenPod.sol"; +// import "../../../src/contracts/pods/EigenPodManager.sol"; + +// import "../../../src/contracts/permissions/PauserRegistry.sol"; + +// import "../../../src/test/mocks/EmptyContract.sol"; +// import "../../../src/test/mocks/ETHDepositMock.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/M1_Deploy.s.sol:Deployer_M1 --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv +// contract Deployer_M1 is Script, Test { +// Vm cheats = Vm(HEVM_ADDRESS); + +// // struct used to encode token info in config file +// struct StrategyConfig { +// uint256 maxDeposits; +// uint256 maxPerDeposit; +// address tokenAddress; +// string tokenSymbol; +// } + +// string public deployConfigPath = string(bytes("script/M1_deploy.config.json")); + +// // EigenLayer Contracts +// ProxyAdmin public eigenLayerProxyAdmin; +// PauserRegistry public eigenLayerPauserReg; +// Slasher public slasher; +// Slasher public slasherImplementation; +// DelegationManager public delegation; +// DelegationManager public delegationImplementation; +// StrategyManager public strategyManager; +// StrategyManager public strategyManagerImplementation; +// EigenPodManager public eigenPodManager; +// EigenPodManager public eigenPodManagerImplementation; +// UpgradeableBeacon public eigenPodBeacon; +// EigenPod public eigenPodImplementation; +// StrategyBase public baseStrategyImplementation; + +// EmptyContract public emptyContract; + +// address executorMultisig; +// address operationsMultisig; +// address pauserMultisig; + +// // the ETH2 deposit contract -- if not on mainnet, we deploy a mock as stand-in +// IETHPOSDeposit public ethPOSDeposit; + +// // strategies deployed +// StrategyBaseTVLLimits[] public deployedStrategyArray; + +// // IMMUTABLES TO SET +// uint256 REQUIRED_BALANCE_WEI; +// uint256 MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR; +// uint64 GOERLI_GENESIS_TIME = 1616508000; + +// // OTHER DEPLOYMENT PARAMETERS +// uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS; +// uint256 SLASHER_INIT_PAUSED_STATUS; +// uint256 DELEGATION_INIT_PAUSED_STATUS; +// uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS; +// uint256 EIGENPOD_MANAGER_MAX_PODS; + +// // one week in blocks -- 50400 +// uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS; + +// function run() external { +// // read and log the chainID +// uint256 chainId = block.chainid; +// emit log_named_uint("You are deploying on ChainID", chainId); + +// // READ JSON CONFIG DATA +// string memory config_data = vm.readFile(deployConfigPath); +// // bytes memory parsedData = vm.parseJson(config_data); + +// STRATEGY_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".strategyManager.init_paused_status"); +// SLASHER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".slasher.init_paused_status"); +// DELEGATION_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".delegation.init_paused_status"); +// EIGENPOD_MANAGER_MAX_PODS = stdJson.readUint(config_data, ".eigenPodManager.max_pods"); +// EIGENPOD_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".eigenPodManager.init_paused_status"); + +// STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = uint32( +// stdJson.readUint(config_data, ".strategyManager.init_withdrawal_delay_blocks") +// ); + +// REQUIRED_BALANCE_WEI = stdJson.readUint(config_data, ".eigenPod.REQUIRED_BALANCE_WEI"); +// MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR = stdJson.readUint( +// config_data, +// ".eigenPod.MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR" +// ); + +// // tokens to deploy strategies for +// StrategyConfig[] memory strategyConfigs; + +// executorMultisig = stdJson.readAddress(config_data, ".multisig_addresses.executorMultisig"); +// operationsMultisig = stdJson.readAddress(config_data, ".multisig_addresses.operationsMultisig"); +// pauserMultisig = stdJson.readAddress(config_data, ".multisig_addresses.pauserMultisig"); +// // load token list +// bytes memory strategyConfigsRaw = stdJson.parseRaw(config_data, ".strategies"); +// strategyConfigs = abi.decode(strategyConfigsRaw, (StrategyConfig[])); + +// require(executorMultisig != address(0), "executorMultisig address not configured correctly!"); +// require(operationsMultisig != address(0), "operationsMultisig address not configured correctly!"); + +// // START RECORDING TRANSACTIONS FOR DEPLOYMENT +// vm.startBroadcast(); + +// // deploy proxy admin for ability to upgrade proxy contracts +// eigenLayerProxyAdmin = new ProxyAdmin(); + +// //deploy pauser registry +// { +// address[] memory pausers = new address[](3); +// pausers[0] = executorMultisig; +// pausers[1] = operationsMultisig; +// pausers[2] = pauserMultisig; +// eigenLayerPauserReg = new PauserRegistry(pausers, executorMultisig); +// } + +// /** +// * 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(); +// delegation = DelegationManager( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// strategyManager = StrategyManager( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// slasher = Slasher( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// eigenPodManager = EigenPodManager( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); + +// // if on mainnet, use the ETH2 deposit contract address +// if (chainId == 1) { +// ethPOSDeposit = IETHPOSDeposit(0x00000000219ab540356cBB839Cbe05303d7705Fa); +// // if not on mainnet, deploy a mock +// } else { +// ethPOSDeposit = IETHPOSDeposit(stdJson.readAddress(config_data, ".ethPOSDepositAddress")); +// } +// eigenPodImplementation = new EigenPod( +// ethPOSDeposit, +// eigenPodManager, +// GOERLI_GENESIS_TIME +// ); + +// eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation)); + +// // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs +// delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); +// strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher, avsDirectory); +// slasherImplementation = new Slasher(strategyManager, delegation); +// eigenPodManagerImplementation = new EigenPodManager( +// ethPOSDeposit, +// eigenPodBeacon, +// strategyManager, +// slasher, +// delegation +// ); + +// // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(delegation))), +// address(delegationImplementation), +// abi.encodeWithSelector( +// DelegationManager.initialize.selector, +// executorMultisig, +// eigenLayerPauserReg, +// DELEGATION_INIT_PAUSED_STATUS +// ) +// ); +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(strategyManager))), +// address(strategyManagerImplementation), +// abi.encodeWithSelector( +// StrategyManager.initialize.selector, +// executorMultisig, +// operationsMultisig, +// eigenLayerPauserReg, +// STRATEGY_MANAGER_INIT_PAUSED_STATUS +// ) +// ); +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(slasher))), +// address(slasherImplementation), +// abi.encodeWithSelector( +// Slasher.initialize.selector, +// executorMultisig, +// eigenLayerPauserReg, +// SLASHER_INIT_PAUSED_STATUS +// ) +// ); +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(eigenPodManager))), +// address(eigenPodManagerImplementation), +// abi.encodeWithSelector( +// EigenPodManager.initialize.selector, +// executorMultisig, +// eigenLayerPauserReg, +// EIGENPOD_MANAGER_INIT_PAUSED_STATUS +// ) +// ); + +// // deploy StrategyBaseTVLLimits contract implementation +// baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager); +// // create upgradeable proxies that each point to the implementation and initialize them +// for (uint256 i = 0; i < strategyConfigs.length; ++i) { +// deployedStrategyArray.push( +// StrategyBaseTVLLimits( +// address( +// new TransparentUpgradeableProxy( +// address(baseStrategyImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector( +// StrategyBaseTVLLimits.initialize.selector, +// strategyConfigs[i].maxPerDeposit, +// strategyConfigs[i].maxDeposits, +// IERC20(strategyConfigs[i].tokenAddress), +// eigenLayerPauserReg +// ) +// ) +// ) +// ) +// ); +// } + +// eigenLayerProxyAdmin.transferOwnership(executorMultisig); +// eigenPodBeacon.transferOwnership(executorMultisig); + +// // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT +// vm.stopBroadcast(); + +// // CHECK CORRECTNESS OF DEPLOYMENT +// _verifyContractsPointAtOneAnother( +// delegationImplementation, +// strategyManagerImplementation, +// slasherImplementation, +// eigenPodManagerImplementation +// ); +// _verifyContractsPointAtOneAnother( +// delegation, +// strategyManager, +// slasher, +// eigenPodManager +// ); +// _verifyImplementationsSetCorrectly(); +// _verifyInitialOwners(); +// _checkPauserInitializations(); +// _verifyInitializationParams(); + +// // WRITE JSON DATA +// string memory parent_object = "parent object"; + +// string memory deployed_strategies = "strategies"; +// for (uint256 i = 0; i < strategyConfigs.length; ++i) { +// vm.serializeAddress(deployed_strategies, strategyConfigs[i].tokenSymbol, address(deployedStrategyArray[i])); +// } +// string memory deployed_strategies_output = vm.serializeAddress( +// deployed_strategies, +// strategyConfigs[strategyConfigs.length - 1].tokenSymbol, +// address(deployedStrategyArray[strategyConfigs.length - 1]) +// ); + +// string memory deployed_addresses = "addresses"; +// vm.serializeAddress(deployed_addresses, "eigenLayerProxyAdmin", address(eigenLayerProxyAdmin)); +// vm.serializeAddress(deployed_addresses, "eigenLayerPauserReg", address(eigenLayerPauserReg)); +// vm.serializeAddress(deployed_addresses, "slasher", address(slasher)); +// vm.serializeAddress(deployed_addresses, "slasherImplementation", address(slasherImplementation)); +// vm.serializeAddress(deployed_addresses, "delegation", address(delegation)); +// vm.serializeAddress(deployed_addresses, "delegationImplementation", address(delegationImplementation)); +// vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); +// vm.serializeAddress( +// deployed_addresses, +// "strategyManagerImplementation", +// address(strategyManagerImplementation) +// ); +// vm.serializeAddress(deployed_addresses, "eigenPodManager", address(eigenPodManager)); +// vm.serializeAddress( +// deployed_addresses, +// "eigenPodManagerImplementation", +// address(eigenPodManagerImplementation) +// ); +// vm.serializeAddress(deployed_addresses, "eigenPodBeacon", address(eigenPodBeacon)); +// vm.serializeAddress(deployed_addresses, "eigenPodImplementation", address(eigenPodImplementation)); +// vm.serializeAddress(deployed_addresses, "baseStrategyImplementation", address(baseStrategyImplementation)); +// vm.serializeAddress(deployed_addresses, "emptyContract", address(emptyContract)); +// string memory deployed_addresses_output = vm.serializeString( +// deployed_addresses, +// "strategies", +// deployed_strategies_output +// ); + +// string memory parameters = "parameters"; +// vm.serializeAddress(parameters, "executorMultisig", executorMultisig); +// string memory parameters_output = vm.serializeAddress(parameters, "operationsMultisig", operationsMultisig); + +// string memory chain_info = "chainInfo"; +// vm.serializeUint(chain_info, "deploymentBlock", block.number); +// string memory chain_info_output = vm.serializeUint(chain_info, "chainId", chainId); + +// // serialize all the data +// vm.serializeString(parent_object, deployed_addresses, deployed_addresses_output); +// vm.serializeString(parent_object, chain_info, chain_info_output); +// string memory finalJson = vm.serializeString(parent_object, parameters, parameters_output); +// vm.writeJson(finalJson, "script/output/M1_deployment_data.json"); +// } + +// function _verifyContractsPointAtOneAnother( +// DelegationManager delegationContract, +// StrategyManager strategyManagerContract, +// Slasher slasherContract, +// EigenPodManager eigenPodManagerContract +// ) internal view { +// require(delegationContract.slasher() == slasher, "delegation: slasher address not set correctly"); +// require( +// delegationContract.strategyManager() == strategyManager, +// "delegation: strategyManager address not set correctly" +// ); + +// require(strategyManagerContract.slasher() == slasher, "strategyManager: slasher address not set correctly"); +// require( +// strategyManagerContract.delegation() == delegation, +// "strategyManager: delegation address not set correctly" +// ); +// require( +// strategyManagerContract.eigenPodManager() == eigenPodManager, +// "strategyManager: eigenPodManager address not set correctly" +// ); + +// require(slasherContract.strategyManager() == strategyManager, "slasher: strategyManager not set correctly"); +// require(slasherContract.delegation() == delegation, "slasher: delegation not set correctly"); + +// require( +// eigenPodManagerContract.ethPOS() == ethPOSDeposit, +// " eigenPodManager: ethPOSDeposit contract address not set correctly" +// ); +// require( +// eigenPodManagerContract.eigenPodBeacon() == eigenPodBeacon, +// "eigenPodManager: eigenPodBeacon contract address not set correctly" +// ); +// require( +// eigenPodManagerContract.strategyManager() == strategyManager, +// "eigenPodManager: strategyManager contract address not set correctly" +// ); +// require( +// eigenPodManagerContract.slasher() == slasher, +// "eigenPodManager: slasher contract address not set correctly" +// ); +// } + +// function _verifyImplementationsSetCorrectly() internal view { +// require( +// eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(delegation)))) == +// address(delegationImplementation), +// "delegation: implementation set incorrectly" +// ); +// require( +// eigenLayerProxyAdmin.getProxyImplementation( +// TransparentUpgradeableProxy(payable(address(strategyManager))) +// ) == address(strategyManagerImplementation), +// "strategyManager: implementation set incorrectly" +// ); +// require( +// eigenLayerProxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(slasher)))) == +// address(slasherImplementation), +// "slasher: implementation set incorrectly" +// ); +// require( +// eigenLayerProxyAdmin.getProxyImplementation( +// TransparentUpgradeableProxy(payable(address(eigenPodManager))) +// ) == address(eigenPodManagerImplementation), +// "eigenPodManager: implementation set incorrectly" +// ); + +// for (uint256 i = 0; i < deployedStrategyArray.length; ++i) { +// require( +// eigenLayerProxyAdmin.getProxyImplementation( +// TransparentUpgradeableProxy(payable(address(deployedStrategyArray[i]))) +// ) == address(baseStrategyImplementation), +// "strategy: implementation set incorrectly" +// ); +// } + +// require( +// eigenPodBeacon.implementation() == address(eigenPodImplementation), +// "eigenPodBeacon: implementation set incorrectly" +// ); +// } + +// function _verifyInitialOwners() internal view { +// require(strategyManager.owner() == executorMultisig, "strategyManager: owner not set correctly"); +// require(delegation.owner() == executorMultisig, "delegation: owner not set correctly"); +// require(slasher.owner() == executorMultisig, "slasher: owner not set correctly"); +// require(eigenPodManager.owner() == executorMultisig, "delegation: owner not set correctly"); + +// require(eigenLayerProxyAdmin.owner() == executorMultisig, "eigenLayerProxyAdmin: owner not set correctly"); +// require(eigenPodBeacon.owner() == executorMultisig, "eigenPodBeacon: owner not set correctly"); +// } + +// function _checkPauserInitializations() internal view { +// require(delegation.pauserRegistry() == eigenLayerPauserReg, "delegation: pauser registry not set correctly"); +// require( +// strategyManager.pauserRegistry() == eigenLayerPauserReg, +// "strategyManager: pauser registry not set correctly" +// ); +// require(slasher.pauserRegistry() == eigenLayerPauserReg, "slasher: pauser registry not set correctly"); +// require( +// eigenPodManager.pauserRegistry() == eigenLayerPauserReg, +// "eigenPodManager: pauser registry not set correctly" +// ); + +// require(eigenLayerPauserReg.isPauser(operationsMultisig), "pauserRegistry: operationsMultisig is not pauser"); +// require(eigenLayerPauserReg.isPauser(executorMultisig), "pauserRegistry: executorMultisig is not pauser"); +// require(eigenLayerPauserReg.isPauser(pauserMultisig), "pauserRegistry: pauserMultisig is not pauser"); +// require(eigenLayerPauserReg.unpauser() == executorMultisig, "pauserRegistry: unpauser not set correctly"); + +// for (uint256 i = 0; i < deployedStrategyArray.length; ++i) { +// require( +// deployedStrategyArray[i].pauserRegistry() == eigenLayerPauserReg, +// "StrategyBaseTVLLimits: pauser registry not set correctly" +// ); +// require( +// deployedStrategyArray[i].paused() == 0, +// "StrategyBaseTVLLimits: init paused status set incorrectly" +// ); +// } + +// // // pause *nothing* +// // uint256 STRATEGY_MANAGER_INIT_PAUSED_STATUS = 0; +// // // pause *everything* +// // uint256 SLASHER_INIT_PAUSED_STATUS = type(uint256).max; +// // // pause *everything* +// // uint256 DELEGATION_INIT_PAUSED_STATUS = type(uint256).max; +// // // pause *all of the proof-related functionality* (everything that can be paused other than creation of EigenPods) +// // uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS = (2**1) + (2**2) + (2**3) + (2**4); /* = 30 */ +// // // pause *nothing* +// require(strategyManager.paused() == 0, "strategyManager: init paused status set incorrectly"); +// require(slasher.paused() == type(uint256).max, "slasher: init paused status set incorrectly"); +// require(delegation.paused() == type(uint256).max, "delegation: init paused status set incorrectly"); +// require(eigenPodManager.paused() == 30, "eigenPodManager: init paused status set incorrectly"); +// } + +// function _verifyInitializationParams() internal { +// // // one week in blocks -- 50400 +// // uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = 7 days / 12 seconds; +// // require(strategyManager.withdrawalDelayBlocks() == 7 days / 12 seconds, +// // "strategyManager: withdrawalDelayBlocks initialized incorrectly"); +// // uint256 REQUIRED_BALANCE_WEI = 32 ether; + +// require( +// strategyManager.strategyWhitelister() == operationsMultisig, +// "strategyManager: strategyWhitelister address not set correctly" +// ); + +// require( +// baseStrategyImplementation.strategyManager() == strategyManager, +// "baseStrategyImplementation: strategyManager set incorrectly" +// ); + +// require( +// eigenPodImplementation.ethPOS() == ethPOSDeposit, +// "eigenPodImplementation: ethPOSDeposit contract address not set correctly" +// ); +// require( +// eigenPodImplementation.eigenPodManager() == eigenPodManager, +// " eigenPodImplementation: eigenPodManager contract address not set correctly" +// ); + +// string memory config_data = vm.readFile(deployConfigPath); +// for (uint i = 0; i < deployedStrategyArray.length; i++) { +// uint256 maxPerDeposit = stdJson.readUint( +// config_data, +// string.concat(".strategies[", vm.toString(i), "].max_per_deposit") +// ); +// uint256 maxDeposits = stdJson.readUint( +// config_data, +// string.concat(".strategies[", vm.toString(i), "].max_deposits") +// ); +// (uint256 setMaxPerDeposit, uint256 setMaxDeposits) = deployedStrategyArray[i].getTVLLimits(); +// require(setMaxPerDeposit == maxPerDeposit, "setMaxPerDeposit not set correctly"); +// require(setMaxDeposits == maxDeposits, "setMaxDeposits not set correctly"); +// } +// } +// } diff --git a/script/deploy/mainnet/M2Deploy.s.sol b/script/deploy/mainnet/M2Deploy.s.sol index 4a6c0daa3..d0a64dcd1 100644 --- a/script/deploy/mainnet/M2Deploy.s.sol +++ b/script/deploy/mainnet/M2Deploy.s.sol @@ -1,327 +1,327 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -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/Slasher.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/milestone/M2Deploy.s.sol:M2Deploy --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv -contract M2Deploy is Script, Test { - Vm cheats = Vm(HEVM_ADDRESS); - - string public m1DeploymentOutputPath; - string public m2DeploymentOutputPath; - - // EigenLayer core contracts - ISlasher public slasher; - 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; - - // Pre-upgrade values to check post-upgrade - address public strategyWhitelister; - bytes32 public withdrawalDelayBlocksStorageSlot = bytes32(uint256(204)); // 0xcc == 204 - uint256 public withdrawalsQueuedStorageSlot = 208; //0xd0 = 208 - uint256 public withdrawalDelayBlocks; - bytes32 public delegationManagerDomainSeparator; - uint256 public numPods; - - // Pointers to pre-upgrade values for lstDepositor - address public lstDepositor; - uint256 public stakerStrategyListLength; - uint256[] public stakerStrategyShares; // Array of shares in each strategy - IStrategy[] public stakerStrategyList; // Array of strategies staker has deposited into - IERC20[] public tokensToWithdraw; - - // Pointers to pre-upgrade values for eigenPodDepositor - address public eigenPodDepositor; - IEigenPod public eigenPod; - address public eigenPodOwner; - bool public hasPod; - uint64 public mostRecentWithdrawalBlock; - - 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) { - m1DeploymentOutputPath = string(bytes("script/output/M1_deployment_mainnet_2023_6_9.json")); - m2DeploymentOutputPath = "script/output/M2_deployment_data_mainnet.json"; - rpcUrl = "RPC_MAINNET"; - } else if (chainId == 5) { - m1DeploymentOutputPath = string(bytes("script/output/M1_deployment_goerli_2023_3_23.json")); - m2DeploymentOutputPath = "script/output/M2_deployment_data_goerli.json"; - rpcUrl = "RPC_GOERLI"; - } else { - revert("Chain not supported"); - } - - // Read json data - string memory deployment_data = vm.readFile(m1DeploymentOutputPath); - slasher = Slasher(stdJson.readAddress(deployment_data, ".addresses.slasher")); - delegation = slasher.delegation(); - strategyManager = slasher.strategyManager(); - eigenPodManager = strategyManager.eigenPodManager(); - eigenPodBeacon = eigenPodManager.eigenPodBeacon(); - ethPOS = eigenPodManager.ethPOS(); - - eigenLayerProxyAdmin = ProxyAdmin(stdJson.readAddress(deployment_data, ".addresses.eigenLayerProxyAdmin")); - - // Store pre-upgrade values to check against later - strategyWhitelister = strategyManager.strategyWhitelister(); - delegationManagerDomainSeparator = IDelegationManagerV0(address(delegation)).DOMAIN_SEPARATOR(); - numPods = eigenPodManager.numPods(); - - // Set chain-specific values - IStrategy[] memory strategyArray = new IStrategy[](1); - uint256[] memory shareAmounts = new uint256[](1); - if (chainId == 1) { - // no-op for now - } else if (chainId == 5) { - // Set LST Depositor values - lstDepositor = 0x01e453D2465cEC1BD2ac9aed06115Fbf28482b33; - strategyArray[0] = IStrategy(0x879944A8cB437a5f8061361f82A6d4EED59070b5); - shareAmounts[0] = 188647761812080108; - tokensToWithdraw.push(IERC20(0x178E141a0E3b34152f73Ff610437A7bf9B83267A)); - - // Set eigenPod owner values - eigenPodDepositor = 0xE9D04433bac1bd584B0493cbaBa170CCCBDA8F00; - } else { - revert("chain ID not supported"); - } - - // Store LST depositor pre-upgrade values - stakerStrategyListLength = strategyManager.stakerStrategyListLength(lstDepositor); - (stakerStrategyList, stakerStrategyShares) = strategyManager.getDeposits(lstDepositor); - - // Store eigenPod owner pre-ugprade values - eigenPod = eigenPodManager.ownerToPod(eigenPodDepositor); - require(address(eigenPod).balance > 0, "eigenPod to test has balance of 0"); - hasPod = eigenPodManager.hasPod(eigenPodDepositor); - eigenPodOwner = eigenPod.podOwner(); - mostRecentWithdrawalBlock = m1EigenPod(address(eigenPod)).mostRecentWithdrawalBlockNumber(); - - // Begin deployment - vm.startBroadcast(); - - // Deploy new implmementation contracts - delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher); - eigenPodManagerImplementation = new EigenPodManager( - ethPOS, - eigenPodBeacon, - strategyManager, - slasher, - delegation - ); - eigenPodImplementation = new EigenPod({ - _ethPOS: ethPOS, - _eigenPodManager: eigenPodManager, - _GENESIS_TIME: 1616508000 - }); - - vm.stopBroadcast(); - - // Write json data out - string memory parent_object = "parent object"; - string memory deployed_addresses = "addresses"; - - // Serialize proxy and non-deployed addresses - vm.serializeAddress(deployed_addresses, "slasher", address(slasher)); - vm.serializeAddress(deployed_addresses, "delegation", address(delegation)); - vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); - vm.serializeAddress(deployed_addresses, "eigenPodManager", address(eigenPodManager)); - vm.serializeAddress(deployed_addresses, "eigenPodBeacon", address(eigenPodBeacon)); - vm.serializeAddress(deployed_addresses, "ethPOS", address(ethPOS)); - - // Serialize new implementation addresses - vm.serializeAddress(deployed_addresses, "delegationImplementation", address(delegationImplementation)); - vm.serializeAddress( - deployed_addresses, - "strategyManagerImplementation", - address(strategyManagerImplementation) - ); - vm.serializeAddress( - deployed_addresses, - "eigenPodManagerImplementation", - address(eigenPodManagerImplementation) - ); - string memory deployed_addresses_output = vm.serializeAddress( - deployed_addresses, - "eigenPodImplementation", - address(eigenPodImplementation) - ); - - // 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); - - // 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, m2DeploymentOutputPath); - - // Perform post-upgrade tests - simulatePerformingUpgrade(); - checkUpgradeCorrectness(); - } - - function simulatePerformingUpgrade() public { - cheats.startPrank(eigenLayerProxyAdmin.owner()); - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(delegation))), - address(delegationImplementation) - ); - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(strategyManager))), - address(strategyManagerImplementation) - ); - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation) - ); - cheats.stopPrank(); - - // Upgrade beacon - cheats.prank(UpgradeableBeacon(address(eigenPodBeacon)).owner()); - UpgradeableBeacon(address(eigenPodBeacon)).upgradeTo(address(eigenPodImplementation)); - } - - function checkUpgradeCorrectness() public { - _verifyStorageSlots(); - - _verifyContractsInitialized(); - - _verifyEigenPodCorrectness(); - } - - // Call contracts to ensure that all simple view functions return the same values (e.g. the return value of `StrategyManager.delegation()` hasn’t changed) - // StrategyManager: delegation, eigenPodManager, slasher, strategyWhitelister, withdrawalDelayBlocks all unchanged - // DelegationManager: DOMAIN_SEPARATOR, strategyManager, slasher, eigenPodManager all unchanged - // EigenPodManager: ethPOS, eigenPodBeacon, strategyManager, slasher, numPods all unchanged - // delegationManager is now correct (added immutable) - // Call contracts to make sure they are still “initialized” (ensure that trying to call initializer reverts) - function _verifyStorageSlots() internal view { - // StrategyManager: Check view functions return pre-upgraded values - require(strategyManager.delegation() == delegation, "strategyManager.delegation incorrect"); - require(strategyManager.eigenPodManager() == eigenPodManager, "strategyManager.eigenPodManager incorrect"); - require(strategyManager.slasher() == slasher, "strategyManager.slasher incorrect"); - require( - strategyManager.strategyWhitelister() == strategyWhitelister, - "strategyManager.strategyWhitelister incorrect" - ); - require( - cheats.load(address(strategyManager), withdrawalDelayBlocksStorageSlot) == bytes32(withdrawalDelayBlocks), - "strategyManager.withdrawalDelayBlocks incorrect" - ); - // DelegationManager: Check view functions return pre-upgraded values - require(DelegationManagerStorage(address(delegation)).strategyManager() == strategyManager, "delegation.strategyManager incorrect"); - require( - delegation.domainSeparator() == delegationManagerDomainSeparator, - "delegation.domainSeparator incorrect" - ); - require(DelegationManagerStorage(address(delegation)).slasher() == slasher, "delegation.slasher incorrect"); - require(DelegationManagerStorage(address(delegation)).eigenPodManager() == eigenPodManager, "delegation.eigenPodManager incorrect"); - // EigenPodManager: check view functions return pre-upgraded values - require(eigenPodManager.ethPOS() == ethPOS, "eigenPodManager.ethPOS incorrect"); - require(eigenPodManager.eigenPodBeacon() == eigenPodBeacon, "eigenPodManager.eigenPodBeacon incorrect"); - require(eigenPodManager.strategyManager() == strategyManager, "eigenPodManager.strategyManager incorrect"); - require(eigenPodManager.slasher() == slasher, "eigenPodManager.slasher incorrect"); - require(eigenPodManager.numPods() == numPods, "eigenPodManager.numPods incorrect"); - require(EigenPodManagerStorage(address(eigenPodManager)).delegationManager() == delegation, "eigenPodManager.delegationManager incorrect"); - } - - function _verifyContractsInitialized() internal { - // Check that contracts are unable to be re-initialized - cheats.expectRevert(bytes("Initializable: contract is already initialized")); - StrategyManager(address(strategyManager)).initialize( - address(this), - address(this), - PauserRegistry(address(this)), - 0 - ); - - IStrategy[] memory strategyArray = new IStrategy[](0); - uint256[] memory withdrawalDelayBlocksArray = new uint256[](0); - cheats.expectRevert(bytes("Initializable: contract is already initialized")); - DelegationManager(address(delegation)).initialize( - address(this), - PauserRegistry(address(this)), - 0, // initialPausedStatus - 0, // minWithdrawalDelayBLocks - strategyArray, - withdrawalDelayBlocksArray - ); - - cheats.expectRevert(bytes("Initializable: contract is already initialized")); - EigenPodManager(address(eigenPodManager)).initialize( - address(this), - PauserRegistry(address(this)), - 0 - ); - } - - function _verifyEigenPodCorrectness() public { - // Check that state is correct - require( - address(eigenPodManager.ownerToPod(eigenPodDepositor)) == address(eigenPod), - "eigenPodManager.ownerToPod incorrect" - ); - require(eigenPodManager.hasPod(eigenPodDepositor) == hasPod, "eigenPodManager.hasPod incorrect"); - require(eigenPod.podOwner() == eigenPodOwner, "eigenPod.podOwner incorrect"); - - // Unpause eigenpods verify credentials - uint256 paused = IPausable(address(eigenPodManager)).paused(); - cheats.prank(IPauserRegistry(IPausable(address(eigenPodManager)).pauserRegistry()).unpauser()); - IPausable(address(eigenPodManager)).unpause(paused ^ (1 << 2)); // eigenpods verify credentials on 2nd bit - - cheats.prank(eigenPodOwner); - eigenPod.startCheckpoint(false); - } -} - -interface IDelegationManagerV0 { - function DOMAIN_SEPARATOR() external view returns (bytes32); -} - -interface m1EigenPod { - function mostRecentWithdrawalBlockNumber() external view returns (uint64); -} +// // SPDX-License-Identifier: BUSL-1.1 +// pragma solidity ^0.8.12; + +// 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/Slasher.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/milestone/M2Deploy.s.sol:M2Deploy --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv +// contract M2Deploy is Script, Test { +// Vm cheats = Vm(HEVM_ADDRESS); + +// string public m1DeploymentOutputPath; +// string public m2DeploymentOutputPath; + +// // EigenLayer core contracts +// ISlasher public slasher; +// 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; + +// // Pre-upgrade values to check post-upgrade +// address public strategyWhitelister; +// bytes32 public withdrawalDelayBlocksStorageSlot = bytes32(uint256(204)); // 0xcc == 204 +// uint256 public withdrawalsQueuedStorageSlot = 208; //0xd0 = 208 +// uint256 public withdrawalDelayBlocks; +// bytes32 public delegationManagerDomainSeparator; +// uint256 public numPods; + +// // Pointers to pre-upgrade values for lstDepositor +// address public lstDepositor; +// uint256 public stakerStrategyListLength; +// uint256[] public stakerStrategyShares; // Array of shares in each strategy +// IStrategy[] public stakerStrategyList; // Array of strategies staker has deposited into +// IERC20[] public tokensToWithdraw; + +// // Pointers to pre-upgrade values for eigenPodDepositor +// address public eigenPodDepositor; +// IEigenPod public eigenPod; +// address public eigenPodOwner; +// bool public hasPod; +// uint64 public mostRecentWithdrawalBlock; + +// 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) { +// m1DeploymentOutputPath = string(bytes("script/output/M1_deployment_mainnet_2023_6_9.json")); +// m2DeploymentOutputPath = "script/output/M2_deployment_data_mainnet.json"; +// rpcUrl = "RPC_MAINNET"; +// } else if (chainId == 5) { +// m1DeploymentOutputPath = string(bytes("script/output/M1_deployment_goerli_2023_3_23.json")); +// m2DeploymentOutputPath = "script/output/M2_deployment_data_goerli.json"; +// rpcUrl = "RPC_GOERLI"; +// } else { +// revert("Chain not supported"); +// } + +// // Read json data +// string memory deployment_data = vm.readFile(m1DeploymentOutputPath); +// slasher = Slasher(stdJson.readAddress(deployment_data, ".addresses.slasher")); +// delegation = slasher.delegation(); +// strategyManager = slasher.strategyManager(); +// eigenPodManager = strategyManager.eigenPodManager(); +// eigenPodBeacon = eigenPodManager.eigenPodBeacon(); +// ethPOS = eigenPodManager.ethPOS(); + +// eigenLayerProxyAdmin = ProxyAdmin(stdJson.readAddress(deployment_data, ".addresses.eigenLayerProxyAdmin")); + +// // Store pre-upgrade values to check against later +// strategyWhitelister = strategyManager.strategyWhitelister(); +// delegationManagerDomainSeparator = IDelegationManagerV0(address(delegation)).DOMAIN_SEPARATOR(); +// numPods = eigenPodManager.numPods(); + +// // Set chain-specific values +// IStrategy[] memory strategyArray = new IStrategy[](1); +// uint256[] memory shareAmounts = new uint256[](1); +// if (chainId == 1) { +// // no-op for now +// } else if (chainId == 5) { +// // Set LST Depositor values +// lstDepositor = 0x01e453D2465cEC1BD2ac9aed06115Fbf28482b33; +// strategyArray[0] = IStrategy(0x879944A8cB437a5f8061361f82A6d4EED59070b5); +// shareAmounts[0] = 188647761812080108; +// tokensToWithdraw.push(IERC20(0x178E141a0E3b34152f73Ff610437A7bf9B83267A)); + +// // Set eigenPod owner values +// eigenPodDepositor = 0xE9D04433bac1bd584B0493cbaBa170CCCBDA8F00; +// } else { +// revert("chain ID not supported"); +// } + +// // Store LST depositor pre-upgrade values +// stakerStrategyListLength = strategyManager.stakerStrategyListLength(lstDepositor); +// (stakerStrategyList, stakerStrategyShares) = strategyManager.getDeposits(lstDepositor); + +// // Store eigenPod owner pre-ugprade values +// eigenPod = eigenPodManager.ownerToPod(eigenPodDepositor); +// require(address(eigenPod).balance > 0, "eigenPod to test has balance of 0"); +// hasPod = eigenPodManager.hasPod(eigenPodDepositor); +// eigenPodOwner = eigenPod.podOwner(); +// mostRecentWithdrawalBlock = m1EigenPod(address(eigenPod)).mostRecentWithdrawalBlockNumber(); + +// // Begin deployment +// vm.startBroadcast(); + +// // Deploy new implmementation contracts +// delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); +// strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher); +// eigenPodManagerImplementation = new EigenPodManager( +// ethPOS, +// eigenPodBeacon, +// strategyManager, +// slasher, +// delegation +// ); +// eigenPodImplementation = new EigenPod({ +// _ethPOS: ethPOS, +// _eigenPodManager: eigenPodManager, +// _GENESIS_TIME: 1616508000 +// }); + +// vm.stopBroadcast(); + +// // Write json data out +// string memory parent_object = "parent object"; +// string memory deployed_addresses = "addresses"; + +// // Serialize proxy and non-deployed addresses +// vm.serializeAddress(deployed_addresses, "slasher", address(slasher)); +// vm.serializeAddress(deployed_addresses, "delegation", address(delegation)); +// vm.serializeAddress(deployed_addresses, "strategyManager", address(strategyManager)); +// vm.serializeAddress(deployed_addresses, "eigenPodManager", address(eigenPodManager)); +// vm.serializeAddress(deployed_addresses, "eigenPodBeacon", address(eigenPodBeacon)); +// vm.serializeAddress(deployed_addresses, "ethPOS", address(ethPOS)); + +// // Serialize new implementation addresses +// vm.serializeAddress(deployed_addresses, "delegationImplementation", address(delegationImplementation)); +// vm.serializeAddress( +// deployed_addresses, +// "strategyManagerImplementation", +// address(strategyManagerImplementation) +// ); +// vm.serializeAddress( +// deployed_addresses, +// "eigenPodManagerImplementation", +// address(eigenPodManagerImplementation) +// ); +// string memory deployed_addresses_output = vm.serializeAddress( +// deployed_addresses, +// "eigenPodImplementation", +// address(eigenPodImplementation) +// ); + +// // 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); + +// // 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, m2DeploymentOutputPath); + +// // Perform post-upgrade tests +// simulatePerformingUpgrade(); +// checkUpgradeCorrectness(); +// } + +// function simulatePerformingUpgrade() public { +// cheats.startPrank(eigenLayerProxyAdmin.owner()); +// eigenLayerProxyAdmin.upgrade( +// TransparentUpgradeableProxy(payable(address(delegation))), +// address(delegationImplementation) +// ); +// eigenLayerProxyAdmin.upgrade( +// TransparentUpgradeableProxy(payable(address(strategyManager))), +// address(strategyManagerImplementation) +// ); +// eigenLayerProxyAdmin.upgrade( +// TransparentUpgradeableProxy(payable(address(eigenPodManager))), +// address(eigenPodManagerImplementation) +// ); +// cheats.stopPrank(); + +// // Upgrade beacon +// cheats.prank(UpgradeableBeacon(address(eigenPodBeacon)).owner()); +// UpgradeableBeacon(address(eigenPodBeacon)).upgradeTo(address(eigenPodImplementation)); +// } + +// function checkUpgradeCorrectness() public { +// _verifyStorageSlots(); + +// _verifyContractsInitialized(); + +// _verifyEigenPodCorrectness(); +// } + +// // Call contracts to ensure that all simple view functions return the same values (e.g. the return value of `StrategyManager.delegation()` hasn’t changed) +// // StrategyManager: delegation, eigenPodManager, slasher, strategyWhitelister, withdrawalDelayBlocks all unchanged +// // DelegationManager: DOMAIN_SEPARATOR, strategyManager, slasher, eigenPodManager all unchanged +// // EigenPodManager: ethPOS, eigenPodBeacon, strategyManager, slasher, numPods all unchanged +// // delegationManager is now correct (added immutable) +// // Call contracts to make sure they are still “initialized” (ensure that trying to call initializer reverts) +// function _verifyStorageSlots() internal view { +// // StrategyManager: Check view functions return pre-upgraded values +// require(strategyManager.delegation() == delegation, "strategyManager.delegation incorrect"); +// require(strategyManager.eigenPodManager() == eigenPodManager, "strategyManager.eigenPodManager incorrect"); +// require(strategyManager.slasher() == slasher, "strategyManager.slasher incorrect"); +// require( +// strategyManager.strategyWhitelister() == strategyWhitelister, +// "strategyManager.strategyWhitelister incorrect" +// ); +// require( +// cheats.load(address(strategyManager), withdrawalDelayBlocksStorageSlot) == bytes32(withdrawalDelayBlocks), +// "strategyManager.withdrawalDelayBlocks incorrect" +// ); +// // DelegationManager: Check view functions return pre-upgraded values +// require(DelegationManagerStorage(address(delegation)).strategyManager() == strategyManager, "delegation.strategyManager incorrect"); +// require( +// delegation.domainSeparator() == delegationManagerDomainSeparator, +// "delegation.domainSeparator incorrect" +// ); +// require(DelegationManagerStorage(address(delegation)).slasher() == slasher, "delegation.slasher incorrect"); +// require(DelegationManagerStorage(address(delegation)).eigenPodManager() == eigenPodManager, "delegation.eigenPodManager incorrect"); +// // EigenPodManager: check view functions return pre-upgraded values +// require(eigenPodManager.ethPOS() == ethPOS, "eigenPodManager.ethPOS incorrect"); +// require(eigenPodManager.eigenPodBeacon() == eigenPodBeacon, "eigenPodManager.eigenPodBeacon incorrect"); +// require(eigenPodManager.strategyManager() == strategyManager, "eigenPodManager.strategyManager incorrect"); +// require(eigenPodManager.slasher() == slasher, "eigenPodManager.slasher incorrect"); +// require(eigenPodManager.numPods() == numPods, "eigenPodManager.numPods incorrect"); +// require(EigenPodManagerStorage(address(eigenPodManager)).delegationManager() == delegation, "eigenPodManager.delegationManager incorrect"); +// } + +// function _verifyContractsInitialized() internal { +// // Check that contracts are unable to be re-initialized +// cheats.expectRevert(bytes("Initializable: contract is already initialized")); +// StrategyManager(address(strategyManager)).initialize( +// address(this), +// address(this), +// PauserRegistry(address(this)), +// 0 +// ); + +// IStrategy[] memory strategyArray = new IStrategy[](0); +// uint256[] memory withdrawalDelayBlocksArray = new uint256[](0); +// cheats.expectRevert(bytes("Initializable: contract is already initialized")); +// DelegationManager(address(delegation)).initialize( +// address(this), +// PauserRegistry(address(this)), +// 0, // initialPausedStatus +// 0, // minWithdrawalDelayBLocks +// strategyArray, +// withdrawalDelayBlocksArray +// ); + +// cheats.expectRevert(bytes("Initializable: contract is already initialized")); +// EigenPodManager(address(eigenPodManager)).initialize( +// address(this), +// PauserRegistry(address(this)), +// 0 +// ); +// } + +// function _verifyEigenPodCorrectness() public { +// // Check that state is correct +// require( +// address(eigenPodManager.ownerToPod(eigenPodDepositor)) == address(eigenPod), +// "eigenPodManager.ownerToPod incorrect" +// ); +// require(eigenPodManager.hasPod(eigenPodDepositor) == hasPod, "eigenPodManager.hasPod incorrect"); +// require(eigenPod.podOwner() == eigenPodOwner, "eigenPod.podOwner incorrect"); + +// // Unpause eigenpods verify credentials +// uint256 paused = IPausable(address(eigenPodManager)).paused(); +// cheats.prank(IPauserRegistry(IPausable(address(eigenPodManager)).pauserRegistry()).unpauser()); +// IPausable(address(eigenPodManager)).unpause(paused ^ (1 << 2)); // eigenpods verify credentials on 2nd bit + +// cheats.prank(eigenPodOwner); +// eigenPod.startCheckpoint(false); +// } +// } + +// interface IDelegationManagerV0 { +// function DOMAIN_SEPARATOR() external view returns (bytes32); +// } + +// interface m1EigenPod { +// function mostRecentWithdrawalBlockNumber() external view returns (uint64); +// } diff --git a/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol b/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol index c69bbe108..7192f442c 100644 --- a/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol +++ b/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol @@ -1,335 +1,335 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "../../utils/ExistingDeploymentParser.sol"; -import "../../utils/TimelockEncoding.sol"; -import "../../utils/Multisend.sol"; - -/** - * @notice Script used for the first deployment of EigenLayer core contracts to Holesky - * anvil --fork-url $RPC_MAINNET - * forge script script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol:M2_Mainnet_Upgrade --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv - * - * forge script script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol:M2_Mainnet_Upgrade --rpc-url $RPC_MAINNET --private-key $PRIVATE_KEY --broadcast -vvvv - * - */ -contract M2_Mainnet_Upgrade is ExistingDeploymentParser { - function run() external virtual { - _parseDeployedContracts("script/output/mainnet/M1_deployment_mainnet_2023_6_9.json"); - _parseInitialDeploymentParams("script/configs/mainnet/M2_mainnet_upgrade.config.json"); - - // START RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.startBroadcast(); - - emit log_named_address("Deployer Address", msg.sender); - - _deployImplementationContracts(); - - // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT - vm.stopBroadcast(); - - // Simulate upgrade of contracts to new implementations - _simulateUpgrade(); - - // Sanity Checks - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(); - _verifyInitializationParams(); - - logAndOutputContractAddresses("script/output/mainnet/M2_mainnet_upgrade.output.json"); - } - - /** - * @notice Deploy EigenLayer contracts from scratch for Holesky - */ - function _deployImplementationContracts() internal { - // 1. Deploy New TUPS - avsDirectoryImplementation = new AVSDirectory(delegationManager); - avsDirectory = AVSDirectory( - address( - new TransparentUpgradeableProxy( - address(avsDirectoryImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - AVSDirectory.initialize.selector, - executorMultisig, // initialOwner - eigenLayerPauserReg, - AVS_DIRECTORY_INIT_PAUSED_STATUS - ) - ) - ) - ); - - // 2. Deploy Implementations - eigenPodImplementation = new EigenPod( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodManager, - EIGENPOD_GENESIS_TIME - ); - delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher); - slasherImplementation = new Slasher(strategyManager, delegationManager); - eigenPodManagerImplementation = new EigenPodManager( - IETHPOSDeposit(ETHPOSDepositAddress), - eigenPodBeacon, - strategyManager, - slasher, - delegationManager - ); - } - - function _simulateUpgrade() internal { - - vm.startPrank(executorMultisig); - - // First, upgrade the proxy contracts to point to the implementations - // AVSDirectory - // eigenLayerProxyAdmin.upgrade( - // TransparentUpgradeableProxy(payable(address(avsDirectory))), - // address(avsDirectoryImplementation) - // ); - // DelegationManager - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(delegationManager))), - address(delegationManagerImplementation) - ); - // StrategyManager - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(strategyManager))), - address(strategyManagerImplementation) - ); - // Slasher - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(slasher))), - address(slasherImplementation) - ); - // EigenPodManager - eigenLayerProxyAdmin.upgrade( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation) - ); - - // Second, configure additional settings and paused statuses - delegationManager.setMinWithdrawalDelayBlocks(DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS); - delegationManager.unpause(0); - eigenPodManager.unpause(0); - - eigenPodBeacon.upgradeTo(address(eigenPodImplementation)); - - vm.stopPrank(); - } -} - -// forge t --mt test_queueUpgrade --fork-url $RPC_MAINNET -vvvv -contract Queue_M2_Upgrade is M2_Mainnet_Upgrade, TimelockEncoding { - Vm cheats = Vm(HEVM_ADDRESS); - - // Thurs Apr 08 2024 12:00:00 GMT-0700 (Pacific Daylight Time) - uint256 timelockEta = 1712559600; - - function test_queueUpgrade() external { - _parseDeployedContracts("script/output/mainnet/M2_mainnet_upgrade.output.json"); - _parseInitialDeploymentParams("script/configs/mainnet/M2_mainnet_upgrade.config.json"); - - Tx[] memory txs = new Tx[](11); - // upgrade the DelegationManager, Slasher, StrategyManager, DelayedWithdrawalRouter, EigenPodManager, & EigenPod contracts - txs[0] = Tx( - address(eigenLayerProxyAdmin), - 0, - abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(delegationManager))), - delegationManagerImplementation - ) - ); - - txs[1] = Tx( - address(eigenLayerProxyAdmin), - 0, - abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(slasher))), - slasherImplementation - ) - ); - - txs[2] = Tx( - address(eigenLayerProxyAdmin), - 0, - abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(strategyManager))), - strategyManagerImplementation - ) - ); - - // txs[3] = Tx( - // address(eigenLayerProxyAdmin), - // 0, - // abi.encodeWithSelector( - // ProxyAdmin.upgrade.selector, - // TransparentUpgradeableProxy(payable(address(delayedWithdrawalRouter))), - // delayedWithdrawalRouterImplementation - // ) - // ); - - txs[4] = Tx( - address(eigenLayerProxyAdmin), - 0, - abi.encodeWithSelector( - ProxyAdmin.upgrade.selector, - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - eigenPodManagerImplementation - ) - ); - - txs[5] = Tx( - address(eigenPodBeacon), - 0, - abi.encodeWithSelector( - UpgradeableBeacon.upgradeTo.selector, - eigenPodImplementation - ) - ); - - // set the min withdrawal delay blocks on the DelegationManager - txs[6] = Tx( - address(delegationManager), - 0, // value - abi.encodeWithSelector(DelegationManager.setMinWithdrawalDelayBlocks.selector, DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS) - ); - - // set beacon chain oracle on EigenPodManager - // txs[7] = Tx( - // address(eigenPodManager), - // 0, // value - // abi.encodeWithSelector(EigenPodManager.updateBeaconChainOracle.selector, beaconOracle) - // ); - - // set Deneb fork timestamp on EigenPodManager - // txs[8] = Tx( - // address(eigenPodManager), - // 0, // value - // abi.encodeWithSelector(EigenPodManager.setDenebForkTimestamp.selector, EIGENPOD_MANAGER_DENEB_FORK_TIMESTAMP) - // ); - - // unpause everything on DelegationManager - txs[9] = Tx( - address(delegationManager), - 0, // value - abi.encodeWithSelector(Pausable.unpause.selector, 0) - ); - - // unpause everything on EigenPodManager - txs[10] = Tx( - address(eigenPodManager), - 0, // value - abi.encodeWithSelector(Pausable.unpause.selector, 0) - ); - - 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); - - bytes memory final_calldata_to_executor_multisig = encodeForExecutor({ - // call to executor will be from the timelock - from: timelock, - // performing many operations at the same time - to: multiSendCallOnly, - // value to send in tx - value: 0, - // calldata for the operation - data: calldata_to_multisend_contract, - // operation type (for performing many operations at the same time) - operation: ISafe.Operation.DelegateCall - }); - - (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 - _verifyContractPointers(); - _verifyImplementations(); - _verifyContractsInitialized(); - _verifyInitializationParams(); - _postUpgradeChecks(); - } - - function _postUpgradeChecks() internal { - // check that LST deposits are paused - address rETH = 0xae78736Cd615f374D3085123A210448E74Fc6393; - address rETH_Strategy = 0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2; - uint256 amount = 1e18; - cheats.prank(rETH); - // this works because rETH has more than 1 ETH of its own token at its address :) - IERC20(rETH).transfer(address(this), amount); - IERC20(rETH).approve(address(strategyManager), amount); - cheats.expectRevert("Pausable: index is paused"); - strategyManager.depositIntoStrategy({ - strategy: IStrategy(rETH_Strategy), - token: IERC20(rETH), - amount: amount - }); - - // unpause LST deposits and check that a deposit works - cheats.prank(executorMultisig); - strategyManager.unpause(0); - strategyManager.depositIntoStrategy({ - strategy: IStrategy(rETH_Strategy), - token: IERC20(rETH), - amount: amount - }); - - // check that EigenPod proofs are live (although this still reverts later in the call) - EigenPod existingEigenPod = EigenPod(payable(0x0b347D5E38296277E829CE1D8C6b82e4c63C2Df3)); - BeaconChainProofs.StateRootProof memory stateRootProof; - uint40[] memory validatorIndices; - bytes[] memory validatorFieldsProofs; - bytes32[][] memory validatorFields; - cheats.startPrank(existingEigenPod.podOwner()); - existingEigenPod.startCheckpoint(false); - cheats.expectRevert("EigenPodManager.getBlockRootAtTimestamp: state root at timestamp not yet finalized"); - existingEigenPod.verifyWithdrawalCredentials( - uint64(block.timestamp), - stateRootProof, - validatorIndices, - validatorFieldsProofs, - validatorFields - ); - } - - 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; - } -} +// // SPDX-License-Identifier: BUSL-1.1 +// pragma solidity ^0.8.12; + +// import "../../utils/ExistingDeploymentParser.sol"; +// import "../../utils/TimelockEncoding.sol"; +// import "../../utils/Multisend.sol"; + +// /** +// * @notice Script used for the first deployment of EigenLayer core contracts to Holesky +// * anvil --fork-url $RPC_MAINNET +// * forge script script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol:M2_Mainnet_Upgrade --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv +// * +// * forge script script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol:M2_Mainnet_Upgrade --rpc-url $RPC_MAINNET --private-key $PRIVATE_KEY --broadcast -vvvv +// * +// */ +// contract M2_Mainnet_Upgrade is ExistingDeploymentParser { +// function run() external virtual { +// _parseDeployedContracts("script/output/mainnet/M1_deployment_mainnet_2023_6_9.json"); +// _parseInitialDeploymentParams("script/configs/mainnet/M2_mainnet_upgrade.config.json"); + +// // START RECORDING TRANSACTIONS FOR DEPLOYMENT +// vm.startBroadcast(); + +// emit log_named_address("Deployer Address", msg.sender); + +// _deployImplementationContracts(); + +// // STOP RECORDING TRANSACTIONS FOR DEPLOYMENT +// vm.stopBroadcast(); + +// // Simulate upgrade of contracts to new implementations +// _simulateUpgrade(); + +// // Sanity Checks +// _verifyContractPointers(); +// _verifyImplementations(); +// _verifyContractsInitialized(); +// _verifyInitializationParams(); + +// logAndOutputContractAddresses("script/output/mainnet/M2_mainnet_upgrade.output.json"); +// } + +// /** +// * @notice Deploy EigenLayer contracts from scratch for Holesky +// */ +// function _deployImplementationContracts() internal { +// // 1. Deploy New TUPS +// avsDirectoryImplementation = new AVSDirectory(delegationManager); +// avsDirectory = AVSDirectory( +// address( +// new TransparentUpgradeableProxy( +// address(avsDirectoryImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector( +// AVSDirectory.initialize.selector, +// executorMultisig, // initialOwner +// eigenLayerPauserReg, +// AVS_DIRECTORY_INIT_PAUSED_STATUS +// ) +// ) +// ) +// ); + +// // 2. Deploy Implementations +// eigenPodImplementation = new EigenPod( +// IETHPOSDeposit(ETHPOSDepositAddress), +// eigenPodManager, +// EIGENPOD_GENESIS_TIME +// ); +// delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); +// strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher, avsDirectory); +// slasherImplementation = new Slasher(strategyManager, delegationManager); +// eigenPodManagerImplementation = new EigenPodManager( +// IETHPOSDeposit(ETHPOSDepositAddress), +// eigenPodBeacon, +// strategyManager, +// slasher, +// delegationManager +// ); +// } + +// function _simulateUpgrade() internal { + +// vm.startPrank(executorMultisig); + +// // First, upgrade the proxy contracts to point to the implementations +// // AVSDirectory +// // eigenLayerProxyAdmin.upgrade( +// // TransparentUpgradeableProxy(payable(address(avsDirectory))), +// // address(avsDirectoryImplementation) +// // ); +// // DelegationManager +// eigenLayerProxyAdmin.upgrade( +// TransparentUpgradeableProxy(payable(address(delegationManager))), +// address(delegationManagerImplementation) +// ); +// // StrategyManager +// eigenLayerProxyAdmin.upgrade( +// TransparentUpgradeableProxy(payable(address(strategyManager))), +// address(strategyManagerImplementation) +// ); +// // Slasher +// eigenLayerProxyAdmin.upgrade( +// TransparentUpgradeableProxy(payable(address(slasher))), +// address(slasherImplementation) +// ); +// // EigenPodManager +// eigenLayerProxyAdmin.upgrade( +// TransparentUpgradeableProxy(payable(address(eigenPodManager))), +// address(eigenPodManagerImplementation) +// ); + +// // Second, configure additional settings and paused statuses +// delegationManager.setMinWithdrawalDelayBlocks(DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS); +// delegationManager.unpause(0); +// eigenPodManager.unpause(0); + +// eigenPodBeacon.upgradeTo(address(eigenPodImplementation)); + +// vm.stopPrank(); +// } +// } + +// // forge t --mt test_queueUpgrade --fork-url $RPC_MAINNET -vvvv +// contract Queue_M2_Upgrade is M2_Mainnet_Upgrade, TimelockEncoding { +// Vm cheats = Vm(HEVM_ADDRESS); + +// // Thurs Apr 08 2024 12:00:00 GMT-0700 (Pacific Daylight Time) +// uint256 timelockEta = 1712559600; + +// function test_queueUpgrade() external { +// _parseDeployedContracts("script/output/mainnet/M2_mainnet_upgrade.output.json"); +// _parseInitialDeploymentParams("script/configs/mainnet/M2_mainnet_upgrade.config.json"); + +// Tx[] memory txs = new Tx[](11); +// // upgrade the DelegationManager, Slasher, StrategyManager, DelayedWithdrawalRouter, EigenPodManager, & EigenPod contracts +// txs[0] = Tx( +// address(eigenLayerProxyAdmin), +// 0, +// abi.encodeWithSelector( +// ProxyAdmin.upgrade.selector, +// TransparentUpgradeableProxy(payable(address(delegationManager))), +// delegationManagerImplementation +// ) +// ); + +// txs[1] = Tx( +// address(eigenLayerProxyAdmin), +// 0, +// abi.encodeWithSelector( +// ProxyAdmin.upgrade.selector, +// TransparentUpgradeableProxy(payable(address(slasher))), +// slasherImplementation +// ) +// ); + +// txs[2] = Tx( +// address(eigenLayerProxyAdmin), +// 0, +// abi.encodeWithSelector( +// ProxyAdmin.upgrade.selector, +// TransparentUpgradeableProxy(payable(address(strategyManager))), +// strategyManagerImplementation +// ) +// ); + +// // txs[3] = Tx( +// // address(eigenLayerProxyAdmin), +// // 0, +// // abi.encodeWithSelector( +// // ProxyAdmin.upgrade.selector, +// // TransparentUpgradeableProxy(payable(address(delayedWithdrawalRouter))), +// // delayedWithdrawalRouterImplementation +// // ) +// // ); + +// txs[4] = Tx( +// address(eigenLayerProxyAdmin), +// 0, +// abi.encodeWithSelector( +// ProxyAdmin.upgrade.selector, +// TransparentUpgradeableProxy(payable(address(eigenPodManager))), +// eigenPodManagerImplementation +// ) +// ); + +// txs[5] = Tx( +// address(eigenPodBeacon), +// 0, +// abi.encodeWithSelector( +// UpgradeableBeacon.upgradeTo.selector, +// eigenPodImplementation +// ) +// ); + +// // set the min withdrawal delay blocks on the DelegationManager +// txs[6] = Tx( +// address(delegationManager), +// 0, // value +// abi.encodeWithSelector(DelegationManager.setMinWithdrawalDelayBlocks.selector, DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS) +// ); + +// // set beacon chain oracle on EigenPodManager +// // txs[7] = Tx( +// // address(eigenPodManager), +// // 0, // value +// // abi.encodeWithSelector(EigenPodManager.updateBeaconChainOracle.selector, beaconOracle) +// // ); + +// // set Deneb fork timestamp on EigenPodManager +// // txs[8] = Tx( +// // address(eigenPodManager), +// // 0, // value +// // abi.encodeWithSelector(EigenPodManager.setDenebForkTimestamp.selector, EIGENPOD_MANAGER_DENEB_FORK_TIMESTAMP) +// // ); + +// // unpause everything on DelegationManager +// txs[9] = Tx( +// address(delegationManager), +// 0, // value +// abi.encodeWithSelector(Pausable.unpause.selector, 0) +// ); + +// // unpause everything on EigenPodManager +// txs[10] = Tx( +// address(eigenPodManager), +// 0, // value +// abi.encodeWithSelector(Pausable.unpause.selector, 0) +// ); + +// 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); + +// bytes memory final_calldata_to_executor_multisig = encodeForExecutor({ +// // call to executor will be from the timelock +// from: timelock, +// // performing many operations at the same time +// to: multiSendCallOnly, +// // value to send in tx +// value: 0, +// // calldata for the operation +// data: calldata_to_multisend_contract, +// // operation type (for performing many operations at the same time) +// operation: ISafe.Operation.DelegateCall +// }); + +// (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 +// _verifyContractPointers(); +// _verifyImplementations(); +// _verifyContractsInitialized(); +// _verifyInitializationParams(); +// _postUpgradeChecks(); +// } + +// function _postUpgradeChecks() internal { +// // check that LST deposits are paused +// address rETH = 0xae78736Cd615f374D3085123A210448E74Fc6393; +// address rETH_Strategy = 0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2; +// uint256 amount = 1e18; +// cheats.prank(rETH); +// // this works because rETH has more than 1 ETH of its own token at its address :) +// IERC20(rETH).transfer(address(this), amount); +// IERC20(rETH).approve(address(strategyManager), amount); +// cheats.expectRevert("Pausable: index is paused"); +// strategyManager.depositIntoStrategy({ +// strategy: IStrategy(rETH_Strategy), +// token: IERC20(rETH), +// amount: amount +// }); + +// // unpause LST deposits and check that a deposit works +// cheats.prank(executorMultisig); +// strategyManager.unpause(0); +// strategyManager.depositIntoStrategy({ +// strategy: IStrategy(rETH_Strategy), +// token: IERC20(rETH), +// amount: amount +// }); + +// // check that EigenPod proofs are live (although this still reverts later in the call) +// EigenPod existingEigenPod = EigenPod(payable(0x0b347D5E38296277E829CE1D8C6b82e4c63C2Df3)); +// BeaconChainProofs.StateRootProof memory stateRootProof; +// uint40[] memory validatorIndices; +// bytes[] memory validatorFieldsProofs; +// bytes32[][] memory validatorFields; +// cheats.startPrank(existingEigenPod.podOwner()); +// existingEigenPod.startCheckpoint(false); +// cheats.expectRevert("EigenPodManager.getBlockRootAtTimestamp: state root at timestamp not yet finalized"); +// existingEigenPod.verifyWithdrawalCredentials( +// uint64(block.timestamp), +// stateRootProof, +// validatorIndices, +// validatorFieldsProofs, +// validatorFields +// ); +// } + +// 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; +// } +// } diff --git a/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol b/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol index 1fe59bed4..77cb4d472 100644 --- a/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol +++ b/script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol @@ -52,11 +52,14 @@ contract MainnetRewardsCoordinatorDeploy is ExistingDeploymentParser { rewardsCoordinatorImplementation = new RewardsCoordinator( delegationManager, strategyManager, + avsDirectory, 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 + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH ); rewardsCoordinator = RewardsCoordinator( address( @@ -85,11 +88,14 @@ contract MainnetRewardsCoordinatorDeploy is ExistingDeploymentParser { rewardsCoordinatorImplementation = new RewardsCoordinator( delegationManager, strategyManager, + avsDirectory, 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 + REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH ); eigenLayerProxyAdmin.upgrade( diff --git a/script/utils/ExistingDeploymentParser.sol b/script/utils/ExistingDeploymentParser.sol index cef8880b9..4b885b7e7 100644 --- a/script/utils/ExistingDeploymentParser.sol +++ b/script/utils/ExistingDeploymentParser.sol @@ -10,6 +10,7 @@ import "../../src/contracts/core/Slasher.sol"; import "../../src/contracts/core/DelegationManager.sol"; import "../../src/contracts/core/AVSDirectory.sol"; import "../../src/contracts/core/RewardsCoordinator.sol"; +import "../../src/contracts/core/AllocationManager.sol"; import "../../src/contracts/strategies/StrategyFactory.sol"; import "../../src/contracts/strategies/StrategyBase.sol"; @@ -62,6 +63,8 @@ contract ExistingDeploymentParser is Script, Test { StrategyBase public baseStrategyImplementation; StrategyFactory public strategyFactory; StrategyFactory public strategyFactoryImplementation; + AllocationManager public allocationManager; + AllocationManager public allocationManagerImplementation; UpgradeableBeacon public strategyBeacon; // Token @@ -116,8 +119,12 @@ contract ExistingDeploymentParser is Script, Test { uint32 REWARDS_COORDINATOR_ACTIVATION_DELAY; uint32 REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS; uint32 REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS; + uint32 REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP; + uint32 REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH; // EigenPodManager uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS; + // AllocaitonManager + uint256 ALLOCATION_MANAGER_INIT_PAUSED_STATUS; // EigenPod uint64 EIGENPOD_GENESIS_TIME; uint64 EIGENPOD_MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR; @@ -307,6 +314,12 @@ contract ExistingDeploymentParser is Script, Test { REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS = uint32( stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.global_operator_commission_bips") ); + 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 @@ -314,6 +327,11 @@ contract ExistingDeploymentParser is Script, Test { initialDeploymentData, ".eigenPodManager.init_paused_status" ); + // AllocationManager + ALLOCATION_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint( + initialDeploymentData, + ".allocationManager.init_paused_status" + ); // EigenPod EIGENPOD_GENESIS_TIME = uint64(stdJson.readUint(initialDeploymentData, ".eigenPod.GENESIS_TIME")); EIGENPOD_MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR = uint64( diff --git a/script/whitelist/delegationFaucet/DelegationFaucet.sol b/script/whitelist/delegationFaucet/DelegationFaucet.sol deleted file mode 100644 index 327e8e678..000000000 --- a/script/whitelist/delegationFaucet/DelegationFaucet.sol +++ /dev/null @@ -1,216 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "src/contracts/interfaces/IStrategyManager.sol"; -import "src/contracts/interfaces/IStrategy.sol"; -import "src/contracts/interfaces/IDelegationManager.sol"; -import "src/contracts/interfaces/IDelegationFaucet.sol"; -import "script/whitelist/delegationFaucet/DelegationFaucetStaker.sol"; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "@openzeppelin/contracts/utils/Create2.sol"; -import "@openzeppelin/contracts/utils/Address.sol"; - -import "../ERC20PresetMinterPauser.sol"; - -/** - * @title DelegationFaucet for M2 - * @author Layr Labs, Inc. - * @notice Faucet contract setup with a dummy ERC20 token and strategy for M2 testnet release. - * Each operator address gets a staker contract assigned to them deterministically. - * This contract assumes minting role of the ERC20 token and that the ERC20 token has a whitelisted strategy. - */ -contract DelegationFaucet is IDelegationFaucet, Ownable { - IStrategyManager immutable strategyManager; - ERC20PresetMinterPauser immutable stakeToken; - IStrategy immutable stakeStrategy; - IDelegationManager immutable delegation; - - uint256 public constant DEFAULT_AMOUNT = 100e18; - - constructor( - IStrategyManager _strategyManager, - IDelegationManager _delegation, - ERC20PresetMinterPauser _token, - IStrategy _strategy - ) { - strategyManager = _strategyManager; - delegation = _delegation; - stakeToken = _token; - stakeStrategy = _strategy; - } - - /** - * Deploys a DelegationFaucetStaker contract if not already deployed for operator. DelegationFaucetStaker gets minted _depositAmount or - * DEFAULT_AMOUNT if _depositAmount is 0. Then DelegationFaucetStaker contract deposits into the strategy and delegates to operator. - * @param _operator The operator to delegate to - * @param _approverSignatureAndExpiry Verifies the operator approves of this delegation - * @param _approverSalt A unique single use value tied to an individual signature. - * @param _depositAmount The amount to deposit into the strategy - */ - function mintDepositAndDelegate( - address _operator, - IDelegationManager.SignatureWithExpiry memory _approverSignatureAndExpiry, - bytes32 _approverSalt, - uint256 _depositAmount - ) public onlyOwner { - // Operator must be registered - require(delegation.isOperator(_operator), "DelegationFaucet: Operator not registered"); - address staker = getStaker(_operator); - // Set deposit amount - if (_depositAmount == 0) { - _depositAmount = DEFAULT_AMOUNT; - } - - // Deploy staker address if not already deployed, staker constructor will approve the StrategyManager to spend the stakeToken - if (!Address.isContract(staker)) { - Create2.deploy( - 0, - bytes32(uint256(uint160(_operator))), - abi.encodePacked(type(DelegationFaucetStaker).creationCode, abi.encode(strategyManager, stakeToken)) - ); - } - - // mint stakeToken to staker - stakeToken.mint(staker, _depositAmount); - // deposit into stakeToken strategy, which will increase delegated shares to operator if already delegated - _depositIntoStrategy(staker, stakeStrategy, stakeToken, _depositAmount); - // delegateTo operator if not delegated - if (!delegation.isDelegated(staker)) { - delegateTo(_operator, _approverSignatureAndExpiry, _approverSalt); - } - } - - /** - * Calls staker contract to deposit into designated strategy, mints staked token if stakeToken and stakeStrategy - * are specified. - * @param _staker address of staker contract for operator - * @param _strategy StakeToken strategy contract - * @param _token StakeToken - * @param _amount amount to get minted and to deposit - */ - function depositIntoStrategy( - address _staker, - IStrategy _strategy, - IERC20 _token, - uint256 _amount - ) public onlyOwner returns (bytes memory) { - // mint stakeToken to staker - if (_token == stakeToken && _strategy == stakeStrategy) { - stakeToken.mint(_staker, _amount); - } - return _depositIntoStrategy(_staker, _strategy, _token, _amount); - } - - /** - * Call staker to delegate to operator - * @param _operator operator to get staker address from and delegate to - * @param _approverSignatureAndExpiry Verifies the operator approves of this delegation - * @param _approverSalt A unique single use value tied to an individual signature. - */ - function delegateTo( - address _operator, - IDelegationManager.SignatureWithExpiry memory _approverSignatureAndExpiry, - bytes32 _approverSalt - ) public onlyOwner returns (bytes memory) { - bytes memory data = abi.encodeWithSelector( - IDelegationManager.delegateTo.selector, - _operator, - _approverSignatureAndExpiry, - _approverSalt - ); - return DelegationFaucetStaker(getStaker(_operator)).callAddress(address(delegation), data); - } - - /** - * Call queueWithdrawal through staker contract - */ - function queueWithdrawal( - address staker, - IDelegationManager.QueuedWithdrawalParams[] calldata queuedWithdrawalParams - ) public onlyOwner returns (bytes memory) { - bytes memory data = abi.encodeWithSelector( - IDelegationManager.queueWithdrawals.selector, - queuedWithdrawalParams - ); - return DelegationFaucetStaker(staker).callAddress(address(delegation), data); - } - - /** - * Call completeQueuedWithdrawal through staker contract - */ - function completeQueuedWithdrawal( - address staker, - IDelegationManager.Withdrawal calldata queuedWithdrawal, - IERC20[] calldata tokens, - uint256 middlewareTimesIndex, - bool receiveAsTokens - ) public onlyOwner returns (bytes memory) { - bytes memory data = abi.encodeWithSelector( - IDelegationManager.completeQueuedWithdrawal.selector, - queuedWithdrawal, - tokens, - middlewareTimesIndex, - receiveAsTokens - ); - return DelegationFaucetStaker(staker).callAddress(address(delegation), data); - } - - /** - * Transfers tokens from staker contract to designated address - * @param staker staker contract to transfer from - * @param token ERC20 token - * @param to the to address - * @param amount transfer amount - */ - function transfer( - address staker, - address token, - address to, - uint256 amount - ) public onlyOwner returns (bytes memory) { - bytes memory data = abi.encodeWithSelector(IERC20.transfer.selector, to, amount); - return DelegationFaucetStaker(staker).callAddress(token, data); - } - - function callAddress(address to, bytes memory data) public payable onlyOwner returns (bytes memory) { - (bool ok, bytes memory res) = payable(to).call{value: msg.value}(data); - if (!ok) { - revert(string(res)); - } - return res; - } - - /** - * @notice Returns the deterministic staker contract address for the operator - * @param _operator The operator to get the staker contract address for - */ - function getStaker(address _operator) public view returns (address) { - return - Create2.computeAddress( - bytes32(uint256(uint160(_operator))), //salt - keccak256( - abi.encodePacked(type(DelegationFaucetStaker).creationCode, abi.encode(strategyManager, stakeToken)) - ) - ); - } - - /** - * @notice Internal function to deposit into a strategy, has same function signature as StrategyManager.depositIntoStrategy - */ - function _depositIntoStrategy( - address _staker, - IStrategy _strategy, - IERC20 _token, - uint256 _amount - ) internal returns (bytes memory) { - bytes memory data = abi.encodeWithSelector( - IStrategyManager.depositIntoStrategy.selector, - _strategy, - _token, - _amount - ); - return DelegationFaucetStaker(_staker).callAddress(address(strategyManager), data); - } -} diff --git a/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol b/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol deleted file mode 100644 index fac0e543c..000000000 --- a/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "src/contracts/interfaces/IStrategyManager.sol"; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "forge-std/Test.sol"; - -contract DelegationFaucetStaker is Ownable { - constructor(IStrategyManager strategyManager, IERC20 token) Ownable() { - token.approve(address(strategyManager), type(uint256).max); - } - - 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/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol b/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol deleted file mode 100644 index db458e99d..000000000 --- a/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol +++ /dev/null @@ -1,84 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "src/contracts/interfaces/IDelegationManager.sol"; -import "src/contracts/interfaces/IStrategyManager.sol"; -import "src/contracts/strategies/StrategyBase.sol"; -import "src/contracts/permissions/PauserRegistry.sol"; - -import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; - -import "./DelegationFaucet.sol"; - -import "forge-std/Script.sol"; -import "forge-std/StdJson.sol"; - -/** - * @notice Deploys the following contracts: - * - ERC20 Dummy token for testing - * - StrategyBase to be added to the StrategyManager whitelist - * - DelegationFaucet contract - */ -contract DeployDelegationFaucet is Script, DSTest { - // EigenLayer contracts - ProxyAdmin public eigenLayerProxyAdmin; - PauserRegistry public eigenLayerPauserReg; - IDelegationManager public delegation; - IStrategyManager public strategyManager; - - DelegationFaucet public delegationFaucet; - - // M2 testing/mock contracts - ERC20PresetMinterPauser public stakeToken; - StrategyBase public stakeTokenStrat; - StrategyBase public baseStrategyImplementation; - - address eigenLayerProxyAdminAddress; - address eigenLayerPauserRegAddress; - address delegationAddress; - address strategyManagerAddress; - address operationsMultisig; - address executorMultisig; - - bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - - function run() external { - string memory goerliDeploymentConfig = vm.readFile("script/output/M1_deployment_goerli_2023_3_23.json"); - _setAddresses(goerliDeploymentConfig); - - vm.startBroadcast(); - // Deploy ERC20 stakeToken - stakeToken = new ERC20PresetMinterPauser("StakeToken", "STK"); - - // Deploy StrategyBase for stakeToken & whitelist it - baseStrategyImplementation = new StrategyBase(strategyManager); - stakeTokenStrat = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - eigenLayerProxyAdminAddress, - abi.encodeWithSelector(StrategyBase.initialize.selector, stakeToken, eigenLayerPauserRegAddress) - ) - ) - ); - - // Needs to be strategyManager.strategyWhitelister() to add STK strategy - // IStrategy[] memory _strategy = new IStrategy[](1); - // _strategy[0] = stakeTokenStrat; - // strategyManager.addStrategiesToDepositWhitelist(_strategy); - - // Deploy DelegationFaucet, grant it admin/mint/pauser roles, etc. - delegationFaucet = new DelegationFaucet(strategyManager, delegation, stakeToken, stakeTokenStrat); - stakeToken.grantRole(MINTER_ROLE, address(delegationFaucet)); - vm.stopBroadcast(); - } - - function _setAddresses(string memory config) internal { - eigenLayerProxyAdminAddress = stdJson.readAddress(config, ".addresses.eigenLayerProxyAdmin"); - eigenLayerPauserRegAddress = stdJson.readAddress(config, ".addresses.eigenLayerPauserReg"); - delegationAddress = stdJson.readAddress(config, ".addresses.delegation"); - strategyManagerAddress = stdJson.readAddress(config, ".addresses.strategyManager"); - operationsMultisig = stdJson.readAddress(config, ".parameters.operationsMultisig"); - executorMultisig = stdJson.readAddress(config, ".parameters.executorMultisig"); - } -} diff --git a/src/contracts/core/AVSDirectory.sol b/src/contracts/core/AVSDirectory.sol index c1d004a8b..727c2308b 100644 --- a/src/contracts/core/AVSDirectory.sol +++ b/src/contracts/core/AVSDirectory.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.12; import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; import "@openzeppelin-upgrades/contracts/security/ReentrancyGuardUpgradeable.sol"; + import "../permissions/Pausable.sol"; import "../libraries/EIP1271SignatureUtils.sol"; import "./AVSDirectoryStorage.sol"; @@ -15,10 +16,15 @@ contract AVSDirectory is AVSDirectoryStorage, ReentrancyGuardUpgradeable { - // @dev Index for flag that pauses operator register/deregister to avs when set. + using EnumerableSet for EnumerableSet.Bytes32Set; + using EnumerableSet for EnumerableSet.AddressSet; + + /// @dev Index for flag that pauses operator register/deregister to avs when set. uint8 internal constant PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS = 0; + /// @dev Index for flag that pauses operator register/deregister to operator sets when set. + uint8 internal constant PAUSER_OPERATOR_REGISTER_DEREGISTER_TO_OPERATOR_SETS = 1; - // @dev Chain ID at the time of contract deployment + /// @dev Returns the chain ID from the time the contract was deployed. uint256 internal immutable ORIGINAL_CHAIN_ID; /** @@ -31,7 +37,9 @@ contract AVSDirectory is * @dev Initializes the immutable addresses of the strategy mananger, delegationManager, slasher, * and eigenpodManager contracts */ - constructor(IDelegationManager _delegation) AVSDirectoryStorage(_delegation) { + constructor( + IDelegationManager _delegation + ) AVSDirectoryStorage(_delegation) { _disableInitializers(); ORIGINAL_CHAIN_ID = block.chainid; } @@ -52,74 +60,314 @@ contract AVSDirectory is /** * - * EXTERNAL FUNCTIONS + * EXTERNAL FUNCTIONS + * + */ + + /** + * @notice Called by an AVS to create a list of new operatorSets. + * + * @param operatorSetIds The IDs of the operator set to initialize. + * + * @dev msg.sender must be the AVS. + * @dev The AVS may create operator sets before it becomes an operator set AVS. + */ + function createOperatorSets( + uint32[] calldata operatorSetIds + ) external { + for (uint256 i = 0; i < operatorSetIds.length; ++i) { + require( + !isOperatorSet[msg.sender][operatorSetIds[i]], + "AVSDirectory.createOperatorSet: operator set already exists" + ); + isOperatorSet[msg.sender][operatorSetIds[i]] = true; + emit OperatorSetCreated(OperatorSet({avs: msg.sender, operatorSetId: operatorSetIds[i]})); + } + } + + /** + * @notice Sets the AVS as an operator set AVS, preventing legacy M2 operator registrations. + * + * @dev msg.sender must be the AVS. + */ + function becomeOperatorSetAVS() external { + require(!isOperatorSetAVS[msg.sender], "AVSDirectory.becomeOperatorSetAVS: already an operator set AVS"); + isOperatorSetAVS[msg.sender] = true; + emit AVSMigratedToOperatorSets(msg.sender); + } + + /** + * @notice Called by an AVS to migrate operators that have a legacy M2 registration to operator sets. + * + * @param operators The list of operators to migrate + * @param operatorSetIds The list of operatorSets to migrate the operators to * + * @dev The msg.sender used is the AVS + * @dev The operator can only be migrated at most once per AVS + * @dev The AVS can no longer register operators via the legacy M2 registration path once it begins migration + * @dev The operator is deregistered from the M2 legacy AVS once migrated */ + function migrateOperatorsToOperatorSets( + address[] calldata operators, + uint32[][] calldata operatorSetIds + ) external override onlyWhenNotPaused(PAUSER_OPERATOR_REGISTER_DEREGISTER_TO_OPERATOR_SETS) { + // Assert that the AVS is an operator set AVS. + require( + isOperatorSetAVS[msg.sender], "AVSDirectory.migrateOperatorsToOperatorSets: AVS is not an operator set AVS" + ); + + for (uint256 i = 0; i < operators.length; i++) { + // Assert that the operator is registered & has not been migrated. + require( + avsOperatorStatus[msg.sender][operators[i]] == OperatorAVSRegistrationStatus.REGISTERED, + "AVSDirectory.migrateOperatorsToOperatorSets: operator already migrated or not a legacy registered operator" + ); + + // Migrate operator to operator sets. + _registerToOperatorSets(operators[i], msg.sender, operatorSetIds[i]); + + // Deregister operator from AVS - this prevents the operator from being migrated again since + // the AVS can no longer use the legacy M2 registration path + avsOperatorStatus[msg.sender][operators[i]] = OperatorAVSRegistrationStatus.UNREGISTERED; + emit OperatorAVSRegistrationStatusUpdated( + operators[i], msg.sender, OperatorAVSRegistrationStatus.UNREGISTERED + ); + emit OperatorMigratedToOperatorSets(operators[i], msg.sender, operatorSetIds[i]); + } + } /** - * @notice Called by the AVS's service manager contract to register an operator with the avs. - * @param operator The address of the operator to register. - * @param operatorSignature The signature, salt, and expiry of the operator's signature. + * @notice Called by AVSs to add an operator to a list of operatorSets. + * + * @param operator The address of the operator to be added to the operator set. + * @param operatorSetIds The IDs of the operator sets. + * @param operatorSignature The signature of the operator on their intent to register. + * + * @dev msg.sender is used as the AVS. + * @dev The operator must not have a pending deregistration from the operator set. + */ + function registerOperatorToOperatorSets( + address operator, + uint32[] calldata operatorSetIds, + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature + ) external override onlyWhenNotPaused(PAUSER_OPERATOR_REGISTER_DEREGISTER_TO_OPERATOR_SETS) { + // Assert operator's signature has not expired. + require( + operatorSignature.expiry >= block.timestamp, + "AVSDirectory.registerOperatorToOperatorSets: operator signature expired" + ); + // Assert `operator` is actually an operator. + require( + delegation.isOperator(operator), + "AVSDirectory.registerOperatorToOperatorSets: operator not registered to EigenLayer yet" + ); + // Assert that the AVS is an operator set AVS. + require( + isOperatorSetAVS[msg.sender], "AVSDirectory.registerOperatorToOperatorSets: AVS is not an operator set AVS" + ); + // Assert operator's signature `salt` has not already been spent. + require( + !operatorSaltIsSpent[operator][operatorSignature.salt], + "AVSDirectory.registerOperatorToOperatorSets: salt already spent" + ); + + // Assert that `operatorSignature.signature` is a valid signature for operator set registrations. + EIP1271SignatureUtils.checkSignature_EIP1271( + operator, + calculateOperatorSetRegistrationDigestHash({ + avs: msg.sender, + operatorSetIds: operatorSetIds, + salt: operatorSignature.salt, + expiry: operatorSignature.expiry + }), + operatorSignature.signature + ); + + // Mutate `operatorSaltIsSpent` to `true` to prevent future respending. + operatorSaltIsSpent[operator][operatorSignature.salt] = true; + + _registerToOperatorSets(operator, msg.sender, operatorSetIds); + } + + /** + * @notice Called by an operator to deregister from an operator set + * + * @param operator The operator to deregister from the operatorSets. + * @param avs The address of the AVS to deregister the operator from. + * @param operatorSetIds The IDs of the operator sets. + * @param operatorSignature the signature of the operator on their intent to deregister or empty if the operator itself is calling + * + * @dev if the operatorSignature is empty, the caller must be the operator + * @dev this will likely only be called in case the AVS contracts are in a state that prevents operators from deregistering + */ + function forceDeregisterFromOperatorSets( + address operator, + address avs, + uint32[] calldata operatorSetIds, + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature + ) external override onlyWhenNotPaused(PAUSER_OPERATOR_REGISTER_DEREGISTER_TO_OPERATOR_SETS) { + // COMMENTED FOR CODESIZE + // if (operatorSignature.signature.length == 0) { + // require(msg.sender == operator, "AVSDirectory.forceDeregisterFromOperatorSets: caller must be operator"); + // } else { + // // Assert operator's signature has not expired. + // require( + // operatorSignature.expiry >= block.timestamp, + // "AVSDirectory.forceDeregisterFromOperatorSets: operator signature expired" + // ); + // // Assert operator's signature `salt` has not already been spent. + // require( + // !operatorSaltIsSpent[operator][operatorSignature.salt], + // "AVSDirectory.forceDeregisterFromOperatorSets: salt already spent" + // ); + + // // Assert that `operatorSignature.signature` is a valid signature for operator set deregistrations. + // EIP1271SignatureUtils.checkSignature_EIP1271( + // operator, + // calculateOperatorSetForceDeregistrationTypehash({ + // avs: avs, + // operatorSetIds: operatorSetIds, + // salt: operatorSignature.salt, + // expiry: operatorSignature.expiry + // }), + // operatorSignature.signature + // ); + + // // Mutate `operatorSaltIsSpent` to `true` to prevent future respending. + // operatorSaltIsSpent[operator][operatorSignature.salt] = true; + // } + // _deregisterFromOperatorSets(avs, operator, operatorSetIds); + } + + /** + * @notice Called by AVSs to remove an operator from an operator set. + * + * @param operator The address of the operator to be removed from the operator set. + * @param operatorSetIds The IDs of the operator sets. + * + * @dev msg.sender is used as the AVS. + */ + function deregisterOperatorFromOperatorSets( + address operator, + uint32[] calldata operatorSetIds + ) external override onlyWhenNotPaused(PAUSER_OPERATOR_REGISTER_DEREGISTER_TO_OPERATOR_SETS) { + _deregisterFromOperatorSets(msg.sender, operator, operatorSetIds); + } + + /** + * @notice Called by an AVS to emit an `AVSMetadataURIUpdated` event indicating the information has updated. + * + * @param metadataURI The URI for metadata associated with an AVS. + * + * @dev Note that the `metadataURI` is *never stored* and is only emitted in the `AVSMetadataURIUpdated` event. + */ + function updateAVSMetadataURI( + string calldata metadataURI + ) external override { + emit AVSMetadataURIUpdated(msg.sender, metadataURI); + } + + /** + * @notice Called by an operator to cancel a salt that has been used to register with an AVS. + * + * @param salt A unique and single use value associated with the approver signature. + */ + function cancelSalt( + bytes32 salt + ) external override { + // Mutate `operatorSaltIsSpent` to `true` to prevent future spending. + operatorSaltIsSpent[msg.sender][salt] = true; + } + + /** + * + * LEGACY EXTERNAL FUNCTIONS - SUPPORT DEPRECATED IN FUTURE RELEASE AFTER SLASHING RELEASE + * + */ + + /** + * @notice Legacy function called by the AVS's service manager contract + * to register an operator with the AVS. NOTE: this function will be deprecated in a future release + * after the slashing release. New AVSs should use `registerOperatorToOperatorSets` instead. + * + * @param operator The address of the operator to register. + * @param operatorSignature The signature, salt, and expiry of the operator's signature. + * + * @dev msg.sender must be the AVS. + * @dev Only used by legacy M2 AVSs that have not integrated with operator sets. */ function registerOperatorToAVS( address operator, ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature - ) external onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS) { + ) external override onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS) { + // Assert `operatorSignature.expiry` has not elapsed. require( operatorSignature.expiry >= block.timestamp, "AVSDirectory.registerOperatorToAVS: operator signature expired" ); + + // Assert that the AVS is not an operator set AVS. + require(!isOperatorSetAVS[msg.sender], "AVSDirectory.registerOperatorToAVS: AVS is an operator set AVS"); + + // Assert that the `operator` is not actively registered to the AVS. require( avsOperatorStatus[msg.sender][operator] != OperatorAVSRegistrationStatus.REGISTERED, "AVSDirectory.registerOperatorToAVS: operator already registered" ); + + // Assert `operator` has not already spent `operatorSignature.salt`. require( !operatorSaltIsSpent[operator][operatorSignature.salt], "AVSDirectory.registerOperatorToAVS: salt already spent" ); + + // Assert `operator` is a registered operator. require( delegation.isOperator(operator), "AVSDirectory.registerOperatorToAVS: operator not registered to EigenLayer yet" ); - // Calculate the digest hash - bytes32 operatorRegistrationDigestHash = calculateOperatorAVSRegistrationDigestHash({ - operator: operator, - avs: msg.sender, - salt: operatorSignature.salt, - expiry: operatorSignature.expiry + // Assert that `operatorSignature.signature` is a valid signature for the operator AVS registration. + EIP1271SignatureUtils.checkSignature_EIP1271({ + signer: operator, + digestHash: calculateOperatorAVSRegistrationDigestHash({ + operator: operator, + avs: msg.sender, + salt: operatorSignature.salt, + expiry: operatorSignature.expiry + }), + signature: operatorSignature.signature }); - // forgefmt: disable-next-item - // Check that the signature is valid - EIP1271SignatureUtils.checkSignature_EIP1271( - operator, - operatorRegistrationDigestHash, - operatorSignature.signature - ); + // Mutate `operatorSaltIsSpent` to `true` to prevent future respending. + operatorSaltIsSpent[operator][operatorSignature.salt] = true; // Set the operator as registered avsOperatorStatus[msg.sender][operator] = OperatorAVSRegistrationStatus.REGISTERED; - // Mark the salt as spent - operatorSaltIsSpent[operator][operatorSignature.salt] = true; - emit OperatorAVSRegistrationStatusUpdated(operator, msg.sender, OperatorAVSRegistrationStatus.REGISTERED); } /** - * @notice Called by an avs to deregister an operator with the avs. - * @param operator The address of the operator to deregister. + * @notice Legacy function called by an AVS to deregister an operator from the AVS. + * NOTE: this function will be deprecated in a future release after the slashing release. + * New AVSs integrating should use `deregisterOperatorFromOperatorSets` instead. + * + * @param operator The address of the operator to deregister. + * + * @dev Only used by legacy M2 AVSs that have not integrated with operator sets. */ - function deregisterOperatorFromAVS(address operator) - external - onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS) - { + function deregisterOperatorFromAVS( + address operator + ) external override onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS) { require( avsOperatorStatus[msg.sender][operator] == OperatorAVSRegistrationStatus.REGISTERED, "AVSDirectory.deregisterOperatorFromAVS: operator not registered" ); + // Assert that the AVS is not an operator set AVS. + require(!isOperatorSetAVS[msg.sender], "AVSDirectory.deregisterOperatorFromAVS: AVS is an operator set AVS"); + // Set the operator as deregistered avsOperatorStatus[msg.sender][operator] = OperatorAVSRegistrationStatus.UNREGISTERED; @@ -127,20 +375,71 @@ contract AVSDirectory is } /** - * @notice Called by an avs to emit an `AVSMetadataURIUpdated` event indicating the information has updated. - * @param metadataURI The URI for metadata associated with an avs + * + * INTERNAL FUNCTIONS + * + */ + + /** + * @notice Helper function used by migration & registration functions to register an operator to operator sets. + * @param avs The AVS that the operator is registering to. + * @param operator The operator to register. + * @param operatorSetIds The IDs of the operator sets. */ - function updateAVSMetadataURI(string calldata metadataURI) external { - emit AVSMetadataURIUpdated(msg.sender, metadataURI); + function _registerToOperatorSets(address operator, address avs, uint32[] calldata operatorSetIds) internal { + // Loop over `operatorSetIds` array and register `operator` for each item. + for (uint256 i = 0; i < operatorSetIds.length; ++i) { + OperatorSet memory operatorSet = OperatorSet(avs, operatorSetIds[i]); + + require( + isOperatorSet[avs][operatorSetIds[i]], + "AVSDirectory._registerOperatorToOperatorSets: invalid operator set" + ); + + bytes32 encodedOperatorSet = _encodeOperatorSet(operatorSet); + + require( + _operatorSetsMemberOf[operator].add(encodedOperatorSet), + "AVSDirectory._registerOperatorToOperatorSets: operator already registered to operator set" + ); + + _operatorSetMembers[encodedOperatorSet].add(operator); + + OperatorSetRegistrationStatus storage registrationStatus = + operatorSetStatus[avs][operator][operatorSetIds[i]]; + require( + !registrationStatus.registered, + "AVSDirectory._registerOperatorToOperatorSets: operator already registered for operator set" + ); + registrationStatus.registered = true; + + emit OperatorAddedToOperatorSet(operator, operatorSet); + } } /** - * @notice Called by an operator to cancel a salt that has been used to register with an AVS. - * @param salt A unique and single use value associated with the approver signature. + * @notice Internal function to deregister an operator from an operator set. + * + * @param avs The AVS that the operator is deregistering from. + * @param operator The operator to deregister. + * @param operatorSetIds The IDs of the operator sets. */ - function cancelSalt(bytes32 salt) external { - require(!operatorSaltIsSpent[msg.sender][salt], "AVSDirectory.cancelSalt: cannot cancel spent salt"); - operatorSaltIsSpent[msg.sender][salt] = true; + function _deregisterFromOperatorSets(address avs, address operator, uint32[] calldata operatorSetIds) internal { + // Loop over `operatorSetIds` array and deregister `operator` for each item. + for (uint256 i = 0; i < operatorSetIds.length; ++i) { + OperatorSet memory operatorSet = OperatorSet(avs, operatorSetIds[i]); + + bytes32 encodedOperatorSet = _encodeOperatorSet(operatorSet); + + require( + _operatorSetsMemberOf[operator].remove(encodedOperatorSet), + "AVSDirectory._deregisterOperatorFromOperatorSet: operator not registered for operator set" + ); + + _operatorSetMembers[encodedOperatorSet].remove(operator); + + emit OperatorRemovedFromOperatorSet(operator, operatorSet); + } } /** @@ -150,39 +449,186 @@ contract AVSDirectory is */ /** - * @notice Calculates the digest hash to be signed by an operator to register with an AVS - * @param operator The account registering as an operator - * @param avs The address of the service manager contract for the AVS that the operator is registering to - * @param salt A unique and single use value associated with the approver signature. - * @param expiry Time after which the approver's signature becomes invalid + * @notice Returns operatorSet an operator is registered to in the order they were registered. + * @param operator The operator address to query. + * @param index The index of the enumerated list of operator sets. + */ + function operatorSetsMemberOfAtIndex(address operator, uint256 index) external view returns (OperatorSet memory) { + return _decodeOperatorSet(_operatorSetsMemberOf[operator].at(index)); + } + + /** + * @notice Returns the operator registered to an operatorSet in the order that it was registered. + * @param operatorSet The operatorSet to query. + * @param index The index of the enumerated list of operators. + */ + function operatorSetMemberAtIndex(OperatorSet memory operatorSet, uint256 index) external view returns (address) { + return _operatorSetMembers[_encodeOperatorSet(operatorSet)].at(index); + } + + /** + * @notice Returns an array of operator sets an operator is registered to. + * @param operator The operator address to query. + * @param start The starting index of the array to query. + * @param length The amount of items of the array to return. + */ + function getOperatorSetsOfOperator( + address operator, + uint256 start, + uint256 length + ) public view returns (OperatorSet[] memory operatorSets) { + uint256 maxLength = _operatorSetsMemberOf[operator].length() - start; + if (length > maxLength) length = maxLength; + operatorSets = new OperatorSet[](length); + for (uint256 i; i < length; ++i) { + operatorSets[i] = _decodeOperatorSet(_operatorSetsMemberOf[operator].at(start + i)); + } + } + + /** + * @notice Returns an array of operators registered to the operatorSet. + * @param operatorSet The operatorSet to query. + * @param start The starting index of the array to query. + * @param length The amount of items of the array to return. + */ + function getOperatorsInOperatorSet( + OperatorSet memory operatorSet, + uint256 start, + uint256 length + ) external view returns (address[] memory operators) { + bytes32 encodedOperatorSet = _encodeOperatorSet(operatorSet); + uint256 maxLength = _operatorSetMembers[encodedOperatorSet].length() - start; + if (length > maxLength) length = maxLength; + operators = new address[](length); + for (uint256 i; i < length; ++i) { + operators[i] = _operatorSetMembers[encodedOperatorSet].at(start + i); + } + } + + /** + * @notice Returns the number of operators registered to an operatorSet. + * @param operatorSet The operatorSet to get the member count for + */ + function getNumOperatorsInOperatorSet( + OperatorSet memory operatorSet + ) external view returns (uint256) { + return _operatorSetMembers[_encodeOperatorSet(operatorSet)].length(); + } + + /** + * @notice Returns the total number of operator sets an operator is registered to. + * @param operator The operator address to query. + */ + function inTotalOperatorSets( + address operator + ) external view returns (uint256) { + return _operatorSetsMemberOf[operator].length(); + } + + /** + * @notice Returns whether or not an operator is registered to an operator set. + * @param operator The operator address to query. + * @param operatorSet The `OperatorSet` to query. + */ + function isMember(address operator, OperatorSet memory operatorSet) public view returns (bool) { + return _operatorSetsMemberOf[operator].contains(_encodeOperatorSet(operatorSet)); + } + + /** + * @notice Calculates the digest hash to be signed by an operator to register with an AVS. + * + * @param operator The account registering as an operator. + * @param avs The AVS the operator is registering with. + * @param salt A unique and single-use value associated with the approver's signature. + * @param expiry The time after which the approver's signature becomes invalid. */ function calculateOperatorAVSRegistrationDigestHash( address operator, address avs, bytes32 salt, uint256 expiry - ) public view returns (bytes32) { - // calculate the struct hash - bytes32 structHash = keccak256(abi.encode(OPERATOR_AVS_REGISTRATION_TYPEHASH, operator, avs, salt, expiry)); - // calculate the digest hash - bytes32 digestHash = keccak256(abi.encodePacked("\x19\x01", domainSeparator(), structHash)); - return digestHash; + ) public view override returns (bytes32) { + return + _calculateDigestHash(keccak256(abi.encode(OPERATOR_AVS_REGISTRATION_TYPEHASH, operator, avs, salt, expiry))); } /** - * @notice Getter function for the current EIP-712 domain separator for this contract. - * @dev The domain separator will change in the event of a fork that changes the ChainID. + * @notice Calculates the digest hash to be signed by an operator to register with an operator set. + * + * @param avs The AVS that operator is registering to operator sets for. + * @param operatorSetIds An array of operator set IDs the operator is registering to. + * @param salt A unique and single use value associated with the approver signature. + * @param expiry Time after which the approver's signature becomes invalid. */ - function domainSeparator() public view returns (bytes32) { + function calculateOperatorSetRegistrationDigestHash( + address avs, + uint32[] calldata operatorSetIds, + bytes32 salt, + uint256 expiry + ) public view override returns (bytes32) { + return _calculateDigestHash( + keccak256(abi.encode(OPERATOR_SET_REGISTRATION_TYPEHASH, avs, operatorSetIds, salt, expiry)) + ); + } + + /** + * @notice Calculates the digest hash to be signed by an operator to force deregister from an operator set. + * + * @param avs The AVS that operator is deregistering from. + * @param operatorSetIds An array of operator set IDs the operator is deregistering from. + * @param salt A unique and single use value associated with the approver signature. + * @param expiry Time after which the approver's signature becomes invalid. + */ + function calculateOperatorSetForceDeregistrationTypehash( + address avs, + uint32[] calldata operatorSetIds, + bytes32 salt, + uint256 expiry + ) public view returns (bytes32) { + return _calculateDigestHash( + keccak256(abi.encode(OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH, avs, operatorSetIds, salt, expiry)) + ); + } + + /// @notice Getter function for the current EIP-712 domain separator for this contract. + /// @dev The domain separator will change in the event of a fork that changes the ChainID. + function domainSeparator() public view override returns (bytes32) { + return _calculateDomainSeparator(); + } + + /// @notice Internal function for calculating the current domain separator of this contract + function _calculateDomainSeparator() internal view returns (bytes32) { if (block.chainid == ORIGINAL_CHAIN_ID) { return _DOMAIN_SEPARATOR; } else { - return _calculateDomainSeparator(); + return keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes("EigenLayer")), block.chainid, address(this))); } } - // @notice Internal function for calculating the current domain separator of this contract - function _calculateDomainSeparator() internal view returns (bytes32) { - return keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes("EigenLayer")), block.chainid, address(this))); + /// @notice Returns an EIP-712 encoded hash struct. + function _calculateDigestHash( + bytes32 structHash + ) internal view returns (bytes32) { + return keccak256(abi.encodePacked("\x19\x01", _calculateDomainSeparator(), structHash)); + } + + /// @dev Returns an `OperatorSet` encoded into a 32-byte value. + /// @param operatorSet The `OperatorSet` to encode. + function _encodeOperatorSet( + OperatorSet memory operatorSet + ) internal pure returns (bytes32) { + return bytes32(abi.encodePacked(operatorSet.avs, uint96(operatorSet.operatorSetId))); + } + + /// @dev Returns an `OperatorSet` decoded from an encoded 32-byte value. + /// @param encoded The encoded `OperatorSet` to decode. + /// @dev Assumes `encoded` is encoded via `_encodeOperatorSet(operatorSet)`. + function _decodeOperatorSet( + bytes32 encoded + ) internal pure returns (OperatorSet memory) { + return OperatorSet({ + avs: address(uint160(uint256(encoded) >> 96)), + operatorSetId: uint32(uint256(encoded) & type(uint96).max) + }); } } diff --git a/src/contracts/core/AVSDirectoryStorage.sol b/src/contracts/core/AVSDirectoryStorage.sol index 47a326f16..2f1065dba 100644 --- a/src/contracts/core/AVSDirectoryStorage.sol +++ b/src/contracts/core/AVSDirectoryStorage.sol @@ -1,10 +1,14 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.12; +import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; + import "../interfaces/IAVSDirectory.sol"; -import "../interfaces/IDelegationManager.sol"; abstract contract AVSDirectoryStorage is IAVSDirectory { + using EnumerableSet for EnumerableSet.Bytes32Set; + using EnumerableSet for EnumerableSet.AddressSet; + /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); @@ -13,6 +17,19 @@ abstract contract AVSDirectoryStorage is IAVSDirectory { bytes32 public constant OPERATOR_AVS_REGISTRATION_TYPEHASH = keccak256("OperatorAVSRegistration(address operator,address avs,bytes32 salt,uint256 expiry)"); + /// @notice The EIP-712 typehash for the `OperatorSetRegistration` struct used by the contract + bytes32 public constant OPERATOR_SET_REGISTRATION_TYPEHASH = + keccak256("OperatorSetRegistration(address avs,uint32[] operatorSetIds,bytes32 salt,uint256 expiry)"); + + /// @notice The EIP-712 typehash for the `OperatorSetMembership` struct used by the contract + bytes32 public constant OPERATOR_SET_FORCE_DEREGISTRATION_TYPEHASH = + keccak256("OperatorSetForceDeregistration(address avs,uint32[] operatorSetIds,bytes32 salt,uint256 expiry)"); + + /// @notice The EIP-712 typehash for the `MagnitudeAdjustments` struct used by the contract + bytes32 public constant MAGNITUDE_ADJUSTMENT_TYPEHASH = keccak256( + "MagnitudeAdjustments(address operator,MagnitudeAdjustment(address strategy, OperatorSet(address avs, uint32 operatorSetId)[], uint64[] magnitudeDiffs)[],bytes32 salt,uint256 expiry)" + ); + /// @notice The DelegationManager contract for EigenLayer IDelegationManager public immutable delegation; @@ -23,14 +40,33 @@ abstract contract AVSDirectoryStorage is IAVSDirectory { */ bytes32 internal _DOMAIN_SEPARATOR; - /// @notice Mapping: AVS => operator => enum of operator status to the AVS + /// @notice Mapping: avs => operator => OperatorAVSRegistrationStatus struct + /// @dev This storage will be deprecated once M2 based deregistration is deprecated. mapping(address => mapping(address => OperatorAVSRegistrationStatus)) public avsOperatorStatus; - /// @notice Mapping: operator => 32-byte salt => whether or not the salt has already been used by the operator. - /// @dev Salt is used in the `registerOperatorToAVS` function. + /// @notice Mapping: operator => salt => Whether the salt has been used or not. mapping(address => mapping(bytes32 => bool)) public operatorSaltIsSpent; - constructor(IDelegationManager _delegation) { + /// @notice Mapping: avs => Whether it is a an operator set AVS or not. + mapping(address => bool) public isOperatorSetAVS; + + /// @notice Mapping: avs => operatorSetId => Whether or not an operator set is valid. + mapping(address => mapping(uint32 => bool)) public isOperatorSet; + + /// @notice Mapping: operator => List of operator sets that operator is registered to. + /// @dev Each item is formatted as such: bytes32(abi.encodePacked(avs, uint96(operatorSetId))) + mapping(address => EnumerableSet.Bytes32Set) internal _operatorSetsMemberOf; + + /// @notice Mapping: operatorSet => List of operators that are registered to the operatorSet + /// @dev Each key is formatted as such: bytes32(abi.encodePacked(avs, uint96(operatorSetId))) + mapping(bytes32 => EnumerableSet.AddressSet) internal _operatorSetMembers; + + /// @notice Mapping: operator => avs => operatorSetId => operator registration status + mapping(address => mapping(address => mapping(uint32 => OperatorSetRegistrationStatus))) public operatorSetStatus; + + constructor( + IDelegationManager _delegation + ) { delegation = _delegation; } @@ -39,5 +75,5 @@ abstract contract AVSDirectoryStorage is IAVSDirectory { * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[47] private __gap; + uint256[42] private __gap; } diff --git a/src/contracts/core/AllocationManager.sol b/src/contracts/core/AllocationManager.sol new file mode 100644 index 000000000..b33fe0d79 --- /dev/null +++ b/src/contracts/core/AllocationManager.sol @@ -0,0 +1,824 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; +import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; +import "@openzeppelin-upgrades/contracts/security/ReentrancyGuardUpgradeable.sol"; + +import "../permissions/Pausable.sol"; +import "../libraries/EIP1271SignatureUtils.sol"; +import "../libraries/SlashingConstants.sol"; +import "./AllocationManagerStorage.sol"; + +contract AllocationManager is + Initializable, + OwnableUpgradeable, + Pausable, + AllocationManagerStorage, + ReentrancyGuardUpgradeable +{ + using Snapshots for Snapshots.History; + + /// @dev BIPS factor for slashable bips + uint256 internal constant BIPS_FACTOR = 10_000; + + /// @dev Maximum number of pending updates that can be queued for allocations/deallocations + uint256 public constant MAX_PENDING_UPDATES = 1; + + /// @dev Returns the chain ID from the time the contract was deployed. + uint256 internal immutable ORIGINAL_CHAIN_ID; + + /** + * + * INITIALIZING FUNCTIONS + * + */ + + /** + * @dev Initializes the immutable addresses of the strategy mananger, delegationManager, slasher, + * and eigenpodManager contracts + */ + constructor( + IDelegationManager _delegation, + IAVSDirectory _avsDirectory + ) AllocationManagerStorage(_delegation, _avsDirectory) { + _disableInitializers(); + ORIGINAL_CHAIN_ID = block.chainid; + } + + /** + * @dev Initializes the addresses of the initial owner, pauser registry, and paused status. + * minWithdrawalDelayBlocks is set only once here + */ + function initialize( + address initialOwner, + IPauserRegistry _pauserRegistry, + uint256 initialPausedStatus + ) external initializer { + _initializePauser(_pauserRegistry, initialPausedStatus); + _DOMAIN_SEPARATOR = _calculateDomainSeparator(); + _transferOwnership(initialOwner); + } + + /** + * @notice For all pending deallocations that have become completable, their pending free magnitude can be + * added back to the free magnitude of the (operator, strategy) amount. This function takes a list of strategies + * and adds all completable deallocations for each strategy, updating the freeMagnitudes of the operator + * + * @param operator address to complete deallocations for + * @param strategies a list of strategies to complete deallocations for + * @param numToComplete a list of number of pending free magnitude deallocations to complete for each strategy + * + * @dev can be called permissionlessly by anyone + */ + function updateFreeMagnitude( + address operator, + IStrategy[] calldata strategies, + uint16[] calldata numToComplete + ) external { + require( + delegation.isOperator(operator), + "AllocationManager.updateFreeMagnitude: operator not registered to EigenLayer yet" + ); + require( + strategies.length == numToComplete.length, "AllocationManager.updateFreeMagnitude: array length mismatch" + ); + for (uint256 i = 0; i < strategies.length; ++i) { + _updateFreeMagnitude({operator: operator, strategy: strategies[i], numToComplete: numToComplete[i]}); + } + } + + /** + * @notice Modifies the propotions of slashable stake allocated to a list of operatorSets for a set of strategies + * @param operator address to modify allocations for + * @param allocations array of magnitude adjustments for multiple strategies and corresponding operator sets + * @param operatorSignature signature of the operator if msg.sender is not the operator + * @dev Updates freeMagnitude for the updated strategies + * @dev Must be called by the operator or with a valid operator signature + * @dev For each allocation, allocation.operatorSets MUST be ordered in ascending order according to the + * encoding of the operatorSet. This is to prevent duplicate operatorSets being passed in. The easiest way to ensure + * ordering is to sort allocated operatorSets by address first, and then sort for each avs by ascending operatorSetIds. + */ + function modifyAllocations( + address operator, + MagnitudeAllocation[] calldata allocations, + SignatureWithSaltAndExpiry calldata operatorSignature + ) external { + if (msg.sender != operator) { + _verifyOperatorSignature(operator, allocations, operatorSignature); + } + require( + delegation.isOperator(operator), + "AllocationManager.modifyAllocations: operator not registered to EigenLayer yet" + ); + IDelegationManager.AllocationDelayDetails memory details = delegation.operatorAllocationDelay(operator); + require( + details.isSet, + "AllocationManager.modifyAllocations: operator must initialize allocation delay before modifying allocations" + ); + // effect timestamp for allocations to take effect. This is configurable by operators + uint32 effectTimestamp = uint32(block.timestamp) + details.allocationDelay; + // completable timestamp for deallocations + uint32 completableTimestamp = uint32(block.timestamp) + SlashingConstants.DEALLOCATION_DELAY; + + for (uint256 i = 0; i < allocations.length; ++i) { + // 1. For the given (operator,strategy) clear all pending free magnitude for the strategy and update freeMagnitude + _updateFreeMagnitude({ + operator: operator, + strategy: allocations[i].strategy, + numToComplete: type(uint16).max + }); + + // 2. Check current totalMagnitude matches expected value. This is to check for slashing race conditions + // where an operator gets slashed from an operatorSet and as a result all the configured allocations have larger + // proprtional magnitudes relative to eachother. This check prevents any surprising behavior. + uint64 currentTotalMagnitude = _getLatestTotalMagnitude(operator, allocations[i].strategy); + require( + currentTotalMagnitude == allocations[i].expectedTotalMagnitude, + "AllocationManager.modifyAllocations: current total magnitude does not match expected" + ); + + // 3. set allocations for the strategy after updating freeMagnitude + _modifyAllocations({ + operator: operator, + allocation: allocations[i], + allocationEffectTimestamp: effectTimestamp, + deallocationCompletableTimestamp: completableTimestamp + }); + } + } + + /** + * @notice Called by an AVS to slash an operator for given operatorSetId, list of strategies, and bipsToSlash. + * For each given (operator, operatorSetId, strategy) tuple, bipsToSlash + * bips of the operatorSet's slashable stake allocation will be slashed + * + * @param operator the address to slash + * @param operatorSetId the ID of the operatorSet the operator is being slashed on behalf of + * @param strategies the set of strategies to slash + * @param bipsToSlash the number of bips to slash, this will be proportional to the + * operator's slashable stake allocation for the operatorSet + */ + function slashOperator( + address operator, + uint32 operatorSetId, + IStrategy[] calldata strategies, + uint16 bipsToSlash + ) external { + OperatorSet memory operatorSet = OperatorSet({avs: msg.sender, operatorSetId: operatorSetId}); + bytes32 operatorSetKey = _encodeOperatorSet(operatorSet); + require( + isOperatorSlashable(operator, operatorSet), + "AllocationManager.slashOperator: operator not slashable for operatorSet" + ); + + for (uint256 i = 0; i < strategies.length; ++i) { + // 1. calculate slashed magnitude from current allocation + // update current and all following queued magnitude updates for (operator, strategy, operatorSetId) tuple + uint64 slashedMagnitude; + { + uint64 currentMagnitude = uint64( + _magnitudeUpdate[operator][strategies[i]][operatorSetKey].upperLookupRecent(uint32(block.timestamp)) + ); + // slash nonzero current magnitude + if (currentMagnitude != 0) { + /// TODO: add wrapping library for rounding up for slashing accounting + slashedMagnitude = uint64(uint256(bipsToSlash) * uint256(currentMagnitude) / BIPS_FACTOR); + + _magnitudeUpdate[operator][strategies[i]][operatorSetKey].decrementAtAndFutureSnapshots({ + key: uint32(block.timestamp), + decrementValue: slashedMagnitude + }); + } + } + + // 2. if there are any pending deallocations then need to update and decrement if they fall within slashable window + // loop backwards through _queuedDeallocationIndices, each element contains an array index to + // corresponding deallocation to access in pendingFreeMagnitude + // if completable, then break + // (since ordered by completableTimestamps, older deallocations will also be completable and outside slashable window) + // if NOT completable, then add to slashed magnitude + { + uint256 queuedDeallocationIndicesLen = + _queuedDeallocationIndices[operator][strategies[i]][operatorSetKey].length; + for (uint256 j = queuedDeallocationIndicesLen; j > 0; --j) { + // index of pendingFreeMagnitude/deallocation to check for slashing + uint256 index = _queuedDeallocationIndices[operator][strategies[i]][operatorSetKey][j - 1]; + PendingFreeMagnitude storage pendingFreeMagnitude = + _pendingFreeMagnitude[operator][strategies[i]][index]; + + // Reached pendingFreeMagnitude/deallocation that is completable and not within slashability window, + // therefore older deallocations will also be completable. Since this is ordered by completableTimestamps break loop now + if (pendingFreeMagnitude.completableTimestamp >= uint32(block.timestamp)) { + break; + } + + // pending deallocation is still within slashable window, slash magnitudeDiff and add to slashedMagnitude + uint64 slashedAmount = + uint64(uint256(bipsToSlash) * uint256(pendingFreeMagnitude.magnitudeDiff) / BIPS_FACTOR); + pendingFreeMagnitude.magnitudeDiff -= slashedAmount; + slashedMagnitude += slashedAmount; + } + } + + // 3. update totalMagnitude, get total magnitude and subtract slashedMagnitude + _totalMagnitudeUpdate[operator][strategies[i]].push({ + key: uint32(block.timestamp), + value: _getLatestTotalMagnitude(operator, strategies[i]) - slashedMagnitude + }); + } + } + + /** + * @notice Called by an operator to cancel a salt that has been used to register with an AVS. + * + * @param salt A unique and single use value associated with the approver signature. + */ + function cancelSalt( + bytes32 salt + ) external override { + // Mutate `operatorSaltIsSpent` to `true` to prevent future spending. + operatorSaltIsSpent[msg.sender][salt] = true; + } + + /** + * @notice For a single strategy, update freeMagnitude by adding completable pending free magnitudes + * @param operator address to update freeMagnitude for + * @param strategy the strategy to update freeMagnitude for + * @param numToComplete the number of pending free magnitudes deallocations to complete + * @dev read through pending free magnitudes and add to freeMagnitude if completableTimestamp is >= block timestamp + * In addition to updating freeMagnitude, updates next starting index to read from for pending free magnitudes after completing + */ + function _updateFreeMagnitude(address operator, IStrategy strategy, uint16 numToComplete) internal { + OperatorMagnitudeInfo storage info = operatorMagnitudeInfo[operator][strategy]; + (uint64 freeMagnitudeToAdd, uint192 completed) = + _getPendingFreeMagnitude(operator, strategy, numToComplete, info.nextPendingFreeMagnitudeIndex); + info.freeMagnitude += freeMagnitudeToAdd; + info.nextPendingFreeMagnitudeIndex += completed; + } + + /** + * @notice For a single strategy, modify magnitude allocations for each of the specified operatorSets + * @param operator address to modify allocations for + * @param allocation the magnitude allocations to modify for a single strategy + * @param allocationEffectTimestamp the timestamp when the allocations will take effect + * @param deallocationCompletableTimestamp the timestamp when the deallocations will be completable + * @dev For each allocation, allocation.operatorSets MUST be ordered in ascending order according to the + * encoding of the operatorSet. This is to prevent duplicate operatorSets being passed in. The easiest way to ensure + * ordering is to sort allocated operatorSets by address first, and then sort for each avs by ascending operatorSetIds. + */ + function _modifyAllocations( + address operator, + MagnitudeAllocation calldata allocation, + uint32 allocationEffectTimestamp, + uint32 deallocationCompletableTimestamp + ) internal { + require( + allocation.operatorSets.length == allocation.magnitudes.length, + "AllocationManager._modifyAllocations: operatorSets and magnitudes length mismatch" + ); + + // OperatorSet[] calldata opSets = allocation.operatorSets; + + bytes32 prevOperatorSet = bytes32(0); + + for (uint256 i = 0; i < allocation.operatorSets.length; ++i) { + require( + avsDirectory.isOperatorSet(allocation.operatorSets[i].avs, allocation.operatorSets[i].operatorSetId), + "AllocationManager._modifyAllocations: operatorSet does not exist" + ); + // use encoding of operatorSet to ensure ordering and also used to use OperatorSet struct as key in mappings + bytes32 operatorSetKey = _encodeOperatorSet(allocation.operatorSets[i]); + require(prevOperatorSet < operatorSetKey, "AllocationManager._modifyAllocations: operatorSets not ordered"); + prevOperatorSet = operatorSetKey; + + // Read current magnitude allocation including its respective array index and length. + // We'll use these values later to check the number of pending allocations/deallocations. + (uint224 currentMagnitude, uint256 pos, uint256 length) = _magnitudeUpdate[operator][allocation.strategy][operatorSetKey] + .upperLookupRecentWithPos(uint32(block.timestamp)); + + // Check that there is at MOST `MAX_PENDING_UPDATES` combined allocations & deallocations for the operator, operatorSet, strategy + { + uint256 numPendingAllocations; + // if no lookup found (currentMagnitude == 0 && pos == 0), then we are at the beginning of the array + // the number of pending allocations is simply length + if (currentMagnitude == 0 && pos == 0) { + numPendingAllocations = length; + // if lookup found, then we take the difference between length-1 and pos + } else { + numPendingAllocations = length - pos - 1; + } + uint256 numPendingDeallocations = + _getNumQueuedDeallocations(operator, allocation.strategy, operatorSetKey); + + require( + numPendingAllocations + numPendingDeallocations < MAX_PENDING_UPDATES, + "AllocationManager._modifyAllocations: Cannot set magnitude with a pending allocation or deallocation" + ); + } + + if (allocation.magnitudes[i] < uint64(currentMagnitude)) { + // Newly configured magnitude is less than current value. + // Therefore we handle this as a deallocation + + // Note: MAX_PENDING_UPDATES == 1, so we do not have to decrement any allocations + + // 1. push PendingFreeMagnitude and respective array index into (op,opSet,Strategy) queued deallocations + uint256 index = _pendingFreeMagnitude[operator][allocation.strategy].length; + _pendingFreeMagnitude[operator][allocation.strategy].push( + PendingFreeMagnitude({ + magnitudeDiff: uint64(currentMagnitude) - allocation.magnitudes[i], + completableTimestamp: deallocationCompletableTimestamp + }) + ); + _queuedDeallocationIndices[operator][allocation.strategy][operatorSetKey].push(index); + } else if (allocation.magnitudes[i] > uint64(currentMagnitude)) { + // Newly configured magnitude is greater than current value. + // Therefore we handle this as an allocation + + // 1. allocate magnitude which will take effect in the future 21 days from now + _magnitudeUpdate[operator][allocation.strategy][operatorSetKey].push({ + key: allocationEffectTimestamp, + value: allocation.magnitudes[i] + }); + + // 2. decrement free magnitude by incremented amount + OperatorMagnitudeInfo storage info = operatorMagnitudeInfo[operator][allocation.strategy]; + require( + info.freeMagnitude >= allocation.magnitudes[i] - uint64(currentMagnitude), + "AllocationManager._modifyAllocations: insufficient available free magnitude to allocate" + ); + info.freeMagnitude -= allocation.magnitudes[i] - uint64(currentMagnitude); + } + } + } + + /** + * @notice Get the number of queued dealloations for the given (operator, strategy, operatorSetKey) tuple + * @param operator address to get queued deallocations for + * @param strategy the strategy to get queued deallocations for + * @param operatorSetKey the encoded operatorSet to get queued deallocations for + */ + function _getNumQueuedDeallocations( + address operator, + IStrategy strategy, + bytes32 operatorSetKey + ) internal view returns (uint256) { + uint256 numQueuedDeallocations; + + uint256 length = _queuedDeallocationIndices[operator][strategy][operatorSetKey].length; + + for (uint256 i = length; i > 0; --i) { + // index of pendingFreeMagnitude/deallocation to check for slashing + uint256 index = _queuedDeallocationIndices[operator][strategy][operatorSetKey][i - 1]; + PendingFreeMagnitude memory pendingFreeMagnitude = _pendingFreeMagnitude[operator][strategy][index]; + + // If completableTimestamp is greater than completeUntilTimestamp, break + if (pendingFreeMagnitude.completableTimestamp < uint32(block.timestamp)) { + ++numQueuedDeallocations; + } else { + break; + } + } + + return numQueuedDeallocations; + } + + /// @dev gets the latest total magnitude or overwrites it if it is not set + function _getLatestTotalMagnitude(address operator, IStrategy strategy) internal returns (uint64) { + (bool exists,, uint224 totalMagnitude) = _totalMagnitudeUpdate[operator][strategy].latestSnapshot(); + if (!exists) { + totalMagnitude = SlashingConstants.INITIAL_TOTAL_MAGNITUDE; + _totalMagnitudeUpdate[operator][strategy].push({key: uint32(block.timestamp), value: totalMagnitude}); + operatorMagnitudeInfo[operator][strategy].freeMagnitude = SlashingConstants.INITIAL_TOTAL_MAGNITUDE; + } + + return uint64(totalMagnitude); + } + + /// @dev gets the pending free magnitude available to add by completing numToComplete pending deallocations + /// and returns the next index to start from if completed. + function _getPendingFreeMagnitude( + address operator, + IStrategy strategy, + uint16 numToComplete, + uint192 nextIndex + ) internal view returns (uint64 freeMagnitudeToAdd, uint192 completed) { + uint256 pendingFreeMagnitudeLength = _pendingFreeMagnitude[operator][strategy].length; + uint16 completed = 0; + freeMagnitudeToAdd = 0; + while (nextIndex < pendingFreeMagnitudeLength && completed < numToComplete) { + PendingFreeMagnitude memory pendingFreeMagnitude = _pendingFreeMagnitude[operator][strategy][nextIndex]; + // pendingFreeMagnitude is ordered by completableTimestamp. If we reach one that is not completable yet, then break + // loop until completableTimestamp is < block.timestamp + if (pendingFreeMagnitude.completableTimestamp < uint32(block.timestamp)) { + break; + } + + // pending free magnitude can be added to freeMagnitude + freeMagnitudeToAdd += pendingFreeMagnitude.magnitudeDiff; + ++nextIndex; + ++completed; + } + return (freeMagnitudeToAdd, nextIndex); + } + + /** + * @param operator the operator to get the slashable magnitude for + * @param strategies the strategies to get the slashable magnitude for + * + * @return operatorSets the operator sets the operator is a member of and the current slashable magnitudes for each strategy + */ + function getCurrentSlashableMagnitudes( + address operator, + IStrategy[] calldata strategies + ) external view returns (OperatorSet[] memory, uint64[][] memory) { + OperatorSet[] memory operatorSets = avsDirectory.getOperatorSetsOfOperator(operator, 0, type(uint256).max); + uint64[][] memory slashableMagnitudes = new uint64[][](strategies.length); + for (uint256 i = 0; i < strategies.length; ++i) { + slashableMagnitudes[i] = new uint64[](operatorSets.length); + for (uint256 j = 0; j < operatorSets.length; ++j) { + slashableMagnitudes[i][j] = uint64( + _magnitudeUpdate[operator][strategies[i]][_encodeOperatorSet(operatorSets[j])].upperLookupLinear( + uint32(block.timestamp) + ) + ); + } + } + return (operatorSets, slashableMagnitudes); + } + + /** + * @param operator the operator to get the slashable magnitude for + * @param strategies the strategies to get the slashable magnitude for + * @param timestamp the timestamp to get the slashable magnitude for + * + * @return operatorSets the operator sets the operator is a member of and the slashable magnitudes for each strategy + */ + function getSlashableMagnitudes( + address operator, + IStrategy[] calldata strategies, + uint32 timestamp + ) external view returns (OperatorSet[] memory, uint64[][] memory) { + OperatorSet[] memory operatorSets = avsDirectory.getOperatorSetsOfOperator(operator, 0, type(uint256).max); + uint64[][] memory slashableMagnitudes = new uint64[][](strategies.length); + for (uint256 i = 0; i < strategies.length; ++i) { + slashableMagnitudes[i] = new uint64[](operatorSets.length); + for (uint256 j = 0; j < operatorSets.length; ++j) { + slashableMagnitudes[i][j] = uint64( + _magnitudeUpdate[operator][strategies[i]][_encodeOperatorSet(operatorSets[j])].upperLookupRecent( + timestamp + ) + ); + } + } + return (operatorSets, slashableMagnitudes); + } + + /** + * @param operator the operator to get the slashable ppm for + * @param operatorSet the operatorSet to get the slashable ppm for + * @param strategies the strategies to get the slashable ppm for + * @param timestamp the timestamp to get the slashable ppm for for + * @param linear whether the search should be linear (from the most recent) or binary + * + * @return slashablePPM the slashable ppm of the given list of strategies allocated to + * the given OperatorSet for the given operator and timestamp + */ + function getSlashablePPM( + address operator, + OperatorSet calldata operatorSet, + IStrategy[] calldata strategies, + uint32 timestamp, + bool linear + ) public view returns (uint24[] memory) { + uint24[] memory slashablePPM = new uint24[](strategies.length); + for (uint256 i = 0; i < strategies.length; ++i) { + slashablePPM[i] = _getSlashablePPM(operator, operatorSet, strategies[i], timestamp, linear); + } + return slashablePPM; + } + + function _getSlashablePPM( + address operator, + OperatorSet calldata operatorSet, + IStrategy strategy, + uint32 timestamp, + bool linear + ) public view returns (uint24) { + uint64 totalMagnitude; + if (linear) { + totalMagnitude = uint64(_totalMagnitudeUpdate[operator][strategy].upperLookupLinear(timestamp)); + } else { + totalMagnitude = uint64(_totalMagnitudeUpdate[operator][strategy].upperLookup(timestamp)); + } + // return early if totalMagnitude is 0 + if (totalMagnitude == 0) { + return 0; + } + + uint64 currentMagnitude; + bytes32 operatorSetKey = _encodeOperatorSet(operatorSet); + if (linear) { + currentMagnitude = uint64(_magnitudeUpdate[operator][strategy][operatorSetKey].upperLookupLinear(timestamp)); + } else { + currentMagnitude = uint64(_magnitudeUpdate[operator][strategy][operatorSetKey].upperLookup(timestamp)); + } + + return uint16(currentMagnitude * 1e6 / totalMagnitude); + } + + /** + * @notice Get the allocatable magnitude for an operator and strategy based on number of pending deallocations + * that could be completed at the same time. This is the sum of freeMagnitude and the sum of all pending completable deallocations. + * @param operator the operator to get the allocatable magnitude for + * @param strategy the strategy to get the allocatable magnitude for + * @param numToComplete the number of pending free magnitudes deallocations to complete + */ + function getAllocatableMagnitude( + address operator, + IStrategy strategy, + uint16 numToComplete + ) external view returns (uint64) { + OperatorMagnitudeInfo storage info = operatorMagnitudeInfo[operator][strategy]; + (uint64 freeMagnitudeToAdd,) = + _getPendingFreeMagnitude(operator, strategy, numToComplete, info.nextPendingFreeMagnitudeIndex); + return info.freeMagnitude + freeMagnitudeToAdd; + } + + /// @notice operator is slashable by operatorSet if currently registered OR last deregistered within 21 days + function isOperatorSlashable(address operator, OperatorSet memory operatorSet) public view returns (bool) { + (, uint32 lastDeregisteredTimestamp) = + avsDirectory.operatorSetStatus(operatorSet.avs, operator, operatorSet.operatorSetId); + return avsDirectory.isMember(operator, operatorSet) + || lastDeregisteredTimestamp + SlashingConstants.DEALLOCATION_DELAY >= block.timestamp; + } + + /** + * @notice Returns the current total magnitudes of an operator for a given set of strategies + * @param operator the operator to get the total magnitude for + * @param strategies the strategies to get the total magnitudes for + * @return totalMagnitudes the total magnitudes for each strategy + */ + function getTotalMagnitudes( + address operator, + IStrategy[] calldata strategies + ) external view returns (uint64[] memory) { + uint64[] memory totalMagnitudes = new uint64[](strategies.length); + for (uint256 i = 0; i < strategies.length; ++i) { + (bool exists,, uint224 value) = _totalMagnitudeUpdate[operator][strategies[i]].latestSnapshot(); + if (!exists) { + totalMagnitudes[i] = SlashingConstants.INITIAL_TOTAL_MAGNITUDE; + } else { + totalMagnitudes[i] = uint64(value); + } + } + return totalMagnitudes; + } + + /** + * @notice Returns the total magnitudes of an operator for a given set of strategies at a given timestamp + * @param operator the operator to get the total magnitude for + * @param strategies the strategies to get the total magnitudes for + * @param timestamp the timestamp to get the total magnitudes at + * @return totalMagnitudes the total magnitudes for each strategy + */ + function getTotalMagnitudesAtTimestamp( + address operator, + IStrategy[] calldata strategies, + uint32 timestamp + ) external view returns (uint64[] memory) { + uint64[] memory totalMagnitudes = new uint64[](strategies.length); + for (uint256 i = 0; i < strategies.length; ++i) { + (uint224 value, uint256 pos,) = + _totalMagnitudeUpdate[operator][strategies[i]].upperLookupRecentWithPos(timestamp); + // if there is no existing total magnitude snapshot + if (value == 0 && pos == 0) { + totalMagnitudes[i] = SlashingConstants.INITIAL_TOTAL_MAGNITUDE; + } else { + totalMagnitudes[i] = uint64(value); + } + } + return totalMagnitudes; + } + + /** + * @notice Returns the current total magnitude of an operator for a given strategy + * @param operator the operator to get the total magnitude for + * @param strategy the strategy to get the total magnitude for + * @return totalMagnitude the total magnitude for the strategy + */ + function getTotalMagnitude(address operator, IStrategy strategy) external view returns (uint64) { + uint64 totalMagnitude; + (bool exists,, uint224 value) = _totalMagnitudeUpdate[operator][strategy].latestSnapshot(); + if (!exists) { + totalMagnitude = SlashingConstants.INITIAL_TOTAL_MAGNITUDE; + } else { + totalMagnitude = uint64(value); + } + + return totalMagnitude; + } + + /** + * @notice Returns the total magnitude of an operator for a given strategy at a given timestamp + * @param operator the operator to get the total magnitude for + * @param strategy the strategy to get the total magnitude for + * @param timestamp the timestamp to get the total magnitude at + * @return totalMagnitude the total magnitude for the strategy + */ + function getTotalMagnitudeAtTimestamp( + address operator, + IStrategy strategy, + uint32 timestamp + ) external view returns (uint64) { + uint64 totalMagnitude = SlashingConstants.INITIAL_TOTAL_MAGNITUDE; + (uint224 value, uint256 pos,) = _totalMagnitudeUpdate[operator][strategy].upperLookupRecentWithPos(timestamp); + + // if there is no existing total magnitude snapshot + if (value == 0 && pos == 0) { + totalMagnitude = SlashingConstants.INITIAL_TOTAL_MAGNITUDE; + } else { + totalMagnitude = uint64(value); + } + + return totalMagnitude; + } + + /** + * @notice Returns the latest pending allocation of an operator for a given strategy and operatorSets. + * One of the assumptions here is we don't allow more than one pending allocation for an operatorSet at a time. + * If that changes, we would need to change this function to return all pending allocations for an operatorSet. + * @param operator the operator to get the pending allocations for + * @param strategy the strategy to get the pending allocations for + * @param operatorSets the operatorSets to get the pending allocations for + * @return pendingMagnitude the pending allocations for each operatorSet + * @return timestamps the timestamps for each pending allocation + */ + function getPendingAllocations( + address operator, + IStrategy strategy, + OperatorSet[] calldata operatorSets + ) external view returns (uint64[] memory, uint32[] memory) { + uint64[] memory pendingMagnitude = new uint64[](operatorSets.length); + uint32[] memory timestamps = new uint32[](operatorSets.length); + for (uint256 i = 0; i < operatorSets.length; ++i) { + // We use latestSnapshot to get the latest pending allocation for an operatorSet. + (bool exists, uint32 key, uint224 value) = + _magnitudeUpdate[operator][strategy][_encodeOperatorSet(operatorSets[i])].latestSnapshot(); + if (exists) { + if (key > block.timestamp) { + pendingMagnitude[i] = uint64(value); + timestamps[i] = key; + } else { + pendingMagnitude[i] = 0; + timestamps[i] = 0; + } + } + } + return (pendingMagnitude, timestamps); + } + + /** + * @notice Returns the pending deallocations of an operator for a given strategy and operatorSets. + * One of the assumptions here is we don't allow more than one pending deallocation for an operatorSet at a time. + * If that changes, we would need to change this function to return all pending deallocations for an operatorSet. + * @param operator the operator to get the pending deallocations for + * @param strategy the strategy to get the pending deallocations for + * @param operatorSets the operatorSets to get the pending deallocations for + * @return pendingMagnitudeDiff the pending difference in deallocations for each operatorSet + * @return timestamps the timestamps for each pending deallocation + */ + function getPendingDeallocations( + address operator, + IStrategy strategy, + OperatorSet[] calldata operatorSets + ) external view returns (uint64[] memory, uint32[] memory) { + uint64[] memory pendingMagnitudeDiff = new uint64[](operatorSets.length); + uint32[] memory timestamps = new uint32[](operatorSets.length); + for (uint256 i = 0; i < operatorSets.length; ++i) { + uint256[] memory indices = + _queuedDeallocationIndices[operator][strategy][_encodeOperatorSet(operatorSets[i])]; + uint256 length = indices.length; + uint256 deallocationIndex = indices[length - 1]; + PendingFreeMagnitude memory latestPendingMagnitude = + _pendingFreeMagnitude[operator][strategy][deallocationIndex]; + if (latestPendingMagnitude.completableTimestamp > block.timestamp) { + pendingMagnitudeDiff[i] = latestPendingMagnitude.magnitudeDiff; + timestamps[i] = latestPendingMagnitude.completableTimestamp; + } else { + // There is no pending deallocation, so we set the pending magnitude and timestamp to 0 + pendingMagnitudeDiff[i] = 0; + timestamps[i] = 0; + } + } + return (pendingMagnitudeDiff, timestamps); + } + + // /** + // * @notice fetches the minimum slashable shares for a certain operator and operatorSet for a list of strategies + // * from the current timestamp until the given timestamp + // * + // * @param operator the operator to get the minimum slashable shares for + // * @param operatorSet the operatorSet to get the minimum slashable shares for + // * @param strategies the strategies to get the minimum slashable shares for + // * @param timestamp the timestamp to the minimum slashable shares before + // * + // * @dev used to get the slashable stakes of operators to weigh over a given slashability window + // * + // * @return the list of share amounts for each strategy + // */ + // function getMinimumSlashableSharesBefore( + // address operator, + // OperatorSet calldata operatorSet, + // IStrategy[] calldata strategies, + // uint32 timestamp + // ) external view returns (uint256[] calldata) {} + + /// @dev Verify operator's signature and spend salt + function _verifyOperatorSignature( + address operator, + MagnitudeAllocation[] calldata allocations, + SignatureWithSaltAndExpiry calldata operatorSignature + ) internal { + // check the signature expiry + require( + operatorSignature.expiry >= block.timestamp, + "AllocationManager._verifyOperatorSignature: operator signature expired" + ); + // Assert operator's signature cannot be replayed. + require( + !avsDirectory.operatorSaltIsSpent(operator, operatorSignature.salt), + "AllocationManager._verifyOperatorSignature: salt spent" + ); + + bytes32 digestHash = calculateMagnitudeAllocationDigestHash( + operator, allocations, operatorSignature.salt, operatorSignature.expiry + ); + + // Assert operator's signature is valid. + EIP1271SignatureUtils.checkSignature_EIP1271(operator, digestHash, operatorSignature.signature); + // Spend salt. + operatorSaltIsSpent[operator][operatorSignature.salt] = true; + } + + /** + * @notice Calculates the digest hash to be signed by an operator to modify magnitude allocations + * @param operator The operator to allocate or deallocate magnitude for. + * @param allocations The magnitude allocations/deallocations to be made. + * @param salt A unique and single use value associated with the approver signature. + * @param expiry Time after which the approver's signature becomes invalid. + */ + function calculateMagnitudeAllocationDigestHash( + address operator, + MagnitudeAllocation[] calldata allocations, + bytes32 salt, + uint256 expiry + ) public view returns (bytes32) { + return _calculateDigestHash( + keccak256(abi.encode(MAGNITUDE_ADJUSTMENT_TYPEHASH, operator, allocations, salt, expiry)) + ); + } + + /// @notice Getter function for the current EIP-712 domain separator for this contract. + /// @dev The domain separator will change in the event of a fork that changes the ChainID. + function domainSeparator() public view override returns (bytes32) { + return _calculateDomainSeparator(); + } + + /// @notice Internal function for calculating the current domain separator of this contract + function _calculateDomainSeparator() internal view returns (bytes32) { + if (block.chainid == ORIGINAL_CHAIN_ID) { + return _DOMAIN_SEPARATOR; + } else { + return keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes("EigenLayer")), block.chainid, address(this))); + } + } + + /// @notice Returns an EIP-712 encoded hash struct. + function _calculateDigestHash( + bytes32 structHash + ) internal view returns (bytes32) { + return keccak256(abi.encodePacked("\x19\x01", _calculateDomainSeparator(), structHash)); + } + + /// @dev Returns an `OperatorSet` encoded into a 32-byte value. + /// @param operatorSet The `OperatorSet` to encode. + function _encodeOperatorSet( + OperatorSet memory operatorSet + ) internal pure returns (bytes32) { + return bytes32(abi.encodePacked(operatorSet.avs, uint96(operatorSet.operatorSetId))); + } + + /// @dev Returns an `OperatorSet` decoded from an encoded 32-byte value. + /// @param encoded The encoded `OperatorSet` to decode. + /// @dev Assumes `encoded` is encoded via `_encodeOperatorSet(operatorSet)`. + function _decodeOperatorSet( + bytes32 encoded + ) internal pure returns (OperatorSet memory) { + return OperatorSet({ + avs: address(uint160(uint256(encoded) >> 96)), + operatorSetId: uint32(uint256(encoded) & type(uint96).max) + }); + } +} diff --git a/src/contracts/core/AllocationManagerStorage.sol b/src/contracts/core/AllocationManagerStorage.sol new file mode 100644 index 000000000..e327f82a9 --- /dev/null +++ b/src/contracts/core/AllocationManagerStorage.sol @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "../interfaces/IAVSDirectory.sol"; +import "../interfaces/IAllocationManager.sol"; +import {Snapshots} from "../libraries/Snapshots.sol"; + +abstract contract AllocationManagerStorage is IAllocationManager { + using Snapshots for Snapshots.History; + + /// @notice The EIP-712 typehash for the contract's domain + bytes32 public constant DOMAIN_TYPEHASH = + keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); + + /// @notice The EIP-712 typehash for the `MagnitudeAdjustments` struct used by the contract + bytes32 public constant MAGNITUDE_ADJUSTMENT_TYPEHASH = keccak256( + "MagnitudeAdjustments(address operator,MagnitudeAdjustment(address strategy, OperatorSet(address avs, uint32 operatorSetId)[], uint64[] magnitudeDiffs)[],bytes32 salt,uint256 expiry)" + ); + + /// @notice The DelegationManager contract for EigenLayer + IDelegationManager public immutable delegation; + + /// @notice The AVSDirectory contract for EigenLayer + IAVSDirectory public immutable avsDirectory; + + /** + * @notice Original EIP-712 Domain separator for this contract. + * @dev The domain separator may change in the event of a fork that modifies the ChainID. + * Use the getter function `domainSeparator` to get the current domain separator for this contract. + */ + bytes32 internal _DOMAIN_SEPARATOR; + + /// @notice Mapping: operator => salt => Whether the salt has been used or not. + mapping(address => mapping(bytes32 => bool)) public operatorSaltIsSpent; + + /// @notice Mapping: operator => strategy => snapshotted totalMagnitude + /// Note that totalMagnitude is monotonically decreasing and only gets updated upon slashing + mapping(address => mapping(IStrategy => Snapshots.History)) internal _totalMagnitudeUpdate; + + /// @notice Mapping: operator => strategy => operatorSet (encoded) => snapshotted magnitude + mapping(address => mapping(IStrategy => mapping(bytes32 => Snapshots.History))) internal _magnitudeUpdate; + + /// @notice Mapping: operator => strategy => OperatorMagnitudeInfo to keep track of info regarding pending magnitude allocations. + mapping(address => mapping(IStrategy => OperatorMagnitudeInfo)) public operatorMagnitudeInfo; + + /// @notice Mapping: operator => strategy => PendingFreeMagnitude[] to keep track of pending free magnitude from deallocations + mapping(address => mapping(IStrategy => PendingFreeMagnitude[])) internal _pendingFreeMagnitude; + + /// @notice Mapping: operator => strategy => operatorSet (encoded) => list of queuedDeallocation indices + mapping(address => mapping(IStrategy => mapping(bytes32 => uint256[]))) internal _queuedDeallocationIndices; + + constructor(IDelegationManager _delegation, IAVSDirectory _avsDirectory) { + delegation = _delegation; + avsDirectory = _avsDirectory; + } + + /** + * @dev This empty reserved space is put in place to allow future versions to add new + * variables without shifting down storage in the inheritance chain. + * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps + */ + uint256[43] private __gap; +} diff --git a/src/contracts/core/DelegationManager.sol b/src/contracts/core/DelegationManager.sol index d4d12091a..856e9cc69 100644 --- a/src/contracts/core/DelegationManager.sol +++ b/src/contracts/core/DelegationManager.sol @@ -6,6 +6,7 @@ import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; import "@openzeppelin-upgrades/contracts/security/ReentrancyGuardUpgradeable.sol"; import "../permissions/Pausable.sol"; import "../libraries/EIP1271SignatureUtils.sol"; +import "../libraries/SlashingConstants.sol"; import "./DelegationManagerStorage.sol"; /** @@ -40,6 +41,12 @@ contract DelegationManager is // @dev Maximum Value for `stakerOptOutWindowBlocks`. Approximately equivalent to 6 months in blocks. uint256 public constant MAX_STAKER_OPT_OUT_WINDOW_BLOCKS = (180 days) / 12; + // The max configurable withdrawal delay per strategy. Set to 30 days in seconds + uint256 public constant MAX_WITHDRAWAL_DELAY = 30 days; + + // the number of 12-second blocks in 30 days (60 * 60 * 24 * 30 / 12 = 216,000) + uint256 public constant MAX_WITHDRAWAL_DELAY_BLOCKS = MAX_WITHDRAWAL_DELAY / 12; + /// @notice Canonical, virtual beacon chain ETH strategy IStrategy public constant beaconChainETHStrategy = IStrategy(0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0); @@ -64,8 +71,10 @@ contract DelegationManager is constructor( IStrategyManager _strategyManager, ISlasher _slasher, - IEigenPodManager _eigenPodManager - ) DelegationManagerStorage(_strategyManager, _slasher, _eigenPodManager) { + IEigenPodManager _eigenPodManager, + IAVSDirectory _avsDirectory, + IAllocationManager _allocationManager + ) DelegationManagerStorage(_strategyManager, _slasher, _eigenPodManager, _avsDirectory, _allocationManager) { _disableInitializers(); ORIGINAL_CHAIN_ID = block.chainid; } @@ -98,6 +107,7 @@ contract DelegationManager is /** * @notice Registers the caller as an operator in EigenLayer. * @param registeringOperatorDetails is the `OperatorDetails` for the operator. + * @param allocationDelay is a one-time configurable delay for the operator when performing slashable magnitude allocations. * @param metadataURI is a URI for the operator's metadata, i.e. a link providing more details on the operator. * * @dev Once an operator is registered, they cannot 'deregister' as an operator, and they will forever be considered "delegated to themself". @@ -106,6 +116,7 @@ contract DelegationManager is */ function registerAsOperator( OperatorDetails calldata registeringOperatorDetails, + uint32 allocationDelay, string calldata metadataURI ) external { require(!isDelegated(msg.sender), "DelegationManager.registerAsOperator: caller is already actively delegated"); @@ -113,18 +124,33 @@ contract DelegationManager is SignatureWithExpiry memory emptySignatureAndExpiry; // delegate from the operator to themselves _delegate(msg.sender, msg.sender, emptySignatureAndExpiry, bytes32(0)); + // set the allocation delay + _initializeAllocationDelay(allocationDelay); // emit events emit OperatorRegistered(msg.sender, registeringOperatorDetails); emit OperatorMetadataURIUpdated(msg.sender, metadataURI); } + /** + * @notice Called by operators to set their allocation delay one time. Cannot be updated + * after being set. This delay is required to be set for an operator to be able to allocate slashable magnitudes. + * @param delay the allocation delay in seconds + */ + function initializeAllocationDelay( + uint32 delay + ) external { + _initializeAllocationDelay(delay); + } + /** * @notice Updates an operator's stored `OperatorDetails`. * @param newOperatorDetails is the updated `OperatorDetails` for the operator, to replace their current OperatorDetails`. * * @dev The caller must have previously registered as an operator in EigenLayer. */ - function modifyOperatorDetails(OperatorDetails calldata newOperatorDetails) external { + function modifyOperatorDetails( + OperatorDetails calldata newOperatorDetails + ) external { require(isOperator(msg.sender), "DelegationManager.modifyOperatorDetails: caller must be an operator"); _setOperatorDetails(msg.sender, newOperatorDetails); } @@ -133,7 +159,9 @@ contract DelegationManager is * @notice Called by an operator to emit an `OperatorMetadataURIUpdated` event indicating the information has updated. * @param metadataURI The URI for metadata associated with an operator */ - function updateOperatorMetadataURI(string calldata metadataURI) external { + function updateOperatorMetadataURI( + string calldata metadataURI + ) external { require(isOperator(msg.sender), "DelegationManager.updateOperatorMetadataURI: caller must be an operator"); emit OperatorMetadataURIUpdated(msg.sender, metadataURI); } @@ -216,11 +244,9 @@ contract DelegationManager is * a staker from their operator. Undelegation immediately removes ALL active shares/strategies from * both the staker and operator, and places the shares and strategies in the withdrawal queue */ - function undelegate(address staker) - external - onlyWhenNotPaused(PAUSED_ENTER_WITHDRAWAL_QUEUE) - returns (bytes32[] memory withdrawalRoots) - { + function undelegate( + address staker + ) external onlyWhenNotPaused(PAUSED_ENTER_WITHDRAWAL_QUEUE) returns (bytes32[] memory withdrawalRoots) { require(isDelegated(staker), "DelegationManager.undelegate: staker must be delegated to undelegate"); require(!isOperator(staker), "DelegationManager.undelegate: operators cannot be undelegated"); require(staker != address(0), "DelegationManager.undelegate: cannot undelegate zero address"); @@ -231,7 +257,7 @@ contract DelegationManager is "DelegationManager.undelegate: caller cannot undelegate staker" ); - // Gather strategies and shares to remove from staker/operator during undelegation + // Gather strategies and shares from the staker. Caluclate scaled shares to remove from operator during undelegation // Undelegation removes ALL currently-active strategies and shares (IStrategy[] memory strategies, uint256[] memory shares) = getDelegatableShares(staker); @@ -249,18 +275,23 @@ contract DelegationManager is withdrawalRoots = new bytes32[](0); } else { withdrawalRoots = new bytes32[](strategies.length); + uint64[] memory totalMagnitudes = allocationManager.getTotalMagnitudes(operator, strategies); + for (uint256 i = 0; i < strategies.length; i++) { IStrategy[] memory singleStrategy = new IStrategy[](1); uint256[] memory singleShare = new uint256[](1); + uint64[] memory singleTotalMagnitude = new uint64[](1); singleStrategy[0] = strategies[i]; singleShare[0] = shares[i]; + singleTotalMagnitude[0] = totalMagnitudes[i]; withdrawalRoots[i] = _removeSharesAndQueueWithdrawal({ staker: staker, operator: operator, withdrawer: staker, strategies: singleStrategy, - shares: singleShare + sharesToWithdraw: singleShare, + totalMagnitudes: singleTotalMagnitude }); } } @@ -275,11 +306,9 @@ contract DelegationManager is * * All withdrawn shares/strategies are placed in a queue and can be fully withdrawn after a delay. */ - function queueWithdrawals(QueuedWithdrawalParams[] calldata queuedWithdrawalParams) - external - onlyWhenNotPaused(PAUSED_ENTER_WITHDRAWAL_QUEUE) - returns (bytes32[] memory) - { + function queueWithdrawals( + QueuedWithdrawalParams[] calldata queuedWithdrawalParams + ) external onlyWhenNotPaused(PAUSED_ENTER_WITHDRAWAL_QUEUE) returns (bytes32[] memory) { bytes32[] memory withdrawalRoots = new bytes32[](queuedWithdrawalParams.length); address operator = delegatedTo[msg.sender]; @@ -293,6 +322,9 @@ contract DelegationManager is "DelegationManager.queueWithdrawal: withdrawer must be staker" ); + uint64[] memory totalMagnitudes = + allocationManager.getTotalMagnitudes(operator, queuedWithdrawalParams[i].strategies); + // Remove shares from staker's strategies and place strategies/shares in queue. // If the staker is delegated to an operator, the operator's delegated shares are also reduced // NOTE: This will fail if the staker doesn't have the shares implied by the input parameters @@ -301,7 +333,8 @@ contract DelegationManager is operator: operator, withdrawer: queuedWithdrawalParams[i].withdrawer, strategies: queuedWithdrawalParams[i].strategies, - shares: queuedWithdrawalParams[i].shares + sharesToWithdraw: queuedWithdrawalParams[i].shares, + totalMagnitudes: totalMagnitudes }); } return withdrawalRoots; @@ -311,12 +344,9 @@ contract DelegationManager is * @notice Used to complete the specified `withdrawal`. The caller must match `withdrawal.withdrawer` * @param withdrawal The Withdrawal to complete. * @param tokens Array in which the i-th entry specifies the `token` input to the 'withdraw' function of the i-th Strategy in the `withdrawal.strategies` array. - * This input can be provided with zero length if `receiveAsTokens` is set to 'false' (since in that case, this input will be unused) - * @param middlewareTimesIndex is the index in the operator that the staker who triggered the withdrawal was delegated to's middleware times array * @param receiveAsTokens If true, the shares specified in the withdrawal will be withdrawn from the specified strategies themselves * and sent to the caller, through calls to `withdrawal.strategies[i].withdraw`. If false, then the shares in the specified strategies * will simply be transferred to the caller directly. - * @dev middlewareTimesIndex is unused, but will be used in the Slasher eventually * @dev beaconChainETHStrategy shares are non-transferrable, so if `receiveAsTokens = false` and `withdrawal.withdrawer != withdrawal.staker`, note that * any beaconChainETHStrategy shares in the `withdrawal` will be _returned to the staker_, rather than transferred to the withdrawer, unlike shares in * any other strategies, which will be transferred to the withdrawer. @@ -324,10 +354,9 @@ contract DelegationManager is function completeQueuedWithdrawal( Withdrawal calldata withdrawal, IERC20[] calldata tokens, - uint256 middlewareTimesIndex, bool receiveAsTokens ) external onlyWhenNotPaused(PAUSED_EXIT_WITHDRAWAL_QUEUE) nonReentrant { - _completeQueuedWithdrawal(withdrawal, tokens, middlewareTimesIndex, receiveAsTokens); + _completeQueuedWithdrawal(withdrawal, tokens, receiveAsTokens); } /** @@ -335,69 +364,96 @@ contract DelegationManager is * Used to complete the specified `withdrawals`. The function caller must match `withdrawals[...].withdrawer` * @param withdrawals The Withdrawals to complete. * @param tokens Array of tokens for each Withdrawal. See `completeQueuedWithdrawal` for the usage of a single array. - * @param middlewareTimesIndexes One index to reference per Withdrawal. See `completeQueuedWithdrawal` for the usage of a single index. * @param receiveAsTokens Whether or not to complete each withdrawal as tokens. See `completeQueuedWithdrawal` for the usage of a single boolean. * @dev See `completeQueuedWithdrawal` for relevant dev tags */ function completeQueuedWithdrawals( Withdrawal[] calldata withdrawals, IERC20[][] calldata tokens, - uint256[] calldata middlewareTimesIndexes, bool[] calldata receiveAsTokens ) external onlyWhenNotPaused(PAUSED_EXIT_WITHDRAWAL_QUEUE) nonReentrant { for (uint256 i = 0; i < withdrawals.length; ++i) { - _completeQueuedWithdrawal(withdrawals[i], tokens[i], middlewareTimesIndexes[i], receiveAsTokens[i]); + _completeQueuedWithdrawal(withdrawals[i], tokens[i], receiveAsTokens[i]); } } /** - * @notice Increases a staker's delegated share balance in a strategy. + * @notice Increases a staker's delegated share balance in a strategy. Note that before adding to operator shares, + * the delegated shares are scaled according to the operator's total magnitude as part of slashing accounting. + * The staker's scaling factor is updated here. * @param staker The address to increase the delegated shares for their operator. * @param strategy The strategy in which to increase the delegated shares. - * @param shares The number of shares to increase. + * @param existingShares The number of shares the staker already has in the strategy. This is the shares amount stored in the + * StrategyManager/EigenPodManager for the staker's shares. + * @param addedShares The number of shares to added to the staker's shares in the strategy. This amount will be scaled prior to adding + * to the operator's scaled shares. * - * @dev *If the staker is actively delegated*, then increases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing. + * @dev *If the staker is actively delegated*, then increases the `staker`'s delegated scaled shares in `strategy` after scaling `shares`. + * Otherwise does nothing. * @dev Callable only by the StrategyManager or EigenPodManager. */ function increaseDelegatedShares( address staker, IStrategy strategy, - uint256 shares + uint256 existingShares, + uint256 addedShares ) external onlyStrategyManagerOrEigenPodManager { // if the staker is delegated to an operator if (isDelegated(staker)) { address operator = delegatedTo[staker]; + uint64 totalMagnitude = allocationManager.getTotalMagnitude(operator, strategy); + + // update stakers scaling deposit scaling factor + uint256 newStakerScalingFactor = _calculateStakerScalingFactor({ + staker: staker, + strategy: strategy, + totalMagnitude: totalMagnitude, + existingShares: existingShares, + addedShares: addedShares + }); + stakerScalingFactors[staker][strategy] = newStakerScalingFactor; // add strategy shares to delegate's shares - _increaseOperatorShares({operator: operator, staker: staker, strategy: strategy, shares: shares}); + _increaseOperatorScaledShares({ + operator: operator, + staker: staker, + strategy: strategy, + shares: addedShares, + totalMagnitude: totalMagnitude + }); } } /** - * @notice Decreases a staker's delegated share balance in a strategy. - * @param staker The address to increase the delegated shares for their operator. - * @param strategy The strategy in which to decrease the delegated shares. - * @param shares The number of shares to decrease. + * @notice Decreases a staker's delegated share balance in a strategy. Note that before removing from operator shares, + * the delegated shares are scaled according to the operator's total magnitude as part of slashing accounting. Unlike + * `increaseDelegatedShares`, the staker's scaling factor is not updated here. + * @param staker The address to increase the delegated scaled shares for their operator. + * @param strategy The strategy in which to decrease the delegated scaled shares. + * @param removedShares The number of shares to decremented for the strategy in the + * StrategyManager/EigenPodManager * - * @dev *If the staker is actively delegated*, then decreases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing. + * @dev *If the staker is actively delegated*, then decreases the `staker`'s delegated scaled shares in `strategy` by `scaledShares`. Otherwise does nothing. * @dev Callable only by the StrategyManager or EigenPodManager. */ function decreaseDelegatedShares( address staker, IStrategy strategy, - uint256 shares + uint256 removedShares ) external onlyStrategyManagerOrEigenPodManager { // if the staker is delegated to an operator if (isDelegated(staker)) { address operator = delegatedTo[staker]; - // forgefmt: disable-next-item - // subtract strategy shares from delegate's shares - _decreaseOperatorShares({ - operator: operator, - staker: staker, - strategy: strategy, - shares: shares + uint64 totalMagnitude = allocationManager.getTotalMagnitude(operator, strategy); + + // subtract strategy shares from delegated scaled shares + _decreaseOperatorScaledShares({ + operator: operator, + staker: staker, + strategy: strategy, + shares: removedShares, + totalMagnitude: totalMagnitude }); } } @@ -406,7 +462,9 @@ contract DelegationManager is * @notice Owner-only function for modifying the value of the `minWithdrawalDelayBlocks` variable. * @param newMinWithdrawalDelayBlocks new value of `minWithdrawalDelayBlocks`. */ - function setMinWithdrawalDelayBlocks(uint256 newMinWithdrawalDelayBlocks) external onlyOwner { + function setMinWithdrawalDelayBlocks( + uint256 newMinWithdrawalDelayBlocks + ) external onlyOwner { _setMinWithdrawalDelayBlocks(newMinWithdrawalDelayBlocks); } @@ -424,6 +482,20 @@ contract DelegationManager is _setStrategyWithdrawalDelayBlocks(strategies, withdrawalDelayBlocks); } + /** + * @notice Called by owner to set the minimum withdrawal delay for each passed in strategy + * Note that the min number of blocks to complete a withdrawal of a strategy is + * MAX(minWithdrawalDelay, strategyWithdrawalDelay[strategy]) + * @param strategies The strategies to set the minimum withdrawal delay for + * @param withdrawalDelays The minimum withdrawal delay (in seconds) to set for each strategy + */ + function setStrategyWithdrawalDelay( + IStrategy[] calldata strategies, + uint256[] calldata withdrawalDelays + ) external onlyOwner { + _setStrategyWithdrawalDelay(strategies, withdrawalDelays); + } + /** * * INTERNAL FUNCTIONS @@ -448,6 +520,25 @@ contract DelegationManager is emit OperatorDetailsModified(msg.sender, newOperatorDetails); } + /** + * @notice Called by operators to set their allocation delay one time. Cannot be updated + * after being set. This delay is required to be set for an operator to be able to allocate slashable magnitudes. + * @param delay the allocation delay in seconds + */ + function _initializeAllocationDelay( + uint32 delay + ) internal { + require( + isOperator(msg.sender), + "DelegationManager._initializeAllocationDelay: operator not registered to EigenLayer yet" + ); + require( + !_operatorAllocationDelay[msg.sender].isSet, + "DelegationManager._initializeAllocationDelay: allocation delay already set" + ); + _operatorAllocationDelay[msg.sender] = AllocationDelayDetails({isSet: true, allocationDelay: delay}); + } + /** * @notice Delegates *from* a `staker` *to* an `operator`. * @param staker The address to delegate *from* -- this address is delegating control of its own assets. @@ -510,15 +601,29 @@ contract DelegationManager is delegatedTo[staker] = operator; emit StakerDelegated(staker, operator); + // read staker's delegatable shares and strategies to add to operator's scaled shares + // and also update the staker scaling factor for each strategy (IStrategy[] memory strategies, uint256[] memory shares) = getDelegatableShares(staker); + uint64[] memory totalMagnitudes = allocationManager.getTotalMagnitudes(operator, strategies); for (uint256 i = 0; i < strategies.length;) { + // update stakers scaling deposit scaling factor + uint256 newStakerScalingFactor = _calculateStakerScalingFactor({ + staker: staker, + strategy: strategies[i], + totalMagnitude: totalMagnitudes[i], + existingShares: 0, + addedShares: shares[i] + }); + stakerScalingFactors[staker][strategies[i]] = newStakerScalingFactor; + // forgefmt: disable-next-item - _increaseOperatorShares({ + _increaseOperatorScaledShares({ operator: operator, staker: staker, strategy: strategies[i], - shares: shares[i] + shares: shares[i], + totalMagnitude: totalMagnitudes[i] }); unchecked { @@ -528,13 +633,16 @@ contract DelegationManager is } /** - * @dev commented-out param (middlewareTimesIndex) is the index in the operator that the staker who triggered the withdrawal was delegated to's middleware times array - * This param is intended to be passed on to the Slasher contract, but is unused in the M2 release of these contracts, and is thus commented-out. + * @dev This function completes a queued withdrawal for a staker. + * This will apply any slashing that has occurred since the scaledShares were initially set in the Withdrawal struct up + * until the totalMagnitude at completion time. + * If receiveAsTokens is true, then these shares will be withdrawn as tokens. + * If receiveAsTokens is false, then they will be redeposited according to the current operator the staker is delegated to, + * and added back to the operator's scaledShares. */ function _completeQueuedWithdrawal( Withdrawal calldata withdrawal, IERC20[] calldata tokens, - uint256, /*middlewareTimesIndex*/ bool receiveAsTokens ) internal { bytes32 withdrawalRoot = calculateWithdrawalRoot(withdrawal); @@ -542,117 +650,207 @@ contract DelegationManager is require( pendingWithdrawals[withdrawalRoot], "DelegationManager._completeQueuedWithdrawal: action is not in queue" ); - require( - withdrawal.startBlock + minWithdrawalDelayBlocks <= block.number, - "DelegationManager._completeQueuedWithdrawal: minWithdrawalDelayBlocks period has not yet passed" + withdrawal.startTimestamp + minWithdrawalDelay <= block.number, + "DelegationManager._completeQueuedWithdrawal: minWithdrawalDelay period has not yet passed" ); - require( msg.sender == withdrawal.withdrawer, "DelegationManager._completeQueuedWithdrawal: only withdrawer can complete action" ); + require( + tokens.length == withdrawal.strategies.length, + "DelegationManager._completeQueuedWithdrawal: input length mismatch" + ); + + // read delegated operator's totalMagnitudes at time of withdrawal to scale shares again if any slashing has occurred + // during withdrawal delay period + uint64[] memory totalMagnitudes = allocationManager.getTotalMagnitudesAtTimestamp({ + operator: withdrawal.delegatedTo, + strategies: withdrawal.strategies, + timestamp: withdrawal.startTimestamp + SlashingConstants.DEALLOCATION_DELAY + }); if (receiveAsTokens) { - require( - tokens.length == withdrawal.strategies.length, - "DelegationManager._completeQueuedWithdrawal: input length mismatch" - ); + // complete the withdrawal by converting shares to tokens + _completeReceiveAsTokens(withdrawal, tokens, totalMagnitudes); + } else { + // Award shares back in StrategyManager/EigenPodManager. + _completeReceiveAsShares(withdrawal, tokens, totalMagnitudes); } // Remove `withdrawalRoot` from pending roots delete pendingWithdrawals[withdrawalRoot]; + emit WithdrawalCompleted(withdrawalRoot); + } - if (receiveAsTokens) { - // Finalize action by converting shares to tokens for each strategy, or - // by re-awarding shares in each strategy. - for (uint256 i = 0; i < withdrawal.strategies.length;) { - require( - withdrawal.startBlock + strategyWithdrawalDelayBlocks[withdrawal.strategies[i]] <= block.number, - "DelegationManager._completeQueuedWithdrawal: withdrawalDelayBlocks period has not yet passed for this strategy" - ); + /** + * @dev This function completes a queued withdrawal for a staker by converting shares to tokens and transferring to the withdrawer. + * This will apply any slashing that has occurred since the scaledShares were initially set in the Withdrawal struct + * by reading the original delegated operator's totalMagnitude at the time of withdrawal completion. + */ + function _completeReceiveAsTokens( + Withdrawal calldata withdrawal, + IERC20[] calldata tokens, + uint64[] memory totalMagnitudes + ) internal { + // Finalize action by converting scaled shares to tokens for each strategy, or + // by re-awarding shares in each strategy. + for (uint256 i = 0; i < withdrawal.strategies.length;) { + require( + withdrawal.startTimestamp + strategyWithdrawalDelays[withdrawal.strategies[i]] <= block.timestamp, + "DelegationManager._completeReceiveAsTokens: withdrawalDelay period has not yet passed for this strategy" + ); - _withdrawSharesAsTokens({ - staker: withdrawal.staker, - withdrawer: msg.sender, - strategy: withdrawal.strategies[i], - shares: withdrawal.shares[i], - token: tokens[i] - }); - unchecked { - ++i; - } + // Take already scaled staker shares and scale again according to current operator totalMagnitude + // This is because the totalMagnitude may have changed since withdrawal was queued and the staker shares + // are still susceptible to slashing + uint256 sharesToWithdraw = + _calculateSharesToCompleteWithdraw(withdrawal.scaledShares[i], totalMagnitudes[i]); + + _withdrawSharesAsTokens({ + staker: withdrawal.staker, + withdrawer: msg.sender, + strategy: withdrawal.strategies[i], + shares: sharesToWithdraw, + token: tokens[i] + }); + unchecked { + ++i; } - } else { - // Award shares back in StrategyManager/EigenPodManager. - // If withdrawer is delegated, increase the shares delegated to the operator. - address currentOperator = delegatedTo[msg.sender]; - for (uint256 i = 0; i < withdrawal.strategies.length;) { - require( - withdrawal.startBlock + strategyWithdrawalDelayBlocks[withdrawal.strategies[i]] <= block.number, - "DelegationManager._completeQueuedWithdrawal: withdrawalDelayBlocks period has not yet passed for this strategy" - ); + } + } + + /** + * @dev This function completes a queued withdrawal for a staker by receiving them back as shares + * in the StrategyManager/EigenPodManager. If the withdrawer is delegated to an operator, this will also + * increase the operator's scaled shares. + * This will apply any slashing that has occurred since the scaledShares were initially set in the Withdrawal struct + * by reading the original delegated operator's totalMagnitude at the time of withdrawal completion. + */ + function _completeReceiveAsShares( + Withdrawal calldata withdrawal, + IERC20[] calldata tokens, + uint64[] memory totalMagnitudes + ) internal { + // read delegated operator for scaling and adding shares back if needed + address currentOperator = delegatedTo[msg.sender]; + + for (uint256 i = 0; i < withdrawal.strategies.length;) { + require( + withdrawal.startTimestamp + strategyWithdrawalDelays[withdrawal.strategies[i]] <= block.number, + "DelegationManager._completeReceiveAsShares: withdrawalDelay period has not yet passed for this strategy" + ); + + // Take already scaled staker shares and scale again according to current operator totalMagnitude + // This is because the totalMagnitude may have changed since withdrawal was queued and the staker shares + // are still susceptible to slashing + uint256 shares = _calculateSharesToCompleteWithdraw(withdrawal.scaledShares[i], totalMagnitudes[i]); + + // store existing shares to calculate new staker scaling factor later + uint256 existingShares; + /** + * When awarding podOwnerShares in EigenPodManager, we need to be sure to only give them back to the original podOwner. + * Other strategy shares can + will be awarded to the withdrawer. + */ + if (withdrawal.strategies[i] == beaconChainETHStrategy) { + address staker = withdrawal.staker; /** - * When awarding podOwnerShares in EigenPodManager, we need to be sure to only give them back to the original podOwner. - * Other strategy shares can + will be awarded to the withdrawer. + * Update shares amount depending upon the returned value. + * The return value will be lower than the input value in the case where the staker has an existing share deficit */ - if (withdrawal.strategies[i] == beaconChainETHStrategy) { - address staker = withdrawal.staker; - /** - * Update shares amount depending upon the returned value. - * The return value will be lower than the input value in the case where the staker has an existing share deficit - */ - uint256 increaseInDelegateableShares = - eigenPodManager.addShares({podOwner: staker, shares: withdrawal.shares[i]}); - address podOwnerOperator = delegatedTo[staker]; - // Similar to `isDelegated` logic - if (podOwnerOperator != address(0)) { - _increaseOperatorShares({ - operator: podOwnerOperator, - // the 'staker' here is the address receiving new shares - staker: staker, - strategy: withdrawal.strategies[i], - shares: increaseInDelegateableShares - }); - } - } else { - strategyManager.addShares(msg.sender, tokens[i], withdrawal.strategies[i], withdrawal.shares[i]); - // Similar to `isDelegated` logic - if (currentOperator != address(0)) { - _increaseOperatorShares({ - operator: currentOperator, - // the 'staker' here is the address receiving new shares - staker: msg.sender, - strategy: withdrawal.strategies[i], - shares: withdrawal.shares[i] - }); - } + (shares, existingShares) = eigenPodManager.addShares({podOwner: staker, shares: shares}); + address podOwnerOperator = delegatedTo[staker]; + // Similar to `isDelegated` logic + if (podOwnerOperator != address(0)) { + _increaseOperatorScaledShares({ + operator: podOwnerOperator, + // the 'staker' here is the address receiving new shares + staker: staker, + strategy: withdrawal.strategies[i], + shares: shares, + totalMagnitude: totalMagnitudes[i] + }); } - unchecked { - ++i; + } else { + existingShares = strategyManager.addShares(msg.sender, tokens[i], withdrawal.strategies[i], shares); + // Similar to `isDelegated` logic + if (currentOperator != address(0)) { + _increaseOperatorScaledShares({ + operator: currentOperator, + // the 'staker' here is the address receiving new shares + staker: msg.sender, + strategy: withdrawal.strategies[i], + shares: shares, + totalMagnitude: totalMagnitudes[i] + }); } } - } - emit WithdrawalCompleted(withdrawalRoot); + // update stakers scaling deposit scaling factor + uint256 newStakerScalingFactor = _calculateStakerScalingFactor({ + staker: withdrawal.staker, + strategy: withdrawal.strategies[i], + totalMagnitude: totalMagnitudes[i], + existingShares: existingShares, + addedShares: shares + }); + stakerScalingFactors[withdrawal.staker][withdrawal.strategies[i]] = newStakerScalingFactor; + + unchecked { + ++i; + } + } } - // @notice Increases `operator`s delegated shares in `strategy` by `shares` and emits an `OperatorSharesIncreased` event - function _increaseOperatorShares(address operator, address staker, IStrategy strategy, uint256 shares) internal { - operatorShares[operator][strategy] += shares; - emit OperatorSharesIncreased(operator, staker, strategy, shares); + /** + * @notice Increases `operator`s delegated scaled shares in `strategy` based on staker's added shares and operator's totalMagnitude + * @param operator The operator to increase the delegated scaled shares for + * @param staker The staker to increase the delegated scaled shares for + * @param strategy The strategy to increase the delegated scaled shares for + * @param shares The shares added to the staker in the StrategyManager/EigenPodManager + * @param totalMagnitude The current total magnitude of the operator for the strategy + */ + function _increaseOperatorScaledShares( + address operator, + address staker, + IStrategy strategy, + uint256 shares, + uint64 totalMagnitude + ) internal { + // based on total magnitude, update operators scaled shares + uint256 scaledShares = _scaleShares(shares, totalMagnitude); + operatorScaledShares[operator][strategy] += scaledShares; + + // TODO: What to do about event wrt scaling? + emit OperatorSharesIncreased(operator, staker, strategy, scaledShares); } - // @notice Decreases `operator`s delegated shares in `strategy` by `shares` and emits an `OperatorSharesDecreased` event - function _decreaseOperatorShares(address operator, address staker, IStrategy strategy, uint256 shares) internal { - // This will revert on underflow, so no check needed - operatorShares[operator][strategy] -= shares; - emit OperatorSharesDecreased(operator, staker, strategy, shares); + /** + * @notice Decreases `operator`s delegated scaled shares in `strategy` based on staker's removed shares and operator's totalMagnitude + * @param operator The operator to decrease the delegated scaled shares for + * @param staker The staker to decrease the delegated scaled shares for + * @param strategy The strategy to decrease the delegated scaled shares for + * @param shares The shares removed from the staker in the StrategyManager/EigenPodManager + * @param totalMagnitude The current total magnitude of the operator for the strategy + */ + function _decreaseOperatorScaledShares( + address operator, + address staker, + IStrategy strategy, + uint256 shares, + uint64 totalMagnitude + ) internal { + // based on total magnitude, decrement operator's scaled shares + uint256 scaledShares = _scaleShares(shares, totalMagnitude); + operatorScaledShares[operator][strategy] -= scaledShares; + // TODO: What to do about event wrt scaling? + emit OperatorSharesDecreased(operator, staker, strategy, scaledShares); } /** - * @notice Removes `shares` in `strategies` from `staker` who is currently delegated to `operator` and queues a withdrawal to the `withdrawer`. + * @notice Removes `scaledShares` in `strategies` from `staker` who is currently delegated to `operator` and queues a withdrawal to the `withdrawer`. * @dev If the `operator` is indeed an operator, then the operator's delegated shares in the `strategies` are also decreased appropriately. * @dev If `withdrawer` is not the same address as `staker`, then thirdPartyTransfersForbidden[strategy] must be set to false in the StrategyManager. */ @@ -661,24 +859,52 @@ contract DelegationManager is address operator, address withdrawer, IStrategy[] memory strategies, - uint256[] memory shares + uint256[] memory sharesToWithdraw, + uint64[] memory totalMagnitudes ) internal returns (bytes32) { require( staker != address(0), "DelegationManager._removeSharesAndQueueWithdrawal: staker cannot be zero address" ); require(strategies.length != 0, "DelegationManager._removeSharesAndQueueWithdrawal: strategies cannot be empty"); + uint256[] memory scaledStakerShares = new uint256[](strategies.length); + // Remove shares from staker and operator // Each of these operations fail if we attempt to remove more shares than exist for (uint256 i = 0; i < strategies.length;) { + // check sharesToWithdraw is valid + // TODO maybe have a getter to get totalShares for all strategies, like getDelegatableShares + // but for inputted strategies + uint256 totalShares; + if (strategies[i] == beaconChainETHStrategy) { + int256 podShares = eigenPodManager.podOwnerShares(staker); + totalShares = podShares <= 0 ? 0 : uint256(podShares); + } else { + totalShares = strategyManager.stakerStrategyShares(staker, strategies[i]); + } + require( + sharesToWithdraw[i] <= _getWithdrawableShares(staker, strategies[i], totalShares, totalMagnitudes[i]), + "DelegationManager._removeSharesAndQueueWithdrawal: shares to withdraw exceeds withdrawable shares" + ); + // calculate scaledShares to place into queue withdrawal and shares to decrement from SM/EPM + uint256 stakerScalingFactor = _getStakerScalingFactor(staker, strategies[i]); + ( + // shares to decrement from StrategyManager/EigenPodManager + uint256 sharesToDecrement, + // scaledShares for staker to place into queueWithdrawal + uint256 scaledShares + ) = _calculateSharesToQueueWithdraw(sharesToWithdraw[i], stakerScalingFactor, totalMagnitudes[i]); + scaledStakerShares[i] = scaledShares; + // Similar to `isDelegated` logic if (operator != address(0)) { // forgefmt: disable-next-item - _decreaseOperatorShares({ + _decreaseOperatorScaledShares({ operator: operator, staker: staker, strategy: strategies[i], - shares: shares[i] + shares: sharesToWithdraw[i], + totalMagnitude: totalMagnitudes[i] }); } @@ -690,14 +916,14 @@ contract DelegationManager is * shares from the operator to whom the staker is delegated. * It will also revert if the share amount being withdrawn is not a whole Gwei amount. */ - eigenPodManager.removeShares(staker, shares[i]); + eigenPodManager.removeShares(staker, sharesToDecrement); } else { require( staker == withdrawer || !strategyManager.thirdPartyTransfersForbidden(strategies[i]), "DelegationManager._removeSharesAndQueueWithdrawal: withdrawer must be same address as staker if thirdPartyTransfersForbidden are set" ); - // this call will revert if `shares[i]` exceeds the Staker's current shares in `strategies[i]` - strategyManager.removeShares(staker, strategies[i], shares[i]); + // this call will revert if `scaledShares[i]` exceeds the Staker's current shares in `strategies[i]` + strategyManager.removeShares(staker, strategies[i], sharesToDecrement); } unchecked { @@ -714,9 +940,9 @@ contract DelegationManager is delegatedTo: operator, withdrawer: withdrawer, nonce: nonce, - startBlock: uint32(block.number), + startTimestamp: uint32(block.timestamp), strategies: strategies, - shares: shares + scaledShares: scaledStakerShares }); bytes32 withdrawalRoot = calculateWithdrawalRoot(withdrawal); @@ -742,11 +968,18 @@ contract DelegationManager is if (strategy == beaconChainETHStrategy) { eigenPodManager.withdrawSharesAsTokens({podOwner: staker, destination: withdrawer, shares: shares}); } else { - strategyManager.withdrawSharesAsTokens(withdrawer, strategy, shares, token); + strategyManager.withdrawSharesAsTokens({ + recipient: withdrawer, + strategy: strategy, + shares: shares, + token: token + }); } } - function _setMinWithdrawalDelayBlocks(uint256 _minWithdrawalDelayBlocks) internal { + function _setMinWithdrawalDelayBlocks( + uint256 _minWithdrawalDelayBlocks + ) internal { require( _minWithdrawalDelayBlocks <= MAX_WITHDRAWAL_DELAY_BLOCKS, "DelegationManager._setMinWithdrawalDelayBlocks: _minWithdrawalDelayBlocks cannot be > MAX_WITHDRAWAL_DELAY_BLOCKS" @@ -785,6 +1018,146 @@ contract DelegationManager is } } + /** + * @notice Sets the withdrawal delay (in seconds) for each strategy in `_strategies` to `_withdrawalDelay`. + * gets called when initializing contract or by calling `setStrategyWithdrawalDelay` + */ + function _setStrategyWithdrawalDelay( + IStrategy[] calldata _strategies, + uint256[] calldata _withdrawalDelays + ) internal { + require( + _strategies.length == _withdrawalDelays.length, + "DelegationManager._setStrategyWithdrawalDelay: input length mismatch" + ); + uint256 numStrats = _strategies.length; + for (uint256 i = 0; i < numStrats; ++i) { + IStrategy strategy = _strategies[i]; + uint256 prevStrategyWithdrawalDelay = strategyWithdrawalDelays[strategy]; + uint256 newStrategyWithdrawalDelay = _withdrawalDelays[i]; + require( + newStrategyWithdrawalDelay <= MAX_WITHDRAWAL_DELAY, + "DelegationManager._setStrategyWithdrawalDelay: _withdrawalDelay cannot be > MAX_WITHDRAWAL_DELAY" + ); + + // set the new withdrawal delay (in seconds) + strategyWithdrawalDelays[strategy] = newStrategyWithdrawalDelay; + emit StrategyWithdrawalDelaySet(strategy, prevStrategyWithdrawalDelay, newStrategyWithdrawalDelay); + } + } + + /** + * + * SLASHING AND SHARES HELPER FUNCTIONS + * + */ + + /** + * @notice helper pure to calculate the scaledShares to store in queue withdrawal + * and the shares to decrement from StrategyManager/EigenPodManager + */ + function _calculateSharesToQueueWithdraw( + uint256 sharesToWithdraw, + uint256 stakerScalingFactor, + uint64 totalMagnitude + ) internal pure returns (uint256 sharesToDecrement, uint256 scaledStakerShares) { + // TODO: DOUBLE CHECK THIS BEHAVIOR + // NOTE that to prevent numerator overflow, the max sharesToWithdraw is + // x*1e36 <= 2^256-1 + // => x <= 1.1579e41 + sharesToDecrement = + (sharesToWithdraw * SlashingConstants.PRECISION_FACTOR_SQUARED) / (stakerScalingFactor * totalMagnitude); + scaledStakerShares = sharesToWithdraw * stakerScalingFactor / SlashingConstants.PRECISION_FACTOR; + return (sharesToDecrement, scaledStakerShares); + } + + /** + * @notice helper pure to calculate the shares to complete a withdrawal after slashing + * We use the totalMagnitude of the delegated operator at the time of withdrawal completion to scale the shares + * back to real StrategyManager/EigenPodManager shares + */ + function _calculateSharesToCompleteWithdraw( + uint256 scaledStakerShares, + uint64 totalMagnitudeAtCompletion + ) internal pure returns (uint256 shares) { + shares = scaledStakerShares * totalMagnitudeAtCompletion / SlashingConstants.PRECISION_FACTOR; + } + + /** + * @notice helper pure to return scaledShares given shares and current totalMagnitude. Used for + * adding/removing staker shares from operatorScaledShares + */ + function _scaleShares(uint256 shares, uint64 totalMagnitude) internal pure returns (uint256) { + return shares * SlashingConstants.PRECISION_FACTOR / totalMagnitude; + } + + /** + * @notice helper pure to return real strategy shares given operator scaledShares and current totalMagnitude. + * Used for returning the total delegated shares for an operator and strategy + */ + function _descaleShares(uint256 scaledShares, uint64 totalMagnitude) internal pure returns (uint256) { + return scaledShares * totalMagnitude / SlashingConstants.PRECISION_FACTOR; + } + + /** + * @notice staker scaling factor should be initialized and lower bounded to 1e18 + */ + function _getStakerScalingFactor(address staker, IStrategy strategy) internal view returns (uint256) { + uint256 currStakerScalingFactor = stakerScalingFactors[staker][strategy]; + if (currStakerScalingFactor == 0) { + currStakerScalingFactor = SlashingConstants.PRECISION_FACTOR; + } + return currStakerScalingFactor; + } + + /** + * @notice helper to calculate the new staker scaling factor after adding shares. This is only used + * when a staker is depositing through the StrategyManager or EigenPodManager. A stakers scaling factor + * is only updated when they have new deposits and their shares are being increased. + */ + function _calculateStakerScalingFactor( + address staker, + IStrategy strategy, + uint64 totalMagnitude, + uint256 existingShares, + uint256 addedShares + ) internal view returns (uint256) { + uint256 newStakerScalingFactor; + + if (existingShares == 0) { + // existing shares are 0, meaning no existing delegated shares. In this case, the new staker scaling factor + // is re-initialized to + newStakerScalingFactor = SlashingConstants.PRECISION_FACTOR / (totalMagnitude); + } else { + uint256 currStakerScalingFactor = _getStakerScalingFactor(staker, strategy); + + // TODO: DOUBLE CHECK THIS BEHAVIOR AND OVERFLOWS + // staker scaling factor is initialized to PRECISION_FACTOR(1e18) and totalMagnitude is initialized to INITIAL_TOTAL_MAGNITUDE(1e18) + // and is monotonically decreasing. You can deduce that the newStakerScalingFactor will never decrease to less than the PRECISION_FACTOR + // so this won't round to 0. + newStakerScalingFactor = ( + currStakerScalingFactor * existingShares * totalMagnitude / SlashingConstants.PRECISION_FACTOR + + addedShares * SlashingConstants.PRECISION_FACTOR + ) / ((existingShares + addedShares) * totalMagnitude); + } + + return newStakerScalingFactor; + } + + /** + * @notice helper to calculate the withdrawable shares for a staker given their shares and the + * current totalMagnitude. `shares` should be the staker's shares in storage in the StrategyManager/EigenPodManager. + */ + function _getWithdrawableShares( + address staker, + IStrategy strategy, + uint256 shares, + uint64 currTotalMagnitude + ) internal view returns (uint256) { + uint256 stakerScalingFactor = _getStakerScalingFactor(staker, strategy); + return stakerScalingFactor * shares * currTotalMagnitude / SlashingConstants.PRECISION_FACTOR; + } + /** * * VIEW FUNCTIONS @@ -809,56 +1182,105 @@ contract DelegationManager is /** * @notice Returns 'true' if `staker` *is* actively delegated, and 'false' otherwise. */ - function isDelegated(address staker) public view returns (bool) { + function isDelegated( + address staker + ) public view returns (bool) { return (delegatedTo[staker] != address(0)); } /** * @notice Returns true is an operator has previously registered for delegation. */ - function isOperator(address operator) public view returns (bool) { + function isOperator( + address operator + ) public view returns (bool) { return operator != address(0) && delegatedTo[operator] == operator; } /** * @notice Returns the OperatorDetails struct associated with an `operator`. */ - function operatorDetails(address operator) external view returns (OperatorDetails memory) { + function operatorDetails( + address operator + ) external view returns (OperatorDetails memory) { return _operatorDetails[operator]; } + /** + * @notice Returns the AllocationDelayDetails struct associated with an `operator` + * @dev If the operator has not set an allocation delay, then the `isSet` field will be `false`. + */ + function operatorAllocationDelay( + address operator + ) external view returns (AllocationDelayDetails memory) { + return _operatorAllocationDelay[operator]; + } + /** * @notice Returns the delegationApprover account for an operator */ - function delegationApprover(address operator) external view returns (address) { + function delegationApprover( + address operator + ) external view returns (address) { return _operatorDetails[operator].delegationApprover; } /** * @notice Returns the stakerOptOutWindowBlocks for an operator */ - function stakerOptOutWindowBlocks(address operator) external view returns (uint256) { + function stakerOptOutWindowBlocks( + address operator + ) external view returns (uint256) { return _operatorDetails[operator].stakerOptOutWindowBlocks; } - /// @notice Given array of strategies, returns array of shares for the operator - function getOperatorShares( - address operator, - IStrategy[] memory strategies - ) public view returns (uint256[] memory) { - uint256[] memory shares = new uint256[](strategies.length); + /// @notice a legacy function that returns the total delegated shares for an operator and strategy + function operatorShares(address operator, IStrategy strategy) public view returns (uint256) { + uint64 totalMagnitude = allocationManager.getTotalMagnitude(operator, strategy); + return _descaleShares(operatorScaledShares[operator][strategy], totalMagnitude); + } + + /** + * @notice Given a staker and scaled shares amounts of deposits, return the shares calculated if + * the staker were to withdraw. This value depends on which operator the staker is delegated to. + * The shares amount returned is the actual amount of Strategy shares the staker would receive (subject + * to each strategy's underlying shares to token ratio). + */ + function getWithdrawableStakerShares( + address staker, + IStrategy[] calldata strategies + ) external view returns (uint256[] memory shares) { + address operator = delegatedTo[staker]; for (uint256 i = 0; i < strategies.length; ++i) { - shares[i] = operatorShares[operator][strategies[i]]; + // 1. read strategy shares + if (strategies[i] == beaconChainETHStrategy) { + int256 podShares = eigenPodManager.podOwnerShares(staker); + shares[i] = podShares <= 0 ? 0 : uint256(podShares); + } else { + shares[i] = strategyManager.stakerStrategyShares(staker, strategies[i]); + } + + // 2. if the staker is delegated, actual withdrawable shares can be different from what is stored + // in the StrategyManager/EigenPodManager because they could have been slashed + if (operator != address(0)) { + uint64 totalMagnitude = allocationManager.getTotalMagnitude(operator, strategies[i]); + shares[i] = _getWithdrawableShares(staker, strategies[i], shares[i], totalMagnitude); + } } return shares; } /** * @notice Returns the number of actively-delegatable shares a staker has across all strategies. + * NOTE: If you are delegated to an operator and have been slashed, these values won't be your real actual + * delegatable shares! * @dev Returns two empty arrays in the case that the Staker has no actively-delegateable shares. */ - function getDelegatableShares(address staker) public view returns (IStrategy[] memory, uint256[] memory) { - // Get currently active shares and strategies for `staker` + function getDelegatableShares( + address staker + ) public view returns (IStrategy[] memory, uint256[] memory) { + // Get current StrategyManager/EigenPodManager shares and strategies for `staker` + // If `staker` is already delegated, these may not be the full withdrawable amounts due to slashing int256 podShares = eigenPodManager.podOwnerShares(staker); (IStrategy[] memory strategyManagerStrats, uint256[] memory strategyManagerShares) = strategyManager.getDeposits(staker); @@ -879,7 +1301,7 @@ contract DelegationManager is shares[0] = uint256(podShares); } else { // Has shares in both - + // TODO: make more efficient by resizing array // 1. Allocate return arrays strategies = new IStrategy[](strategyManagerStrats.length + 1); shares = new uint256[](strategies.length); @@ -907,7 +1329,9 @@ contract DelegationManager is * from all the inputted strategies. Return value is >= minWithdrawalDelayBlocks as this is the global min withdrawal delay. * @param strategies The strategies to check withdrawal delays for */ - function getWithdrawalDelay(IStrategy[] calldata strategies) public view returns (uint256) { + function getWithdrawalDelay( + IStrategy[] calldata strategies + ) public view returns (uint256) { uint256 withdrawalDelay = minWithdrawalDelayBlocks; for (uint256 i = 0; i < strategies.length; ++i) { uint256 currWithdrawalDelay = strategyWithdrawalDelayBlocks[strategies[i]]; @@ -919,7 +1343,9 @@ contract DelegationManager is } /// @notice Returns the keccak256 hash of `withdrawal`. - function calculateWithdrawalRoot(Withdrawal memory withdrawal) public pure returns (bytes32) { + function calculateWithdrawalRoot( + Withdrawal memory withdrawal + ) public pure returns (bytes32) { return keccak256(abi.encode(withdrawal)); } diff --git a/src/contracts/core/DelegationManagerStorage.sol b/src/contracts/core/DelegationManagerStorage.sol index 00fc5b4ac..4cd01ca48 100644 --- a/src/contracts/core/DelegationManagerStorage.sol +++ b/src/contracts/core/DelegationManagerStorage.sol @@ -4,7 +4,9 @@ pragma solidity ^0.8.12; import "../interfaces/IStrategyManager.sol"; import "../interfaces/IDelegationManager.sol"; import "../interfaces/ISlasher.sol"; +import "../interfaces/IAVSDirectory.sol"; import "../interfaces/IEigenPodManager.sol"; +import "../interfaces/IAllocationManager.sol"; /** * @title Storage variables for the `DelegationManager` contract. @@ -33,6 +35,9 @@ abstract contract DelegationManagerStorage is IDelegationManager { */ bytes32 internal _DOMAIN_SEPARATOR; + /// @notice The AVSDirectory contract for EigenLayer + IAVSDirectory public immutable avsDirectory; + /// @notice The StrategyManager contract for EigenLayer IStrategyManager public immutable strategyManager; @@ -42,17 +47,19 @@ abstract contract DelegationManagerStorage is IDelegationManager { /// @notice The EigenPodManager contract for EigenLayer IEigenPodManager public immutable eigenPodManager; - // the number of 12-second blocks in 30 days (60 * 60 * 24 * 30 / 12 = 216,000) - uint256 public constant MAX_WITHDRAWAL_DELAY_BLOCKS = 216_000; + /// @notice The AllocationManager contract for EigenLayer + IAllocationManager public immutable allocationManager; /** - * @notice returns the total number of shares in `strategy` that are delegated to `operator`. - * @notice Mapping: operator => strategy => total number of shares in the strategy delegated to the operator. + * @notice returns the total number of scaled shares (i.e. shares scaled down by a factor of the `operator`'s + * totalMagnitude) in `strategy` that are delegated to `operator`. + * @notice Mapping: operator => strategy => total number of scaled shares in the strategy delegated to the operator. * @dev By design, the following invariant should hold for each Strategy: - * (operator's shares in delegation manager) = sum (shares above zero of all stakers delegated to operator) - * = sum (delegateable shares of all stakers delegated to the operator) + * (operator's scaled shares in delegation manager) = sum (scaled shares above zero of all stakers delegated to operator) + * = sum (delegateable scaled shares of all stakers delegated to the operator) + * @dev FKA `operatorShares` */ - mapping(address => mapping(IStrategy => uint256)) public operatorShares; + mapping(address => mapping(IStrategy => uint256)) public operatorScaledShares; /** * @notice Mapping: operator => OperatorDetails struct @@ -102,10 +109,42 @@ abstract contract DelegationManagerStorage is IDelegationManager { */ mapping(IStrategy => uint256) public strategyWithdrawalDelayBlocks; - constructor(IStrategyManager _strategyManager, ISlasher _slasher, IEigenPodManager _eigenPodManager) { + /** + * @notice Global minimum withdrawal delay for all strategy withdrawals. + * NOTE: This is used equivalently to minWithdrawalDelayBlocks and strategyWithdrawalDelayBlocks but + * using timestamps instead in the Slashing release. + * In addition, we now also configure withdrawal delays on a per-strategy basis. + * To withdraw from a strategy, max(minWithdrawalDelay, strategyWithdrawalDelay[strategy]) number of seconds must have passed. + * See mapping strategyWithdrawalDelay below for per-strategy withdrawal delays. + */ + uint256 public minWithdrawalDelay; + + /** + * @notice Minimum delay enforced by this contract per Strategy for completing queued withdrawals. Measured in seconds, and adjustable by this contract's owner, + * up to a maximum of `MAX_WITHDRAWAL_DELAY`. Minimum value is 0 (i.e. no delay enforced). + */ + mapping(IStrategy => uint256) public strategyWithdrawalDelays; + + /// @notice Mapping: staker => strategy => scaling factor used to calculate the staker's withdrawable shares in the strategy. + /// This is updated upon each deposit based on the staker's currently delegated operator's totalMagnitude. + mapping(address => mapping(IStrategy => uint256)) public stakerScalingFactors; + + /// @notice Mapping: operator => allocation delay (in seconds) for the operator. + /// This determines how long it takes for allocations to take effect in the future. Can only be set one time for each operator + mapping(address => AllocationDelayDetails) internal _operatorAllocationDelay; + + constructor( + IStrategyManager _strategyManager, + ISlasher _slasher, + IEigenPodManager _eigenPodManager, + IAVSDirectory _avsDirectory, + IAllocationManager _allocationManager + ) { strategyManager = _strategyManager; eigenPodManager = _eigenPodManager; slasher = _slasher; + avsDirectory = _avsDirectory; + allocationManager = _allocationManager; } /** @@ -113,5 +152,5 @@ abstract contract DelegationManagerStorage is IDelegationManager { * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[39] private __gap; + uint256[37] private __gap; } diff --git a/src/contracts/core/RewardsCoordinator.sol b/src/contracts/core/RewardsCoordinator.sol index 562df4cb7..5c7176dc5 100644 --- a/src/contracts/core/RewardsCoordinator.sol +++ b/src/contracts/core/RewardsCoordinator.sol @@ -34,6 +34,10 @@ contract RewardsCoordinator is uint256 internal immutable ORIGINAL_CHAIN_ID; /// @notice The maximum rewards token amount for a single rewards submission, constrained by off-chain calculation uint256 internal constant MAX_REWARDS_AMOUNT = 1e38 - 1; + /// @notice The activation delay until an updated operator's commission bips takes effect + uint32 internal constant OPERATOR_COMMISSION_ACTIVATION_DELAY = 7 days; + /// @notice The maximum commission bips that can be set for an operator + uint16 internal constant MAX_COMMISSION_BIPS = 10_000; /// @dev Index for flag that pauses calling createAVSRewardsSubmission uint8 internal constant PAUSED_AVS_REWARDS_SUBMISSION = 0; @@ -43,6 +47,8 @@ contract RewardsCoordinator is uint8 internal constant PAUSED_PROCESS_CLAIM = 2; /// @dev Index for flag that pauses submitRoots and disableRoot uint8 internal constant PAUSED_SUBMIT_DISABLE_ROOTS = 3; + /// @dev Index for flag that pauses calling rewardOperatorSetForRange + uint8 internal constant PAUSED_REWARD_OPERATOR_SET = 4; /// @dev Salt for the earner leaf, meant to distinguish from tokenLeaf since they have the same sized data uint8 internal constant EARNER_LEAF_SALT = 0; @@ -69,20 +75,26 @@ contract RewardsCoordinator is constructor( IDelegationManager _delegationManager, IStrategyManager _strategyManager, + IAVSDirectory _avsDirectory, uint32 _CALCULATION_INTERVAL_SECONDS, uint32 _MAX_REWARDS_DURATION, uint32 _MAX_RETROACTIVE_LENGTH, uint32 _MAX_FUTURE_LENGTH, - uint32 __GENESIS_REWARDS_TIMESTAMP + uint32 _GENESIS_REWARDS_TIMESTAMP, + uint32 _OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + uint32 _OPERATOR_SET_MAX_RETROACTIVE_LENGTH ) RewardsCoordinatorStorage( _delegationManager, _strategyManager, + _avsDirectory, _CALCULATION_INTERVAL_SECONDS, _MAX_REWARDS_DURATION, _MAX_RETROACTIVE_LENGTH, _MAX_FUTURE_LENGTH, - __GENESIS_REWARDS_TIMESTAMP + _GENESIS_REWARDS_TIMESTAMP, + _OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + _OPERATOR_SET_MAX_RETROACTIVE_LENGTH ) { _disableInitializers(); @@ -116,7 +128,9 @@ contract RewardsCoordinator is */ /** - * @notice Creates a new rewards submission on behalf of an AVS, to be split amongst the + * @notice Legacy interface to be DEPRECATED in future releases. See rewardOperatorSetForRange + * for a more updated interface. + * Creates a new rewards submission on behalf of an AVS, to be split amongst the * set of stakers delegated to operators who are registered to the `avs` * @param rewardsSubmissions The rewards submissions being created * @dev Expected to be called by the ServiceManager of the AVS on behalf of which the submission is being made @@ -126,23 +140,33 @@ contract RewardsCoordinator is * @dev This function will revert if the `rewardsSubmission` is malformed, * e.g. if the `strategies` and `weights` arrays are of non-equal lengths */ - function createAVSRewardsSubmission(RewardsSubmission[] calldata rewardsSubmissions) - external - onlyWhenNotPaused(PAUSED_AVS_REWARDS_SUBMISSION) - nonReentrant - { - for (uint256 i = 0; i < rewardsSubmissions.length; i++) { + function createAVSRewardsSubmission( + RewardsSubmission[] calldata rewardsSubmissions + ) external onlyWhenNotPaused(PAUSED_AVS_REWARDS_SUBMISSION) nonReentrant { + for (uint256 i = 0; i < rewardsSubmissions.length;) { RewardsSubmission calldata rewardsSubmission = rewardsSubmissions[i]; uint256 nonce = submissionNonce[msg.sender]; bytes32 rewardsSubmissionHash = keccak256(abi.encode(msg.sender, nonce, rewardsSubmission)); - _validateRewardsSubmission(rewardsSubmission); + _validateRewardsSubmission( + rewardsSubmission.strategiesAndMultipliers, + rewardsSubmission.token, + rewardsSubmission.amount, + rewardsSubmission.startTimestamp, + rewardsSubmission.duration, + MAX_RETROACTIVE_LENGTH, + GENESIS_REWARDS_TIMESTAMP + ); isAVSRewardsSubmissionHash[msg.sender][rewardsSubmissionHash] = true; submissionNonce[msg.sender] = nonce + 1; emit AVSRewardsSubmissionCreated(msg.sender, nonce, rewardsSubmissionHash, rewardsSubmission); rewardsSubmission.token.safeTransferFrom(msg.sender, address(this), rewardsSubmission.amount); + + unchecked { + ++i; + } } } @@ -152,24 +176,80 @@ contract RewardsCoordinator is * a permissioned call based on isRewardsForAllSubmitter mapping. * @param rewardsSubmissions The rewards submissions being created */ - function createRewardsForAllSubmission(RewardsSubmission[] calldata rewardsSubmissions) - external - onlyWhenNotPaused(PAUSED_REWARDS_FOR_ALL_SUBMISSION) - onlyRewardsForAllSubmitter - nonReentrant - { - for (uint256 i = 0; i < rewardsSubmissions.length; i++) { + function createRewardsForAllSubmission( + RewardsSubmission[] calldata rewardsSubmissions + ) external onlyWhenNotPaused(PAUSED_REWARDS_FOR_ALL_SUBMISSION) onlyRewardsForAllSubmitter nonReentrant { + for (uint256 i = 0; i < rewardsSubmissions.length;) { RewardsSubmission calldata rewardsSubmission = rewardsSubmissions[i]; uint256 nonce = submissionNonce[msg.sender]; bytes32 rewardsSubmissionForAllHash = keccak256(abi.encode(msg.sender, nonce, rewardsSubmission)); - _validateRewardsSubmission(rewardsSubmission); + _validateRewardsSubmission( + rewardsSubmission.strategiesAndMultipliers, + rewardsSubmission.token, + rewardsSubmission.amount, + rewardsSubmission.startTimestamp, + rewardsSubmission.duration, + MAX_RETROACTIVE_LENGTH, + GENESIS_REWARDS_TIMESTAMP + ); isRewardsSubmissionForAllHash[msg.sender][rewardsSubmissionForAllHash] = true; submissionNonce[msg.sender] = nonce + 1; emit RewardsSubmissionForAllCreated(msg.sender, nonce, rewardsSubmissionForAllHash, rewardsSubmission); rewardsSubmission.token.safeTransferFrom(msg.sender, address(this), rewardsSubmission.amount); + + unchecked { + ++i; + } + } + } + + /** + * @notice Creates a new rewards submission on behalf of an AVS for a given operatorSet, + * to be split amongst the set of stakers delegated to operators who are + * registered to the msg.sender AVS and the given operatorSetId + * + * @param rewardsSubmissions The operatorSet rewards submission being created for + * + * @dev msg.sender is the AVS in the operatorSet the rewards submission is being made to + * @dev AVSs set their reward type depending on what metric they want rewards + * distributed proportional to + * @dev The tokens in the rewards submissions are sent to the `RewardsCoordinator` contract + * @dev Strategies of each rewards submission must be in ascending order of addresses to check for duplicates + */ + function rewardOperatorSetForRange( + OperatorSetRewardsSubmission[] calldata rewardsSubmissions + ) external onlyWhenNotPaused(PAUSED_REWARD_OPERATOR_SET) nonReentrant { + for (uint256 i = 0; i < rewardsSubmissions.length;) { + OperatorSetRewardsSubmission calldata rewardsSubmission = rewardsSubmissions[i]; + uint256 nonce = submissionNonce[msg.sender]; + bytes32 rewardsSubmissionHash = keccak256(abi.encode(msg.sender, nonce, rewardsSubmission)); + + require( + avsDirectory.isOperatorSet(msg.sender, rewardsSubmission.operatorSetId), + "RewardsCoordinator.rewardOperatorSetForRange: invalid operatorSet" + ); + _validateRewardsSubmission( + rewardsSubmission.strategiesAndMultipliers, + rewardsSubmission.token, + rewardsSubmission.amount, + rewardsSubmission.startTimestamp, + rewardsSubmission.duration, + OPERATOR_SET_MAX_RETROACTIVE_LENGTH, + OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP + ); + + isAVSRewardsSubmissionHash[msg.sender][rewardsSubmissionHash] = true; + submissionNonce[msg.sender] = nonce + 1; + + emit OperatorSetRewardCreated(msg.sender, nonce, rewardsSubmissionHash, rewardsSubmission); + rewardsSubmission.token.safeTransferFrom(msg.sender, address(this), rewardsSubmission.amount); + + unchecked { + ++i; + } } } @@ -198,7 +278,7 @@ contract RewardsCoordinator is claimer = earner; } require(msg.sender == claimer, "RewardsCoordinator.processClaim: caller is not valid claimer"); - for (uint256 i = 0; i < claim.tokenIndices.length; i++) { + for (uint256 i = 0; i < claim.tokenIndices.length; ++i) { TokenTreeMerkleLeaf calldata tokenLeaf = claim.tokenLeaves[i]; uint256 currCumulativeClaimed = cumulativeClaimed[earner][tokenLeaf.token]; @@ -252,7 +332,9 @@ contract RewardsCoordinator is * @notice allow the rewardsUpdater to disable/cancel a pending root submission in case of an error * @param rootIndex The index of the root to be disabled */ - function disableRoot(uint32 rootIndex) external onlyWhenNotPaused(PAUSED_SUBMIT_DISABLE_ROOTS) onlyRewardsUpdater { + function disableRoot( + uint32 rootIndex + ) external onlyWhenNotPaused(PAUSED_SUBMIT_DISABLE_ROOTS) onlyRewardsUpdater { require(rootIndex < _distributionRoots.length, "RewardsCoordinator.disableRoot: invalid rootIndex"); DistributionRoot storage root = _distributionRoots[rootIndex]; require(!root.disabled, "RewardsCoordinator.disableRoot: root already disabled"); @@ -266,19 +348,59 @@ contract RewardsCoordinator is * @param claimer The address of the entity that can call `processClaim` on behalf of the earner * @dev Only callable by the `earner` */ - function setClaimerFor(address claimer) external { + function setClaimerFor( + address claimer + ) external { address earner = msg.sender; address prevClaimer = claimerFor[earner]; claimerFor[earner] = claimer; emit ClaimerForSet(earner, prevClaimer, claimer); } + /** + * @notice Sets the commission an operator takes in bips for a given reward type and operatorSet + * @param operatorSet The operatorSet to update commission for + * @param rewardType The associated rewardType to update commission for + * @param commissionBips The commission in bips for the operator, must be <= MAX_COMMISSION_BIPS + * @return effectTimestamp The timestamp at which the operator commission update will take effect + * + * @dev The commission can range from 1 to 10000 + * @dev The commission update takes effect after 7 days + */ + function setOperatorCommissionBips( + OperatorSet calldata operatorSet, + RewardType rewardType, + uint16 commissionBips + ) external returns (uint32 effectTimestamp) { + require( + commissionBips <= MAX_COMMISSION_BIPS, + "RewardsCoordinator.setOperatorCommissionBips: commissionBips too high" + ); + effectTimestamp = uint32(block.timestamp + OPERATOR_COMMISSION_ACTIVATION_DELAY); + OperatorCommissionUpdate[] storage commissionHistory = + operatorCommissionUpdates[msg.sender][operatorSet.avs][operatorSet.operatorSetId][rewardType]; + uint256 updateLength = commissionHistory.length; + + // If no updates or latest update is not for current effective timestamp, push a new commission update + // otherwise modify current storage + if (updateLength == 0 || commissionHistory[updateLength - 1].effectTimestamp != effectTimestamp) { + commissionHistory.push( + OperatorCommissionUpdate({commissionBips: commissionBips, effectTimestamp: effectTimestamp}) + ); + } else { + commissionHistory[updateLength - 1].commissionBips = commissionBips; + } + emit OperatorCommissionUpdated(msg.sender, operatorSet, rewardType, commissionBips, effectTimestamp); + } + /** * @notice Sets the delay in timestamp before a posted root can be claimed against * @dev Only callable by the contract owner * @param _activationDelay The new value for activationDelay */ - function setActivationDelay(uint32 _activationDelay) external onlyOwner { + function setActivationDelay( + uint32 _activationDelay + ) external onlyOwner { _setActivationDelay(_activationDelay); } @@ -287,7 +409,9 @@ contract RewardsCoordinator is * @dev Only callable by the contract owner * @param _globalCommissionBips The commission for all operators across all avss */ - function setGlobalOperatorCommission(uint16 _globalCommissionBips) external onlyOwner { + function setGlobalOperatorCommission( + uint16 _globalCommissionBips + ) external onlyOwner { _setGlobalOperatorCommission(_globalCommissionBips); } @@ -296,7 +420,9 @@ contract RewardsCoordinator is * @dev Only callable by the contract owner * @param _rewardsUpdater The address of the new rewardsUpdater */ - function setRewardsUpdater(address _rewardsUpdater) external onlyOwner { + function setRewardsUpdater( + address _rewardsUpdater + ) external onlyOwner { _setRewardsUpdater(_rewardsUpdater); } @@ -319,44 +445,49 @@ contract RewardsCoordinator is */ /** - * @notice Validate a RewardsSubmission. Called from both `createAVSRewardsSubmission` and `createRewardsForAllSubmission` + * @notice Validate a RewardsSubmission. Called from `createAVSRewardsSubmission`, `createRewardsForAllSubmission`, + * and `rewardOperatorSetForRange` + * + * @dev The callee must specify the `retroactiveLength` and `genesisRewardsTimestamp` as those values + * are different depending on the rewards submission type. */ - function _validateRewardsSubmission(RewardsSubmission calldata rewardsSubmission) internal view { - require( - rewardsSubmission.strategiesAndMultipliers.length > 0, - "RewardsCoordinator._validateRewardsSubmission: no strategies set" - ); - require(rewardsSubmission.amount > 0, "RewardsCoordinator._validateRewardsSubmission: amount cannot be 0"); + function _validateRewardsSubmission( + StrategyAndMultiplier[] calldata strategiesAndMultipliers, + IERC20 token, + uint256 amount, + uint32 startTimestamp, + uint32 duration, + uint32 maxRetroactiveLength, + uint32 genesisRewardsTimestamp + ) internal view { + require(strategiesAndMultipliers.length > 0, "RewardsCoordinator._validateRewardsSubmission: no strategies set"); + require(amount > 0, "RewardsCoordinator._validateRewardsSubmission: amount cannot be 0"); + require(amount <= MAX_REWARDS_AMOUNT, "RewardsCoordinator._validateRewardsSubmission: amount too large"); require( - rewardsSubmission.amount <= MAX_REWARDS_AMOUNT, - "RewardsCoordinator._validateRewardsSubmission: amount too large" - ); - require( - rewardsSubmission.duration <= MAX_REWARDS_DURATION, + duration <= MAX_REWARDS_DURATION, "RewardsCoordinator._validateRewardsSubmission: duration exceeds MAX_REWARDS_DURATION" ); require( - rewardsSubmission.duration % CALCULATION_INTERVAL_SECONDS == 0, + duration % CALCULATION_INTERVAL_SECONDS == 0, "RewardsCoordinator._validateRewardsSubmission: duration must be a multiple of CALCULATION_INTERVAL_SECONDS" ); require( - rewardsSubmission.startTimestamp % CALCULATION_INTERVAL_SECONDS == 0, + startTimestamp % CALCULATION_INTERVAL_SECONDS == 0, "RewardsCoordinator._validateRewardsSubmission: startTimestamp must be a multiple of CALCULATION_INTERVAL_SECONDS" ); require( - block.timestamp - MAX_RETROACTIVE_LENGTH <= rewardsSubmission.startTimestamp - && GENESIS_REWARDS_TIMESTAMP <= rewardsSubmission.startTimestamp, + block.timestamp - maxRetroactiveLength <= startTimestamp && genesisRewardsTimestamp <= startTimestamp, "RewardsCoordinator._validateRewardsSubmission: startTimestamp too far in the past" ); require( - rewardsSubmission.startTimestamp <= block.timestamp + MAX_FUTURE_LENGTH, + startTimestamp <= block.timestamp + MAX_FUTURE_LENGTH, "RewardsCoordinator._validateRewardsSubmission: startTimestamp too far in the future" ); // Require rewardsSubmission is for whitelisted strategy or beaconChainETHStrategy address currAddress = address(0); - for (uint256 i = 0; i < rewardsSubmission.strategiesAndMultipliers.length; ++i) { - IStrategy strategy = rewardsSubmission.strategiesAndMultipliers[i].strategy; + for (uint256 i = 0; i < strategiesAndMultipliers.length; ++i) { + IStrategy strategy = strategiesAndMultipliers[i].strategy; require( strategyManager.strategyIsWhitelistedForDeposit(strategy) || strategy == beaconChainETHStrategy, "RewardsCoordinator._validateRewardsSubmission: invalid strategy considered" @@ -468,17 +599,23 @@ contract RewardsCoordinator is ); } - function _setActivationDelay(uint32 _activationDelay) internal { + function _setActivationDelay( + uint32 _activationDelay + ) internal { emit ActivationDelaySet(activationDelay, _activationDelay); activationDelay = _activationDelay; } - function _setGlobalOperatorCommission(uint16 _globalCommissionBips) internal { + function _setGlobalOperatorCommission( + uint16 _globalCommissionBips + ) internal { emit GlobalCommissionBipsSet(globalOperatorCommissionBips, _globalCommissionBips); globalOperatorCommissionBips = _globalCommissionBips; } - function _setRewardsUpdater(address _rewardsUpdater) internal { + function _setRewardsUpdater( + address _rewardsUpdater + ) internal { emit RewardsUpdaterSet(rewardsUpdater, _rewardsUpdater); rewardsUpdater = _rewardsUpdater; } @@ -490,33 +627,60 @@ contract RewardsCoordinator is */ /// @notice return the hash of the earner's leaf - function calculateEarnerLeafHash(EarnerTreeMerkleLeaf calldata leaf) public pure returns (bytes32) { + function calculateEarnerLeafHash( + EarnerTreeMerkleLeaf calldata leaf + ) public pure returns (bytes32) { return keccak256(abi.encodePacked(EARNER_LEAF_SALT, leaf.earner, leaf.earnerTokenRoot)); } /// @notice returns the hash of the earner's token leaf - function calculateTokenLeafHash(TokenTreeMerkleLeaf calldata leaf) public pure returns (bytes32) { + function calculateTokenLeafHash( + TokenTreeMerkleLeaf calldata leaf + ) public pure returns (bytes32) { return keccak256(abi.encodePacked(TOKEN_LEAF_SALT, leaf.token, leaf.cumulativeEarnings)); } /// @notice returns 'true' if the claim would currently pass the check in `processClaims` /// but will revert if not valid - function checkClaim(RewardsMerkleClaim calldata claim) public view returns (bool) { + function checkClaim( + RewardsMerkleClaim calldata claim + ) public view returns (bool) { _checkClaim(claim, _distributionRoots[claim.rootIndex]); return true; } - /// @notice the commission for a specific operator for a specific avs + /// @notice the commission for an operator for a specific operatorSet and reward type /// NOTE: Currently unused and simply returns the globalOperatorCommissionBips value but will be used in future release - function operatorCommissionBips(address operator, address avs) external view returns (uint16) { - return globalOperatorCommissionBips; + function getOperatorCommissionBips( + address operator, + OperatorSet calldata operatorSet, + RewardType rewardType + ) external view returns (uint16) { + // if no value set, default to globalOperatorCommissionBips + uint16 commissionBips = globalOperatorCommissionBips; + OperatorCommissionUpdate[] memory commissionHistory = + operatorCommissionUpdates[operator][operatorSet.avs][operatorSet.operatorSetId][rewardType]; + + for (uint256 i = commissionHistory.length; i > 0;) { + if (commissionHistory[i - 1].effectTimestamp <= uint32(block.timestamp)) { + commissionBips = commissionHistory[i - 1].commissionBips; + break; + } + + unchecked { + --i; + } + } + return commissionBips; } function getDistributionRootsLength() public view returns (uint256) { return _distributionRoots.length; } - function getDistributionRootAtIndex(uint256 index) external view returns (DistributionRoot memory) { + function getDistributionRootAtIndex( + uint256 index + ) external view returns (DistributionRoot memory) { return _distributionRoots[index]; } @@ -537,7 +701,9 @@ contract RewardsCoordinator is } /// @notice loop through distribution roots from reverse and return hash - function getRootIndexFromHash(bytes32 rootHash) public view returns (uint32) { + function getRootIndexFromHash( + bytes32 rootHash + ) public view returns (uint32) { for (uint32 i = uint32(_distributionRoots.length); i > 0; i--) { if (_distributionRoots[i - 1].root == rootHash) { return i - 1; @@ -546,6 +712,15 @@ contract RewardsCoordinator is revert("RewardsCoordinator.getRootIndexFromHash: root not found"); } + /// @notice returns the length of the operator commission update history + function getOperatorCommissionUpdateHistoryLength( + address operator, + OperatorSet calldata operatorSet, + RewardType rewardType + ) external view returns (uint256) { + return operatorCommissionUpdates[operator][operatorSet.avs][operatorSet.operatorSetId][rewardType].length; + } + /** * @notice Getter function for the current EIP-712 domain separator for this contract. * diff --git a/src/contracts/core/RewardsCoordinatorStorage.sol b/src/contracts/core/RewardsCoordinatorStorage.sol index ef918ffba..0ca246bca 100644 --- a/src/contracts/core/RewardsCoordinatorStorage.sol +++ b/src/contracts/core/RewardsCoordinatorStorage.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.12; import "../interfaces/IStrategyManager.sol"; import "../interfaces/IDelegationManager.sol"; +import "../interfaces/IAVSDirectory.sol"; import "../interfaces/IRewardsCoordinator.sol"; /** @@ -18,26 +19,38 @@ abstract contract RewardsCoordinatorStorage is IRewardsCoordinator { * */ + // Constants for all reward types /// @notice The interval in seconds at which the calculation for rewards distribution is done. - /// @dev RewardsSubmission durations must be multiples of this interval. This is going to be configured to 1 week + /// @dev ALL RewardsSubmission durations must be multiples of this interval. This is going to be configured to 1 week uint32 public immutable CALCULATION_INTERVAL_SECONDS; - /// @notice The maximum amount of time (seconds) that a rewards submission can span over + /// @notice The maximum amount of time (seconds) that ALL rewards submission can span over uint32 public immutable MAX_REWARDS_DURATION; - /// @notice max amount of time (seconds) that a rewards submission can start in the past - uint32 public immutable MAX_RETROACTIVE_LENGTH; - /// @notice max amount of time (seconds) that a rewards submission can start in the future + /// @notice max amount of time (seconds) that ALL rewards submission can start in the future uint32 public immutable MAX_FUTURE_LENGTH; - /// @notice absolute min timestamp (seconds) that a rewards submission can start at - uint32 public immutable GENESIS_REWARDS_TIMESTAMP; /// @notice The cadence at which a snapshot is taken offchain for calculating rewards distributions uint32 internal constant SNAPSHOT_CADENCE = 1 days; + // V1 Rewards Constants + /// @notice absolute min timestamp (seconds) that a V1 rewards submission can start at + uint32 public immutable GENESIS_REWARDS_TIMESTAMP; + /// @notice max amount of time (seconds) that a V1 rewards submission can start in the past + uint32 public immutable MAX_RETROACTIVE_LENGTH; + + // OperatorSet Rewards Constants + /// @notice absolute min timestamp (seconds) that an operatorSet rewards submission can start at + uint32 public immutable OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP; + /// @notice max of time (seconds) that an operatorSet rewards submission can start in the past + uint32 public immutable OPERATOR_SET_MAX_RETROACTIVE_LENGTH; + /// @notice The DelegationManager contract for EigenLayer IDelegationManager public immutable delegationManager; /// @notice The StrategyManager contract for EigenLayer IStrategyManager public immutable strategyManager; + /// @notice The AVSDirectory contract for EigenLayer + IAVSDirectory public immutable avsDirectory; + /** * * STORAGE @@ -77,21 +90,34 @@ abstract contract RewardsCoordinatorStorage is IRewardsCoordinator { /// @notice Used for unique rewardsSubmissionHashes per AVS and for RewardsForAllSubmitters mapping(address => uint256) public submissionNonce; + /// @notice Mapping: avs => avsRewardsSubmissionHash => bool to check if rewards submission hash has been submitted mapping(address => mapping(bytes32 => bool)) public isAVSRewardsSubmissionHash; + /// @notice Mapping: avs => rewardsSubmissionForALlHash => bool to check if rewards submission hash for all has been submitted mapping(address => mapping(bytes32 => bool)) public isRewardsSubmissionForAllHash; + /// @notice Mapping: address => bool to check if the address is permissioned to call createRewardsForAllSubmission mapping(address => bool) public isRewardsForAllSubmitter; + /// @notice Mapping: avs => rewardsSubmissionHash => bool to check if operatorSet rewards submission hash has been submitted + mapping(address => mapping(bytes32 => bool)) isOperatorSetRewardsSubmissionHash; + + /// @notice Mapping: operator => avs => operatorSetId => OperatorCommissionUpdate history + mapping(address => mapping(address => mapping(uint32 => mapping(RewardType => OperatorCommissionUpdate[])))) public + operatorCommissionUpdates; + constructor( IDelegationManager _delegationManager, IStrategyManager _strategyManager, + IAVSDirectory _avsDirectory, uint32 _CALCULATION_INTERVAL_SECONDS, uint32 _MAX_REWARDS_DURATION, uint32 _MAX_RETROACTIVE_LENGTH, uint32 _MAX_FUTURE_LENGTH, - uint32 _GENESIS_REWARDS_TIMESTAMP + uint32 _GENESIS_REWARDS_TIMESTAMP, + uint32 _OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + uint32 _OPERATOR_SET_MAX_RETROACTIVE_LENGTH ) { require( _GENESIS_REWARDS_TIMESTAMP % _CALCULATION_INTERVAL_SECONDS == 0, @@ -101,13 +127,20 @@ abstract contract RewardsCoordinatorStorage is IRewardsCoordinator { _CALCULATION_INTERVAL_SECONDS % SNAPSHOT_CADENCE == 0, "RewardsCoordinator: CALCULATION_INTERVAL_SECONDS must be a multiple of SNAPSHOT_CADENCE" ); + require( + _OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP % _CALCULATION_INTERVAL_SECONDS == 0, + "RewardsCoordinator: OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP must be a multiple of CALCULATION_INTERVAL_SECONDS" + ); delegationManager = _delegationManager; strategyManager = _strategyManager; + avsDirectory = _avsDirectory; CALCULATION_INTERVAL_SECONDS = _CALCULATION_INTERVAL_SECONDS; MAX_REWARDS_DURATION = _MAX_REWARDS_DURATION; MAX_RETROACTIVE_LENGTH = _MAX_RETROACTIVE_LENGTH; MAX_FUTURE_LENGTH = _MAX_FUTURE_LENGTH; GENESIS_REWARDS_TIMESTAMP = _GENESIS_REWARDS_TIMESTAMP; + OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP = _OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP; + OPERATOR_SET_MAX_RETROACTIVE_LENGTH = _OPERATOR_SET_MAX_RETROACTIVE_LENGTH; } /** @@ -115,5 +148,5 @@ abstract contract RewardsCoordinatorStorage is IRewardsCoordinator { * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[40] private __gap; + uint256[38] private __gap; } diff --git a/src/contracts/core/Slasher.sol b/src/contracts/core/Slasher.sol index 9a05a560a..28f147feb 100644 --- a/src/contracts/core/Slasher.sol +++ b/src/contracts/core/Slasher.sol @@ -29,11 +29,17 @@ contract Slasher is Initializable, OwnableUpgradeable, ISlasher, Pausable { function initialize(address, IPauserRegistry, uint256) external {} - function optIntoSlashing(address) external {} + function optIntoSlashing( + address + ) external {} - function freezeOperator(address) external {} + function freezeOperator( + address + ) external {} - function resetFrozenStatus(address[] calldata) external {} + function resetFrozenStatus( + address[] calldata + ) external {} function recordFirstStakeUpdate(address, uint32) external {} @@ -45,7 +51,9 @@ contract Slasher is Initializable, OwnableUpgradeable, ISlasher, Pausable { function delegation() external view returns (IDelegationManager) {} - function isFrozen(address) external view returns (bool) {} + function isFrozen( + address + ) external view returns (bool) {} function canSlash(address, address) external view returns (bool) {} @@ -59,13 +67,17 @@ contract Slasher is Initializable, OwnableUpgradeable, ISlasher, Pausable { function operatorToMiddlewareTimes(address, uint256) external view returns (MiddlewareTimes memory) {} - function middlewareTimesLength(address) external view returns (uint256) {} + function middlewareTimesLength( + address + ) external view returns (uint256) {} function getMiddlewareTimesIndexStalestUpdateBlock(address, uint32) external view returns (uint32) {} function getMiddlewareTimesIndexServeUntilBlock(address, uint32) external view returns (uint32) {} - function operatorWhitelistedContractsLinkedListSize(address) external view returns (uint256) {} + function operatorWhitelistedContractsLinkedListSize( + address + ) external view returns (uint256) {} function operatorWhitelistedContractsLinkedListEntry( address, diff --git a/src/contracts/core/StrategyManager.sol b/src/contracts/core/StrategyManager.sol index ddc36a032..e770d64be 100644 --- a/src/contracts/core/StrategyManager.sol +++ b/src/contracts/core/StrategyManager.sol @@ -41,7 +41,9 @@ contract StrategyManager is _; } - modifier onlyStrategiesWhitelistedForDeposit(IStrategy strategy) { + modifier onlyStrategiesWhitelistedForDeposit( + IStrategy strategy + ) { require( strategyIsWhitelistedForDeposit[strategy], "StrategyManager.onlyStrategiesWhitelistedForDeposit: strategy not whitelisted" @@ -62,8 +64,9 @@ contract StrategyManager is constructor( IDelegationManager _delegation, IEigenPodManager _eigenPodManager, - ISlasher _slasher - ) StrategyManagerStorage(_delegation, _eigenPodManager, _slasher) { + ISlasher _slasher, + IAVSDirectory _avsDirectory + ) StrategyManagerStorage(_delegation, _eigenPodManager, _slasher, _avsDirectory) { _disableInitializers(); ORIGINAL_CHAIN_ID = block.chainid; } @@ -176,11 +179,14 @@ contract StrategyManager is IERC20 token, IStrategy strategy, uint256 shares - ) external onlyDelegationManager { - _addShares(staker, token, strategy, shares); + ) external onlyDelegationManager returns (uint256 existingShares) { + uint256 existingShares = _addShares(staker, token, strategy, shares); + return existingShares; } /// @notice Used by the DelegationManager to convert withdrawn shares to tokens and send them to a recipient + /// Assumes that shares being passed in have already been accounted for any slashing + /// and are the `real` shares in the strategy to withdraw function withdrawSharesAsTokens( address recipient, IStrategy strategy, @@ -205,7 +211,9 @@ contract StrategyManager is * @notice Owner-only function to change the `strategyWhitelister` address. * @param newStrategyWhitelister new address for the `strategyWhitelister`. */ - function setStrategyWhitelister(address newStrategyWhitelister) external onlyOwner { + function setStrategyWhitelister( + address newStrategyWhitelister + ) external onlyOwner { _setStrategyWhitelister(newStrategyWhitelister); } @@ -240,10 +248,9 @@ contract StrategyManager is * @notice Owner-only function that removes the provided Strategies from the 'whitelist' of strategies that stakers can deposit into * @param strategiesToRemoveFromWhitelist Strategies that will be removed to the `strategyIsWhitelistedForDeposit` mapping (if they are in it) */ - function removeStrategiesFromDepositWhitelist(IStrategy[] calldata strategiesToRemoveFromWhitelist) - external - onlyStrategyWhitelister - { + function removeStrategiesFromDepositWhitelist( + IStrategy[] calldata strategiesToRemoveFromWhitelist + ) external onlyStrategyWhitelister { uint256 strategiesToRemoveFromWhitelistLength = strategiesToRemoveFromWhitelist.length; for (uint256 i = 0; i < strategiesToRemoveFromWhitelistLength;) { // change storage and emit event only if strategy is already in whitelist @@ -271,7 +278,12 @@ contract StrategyManager is * delegated shares are tracked, increases the stored share amount in `stakerStrategyShares[staker][strategy]`, and adds `strategy` * to the `staker`'s list of strategies, if it is not in the list already. */ - function _addShares(address staker, IERC20 token, IStrategy strategy, uint256 shares) internal { + function _addShares( + address staker, + IERC20 token, + IStrategy strategy, + uint256 shares + ) internal returns (uint256 existingShares) { // sanity checks on inputs require(staker != address(0), "StrategyManager._addShares: staker cannot be zero address"); require(shares != 0, "StrategyManager._addShares: shares should not be zero!"); @@ -286,9 +298,11 @@ contract StrategyManager is } // add the returned shares to their existing shares for this strategy + existingShares = stakerStrategyShares[staker][strategy]; stakerStrategyShares[staker][strategy] += shares; emit Deposit(staker, token, strategy, shares); + return existingShares; } /** @@ -310,13 +324,18 @@ contract StrategyManager is token.safeTransferFrom(msg.sender, address(strategy), amount); // deposit the assets into the specified strategy and get the equivalent amount of shares in that strategy - shares = strategy.deposit(token, amount); + uint256 shares = strategy.deposit(token, amount); // add the returned shares to the staker's existing shares for this strategy - _addShares(staker, token, strategy, shares); + uint256 existingShares = _addShares(staker, token, strategy, shares); // Increase shares delegated to operator, if needed - delegation.increaseDelegatedShares(staker, strategy, shares); + delegation.increaseDelegatedShares({ + staker: staker, + strategy: strategy, + existingShares: existingShares, + addedShares: shares + }); return shares; } @@ -396,18 +415,23 @@ contract StrategyManager is * @notice Internal function for modifying the `strategyWhitelister`. Used inside of the `setStrategyWhitelister` and `initialize` functions. * @param newStrategyWhitelister The new address for the `strategyWhitelister` to take. */ - function _setStrategyWhitelister(address newStrategyWhitelister) internal { + function _setStrategyWhitelister( + address newStrategyWhitelister + ) internal { emit StrategyWhitelisterChanged(strategyWhitelister, newStrategyWhitelister); strategyWhitelister = newStrategyWhitelister; } // VIEW FUNCTIONS + /** * @notice Get all details on the staker's deposits and corresponding shares * @param staker The staker of interest, whose deposits this function will fetch * @return (staker's strategies, shares in these strategies) */ - function getDeposits(address staker) external view returns (IStrategy[] memory, uint256[] memory) { + function getDeposits( + address staker + ) external view returns (IStrategy[] memory, uint256[] memory) { uint256 strategiesLength = stakerStrategyList[staker].length; uint256[] memory shares = new uint256[](strategiesLength); @@ -421,7 +445,9 @@ contract StrategyManager is } /// @notice Simple getter function that returns `stakerStrategyList[staker].length`. - function stakerStrategyListLength(address staker) external view returns (uint256) { + function stakerStrategyListLength( + address staker + ) external view returns (uint256) { return stakerStrategyList[staker].length; } diff --git a/src/contracts/core/StrategyManagerStorage.sol b/src/contracts/core/StrategyManagerStorage.sol index 085b1dc9a..4e6c5dde7 100644 --- a/src/contracts/core/StrategyManagerStorage.sol +++ b/src/contracts/core/StrategyManagerStorage.sol @@ -6,6 +6,7 @@ import "../interfaces/IStrategy.sol"; import "../interfaces/IEigenPodManager.sol"; import "../interfaces/IDelegationManager.sol"; import "../interfaces/ISlasher.sol"; +import "../interfaces/IAVSDirectory.sol"; /** * @title Storage variables for the `StrategyManager` contract. @@ -27,6 +28,7 @@ abstract contract StrategyManagerStorage is IStrategyManager { IDelegationManager public immutable delegation; IEigenPodManager public immutable eigenPodManager; ISlasher public immutable slasher; + IAVSDirectory public immutable avsDirectory; /** * @notice Original EIP-712 Domain separator for this contract. @@ -72,10 +74,16 @@ abstract contract StrategyManagerStorage is IStrategyManager { */ mapping(IStrategy => bool) public thirdPartyTransfersForbidden; - constructor(IDelegationManager _delegation, IEigenPodManager _eigenPodManager, ISlasher _slasher) { + constructor( + IDelegationManager _delegation, + IEigenPodManager _eigenPodManager, + ISlasher _slasher, + IAVSDirectory _avsDirectory + ) { delegation = _delegation; eigenPodManager = _eigenPodManager; slasher = _slasher; + avsDirectory = _avsDirectory; } /** diff --git a/src/contracts/interfaces/IAVSDirectory.sol b/src/contracts/interfaces/IAVSDirectory.sol index b35cabc99..c619c5b29 100644 --- a/src/contracts/interfaces/IAVSDirectory.sol +++ b/src/contracts/interfaces/IAVSDirectory.sol @@ -1,10 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; +import "./IDelegationManager.sol"; import "./ISignatureUtils.sol"; +/// @notice Struct representing an operator set +struct OperatorSet { + address avs; + uint32 operatorSetId; +} + interface IAVSDirectory is ISignatureUtils { - /// @notice Enum representing the status of an operator's registration with an AVS + /// @notice Enum representing the registration status of an operator with an AVS. + /// @notice Only used by legacy M2 AVSs that have not integrated with operatorSets. enum OperatorAVSRegistrationStatus { UNREGISTERED, // Operator not registered to AVS REGISTERED // Operator registered to AVS @@ -12,20 +20,138 @@ interface IAVSDirectory is ISignatureUtils { } /** - * @notice Emitted when @param avs indicates that they are updating their MetadataURI string - * @dev Note that these strings are *never stored in storage* and are instead purely emitted in events for off-chain indexing + * @notice Struct representing the registration status of an operator with an operator set. + * Keeps track of last deregistered timestamp for slashability concerns. + * @param registered whether the operator is registered with the operator set + * @param lastDeregisteredTimestamp the timestamp at which the operator was last deregistered */ - event AVSMetadataURIUpdated(address indexed avs, string metadataURI); + struct OperatorSetRegistrationStatus { + bool registered; + uint32 lastDeregisteredTimestamp; + } + + /// @notice Emitted when an operator set is created by an AVS. + event OperatorSetCreated(OperatorSet operatorSet); - /// @notice Emitted when an operator's registration status for an AVS is updated + /** + * @notice Emitted when an operator's registration status with an AVS id udpated + * @notice Only used by legacy M2 AVSs that have not integrated with operatorSets. + */ event OperatorAVSRegistrationStatusUpdated( address indexed operator, address indexed avs, OperatorAVSRegistrationStatus status ); + /// @notice Emitted when an operator is added to an operator set. + event OperatorAddedToOperatorSet(address indexed operator, OperatorSet operatorSet); + + /// @notice Emitted when an operator is removed from an operator set. + event OperatorRemovedFromOperatorSet(address indexed operator, OperatorSet operatorSet); + + /// @notice Emitted when an AVS updates their metadata URI (Uniform Resource Identifier). + /// @dev The URI is never stored; it is simply emitted through an event for off-chain indexing. + event AVSMetadataURIUpdated(address indexed avs, string metadataURI); + + /// @notice Emitted when an AVS migrates to using operator sets. + event AVSMigratedToOperatorSets(address indexed avs); + + /// @notice Emitted when an operator is migrated from M2 registration to operator sets. + event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds); + + /** + * + * EXTERNAL FUNCTIONS + * + */ + + /** + * @notice Called by an AVS to create a list of new operatorSets. + * + * @param operatorSetIds The IDs of the operator set to initialize. + * + * @dev msg.sender must be the AVS. + * @dev The AVS may create operator sets before it becomes an operator set AVS. + */ + function createOperatorSets( + uint32[] calldata operatorSetIds + ) external; + + /** + * @notice Sets the AVS as an operator set AVS, preventing legacy M2 operator registrations. + * + * @dev msg.sender must be the AVS. + */ + function becomeOperatorSetAVS() external; + /** - * @notice Called by an avs to register an operator with the avs. - * @param operator The address of the operator to register. - * @param operatorSignature The signature, salt, and expiry of the operator's signature. + * @notice Called by an AVS to migrate operators that have a legacy M2 registration to operator sets. + * + * @param operators The list of operators to migrate + * @param operatorSetIds The list of operatorSets to migrate the operators to + * + * @dev The msg.sender used is the AVS + * @dev The operator can only be migrated at most once per AVS + * @dev The AVS can no longer register operators via the legacy M2 registration path once it begins migration + * @dev The operator is deregistered from the M2 legacy AVS once migrated + */ + function migrateOperatorsToOperatorSets( + address[] calldata operators, + uint32[][] calldata operatorSetIds + ) external; + + /** + * @notice Called by AVSs to add an operator to list of operatorSets. + * + * @param operator The address of the operator to be added to the operator set. + * @param operatorSetIds The IDs of the operator sets. + * @param operatorSignature The signature of the operator on their intent to register. + * + * @dev msg.sender is used as the AVS. + * @dev The operator must not have a pending deregistration from the operator set. + */ + function registerOperatorToOperatorSets( + address operator, + uint32[] calldata operatorSetIds, + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature + ) external; + + /** + * @notice Called by AVSs to remove an operator from an operator set. + * + * @param operator The address of the operator to be removed from the operator set. + * @param operatorSetIds The IDs of the operator sets. + * + * @dev msg.sender is used as the AVS. + */ + function deregisterOperatorFromOperatorSets(address operator, uint32[] calldata operatorSetIds) external; + + /** + * @notice Called by an operator to deregister from an operator set + * + * @param operator The operator to deregister from the operatorSets. + * @param avs The address of the AVS to deregister the operator from. + * @param operatorSetIds The IDs of the operator sets. + * @param operatorSignature the signature of the operator on their intent to deregister or empty if the operator itself is calling + * + * @dev if the operatorSignature is empty, the caller must be the operator + * @dev this will likely only be called in case the AVS contracts are in a state that prevents operators from deregistering + */ + function forceDeregisterFromOperatorSets( + address operator, + address avs, + uint32[] calldata operatorSetIds, + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature + ) external; + + /** + * @notice Legacy function called by the AVS's service manager contract + * to register an operator with the AVS. NOTE: this function will be deprecated in a future release + * after the slashing release. New AVSs should use `registerOperatorToOperatorSets` instead. + * + * @param operator The address of the operator to register. + * @param operatorSignature The signature, salt, and expiry of the operator's signature. + * + * @dev msg.sender must be the AVS. + * @dev Only used by legacy M2 AVSs that have not integrated with operator sets. */ function registerOperatorToAVS( address operator, @@ -33,30 +159,114 @@ interface IAVSDirectory is ISignatureUtils { ) external; /** - * @notice Called by an avs to deregister an operator with the avs. - * @param operator The address of the operator to deregister. + * @notice Legacy function called by an AVS to deregister an operator from the AVS. + * NOTE: this function will be deprecated in a future release after the slashing release. + * New AVSs integrating should use `deregisterOperatorFromOperatorSets` instead. + * + * @param operator The address of the operator to deregister. + * + * @dev Only used by legacy M2 AVSs that have not integrated with operator sets. + */ + function deregisterOperatorFromAVS( + address operator + ) external; + + /** + * @notice Called by an AVS to emit an `AVSMetadataURIUpdated` event indicating the information has updated. + * + * @param metadataURI The URI for metadata associated with an AVS. + * + * @dev Note that the `metadataURI` is *never stored* and is only emitted in the `AVSMetadataURIUpdated` event. */ - function deregisterOperatorFromAVS(address operator) external; + function updateAVSMetadataURI( + string calldata metadataURI + ) external; /** - * @notice Called by an AVS to emit an `AVSMetadataURIUpdated` event indicating the information has updated. - * @param metadataURI The URI for metadata associated with an AVS - * @dev Note that the `metadataURI` is *never stored * and is only emitted in the `AVSMetadataURIUpdated` event + * @notice Called by an operator to cancel a salt that has been used to register with an AVS. + * + * @param salt A unique and single use value associated with the approver signature. */ - function updateAVSMetadataURI(string calldata metadataURI) external; + function cancelSalt( + bytes32 salt + ) external; /** - * @notice Returns whether or not the salt has already been used by the operator. - * @dev Salts is used in the `registerOperatorToAVS` function. + * + * VIEW FUNCTIONS + * */ function operatorSaltIsSpent(address operator, bytes32 salt) external view returns (bool); + function isMember(address operator, OperatorSet memory operatorSet) external view returns (bool); + + function isOperatorSetAVS( + address avs + ) external view returns (bool); + + function isOperatorSet(address avs, uint32 operatorSetId) external view returns (bool); + /** - * @notice Calculates the digest hash to be signed by an operator to register with an AVS - * @param operator The account registering as an operator - * @param avs The AVS the operator is registering to - * @param salt A unique and single use value associated with the approver signature. - * @param expiry Time after which the approver's signature becomes invalid + * @notice Returns operator set an operator is registered to in the order they were registered. + * @param operator The operator address to query. + * @param index The index of the enumerated list of operator sets. + */ + function operatorSetsMemberOfAtIndex(address operator, uint256 index) external view returns (OperatorSet memory); + + /** + * @notice Retursn the operator registered to an operatorSet in the order that it was registered. + * @param operatorSet The operatorSet to query. + * @param index The index of the enumerated list of operators. + */ + function operatorSetMemberAtIndex(OperatorSet memory operatorSet, uint256 index) external view returns (address); + + /** + * @notice Returns an array of operator sets an operator is registered to. + * @param operator The operator address to query. + * @param start The starting index of the array to query. + * @param length The amount of items of the array to return. + */ + function getOperatorSetsOfOperator( + address operator, + uint256 start, + uint256 length + ) external view returns (OperatorSet[] memory operatorSets); + + /** + * @notice Returns an array of operators registered to the operatorSet. + * @param operatorSet The operatorSet to query. + * @param start The starting index of the array to query. + * @param length The amount of items of the array to return. + */ + function getOperatorsInOperatorSet( + OperatorSet memory operatorSet, + uint256 start, + uint256 length + ) external view returns (address[] memory operators); + + /** + * @notice Returns the number of operators registered to an operatorSet. + * @param operatorSet The operatorSet to get the member count for + */ + function getNumOperatorsInOperatorSet( + OperatorSet memory operatorSet + ) external view returns (uint256); + + /** + * @notice Returns the total number of operator sets an operator is registered to. + * @param operator The operator address to query. + */ + function inTotalOperatorSets( + address operator + ) external view returns (uint256); + + /** + * @notice Calculates the digest hash to be signed by an operator to register with an AVS. + * + * @param operator The account registering as an operator. + * @param avs The AVS the operator is registering with. + * @param salt A unique and single-use value associated with the approver's signature. + * @param expiry The time after which the approver's signature becomes invalid. */ function calculateOperatorAVSRegistrationDigestHash( address operator, @@ -65,6 +275,49 @@ interface IAVSDirectory is ISignatureUtils { uint256 expiry ) external view returns (bytes32); - /// @notice The EIP-712 typehash for the Registration struct used by the contract + /** + * @notice Calculates the digest hash to be signed by an operator to register with an operator set. + * + * @param avs The AVS that operator is registering to operator sets for. + * @param operatorSetIds An array of operator set IDs the operator is registering to. + * @param salt A unique and single use value associated with the approver signature. + * @param expiry Time after which the approver's signature becomes invalid. + */ + function calculateOperatorSetRegistrationDigestHash( + address avs, + uint32[] calldata operatorSetIds, + bytes32 salt, + uint256 expiry + ) external view returns (bytes32); + + /** + * @notice Calculates the digest hash to be signed by an operator to force deregister from an operator set. + * + * @param avs The AVS that operator is deregistering from. + * @param operatorSetIds An array of operator set IDs the operator is deregistering from. + * @param salt A unique and single use value associated with the approver signature. + * @param expiry Time after which the approver's signature becomes invalid. + */ + function calculateOperatorSetForceDeregistrationTypehash( + address avs, + uint32[] calldata operatorSetIds, + bytes32 salt, + uint256 expiry + ) external view returns (bytes32); + + /// @notice Getter function for the current EIP-712 domain separator for this contract. + /// @dev The domain separator will change in the event of a fork that changes the ChainID. + function domainSeparator() external view returns (bytes32); + + /// @notice The EIP-712 typehash for the Registration struct used by the contract. function OPERATOR_AVS_REGISTRATION_TYPEHASH() external view returns (bytes32); + + /// @notice The EIP-712 typehash for the OperatorSetRegistration struct used by the contract. + function OPERATOR_SET_REGISTRATION_TYPEHASH() external view returns (bytes32); + + function operatorSetStatus( + address avs, + address operator, + uint32 operatorSetId + ) external view returns (bool registered, uint32 lastDeregisteredTimestamp); } diff --git a/src/contracts/interfaces/IAllocationManager.sol b/src/contracts/interfaces/IAllocationManager.sol new file mode 100644 index 000000000..6b3d24327 --- /dev/null +++ b/src/contracts/interfaces/IAllocationManager.sol @@ -0,0 +1,300 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity >=0.5.0; + +import {OperatorSet} from "./IAVSDirectory.sol"; +import "./IStrategy.sol"; +import "./ISignatureUtils.sol"; + +interface IAllocationManager is ISignatureUtils { + /** + * @notice struct used to modify the allocation of slashable magnitude to list of operatorSets + * @param strategy the strategy to allocate magnitude for + * @param expectedTotalMagnitude the expected total magnitude of the operator used to combat against race conditions with slashing + * @param operatorSets the operatorSets to allocate magnitude for + * @param magnitudes the magnitudes to allocate for each operatorSet + */ + struct MagnitudeAllocation { + IStrategy strategy; + uint64 expectedTotalMagnitude; + OperatorSet[] operatorSets; + uint64[] magnitudes; + } + + /** + * @notice struct used for pending free magnitude. Stored in (operator, strategy, operatorSet) mapping + * to be used in completeDeallocations. + * @param magnitudeDiff the amount of magnitude to deallocate + * @param completableTimestamp the timestamp at which the deallocation can be completed, 21 days from when queued + */ + struct PendingFreeMagnitude { + uint64 magnitudeDiff; + uint32 completableTimestamp; + } + + /** + * @notice Struct containing info regarding free allocatable magnitude. + * @param nextPendingFreeMagnitudeIndex The next available update index. + * @param freeMagnitude The total amount of free allocatable magnitude. + */ + struct OperatorMagnitudeInfo { + uint192 nextPendingFreeMagnitudeIndex; + uint64 freeMagnitude; + } + + /// @notice Emitted when an operator set is created by an AVS. + event OperatorSetCreated(OperatorSet operatorSet); + + /// @notice Emitted when an operator allocates slashable magnitude to an operator set + event MagnitudeAllocated( + address operator, + IStrategy strategy, + OperatorSet operatorSet, + uint64 magnitudeToAllocate, + uint32 effectTimestamp + ); + + /// @notice Emitted when an operator queues deallocations of slashable magnitude from an operator set + event MagnitudeQueueDeallocated( + address operator, + IStrategy strategy, + OperatorSet operatorSet, + uint64 magnitudeToDeallocate, + uint32 completableTimestamp + ); + + /// @notice Emitted when an operator completes deallocations of slashable magnitude from an operator set + /// and adds back magnitude to free allocatable magnitude + event MagnitudeDeallocationCompleted( + address operator, IStrategy strategy, OperatorSet operatorSet, uint64 freeMagnitudeAdded + ); + + /// @notice Emitted when an operator is slashed by an operator set for a strategy + event OperatorSlashed(address operator, uint32 operatorSetId, IStrategy strategy, uint16 bipsToSlash); + + /** + * + * EXTERNAL FUNCTIONS + * + */ + + /** + * @notice Modifies the propotions of slashable stake allocated to a list of operatorSets for a set of strategies + * @param operator address to modify allocations for + * @param allocations array of magnitude adjustments for multiple strategies and corresponding operator sets + * @param operatorSignature signature of the operator if msg.sender is not the operator + * @dev updates freeMagnitude for the updated strategies + * @dev must be called by the operator + */ + function modifyAllocations( + address operator, + MagnitudeAllocation[] calldata allocations, + SignatureWithSaltAndExpiry calldata operatorSignature + ) external; + + /** + * @notice For all pending deallocations that have become completable, their pending free magnitude can be + * added back to the free magnitude of the (operator, strategy) amount. This function takes a list of strategies + * and adds all completable deallocations for each strategy, updating the freeMagnitudes of the operator + * + * @param operator address to complete deallocations for + * @param strategies a list of strategies to complete deallocations for + * + * @dev can be called permissionlessly by anyone + */ + function updateFreeMagnitude( + address operator, + IStrategy[] calldata strategies, + uint16[] calldata numToComplete + ) external; + + /** + * @notice Called by an AVS to slash an operator for given operatorSetId, list of strategies, and bipsToSlash. + * For each given (operator, operatorSetId, strategy) tuple, bipsToSlash + * bips of the operatorSet's slashable stake allocation will be slashed + * + * @param operator the address to slash + * @param operatorSetId the ID of the operatorSet the operator is being slashed on behalf of + * @param strategies the set of strategies to slash + * @param bipsToSlash the number of bips to slash, this will be proportional to the + * operator's slashable stake allocation for the operatorSet + */ + function slashOperator( + address operator, + uint32 operatorSetId, + IStrategy[] calldata strategies, + uint16 bipsToSlash + ) external; + + /** + * @notice Called by an operator to cancel a salt that has been used to register with an AVS. + * + * @param salt A unique and single use value associated with the approver signature. + */ + function cancelSalt( + bytes32 salt + ) external; + + /** + * + * VIEW FUNCTIONS + * + */ + + /** + * @notice Get the allocatable magnitude for an operator and strategy based on number of pending deallocations + * that could be completed at the same time. This is the sum of freeMagnitude and the sum of all pending completable deallocations. + * @param operator the operator to get the allocatable magnitude for + * @param strategy the strategy to get the allocatable magnitude for + * @param numToComplete the number of pending free magnitudes deallocations to complete, 0 to complete all (uint8 max 256) + */ + function getAllocatableMagnitude( + address operator, + IStrategy strategy, + uint16 numToComplete + ) external view returns (uint64); + + /** + * @notice Returns the pending allocations of an operator for a given strategy and operatorSets + * One of the assumptions here is we don't allow more than one pending allocation for an operatorSet at a time. + * If that changes, we would need to change this function to return all pending allocations for an operatorSet. + * @param operator the operator to get the pending allocations for + * @param strategy the strategy to get the pending allocations for + * @param operatorSets the operatorSets to get the pending allocations for + * @return pendingMagnitude the pending allocations for each operatorSet + * @return timestamps the timestamps for each pending allocation + */ + function getPendingAllocations( + address operator, + IStrategy strategy, + OperatorSet[] calldata operatorSets + ) external view returns (uint64[] memory, uint32[] memory); + + /** + * @notice Returns the pending deallocations of an operator for a given strategy and operatorSets. + * One of the assumptions here is we don't allow more than one pending deallocation for an operatorSet at a time. + * If that changes, we would need to change this function to return all pending deallocations for an operatorSet. + * @param operator the operator to get the pending deallocations for + * @param strategy the strategy to get the pending deallocations for + * @param operatorSets the operatorSets to get the pending deallocations for + * @return pendingMagnitudeDiff the pending difference in deallocations for each operatorSet + * @return timestamps the timestamps for each pending deallocation + */ + function getPendingDeallocations( + address operator, + IStrategy strategy, + OperatorSet[] calldata operatorSets + ) external view returns (uint64[] memory, uint32[] memory); + + /** + * @notice operator is slashable by operatorSet if currently registered OR last deregistered within 21 days + * @param operator the operator to check slashability for + * @param operatorSet the operatorSet to check slashability for + * @return bool if the operator is slashable by the operatorSet + */ + function isOperatorSlashable(address operator, OperatorSet memory operatorSet) external view returns (bool); + + /** + * @param operator the operator to get the slashable magnitude for + * @param strategies the strategies to get the slashable magnitude for + * + * @return operatorSets the operator sets the operator is a member of and the current slashable magnitudes for each strategy + */ + function getCurrentSlashableMagnitudes( + address operator, + IStrategy[] calldata strategies + ) external view returns (OperatorSet[] memory, uint64[][] memory); + + /** + * @param operator the operator to get the slashable magnitude for + * @param strategies the strategies to get the slashable magnitude for + * @param timestamp the timestamp to get the slashable magnitude for + * + * @return operatorSets the operator sets the operator is a member of and the slashable magnitudes for each strategy + */ + function getSlashableMagnitudes( + address operator, + IStrategy[] calldata strategies, + uint32 timestamp + ) external view returns (OperatorSet[] memory, uint64[][] memory); + + /** + * @param operator the operator to get the slashable ppm for + * @param operatorSet the operatorSet to get the slashable ppm for + * @param strategies the strategies to get the slashable ppm for + * @param timestamp the timestamp to get the slashable ppm for for + * @param linear whether the search should be linear (from the most recent) or binary + * + * @return slashablePPM the slashable ppm of the given list of strategies allocated to + * the given OperatorSet for the given operator and timestamp + */ + function getSlashablePPM( + address operator, + OperatorSet calldata operatorSet, + IStrategy[] calldata strategies, + uint32 timestamp, + bool linear + ) external view returns (uint24[] memory); + + /** + * @notice Returns the current total magnitudes of an operator for a given set of strategies + * @param operator the operator to get the total magnitude for + * @param strategies the strategies to get the total magnitudes for + * @return totalMagnitudes the total magnitudes for each strategy + */ + function getTotalMagnitudes( + address operator, + IStrategy[] calldata strategies + ) external view returns (uint64[] memory); + + /** + * @notice Returns the total magnitudes of an operator for a given set of strategies at a given timestamp + * @param operator the operator to get the total magnitude for + * @param strategies the strategies to get the total magnitudes for + * @param timestamp the timestamp to get the total magnitudes at + * @return totalMagnitudes the total magnitudes for each strategy + */ + function getTotalMagnitudesAtTimestamp( + address operator, + IStrategy[] calldata strategies, + uint32 timestamp + ) external view returns (uint64[] memory); + + /** + * @notice Returns the current total magnitude of an operator for a given strategy + * @param operator the operator to get the total magnitude for + * @param strategy the strategy to get the total magnitude for + * @return totalMagnitude the total magnitude for the strategy + */ + function getTotalMagnitude(address operator, IStrategy strategy) external view returns (uint64); + + /** + * @notice Returns the total magnitude of an operator for a given strategy at a given timestamp + * @param operator the operator to get the total magnitude for + * @param strategy the strategy to get the total magnitude for + * @param timestamp the timestamp to get the total magnitude at + * @return totalMagnitude the total magnitude for the strategy + */ + function getTotalMagnitudeAtTimestamp( + address operator, + IStrategy strategy, + uint32 timestamp + ) external view returns (uint64); + + /** + * @notice Calculates the digest hash to be signed by an operator to modify magnitude allocations + * @param operator The operator to allocate or deallocate magnitude for. + * @param allocations The magnitude allocations/deallocations to be made. + * @param salt A unique and single use value associated with the approver signature. + * @param expiry Time after which the approver's signature becomes invalid. + */ + function calculateMagnitudeAllocationDigestHash( + address operator, + MagnitudeAllocation[] calldata allocations, + bytes32 salt, + uint256 expiry + ) external view returns (bytes32); + + /// @notice Getter function for the current EIP-712 domain separator for this contract. + /// @dev The domain separator will change in the event of a fork that changes the ChainID. + function domainSeparator() external view returns (bytes32); +} diff --git a/src/contracts/interfaces/IDelegationFaucet.sol b/src/contracts/interfaces/IDelegationFaucet.sol index 8741208db..5642c1342 100644 --- a/src/contracts/interfaces/IDelegationFaucet.sol +++ b/src/contracts/interfaces/IDelegationFaucet.sol @@ -13,7 +13,9 @@ interface IDelegationFaucet { uint256 _depositAmount ) external; - function getStaker(address operator) external returns (address); + function getStaker( + address operator + ) external returns (address); function depositIntoStrategy( address staker, diff --git a/src/contracts/interfaces/IDelegationManager.sol b/src/contracts/interfaces/IDelegationManager.sol index dc42416b6..6a0a7789b 100644 --- a/src/contracts/interfaces/IDelegationManager.sol +++ b/src/contracts/interfaces/IDelegationManager.sol @@ -38,6 +38,16 @@ interface IDelegationManager is ISignatureUtils { uint32 stakerOptOutWindowBlocks; } + /** + * @notice struct used to store the allocation delay for an operator + * @param isSet whether the allocation delay is set. Can only be configured one time for each operator + * @param allocationDelay the delay in seconds for the operator's allocations + */ + struct AllocationDelayDetails { + bool isSet; + uint32 allocationDelay; + } + /** * @notice Abstract struct used in calculating an EIP712 signature for a staker to approve that they (the staker themselves) delegate to a specific operator. * @dev Used in computing the `STAKER_DELEGATION_TYPEHASH` and as a reference in the computation of the stakerDigestHash in the `delegateToBySignature` function. @@ -82,18 +92,23 @@ interface IDelegationManager is ISignatureUtils { address withdrawer; // Nonce used to guarantee that otherwise identical withdrawals have unique hashes uint256 nonce; - // Block number when the Withdrawal was created - uint32 startBlock; + // Timestamp when the Withdrawal was created. + // NOTE this used to be `startBlock` but changedto timestamps in the Slashing release. This has no effect + // on the hash of this struct but we do need to know when to handle blocknumbers vs timestamps depending on + // if the withdrawal was created before or after the Slashing release. + uint32 startTimestamp; // Array of strategies that the Withdrawal contains IStrategy[] strategies; - // Array containing the amount of shares in each Strategy in the `strategies` array - uint256[] shares; + // Array containing the amount of staker scaled shares for withdrawal in each Strategy in the `strategies` array + // Note that these shares need to be rescaled again at completion based on the operator's totalMagnitude in case + // of slashing occurring during the queue withdrawal period + uint256[] scaledShares; } struct QueuedWithdrawalParams { // Array of strategies that the QueuedWithdrawal contains IStrategy[] strategies; - // Array containing the amount of shares in each Strategy in the `strategies` array + // Array containing the amount of shares for withdrawal in each Strategy in the `strategies` array uint256[] shares; // The address of the withdrawer address withdrawer; @@ -142,9 +157,13 @@ interface IDelegationManager is ISignatureUtils { /// @notice Emitted when the `strategyWithdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`. event StrategyWithdrawalDelayBlocksSet(IStrategy strategy, uint256 previousValue, uint256 newValue); + /// @notice Emitted when the `strategyWithdrawalDelay` variable is modified from `previousValue` to `newValue`. + event StrategyWithdrawalDelaySet(IStrategy strategy, uint256 previousValue, uint256 newValue); + /** * @notice Registers the caller as an operator in EigenLayer. * @param registeringOperatorDetails is the `OperatorDetails` for the operator. + * @param allocationDelay is a one-time configurable delay for the operator when performing slashable magnitude allocations. * @param metadataURI is a URI for the operator's metadata, i.e. a link providing more details on the operator. * * @dev Once an operator is registered, they cannot 'deregister' as an operator, and they will forever be considered "delegated to themself". @@ -152,23 +171,37 @@ interface IDelegationManager is ISignatureUtils { */ function registerAsOperator( OperatorDetails calldata registeringOperatorDetails, + uint32 allocationDelay, string calldata metadataURI ) external; + /** + * @notice Called by operators to set their allocation delay one time. Cannot be updated + * after being set. This delay is required to be set for an operator to be able to allocate slashable magnitudes. + * @param delay the allocation delay in seconds + */ + function initializeAllocationDelay( + uint32 delay + ) external; + /** * @notice Updates an operator's stored `OperatorDetails`. * @param newOperatorDetails is the updated `OperatorDetails` for the operator, to replace their current OperatorDetails`. * * @dev The caller must have previously registered as an operator in EigenLayer. */ - function modifyOperatorDetails(OperatorDetails calldata newOperatorDetails) external; + function modifyOperatorDetails( + OperatorDetails calldata newOperatorDetails + ) external; /** * @notice Called by an operator to emit an `OperatorMetadataURIUpdated` event indicating the information has updated. * @param metadataURI The URI for metadata associated with an operator * @dev Note that the `metadataURI` is *never stored * and is only emitted in the `OperatorMetadataURIUpdated` event */ - function updateOperatorMetadataURI(string calldata metadataURI) external; + function updateOperatorMetadataURI( + string calldata metadataURI + ) external; /** * @notice Caller delegates their stake to an operator. @@ -224,7 +257,9 @@ interface IDelegationManager is ISignatureUtils { * @dev Reverts if the caller is not the staker, nor the operator who the staker is delegated to, nor the operator's specified "delegationApprover" * @dev Reverts if the `staker` is already undelegated. */ - function undelegate(address staker) external returns (bytes32[] memory withdrawalRoot); + function undelegate( + address staker + ) external returns (bytes32[] memory withdrawalRoot); /** * Allows a staker to withdraw some shares. Withdrawn shares/strategies are immediately removed @@ -233,20 +268,17 @@ interface IDelegationManager is ISignatureUtils { * * All withdrawn shares/strategies are placed in a queue and can be fully withdrawn after a delay. */ - function queueWithdrawals(QueuedWithdrawalParams[] calldata queuedWithdrawalParams) - external - returns (bytes32[] memory); + function queueWithdrawals( + QueuedWithdrawalParams[] calldata queuedWithdrawalParams + ) external returns (bytes32[] memory); /** * @notice Used to complete the specified `withdrawal`. The caller must match `withdrawal.withdrawer` * @param withdrawal The Withdrawal to complete. * @param tokens Array in which the i-th entry specifies the `token` input to the 'withdraw' function of the i-th Strategy in the `withdrawal.strategies` array. - * This input can be provided with zero length if `receiveAsTokens` is set to 'false' (since in that case, this input will be unused) - * @param middlewareTimesIndex is the index in the operator that the staker who triggered the withdrawal was delegated to's middleware times array * @param receiveAsTokens If true, the shares specified in the withdrawal will be withdrawn from the specified strategies themselves * and sent to the caller, through calls to `withdrawal.strategies[i].withdraw`. If false, then the shares in the specified strategies * will simply be transferred to the caller directly. - * @dev middlewareTimesIndex should be calculated off chain before calling this function by finding the first index that satisfies `slasher.canWithdraw` * @dev beaconChainETHStrategy shares are non-transferrable, so if `receiveAsTokens = false` and `withdrawal.withdrawer != withdrawal.staker`, note that * any beaconChainETHStrategy shares in the `withdrawal` will be _returned to the staker_, rather than transferred to the withdrawer, unlike shares in * any other strategies, which will be transferred to the withdrawer. @@ -254,7 +286,6 @@ interface IDelegationManager is ISignatureUtils { function completeQueuedWithdrawal( Withdrawal calldata withdrawal, IERC20[] calldata tokens, - uint256 middlewareTimesIndex, bool receiveAsTokens ) external; @@ -263,97 +294,127 @@ interface IDelegationManager is ISignatureUtils { * Used to complete the specified `withdrawals`. The function caller must match `withdrawals[...].withdrawer` * @param withdrawals The Withdrawals to complete. * @param tokens Array of tokens for each Withdrawal. See `completeQueuedWithdrawal` for the usage of a single array. - * @param middlewareTimesIndexes One index to reference per Withdrawal. See `completeQueuedWithdrawal` for the usage of a single index. * @param receiveAsTokens Whether or not to complete each withdrawal as tokens. See `completeQueuedWithdrawal` for the usage of a single boolean. * @dev See `completeQueuedWithdrawal` for relevant dev tags */ function completeQueuedWithdrawals( Withdrawal[] calldata withdrawals, IERC20[][] calldata tokens, - uint256[] calldata middlewareTimesIndexes, bool[] calldata receiveAsTokens ) external; /** - * @notice Increases a staker's delegated share balance in a strategy. + * @notice Increases a staker's delegated share balance in a strategy. Note that before adding to operator shares, + * the delegated shares are scaled according to the operator's total magnitude as part of slashing accounting. + * The staker's scaling factor is updated here. * @param staker The address to increase the delegated shares for their operator. * @param strategy The strategy in which to increase the delegated shares. - * @param shares The number of shares to increase. + * @param existingShares The number of shares the staker already has in the strategy. This is the shares amount stored in the + * StrategyManager/EigenPodManager for the staker's shares. + * @param addedShares The number of shares to added to the staker's shares in the strategy. This amount will be scaled prior to adding + * to the operator's scaled shares. * - * @dev *If the staker is actively delegated*, then increases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing. + * @dev *If the staker is actively delegated*, then increases the `staker`'s delegated scaled shares in `strategy` after scaling `shares`. + * Otherwise does nothing. * @dev Callable only by the StrategyManager or EigenPodManager. */ - function increaseDelegatedShares(address staker, IStrategy strategy, uint256 shares) external; + function increaseDelegatedShares( + address staker, + IStrategy strategy, + uint256 existingShares, + uint256 addedShares + ) external; /** - * @notice Decreases a staker's delegated share balance in a strategy. - * @param staker The address to increase the delegated shares for their operator. - * @param strategy The strategy in which to decrease the delegated shares. - * @param shares The number of shares to decrease. + * @notice Decreases a staker's delegated share balance in a strategy. Note that before removing from operator shares, + * the delegated shares are scaled according to the operator's total magnitude as part of slashing accounting. Unlike + * `increaseDelegatedShares`, the staker's scaling factor is not updated here. + * @param staker The address to increase the delegated scaled shares for their operator. + * @param strategy The strategy in which to decrease the delegated scaled shares. + * @param removedShares The number of shares to decremented for the strategy in the + * StrategyManager/EigenPodManager * - * @dev *If the staker is actively delegated*, then decreases the `staker`'s delegated shares in `strategy` by `shares`. Otherwise does nothing. + * @dev *If the staker is actively delegated*, then decreases the `staker`'s delegated scaled shares in `strategy` by `scaledShares`. Otherwise does nothing. * @dev Callable only by the StrategyManager or EigenPodManager. */ - function decreaseDelegatedShares(address staker, IStrategy strategy, uint256 shares) external; + function decreaseDelegatedShares(address staker, IStrategy strategy, uint256 removedShares) external; /** * @notice returns the address of the operator that `staker` is delegated to. * @notice Mapping: staker => operator whom the staker is currently delegated to. * @dev Note that returning address(0) indicates that the staker is not actively delegated to any operator. */ - function delegatedTo(address staker) external view returns (address); + function delegatedTo( + address staker + ) external view returns (address); /** * @notice Returns the OperatorDetails struct associated with an `operator`. */ - function operatorDetails(address operator) external view returns (OperatorDetails memory); + function operatorDetails( + address operator + ) external view returns (OperatorDetails memory); /** - * @notice Returns the delegationApprover account for an operator + * @notice Returns the AllocationDelayDetails struct associated with an `operator` + * @dev If the operator has not set an allocation delay, then the `isSet` field will be `false`. */ - function delegationApprover(address operator) external view returns (address); + function operatorAllocationDelay( + address operator + ) external view returns (AllocationDelayDetails memory); /** - * @notice Returns the stakerOptOutWindowBlocks for an operator + * @notice Returns the delegationApprover account for an operator */ - function stakerOptOutWindowBlocks(address operator) external view returns (uint256); + function delegationApprover( + address operator + ) external view returns (address); /** - * @notice Given array of strategies, returns array of shares for the operator + * @notice Returns the stakerOptOutWindowBlocks for an operator */ - function getOperatorShares( - address operator, - IStrategy[] memory strategies - ) external view returns (uint256[] memory); + function stakerOptOutWindowBlocks( + address operator + ) external view returns (uint256); /** * @notice Given a list of strategies, return the minimum number of blocks that must pass to withdraw * from all the inputted strategies. Return value is >= minWithdrawalDelayBlocks as this is the global min withdrawal delay. * @param strategies The strategies to check withdrawal delays for */ - function getWithdrawalDelay(IStrategy[] calldata strategies) external view returns (uint256); + function getWithdrawalDelay( + IStrategy[] calldata strategies + ) external view returns (uint256); /** - * @notice returns the total number of shares in `strategy` that are delegated to `operator`. - * @notice Mapping: operator => strategy => total number of shares in the strategy delegated to the operator. + * @notice returns the total number of scaled shares (i.e. shares scaled down by a factor of the `operator`'s + * totalMagnitude) in `strategy` that are delegated to `operator`. + * @notice Mapping: operator => strategy => total number of scaled shares in the strategy delegated to the operator. * @dev By design, the following invariant should hold for each Strategy: - * (operator's shares in delegation manager) = sum (shares above zero of all stakers delegated to operator) - * = sum (delegateable shares of all stakers delegated to the operator) + * (operator's scaled shares in delegation manager) = sum (scaled shares above zero of all stakers delegated to operator) + * = sum (delegateable scaled shares of all stakers delegated to the operator) + * @dev FKA `operatorShares` */ - function operatorShares(address operator, IStrategy strategy) external view returns (uint256); + function operatorScaledShares(address operator, IStrategy strategy) external view returns (uint256); /** * @notice Returns 'true' if `staker` *is* actively delegated, and 'false' otherwise. */ - function isDelegated(address staker) external view returns (bool); + function isDelegated( + address staker + ) external view returns (bool); /** * @notice Returns true is an operator has previously registered for delegation. */ - function isOperator(address operator) external view returns (bool); + function isOperator( + address operator + ) external view returns (bool); /// @notice Mapping: staker => number of signed delegation nonces (used in `delegateToBySignature`) from the staker that the contract has already checked - function stakerNonce(address staker) external view returns (uint256); + function stakerNonce( + address staker + ) external view returns (uint256); /** * @notice Mapping: delegationApprover => 32-byte salt => whether or not the salt has already been used by the delegationApprover. @@ -374,7 +435,9 @@ interface IDelegationManager is ISignatureUtils { * @notice Minimum delay enforced by this contract per Strategy for completing queued withdrawals. Measured in blocks, and adjustable by this contract's owner, * up to a maximum of `MAX_WITHDRAWAL_DELAY_BLOCKS`. Minimum value is 0 (i.e. no delay enforced). */ - function strategyWithdrawalDelayBlocks(IStrategy strategy) external view returns (uint256); + function strategyWithdrawalDelayBlocks( + IStrategy strategy + ) external view returns (uint256); /// @notice return address of the beaconChainETHStrategy function beaconChainETHStrategy() external view returns (IStrategy); @@ -441,8 +504,12 @@ interface IDelegationManager is ISignatureUtils { /// @notice Mapping: staker => cumulative number of queued withdrawals they have ever initiated. /// @dev This only increments (doesn't decrement), and is used to help ensure that otherwise identical withdrawals have unique hashes. - function cumulativeWithdrawalsQueued(address staker) external view returns (uint256); + function cumulativeWithdrawalsQueued( + address staker + ) external view returns (uint256); /// @notice Returns the keccak256 hash of `withdrawal`. - function calculateWithdrawalRoot(Withdrawal memory withdrawal) external pure returns (bytes32); + function calculateWithdrawalRoot( + Withdrawal memory withdrawal + ) external pure returns (bytes32); } diff --git a/src/contracts/interfaces/IEigen.sol b/src/contracts/interfaces/IEigen.sol index cd9279e55..0de79374b 100644 --- a/src/contracts/interfaces/IEigen.sol +++ b/src/contracts/interfaces/IEigen.sol @@ -31,12 +31,16 @@ interface IEigen is IERC20 { /** * @notice This function allows bEIGEN holders to wrap their tokens into Eigen */ - function wrap(uint256 amount) external; + function wrap( + uint256 amount + ) external; /** * @notice This function allows Eigen holders to unwrap their tokens into bEIGEN */ - function unwrap(uint256 amount) external; + function unwrap( + uint256 amount + ) external; /** * @dev Clock used for flagging checkpoints. Has been overridden to implement timestamp based diff --git a/src/contracts/interfaces/IEigenPod.sol b/src/contracts/interfaces/IEigenPod.sol index be96da52c..41ce7678d 100644 --- a/src/contracts/interfaces/IEigenPod.sol +++ b/src/contracts/interfaces/IEigenPod.sol @@ -89,7 +89,9 @@ interface IEigenPod { */ /// @notice Used to initialize the pointers to contracts crucial to the pod's functionality, in beacon proxy construction from EigenPodManager - function initialize(address owner) external; + function initialize( + address owner + ) external; /// @notice Called by EigenPodManager when the owner wants to create another ETH validator. function stake(bytes calldata pubkey, bytes calldata signature, bytes32 depositDataRoot) external payable; @@ -115,7 +117,9 @@ interface IEigenPod { * @param revertIfNoBalance Forces a revert if the pod ETH balance is 0. This allows the pod owner * to prevent accidentally starting a checkpoint that will not increase their shares */ - function startCheckpoint(bool revertIfNoBalance) external; + function startCheckpoint( + bool revertIfNoBalance + ) external; /** * @dev Progress the current checkpoint towards completion by submitting one or more validator @@ -200,7 +204,9 @@ interface IEigenPod { /// only address that can call these methods. /// @param newProofSubmitter The new proof submitter address. If set to 0, only the /// pod owner will be able to call `startCheckpoint` and `verifyWithdrawalCredentials` - function setProofSubmitter(address newProofSubmitter) external; + function setProofSubmitter( + address newProofSubmitter + ) external; /** * @@ -224,16 +230,24 @@ interface IEigenPod { function podOwner() external view returns (address); /// @notice Returns the validatorInfo struct for the provided pubkeyHash - function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) external view returns (ValidatorInfo memory); + function validatorPubkeyHashToInfo( + bytes32 validatorPubkeyHash + ) external view returns (ValidatorInfo memory); /// @notice Returns the validatorInfo struct for the provided pubkey - function validatorPubkeyToInfo(bytes calldata validatorPubkey) external view returns (ValidatorInfo memory); + function validatorPubkeyToInfo( + bytes calldata validatorPubkey + ) external view returns (ValidatorInfo memory); /// @notice This returns the status of a given validator - function validatorStatus(bytes32 pubkeyHash) external view returns (VALIDATOR_STATUS); + function validatorStatus( + bytes32 pubkeyHash + ) external view returns (VALIDATOR_STATUS); /// @notice This returns the status of a given validator pubkey - function validatorStatus(bytes calldata validatorPubkey) external view returns (VALIDATOR_STATUS); + function validatorStatus( + bytes calldata validatorPubkey + ) external view returns (VALIDATOR_STATUS); /// @notice Number of validators with proven withdrawal credentials, who do not have proven full withdrawals function activeValidatorCount() external view returns (uint256); @@ -275,11 +289,15 @@ interface IEigenPod { /// - The final partial withdrawal for an exited validator will be likely be included in this mapping. /// i.e. if a validator was last checkpointed at 32.1 ETH before exiting, the next checkpoint will calculate their /// "exited" amount to be 32.1 ETH rather than 32 ETH. - function checkpointBalanceExitedGwei(uint64) external view returns (uint64); + function checkpointBalanceExitedGwei( + uint64 + ) external view returns (uint64); /// @notice Query the 4788 oracle to get the parent block root of the slot with the given `timestamp` /// @param timestamp of the block for which the parent block root will be returned. MUST correspond /// to an existing slot within the last 24 hours. If the slot at `timestamp` was skipped, this method /// will revert. - function getParentBlockRoot(uint64 timestamp) external view returns (bytes32); + function getParentBlockRoot( + uint64 timestamp + ) external view returns (bytes32); } diff --git a/src/contracts/interfaces/IEigenPodManager.sol b/src/contracts/interfaces/IEigenPodManager.sol index cbe253382..f752aec06 100644 --- a/src/contracts/interfaces/IEigenPodManager.sol +++ b/src/contracts/interfaces/IEigenPodManager.sol @@ -64,10 +64,14 @@ interface IEigenPodManager is IPausable { function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) external; /// @notice Returns the address of the `podOwner`'s EigenPod if it has been deployed. - function ownerToPod(address podOwner) external view returns (IEigenPod); + function ownerToPod( + address podOwner + ) external view returns (IEigenPod); /// @notice Returns the address of the `podOwner`'s EigenPod (whether it is deployed yet or not). - function getPod(address podOwner) external view returns (IEigenPod); + function getPod( + address podOwner + ) external view returns (IEigenPod); /// @notice The ETH2 Deposit Contract function ethPOS() external view returns (IETHPOSDeposit); @@ -82,7 +86,9 @@ interface IEigenPodManager is IPausable { function slasher() external view returns (ISlasher); /// @notice Returns 'true' if the `podOwner` has created an EigenPod, and 'false' otherwise. - function hasPod(address podOwner) external view returns (bool); + function hasPod( + address podOwner + ) external view returns (bool); /// @notice Returns the number of EigenPods that have been created function numPods() external view returns (uint256); @@ -95,7 +101,9 @@ interface IEigenPodManager is IPausable { * Likewise, when a withdrawal is completed, this "deficit" is decreased and the withdrawal amount is decreased; We can think of this * as the withdrawal "paying off the deficit". */ - function podOwnerShares(address podOwner) external view returns (int256); + function podOwnerShares( + address podOwner + ) external view returns (int256); /// @notice returns canonical, virtual beaconChainETH strategy function beaconChainETHStrategy() external view returns (IStrategy); @@ -114,10 +122,14 @@ interface IEigenPodManager is IPausable { * @notice Increases the `podOwner`'s shares by `shares`, paying off deficit if possible. * Used by the DelegationManager to award a pod owner shares on exiting the withdrawal queue * @dev Returns the number of shares added to `podOwnerShares[podOwner]` above zero, which will be less than the `shares` input - * in the event that the podOwner has an existing shares deficit (i.e. `podOwnerShares[podOwner]` starts below zero) + * in the event that the podOwner has an existing shares deficit (i.e. `podOwnerShares[podOwner]` starts below zero). + * Also returns existingPodShares prior to adding shares, this is returned as 0 if the existing podOwnerShares is negative * @dev Reverts if `shares` is not a whole Gwei amount */ - function addShares(address podOwner, uint256 shares) external returns (uint256); + function addShares( + address podOwner, + uint256 shares + ) external returns (uint256 increaseInDelegateableShares, uint256 existingPodShares); /** * @notice Used by the DelegationManager to complete a withdrawal, sending tokens to some destination address diff --git a/src/contracts/interfaces/IPausable.sol b/src/contracts/interfaces/IPausable.sol index 061712653..1ed5f04f7 100644 --- a/src/contracts/interfaces/IPausable.sol +++ b/src/contracts/interfaces/IPausable.sol @@ -38,7 +38,9 @@ interface IPausable { * @param newPausedStatus represents the new value for `_paused` to take, which means it may flip several bits at once. * @dev This function can only pause functionality, and thus cannot 'unflip' any bit in `_paused` from 1 to 0. */ - function pause(uint256 newPausedStatus) external; + function pause( + uint256 newPausedStatus + ) external; /** * @notice Alias for `pause(type(uint256).max)`. @@ -51,14 +53,20 @@ interface IPausable { * @param newPausedStatus represents the new value for `_paused` to take, which means it may flip several bits at once. * @dev This function can only unpause functionality, and thus cannot 'flip' any bit in `_paused` from 0 to 1. */ - function unpause(uint256 newPausedStatus) external; + function unpause( + uint256 newPausedStatus + ) external; /// @notice Returns the current paused status as a uint256. function paused() external view returns (uint256); /// @notice Returns 'true' if the `indexed`th bit of `_paused` is 1, and 'false' otherwise - function paused(uint8 index) external view returns (bool); + function paused( + uint8 index + ) external view returns (bool); /// @notice Allows the unpauser to set a new pauser registry - function setPauserRegistry(IPauserRegistry newPauserRegistry) external; + function setPauserRegistry( + IPauserRegistry newPauserRegistry + ) external; } diff --git a/src/contracts/interfaces/IPauserRegistry.sol b/src/contracts/interfaces/IPauserRegistry.sol index cd0b95546..c636ee91a 100644 --- a/src/contracts/interfaces/IPauserRegistry.sol +++ b/src/contracts/interfaces/IPauserRegistry.sol @@ -12,7 +12,9 @@ interface IPauserRegistry { event UnpauserChanged(address previousUnpauser, address newUnpauser); /// @notice Mapping of addresses to whether they hold the pauser role. - function isPauser(address pauser) external view returns (bool); + function isPauser( + address pauser + ) external view returns (bool); /// @notice Unique address that holds the unpauser role. Capable of changing *both* the pauser and unpauser addresses. function unpauser() external view returns (address); diff --git a/src/contracts/interfaces/IRewardsCoordinator.sol b/src/contracts/interfaces/IRewardsCoordinator.sol index dd95ff5cb..349d8562b 100644 --- a/src/contracts/interfaces/IRewardsCoordinator.sol +++ b/src/contracts/interfaces/IRewardsCoordinator.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "./IAVSDirectory.sol"; import "./IStrategy.sol"; /** @@ -15,6 +16,12 @@ import "./IStrategy.sol"; */ interface IRewardsCoordinator { /// STRUCTS /// + + /// @notice Reward type + enum RewardType { + DELEGATED_STAKE + } + /** * @notice A linear combination of strategies and multipliers for AVSs to weigh * EigenLayer strategies. @@ -59,6 +66,32 @@ interface IRewardsCoordinator { uint32 startTimestamp; uint32 duration; } + /** + * @notice OperatorSetRewardsSubmission struct submitted by AVSs when making rewards to operatorSets + * @notice The retroactive range applies from RewardsSubmission + * @param RewardType The type of reward to be distributed for. + * @param operatorSetId The operatorSetId to distribute rewards to + * @param strategiesAndMultipliers The strategies and their relative weights + * cannot have duplicate strategies and need to be sorted in ascending address order + * @param token The rewards token to be distributed + * @param amount The total amount of tokens to be distributed + * @param startTimestamp The timestamp (seconds) at which the submission range is considered for distribution + * could start in the past or in the future but within a valid range. See the diagram above. + * @param duration The duration of the submission range in seconds. Must be <= MAX_REWARDS_DURATION + * @dev The sliding window from `RewardsSubmission` applies to `OperatorSetRewardsSubmission`, with + * using `OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP` instead of `GENESIS_REWARDS_TIMESTAMP` and + * `OPERATOR_SET_MAX_RETROACTIVE_LENGTH` instead of `MAX_RETROACTIVE_LENGTH` + */ + + struct OperatorSetRewardsSubmission { + RewardType rewardType; + uint32 operatorSetId; + StrategyAndMultiplier[] strategiesAndMultipliers; + IERC20 token; + uint256 amount; + uint32 startTimestamp; + uint32 duration; + } /** * @notice A distribution root is a merkle root of the distribution of earnings for a given period. @@ -127,6 +160,12 @@ interface IRewardsCoordinator { TokenTreeMerkleLeaf[] tokenLeaves; } + /// @notice used for setting operator commission bips per operator set + struct OperatorCommissionUpdate { + uint16 commissionBips; + uint32 effectTimestamp; + } + /// EVENTS /// /// @notice emitted when an AVS creates a valid RewardsSubmission @@ -136,6 +175,15 @@ interface IRewardsCoordinator { bytes32 indexed rewardsSubmissionHash, RewardsSubmission rewardsSubmission ); + + /// @notice emitted when an AVS creates a valid OperatorSetRewardsSubmission + event OperatorSetRewardCreated( + address indexed avs, + uint256 indexed submissionNonce, + bytes32 indexed rewardsSubmissionHash, + OperatorSetRewardsSubmission rewardsSubmission + ); + /// @notice emitted when a valid RewardsSubmission is created for all stakers by a valid submitter event RewardsSubmissionForAllCreated( address indexed submitter, @@ -143,14 +191,27 @@ interface IRewardsCoordinator { bytes32 indexed rewardsSubmissionHash, RewardsSubmission rewardsSubmission ); + /// @notice rewardsUpdater is responsible for submiting DistributionRoots, only owner can set rewardsUpdater event RewardsUpdaterSet(address indexed oldRewardsUpdater, address indexed newRewardsUpdater); + event RewardsForAllSubmitterSet( address indexed rewardsForAllSubmitter, bool indexed oldValue, bool indexed newValue ); + event ActivationDelaySet(uint32 oldActivationDelay, uint32 newActivationDelay); + event GlobalCommissionBipsSet(uint16 oldGlobalCommissionBips, uint16 newGlobalCommissionBips); + /// @notice emitted when an operator commission is set for a specific OperatorSet and RewardType + event OperatorCommissionUpdated( + address indexed operator, + OperatorSet indexed operatorSet, + RewardType rewardType, + uint16 newCommissionBips, + uint32 effectTimestamp + ); event ClaimerForSet(address indexed earner, address indexed oldClaimer, address indexed claimer); + /// @notice rootIndex is the specific array index of the newly created root in the storage array event DistributionRootSubmitted( uint32 indexed rootIndex, @@ -158,7 +219,9 @@ interface IRewardsCoordinator { uint32 indexed rewardsCalculationEndTimestamp, uint32 activatedAt ); + event DistributionRootDisabled(uint32 indexed rootIndex); + /// @notice root is one of the submitted distribution roots that was claimed against event RewardsClaimed( bytes32 root, @@ -200,7 +263,9 @@ interface IRewardsCoordinator { function activationDelay() external view returns (uint32); /// @notice Mapping: earner => the address of the entity who can call `processClaim` on behalf of the earner - function claimerFor(address earner) external view returns (address); + function claimerFor( + address earner + ) external view returns (address); /// @notice Mapping: claimer => token => total amount claimed function cumulativeClaimed(address claimer, IERC20 token) external view returns (uint256); @@ -210,17 +275,27 @@ interface IRewardsCoordinator { /// @notice the commission for a specific operator for a specific avs /// NOTE: Currently unused and simply returns the globalOperatorCommissionBips value but will be used in future release - function operatorCommissionBips(address operator, address avs) external view returns (uint16); + function getOperatorCommissionBips( + address operator, + OperatorSet calldata operatorSet, + RewardType rewardType + ) external view returns (uint16); /// @notice return the hash of the earner's leaf - function calculateEarnerLeafHash(EarnerTreeMerkleLeaf calldata leaf) external pure returns (bytes32); + function calculateEarnerLeafHash( + EarnerTreeMerkleLeaf calldata leaf + ) external pure returns (bytes32); /// @notice returns the hash of the earner's token leaf - function calculateTokenLeafHash(TokenTreeMerkleLeaf calldata leaf) external pure returns (bytes32); + function calculateTokenLeafHash( + TokenTreeMerkleLeaf calldata leaf + ) external pure returns (bytes32); /// @notice returns 'true' if the claim would currently pass the check in `processClaims` /// but will revert if not valid - function checkClaim(RewardsMerkleClaim calldata claim) external view returns (bool); + function checkClaim( + RewardsMerkleClaim calldata claim + ) external view returns (bool); /// @notice The timestamp until which RewardsSubmissions have been calculated function currRewardsCalculationEndTimestamp() external view returns (uint32); @@ -229,7 +304,9 @@ interface IRewardsCoordinator { function getDistributionRootsLength() external view returns (uint256); /// @notice returns the distributionRoot at the specified index - function getDistributionRootAtIndex(uint256 index) external view returns (DistributionRoot memory); + function getDistributionRootAtIndex( + uint256 index + ) external view returns (DistributionRoot memory); /// @notice returns the current distributionRoot function getCurrentDistributionRoot() external view returns (DistributionRoot memory); @@ -239,7 +316,16 @@ interface IRewardsCoordinator { function getCurrentClaimableDistributionRoot() external view returns (DistributionRoot memory); /// @notice loop through distribution roots from reverse and return index from hash - function getRootIndexFromHash(bytes32 rootHash) external view returns (uint32); + function getRootIndexFromHash( + bytes32 rootHash + ) external view returns (uint32); + + /// @notice returns the length of the operator commission update history + function getOperatorCommissionUpdateHistoryLength( + address operator, + OperatorSet calldata operatorSet, + RewardType rewardType + ) external view returns (uint256); /** * @@ -248,7 +334,9 @@ interface IRewardsCoordinator { */ /** - * @notice Creates a new rewards submission on behalf of an AVS, to be split amongst the + * @notice Legacy interface to be DEPRECATED in future releases. See rewardOperatorSetForRange + * for a more updated interface. + * Creates a new rewards submission on behalf of an AVS, to be split amongst the * set of stakers delegated to operators who are registered to the `avs` * @param rewardsSubmissions The rewards submissions being created * @dev Expected to be called by the ServiceManager of the AVS on behalf of which the submission is being made @@ -258,14 +346,35 @@ interface IRewardsCoordinator { * @dev This function will revert if the `rewardsSubmission` is malformed, * e.g. if the `strategies` and `weights` arrays are of non-equal lengths */ - function createAVSRewardsSubmission(RewardsSubmission[] calldata rewardsSubmissions) external; + function createAVSRewardsSubmission( + RewardsSubmission[] calldata rewardsSubmissions + ) external; + + /** + * @notice Creates a new rewards submission on behalf of an AVS for a given operatorSet, + * to be split amongst the set of stakers delegated to operators who are + * registered to the msg.sender AVS and the given operatorSetId + * + * @param rewardsSubmissions The operatorSet rewards submission being created for + * + * @dev msg.sender is the AVS in the operatorSet the rewards submission is being made to + * @dev AVSs set their reward type depending on what metric they want rewards + * distributed proportional to + * @dev The tokens in the rewards submissions are sent to the `RewardsCoordinator` contract + * @dev Strategies of each rewards submission must be in ascending order of addresses to check for duplicates + */ + function rewardOperatorSetForRange( + OperatorSetRewardsSubmission[] calldata rewardsSubmissions + ) external; /** * @notice similar to `createAVSRewardsSubmission` except the rewards are split amongst *all* stakers * rather than just those delegated to operators who are registered to a single avs and is * a permissioned call based on isRewardsForAllSubmitter mapping. */ - function createRewardsForAllSubmission(RewardsSubmission[] calldata rewardsSubmission) external; + function createRewardsForAllSubmission( + RewardsSubmission[] calldata rewardsSubmission + ) external; /** * @notice Claim rewards against a given root (read from _distributionRoots[claim.rootIndex]). @@ -293,34 +402,44 @@ interface IRewardsCoordinator { * @notice allow the rewardsUpdater to disable/cancel a pending root submission in case of an error * @param rootIndex The index of the root to be disabled */ - function disableRoot(uint32 rootIndex) external; + function disableRoot( + uint32 rootIndex + ) external; /** * @notice Sets the address of the entity that can call `processClaim` on behalf of the earner (msg.sender) * @param claimer The address of the entity that can claim rewards on behalf of the earner * @dev Only callable by the `earner` */ - function setClaimerFor(address claimer) external; + function setClaimerFor( + address claimer + ) external; /** * @notice Sets the delay in timestamp before a posted root can be claimed against * @param _activationDelay Delay in timestamp (seconds) before a posted root can be claimed against * @dev Only callable by the contract owner */ - function setActivationDelay(uint32 _activationDelay) external; + function setActivationDelay( + uint32 _activationDelay + ) external; /** * @notice Sets the global commission for all operators across all avss * @param _globalCommissionBips The commission for all operators across all avss * @dev Only callable by the contract owner */ - function setGlobalOperatorCommission(uint16 _globalCommissionBips) external; + function setGlobalOperatorCommission( + uint16 _globalCommissionBips + ) external; /** * @notice Sets the permissioned `rewardsUpdater` address which can post new roots * @dev Only callable by the contract owner */ - function setRewardsUpdater(address _rewardsUpdater) external; + function setRewardsUpdater( + address _rewardsUpdater + ) external; /** * @notice Sets the permissioned `rewardsForAllSubmitter` address which can submit createRewardsForAllSubmission @@ -329,4 +448,20 @@ interface IRewardsCoordinator { * @param _newValue The new value for isRewardsForAllSubmitter */ function setRewardsForAllSubmitter(address _submitter, bool _newValue) external; + + /** + * @notice Sets the commission an operator takes in bips for a given reward type and operatorSet + * @param operatorSet The operatorSet to update commission for + * @param rewardType The associated rewardType to update commission for + * @param commissionBips The commission in bips for the operator, must be <= MAX_COMMISSION_BIPS + * @return effectTimestamp The timestamp at which the operator commission update will take effect + * + * @dev The commission can range from 1 to 10000 + * @dev The commission update takes effect after 7 days + */ + function setOperatorCommissionBips( + OperatorSet calldata operatorSet, + RewardType rewardType, + uint16 commissionBips + ) external returns (uint32); } diff --git a/src/contracts/interfaces/ISlasher.sol b/src/contracts/interfaces/ISlasher.sol index f2b4952be..1cd77b996 100644 --- a/src/contracts/interfaces/ISlasher.sol +++ b/src/contracts/interfaces/ISlasher.sol @@ -55,7 +55,9 @@ interface ISlasher { * @notice Gives the `contractAddress` permission to slash the funds of the caller. * @dev Typically, this function must be called prior to registering for a middleware. */ - function optIntoSlashing(address contractAddress) external; + function optIntoSlashing( + address contractAddress + ) external; /** * @notice Used for 'slashing' a certain operator. @@ -63,13 +65,17 @@ interface ISlasher { * @dev Technically the operator is 'frozen' (hence the name of this function), and then subject to slashing pending a decision by a human-in-the-loop. * @dev The operator must have previously given the caller (which should be a contract) the ability to slash them, through a call to `optIntoSlashing`. */ - function freezeOperator(address toBeFrozen) external; + function freezeOperator( + address toBeFrozen + ) external; /** * @notice Removes the 'frozen' status from each of the `frozenAddresses` * @dev Callable only by the contract owner (i.e. governance). */ - function resetFrozenStatus(address[] calldata frozenAddresses) external; + function resetFrozenStatus( + address[] calldata frozenAddresses + ) external; /** * @notice this function is a called by middlewares during an operator's registration to make sure the operator's stake at registration @@ -121,7 +127,9 @@ interface ISlasher { * @return Returns 'true' if `staker` themselves has their status set to frozen, OR if the staker is delegated * to an operator who has their status set to frozen. Otherwise returns 'false'. */ - function isFrozen(address staker) external view returns (bool); + function isFrozen( + address staker + ) external view returns (bool); /// @notice Returns true if `slashingContract` is currently allowed to slash `toBeSlashed`. function canSlash(address toBeSlashed, address slashingContract) external view returns (bool); @@ -171,7 +179,9 @@ interface ISlasher { ) external view returns (MiddlewareTimes memory); /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator].length` - function middlewareTimesLength(address operator) external view returns (uint256); + function middlewareTimesLength( + address operator + ) external view returns (uint256); /// @notice Getter function for fetching `operatorToMiddlewareTimes[operator][index].stalestUpdateBlock`. function getMiddlewareTimesIndexStalestUpdateBlock(address operator, uint32 index) external view returns (uint32); @@ -180,7 +190,9 @@ interface ISlasher { function getMiddlewareTimesIndexServeUntilBlock(address operator, uint32 index) external view returns (uint32); /// @notice Getter function for fetching `_operatorToWhitelistedContractsByUpdate[operator].size`. - function operatorWhitelistedContractsLinkedListSize(address operator) external view returns (uint256); + function operatorWhitelistedContractsLinkedListSize( + address operator + ) external view returns (uint256); /// @notice Getter function for fetching a single node in the operator's linked list (`_operatorToWhitelistedContractsByUpdate[operator]`). function operatorWhitelistedContractsLinkedListEntry( diff --git a/src/contracts/interfaces/ISocketUpdater.sol b/src/contracts/interfaces/ISocketUpdater.sol index df95d4ab0..2a4f2e651 100644 --- a/src/contracts/interfaces/ISocketUpdater.sol +++ b/src/contracts/interfaces/ISocketUpdater.sol @@ -16,5 +16,7 @@ interface ISocketUpdater { * @notice Updates the socket of the msg.sender given they are a registered operator * @param socket is the new socket of the operator */ - function updateSocket(string memory socket) external; + function updateSocket( + string memory socket + ) external; } diff --git a/src/contracts/interfaces/IStrategy.sol b/src/contracts/interfaces/IStrategy.sol index e7a6f684d..afe7e7198 100644 --- a/src/contracts/interfaces/IStrategy.sol +++ b/src/contracts/interfaces/IStrategy.sol @@ -52,7 +52,9 @@ interface IStrategy { * @return The amount of underlying tokens corresponding to the input `amountShares` * @dev Implementation for these functions in particular may vary significantly for different strategies */ - function sharesToUnderlying(uint256 amountShares) external returns (uint256); + function sharesToUnderlying( + uint256 amountShares + ) external returns (uint256); /** * @notice Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy. @@ -61,19 +63,25 @@ interface IStrategy { * @return The amount of underlying tokens corresponding to the input `amountShares` * @dev Implementation for these functions in particular may vary significantly for different strategies */ - function underlyingToShares(uint256 amountUnderlying) external returns (uint256); + function underlyingToShares( + uint256 amountUnderlying + ) external returns (uint256); /** * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in * this strategy. In contrast to `userUnderlyingView`, this function **may** make state modifications */ - function userUnderlying(address user) external returns (uint256); + function userUnderlying( + address user + ) external returns (uint256); /** * @notice convenience function for fetching the current total shares of `user` in this strategy, by * querying the `strategyManager` contract */ - function shares(address user) external view returns (uint256); + function shares( + address user + ) external view returns (uint256); /** * @notice Used to convert a number of shares to the equivalent amount of underlying tokens for this strategy. @@ -82,7 +90,9 @@ interface IStrategy { * @return The amount of shares corresponding to the input `amountUnderlying` * @dev Implementation for these functions in particular may vary significantly for different strategies */ - function sharesToUnderlyingView(uint256 amountShares) external view returns (uint256); + function sharesToUnderlyingView( + uint256 amountShares + ) external view returns (uint256); /** * @notice Used to convert an amount of underlying tokens to the equivalent amount of shares in this strategy. @@ -91,13 +101,17 @@ interface IStrategy { * @return The amount of shares corresponding to the input `amountUnderlying` * @dev Implementation for these functions in particular may vary significantly for different strategies */ - function underlyingToSharesView(uint256 amountUnderlying) external view returns (uint256); + function underlyingToSharesView( + uint256 amountUnderlying + ) external view returns (uint256); /** * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in * this strategy. In contrast to `userUnderlying`, this function guarantees no state modifications */ - function userUnderlyingView(address user) external view returns (uint256); + function userUnderlyingView( + address user + ) external view returns (uint256); /// @notice The underlying token for shares in this Strategy function underlyingToken() external view returns (IERC20); diff --git a/src/contracts/interfaces/IStrategyFactory.sol b/src/contracts/interfaces/IStrategyFactory.sol index 85dab8cd0..de2713ea5 100644 --- a/src/contracts/interfaces/IStrategyFactory.sol +++ b/src/contracts/interfaces/IStrategyFactory.sol @@ -24,7 +24,9 @@ interface IStrategyFactory { /// though deployNewStrategy does whitelist by default. /// These strategies MIGHT not be the only strategy for the underlying token /// as additional strategies can be whitelisted by the owner of the factory. - function deployedStrategies(IERC20 token) external view returns (IStrategy); + function deployedStrategies( + IERC20 token + ) external view returns (IStrategy); /** * @notice Deploy a new strategyBeacon contract for the ERC20 token. @@ -33,7 +35,9 @@ interface IStrategyFactory { * $dev Immense caution is warranted for non-standard ERC20 tokens, particularly "reentrant" tokens * like those that conform to ERC777. */ - function deployNewStrategy(IERC20 token) external returns (IStrategy newStrategy); + function deployNewStrategy( + IERC20 token + ) external returns (IStrategy newStrategy); /** * @notice Owner-only function to pass through a call to `StrategyManager.addStrategiesToDepositWhitelist` @@ -51,7 +55,9 @@ interface IStrategyFactory { /** * @notice Owner-only function to pass through a call to `StrategyManager.removeStrategiesFromDepositWhitelist` */ - function removeStrategiesFromWhitelist(IStrategy[] calldata strategiesToRemoveFromWhitelist) external; + function removeStrategiesFromWhitelist( + IStrategy[] calldata strategiesToRemoveFromWhitelist + ) external; /// @notice Emitted when the `strategyBeacon` is changed event StrategyBeaconModified(IBeacon previousBeacon, IBeacon newBeacon); diff --git a/src/contracts/interfaces/IStrategyManager.sol b/src/contracts/interfaces/IStrategyManager.sol index 565b301cd..0989bc3a5 100644 --- a/src/contracts/interfaces/IStrategyManager.sol +++ b/src/contracts/interfaces/IStrategyManager.sol @@ -82,9 +82,14 @@ interface IStrategyManager { function removeShares(address staker, IStrategy strategy, uint256 shares) external; /// @notice Used by the DelegationManager to award a Staker some shares that have passed through the withdrawal queue - function addShares(address staker, IERC20 token, IStrategy strategy, uint256 shares) external; + function addShares( + address staker, + IERC20 token, + IStrategy strategy, + uint256 shares + ) external returns (uint256 existingShares); - /// @notice Used by the DelegationManager to convert withdrawn shares to tokens and send them to a recipient + /// @notice Used by the DelegationManager to convert withdrawn descaled shares to tokens and send them to a recipient function withdrawSharesAsTokens(address recipient, IStrategy strategy, uint256 shares, IERC20 token) external; /// @notice Returns the current shares of `user` in `strategy` @@ -94,10 +99,14 @@ interface IStrategyManager { * @notice Get all details on the staker's deposits and corresponding shares * @return (staker's strategies, shares in these strategies) */ - function getDeposits(address staker) external view returns (IStrategy[] memory, uint256[] memory); + function getDeposits( + address staker + ) external view returns (IStrategy[] memory, uint256[] memory); /// @notice Simple getter function that returns `stakerStrategyList[staker].length`. - function stakerStrategyListLength(address staker) external view returns (uint256); + function stakerStrategyListLength( + address staker + ) external view returns (uint256); /** * @notice Owner-only function that adds the provided Strategies to the 'whitelist' of strategies that stakers can deposit into @@ -113,7 +122,9 @@ interface IStrategyManager { * @notice Owner-only function that removes the provided Strategies from the 'whitelist' of strategies that stakers can deposit into * @param strategiesToRemoveFromWhitelist Strategies that will be removed to the `strategyIsWhitelistedForDeposit` mapping (if they are in it) */ - function removeStrategiesFromDepositWhitelist(IStrategy[] calldata strategiesToRemoveFromWhitelist) external; + function removeStrategiesFromDepositWhitelist( + IStrategy[] calldata strategiesToRemoveFromWhitelist + ) external; /** * If true for a strategy, a user cannot depositIntoStrategyWithSignature into that strategy for another staker @@ -137,11 +148,15 @@ interface IStrategyManager { function strategyWhitelister() external view returns (address); /// @notice Returns bool for whether or not `strategy` is whitelisted for deposit - function strategyIsWhitelistedForDeposit(IStrategy strategy) external view returns (bool); + function strategyIsWhitelistedForDeposit( + IStrategy strategy + ) external view returns (bool); /** * @notice Returns bool for whether or not `strategy` enables credit transfers. i.e enabling * depositIntoStrategyWithSignature calls or queueing withdrawals to a different address than the staker. */ - function thirdPartyTransfersForbidden(IStrategy strategy) external view returns (bool); + function thirdPartyTransfersForbidden( + IStrategy strategy + ) external view returns (bool); } diff --git a/src/contracts/interfaces/IWhitelister.sol b/src/contracts/interfaces/IWhitelister.sol index da68992c8..1afdce118 100644 --- a/src/contracts/interfaces/IWhitelister.sol +++ b/src/contracts/interfaces/IWhitelister.sol @@ -11,9 +11,13 @@ import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Create2.sol"; interface IWhitelister { - function whitelist(address operator) external; + function whitelist( + address operator + ) external; - function getStaker(address operator) external returns (address); + function getStaker( + address operator + ) external returns (address); function depositIntoStrategy( address staker, diff --git a/src/contracts/libraries/BeaconChainProofs.sol b/src/contracts/libraries/BeaconChainProofs.sol index 9d0caa8d9..41f023f0a 100644 --- a/src/contracts/libraries/BeaconChainProofs.sol +++ b/src/contracts/libraries/BeaconChainProofs.sol @@ -274,32 +274,44 @@ library BeaconChainProofs { /// (See https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#validator) /// @dev Retrieves a validator's pubkey hash - function getPubkeyHash(bytes32[] memory validatorFields) internal pure returns (bytes32) { + function getPubkeyHash( + bytes32[] memory validatorFields + ) internal pure returns (bytes32) { return validatorFields[VALIDATOR_PUBKEY_INDEX]; } /// @dev Retrieves a validator's withdrawal credentials - function getWithdrawalCredentials(bytes32[] memory validatorFields) internal pure returns (bytes32) { + function getWithdrawalCredentials( + bytes32[] memory validatorFields + ) internal pure returns (bytes32) { return validatorFields[VALIDATOR_WITHDRAWAL_CREDENTIALS_INDEX]; } /// @dev Retrieves a validator's effective balance (in gwei) - function getEffectiveBalanceGwei(bytes32[] memory validatorFields) internal pure returns (uint64) { + function getEffectiveBalanceGwei( + bytes32[] memory validatorFields + ) internal pure returns (uint64) { return Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_BALANCE_INDEX]); } /// @dev Retrieves a validator's activation epoch - function getActivationEpoch(bytes32[] memory validatorFields) internal pure returns (uint64) { + function getActivationEpoch( + bytes32[] memory validatorFields + ) internal pure returns (uint64) { return Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_ACTIVATION_EPOCH_INDEX]); } /// @dev Retrieves true IFF a validator is marked slashed - function isValidatorSlashed(bytes32[] memory validatorFields) internal pure returns (bool) { + function isValidatorSlashed( + bytes32[] memory validatorFields + ) internal pure returns (bool) { return validatorFields[VALIDATOR_SLASHED_INDEX] != 0; } /// @dev Retrieves a validator's exit epoch - function getExitEpoch(bytes32[] memory validatorFields) internal pure returns (uint64) { + function getExitEpoch( + bytes32[] memory validatorFields + ) internal pure returns (uint64) { return Endian.fromLittleEndianUint64(validatorFields[VALIDATOR_EXIT_EPOCH_INDEX]); } } diff --git a/src/contracts/libraries/Endian.sol b/src/contracts/libraries/Endian.sol index f9799bb9e..56233cda2 100644 --- a/src/contracts/libraries/Endian.sol +++ b/src/contracts/libraries/Endian.sol @@ -9,7 +9,9 @@ library Endian { * @dev Note that the input is formatted as a 'bytes32' type (i.e. 256 bits), but it is immediately truncated to a uint64 (i.e. 64 bits) * through a right-shift/shr operation. */ - function fromLittleEndianUint64(bytes32 lenum) internal pure returns (uint64 n) { + function fromLittleEndianUint64( + bytes32 lenum + ) internal pure returns (uint64 n) { // the number needs to be stored in little-endian encoding (ie in bytes 0-8) n = uint64(uint256(lenum >> 192)); // forgefmt: disable-next-item diff --git a/src/contracts/libraries/Merkle.sol b/src/contracts/libraries/Merkle.sol index 5b7635423..ff0bce080 100644 --- a/src/contracts/libraries/Merkle.sol +++ b/src/contracts/libraries/Merkle.sol @@ -140,7 +140,9 @@ library Merkle { * @return The computed Merkle root of the tree. * @dev A pre-condition to this function is that leaves.length is a power of two. If not, the function will merkleize the inputs incorrectly. */ - function merkleizeSha256(bytes32[] memory leaves) internal pure returns (bytes32) { + function merkleizeSha256( + bytes32[] memory leaves + ) internal pure returns (bytes32) { //there are half as many nodes in the layer above the leaves uint256 numNodesInLayer = leaves.length / 2; //create a layer to store the internal nodes diff --git a/src/contracts/libraries/SlashingConstants.sol b/src/contracts/libraries/SlashingConstants.sol new file mode 100644 index 000000000..cb92ae69b --- /dev/null +++ b/src/contracts/libraries/SlashingConstants.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "../interfaces/IAVSDirectory.sol"; + +library SlashingConstants { + /// @dev The initial total magnitude for an operator + uint64 public constant INITIAL_TOTAL_MAGNITUDE = 1e18; + + /// @notice that stakerScalingFactor and totalMagnitude have initial default values to 1e18 as "1" + /// to preserve precision with uint256 math. We use `PRECISION_FACTOR` where these variables are used + /// and divide to represent as 1 + uint256 public constant PRECISION_FACTOR = 1e18; + uint256 public constant PRECISION_FACTOR_SQUARED = 1e36; + + /// @dev Delay before deallocations are completable and can be added back into freeMagnitude + uint32 public constant DEALLOCATION_DELAY = 17.5 days; +} diff --git a/src/contracts/libraries/Snapshots.sol b/src/contracts/libraries/Snapshots.sol new file mode 100644 index 000000000..2938065bd --- /dev/null +++ b/src/contracts/libraries/Snapshots.sol @@ -0,0 +1,289 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "@openzeppelin-upgrades-v4.9.0/contracts/utils/math/MathUpgradeable.sol"; +import "@openzeppelin-upgrades-v4.9.0/contracts/utils/math/SafeCastUpgradeable.sol"; + +/** + * @title Library for handling snapshots as part of allocating and slashing. + * @notice This library is using OpenZeppelin's CheckpointsUpgradeable library (v4.9.0) + * and removes structs and functions that are unessential. + * Interfaces and structs are renamed for clarity and usage (timestamps, etc). + * Some additional functions have also been added for convenience. + * @dev This library defines the `History` struct, for snapshotting values as they change at different points in + * time, and later looking up past values by block number. See {Votes} as an example. + * + * To create a history of snapshots define a variable type `Snapshots.History` in your contract, and store a new + * snapshot for the current transaction block using the {push} function. + * + * _Available since v4.5._ + */ +library Snapshots { + struct History { + Snapshot[] _snapshots; + } + + struct Snapshot { + uint32 _key; + uint224 _value; + } + + /** + * @dev Pushes a (`key`, `value`) pair into a History so that it is stored as the snapshot. + * + * Returns previous value and new value. + */ + function push(History storage self, uint32 key, uint224 value) internal returns (uint224, uint224) { + return _insert(self._snapshots, key, value); + } + + /** + * @dev Returns the value in the first (oldest) snapshot with key greater or equal than the search key, or zero if there is none. + */ + function lowerLookup(History storage self, uint32 key) internal view returns (uint224) { + uint256 len = self._snapshots.length; + uint256 pos = _lowerBinaryLookup(self._snapshots, key, 0, len); + return pos == len ? 0 : _unsafeAccess(self._snapshots, pos)._value; + } + + /** + * @dev Returns the value in the last (most recent) snapshot with key lower or equal than the search key, or zero if there is none. + */ + function upperLookup(History storage self, uint32 key) internal view returns (uint224) { + uint256 len = self._snapshots.length; + uint256 pos = _upperBinaryLookup(self._snapshots, key, 0, len); + return pos == 0 ? 0 : _unsafeAccess(self._snapshots, pos - 1)._value; + } + + /** + * @dev Returns the value in the last (most recent) snapshot with key lower or equal than the search key, or zero if there is none. + * + * NOTE: This is a variant of {upperLookup} that is optimised to find "recent" snapshot (snapshots with high keys). + */ + function upperLookupRecent(History storage self, uint32 key) internal view returns (uint224) { + uint256 len = self._snapshots.length; + + uint256 low = 0; + uint256 high = len; + + if (len > 5) { + uint256 mid = len - MathUpgradeable.sqrt(len); + if (key < _unsafeAccess(self._snapshots, mid)._key) { + high = mid; + } else { + low = mid + 1; + } + } + + uint256 pos = _upperBinaryLookup(self._snapshots, key, low, high); + + return pos == 0 ? 0 : _unsafeAccess(self._snapshots, pos - 1)._value; + } + + /** + * @dev Returns the value in the most recent snapshot, or zero if there are no snapshots. + */ + function latest( + History storage self + ) internal view returns (uint224) { + uint256 pos = self._snapshots.length; + return pos == 0 ? 0 : _unsafeAccess(self._snapshots, pos - 1)._value; + } + + /** + * @dev Returns whether there is a snapshot in the structure (i.e. it is not empty), and if so the key and value + * in the most recent snapshot. + */ + function latestSnapshot( + History storage self + ) internal view returns (bool exists, uint32 _key, uint224 _value) { + uint256 pos = self._snapshots.length; + if (pos == 0) { + return (false, 0, 0); + } else { + Snapshot memory ckpt = _unsafeAccess(self._snapshots, pos - 1); + return (true, ckpt._key, ckpt._value); + } + } + + /** + * @dev Returns the number of snapshot. + */ + function length( + History storage self + ) internal view returns (uint256) { + return self._snapshots.length; + } + + /** + * @dev Pushes a (`key`, `value`) pair into an ordered list of snapshots, either by inserting a new snapshot, + * or by updating the last one. + */ + function _insert(Snapshot[] storage self, uint32 key, uint224 value) private returns (uint224, uint224) { + uint256 pos = self.length; + + if (pos > 0) { + // Copying to memory is important here. + Snapshot memory last = _unsafeAccess(self, pos - 1); + + // Snapshot keys must be non-decreasing. + require(last._key <= key, "Snapshot: decreasing keys"); + + // Update or push new snapshot + if (last._key == key) { + _unsafeAccess(self, pos - 1)._value = value; + } else { + self.push(Snapshot({_key: key, _value: value})); + } + return (last._value, value); + } else { + self.push(Snapshot({_key: key, _value: value})); + return (0, value); + } + } + + /** + * @dev Return the index of the last (most recent) snapshot with key lower or equal than the search key, or `high` if there is none. + * `low` and `high` define a section where to do the search, with inclusive `low` and exclusive `high`. + * + * WARNING: `high` should not be greater than the array's length. + */ + function _upperBinaryLookup( + Snapshot[] storage self, + uint32 key, + uint256 low, + uint256 high + ) private view returns (uint256) { + while (low < high) { + uint256 mid = MathUpgradeable.average(low, high); + if (_unsafeAccess(self, mid)._key > key) { + high = mid; + } else { + low = mid + 1; + } + } + return high; + } + + /** + * @dev Return the index of the first (oldest) snapshot with key is greater or equal than the search key, or `high` if there is none. + * `low` and `high` define a section where to do the search, with inclusive `low` and exclusive `high`. + * + * WARNING: `high` should not be greater than the array's length. + */ + function _lowerBinaryLookup( + Snapshot[] storage self, + uint32 key, + uint256 low, + uint256 high + ) private view returns (uint256) { + while (low < high) { + uint256 mid = MathUpgradeable.average(low, high); + if (_unsafeAccess(self, mid)._key < key) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + + /** + * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds. + */ + function _unsafeAccess(Snapshot[] storage self, uint256 pos) private pure returns (Snapshot storage result) { + assembly { + mstore(0, self.slot) + result.slot := add(keccak256(0, 0x20), pos) + } + } + + /** + * + * ADDITIONAL FUNCTIONS FROM EIGEN-LABS + * + */ + + /** + * @dev Returns the value in the last (most recent) snapshot with key lower or equal than the search key, or zero if there is none. + * This function is a linear search for keys that are close to the end of the array. + */ + function upperLookupLinear(History storage self, uint32 key) internal view returns (uint224) { + uint256 len = self._snapshots.length; + for (uint256 i = len; i > 0; --i) { + Snapshot storage current = _unsafeAccess(self._snapshots, i - 1); + if (current._key <= key) { + return current._value; + } + } + return 0; + } + + /** + * @dev Returns the value in the last (most recent) snapshot with key lower or equal than the search key, or zero if there is none. + * In addition, returns the position of the snapshot in the array. + * + * NOTE: That if value != 0 && pos == 0, then that means the value is the first snapshot and actually exists + * a snapshot DNE iff value == 0 && pos == 0 + */ + function upperLookupWithPos(History storage self, uint32 key) internal view returns (uint224, uint256) { + uint256 len = self._snapshots.length; + uint256 pos = _upperBinaryLookup(self._snapshots, key, 0, len); + return pos == 0 ? (0, 0) : (_unsafeAccess(self._snapshots, pos - 1)._value, pos - 1); + } + + /** + * @dev Returns the value in the last (most recent) snapshot with key lower or equal than the search key, or zero if there is none. + * In addition, returns the position of the snapshot in the array. + * + * NOTE: This is a variant of {upperLookup} that is optimised to find "recent" snapshot (snapshots with high keys). + * NOTE: That if value != 0 && pos == 0, then that means the value is the first snapshot and actually exists + * a snapshot DNE iff value == 0 && pos == 0 => value == 0 + */ + function upperLookupRecentWithPos( + History storage self, + uint32 key + ) internal view returns (uint224, uint256, uint256) { + uint256 len = self._snapshots.length; + + uint256 low = 0; + uint256 high = len; + + if (len > 5) { + uint256 mid = len - MathUpgradeable.sqrt(len); + if (key < _unsafeAccess(self._snapshots, mid)._key) { + high = mid; + } else { + low = mid + 1; + } + } + + uint256 pos = _upperBinaryLookup(self._snapshots, key, low, high); + + return pos == 0 ? (0, 0, len) : (_unsafeAccess(self._snapshots, pos - 1)._value, pos - 1, len); + } + + /// @notice WARNING: this function is only used because of the invariant property + /// that from the current key, all future snapshotted magnitude values are strictly > current value. + /// Use function with extreme care for other situations. + function decrementAtAndFutureSnapshots(History storage self, uint32 key, uint224 decrementValue) internal { + (uint224 value, uint256 pos, uint256 len) = upperLookupRecentWithPos(self, key); + + // if there is no snapshot, return + if (value == 0 && pos == 0) { + pos = type(uint256).max; + } + + while (pos < len) { + Snapshot storage current = _unsafeAccess(self._snapshots, pos); + + // reverts from underflow. Expected to never happen in our usage + current._value -= decrementValue; + + unchecked { + ++pos; + } + } + } +} diff --git a/src/contracts/libraries/StructuredLinkedList.sol b/src/contracts/libraries/StructuredLinkedList.sol index 29410656f..eaa36e393 100644 --- a/src/contracts/libraries/StructuredLinkedList.sol +++ b/src/contracts/libraries/StructuredLinkedList.sol @@ -25,7 +25,9 @@ library StructuredLinkedList { * @param self stored linked list from contract * @return bool true if list exists, false otherwise */ - function listExists(List storage self) internal view returns (bool) { + function listExists( + List storage self + ) internal view returns (bool) { // if the head nodes previous or next pointers both point to itself, then there are no items in the list if (self.list[_HEAD][_PREV] != _HEAD || self.list[_HEAD][_NEXT] != _HEAD) { return true; @@ -57,7 +59,9 @@ library StructuredLinkedList { * @param self stored linked list from contract * @return uint256 */ - function sizeOf(List storage self) internal view returns (uint256) { + function sizeOf( + List storage self + ) internal view returns (uint256) { return self.size; } @@ -66,7 +70,9 @@ library StructuredLinkedList { * @param self stored linked list from contract * @return uint256 the head of the list */ - function getHead(List storage self) internal view returns (uint256) { + function getHead( + List storage self + ) internal view returns (uint256) { return self.list[_HEAD][_NEXT]; } @@ -186,7 +192,9 @@ library StructuredLinkedList { * @param self stored linked list from contract * @return uint256 the removed node */ - function popFront(List storage self) internal returns (uint256) { + function popFront( + List storage self + ) internal returns (uint256) { return _pop(self, _NEXT); } @@ -195,7 +203,9 @@ library StructuredLinkedList { * @param self stored linked list from contract * @return uint256 the removed node */ - function popBack(List storage self) internal returns (uint256) { + function popBack( + List storage self + ) internal returns (uint256) { return _pop(self, _PREV); } diff --git a/src/contracts/permissions/Pausable.sol b/src/contracts/permissions/Pausable.sol index 52883e888..a3b20a745 100644 --- a/src/contracts/permissions/Pausable.sol +++ b/src/contracts/permissions/Pausable.sol @@ -48,7 +48,9 @@ contract Pausable is IPausable { } /// @notice Throws if the `indexed`th bit of `_paused` is 1, i.e. if the `index`th pause switch is flipped. - modifier onlyWhenNotPaused(uint8 index) { + modifier onlyWhenNotPaused( + uint8 index + ) { require(!paused(index), "Pausable: index is paused"); _; } @@ -70,7 +72,9 @@ contract Pausable is IPausable { * @param newPausedStatus represents the new value for `_paused` to take, which means it may flip several bits at once. * @dev This function can only pause functionality, and thus cannot 'unflip' any bit in `_paused` from 1 to 0. */ - function pause(uint256 newPausedStatus) external onlyPauser { + function pause( + uint256 newPausedStatus + ) external onlyPauser { // verify that the `newPausedStatus` does not *unflip* any bits (i.e. doesn't unpause anything, all 1 bits remain) require((_paused & newPausedStatus) == _paused, "Pausable.pause: invalid attempt to unpause functionality"); _paused = newPausedStatus; @@ -91,7 +95,9 @@ contract Pausable is IPausable { * @param newPausedStatus represents the new value for `_paused` to take, which means it may flip several bits at once. * @dev This function can only unpause functionality, and thus cannot 'flip' any bit in `_paused` from 0 to 1. */ - function unpause(uint256 newPausedStatus) external onlyUnpauser { + function unpause( + uint256 newPausedStatus + ) external onlyUnpauser { // verify that the `newPausedStatus` does not *flip* any bits (i.e. doesn't pause anything, all 0 bits remain) require( ((~_paused) & (~newPausedStatus)) == (~_paused), "Pausable.unpause: invalid attempt to pause functionality" @@ -106,18 +112,24 @@ contract Pausable is IPausable { } /// @notice Returns 'true' if the `indexed`th bit of `_paused` is 1, and 'false' otherwise - function paused(uint8 index) public view virtual returns (bool) { + function paused( + uint8 index + ) public view virtual returns (bool) { uint256 mask = 1 << index; return ((_paused & mask) == mask); } /// @notice Allows the unpauser to set a new pauser registry - function setPauserRegistry(IPauserRegistry newPauserRegistry) external onlyUnpauser { + function setPauserRegistry( + IPauserRegistry newPauserRegistry + ) external onlyUnpauser { _setPauserRegistry(newPauserRegistry); } /// internal function for setting pauser registry - function _setPauserRegistry(IPauserRegistry newPauserRegistry) internal { + function _setPauserRegistry( + IPauserRegistry newPauserRegistry + ) internal { require( address(newPauserRegistry) != address(0), "Pausable._setPauserRegistry: newPauserRegistry cannot be the zero address" diff --git a/src/contracts/permissions/PauserRegistry.sol b/src/contracts/permissions/PauserRegistry.sol index 1058784ec..4ef0a9b49 100644 --- a/src/contracts/permissions/PauserRegistry.sol +++ b/src/contracts/permissions/PauserRegistry.sol @@ -35,7 +35,9 @@ contract PauserRegistry is IPauserRegistry { } /// @notice Sets new unpauser - only callable by unpauser, as the unpauser is expected to be kept more secure, e.g. being a multisig with a higher threshold - function setUnpauser(address newUnpauser) external onlyUnpauser { + function setUnpauser( + address newUnpauser + ) external onlyUnpauser { _setUnpauser(newUnpauser); } @@ -45,7 +47,9 @@ contract PauserRegistry is IPauserRegistry { emit PauserStatusChanged(pauser, canPause); } - function _setUnpauser(address newUnpauser) internal { + function _setUnpauser( + address newUnpauser + ) internal { require(newUnpauser != address(0), "PauserRegistry._setUnpauser: zero address input"); emit UnpauserChanged(unpauser, newUnpauser); unpauser = newUnpauser; diff --git a/src/contracts/pods/EigenPod.sol b/src/contracts/pods/EigenPod.sol index d98ef59f3..ee4ecf9d0 100644 --- a/src/contracts/pods/EigenPod.sol +++ b/src/contracts/pods/EigenPod.sol @@ -85,7 +85,9 @@ contract EigenPod is Initializable, ReentrancyGuardUpgradeable, EigenPodPausingC * is necessary for enabling pausing all EigenPods at the same time (due to EigenPods being Beacon Proxies). * Modifier throws if the `indexed`th bit of `_paused` in the EigenPodManager is 1, i.e. if the `index`th pause switch is flipped. */ - modifier onlyWhenNotPaused(uint8 index) { + modifier onlyWhenNotPaused( + uint8 index + ) { require( !IPausable(address(eigenPodManager)).paused(index), "EigenPod.onlyWhenNotPaused: index is paused in EigenPodManager" @@ -106,7 +108,9 @@ contract EigenPod is Initializable, ReentrancyGuardUpgradeable, EigenPodPausingC } /// @notice Used to initialize the pointers to addresses crucial to the pod's functionality. Called on construction by the EigenPodManager. - function initialize(address _podOwner) external initializer { + function initialize( + address _podOwner + ) external initializer { require(_podOwner != address(0), "EigenPod.initialize: podOwner cannot be zero address"); podOwner = _podOwner; } @@ -134,11 +138,9 @@ contract EigenPod is Initializable, ReentrancyGuardUpgradeable, EigenPodPausingC * @param revertIfNoBalance Forces a revert if the pod ETH balance is 0. This allows the pod owner * to prevent accidentally starting a checkpoint that will not increase their shares */ - function startCheckpoint(bool revertIfNoBalance) - external - onlyOwnerOrProofSubmitter - onlyWhenNotPaused(PAUSED_START_CHECKPOINT) - { + function startCheckpoint( + bool revertIfNoBalance + ) external onlyOwnerOrProofSubmitter onlyWhenNotPaused(PAUSED_START_CHECKPOINT) { _startCheckpoint(revertIfNoBalance); } @@ -384,7 +386,9 @@ contract EigenPod is Initializable, ReentrancyGuardUpgradeable, EigenPodPausingC /// only address that can call these methods. /// @param newProofSubmitter The new proof submitter address. If set to 0, only the /// pod owner will be able to call `startCheckpoint` and `verifyWithdrawalCredentials` - function setProofSubmitter(address newProofSubmitter) external onlyEigenPodOwner { + function setProofSubmitter( + address newProofSubmitter + ) external onlyEigenPodOwner { emit ProofSubmitterUpdated(proofSubmitter, newProofSubmitter); proofSubmitter = newProofSubmitter; } @@ -593,7 +597,9 @@ contract EigenPod is Initializable, ReentrancyGuardUpgradeable, EigenPodPausingC * @param revertIfNoBalance If the available ETH balance for checkpointing is 0 and this is * true, this method will revert */ - function _startCheckpoint(bool revertIfNoBalance) internal { + function _startCheckpoint( + bool revertIfNoBalance + ) internal { require( currentCheckpointTimestamp == 0, "EigenPod._startCheckpoint: must finish previous checkpoint before starting another" @@ -651,7 +657,9 @@ contract EigenPod is Initializable, ReentrancyGuardUpgradeable, EigenPodPausingC * - `lastCheckpointTimestamp` is updated * - `_currentCheckpoint` and `currentCheckpointTimestamp` are deleted */ - function _updateCheckpoint(Checkpoint memory checkpoint) internal { + function _updateCheckpoint( + Checkpoint memory checkpoint + ) internal { if (checkpoint.proofsRemaining == 0) { int256 totalShareDeltaWei = (int128(uint128(checkpoint.podBalanceGwei)) + checkpoint.balanceDeltasGwei) * int256(GWEI_TO_WEI); @@ -678,7 +686,9 @@ contract EigenPod is Initializable, ReentrancyGuardUpgradeable, EigenPodPausingC } ///@notice Calculates the pubkey hash of a validator's pubkey as per SSZ spec - function _calculateValidatorPubkeyHash(bytes memory validatorPubkey) internal pure returns (bytes32) { + function _calculateValidatorPubkeyHash( + bytes memory validatorPubkey + ) internal pure returns (bytes32) { require(validatorPubkey.length == 48, "EigenPod._calculateValidatorPubkeyHash must be a 48-byte BLS public key"); return sha256(abi.encodePacked(validatorPubkey, bytes16(0))); } @@ -695,21 +705,29 @@ contract EigenPod is Initializable, ReentrancyGuardUpgradeable, EigenPodPausingC */ /// @notice Returns the validatorInfo for a given validatorPubkeyHash - function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) external view returns (ValidatorInfo memory) { + function validatorPubkeyHashToInfo( + bytes32 validatorPubkeyHash + ) external view returns (ValidatorInfo memory) { return _validatorPubkeyHashToInfo[validatorPubkeyHash]; } /// @notice Returns the validatorInfo for a given validatorPubkey - function validatorPubkeyToInfo(bytes calldata validatorPubkey) external view returns (ValidatorInfo memory) { + function validatorPubkeyToInfo( + bytes calldata validatorPubkey + ) external view returns (ValidatorInfo memory) { return _validatorPubkeyHashToInfo[_calculateValidatorPubkeyHash(validatorPubkey)]; } - function validatorStatus(bytes32 pubkeyHash) external view returns (VALIDATOR_STATUS) { + function validatorStatus( + bytes32 pubkeyHash + ) external view returns (VALIDATOR_STATUS) { return _validatorPubkeyHashToInfo[pubkeyHash].status; } /// @notice Returns the validator status for a given validatorPubkey - function validatorStatus(bytes calldata validatorPubkey) external view returns (VALIDATOR_STATUS) { + function validatorStatus( + bytes calldata validatorPubkey + ) external view returns (VALIDATOR_STATUS) { bytes32 validatorPubkeyHash = _calculateValidatorPubkeyHash(validatorPubkey); return _validatorPubkeyHashToInfo[validatorPubkeyHash].status; } @@ -723,7 +741,9 @@ contract EigenPod is Initializable, ReentrancyGuardUpgradeable, EigenPodPausingC /// @param timestamp of the block for which the parent block root will be returned. MUST correspond /// to an existing slot within the last 24 hours. If the slot at `timestamp` was skipped, this method /// will revert. - function getParentBlockRoot(uint64 timestamp) public view returns (bytes32) { + function getParentBlockRoot( + uint64 timestamp + ) public view returns (bytes32) { require( block.timestamp - timestamp < BEACON_ROOTS_HISTORY_BUFFER_LENGTH * 12, "EigenPod.getParentBlockRoot: timestamp out of range" diff --git a/src/contracts/pods/EigenPodManager.sol b/src/contracts/pods/EigenPodManager.sol index 300f36de0..357eca86b 100644 --- a/src/contracts/pods/EigenPodManager.sol +++ b/src/contracts/pods/EigenPodManager.sol @@ -28,7 +28,9 @@ contract EigenPodManager is EigenPodManagerStorage, ReentrancyGuardUpgradeable { - modifier onlyEigenPod(address podOwner) { + modifier onlyEigenPod( + address podOwner + ) { require(address(ownerToPod[podOwner]) == msg.sender, "EigenPodManager.onlyEigenPod: not a pod"); _; } @@ -121,18 +123,22 @@ contract EigenPodManager is sharesAfter: updatedPodOwnerShares }); // skip making a call to the DelegationManager if there is no change in delegateable shares + // or if the currentPodShares < 0 and updatedPodShares is still < 0. Means no update required + // in delegated shares if (changeInDelegatableShares != 0) { if (changeInDelegatableShares < 0) { delegationManager.decreaseDelegatedShares({ staker: podOwner, strategy: beaconChainETHStrategy, - shares: uint256(-changeInDelegatableShares) + removedShares: uint256(-changeInDelegatableShares) }); } else { delegationManager.increaseDelegatedShares({ staker: podOwner, strategy: beaconChainETHStrategy, - shares: uint256(changeInDelegatableShares) + // existing shares from standpoint of the DelegationManager + existingShares: currentPodOwnerShares < 0 ? 0 : uint256(currentPodOwnerShares), + addedShares: uint256(changeInDelegatableShares) }); } } @@ -166,10 +172,14 @@ contract EigenPodManager is * @notice Increases the `podOwner`'s shares by `shares`, paying off deficit if possible. * Used by the DelegationManager to award a pod owner shares on exiting the withdrawal queue * @dev Returns the number of shares added to `podOwnerShares[podOwner]` above zero, which will be less than the `shares` input - * in the event that the podOwner has an existing shares deficit (i.e. `podOwnerShares[podOwner]` starts below zero) + * in the event that the podOwner has an existing shares deficit (i.e. `podOwnerShares[podOwner]` starts below zero). + * Also returns existingPodShares prior to adding shares, this is returned as 0 if the existing podOwnerShares is negative * @dev Reverts if `shares` is not a whole Gwei amount */ - function addShares(address podOwner, uint256 shares) external onlyDelegationManager returns (uint256) { + function addShares( + address podOwner, + uint256 shares + ) external onlyDelegationManager returns (uint256 increaseInDelegateableShares, uint256 existingPodShares) { require(podOwner != address(0), "EigenPodManager.addShares: podOwner cannot be zero address"); require(int256(shares) >= 0, "EigenPodManager.addShares: shares cannot be negative"); require(shares % GWEI_TO_WEI == 0, "EigenPodManager.addShares: shares must be a whole Gwei amount"); @@ -180,12 +190,15 @@ contract EigenPodManager is emit PodSharesUpdated(podOwner, int256(shares)); emit NewTotalShares(podOwner, updatedPodOwnerShares); - return uint256( + increaseInDelegateableShares = uint256( _calculateChangeInDelegatableShares({ sharesBefore: currentPodOwnerShares, sharesAfter: updatedPodOwnerShares }) ); + existingPodShares = currentPodOwnerShares < 0 ? 0 : uint256(currentPodOwnerShares); + + return (increaseInDelegateableShares, existingPodShares); } /** @@ -279,7 +292,9 @@ contract EigenPodManager is // VIEW FUNCTIONS /// @notice Returns the address of the `podOwner`'s EigenPod (whether it is deployed yet or not). - function getPod(address podOwner) public view returns (IEigenPod) { + function getPod( + address podOwner + ) public view returns (IEigenPod) { IEigenPod pod = ownerToPod[podOwner]; // if pod does not exist already, calculate what its address *will be* once it is deployed if (address(pod) == address(0)) { @@ -294,7 +309,9 @@ contract EigenPodManager is } /// @notice Returns 'true' if the `podOwner` has created an EigenPod, and 'false' otherwise. - function hasPod(address podOwner) public view returns (bool) { + function hasPod( + address podOwner + ) public view returns (bool) { return address(ownerToPod[podOwner]) != address(0); } } diff --git a/src/contracts/strategies/EigenStrategy.sol b/src/contracts/strategies/EigenStrategy.sol index aa5204dcb..e99957321 100644 --- a/src/contracts/strategies/EigenStrategy.sol +++ b/src/contracts/strategies/EigenStrategy.sol @@ -35,7 +35,9 @@ contract EigenStrategy is StrategyBase { IEigen public EIGEN; /// @notice Since this contract is designed to be initializable, the constructor simply sets `strategyManager`, the only immutable variable. - constructor(IStrategyManager _strategyManager) StrategyBase(_strategyManager) {} + constructor( + IStrategyManager _strategyManager + ) StrategyBase(_strategyManager) {} function initialize(IEigen _EIGEN, IERC20 _bEIGEN, IPauserRegistry _pauserRegistry) public virtual initializer { EIGEN = _EIGEN; diff --git a/src/contracts/strategies/StrategyBase.sol b/src/contracts/strategies/StrategyBase.sol index a4fab630a..2dc0ff713 100644 --- a/src/contracts/strategies/StrategyBase.sol +++ b/src/contracts/strategies/StrategyBase.sol @@ -69,7 +69,9 @@ contract StrategyBase is Initializable, Pausable, IStrategy { } /// @notice Since this contract is designed to be initializable, the constructor simply sets `strategyManager`, the only immutable variable. - constructor(IStrategyManager _strategyManager) { + constructor( + IStrategyManager _strategyManager + ) { strategyManager = _strategyManager; _disableInitializers(); } @@ -225,7 +227,9 @@ contract StrategyBase is Initializable, Pausable, IStrategy { * @return The amount of underlying tokens corresponding to the input `amountShares` * @dev Implementation for these functions in particular may vary significantly for different strategies */ - function sharesToUnderlyingView(uint256 amountShares) public view virtual override returns (uint256) { + function sharesToUnderlyingView( + uint256 amountShares + ) public view virtual override returns (uint256) { // account for virtual shares and balance uint256 virtualTotalShares = totalShares + SHARES_OFFSET; uint256 virtualTokenBalance = _tokenBalance() + BALANCE_OFFSET; @@ -240,7 +244,9 @@ contract StrategyBase is Initializable, Pausable, IStrategy { * @return The amount of underlying tokens corresponding to the input `amountShares` * @dev Implementation for these functions in particular may vary significantly for different strategies */ - function sharesToUnderlying(uint256 amountShares) public view virtual override returns (uint256) { + function sharesToUnderlying( + uint256 amountShares + ) public view virtual override returns (uint256) { return sharesToUnderlyingView(amountShares); } @@ -251,7 +257,9 @@ contract StrategyBase is Initializable, Pausable, IStrategy { * @return The amount of shares corresponding to the input `amountUnderlying` * @dev Implementation for these functions in particular may vary significantly for different strategies */ - function underlyingToSharesView(uint256 amountUnderlying) public view virtual returns (uint256) { + function underlyingToSharesView( + uint256 amountUnderlying + ) public view virtual returns (uint256) { // account for virtual shares and balance uint256 virtualTotalShares = totalShares + SHARES_OFFSET; uint256 virtualTokenBalance = _tokenBalance() + BALANCE_OFFSET; @@ -266,7 +274,9 @@ contract StrategyBase is Initializable, Pausable, IStrategy { * @return The amount of shares corresponding to the input `amountUnderlying` * @dev Implementation for these functions in particular may vary significantly for different strategies */ - function underlyingToShares(uint256 amountUnderlying) external view virtual returns (uint256) { + function underlyingToShares( + uint256 amountUnderlying + ) external view virtual returns (uint256) { return underlyingToSharesView(amountUnderlying); } @@ -274,7 +284,9 @@ contract StrategyBase is Initializable, Pausable, IStrategy { * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in * this strategy. In contrast to `userUnderlying`, this function guarantees no state modifications */ - function userUnderlyingView(address user) external view virtual returns (uint256) { + function userUnderlyingView( + address user + ) external view virtual returns (uint256) { return sharesToUnderlyingView(shares(user)); } @@ -282,7 +294,9 @@ contract StrategyBase is Initializable, Pausable, IStrategy { * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in * this strategy. In contrast to `userUnderlyingView`, this function **may** make state modifications */ - function userUnderlying(address user) external virtual returns (uint256) { + function userUnderlying( + address user + ) external virtual returns (uint256) { return sharesToUnderlying(shares(user)); } @@ -290,7 +304,9 @@ contract StrategyBase is Initializable, Pausable, IStrategy { * @notice convenience function for fetching the current total shares of `user` in this strategy, by * querying the `strategyManager` contract */ - function shares(address user) public view virtual returns (uint256) { + function shares( + address user + ) public view virtual returns (uint256) { return strategyManager.stakerStrategyShares(user, IStrategy(address(this))); } diff --git a/src/contracts/strategies/StrategyBaseTVLLimits.sol b/src/contracts/strategies/StrategyBaseTVLLimits.sol index 63b76ff45..29ce345ce 100644 --- a/src/contracts/strategies/StrategyBaseTVLLimits.sol +++ b/src/contracts/strategies/StrategyBaseTVLLimits.sol @@ -24,7 +24,9 @@ contract StrategyBaseTVLLimits is StrategyBase { event MaxTotalDepositsUpdated(uint256 previousValue, uint256 newValue); // solhint-disable-next-line no-empty-blocks - constructor(IStrategyManager _strategyManager) StrategyBase(_strategyManager) {} + constructor( + IStrategyManager _strategyManager + ) StrategyBase(_strategyManager) {} function initialize( uint256 _maxPerDeposit, diff --git a/src/contracts/strategies/StrategyFactory.sol b/src/contracts/strategies/StrategyFactory.sol index 7e9a468fb..155342d17 100644 --- a/src/contracts/strategies/StrategyFactory.sol +++ b/src/contracts/strategies/StrategyFactory.sol @@ -21,7 +21,9 @@ contract StrategyFactory is StrategyFactoryStorage, OwnableUpgradeable, Pausable IStrategyManager public immutable strategyManager; /// @notice Since this contract is designed to be initializable, the constructor simply sets the immutable variables. - constructor(IStrategyManager _strategyManager) { + constructor( + IStrategyManager _strategyManager + ) { strategyManager = _strategyManager; _disableInitializers(); } @@ -43,11 +45,9 @@ contract StrategyFactory is StrategyFactoryStorage, OwnableUpgradeable, Pausable * $dev Immense caution is warranted for non-standard ERC20 tokens, particularly "reentrant" tokens * like those that conform to ERC777. */ - function deployNewStrategy(IERC20 token) - external - onlyWhenNotPaused(PAUSED_NEW_STRATEGIES) - returns (IStrategy newStrategy) - { + function deployNewStrategy( + IERC20 token + ) external onlyWhenNotPaused(PAUSED_NEW_STRATEGIES) returns (IStrategy newStrategy) { require(!isBlacklisted[token], "StrategyFactory.deployNewStrategy: Token is blacklisted"); require( deployedStrategies[token] == IStrategy(address(0)), @@ -74,7 +74,9 @@ contract StrategyFactory is StrategyFactoryStorage, OwnableUpgradeable, Pausable * @notice Owner-only function to prevent strategies from being created for given tokens. * @param tokens An array of token addresses to blacklist. */ - function blacklistTokens(IERC20[] calldata tokens) external onlyOwner { + function blacklistTokens( + IERC20[] calldata tokens + ) external onlyOwner { IStrategy[] memory strategiesToRemove = new IStrategy[](tokens.length); uint256 removeIdx = 0; @@ -123,7 +125,9 @@ contract StrategyFactory is StrategyFactoryStorage, OwnableUpgradeable, Pausable /** * @notice Owner-only function to pass through a call to `StrategyManager.removeStrategiesFromDepositWhitelist` */ - function removeStrategiesFromWhitelist(IStrategy[] calldata strategiesToRemoveFromWhitelist) external onlyOwner { + function removeStrategiesFromWhitelist( + IStrategy[] calldata strategiesToRemoveFromWhitelist + ) external onlyOwner { strategyManager.removeStrategiesFromDepositWhitelist(strategiesToRemoveFromWhitelist); } @@ -132,7 +136,9 @@ contract StrategyFactory is StrategyFactoryStorage, OwnableUpgradeable, Pausable emit StrategySetForToken(token, strategy); } - function _setStrategyBeacon(IBeacon _strategyBeacon) internal { + function _setStrategyBeacon( + IBeacon _strategyBeacon + ) internal { emit StrategyBeaconModified(strategyBeacon, _strategyBeacon); strategyBeacon = _strategyBeacon; } diff --git a/src/contracts/token/BackingEigen.sol b/src/contracts/token/BackingEigen.sol index 0a3b707ec..6b150d809 100644 --- a/src/contracts/token/BackingEigen.sol +++ b/src/contracts/token/BackingEigen.sol @@ -27,7 +27,9 @@ contract BackingEigen is OwnableUpgradeable, ERC20VotesUpgradeable { /// @notice event emitted when the EIGEN token is backed event Backed(); - constructor(IERC20 _EIGEN) { + constructor( + IERC20 _EIGEN + ) { EIGEN = _EIGEN; _disableInitializers(); } @@ -35,7 +37,9 @@ contract BackingEigen is OwnableUpgradeable, ERC20VotesUpgradeable { /** * @notice An initializer function that sets initial values for the contract's state variables. */ - function initialize(address initialOwner) public initializer { + function initialize( + address initialOwner + ) public initializer { __Ownable_init(); __ERC20_init("Backing Eigen", "bEIGEN"); _transferOwnership(initialOwner); diff --git a/src/contracts/token/Eigen.sol b/src/contracts/token/Eigen.sol index 327fe13b4..fd685ddc6 100644 --- a/src/contracts/token/Eigen.sol +++ b/src/contracts/token/Eigen.sol @@ -32,7 +32,9 @@ contract Eigen is OwnableUpgradeable, ERC20VotesUpgradeable { /// @notice event emitted when the transfer restrictions disabled event TransferRestrictionsDisabled(); - constructor(IERC20 _bEIGEN) { + constructor( + IERC20 _bEIGEN + ) { bEIGEN = _bEIGEN; _disableInitializers(); } @@ -121,7 +123,9 @@ contract Eigen is OwnableUpgradeable, ERC20VotesUpgradeable { /** * @notice This function allows bEIGEN holders to wrap their tokens into Eigen */ - function wrap(uint256 amount) external { + function wrap( + uint256 amount + ) external { require(bEIGEN.transferFrom(msg.sender, address(this), amount), "Eigen.wrap: bEIGEN transfer failed"); _transfer(address(this), msg.sender, amount); } @@ -129,7 +133,9 @@ contract Eigen is OwnableUpgradeable, ERC20VotesUpgradeable { /** * @notice This function allows Eigen holders to unwrap their tokens into bEIGEN */ - function unwrap(uint256 amount) external { + function unwrap( + uint256 amount + ) external { _transfer(msg.sender, address(this), amount); require(bEIGEN.transfer(msg.sender, amount), "Eigen.unwrap: bEIGEN transfer failed"); } diff --git a/src/test/Delegation.t.sol b/src/test/Delegation.t.sol index 3138039cd..78c3de53c 100644 --- a/src/test/Delegation.t.sol +++ b/src/test/Delegation.t.sol @@ -1,501 +1,501 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.12; -import "@openzeppelin/contracts/mocks/ERC1271WalletMock.sol"; -import "src/contracts/interfaces/ISignatureUtils.sol"; - -import "../test/EigenLayerTestHelper.t.sol"; - -contract DelegationTests is EigenLayerTestHelper { - uint256 public PRIVATE_KEY = 420; - - uint32 serveUntil = 100; - - address public registryCoordinator = address(uint160(uint256(keccak256("registryCoordinator")))); - uint8 defaultQuorumNumber = 0; - bytes32 defaultOperatorId = bytes32(uint256(0)); - - modifier fuzzedAmounts(uint256 ethAmount, uint256 eigenAmount) { - cheats.assume(ethAmount >= 0 && ethAmount <= 1e18); - cheats.assume(eigenAmount >= 0 && eigenAmount <= 1e18); - _; - } - - function setUp() public virtual override { - EigenLayerDeployer.setUp(); - } - - /// @notice testing if an operator can register to themselves. - function testSelfOperatorRegister() public { - _testRegisterAdditionalOperator(0); - } - - /// @notice testing if an operator can delegate to themselves. - /// @param sender is the address of the operator. - function testSelfOperatorDelegate(address sender) public { - cheats.assume(sender != address(0)); - cheats.assume(sender != address(eigenLayerProxyAdmin)); - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: sender, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _testRegisterAsOperator(sender, operatorDetails); - } - - function testTwoSelfOperatorsRegister() public { - _testRegisterAdditionalOperator(0); - _testRegisterAdditionalOperator(1); - } - - /// @notice registers a fixed address as a delegate, delegates to it from a second address, - /// and checks that the delegate's voteWeights increase properly - /// @param operator is the operator being delegated to. - /// @param staker is the staker delegating stake to the operator. - function testDelegation( - address operator, - address staker, - uint96 ethAmount, - uint96 eigenAmount - ) public fuzzedAddress(operator) fuzzedAddress(staker) fuzzedAmounts(ethAmount, eigenAmount) { - cheats.assume(staker != operator); - // base strategy will revert if these amounts are too small on first deposit - cheats.assume(ethAmount >= 1); - cheats.assume(eigenAmount >= 2); - - // Set weights ahead of the helper function call - bytes memory quorumNumbers = new bytes(2); - quorumNumbers[0] = bytes1(uint8(0)); - quorumNumbers[0] = bytes1(uint8(1)); - _testDelegation(operator, staker, ethAmount, eigenAmount); - } - - /// @notice tests that a when an operator is delegated to, that delegation is properly accounted for. - function testDelegationReceived( - address _operator, - address staker, - uint64 ethAmount, - uint64 eigenAmount - ) public fuzzedAddress(_operator) fuzzedAddress(staker) fuzzedAmounts(ethAmount, eigenAmount) { - cheats.assume(staker != _operator); - cheats.assume(ethAmount >= 1); - cheats.assume(eigenAmount >= 2); - - // use storage to solve stack-too-deep - operator = _operator; - - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: operator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - if (!delegation.isOperator(operator)) { - _testRegisterAsOperator(operator, operatorDetails); - } - - uint256 amountBefore = delegation.operatorShares(operator, wethStrat); - - //making additional deposits to the strategies - assertTrue(!delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); - _testDepositWeth(staker, ethAmount); - _testDepositEigen(staker, eigenAmount); - _testDelegateToOperator(staker, operator); - assertTrue(delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); - - (/*IStrategy[] memory updatedStrategies*/, uint256[] memory updatedShares) = strategyManager.getDeposits(staker); - - { - IStrategy _strat = wethStrat; - // IStrategy _strat = strategyManager.stakerStrats(staker, 0); - assertTrue(address(_strat) != address(0), "stakerStrats not updated correctly"); - - assertTrue( - delegation.operatorShares(operator, _strat) - updatedShares[0] == amountBefore, - "ETH operatorShares not updated correctly" - ); - - cheats.startPrank(address(strategyManager)); - - IDelegationManager.OperatorDetails memory expectedOperatorDetails = delegation.operatorDetails(operator); - assertTrue( - keccak256(abi.encode(expectedOperatorDetails)) == keccak256(abi.encode(operatorDetails)), - "failed to set correct operator details" - ); - } - } - - /// @notice tests that a when an operator is undelegated from, that the staker is properly classified as undelegated. - function testUndelegation( - address operator, - address staker, - uint96 ethAmount, - uint96 eigenAmount - ) public fuzzedAddress(operator) fuzzedAddress(staker) fuzzedAmounts(ethAmount, eigenAmount) { - cheats.assume(staker != operator); - // base strategy will revert if these amounts are too small on first deposit - cheats.assume(ethAmount >= 1); - cheats.assume(eigenAmount >= 1); - _testDelegation(operator, staker, ethAmount, eigenAmount); - - (IStrategy[] memory strategyArray, uint256[] memory shareAmounts) = strategyManager.getDeposits(staker); - uint256[] memory strategyIndexes = new uint256[](strategyArray.length); - - // withdraw shares - _testQueueWithdrawal(staker, strategyIndexes, strategyArray, shareAmounts, staker /*withdrawer*/); - - cheats.startPrank(staker); - delegation.undelegate(staker); - cheats.stopPrank(); - - require(delegation.delegatedTo(staker) == address(0), "undelegation unsuccessful"); - } - - /// @notice tests delegation from a staker to operator via ECDSA signature. - function testDelegateToBySignature( - address operator, - uint96 ethAmount, - uint96 eigenAmount, - uint256 expiry - ) public fuzzedAddress(operator) { - address staker = cheats.addr(PRIVATE_KEY); - _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); - - uint256 nonceBefore = delegation.stakerNonce(staker); - - bytes32 structHash = keccak256( - abi.encode(delegation.STAKER_DELEGATION_TYPEHASH(), staker, operator, nonceBefore, expiry) - ); - bytes32 digestHash = keccak256(abi.encodePacked("\x19\x01", delegation.domainSeparator(), structHash)); - - bytes memory signature; - { - (uint8 v, bytes32 r, bytes32 s) = cheats.sign(PRIVATE_KEY, digestHash); - signature = abi.encodePacked(r, s, v); - } - - if (expiry < block.timestamp) { - cheats.expectRevert("DelegationManager.delegateToBySignature: staker signature expired"); - } - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ - signature: signature, - expiry: expiry - }); - delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); - if (expiry >= block.timestamp) { - assertTrue(delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); - assertTrue(nonceBefore + 1 == delegation.stakerNonce(staker), "nonce not incremented correctly"); - assertTrue(delegation.delegatedTo(staker) == operator, "staker delegated to wrong operator"); - } - } - - /// @notice tries delegating using a signature and an EIP 1271 compliant wallet - function testDelegateToBySignature_WithContractWallet_Successfully( - address operator, - uint96 ethAmount, - uint96 eigenAmount - ) public fuzzedAddress(operator) { - address staker = cheats.addr(PRIVATE_KEY); - - // deploy ERC1271WalletMock for staker to use - cheats.startPrank(staker); - ERC1271WalletMock wallet = new ERC1271WalletMock(staker); - cheats.stopPrank(); - staker = address(wallet); - - _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); - - uint256 nonceBefore = delegation.stakerNonce(staker); - - bytes32 structHash = keccak256( - abi.encode(delegation.STAKER_DELEGATION_TYPEHASH(), staker, operator, nonceBefore, type(uint256).max) - ); - bytes32 digestHash = keccak256(abi.encodePacked("\x19\x01", delegation.domainSeparator(), structHash)); - - bytes memory signature; - { - (uint8 v, bytes32 r, bytes32 s) = cheats.sign(PRIVATE_KEY, digestHash); - signature = abi.encodePacked(r, s, v); - } - - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ - signature: signature, - expiry: type(uint256).max - }); - delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); - assertTrue(delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); - assertTrue(nonceBefore + 1 == delegation.stakerNonce(staker), "nonce not incremented correctly"); - assertTrue(delegation.delegatedTo(staker) == operator, "staker delegated to wrong operator"); - } - - /// @notice tries delegating using a signature and an EIP 1271 compliant wallet, *but* providing a bad signature - function testDelegateToBySignature_WithContractWallet_BadSignature( - address operator, - uint96 ethAmount, - uint96 eigenAmount - ) public fuzzedAddress(operator) { - address staker = cheats.addr(PRIVATE_KEY); - - // deploy ERC1271WalletMock for staker to use - cheats.startPrank(staker); - ERC1271WalletMock wallet = new ERC1271WalletMock(staker); - cheats.stopPrank(); - staker = address(wallet); - - _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); - - uint256 nonceBefore = delegation.stakerNonce(staker); - - bytes32 structHash = keccak256( - abi.encode(delegation.STAKER_DELEGATION_TYPEHASH(), staker, operator, nonceBefore, type(uint256).max) - ); - bytes32 digestHash = keccak256(abi.encodePacked("\x19\x01", delegation.domainSeparator(), structHash)); - - bytes memory signature; - { - (uint8 v, bytes32 r, bytes32 s) = cheats.sign(PRIVATE_KEY, digestHash); - // mess up the signature by flipping v's parity - v = (v == 27 ? 28 : 27); - signature = abi.encodePacked(r, s, v); - } - - cheats.expectRevert( - bytes("EIP1271SignatureUtils.checkSignature_EIP1271: ERC1271 signature verification failed") - ); - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ - signature: signature, - expiry: type(uint256).max - }); - delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); - } - - /// @notice tries delegating using a wallet that does not comply with EIP 1271 - function testDelegateToBySignature_WithContractWallet_NonconformingWallet( - address operator, - uint96 ethAmount, - uint96 eigenAmount, - uint8 v, - bytes32 r, - bytes32 s - ) public fuzzedAddress(operator) { - address staker = cheats.addr(PRIVATE_KEY); - - // deploy non ERC1271-compliant wallet for staker to use - cheats.startPrank(staker); - ERC1271MaliciousMock wallet = new ERC1271MaliciousMock(); - cheats.stopPrank(); - staker = address(wallet); - - _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); - - cheats.assume(staker != operator); - - bytes memory signature = abi.encodePacked(r, s, v); - - cheats.expectRevert(); - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ - signature: signature, - expiry: type(uint256).max - }); - delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); - } - - /// @notice tests delegation to EigenLayer via an ECDSA signatures with invalid signature - /// @param operator is the operator being delegated to. - function testDelegateToByInvalidSignature( - address operator, - uint96 ethAmount, - uint96 eigenAmount, - uint8 v, - bytes32 r, - bytes32 s - ) public fuzzedAddress(operator) fuzzedAmounts(ethAmount, eigenAmount) { - address staker = cheats.addr(PRIVATE_KEY); - _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); - - bytes memory signature = abi.encodePacked(r, s, v); - - cheats.expectRevert(); - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ - signature: signature, - expiry: type(uint256).max - }); - delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); - } - - /// @notice This function tests to ensure that a delegation contract - /// cannot be intitialized multiple times - function testCannotInitMultipleTimesDelegation() public cannotReinit { - //delegation has already been initialized in the Deployer test contract - delegation.initialize( - address(this), - eigenLayerPauserReg, - 0, - minWithdrawalDelayBlocks, - initializeStrategiesToSetDelayBlocks, - initializeWithdrawalDelayBlocks - ); - } - - /// @notice This function tests to ensure that a you can't register as a delegate multiple times - /// @param operator is the operator being delegated to. - function testRegisterAsOperatorMultipleTimes(address operator) public fuzzedAddress(operator) { - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: operator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _testRegisterAsOperator(operator, operatorDetails); - cheats.expectRevert(bytes("DelegationManager.registerAsOperator: caller is already actively delegated")); - _testRegisterAsOperator(operator, operatorDetails); - } - - /// @notice This function tests to ensure that a staker cannot delegate to an unregistered operator - /// @param delegate is the unregistered operator - function testDelegationToUnregisteredDelegate(address delegate) public fuzzedAddress(delegate) { - //deposit into 1 strategy for getOperatorAddress(1), who is delegating to the unregistered operator - _testDepositStrategies(getOperatorAddress(1), 1e18, 1); - _testDepositEigen(getOperatorAddress(1), 1e18); - - cheats.expectRevert(bytes("DelegationManager.delegateTo: operator is not registered in EigenLayer")); - cheats.startPrank(getOperatorAddress(1)); - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; - delegation.delegateTo(delegate, signatureWithExpiry, bytes32(0)); - cheats.stopPrank(); - } - - /// @notice This function tests to ensure that a delegation contract - /// cannot be intitialized multiple times, test with different caller addresses - function testCannotInitMultipleTimesDelegation(address _attacker) public { - cheats.assume(_attacker != address(eigenLayerProxyAdmin)); - //delegation has already been initialized in the Deployer test contract - vm.prank(_attacker); - cheats.expectRevert(bytes("Initializable: contract is already initialized")); - delegation.initialize( - _attacker, - eigenLayerPauserReg, - 0, - 0, // minWithdrawalDelayBLocks - initializeStrategiesToSetDelayBlocks, - initializeWithdrawalDelayBlocks - ); - } - - /// @notice This function tests to ensure that an address can only call registerAsOperator() once - function testCannotRegisterAsOperatorTwice( - address _operator, - address _dt - ) public fuzzedAddress(_operator) fuzzedAddress(_dt) { - vm.assume(_dt != address(0)); - vm.startPrank(_operator); - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: msg.sender, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - string memory emptyStringForMetadataURI; - delegation.registerAsOperator(operatorDetails, emptyStringForMetadataURI); - vm.expectRevert("DelegationManager.registerAsOperator: caller is already actively delegated"); - delegation.registerAsOperator(operatorDetails, emptyStringForMetadataURI); - cheats.stopPrank(); - } - - /// @notice this function checks that you can only delegate to an address that is already registered. - function testDelegateToInvalidOperator( - address _staker, - address _unregisteredoperator - ) public fuzzedAddress(_staker) { - vm.startPrank(_staker); - cheats.expectRevert(bytes("DelegationManager.delegateTo: operator is not registered in EigenLayer")); - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; - delegation.delegateTo(_unregisteredoperator, signatureWithExpiry, bytes32(0)); - cheats.expectRevert(bytes("DelegationManager.delegateTo: operator is not registered in EigenLayer")); - delegation.delegateTo(_staker, signatureWithExpiry, bytes32(0)); - cheats.stopPrank(); - } - - function testUndelegate_SigP_Version(address _operator, address _staker, address _dt) public { - vm.assume(_operator != address(0)); - vm.assume(_staker != address(0)); - vm.assume(_operator != _staker); - vm.assume(_dt != address(0)); - vm.assume(_operator != address(eigenLayerProxyAdmin)); - vm.assume(_staker != address(eigenLayerProxyAdmin)); - - // setup delegation - vm.prank(_operator); - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: _dt, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - string memory emptyStringForMetadataURI; - delegation.registerAsOperator(operatorDetails, emptyStringForMetadataURI); - vm.prank(_staker); - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; - delegation.delegateTo(_operator, signatureWithExpiry, bytes32(0)); - - // operators cannot undelegate from themselves - vm.prank(_operator); - cheats.expectRevert(bytes("DelegationManager.undelegate: operators cannot be undelegated")); - delegation.undelegate(_operator); - - // assert still delegated - assertTrue(delegation.isDelegated(_staker)); - assertTrue(delegation.isOperator(_operator)); - - // _staker *can* undelegate themselves - vm.prank(_staker); - delegation.undelegate(_staker); - - // assert undelegated - assertTrue(!delegation.isDelegated(_staker)); - assertTrue(delegation.isOperator(_operator)); - } - - function _testRegisterAdditionalOperator(uint256 index) internal { - address sender = getOperatorAddress(index); - - //register as both ETH and EIGEN operator - uint256 wethToDeposit = 1e18; - uint256 eigenToDeposit = 1e10; - _testDepositWeth(sender, wethToDeposit); - _testDepositEigen(sender, eigenToDeposit); - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: sender, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _testRegisterAsOperator(sender, operatorDetails); - cheats.startPrank(sender); - - cheats.stopPrank(); - } - - // registers the operator if they are not already registered, and deposits "WETH" + "EIGEN" on behalf of the staker. - function _registerOperatorAndDepositFromStaker( - address operator, - address staker, - uint96 ethAmount, - uint96 eigenAmount - ) internal { - cheats.assume(staker != operator); - - // if first deposit amount to base strategy is too small, it will revert. ignore that case here. - cheats.assume(ethAmount >= 1 && ethAmount <= 1e18); - cheats.assume(eigenAmount >= 1 && eigenAmount <= 1e18); - - if (!delegation.isOperator(operator)) { - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: operator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _testRegisterAsOperator(operator, operatorDetails); - } - - //making additional deposits to the strategies - assertTrue(!delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); - _testDepositWeth(staker, ethAmount); - _testDepositEigen(staker, eigenAmount); - } -} +// import "@openzeppelin/contracts/mocks/ERC1271WalletMock.sol"; +// import "src/contracts/interfaces/ISignatureUtils.sol"; + +// import "../test/EigenLayerTestHelper.t.sol"; + +// contract DelegationTests is EigenLayerTestHelper { +// uint256 public PRIVATE_KEY = 420; + +// uint32 serveUntil = 100; + +// address public registryCoordinator = address(uint160(uint256(keccak256("registryCoordinator")))); +// uint8 defaultQuorumNumber = 0; +// bytes32 defaultOperatorId = bytes32(uint256(0)); + +// modifier fuzzedAmounts(uint256 ethAmount, uint256 eigenAmount) { +// cheats.assume(ethAmount >= 0 && ethAmount <= 1e18); +// cheats.assume(eigenAmount >= 0 && eigenAmount <= 1e18); +// _; +// } + +// function setUp() public virtual override { +// EigenLayerDeployer.setUp(); +// } + +// /// @notice testing if an operator can register to themselves. +// function testSelfOperatorRegister() public { +// _testRegisterAdditionalOperator(0); +// } + +// /// @notice testing if an operator can delegate to themselves. +// /// @param sender is the address of the operator. +// function testSelfOperatorDelegate(address sender) public { +// cheats.assume(sender != address(0)); +// cheats.assume(sender != address(eigenLayerProxyAdmin)); +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: sender, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// _testRegisterAsOperator(sender, operatorDetails); +// } + +// function testTwoSelfOperatorsRegister() public { +// _testRegisterAdditionalOperator(0); +// _testRegisterAdditionalOperator(1); +// } + +// /// @notice registers a fixed address as a delegate, delegates to it from a second address, +// /// and checks that the delegate's voteWeights increase properly +// /// @param operator is the operator being delegated to. +// /// @param staker is the staker delegating stake to the operator. +// function testDelegation( +// address operator, +// address staker, +// uint96 ethAmount, +// uint96 eigenAmount +// ) public fuzzedAddress(operator) fuzzedAddress(staker) fuzzedAmounts(ethAmount, eigenAmount) { +// cheats.assume(staker != operator); +// // base strategy will revert if these amounts are too small on first deposit +// cheats.assume(ethAmount >= 1); +// cheats.assume(eigenAmount >= 2); + +// // Set weights ahead of the helper function call +// bytes memory quorumNumbers = new bytes(2); +// quorumNumbers[0] = bytes1(uint8(0)); +// quorumNumbers[0] = bytes1(uint8(1)); +// _testDelegation(operator, staker, ethAmount, eigenAmount); +// } + +// /// @notice tests that a when an operator is delegated to, that delegation is properly accounted for. +// function testDelegationReceived( +// address _operator, +// address staker, +// uint64 ethAmount, +// uint64 eigenAmount +// ) public fuzzedAddress(_operator) fuzzedAddress(staker) fuzzedAmounts(ethAmount, eigenAmount) { +// cheats.assume(staker != _operator); +// cheats.assume(ethAmount >= 1); +// cheats.assume(eigenAmount >= 2); + +// // use storage to solve stack-too-deep +// operator = _operator; + +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: operator, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// if (!delegation.isOperator(operator)) { +// _testRegisterAsOperator(operator, operatorDetails); +// } + +// uint256 amountBefore = delegation.operatorShares(operator, wethStrat); + +// //making additional deposits to the strategies +// assertTrue(!delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); +// _testDepositWeth(staker, ethAmount); +// _testDepositEigen(staker, eigenAmount); +// _testDelegateToOperator(staker, operator); +// assertTrue(delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); + +// (/*IStrategy[] memory updatedStrategies*/, uint256[] memory updatedShares) = strategyManager.getDeposits(staker); + +// { +// IStrategy _strat = wethStrat; +// // IStrategy _strat = strategyManager.stakerStrats(staker, 0); +// assertTrue(address(_strat) != address(0), "stakerStrats not updated correctly"); + +// assertTrue( +// delegation.operatorShares(operator, _strat) - updatedShares[0] == amountBefore, +// "ETH operatorShares not updated correctly" +// ); + +// cheats.startPrank(address(strategyManager)); + +// IDelegationManager.OperatorDetails memory expectedOperatorDetails = delegation.operatorDetails(operator); +// assertTrue( +// keccak256(abi.encode(expectedOperatorDetails)) == keccak256(abi.encode(operatorDetails)), +// "failed to set correct operator details" +// ); +// } +// } + +// /// @notice tests that a when an operator is undelegated from, that the staker is properly classified as undelegated. +// function testUndelegation( +// address operator, +// address staker, +// uint96 ethAmount, +// uint96 eigenAmount +// ) public fuzzedAddress(operator) fuzzedAddress(staker) fuzzedAmounts(ethAmount, eigenAmount) { +// cheats.assume(staker != operator); +// // base strategy will revert if these amounts are too small on first deposit +// cheats.assume(ethAmount >= 1); +// cheats.assume(eigenAmount >= 1); +// _testDelegation(operator, staker, ethAmount, eigenAmount); + +// (IStrategy[] memory strategyArray, uint256[] memory shareAmounts) = strategyManager.getDeposits(staker); +// uint256[] memory strategyIndexes = new uint256[](strategyArray.length); + +// // withdraw shares +// _testQueueWithdrawal(staker, strategyIndexes, strategyArray, shareAmounts, staker /*withdrawer*/); + +// cheats.startPrank(staker); +// delegation.undelegate(staker); +// cheats.stopPrank(); + +// require(delegation.delegatedTo(staker) == address(0), "undelegation unsuccessful"); +// } + +// /// @notice tests delegation from a staker to operator via ECDSA signature. +// function testDelegateToBySignature( +// address operator, +// uint96 ethAmount, +// uint96 eigenAmount, +// uint256 expiry +// ) public fuzzedAddress(operator) { +// address staker = cheats.addr(PRIVATE_KEY); +// _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); + +// uint256 nonceBefore = delegation.stakerNonce(staker); + +// bytes32 structHash = keccak256( +// abi.encode(delegation.STAKER_DELEGATION_TYPEHASH(), staker, operator, nonceBefore, expiry) +// ); +// bytes32 digestHash = keccak256(abi.encodePacked("\x19\x01", delegation.domainSeparator(), structHash)); + +// bytes memory signature; +// { +// (uint8 v, bytes32 r, bytes32 s) = cheats.sign(PRIVATE_KEY, digestHash); +// signature = abi.encodePacked(r, s, v); +// } + +// if (expiry < block.timestamp) { +// cheats.expectRevert("DelegationManager.delegateToBySignature: staker signature expired"); +// } +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ +// signature: signature, +// expiry: expiry +// }); +// delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); +// if (expiry >= block.timestamp) { +// assertTrue(delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); +// assertTrue(nonceBefore + 1 == delegation.stakerNonce(staker), "nonce not incremented correctly"); +// assertTrue(delegation.delegatedTo(staker) == operator, "staker delegated to wrong operator"); +// } +// } + +// /// @notice tries delegating using a signature and an EIP 1271 compliant wallet +// function testDelegateToBySignature_WithContractWallet_Successfully( +// address operator, +// uint96 ethAmount, +// uint96 eigenAmount +// ) public fuzzedAddress(operator) { +// address staker = cheats.addr(PRIVATE_KEY); + +// // deploy ERC1271WalletMock for staker to use +// cheats.startPrank(staker); +// ERC1271WalletMock wallet = new ERC1271WalletMock(staker); +// cheats.stopPrank(); +// staker = address(wallet); + +// _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); + +// uint256 nonceBefore = delegation.stakerNonce(staker); + +// bytes32 structHash = keccak256( +// abi.encode(delegation.STAKER_DELEGATION_TYPEHASH(), staker, operator, nonceBefore, type(uint256).max) +// ); +// bytes32 digestHash = keccak256(abi.encodePacked("\x19\x01", delegation.domainSeparator(), structHash)); + +// bytes memory signature; +// { +// (uint8 v, bytes32 r, bytes32 s) = cheats.sign(PRIVATE_KEY, digestHash); +// signature = abi.encodePacked(r, s, v); +// } + +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ +// signature: signature, +// expiry: type(uint256).max +// }); +// delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); +// assertTrue(delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); +// assertTrue(nonceBefore + 1 == delegation.stakerNonce(staker), "nonce not incremented correctly"); +// assertTrue(delegation.delegatedTo(staker) == operator, "staker delegated to wrong operator"); +// } + +// /// @notice tries delegating using a signature and an EIP 1271 compliant wallet, *but* providing a bad signature +// function testDelegateToBySignature_WithContractWallet_BadSignature( +// address operator, +// uint96 ethAmount, +// uint96 eigenAmount +// ) public fuzzedAddress(operator) { +// address staker = cheats.addr(PRIVATE_KEY); + +// // deploy ERC1271WalletMock for staker to use +// cheats.startPrank(staker); +// ERC1271WalletMock wallet = new ERC1271WalletMock(staker); +// cheats.stopPrank(); +// staker = address(wallet); + +// _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); + +// uint256 nonceBefore = delegation.stakerNonce(staker); + +// bytes32 structHash = keccak256( +// abi.encode(delegation.STAKER_DELEGATION_TYPEHASH(), staker, operator, nonceBefore, type(uint256).max) +// ); +// bytes32 digestHash = keccak256(abi.encodePacked("\x19\x01", delegation.domainSeparator(), structHash)); + +// bytes memory signature; +// { +// (uint8 v, bytes32 r, bytes32 s) = cheats.sign(PRIVATE_KEY, digestHash); +// // mess up the signature by flipping v's parity +// v = (v == 27 ? 28 : 27); +// signature = abi.encodePacked(r, s, v); +// } + +// cheats.expectRevert( +// bytes("EIP1271SignatureUtils.checkSignature_EIP1271: ERC1271 signature verification failed") +// ); +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ +// signature: signature, +// expiry: type(uint256).max +// }); +// delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); +// } + +// /// @notice tries delegating using a wallet that does not comply with EIP 1271 +// function testDelegateToBySignature_WithContractWallet_NonconformingWallet( +// address operator, +// uint96 ethAmount, +// uint96 eigenAmount, +// uint8 v, +// bytes32 r, +// bytes32 s +// ) public fuzzedAddress(operator) { +// address staker = cheats.addr(PRIVATE_KEY); + +// // deploy non ERC1271-compliant wallet for staker to use +// cheats.startPrank(staker); +// ERC1271MaliciousMock wallet = new ERC1271MaliciousMock(); +// cheats.stopPrank(); +// staker = address(wallet); + +// _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); + +// cheats.assume(staker != operator); + +// bytes memory signature = abi.encodePacked(r, s, v); + +// cheats.expectRevert(); +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ +// signature: signature, +// expiry: type(uint256).max +// }); +// delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); +// } + +// /// @notice tests delegation to EigenLayer via an ECDSA signatures with invalid signature +// /// @param operator is the operator being delegated to. +// function testDelegateToByInvalidSignature( +// address operator, +// uint96 ethAmount, +// uint96 eigenAmount, +// uint8 v, +// bytes32 r, +// bytes32 s +// ) public fuzzedAddress(operator) fuzzedAmounts(ethAmount, eigenAmount) { +// address staker = cheats.addr(PRIVATE_KEY); +// _registerOperatorAndDepositFromStaker(operator, staker, ethAmount, eigenAmount); + +// bytes memory signature = abi.encodePacked(r, s, v); + +// cheats.expectRevert(); +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ +// signature: signature, +// expiry: type(uint256).max +// }); +// delegation.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, bytes32(0)); +// } + +// /// @notice This function tests to ensure that a delegation contract +// /// cannot be intitialized multiple times +// function testCannotInitMultipleTimesDelegation() public cannotReinit { +// //delegation has already been initialized in the Deployer test contract +// delegation.initialize( +// address(this), +// eigenLayerPauserReg, +// 0, +// minWithdrawalDelayBlocks, +// initializeStrategiesToSetDelayBlocks, +// initializeWithdrawalDelayBlocks +// ); +// } + +// /// @notice This function tests to ensure that a you can't register as a delegate multiple times +// /// @param operator is the operator being delegated to. +// function testRegisterAsOperatorMultipleTimes(address operator) public fuzzedAddress(operator) { +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: operator, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// _testRegisterAsOperator(operator, operatorDetails); +// cheats.expectRevert(bytes("DelegationManager.registerAsOperator: caller is already actively delegated")); +// _testRegisterAsOperator(operator, operatorDetails); +// } + +// /// @notice This function tests to ensure that a staker cannot delegate to an unregistered operator +// /// @param delegate is the unregistered operator +// function testDelegationToUnregisteredDelegate(address delegate) public fuzzedAddress(delegate) { +// //deposit into 1 strategy for getOperatorAddress(1), who is delegating to the unregistered operator +// _testDepositStrategies(getOperatorAddress(1), 1e18, 1); +// _testDepositEigen(getOperatorAddress(1), 1e18); + +// cheats.expectRevert(bytes("DelegationManager.delegateTo: operator is not registered in EigenLayer")); +// cheats.startPrank(getOperatorAddress(1)); +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; +// delegation.delegateTo(delegate, signatureWithExpiry, bytes32(0)); +// cheats.stopPrank(); +// } + +// /// @notice This function tests to ensure that a delegation contract +// /// cannot be intitialized multiple times, test with different caller addresses +// function testCannotInitMultipleTimesDelegation(address _attacker) public { +// cheats.assume(_attacker != address(eigenLayerProxyAdmin)); +// //delegation has already been initialized in the Deployer test contract +// vm.prank(_attacker); +// cheats.expectRevert(bytes("Initializable: contract is already initialized")); +// delegation.initialize( +// _attacker, +// eigenLayerPauserReg, +// 0, +// 0, // minWithdrawalDelayBLocks +// initializeStrategiesToSetDelayBlocks, +// initializeWithdrawalDelayBlocks +// ); +// } + +// /// @notice This function tests to ensure that an address can only call registerAsOperator() once +// function testCannotRegisterAsOperatorTwice( +// address _operator, +// address _dt +// ) public fuzzedAddress(_operator) fuzzedAddress(_dt) { +// vm.assume(_dt != address(0)); +// vm.startPrank(_operator); +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: msg.sender, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// string memory emptyStringForMetadataURI; +// delegation.registerAsOperator(operatorDetails, emptyStringForMetadataURI); +// vm.expectRevert("DelegationManager.registerAsOperator: caller is already actively delegated"); +// delegation.registerAsOperator(operatorDetails, emptyStringForMetadataURI); +// cheats.stopPrank(); +// } + +// /// @notice this function checks that you can only delegate to an address that is already registered. +// function testDelegateToInvalidOperator( +// address _staker, +// address _unregisteredoperator +// ) public fuzzedAddress(_staker) { +// vm.startPrank(_staker); +// cheats.expectRevert(bytes("DelegationManager.delegateTo: operator is not registered in EigenLayer")); +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; +// delegation.delegateTo(_unregisteredoperator, signatureWithExpiry, bytes32(0)); +// cheats.expectRevert(bytes("DelegationManager.delegateTo: operator is not registered in EigenLayer")); +// delegation.delegateTo(_staker, signatureWithExpiry, bytes32(0)); +// cheats.stopPrank(); +// } + +// function testUndelegate_SigP_Version(address _operator, address _staker, address _dt) public { +// vm.assume(_operator != address(0)); +// vm.assume(_staker != address(0)); +// vm.assume(_operator != _staker); +// vm.assume(_dt != address(0)); +// vm.assume(_operator != address(eigenLayerProxyAdmin)); +// vm.assume(_staker != address(eigenLayerProxyAdmin)); + +// // setup delegation +// vm.prank(_operator); +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: _dt, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// string memory emptyStringForMetadataURI; +// delegation.registerAsOperator(operatorDetails, emptyStringForMetadataURI); +// vm.prank(_staker); +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; +// delegation.delegateTo(_operator, signatureWithExpiry, bytes32(0)); + +// // operators cannot undelegate from themselves +// vm.prank(_operator); +// cheats.expectRevert(bytes("DelegationManager.undelegate: operators cannot be undelegated")); +// delegation.undelegate(_operator); + +// // assert still delegated +// assertTrue(delegation.isDelegated(_staker)); +// assertTrue(delegation.isOperator(_operator)); + +// // _staker *can* undelegate themselves +// vm.prank(_staker); +// delegation.undelegate(_staker); + +// // assert undelegated +// assertTrue(!delegation.isDelegated(_staker)); +// assertTrue(delegation.isOperator(_operator)); +// } + +// function _testRegisterAdditionalOperator(uint256 index) internal { +// address sender = getOperatorAddress(index); + +// //register as both ETH and EIGEN operator +// uint256 wethToDeposit = 1e18; +// uint256 eigenToDeposit = 1e10; +// _testDepositWeth(sender, wethToDeposit); +// _testDepositEigen(sender, eigenToDeposit); +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: sender, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// _testRegisterAsOperator(sender, operatorDetails); +// cheats.startPrank(sender); + +// cheats.stopPrank(); +// } + +// // registers the operator if they are not already registered, and deposits "WETH" + "EIGEN" on behalf of the staker. +// function _registerOperatorAndDepositFromStaker( +// address operator, +// address staker, +// uint96 ethAmount, +// uint96 eigenAmount +// ) internal { +// cheats.assume(staker != operator); + +// // if first deposit amount to base strategy is too small, it will revert. ignore that case here. +// cheats.assume(ethAmount >= 1 && ethAmount <= 1e18); +// cheats.assume(eigenAmount >= 1 && eigenAmount <= 1e18); + +// if (!delegation.isOperator(operator)) { +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: operator, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// _testRegisterAsOperator(operator, operatorDetails); +// } + +// //making additional deposits to the strategies +// assertTrue(!delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); +// _testDepositWeth(staker, ethAmount); +// _testDepositEigen(staker, eigenAmount); +// } +// } \ No newline at end of file diff --git a/src/test/DelegationFaucet.t.sol b/src/test/DelegationFaucet.t.sol deleted file mode 100644 index c611b8669..000000000 --- a/src/test/DelegationFaucet.t.sol +++ /dev/null @@ -1,513 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "script/whitelist/delegationFaucet/DelegationFaucet.sol"; -import "script/whitelist/ERC20PresetMinterPauser.sol"; - -import "src/test/EigenLayerTestHelper.t.sol"; - -contract DelegationFaucetTests is EigenLayerTestHelper { - // EigenLayer contracts - DelegationFaucet delegationFaucet; - - // M2 testing/mock contracts - ERC20PresetMinterPauser public stakeToken; - StrategyBase public stakeTokenStrat; - - bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - uint256 public constant DEFAULT_AMOUNT = 100e18; - address owner = cheats.addr(1000); - - /// @notice Emitted when a queued withdrawal is completed - event WithdrawalCompleted(bytes32 withdrawalRoot); - - function setUp() public virtual override { - EigenLayerDeployer.setUp(); - - // Deploy ERC20 stakeToken, StrategyBase, and add StrategyBase to whitelist - stakeToken = new ERC20PresetMinterPauser("StakeToken", "STK"); - stakeTokenStrat = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector(StrategyBase.initialize.selector, stakeToken, eigenLayerPauserReg) - ) - ) - ); - cheats.startPrank(strategyManager.strategyWhitelister()); - IStrategy[] memory _strategy = new IStrategy[](1); - bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); - _strategy[0] = stakeTokenStrat; - strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); - cheats.stopPrank(); - - // Deploy DelegationFaucet, grant it admin/mint/pauser roles, etc. - delegationFaucet = new DelegationFaucet(strategyManager, delegation, stakeToken, stakeTokenStrat); - targetContract(address(delegationFaucet)); - stakeToken.grantRole(MINTER_ROLE, address(delegationFaucet)); - } - - /** - * @notice Assertions in test - * - Checks staker contract is deployed - * - Checks token supply before/after minting - * - Checks token balances are updated correctly for staker and strategy contracts - * @param _operatorIndex is the index of the operator to use from the test-data/operators.json file - * @param _depositAmount is the amount of stakeToken to mint to the staker and deposit into the strategy - */ - function test_mintDepositAndDelegate_CheckBalancesAndDeploys(uint8 _operatorIndex, uint256 _depositAmount) public { - cheats.assume(_operatorIndex < 15 && _depositAmount < DEFAULT_AMOUNT); - if (_depositAmount == 0) { - // Passing 0 as amount param defaults the amount to DEFAULT_AMOUNT constant - _depositAmount = DEFAULT_AMOUNT; - } - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - uint256 supplyBefore = stakeToken.totalSupply(); - uint256 stratBalanceBefore = stakeToken.balanceOf(address(stakeTokenStrat)); - assertTrue( - !Address.isContract(stakerContract), - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: staker contract shouldn't be deployed" - ); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), _depositAmount); - assertTrue( - Address.isContract(stakerContract), - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: staker contract not deployed" - ); - uint256 supplyAfter = stakeToken.totalSupply(); - uint256 stratBalanceAfter = stakeToken.balanceOf(address(stakeTokenStrat)); - // Check token supply and balances - assertEq( - supplyAfter, - supplyBefore + _depositAmount, - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: token supply not updated correctly" - ); - assertEq( - stratBalanceAfter, - stratBalanceBefore + _depositAmount, - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: strategy balance not updated correctly" - ); - assertEq( - stakeToken.balanceOf(stakerContract), - 0, - "test_mintDepositAndDelegate_CheckBalancesAndDeploys: staker balance should be 0" - ); - } - - /** - * @notice Check the before/after values for strategy shares and operator shares - * @param _operatorIndex is the index of the operator to use from the test-data/operators.json file - * @param _depositAmount is the amount of stakeToken to mint to the staker and deposit into the strategy - */ - function test_mintDepositAndDelegate_StrategyAndOperatorShares( - uint8 _operatorIndex, - uint256 _depositAmount - ) public { - cheats.assume(_operatorIndex < 15 && _depositAmount < DEFAULT_AMOUNT); - if (_depositAmount == 0) { - _depositAmount = DEFAULT_AMOUNT; - } - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - uint256 stakerSharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesBefore = delegation.operatorShares(operator, stakeTokenStrat); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), _depositAmount); - - uint256 stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - assertTrue( - delegation.delegatedTo(stakerContract) == operator, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: delegated address not set appropriately" - ); - assertTrue( - delegation.isDelegated(stakerContract), - "test_mintDepositAndDelegate_StrategyAndOperatorShares: delegated status not set appropriately" - ); - assertEq( - stakerSharesAfter, - stakerSharesBefore + _depositAmount, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: staker shares not updated correctly" - ); - assertEq( - operatorSharesAfter, - operatorSharesBefore + _depositAmount, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: operator shares not updated correctly" - ); - } - - /** - * @notice Invariant test the before/after values for strategy shares and operator shares from multiple runs - */ - /// forge-config: default.invariant.runs = 5 - /// forge-config: default.invariant.depth = 20 - function invariant_test_mintDepositAndDelegate_StrategyAndOperatorShares() public { - // Setup Operator - address operator = getOperatorAddress(0); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - uint256 stakerSharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesBefore = delegation.operatorShares(operator, stakeTokenStrat); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - cheats.prank(delegationFaucet.owner()); - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - - uint256 stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - assertTrue( - delegation.delegatedTo(stakerContract) == operator, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: delegated address not set appropriately" - ); - assertTrue( - delegation.isDelegated(stakerContract), - "test_mintDepositAndDelegate_StrategyAndOperatorShares: delegated status not set appropriately" - ); - assertEq( - stakerSharesAfter, - stakerSharesBefore + DEFAULT_AMOUNT, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: staker shares not updated correctly" - ); - assertEq( - operatorSharesAfter, - operatorSharesBefore + DEFAULT_AMOUNT, - "test_mintDepositAndDelegate_StrategyAndOperatorShares: operator shares not updated correctly" - ); - } - - /** - * @param _operatorIndex is the index of the operator to use from the test-data/operators.json file - */ - function test_mintDepositAndDelegate_RevertsIf_UnregisteredOperator(uint8 _operatorIndex) public { - cheats.assume(_operatorIndex < 15); - address operator = getOperatorAddress(_operatorIndex); - // Unregistered operator should revert - cheats.expectRevert("DelegationFaucet: Operator not registered"); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - } - - function test_depositIntoStrategy_IncreaseShares(uint8 _operatorIndex, uint256 _depositAmount) public { - cheats.assume(_operatorIndex < 15 && _depositAmount < DEFAULT_AMOUNT); - if (_depositAmount == 0) { - _depositAmount = DEFAULT_AMOUNT; - } - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - uint256 stakerSharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesBefore = delegation.operatorShares(operator, stakeTokenStrat); - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - - uint256 stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - assertTrue( - delegation.delegatedTo(stakerContract) == operator, - "test_mintDepositAndDelegate_IncreaseShares: delegated address not set appropriately" - ); - assertTrue( - delegation.isDelegated(stakerContract), - "test_mintDepositAndDelegate_IncreaseShares: delegated status not set appropriately" - ); - assertEq( - stakerSharesAfter, - stakerSharesBefore + DEFAULT_AMOUNT, - "test_mintDepositAndDelegate_IncreaseShares: staker shares not updated correctly" - ); - assertEq( - operatorSharesAfter, - operatorSharesBefore + DEFAULT_AMOUNT, - "test_mintDepositAndDelegate_IncreaseShares: operator shares not updated correctly" - ); - - // Deposit more into strategy - stakerSharesBefore = stakerSharesAfter; - operatorSharesBefore = operatorSharesAfter; - delegationFaucet.depositIntoStrategy(stakerContract, stakeTokenStrat, stakeToken, _depositAmount); - stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - - assertEq( - stakerSharesAfter, - stakerSharesBefore + _depositAmount, - "test_mintDepositAndDelegate_IncreasesShares: staker shares not updated correctly" - ); - assertEq( - operatorSharesAfter, - operatorSharesBefore + _depositAmount, - "test_mintDepositAndDelegate_IncreasesShares: operator shares not updated correctly" - ); - } - - function test_queueWithdrawal_StakeTokenWithdraw(uint8 _operatorIndex, uint256 _withdrawAmount) public { - cheats.assume(_operatorIndex < 15 && 0 < _withdrawAmount && _withdrawAmount < DEFAULT_AMOUNT); - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - - uint256 operatorSharesBefore = delegation.operatorShares(operator, stakeTokenStrat); - uint256 stakerSharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 nonceBefore = delegation.cumulativeWithdrawalsQueued(/*staker*/ stakerContract); - - // Queue withdrawal - ( - IDelegationManager.Withdrawal memory queuedWithdrawal, - , /*tokensArray is unused in this test*/ - /*withdrawalRoot is unused in this test*/ - ) = _setUpQueuedWithdrawalStructSingleStrat( - /*staker*/ stakerContract, - /*withdrawer*/ stakerContract, - stakeToken, - stakeTokenStrat, - _withdrawAmount - ); - IDelegationManager.QueuedWithdrawalParams[] memory params = new IDelegationManager.QueuedWithdrawalParams[](1); - - params[0] = IDelegationManager.QueuedWithdrawalParams({ - strategies: queuedWithdrawal.strategies, - shares: queuedWithdrawal.shares, - withdrawer: stakerContract - }); - - delegationFaucet.queueWithdrawal( - stakerContract, - params - ); - uint256 operatorSharesAfter = delegation.operatorShares(operator, stakeTokenStrat); - uint256 stakerSharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 nonceAfter = delegation.cumulativeWithdrawalsQueued(/*staker*/ stakerContract); - - assertEq( - operatorSharesBefore, - operatorSharesAfter + _withdrawAmount, - "test_queueWithdrawal_WithdrawStakeToken: operator shares not updated correctly" - ); - // Withdrawal queued, but not withdrawn as of yet - assertEq( - stakerSharesBefore, - stakerSharesAfter + _withdrawAmount, - "test_queueWithdrawal_WithdrawStakeToken: staker shares not updated correctly" - ); - assertEq( - nonceBefore, - nonceAfter - 1, - "test_queueWithdrawal_WithdrawStakeToken: staker withdrawal nonce not updated" - ); - } - - function test_completeQueuedWithdrawal_ReceiveAsTokensMarkedFalse( - uint8 _operatorIndex, - uint256 _withdrawAmount - ) public { - test_queueWithdrawal_StakeTokenWithdraw(_operatorIndex, _withdrawAmount); - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - // assertion before values - uint256 sharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 balanceBefore = stakeToken.balanceOf(address(stakerContract)); - - // Set completeQueuedWithdrawal params - IStrategy[] memory strategyArray = new IStrategy[](1); - IERC20[] memory tokensArray = new IERC20[](1); - uint256[] memory shareAmounts = new uint256[](1); - { - strategyArray[0] = stakeTokenStrat; - shareAmounts[0] = _withdrawAmount; - tokensArray[0] = stakeToken; - } - - IDelegationManager.Withdrawal memory queuedWithdrawal; - { - uint256 nonce = delegation.cumulativeWithdrawalsQueued(stakerContract); - - queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: stakerContract, - withdrawer: stakerContract, - nonce: (nonce - 1), - startBlock: uint32(block.number), - delegatedTo: strategyManager.delegation().delegatedTo(stakerContract) - }); - } - cheats.expectEmit(true, true, true, true, address(delegation)); - emit WithdrawalCompleted(delegation.calculateWithdrawalRoot(queuedWithdrawal)); - uint256 middlewareTimesIndex = 0; - bool receiveAsTokens = false; - delegationFaucet.completeQueuedWithdrawal( - stakerContract, - queuedWithdrawal, - tokensArray, - middlewareTimesIndex, - receiveAsTokens - ); - // assertion after values - uint256 sharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 balanceAfter = stakeToken.balanceOf(address(stakerContract)); - assertEq( - sharesBefore + _withdrawAmount, - sharesAfter, - "test_completeQueuedWithdrawal_ReceiveAsTokensMarkedFalse: staker shares not updated correctly" - ); - assertEq( - balanceBefore, - balanceAfter, - "test_completeQueuedWithdrawal_ReceiveAsTokensMarkedFalse: stakerContract balance not updated correctly" - ); - } - - function test_completeQueuedWithdrawal_ReceiveAsTokensMarkedTrue( - uint8 _operatorIndex, - uint256 _withdrawAmount - ) public { - test_queueWithdrawal_StakeTokenWithdraw(_operatorIndex, _withdrawAmount); - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - // assertion before values - uint256 sharesBefore = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 balanceBefore = stakeToken.balanceOf(address(stakerContract)); - - // Set completeQueuedWithdrawal params - IStrategy[] memory strategyArray = new IStrategy[](1); - IERC20[] memory tokensArray = new IERC20[](1); - uint256[] memory shareAmounts = new uint256[](1); - { - strategyArray[0] = stakeTokenStrat; - shareAmounts[0] = _withdrawAmount; - tokensArray[0] = stakeToken; - } - - IDelegationManager.Withdrawal memory queuedWithdrawal; - { - uint256 nonce = delegation.cumulativeWithdrawalsQueued(stakerContract); - - queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: stakerContract, - withdrawer: stakerContract, - nonce: (nonce - 1), - startBlock: uint32(block.number), - delegatedTo: strategyManager.delegation().delegatedTo(stakerContract) - }); - } - cheats.expectEmit(true, true, true, true, address(delegation)); - emit WithdrawalCompleted(delegation.calculateWithdrawalRoot(queuedWithdrawal)); - uint256 middlewareTimesIndex = 0; - bool receiveAsTokens = true; - delegationFaucet.completeQueuedWithdrawal( - stakerContract, - queuedWithdrawal, - tokensArray, - middlewareTimesIndex, - receiveAsTokens - ); - // assertion after values - uint256 sharesAfter = strategyManager.stakerStrategyShares(stakerContract, stakeTokenStrat); - uint256 balanceAfter = stakeToken.balanceOf(address(stakerContract)); - assertEq( - sharesBefore, - sharesAfter, - "test_completeQueuedWithdrawal_ReceiveAsTokensMarkedTrue: staker shares not updated correctly" - ); - assertEq( - balanceBefore + _withdrawAmount, - balanceAfter, - "test_completeQueuedWithdrawal_ReceiveAsTokensMarkedTrue: stakerContract balance not updated correctly" - ); - } - - function test_transfer_TransfersERC20(uint8 _operatorIndex, address _to, uint256 _transferAmount) public { - cheats.assume(_operatorIndex < 15); - // Setup Operator - address operator = getOperatorAddress(_operatorIndex); - address stakerContract = delegationFaucet.getStaker(operator); - _registerOperator(operator); - - // Mint token to Staker, deposit minted amount into strategy, and delegate to operator - IDelegationManager.SignatureWithExpiry memory signatureWithExpiry; - delegationFaucet.mintDepositAndDelegate(operator, signatureWithExpiry, bytes32(0), DEFAULT_AMOUNT); - - ERC20PresetMinterPauser mockToken = new ERC20PresetMinterPauser("MockToken", "MTK"); - mockToken.mint(stakerContract, _transferAmount); - - uint256 stakerBalanceBefore = mockToken.balanceOf(stakerContract); - uint256 toBalanceBefore = mockToken.balanceOf(_to); - delegationFaucet.transfer(stakerContract, address(mockToken), _to, _transferAmount); - uint256 stakerBalanceAfter = mockToken.balanceOf(stakerContract); - uint256 toBalanceAfter = mockToken.balanceOf(_to); - assertEq( - stakerBalanceBefore, - stakerBalanceAfter + _transferAmount, - "test_transfer_TransfersERC20: staker balance not updated correctly" - ); - assertEq( - toBalanceBefore + _transferAmount, - toBalanceAfter, - "test_transfer_TransfersERC20: to balance not updated correctly" - ); - } - - function _registerOperator(address _operator) internal { - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: _operator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _testRegisterAsOperator(_operator, operatorDetails); - } - - function _setUpQueuedWithdrawalStructSingleStrat( - address staker, - address withdrawer, - IERC20 token, - IStrategy strategy, - uint256 shareAmount - ) - internal - view - returns ( - IDelegationManager.Withdrawal memory queuedWithdrawal, - IERC20[] memory tokensArray, - bytes32 withdrawalRoot - ) - { - IStrategy[] memory strategyArray = new IStrategy[](1); - tokensArray = new IERC20[](1); - uint256[] memory shareAmounts = new uint256[](1); - strategyArray[0] = strategy; - tokensArray[0] = token; - shareAmounts[0] = shareAmount; - queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: staker, - withdrawer: withdrawer, - nonce: delegation.cumulativeWithdrawalsQueued(staker), - startBlock: uint32(block.number), - delegatedTo: strategyManager.delegation().delegatedTo(staker) - }); - // calculate the withdrawal root - withdrawalRoot = delegation.calculateWithdrawalRoot(queuedWithdrawal); - return (queuedWithdrawal, tokensArray, withdrawalRoot); - } -} diff --git a/src/test/DepositWithdraw.t.sol b/src/test/DepositWithdraw.t.sol index 8e87e245b..263e73c99 100644 --- a/src/test/DepositWithdraw.t.sol +++ b/src/test/DepositWithdraw.t.sol @@ -1,503 +1,503 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.12; -import "./EigenLayerTestHelper.t.sol"; -import "../contracts/core/StrategyManagerStorage.sol"; -import "./mocks/ERC20_OneWeiFeeOnTransfer.sol"; - -contract DepositWithdrawTests is EigenLayerTestHelper { - uint256[] public emptyUintArray; - - /** - * @notice Verifies that it is possible to deposit WETH - * @param amountToDeposit Fuzzed input for amount of WETH to deposit - */ - function testWethDeposit(uint256 amountToDeposit) public returns (uint256 amountDeposited) { - // if first deposit amount to base strategy is too small, it will revert. ignore that case here. - cheats.assume(amountToDeposit >= 1); - cheats.assume(amountToDeposit <= 1e38 - 1); - return _testDepositWeth(getOperatorAddress(0), amountToDeposit); - } - - - /// @notice deploys 'numStratsToAdd' strategies using '_testAddStrategy' and then deposits '1e18' to each of them from 'getOperatorAddress(0)' - /// @param numStratsToAdd is the number of strategies being added and deposited into - function testDepositStrategies(uint8 numStratsToAdd) public { - _testDepositStrategies(getOperatorAddress(0), 1e18, numStratsToAdd); - } - - /// @notice Verifies that it is possible to deposit eigen. - /// @param eigenToDeposit is amount of eigen to deposit into the eigen strategy - function testDepositEigen(uint96 eigenToDeposit) public { - // sanity check for inputs; keeps fuzzed tests from failing - cheats.assume(eigenToDeposit < eigenTotalSupply); - // if first deposit amount to base strategy is too small, it will revert. ignore that case here. - cheats.assume(eigenToDeposit >= 1); - _testDepositEigen(getOperatorAddress(0), eigenToDeposit); - } - - /** - * @notice Tries to deposit an unsupported token into an `StrategyBase` contract by calling `strategyManager.depositIntoStrategy`. - * Verifies that reversion occurs correctly. - */ - function testDepositUnsupportedToken() public { - IERC20 token = new ERC20PresetFixedSupply( - "badToken", - "BADTOKEN", - 100, - address(this) - ); - token.approve(address(strategyManager), type(uint256).max); - - // whitelist the strategy for deposit - cheats.startPrank(strategyManager.strategyWhitelister()); - IStrategy[] memory _strategy = new IStrategy[](1); - bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); - _strategy[0] = wethStrat; - strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); - cheats.stopPrank(); - - cheats.expectRevert(bytes("StrategyBase.deposit: Can only deposit underlyingToken")); - strategyManager.depositIntoStrategy(wethStrat, token, 10); - } - - /** - * @notice Tries to deposit into an unsupported strategy by calling `strategyManager.depositIntoStrategy`. - * Verifies that reversion occurs correctly. - */ - function testDepositNonexistentStrategy(address nonexistentStrategy) public fuzzedAddress(nonexistentStrategy) { - // assume that the fuzzed address is not already a contract! - uint256 size; - assembly { - size := extcodesize(nonexistentStrategy) - } - cheats.assume(size == 0); - // check against calls from precompile addresses -- was getting fuzzy failures from this - cheats.assume(uint160(nonexistentStrategy) > 9); - - // harcoded input - uint256 testDepositAmount = 10; - - IERC20 token = new ERC20PresetFixedSupply( - "badToken", - "BADTOKEN", - 100, - address(this) - ); - token.approve(address(strategyManager), type(uint256).max); - - // whitelist the strategy for deposit - cheats.startPrank(strategyManager.strategyWhitelister()); - IStrategy[] memory _strategy = new IStrategy[](1); - bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); - _strategy[0] = IStrategy(nonexistentStrategy); - strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); - cheats.stopPrank(); - - cheats.expectRevert(); - strategyManager.depositIntoStrategy(IStrategy(nonexistentStrategy), token, testDepositAmount); - } - - /// @notice verify that trying to deposit an amount of zero will correctly revert - function testRevertOnZeroDeposit() public { - // whitelist the strategy for deposit - cheats.startPrank(strategyManager.strategyWhitelister()); - IStrategy[] memory _strategy = new IStrategy[](1); - bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); - _strategy[0] = wethStrat; - strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); - cheats.stopPrank(); - - cheats.expectRevert(bytes("StrategyBase.deposit: newShares cannot be zero")); - strategyManager.depositIntoStrategy(wethStrat, weth, 0); - } - - - /** - * @notice Modified from existing _createQueuedWithdrawal, skips delegation and deposit steps so that we can isolate the withdrawal step - * @notice Creates a queued withdrawal from `staker`, queues a withdrawal using - * `delegation.queueWithdrawal(strategyIndexes, strategyArray, tokensArray, shareAmounts, withdrawer)` - * @notice After initiating a queued withdrawal, this test checks that `delegation.canCompleteQueuedWithdrawal` immediately returns the correct - * response depending on whether `staker` is delegated or not. - * @param staker The address to initiate the queued withdrawal - * @param amountToDeposit The amount of WETH to deposit - */ - function _createOnlyQueuedWithdrawal( - address staker, - bool /*registerAsOperator*/, - uint256 amountToDeposit, - IStrategy[] memory strategyArray, - IERC20[] memory /*tokensArray*/, - uint256[] memory shareAmounts, - uint256[] memory /*strategyIndexes*/, - address withdrawer - ) - internal returns(bytes32 withdrawalRoot, IDelegationManager.Withdrawal memory queuedWithdrawal) - { - require(amountToDeposit >= shareAmounts[0], "_createQueuedWithdrawal: sanity check failed"); - - queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: staker, - withdrawer: withdrawer, - nonce: delegation.cumulativeWithdrawalsQueued(staker), - delegatedTo: delegation.delegatedTo(staker), - startBlock: uint32(block.number) - }); - - - IDelegationManager.QueuedWithdrawalParams[] memory params = new IDelegationManager.QueuedWithdrawalParams[](1); +// import "./EigenLayerTestHelper.t.sol"; +// import "../contracts/core/StrategyManagerStorage.sol"; +// import "./mocks/ERC20_OneWeiFeeOnTransfer.sol"; + +// contract DepositWithdrawTests is EigenLayerTestHelper { +// uint256[] public emptyUintArray; + +// /** +// * @notice Verifies that it is possible to deposit WETH +// * @param amountToDeposit Fuzzed input for amount of WETH to deposit +// */ +// function testWethDeposit(uint256 amountToDeposit) public returns (uint256 amountDeposited) { +// // if first deposit amount to base strategy is too small, it will revert. ignore that case here. +// cheats.assume(amountToDeposit >= 1); +// cheats.assume(amountToDeposit <= 1e38 - 1); +// return _testDepositWeth(getOperatorAddress(0), amountToDeposit); +// } + + +// /// @notice deploys 'numStratsToAdd' strategies using '_testAddStrategy' and then deposits '1e18' to each of them from 'getOperatorAddress(0)' +// /// @param numStratsToAdd is the number of strategies being added and deposited into +// function testDepositStrategies(uint8 numStratsToAdd) public { +// _testDepositStrategies(getOperatorAddress(0), 1e18, numStratsToAdd); +// } + +// /// @notice Verifies that it is possible to deposit eigen. +// /// @param eigenToDeposit is amount of eigen to deposit into the eigen strategy +// function testDepositEigen(uint96 eigenToDeposit) public { +// // sanity check for inputs; keeps fuzzed tests from failing +// cheats.assume(eigenToDeposit < eigenTotalSupply); +// // if first deposit amount to base strategy is too small, it will revert. ignore that case here. +// cheats.assume(eigenToDeposit >= 1); +// _testDepositEigen(getOperatorAddress(0), eigenToDeposit); +// } + +// /** +// * @notice Tries to deposit an unsupported token into an `StrategyBase` contract by calling `strategyManager.depositIntoStrategy`. +// * Verifies that reversion occurs correctly. +// */ +// function testDepositUnsupportedToken() public { +// IERC20 token = new ERC20PresetFixedSupply( +// "badToken", +// "BADTOKEN", +// 100, +// address(this) +// ); +// token.approve(address(strategyManager), type(uint256).max); + +// // whitelist the strategy for deposit +// cheats.startPrank(strategyManager.strategyWhitelister()); +// IStrategy[] memory _strategy = new IStrategy[](1); +// bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); +// _strategy[0] = wethStrat; +// strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); +// cheats.stopPrank(); + +// cheats.expectRevert(bytes("StrategyBase.deposit: Can only deposit underlyingToken")); +// strategyManager.depositIntoStrategy(wethStrat, token, 10); +// } + +// /** +// * @notice Tries to deposit into an unsupported strategy by calling `strategyManager.depositIntoStrategy`. +// * Verifies that reversion occurs correctly. +// */ +// function testDepositNonexistentStrategy(address nonexistentStrategy) public fuzzedAddress(nonexistentStrategy) { +// // assume that the fuzzed address is not already a contract! +// uint256 size; +// assembly { +// size := extcodesize(nonexistentStrategy) +// } +// cheats.assume(size == 0); +// // check against calls from precompile addresses -- was getting fuzzy failures from this +// cheats.assume(uint160(nonexistentStrategy) > 9); + +// // harcoded input +// uint256 testDepositAmount = 10; + +// IERC20 token = new ERC20PresetFixedSupply( +// "badToken", +// "BADTOKEN", +// 100, +// address(this) +// ); +// token.approve(address(strategyManager), type(uint256).max); + +// // whitelist the strategy for deposit +// cheats.startPrank(strategyManager.strategyWhitelister()); +// IStrategy[] memory _strategy = new IStrategy[](1); +// bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); +// _strategy[0] = IStrategy(nonexistentStrategy); +// strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); +// cheats.stopPrank(); + +// cheats.expectRevert(); +// strategyManager.depositIntoStrategy(IStrategy(nonexistentStrategy), token, testDepositAmount); +// } + +// /// @notice verify that trying to deposit an amount of zero will correctly revert +// function testRevertOnZeroDeposit() public { +// // whitelist the strategy for deposit +// cheats.startPrank(strategyManager.strategyWhitelister()); +// IStrategy[] memory _strategy = new IStrategy[](1); +// bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); +// _strategy[0] = wethStrat; +// strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); +// cheats.stopPrank(); + +// cheats.expectRevert(bytes("StrategyBase.deposit: newShares cannot be zero")); +// strategyManager.depositIntoStrategy(wethStrat, weth, 0); +// } + + +// /** +// * @notice Modified from existing _createQueuedWithdrawal, skips delegation and deposit steps so that we can isolate the withdrawal step +// * @notice Creates a queued withdrawal from `staker`, queues a withdrawal using +// * `delegation.queueWithdrawal(strategyIndexes, strategyArray, tokensArray, shareAmounts, withdrawer)` +// * @notice After initiating a queued withdrawal, this test checks that `delegation.canCompleteQueuedWithdrawal` immediately returns the correct +// * response depending on whether `staker` is delegated or not. +// * @param staker The address to initiate the queued withdrawal +// * @param amountToDeposit The amount of WETH to deposit +// */ +// function _createOnlyQueuedWithdrawal( +// address staker, +// bool /*registerAsOperator*/, +// uint256 amountToDeposit, +// IStrategy[] memory strategyArray, +// IERC20[] memory /*tokensArray*/, +// uint256[] memory shareAmounts, +// uint256[] memory /*strategyIndexes*/, +// address withdrawer +// ) +// internal returns(bytes32 withdrawalRoot, IDelegationManager.Withdrawal memory queuedWithdrawal) +// { +// require(amountToDeposit >= shareAmounts[0], "_createQueuedWithdrawal: sanity check failed"); + +// queuedWithdrawal = IDelegationManager.Withdrawal({ +// strategies: strategyArray, +// shares: shareAmounts, +// staker: staker, +// withdrawer: withdrawer, +// nonce: delegation.cumulativeWithdrawalsQueued(staker), +// delegatedTo: delegation.delegatedTo(staker), +// startBlock: uint32(block.number) +// }); + + +// IDelegationManager.QueuedWithdrawalParams[] memory params = new IDelegationManager.QueuedWithdrawalParams[](1); - params[0] = IDelegationManager.QueuedWithdrawalParams({ - strategies: strategyArray, - shares: shareAmounts, - withdrawer: withdrawer - }); - - bytes32[] memory withdrawalRoots = new bytes32[](1); - - //queue the withdrawal - cheats.startPrank(staker); - withdrawalRoots = delegation.queueWithdrawals(params); - cheats.stopPrank(); - return (withdrawalRoots[0], queuedWithdrawal); - } +// params[0] = IDelegationManager.QueuedWithdrawalParams({ +// strategies: strategyArray, +// shares: shareAmounts, +// withdrawer: withdrawer +// }); + +// bytes32[] memory withdrawalRoots = new bytes32[](1); + +// //queue the withdrawal +// cheats.startPrank(staker); +// withdrawalRoots = delegation.queueWithdrawals(params); +// cheats.stopPrank(); +// return (withdrawalRoots[0], queuedWithdrawal); +// } - function testFrontrunFirstDepositor(/*uint256 depositAmount*/) public { +// function testFrontrunFirstDepositor(/*uint256 depositAmount*/) public { - //setup addresses - address attacker = address(100); - address user = address(200); - - //give 2 ether to attacker and user - weth.transfer(attacker,2 ether); - weth.transfer(user,2 ether); - - //attacker FRONTRUN: deposit 1 wei (receive 1 share) - StrategyManager _strategyManager = _whitelistStrategy(strategyManager, wethStrat); - - cheats.startPrank(attacker); - weth.approve(address(strategyManager), type(uint256).max); - _strategyManager.depositIntoStrategy(wethStrat, weth, 1 wei); - cheats.stopPrank(); - - //attacker FRONTRUN: transfer 1 ether into strategy directly to manipulate the value of shares - cheats.prank(attacker); - weth.transfer(address(wethStrat),1 ether); - - //user deposits 2 eth into strategy - only gets 1 share due to rounding - cheats.startPrank(user); - weth.approve(address(_strategyManager), type(uint256).max); - _strategyManager.depositIntoStrategy(wethStrat, weth, 2 ether); - cheats.stopPrank(); - - //attacker deposited 1 ether and 1 wei - received 1 share - //user deposited 2 ether - received X shares - //user has lost 0.5 ether? - (, uint256[] memory shares) = _strategyManager.getDeposits(attacker); - uint256 attackerValueWeth = wethStrat.sharesToUnderlyingView(shares[0]); - require(attackerValueWeth >= (1), "attacker got zero shares"); - - (, shares) = _strategyManager.getDeposits(user); - uint256 userValueWeth = wethStrat.sharesToUnderlyingView(shares[0]); - require(userValueWeth >= (1900000000000000000), "user has lost more than 0.1 eth from frontrunning"); - - uint256 attackerLossesWeth = (2 ether + 1 wei) - attackerValueWeth; - uint256 userLossesWeth = 2 ether - userValueWeth; - require(attackerLossesWeth > userLossesWeth, "griefing attack deals more damage than cost"); - } - - // fuzzed amounts user uint96's to be more realistic with amounts - function testFrontrunFirstDepositorFuzzed(uint96 firstDepositAmount, uint96 donationAmount, uint96 secondDepositAmount) public { - // want to only use nonzero amounts or else we'll get reverts - cheats.assume(firstDepositAmount != 0 && secondDepositAmount != 0); - - // setup addresses - address attacker = address(100); - address user = address(200); - - // attacker makes first deposit - _testDepositToStrategy(attacker, firstDepositAmount, weth, wethStrat); - - // transfer tokens into strategy directly to manipulate the value of shares - weth.transfer(address(wethStrat), donationAmount); - - // filter out calls that would revert for minting zero shares - cheats.assume(wethStrat.underlyingToShares(secondDepositAmount) != 0); - - // user makes 2nd deposit into strategy - gets diminished shares due to rounding - _testDepositToStrategy(user, secondDepositAmount, weth, wethStrat); - - // check for griefing - (, uint256[] memory shares) = strategyManager.getDeposits(attacker); - uint256 attackerValueWeth = wethStrat.sharesToUnderlyingView(shares[0]); - (, shares) = strategyManager.getDeposits(user); - uint256 userValueWeth = wethStrat.sharesToUnderlyingView(shares[0]); - - uint256 attackerCost = uint256(firstDepositAmount) + uint256(donationAmount); - require(attackerCost >= attackerValueWeth, "attacker gained value?"); - // uint256 attackerLossesWeth = attackerValueWeth > attackerCost ? 0 : (attackerCost - attackerValueWeth); - uint256 attackerLossesWeth = attackerCost - attackerValueWeth; - uint256 userLossesWeth = secondDepositAmount - userValueWeth; - - emit log_named_uint("attackerLossesWeth", attackerLossesWeth); - emit log_named_uint("userLossesWeth", userLossesWeth); - - // use '+1' here to account for rounding. given the attack will cost ETH in the form of gas, this is fine. - require(attackerLossesWeth + 1 >= userLossesWeth, "griefing attack deals more damage than cost"); - } - - - function testDepositTokenWithOneWeiFeeOnTransfer(address sender, uint64 amountToDeposit) public fuzzedAddress(sender) { - cheats.assume(amountToDeposit != 0); - - IERC20 underlyingToken; - - { - uint256 initSupply = 1e50; - address initOwner = address(this); - ERC20_OneWeiFeeOnTransfer oneWeiFeeOnTransferToken = new ERC20_OneWeiFeeOnTransfer(initSupply, initOwner); - underlyingToken = IERC20(address(oneWeiFeeOnTransferToken)); - } - - // need to transfer extra here because otherwise the `sender` won't have enough tokens - underlyingToken.transfer(sender, 1000); - - IStrategy oneWeiFeeOnTransferTokenStrategy = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector(StrategyBase.initialize.selector, underlyingToken, eigenLayerPauserReg) - ) - ) - ); - - // REMAINDER OF CODE ADAPTED FROM `_testDepositToStrategy` - // _testDepositToStrategy(sender, amountToDeposit, underlyingToken, oneWeiFeeOnTransferTokenStrategy); - - // whitelist the strategy for deposit, in case it wasn't before - { - cheats.startPrank(strategyManager.strategyWhitelister()); - IStrategy[] memory _strategy = new IStrategy[](1); - bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); - _strategy[0] = oneWeiFeeOnTransferTokenStrategy; - strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); - cheats.stopPrank(); - } +// //setup addresses +// address attacker = address(100); +// address user = address(200); + +// //give 2 ether to attacker and user +// weth.transfer(attacker,2 ether); +// weth.transfer(user,2 ether); + +// //attacker FRONTRUN: deposit 1 wei (receive 1 share) +// StrategyManager _strategyManager = _whitelistStrategy(strategyManager, wethStrat); + +// cheats.startPrank(attacker); +// weth.approve(address(strategyManager), type(uint256).max); +// _strategyManager.depositIntoStrategy(wethStrat, weth, 1 wei); +// cheats.stopPrank(); + +// //attacker FRONTRUN: transfer 1 ether into strategy directly to manipulate the value of shares +// cheats.prank(attacker); +// weth.transfer(address(wethStrat),1 ether); + +// //user deposits 2 eth into strategy - only gets 1 share due to rounding +// cheats.startPrank(user); +// weth.approve(address(_strategyManager), type(uint256).max); +// _strategyManager.depositIntoStrategy(wethStrat, weth, 2 ether); +// cheats.stopPrank(); + +// //attacker deposited 1 ether and 1 wei - received 1 share +// //user deposited 2 ether - received X shares +// //user has lost 0.5 ether? +// (, uint256[] memory shares) = _strategyManager.getDeposits(attacker); +// uint256 attackerValueWeth = wethStrat.sharesToUnderlyingView(shares[0]); +// require(attackerValueWeth >= (1), "attacker got zero shares"); + +// (, shares) = _strategyManager.getDeposits(user); +// uint256 userValueWeth = wethStrat.sharesToUnderlyingView(shares[0]); +// require(userValueWeth >= (1900000000000000000), "user has lost more than 0.1 eth from frontrunning"); + +// uint256 attackerLossesWeth = (2 ether + 1 wei) - attackerValueWeth; +// uint256 userLossesWeth = 2 ether - userValueWeth; +// require(attackerLossesWeth > userLossesWeth, "griefing attack deals more damage than cost"); +// } + +// // fuzzed amounts user uint96's to be more realistic with amounts +// function testFrontrunFirstDepositorFuzzed(uint96 firstDepositAmount, uint96 donationAmount, uint96 secondDepositAmount) public { +// // want to only use nonzero amounts or else we'll get reverts +// cheats.assume(firstDepositAmount != 0 && secondDepositAmount != 0); + +// // setup addresses +// address attacker = address(100); +// address user = address(200); + +// // attacker makes first deposit +// _testDepositToStrategy(attacker, firstDepositAmount, weth, wethStrat); + +// // transfer tokens into strategy directly to manipulate the value of shares +// weth.transfer(address(wethStrat), donationAmount); + +// // filter out calls that would revert for minting zero shares +// cheats.assume(wethStrat.underlyingToShares(secondDepositAmount) != 0); + +// // user makes 2nd deposit into strategy - gets diminished shares due to rounding +// _testDepositToStrategy(user, secondDepositAmount, weth, wethStrat); + +// // check for griefing +// (, uint256[] memory shares) = strategyManager.getDeposits(attacker); +// uint256 attackerValueWeth = wethStrat.sharesToUnderlyingView(shares[0]); +// (, shares) = strategyManager.getDeposits(user); +// uint256 userValueWeth = wethStrat.sharesToUnderlyingView(shares[0]); + +// uint256 attackerCost = uint256(firstDepositAmount) + uint256(donationAmount); +// require(attackerCost >= attackerValueWeth, "attacker gained value?"); +// // uint256 attackerLossesWeth = attackerValueWeth > attackerCost ? 0 : (attackerCost - attackerValueWeth); +// uint256 attackerLossesWeth = attackerCost - attackerValueWeth; +// uint256 userLossesWeth = secondDepositAmount - userValueWeth; + +// emit log_named_uint("attackerLossesWeth", attackerLossesWeth); +// emit log_named_uint("userLossesWeth", userLossesWeth); + +// // use '+1' here to account for rounding. given the attack will cost ETH in the form of gas, this is fine. +// require(attackerLossesWeth + 1 >= userLossesWeth, "griefing attack deals more damage than cost"); +// } + + +// function testDepositTokenWithOneWeiFeeOnTransfer(address sender, uint64 amountToDeposit) public fuzzedAddress(sender) { +// cheats.assume(amountToDeposit != 0); + +// IERC20 underlyingToken; + +// { +// uint256 initSupply = 1e50; +// address initOwner = address(this); +// ERC20_OneWeiFeeOnTransfer oneWeiFeeOnTransferToken = new ERC20_OneWeiFeeOnTransfer(initSupply, initOwner); +// underlyingToken = IERC20(address(oneWeiFeeOnTransferToken)); +// } + +// // need to transfer extra here because otherwise the `sender` won't have enough tokens +// underlyingToken.transfer(sender, 1000); + +// IStrategy oneWeiFeeOnTransferTokenStrategy = StrategyBase( +// address( +// new TransparentUpgradeableProxy( +// address(baseStrategyImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector(StrategyBase.initialize.selector, underlyingToken, eigenLayerPauserReg) +// ) +// ) +// ); + +// // REMAINDER OF CODE ADAPTED FROM `_testDepositToStrategy` +// // _testDepositToStrategy(sender, amountToDeposit, underlyingToken, oneWeiFeeOnTransferTokenStrategy); + +// // whitelist the strategy for deposit, in case it wasn't before +// { +// cheats.startPrank(strategyManager.strategyWhitelister()); +// IStrategy[] memory _strategy = new IStrategy[](1); +// bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); +// _strategy[0] = oneWeiFeeOnTransferTokenStrategy; +// strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); +// cheats.stopPrank(); +// } - uint256 operatorSharesBefore = strategyManager.stakerStrategyShares(sender, oneWeiFeeOnTransferTokenStrategy); - // check the expected output - uint256 expectedSharesOut = oneWeiFeeOnTransferTokenStrategy.underlyingToShares(amountToDeposit); - - underlyingToken.transfer(sender, amountToDeposit); - cheats.startPrank(sender); - underlyingToken.approve(address(strategyManager), type(uint256).max); - strategyManager.depositIntoStrategy(oneWeiFeeOnTransferTokenStrategy, underlyingToken, amountToDeposit); - - //check if depositor has never used this strat, that it is added correctly to stakerStrategyList array. - if (operatorSharesBefore == 0) { - // check that strategy is appropriately added to dynamic array of all of sender's strategies - assertTrue( - strategyManager.stakerStrategyList(sender, strategyManager.stakerStrategyListLength(sender) - 1) - == oneWeiFeeOnTransferTokenStrategy, - "_testDepositToStrategy: stakerStrategyList array updated incorrectly" - ); - } +// uint256 operatorSharesBefore = strategyManager.stakerStrategyShares(sender, oneWeiFeeOnTransferTokenStrategy); +// // check the expected output +// uint256 expectedSharesOut = oneWeiFeeOnTransferTokenStrategy.underlyingToShares(amountToDeposit); + +// underlyingToken.transfer(sender, amountToDeposit); +// cheats.startPrank(sender); +// underlyingToken.approve(address(strategyManager), type(uint256).max); +// strategyManager.depositIntoStrategy(oneWeiFeeOnTransferTokenStrategy, underlyingToken, amountToDeposit); + +// //check if depositor has never used this strat, that it is added correctly to stakerStrategyList array. +// if (operatorSharesBefore == 0) { +// // check that strategy is appropriately added to dynamic array of all of sender's strategies +// assertTrue( +// strategyManager.stakerStrategyList(sender, strategyManager.stakerStrategyListLength(sender) - 1) +// == oneWeiFeeOnTransferTokenStrategy, +// "_testDepositToStrategy: stakerStrategyList array updated incorrectly" +// ); +// } - // check that the shares out match the expected amount out - // the actual transfer in will be lower by 1 wei than expected due to stETH's internal rounding - // to account for this we check approximate rather than strict equivalence here - { - uint256 actualSharesOut = strategyManager.stakerStrategyShares(sender, oneWeiFeeOnTransferTokenStrategy) - operatorSharesBefore; - require((actualSharesOut * 1000) / expectedSharesOut > 998, "too few shares"); - require((actualSharesOut * 1000) / expectedSharesOut < 1002, "too many shares"); - - // additional sanity check for deposit not increasing in value - require(oneWeiFeeOnTransferTokenStrategy.sharesToUnderlying(actualSharesOut) <= amountToDeposit, "value cannot have increased"); - } - cheats.stopPrank(); - } - - /// @notice Shadow-forks mainnet and tests depositing stETH tokens into a "StrategyBase" contract. - function testForkMainnetDepositSteth() public { - // hard-coded inputs - // address sender = address(this); - uint64 amountToDeposit = 1e12; - - // shadow-fork mainnet - try cheats.createFork("mainnet") returns (uint256 forkId) { - cheats.selectFork(forkId); - // If RPC_MAINNET ENV not set, default to this mainnet RPC endpoint - } catch { - cheats.createSelectFork("https://eth.llamarpc.com"); - } - - // cast mainnet stETH address to IERC20 interface - // IERC20 steth = IERC20(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); - IERC20 underlyingToken = IERC20(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); - - // deploy necessary contracts on the shadow-forked network - // deploy proxy admin for ability to upgrade proxy contracts - eigenLayerProxyAdmin = new ProxyAdmin(); - //deploy pauser registry - address[] memory pausers = new address[](1); - pausers[0] = pauser; - 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(); - delegation = DelegationManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - strategyManager = StrategyManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - slasher = Slasher( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - eigenPodManager = EigenPodManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - - ethPOSDeposit = new ETHPOSDepositMock(); - pod = new EigenPod(ethPOSDeposit, eigenPodManager, GOERLI_GENESIS_TIME); - - eigenPodBeacon = new UpgradeableBeacon(address(pod)); - - // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs - DelegationManager delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - StrategyManager strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher); - Slasher slasherImplementation = new Slasher(strategyManager, delegation); - EigenPodManager eigenPodManagerImplementation = new EigenPodManager(ethPOSDeposit, eigenPodBeacon, strategyManager, slasher, delegation); - // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(delegation))), - address(delegationImplementation), - abi.encodeWithSelector( - DelegationManager.initialize.selector, - eigenLayerReputedMultisig, - eigenLayerPauserReg, - 0 /*initialPausedStatus*/, - minWithdrawalDelayBlocks, - initializeStrategiesToSetDelayBlocks, - initializeWithdrawalDelayBlocks - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(strategyManager))), - address(strategyManagerImplementation), - abi.encodeWithSelector( - StrategyManager.initialize.selector, - eigenLayerReputedMultisig, - eigenLayerReputedMultisig, - eigenLayerPauserReg, - 0/*initialPausedStatus*/ - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(slasher))), - address(slasherImplementation), - abi.encodeWithSelector( - Slasher.initialize.selector, - eigenLayerReputedMultisig, - eigenLayerPauserReg, - 0/*initialPausedStatus*/ - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation), - abi.encodeWithSelector( - EigenPodManager.initialize.selector, - eigenLayerReputedMultisig, - eigenLayerPauserReg, - 0/*initialPausedStatus*/ - ) - ); - - // cheat a bunch of ETH to this address - cheats.deal(address(this), 1e20); - // deposit a huge amount of ETH to get ample stETH - { - (bool success, bytes memory returnData) = address(underlyingToken).call{value: 1e20}(""); - require(success, "depositing stETH failed"); - returnData; - } - - // deploy StrategyBase contract implementation, then create upgradeable proxy that points to implementation and initialize it - baseStrategyImplementation = new StrategyBase(strategyManager); - IStrategy stethStrategy = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector(StrategyBase.initialize.selector, underlyingToken, eigenLayerPauserReg) - ) - ) - ); - - // REMAINDER OF CODE ADAPTED FROM `_testDepositToStrategy` - // _testDepositToStrategy(sender, amountToDeposit, underlyingToken, stethStrategy); - - // whitelist the strategy for deposit, in case it wasn't before - { - cheats.startPrank(strategyManager.strategyWhitelister()); - IStrategy[] memory _strategy = new IStrategy[](1); - bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); - _strategy[0] = stethStrategy; - strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); - cheats.stopPrank(); - } - - uint256 operatorSharesBefore = strategyManager.stakerStrategyShares(address(this), stethStrategy); - // check the expected output - uint256 expectedSharesOut = stethStrategy.underlyingToShares(amountToDeposit); - - underlyingToken.transfer(address(this), amountToDeposit); - cheats.startPrank(address(this)); - underlyingToken.approve(address(strategyManager), type(uint256).max); - strategyManager.depositIntoStrategy(stethStrategy, underlyingToken, amountToDeposit); - - //check if depositor has never used this strat, that it is added correctly to stakerStrategyList array. - if (operatorSharesBefore == 0) { - // check that strategy is appropriately added to dynamic array of all of sender's strategies - assertTrue( - strategyManager.stakerStrategyList(address(this), strategyManager.stakerStrategyListLength(address(this)) - 1) - == stethStrategy, - "_testDepositToStrategy: stakerStrategyList array updated incorrectly" - ); - } +// // check that the shares out match the expected amount out +// // the actual transfer in will be lower by 1 wei than expected due to stETH's internal rounding +// // to account for this we check approximate rather than strict equivalence here +// { +// uint256 actualSharesOut = strategyManager.stakerStrategyShares(sender, oneWeiFeeOnTransferTokenStrategy) - operatorSharesBefore; +// require((actualSharesOut * 1000) / expectedSharesOut > 998, "too few shares"); +// require((actualSharesOut * 1000) / expectedSharesOut < 1002, "too many shares"); + +// // additional sanity check for deposit not increasing in value +// require(oneWeiFeeOnTransferTokenStrategy.sharesToUnderlying(actualSharesOut) <= amountToDeposit, "value cannot have increased"); +// } +// cheats.stopPrank(); +// } + +// /// @notice Shadow-forks mainnet and tests depositing stETH tokens into a "StrategyBase" contract. +// function testForkMainnetDepositSteth() public { +// // hard-coded inputs +// // address sender = address(this); +// uint64 amountToDeposit = 1e12; + +// // shadow-fork mainnet +// try cheats.createFork("mainnet") returns (uint256 forkId) { +// cheats.selectFork(forkId); +// // If RPC_MAINNET ENV not set, default to this mainnet RPC endpoint +// } catch { +// cheats.createSelectFork("https://eth.llamarpc.com"); +// } + +// // cast mainnet stETH address to IERC20 interface +// // IERC20 steth = IERC20(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); +// IERC20 underlyingToken = IERC20(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); + +// // deploy necessary contracts on the shadow-forked network +// // deploy proxy admin for ability to upgrade proxy contracts +// eigenLayerProxyAdmin = new ProxyAdmin(); +// //deploy pauser registry +// address[] memory pausers = new address[](1); +// pausers[0] = pauser; +// 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(); +// delegation = DelegationManager( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// strategyManager = StrategyManager( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// slasher = Slasher( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// eigenPodManager = EigenPodManager( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); + +// ethPOSDeposit = new ETHPOSDepositMock(); +// pod = new EigenPod(ethPOSDeposit, eigenPodManager, GOERLI_GENESIS_TIME); + +// eigenPodBeacon = new UpgradeableBeacon(address(pod)); + +// // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs +// DelegationManager delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); +// StrategyManager strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher); +// Slasher slasherImplementation = new Slasher(strategyManager, delegation); +// EigenPodManager eigenPodManagerImplementation = new EigenPodManager(ethPOSDeposit, eigenPodBeacon, strategyManager, slasher, delegation); +// // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(delegation))), +// address(delegationImplementation), +// abi.encodeWithSelector( +// DelegationManager.initialize.selector, +// eigenLayerReputedMultisig, +// eigenLayerPauserReg, +// 0 /*initialPausedStatus*/, +// minWithdrawalDelayBlocks, +// initializeStrategiesToSetDelayBlocks, +// initializeWithdrawalDelayBlocks +// ) +// ); +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(strategyManager))), +// address(strategyManagerImplementation), +// abi.encodeWithSelector( +// StrategyManager.initialize.selector, +// eigenLayerReputedMultisig, +// eigenLayerReputedMultisig, +// eigenLayerPauserReg, +// 0/*initialPausedStatus*/ +// ) +// ); +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(slasher))), +// address(slasherImplementation), +// abi.encodeWithSelector( +// Slasher.initialize.selector, +// eigenLayerReputedMultisig, +// eigenLayerPauserReg, +// 0/*initialPausedStatus*/ +// ) +// ); +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(eigenPodManager))), +// address(eigenPodManagerImplementation), +// abi.encodeWithSelector( +// EigenPodManager.initialize.selector, +// eigenLayerReputedMultisig, +// eigenLayerPauserReg, +// 0/*initialPausedStatus*/ +// ) +// ); + +// // cheat a bunch of ETH to this address +// cheats.deal(address(this), 1e20); +// // deposit a huge amount of ETH to get ample stETH +// { +// (bool success, bytes memory returnData) = address(underlyingToken).call{value: 1e20}(""); +// require(success, "depositing stETH failed"); +// returnData; +// } + +// // deploy StrategyBase contract implementation, then create upgradeable proxy that points to implementation and initialize it +// baseStrategyImplementation = new StrategyBase(strategyManager); +// IStrategy stethStrategy = StrategyBase( +// address( +// new TransparentUpgradeableProxy( +// address(baseStrategyImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector(StrategyBase.initialize.selector, underlyingToken, eigenLayerPauserReg) +// ) +// ) +// ); + +// // REMAINDER OF CODE ADAPTED FROM `_testDepositToStrategy` +// // _testDepositToStrategy(sender, amountToDeposit, underlyingToken, stethStrategy); + +// // whitelist the strategy for deposit, in case it wasn't before +// { +// cheats.startPrank(strategyManager.strategyWhitelister()); +// IStrategy[] memory _strategy = new IStrategy[](1); +// bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); +// _strategy[0] = stethStrategy; +// strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); +// cheats.stopPrank(); +// } + +// uint256 operatorSharesBefore = strategyManager.stakerStrategyShares(address(this), stethStrategy); +// // check the expected output +// uint256 expectedSharesOut = stethStrategy.underlyingToShares(amountToDeposit); + +// underlyingToken.transfer(address(this), amountToDeposit); +// cheats.startPrank(address(this)); +// underlyingToken.approve(address(strategyManager), type(uint256).max); +// strategyManager.depositIntoStrategy(stethStrategy, underlyingToken, amountToDeposit); + +// //check if depositor has never used this strat, that it is added correctly to stakerStrategyList array. +// if (operatorSharesBefore == 0) { +// // check that strategy is appropriately added to dynamic array of all of sender's strategies +// assertTrue( +// strategyManager.stakerStrategyList(address(this), strategyManager.stakerStrategyListLength(address(this)) - 1) +// == stethStrategy, +// "_testDepositToStrategy: stakerStrategyList array updated incorrectly" +// ); +// } - // check that the shares out match the expected amount out - // the actual transfer in will be lower by 1-2 wei than expected due to stETH's internal rounding - // to account for this we check approximate rather than strict equivalence here - { - uint256 actualSharesOut = strategyManager.stakerStrategyShares(address(this), stethStrategy) - operatorSharesBefore; - require(actualSharesOut >= expectedSharesOut, "too few shares"); - require((actualSharesOut * 1000) / expectedSharesOut < 1003, "too many shares"); - - // additional sanity check for deposit not increasing in value - require(stethStrategy.sharesToUnderlying(actualSharesOut) <= amountToDeposit, "value cannot have increased"); - // slippage check - require((stethStrategy.sharesToUnderlying(actualSharesOut) * 1e6) / amountToDeposit >= (1e6 - 1), "bad slippage on first deposit"); - } - cheats.stopPrank(); - } - - function _whitelistStrategy(StrategyManager _strategyManager, StrategyBase _strategyBase) internal returns(StrategyManager) { - // whitelist the strategy for deposit - cheats.startPrank(strategyManager.strategyWhitelister()); - IStrategy[] memory _strategy = new IStrategy[](1); - bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); - _strategy[0] = IStrategy(_strategyBase); - _strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); - cheats.stopPrank(); - - return _strategyManager; - } -} +// // check that the shares out match the expected amount out +// // the actual transfer in will be lower by 1-2 wei than expected due to stETH's internal rounding +// // to account for this we check approximate rather than strict equivalence here +// { +// uint256 actualSharesOut = strategyManager.stakerStrategyShares(address(this), stethStrategy) - operatorSharesBefore; +// require(actualSharesOut >= expectedSharesOut, "too few shares"); +// require((actualSharesOut * 1000) / expectedSharesOut < 1003, "too many shares"); + +// // additional sanity check for deposit not increasing in value +// require(stethStrategy.sharesToUnderlying(actualSharesOut) <= amountToDeposit, "value cannot have increased"); +// // slippage check +// require((stethStrategy.sharesToUnderlying(actualSharesOut) * 1e6) / amountToDeposit >= (1e6 - 1), "bad slippage on first deposit"); +// } +// cheats.stopPrank(); +// } + +// function _whitelistStrategy(StrategyManager _strategyManager, StrategyBase _strategyBase) internal returns(StrategyManager) { +// // whitelist the strategy for deposit +// cheats.startPrank(strategyManager.strategyWhitelister()); +// IStrategy[] memory _strategy = new IStrategy[](1); +// bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); +// _strategy[0] = IStrategy(_strategyBase); +// _strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); +// cheats.stopPrank(); + +// return _strategyManager; +// } +// } \ No newline at end of file diff --git a/src/test/EigenLayerDeployer.t.sol b/src/test/EigenLayerDeployer.t.sol index 0f4888fc5..f5bea85ad 100644 --- a/src/test/EigenLayerDeployer.t.sol +++ b/src/test/EigenLayerDeployer.t.sol @@ -1,272 +1,279 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.12; -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/IBeacon.sol"; -import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; - -import "../contracts/interfaces/IDelegationManager.sol"; -import "../contracts/core/DelegationManager.sol"; - -import "../contracts/interfaces/IETHPOSDeposit.sol"; - -import "../contracts/core/StrategyManager.sol"; -import "../contracts/strategies/StrategyBase.sol"; -import "../contracts/core/Slasher.sol"; - -import "../contracts/pods/EigenPod.sol"; -import "../contracts/pods/EigenPodManager.sol"; - -import "../contracts/permissions/PauserRegistry.sol"; - -import "./utils/Operators.sol"; - -import "./mocks/LiquidStakingToken.sol"; -import "./mocks/EmptyContract.sol"; -import "./mocks/ETHDepositMock.sol"; - -import "forge-std/Test.sol"; - -contract EigenLayerDeployer is Operators { - Vm cheats = Vm(HEVM_ADDRESS); - - // EigenLayer contracts - ProxyAdmin public eigenLayerProxyAdmin; - PauserRegistry public eigenLayerPauserReg; - - Slasher public slasher; - DelegationManager public delegation; - StrategyManager public strategyManager; - EigenPodManager public eigenPodManager; - IEigenPod public pod; - IETHPOSDeposit public ethPOSDeposit; - IBeacon public eigenPodBeacon; - - // testing/mock contracts - IERC20 public eigenToken; - IERC20 public weth; - StrategyBase public wethStrat; - StrategyBase public eigenStrat; - StrategyBase public baseStrategyImplementation; - EmptyContract public emptyContract; - - mapping(uint256 => IStrategy) public strategies; - - //from testing seed phrase - bytes32 priv_key_0 = 0x1234567812345678123456781234567812345678123456781234567812345678; - bytes32 priv_key_1 = 0x1234567812345678123456781234567812345698123456781234567812348976; - - //strategy indexes for undelegation (see commitUndelegation function) - uint256[] public strategyIndexes; - address[2] public stakers; - address sample_registrant = cheats.addr(436364636); - - address[] public slashingContracts; - - uint256 wethInitialSupply = 10e50; - uint256 public constant eigenTotalSupply = 1000e18; - uint256 nonce = 69; - uint256 public gasLimit = 750000; - IStrategy[] public initializeStrategiesToSetDelayBlocks; - uint256[] public initializeWithdrawalDelayBlocks; - uint256 minWithdrawalDelayBlocks = 0; - uint32 PARTIAL_WITHDRAWAL_FRAUD_PROOF_PERIOD_BLOCKS = 7 days / 12 seconds; - uint256 REQUIRED_BALANCE_WEI = 32 ether; - uint64 MAX_PARTIAL_WTIHDRAWAL_AMOUNT_GWEI = 1 ether / 1e9; - uint64 GOERLI_GENESIS_TIME = 1616508000; - - address pauser; - address unpauser; - address theMultiSig = address(420); - address operator = address(0x4206904396bF2f8b173350ADdEc5007A52664293); //sk: e88d9d864d5d731226020c5d2f02b62a4ce2a4534a39c225d32d3db795f83319 - address acct_0 = cheats.addr(uint256(priv_key_0)); - address acct_1 = cheats.addr(uint256(priv_key_1)); - address _challenger = address(0x6966904396bF2f8b173350bCcec5007A52669873); - address public eigenLayerReputedMultisig = address(this); - - address eigenLayerProxyAdminAddress; - address eigenLayerPauserRegAddress; - address slasherAddress; - address delegationAddress; - address strategyManagerAddress; - address eigenPodManagerAddress; - address podAddress; - address eigenPodBeaconAddress; - address emptyContractAddress; - address operationsMultisig; - address executorMultisig; - - - // addresses excluded from fuzzing due to abnormal behavior. TODO: @Sidu28 define this better and give it a clearer name - mapping(address => bool) fuzzedAddressMapping; - - //ensures that a passed in address is not set to true in the fuzzedAddressMapping - modifier fuzzedAddress(address addr) virtual { - cheats.assume(fuzzedAddressMapping[addr] == false); - _; - } - - modifier cannotReinit() { - cheats.expectRevert(bytes("Initializable: contract is already initialized")); - _; - } - - //performs basic deployment before each test - function setUp() public virtual { - try vm.envUint("CHAIN_ID") returns (uint256 chainId) { - if (chainId == 31337) { - _deployEigenLayerContractsLocal(); - } - // If CHAIN_ID ENV is not set, assume local deployment on 31337 - } catch { - _deployEigenLayerContractsLocal(); - } - - fuzzedAddressMapping[address(0)] = true; - fuzzedAddressMapping[address(eigenLayerProxyAdmin)] = true; - fuzzedAddressMapping[address(strategyManager)] = true; - fuzzedAddressMapping[address(eigenPodManager)] = true; - fuzzedAddressMapping[address(delegation)] = true; - fuzzedAddressMapping[address(slasher)] = true; - } - - function _deployEigenLayerContractsLocal() internal { - pauser = address(69); - unpauser = address(489); - // deploy proxy admin for ability to upgrade proxy contracts - eigenLayerProxyAdmin = new ProxyAdmin(); - - //deploy pauser registry - address[] memory pausers = new address[](1); - pausers[0] = pauser; - 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(); - delegation = DelegationManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - strategyManager = StrategyManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - slasher = Slasher( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - eigenPodManager = EigenPodManager( - address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) - ); - ethPOSDeposit = new ETHPOSDepositMock(); - pod = new EigenPod( - ethPOSDeposit, - eigenPodManager, - GOERLI_GENESIS_TIME - ); - - eigenPodBeacon = new UpgradeableBeacon(address(pod)); - - // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs - DelegationManager delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - StrategyManager strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher); - Slasher slasherImplementation = new Slasher(strategyManager, delegation); - EigenPodManager eigenPodManagerImplementation = new EigenPodManager( - ethPOSDeposit, - eigenPodBeacon, - strategyManager, - slasher, - delegation - ); - - // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(delegation))), - address(delegationImplementation), - abi.encodeWithSelector( - DelegationManager.initialize.selector, - eigenLayerReputedMultisig, - eigenLayerPauserReg, - 0 /*initialPausedStatus*/, - minWithdrawalDelayBlocks, - initializeStrategiesToSetDelayBlocks, - initializeWithdrawalDelayBlocks - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(strategyManager))), - address(strategyManagerImplementation), - abi.encodeWithSelector( - StrategyManager.initialize.selector, - eigenLayerReputedMultisig, - eigenLayerReputedMultisig, - eigenLayerPauserReg, - 0 /*initialPausedStatus*/ - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(slasher))), - address(slasherImplementation), - abi.encodeWithSelector( - Slasher.initialize.selector, - eigenLayerReputedMultisig, - eigenLayerPauserReg, - 0 /*initialPausedStatus*/ - ) - ); - eigenLayerProxyAdmin.upgradeAndCall( - TransparentUpgradeableProxy(payable(address(eigenPodManager))), - address(eigenPodManagerImplementation), - abi.encodeWithSelector( - EigenPodManager.initialize.selector, - eigenLayerReputedMultisig, - eigenLayerPauserReg, - 0 /*initialPausedStatus*/ - ) - ); - - //simple ERC20 (**NOT** WETH-like!), used in a test strategy - weth = new ERC20PresetFixedSupply("weth", "WETH", wethInitialSupply, address(this)); - - // deploy StrategyBase contract implementation, then create upgradeable proxy that points to implementation and initialize it - baseStrategyImplementation = new StrategyBase(strategyManager); - wethStrat = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector(StrategyBase.initialize.selector, weth, eigenLayerPauserReg) - ) - ) - ); - - eigenToken = new ERC20PresetFixedSupply("eigen", "EIGEN", wethInitialSupply, address(this)); - - // deploy upgradeable proxy that points to StrategyBase implementation and initialize it - eigenStrat = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector(StrategyBase.initialize.selector, eigenToken, eigenLayerPauserReg) - ) - ) - ); - - stakers = [acct_0, acct_1]; - } - - function _setAddresses(string memory config) internal { - eigenLayerProxyAdminAddress = stdJson.readAddress(config, ".addresses.eigenLayerProxyAdmin"); - eigenLayerPauserRegAddress = stdJson.readAddress(config, ".addresses.eigenLayerPauserReg"); - delegationAddress = stdJson.readAddress(config, ".addresses.delegation"); - strategyManagerAddress = stdJson.readAddress(config, ".addresses.strategyManager"); - slasherAddress = stdJson.readAddress(config, ".addresses.slasher"); - eigenPodManagerAddress = stdJson.readAddress(config, ".addresses.eigenPodManager"); - emptyContractAddress = stdJson.readAddress(config, ".addresses.emptyContract"); - operationsMultisig = stdJson.readAddress(config, ".parameters.operationsMultisig"); - executorMultisig = stdJson.readAddress(config, ".parameters.executorMultisig"); - } -} +// 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/IBeacon.sol"; +// import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; + +// import "../contracts/interfaces/IDelegationManager.sol"; +// import "../contracts/core/DelegationManager.sol"; +// import "../contracts/core/AVSDirectory.sol"; + +// import "../contracts/interfaces/IETHPOSDeposit.sol"; + +// import "../contracts/core/StrategyManager.sol"; +// import "../contracts/strategies/StrategyBase.sol"; +// import "../contracts/core/Slasher.sol"; + +// import "../contracts/pods/EigenPod.sol"; +// import "../contracts/pods/EigenPodManager.sol"; + +// import "../contracts/permissions/PauserRegistry.sol"; + +// import "./utils/Operators.sol"; + +// import "./mocks/LiquidStakingToken.sol"; +// import "./mocks/EmptyContract.sol"; +// import "./mocks/ETHDepositMock.sol"; + +// import "forge-std/Test.sol"; + +// contract EigenLayerDeployer is Operators { +// Vm cheats = Vm(HEVM_ADDRESS); + +// // EigenLayer contracts +// ProxyAdmin public eigenLayerProxyAdmin; +// PauserRegistry public eigenLayerPauserReg; + +// AVSDirectory public avsDirectory; +// Slasher public slasher; +// DelegationManager public delegation; +// StrategyManager public strategyManager; +// EigenPodManager public eigenPodManager; +// IEigenPod public pod; +// IETHPOSDeposit public ethPOSDeposit; +// IBeacon public eigenPodBeacon; + +// // testing/mock contracts +// IERC20 public eigenToken; +// IERC20 public weth; +// StrategyBase public wethStrat; +// StrategyBase public eigenStrat; +// StrategyBase public baseStrategyImplementation; +// EmptyContract public emptyContract; + +// mapping(uint256 => IStrategy) public strategies; + +// //from testing seed phrase +// bytes32 priv_key_0 = 0x1234567812345678123456781234567812345678123456781234567812345678; +// bytes32 priv_key_1 = 0x1234567812345678123456781234567812345698123456781234567812348976; + +// //strategy indexes for undelegation (see commitUndelegation function) +// uint256[] public strategyIndexes; +// address[2] public stakers; +// address sample_registrant = cheats.addr(436364636); + +// address[] public slashingContracts; + +// uint256 wethInitialSupply = 10e50; +// uint256 public constant eigenTotalSupply = 1000e18; +// uint256 nonce = 69; +// uint256 public gasLimit = 750000; +// IStrategy[] public initializeStrategiesToSetDelayBlocks; +// uint256[] public initializeWithdrawalDelayBlocks; +// uint256 minWithdrawalDelayBlocks = 0; +// uint32 PARTIAL_WITHDRAWAL_FRAUD_PROOF_PERIOD_BLOCKS = 7 days / 12 seconds; +// uint256 REQUIRED_BALANCE_WEI = 32 ether; +// uint64 MAX_PARTIAL_WTIHDRAWAL_AMOUNT_GWEI = 1 ether / 1e9; +// uint64 GOERLI_GENESIS_TIME = 1616508000; + +// address pauser; +// address unpauser; +// address theMultiSig = address(420); +// address operator = address(0x4206904396bF2f8b173350ADdEc5007A52664293); //sk: e88d9d864d5d731226020c5d2f02b62a4ce2a4534a39c225d32d3db795f83319 +// address acct_0 = cheats.addr(uint256(priv_key_0)); +// address acct_1 = cheats.addr(uint256(priv_key_1)); +// address _challenger = address(0x6966904396bF2f8b173350bCcec5007A52669873); +// address public eigenLayerReputedMultisig = address(this); + +// address eigenLayerProxyAdminAddress; +// address eigenLayerPauserRegAddress; +// address slasherAddress; +// address delegationAddress; +// address strategyManagerAddress; +// address eigenPodManagerAddress; +// address podAddress; +// address eigenPodBeaconAddress; +// address emptyContractAddress; +// address operationsMultisig; +// address executorMultisig; + + +// // addresses excluded from fuzzing due to abnormal behavior. TODO: @Sidu28 define this better and give it a clearer name +// mapping(address => bool) fuzzedAddressMapping; + +// //ensures that a passed in address is not set to true in the fuzzedAddressMapping +// modifier fuzzedAddress(address addr) virtual { +// cheats.assume(fuzzedAddressMapping[addr] == false); +// _; +// } + +// modifier cannotReinit() { +// cheats.expectRevert(bytes("Initializable: contract is already initialized")); +// _; +// } + +// //performs basic deployment before each test +// function setUp() public virtual { +// try vm.envUint("CHAIN_ID") returns (uint256 chainId) { +// if (chainId == 31337) { +// _deployEigenLayerContractsLocal(); +// } +// // If CHAIN_ID ENV is not set, assume local deployment on 31337 +// } catch { +// _deployEigenLayerContractsLocal(); +// } + +// fuzzedAddressMapping[address(0)] = true; +// fuzzedAddressMapping[address(eigenLayerProxyAdmin)] = true; +// fuzzedAddressMapping[address(strategyManager)] = true; +// fuzzedAddressMapping[address(eigenPodManager)] = true; +// fuzzedAddressMapping[address(delegation)] = true; +// fuzzedAddressMapping[address(slasher)] = true; +// fuzzedAddressMapping[address(avsDirectory)] = true; +// } + +// function _deployEigenLayerContractsLocal() internal { +// pauser = address(69); +// unpauser = address(489); +// // deploy proxy admin for ability to upgrade proxy contracts +// eigenLayerProxyAdmin = new ProxyAdmin(); + +// //deploy pauser registry +// address[] memory pausers = new address[](1); +// pausers[0] = pauser; +// 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), "")) +// ); +// delegation = DelegationManager( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// strategyManager = StrategyManager( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// slasher = Slasher( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// eigenPodManager = EigenPodManager( +// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) +// ); +// ethPOSDeposit = new ETHPOSDepositMock(); +// pod = new EigenPod( +// ethPOSDeposit, +// eigenPodManager, +// GOERLI_GENESIS_TIME +// ); + +// eigenPodBeacon = new UpgradeableBeacon(address(pod)); + +// // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs +// AVSDirectory avsDirectoryImplementation = new AVSDirectory(delegation); +// DelegationManager delegationImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); +// StrategyManager strategyManagerImplementation = new StrategyManager(delegation, eigenPodManager, slasher, avsDirectory); +// Slasher slasherImplementation = new Slasher(strategyManager, delegation); +// EigenPodManager eigenPodManagerImplementation = new EigenPodManager( +// ethPOSDeposit, +// eigenPodBeacon, +// strategyManager, +// slasher, +// delegation +// ); + +// // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them. +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(delegation))), +// address(delegationImplementation), +// abi.encodeWithSelector( +// DelegationManager.initialize.selector, +// eigenLayerReputedMultisig, +// eigenLayerPauserReg, +// 0 /*initialPausedStatus*/, +// minWithdrawalDelayBlocks, +// initializeStrategiesToSetDelayBlocks, +// initializeWithdrawalDelayBlocks +// ) +// ); +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(strategyManager))), +// address(strategyManagerImplementation), +// abi.encodeWithSelector( +// StrategyManager.initialize.selector, +// eigenLayerReputedMultisig, +// eigenLayerReputedMultisig, +// eigenLayerPauserReg, +// 0 /*initialPausedStatus*/ +// ) +// ); +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(slasher))), +// address(slasherImplementation), +// abi.encodeWithSelector( +// Slasher.initialize.selector, +// eigenLayerReputedMultisig, +// eigenLayerPauserReg, +// 0 /*initialPausedStatus*/ +// ) +// ); +// eigenLayerProxyAdmin.upgradeAndCall( +// TransparentUpgradeableProxy(payable(address(eigenPodManager))), +// address(eigenPodManagerImplementation), +// abi.encodeWithSelector( +// EigenPodManager.initialize.selector, +// eigenLayerReputedMultisig, +// eigenLayerPauserReg, +// 0 /*initialPausedStatus*/ +// ) +// ); + +// //simple ERC20 (**NOT** WETH-like!), used in a test strategy +// weth = new ERC20PresetFixedSupply("weth", "WETH", wethInitialSupply, address(this)); + +// // deploy StrategyBase contract implementation, then create upgradeable proxy that points to implementation and initialize it +// baseStrategyImplementation = new StrategyBase(strategyManager); +// wethStrat = StrategyBase( +// address( +// new TransparentUpgradeableProxy( +// address(baseStrategyImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector(StrategyBase.initialize.selector, weth, eigenLayerPauserReg) +// ) +// ) +// ); + +// eigenToken = new ERC20PresetFixedSupply("eigen", "EIGEN", wethInitialSupply, address(this)); + +// // deploy upgradeable proxy that points to StrategyBase implementation and initialize it +// eigenStrat = StrategyBase( +// address( +// new TransparentUpgradeableProxy( +// address(baseStrategyImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector(StrategyBase.initialize.selector, eigenToken, eigenLayerPauserReg) +// ) +// ) +// ); + +// stakers = [acct_0, acct_1]; +// } + +// function _setAddresses(string memory config) internal { +// eigenLayerProxyAdminAddress = stdJson.readAddress(config, ".addresses.eigenLayerProxyAdmin"); +// eigenLayerPauserRegAddress = stdJson.readAddress(config, ".addresses.eigenLayerPauserReg"); +// delegationAddress = stdJson.readAddress(config, ".addresses.delegation"); +// strategyManagerAddress = stdJson.readAddress(config, ".addresses.strategyManager"); +// slasherAddress = stdJson.readAddress(config, ".addresses.slasher"); +// eigenPodManagerAddress = stdJson.readAddress(config, ".addresses.eigenPodManager"); +// emptyContractAddress = stdJson.readAddress(config, ".addresses.emptyContract"); +// operationsMultisig = stdJson.readAddress(config, ".parameters.operationsMultisig"); +// executorMultisig = stdJson.readAddress(config, ".parameters.executorMultisig"); +// } +// } \ No newline at end of file diff --git a/src/test/EigenLayerTestHelper.t.sol b/src/test/EigenLayerTestHelper.t.sol index 62508d5d8..dc4632e49 100644 --- a/src/test/EigenLayerTestHelper.t.sol +++ b/src/test/EigenLayerTestHelper.t.sol @@ -1,505 +1,505 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.12; -import "../test/EigenLayerDeployer.t.sol"; -import "../contracts/interfaces/ISignatureUtils.sol"; - -contract EigenLayerTestHelper is EigenLayerDeployer { - uint8 durationToInit = 2; - uint256 public SECP256K1N_MODULUS = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141; - uint256 public SECP256K1N_MODULUS_HALF = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0; - - uint256[] sharesBefore; - uint256[] balanceBefore; - uint256[] priorTotalShares; - uint256[] strategyTokenBalance; - - /** - * @notice Helper function to test `initiateDelegation` functionality. Handles registering as an operator, depositing tokens - * into both Weth and Eigen strategies, as well as delegating assets from "stakers" to the operator. - * @param operatorIndex is the index of the operator to use from the test-data/operators.json file - * @param amountEigenToDeposit amount of eigen token to deposit - * @param amountEthToDeposit amount of eth to deposit - */ - - function _testInitiateDelegation( - uint8 operatorIndex, - uint256 amountEigenToDeposit, - uint256 amountEthToDeposit - ) public returns (uint256 amountEthStaked, uint256 amountEigenStaked) { - address operator = getOperatorAddress(operatorIndex); - - //setting up operator's delegation terms - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: operator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _testRegisterAsOperator(operator, operatorDetails); - - for (uint256 i; i < stakers.length; i++) { - //initialize weth, eigen and eth balances for staker - eigenToken.transfer(stakers[i], amountEigenToDeposit); - weth.transfer(stakers[i], amountEthToDeposit); - - //deposit staker's eigen and weth into strategy manager - _testDepositEigen(stakers[i], amountEigenToDeposit); - _testDepositWeth(stakers[i], amountEthToDeposit); - - //delegate the staker's deposits to operator - uint256 operatorEigenSharesBefore = delegation.operatorShares(operator, eigenStrat); - uint256 operatorWETHSharesBefore = delegation.operatorShares(operator, wethStrat); - _testDelegateToOperator(stakers[i], operator); - //verify that `increaseOperatorShares` worked - assertTrue( - delegation.operatorShares(operator, eigenStrat) - operatorEigenSharesBefore == amountEigenToDeposit - ); - assertTrue(delegation.operatorShares(operator, wethStrat) - operatorWETHSharesBefore == amountEthToDeposit); - } - amountEthStaked += delegation.operatorShares(operator, wethStrat); - amountEigenStaked += delegation.operatorShares(operator, eigenStrat); - - return (amountEthStaked, amountEigenStaked); - } - - /** - * @notice Register 'sender' as an operator, setting their 'OperatorDetails' in DelegationManager to 'operatorDetails', verifies - * that the storage of DelegationManager contract is updated appropriately - * - * @param sender is the address being registered as an operator - * @param operatorDetails is the `sender`'s OperatorDetails struct - */ - function _testRegisterAsOperator( - address sender, - IDelegationManager.OperatorDetails memory operatorDetails - ) internal { - cheats.startPrank(sender); - string memory emptyStringForMetadataURI; - delegation.registerAsOperator(operatorDetails, emptyStringForMetadataURI); - assertTrue(delegation.isOperator(sender), "testRegisterAsOperator: sender is not a operator"); - - assertTrue( - keccak256(abi.encode(delegation.operatorDetails(sender))) == keccak256(abi.encode(operatorDetails)), - "_testRegisterAsOperator: operatorDetails not set appropriately" - ); - - assertTrue(delegation.isDelegated(sender), "_testRegisterAsOperator: sender not marked as actively delegated"); - cheats.stopPrank(); - } - - /** - * @notice Deposits `amountToDeposit` of WETH from address `sender` into `wethStrat`. - * @param sender The address to spoof calls from using `cheats.startPrank(sender)` - * @param amountToDeposit Amount of WETH that is first *transferred from this contract to `sender`* and then deposited by `sender` into `stratToDepositTo` - */ - function _testDepositWeth(address sender, uint256 amountToDeposit) internal returns (uint256 amountDeposited) { - cheats.assume(amountToDeposit <= wethInitialSupply); - amountDeposited = _testDepositToStrategy(sender, amountToDeposit, weth, wethStrat); - } - - /** - * @notice Deposits `amountToDeposit` of EIGEN from address `sender` into `eigenStrat`. - * @param sender The address to spoof calls from using `cheats.startPrank(sender)` - * @param amountToDeposit Amount of EIGEN that is first *transferred from this contract to `sender`* and then deposited by `sender` into `stratToDepositTo` - */ - function _testDepositEigen(address sender, uint256 amountToDeposit) internal returns (uint256 amountDeposited) { - cheats.assume(amountToDeposit <= eigenTotalSupply); - amountDeposited = _testDepositToStrategy(sender, amountToDeposit, eigenToken, eigenStrat); - } - - /** - * @notice Deposits `amountToDeposit` of `underlyingToken` from address `sender` into `stratToDepositTo`. - * *If* `sender` has zero shares prior to deposit, *then* checks that `stratToDepositTo` is correctly added to their `stakerStrategyList` array. - * - * @param sender The address to spoof calls from using `cheats.startPrank(sender)` - * @param amountToDeposit Amount of WETH that is first *transferred from this contract to `sender`* and then deposited by `sender` into `stratToDepositTo` - */ - function _testDepositToStrategy( - address sender, - uint256 amountToDeposit, - IERC20 underlyingToken, - IStrategy stratToDepositTo - ) internal returns (uint256 amountDeposited) { - // deposits will revert when amountToDeposit is 0 - cheats.assume(amountToDeposit > 0); - - // whitelist the strategy for deposit, in case it wasn't before - { - cheats.startPrank(strategyManager.strategyWhitelister()); - IStrategy[] memory _strategy = new IStrategy[](1); - bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); - _strategy[0] = stratToDepositTo; - strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); - cheats.stopPrank(); - } - - uint256 operatorSharesBefore = strategyManager.stakerStrategyShares(sender, stratToDepositTo); - // assumes this contract already has the underlying token! - uint256 contractBalance = underlyingToken.balanceOf(address(this)); - // check the expected output - uint256 expectedSharesOut = stratToDepositTo.underlyingToShares(amountToDeposit); - // logging and error for misusing this function (see assumption above) - if (amountToDeposit > contractBalance) { - emit log("amountToDeposit > contractBalance"); - emit log_named_uint("amountToDeposit is", amountToDeposit); - emit log_named_uint("while contractBalance is", contractBalance); - revert("_testDepositToStrategy failure"); - } else { - underlyingToken.transfer(sender, amountToDeposit); - cheats.startPrank(sender); - underlyingToken.approve(address(strategyManager), type(uint256).max); - strategyManager.depositIntoStrategy(stratToDepositTo, underlyingToken, amountToDeposit); - amountDeposited = amountToDeposit; - - //check if depositor has never used this strat, that it is added correctly to stakerStrategyList array. - if (operatorSharesBefore == 0) { - // check that strategy is appropriately added to dynamic array of all of sender's strategies - assertTrue( - strategyManager.stakerStrategyList(sender, strategyManager.stakerStrategyListLength(sender) - 1) == - stratToDepositTo, - "_testDepositToStrategy: stakerStrategyList array updated incorrectly" - ); - } - - // check that the shares out match the expected amount out - assertEq( - strategyManager.stakerStrategyShares(sender, stratToDepositTo) - operatorSharesBefore, - expectedSharesOut, - "_testDepositToStrategy: actual shares out should match expected shares out" - ); - } - cheats.stopPrank(); - } - - /** - * @notice tries to delegate from 'staker' to 'operator', verifies that staker has at least some shares - * delegatedShares update correctly for 'operator' and delegated status is updated correctly for 'staker' - * @param staker the staker address to delegate from - * @param operator the operator address to delegate to - */ - function _testDelegateToOperator(address staker, address operator) internal { - //staker-specific information - (IStrategy[] memory delegateStrategies, uint256[] memory delegateShares) = strategyManager.getDeposits(staker); - - uint256 numStrats = delegateShares.length; - assertTrue(numStrats != 0, "_testDelegateToOperator: delegating from address with no deposits"); - uint256[] memory inititalSharesInStrats = new uint256[](numStrats); - for (uint256 i = 0; i < numStrats; ++i) { - inititalSharesInStrats[i] = delegation.operatorShares(operator, delegateStrategies[i]); - } - - cheats.startPrank(staker); - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; - delegation.delegateTo(operator, signatureWithExpiry, bytes32(0)); - cheats.stopPrank(); - - assertTrue( - delegation.delegatedTo(staker) == operator, - "_testDelegateToOperator: delegated address not set appropriately" - ); - assertTrue(delegation.isDelegated(staker), "_testDelegateToOperator: delegated status not set appropriately"); - - for (uint256 i = 0; i < numStrats; ++i) { - uint256 operatorSharesBefore = inititalSharesInStrats[i]; - uint256 operatorSharesAfter = delegation.operatorShares(operator, delegateStrategies[i]); - assertTrue( - operatorSharesAfter == (operatorSharesBefore + delegateShares[i]), - "_testDelegateToOperator: delegatedShares not increased correctly" - ); - } - } - - /** - * @notice deploys 'numStratsToAdd' strategies contracts and initializes them to treat `underlyingToken` as their underlying token - * and then deposits 'amountToDeposit' to each of them from 'sender' - * - * @param sender address that is depositing into the strategies - * @param amountToDeposit amount being deposited - * @param numStratsToAdd number of strategies that are being deployed and deposited into - */ - function _testDepositStrategies(address sender, uint256 amountToDeposit, uint8 numStratsToAdd) internal { - // hard-coded input - IERC20 underlyingToken = weth; - - cheats.assume(numStratsToAdd > 0 && numStratsToAdd <= 20); - IStrategy[] memory stratsToDepositTo = new IStrategy[](numStratsToAdd); - for (uint8 i = 0; i < numStratsToAdd; ++i) { - stratsToDepositTo[i] = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(baseStrategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector(StrategyBase.initialize.selector, underlyingToken, eigenLayerPauserReg) - ) - ) - ); - _testDepositToStrategy(sender, amountToDeposit, weth, StrategyBase(address(stratsToDepositTo[i]))); - } - for (uint8 i = 0; i < numStratsToAdd; ++i) { - // check that strategy is appropriately added to dynamic array of all of sender's strategies - assertTrue( - strategyManager.stakerStrategyList(sender, i) == stratsToDepositTo[i], - "stakerStrategyList array updated incorrectly" - ); - - // TODO: perhaps remove this is we can. seems brittle if we don't track the number of strategies somewhere - //store strategy in mapping of strategies - strategies[i] = IStrategy(address(stratsToDepositTo[i])); - } - } - - /** - * @notice Creates a queued withdrawal from `staker`. Begins by registering the staker as a delegate (if specified), then deposits `amountToDeposit` - * into the WETH strategy, and then queues a withdrawal using - * `strategyManager.queueWithdrawal(strategyIndexes, strategyArray, tokensArray, shareAmounts, withdrawer)` - * @notice After initiating a queued withdrawal, this test checks that `strategyManager.canCompleteQueuedWithdrawal` immediately returns the correct - * response depending on whether `staker` is delegated or not. - * @param staker The address to initiate the queued withdrawal - * @param registerAsOperator If true, `staker` will also register as a delegate in the course of this function - * @param amountToDeposit The amount of WETH to deposit - */ - function _createQueuedWithdrawal( - address staker, - bool registerAsOperator, - uint256 amountToDeposit, - IStrategy[] memory strategyArray, - uint256[] memory shareAmounts, - uint256[] memory strategyIndexes, - address withdrawer - ) internal returns (bytes32 withdrawalRoot, IDelegationManager.Withdrawal memory queuedWithdrawal) { - require(amountToDeposit >= shareAmounts[0], "_createQueuedWithdrawal: sanity check failed"); - - // we do this here to ensure that `staker` is delegated if `registerAsOperator` is true - if (registerAsOperator) { - assertTrue(!delegation.isDelegated(staker), "_createQueuedWithdrawal: staker is already delegated"); - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: staker, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _testRegisterAsOperator(staker, operatorDetails); - assertTrue( - delegation.isDelegated(staker), - "_createQueuedWithdrawal: staker isn't delegated when they should be" - ); - } - - queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: staker, - withdrawer: withdrawer, - nonce: delegation.cumulativeWithdrawalsQueued(staker), - delegatedTo: delegation.delegatedTo(staker), - startBlock: uint32(block.number) - }); - - { - //make deposit in WETH strategy - uint256 amountDeposited = _testDepositWeth(staker, amountToDeposit); - // We can't withdraw more than we deposit - if (shareAmounts[0] > amountDeposited) { - cheats.expectRevert("StrategyManager._removeShares: shareAmount too high"); - } - } - - //queue the withdrawal - withdrawalRoot = _testQueueWithdrawal(staker, strategyIndexes, strategyArray, shareAmounts, withdrawer); - return (withdrawalRoot, queuedWithdrawal); - } - - /** - * Helper for ECDSA signatures: combines V and S into VS - if S is greater than SECP256K1N_MODULUS_HALF, then we - * get the modulus, so that the leading bit of s is always 0. Then we set the leading - * bit to be either 0 or 1 based on the value of v, which is either 27 or 28 - */ - function getVSfromVandS(uint8 v, bytes32 s) internal view returns (bytes32) { - if (uint256(s) > SECP256K1N_MODULUS_HALF) { - s = bytes32(SECP256K1N_MODULUS - uint256(s)); - } - - bytes32 vs = s; - if (v == 28) { - vs = bytes32(uint256(s) ^ (1 << 255)); - } - - return vs; - } - - /// @notice registers a fixed address as an operator, delegates to it from a second address, - /// and checks that the operator's voteWeights increase properly - /// @param operator is the operator being delegated to. - /// @param staker is the staker delegating stake to the operator. - /// @param ethAmount is the amount of ETH to deposit into the operator's strategy. - /// @param eigenAmount is the amount of EIGEN to deposit into the operator's strategy. - function _testDelegation( - address operator, - address staker, - uint256 ethAmount, - uint256 eigenAmount - ) internal { - if (!delegation.isOperator(operator)) { - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: operator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _testRegisterAsOperator(operator, operatorDetails); - } - - uint256 amountBefore = delegation.operatorShares(operator, wethStrat); - - //making additional deposits to the strategies - assertTrue(!delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); - _testDepositWeth(staker, ethAmount); - _testDepositEigen(staker, eigenAmount); - _testDelegateToOperator(staker, operator); - assertTrue(delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); - - (/*IStrategy[] memory updatedStrategies*/, uint256[] memory updatedShares) = strategyManager.getDeposits(staker); - - IStrategy _strat = wethStrat; - // IStrategy _strat = strategyManager.stakerStrategyList(staker, 0); - assertTrue(address(_strat) != address(0), "stakerStrategyList not updated correctly"); - - assertTrue( - delegation.operatorShares(operator, _strat) - updatedShares[0] == amountBefore, - "ETH operatorShares not updated correctly" - ); - } - - /** - * @notice Helper function to complete an existing queued withdrawal in shares - * @param depositor is the address of the staker who queued a withdrawal - * @param strategyArray is the array of strategies to withdraw from - * @param tokensArray is the array of tokens to withdraw from said strategies - * @param shareAmounts is the array of shares to be withdrawn from said strategies - * @param delegatedTo is the address the staker has delegated their shares to - * @param withdrawalStartBlock the block number of the original queued withdrawal - * @param middlewareTimesIndex index in the middlewareTimes array used to queue this withdrawal - */ - - function _testCompleteQueuedWithdrawalShares( - address depositor, - IStrategy[] memory strategyArray, - IERC20[] memory tokensArray, - uint256[] memory shareAmounts, - address delegatedTo, - address withdrawer, - uint256 nonce, - uint32 withdrawalStartBlock, - uint256 middlewareTimesIndex - ) internal { - cheats.startPrank(withdrawer); - - for (uint256 i = 0; i < strategyArray.length; i++) { - sharesBefore.push(strategyManager.stakerStrategyShares(withdrawer, strategyArray[i])); - } - // emit log_named_uint("strategies", strategyArray.length); - // emit log_named_uint("tokens", tokensArray.length); - // emit log_named_uint("shares", shareAmounts.length); - // emit log_named_address("depositor", depositor); - // emit log_named_uint("withdrawalStartBlock", withdrawalStartBlock); - // emit log_named_address("delegatedAddress", delegatedTo); - // emit log("************************************************************************************************"); - - IDelegationManager.Withdrawal memory queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: depositor, - withdrawer: withdrawer, - nonce: nonce, - startBlock: withdrawalStartBlock, - delegatedTo: delegatedTo - }); - - // complete the queued withdrawal - delegation.completeQueuedWithdrawal(queuedWithdrawal, tokensArray, middlewareTimesIndex, false); - - for (uint256 i = 0; i < strategyArray.length; i++) { - require( - strategyManager.stakerStrategyShares(withdrawer, strategyArray[i]) == sharesBefore[i] + shareAmounts[i], - "_testCompleteQueuedWithdrawalShares: withdrawer shares not incremented" - ); - } - cheats.stopPrank(); - } - - /** - * @notice Helper function to complete an existing queued withdrawal in tokens - * @param depositor is the address of the staker who queued a withdrawal - * @param strategyArray is the array of strategies to withdraw from - * @param tokensArray is the array of tokens to withdraw from said strategies - * @param shareAmounts is the array of shares to be withdrawn from said strategies - * @param delegatedTo is the address the staker has delegated their shares to - * @param withdrawalStartBlock the block number of the original queued withdrawal - * @param middlewareTimesIndex index in the middlewareTimes array used to queue this withdrawal - */ - function _testCompleteQueuedWithdrawalTokens( - address depositor, - IStrategy[] memory strategyArray, - IERC20[] memory tokensArray, - uint256[] memory shareAmounts, - address delegatedTo, - address withdrawer, - uint256 nonce, - uint32 withdrawalStartBlock, - uint256 middlewareTimesIndex - ) internal { - cheats.startPrank(withdrawer); - - for (uint256 i = 0; i < strategyArray.length; i++) { - balanceBefore.push(strategyArray[i].underlyingToken().balanceOf(withdrawer)); - priorTotalShares.push(strategyArray[i].totalShares()); - strategyTokenBalance.push(strategyArray[i].underlyingToken().balanceOf(address(strategyArray[i]))); - } - - IDelegationManager.Withdrawal memory queuedWithdrawal = IDelegationManager.Withdrawal({ - strategies: strategyArray, - shares: shareAmounts, - staker: depositor, - withdrawer: withdrawer, - nonce: nonce, - startBlock: withdrawalStartBlock, - delegatedTo: delegatedTo - }); - // complete the queued withdrawal - delegation.completeQueuedWithdrawal(queuedWithdrawal, tokensArray, middlewareTimesIndex, true); - - for (uint256 i = 0; i < strategyArray.length; i++) { - //uint256 strategyTokenBalance = strategyArray[i].underlyingToken().balanceOf(address(strategyArray[i])); - uint256 tokenBalanceDelta = (strategyTokenBalance[i] * shareAmounts[i]) / priorTotalShares[i]; - - // filter out unrealistic case, where the withdrawer is the strategy contract itself - cheats.assume(withdrawer != address(strategyArray[i])); - require( - strategyArray[i].underlyingToken().balanceOf(withdrawer) == balanceBefore[i] + tokenBalanceDelta, - "_testCompleteQueuedWithdrawalTokens: withdrawer balance not incremented" - ); - } - cheats.stopPrank(); - } - - function _testQueueWithdrawal( - address depositor, - uint256[] memory /*strategyIndexes*/, - IStrategy[] memory strategyArray, - uint256[] memory shareAmounts, - address withdrawer - ) internal returns (bytes32) { - cheats.startPrank(depositor); - - IDelegationManager.QueuedWithdrawalParams[] memory params = new IDelegationManager.QueuedWithdrawalParams[](1); - - params[0] = IDelegationManager.QueuedWithdrawalParams({ - strategies: strategyArray, - shares: shareAmounts, - withdrawer: withdrawer - }); - - bytes32[] memory withdrawalRoots = new bytes32[](1); - withdrawalRoots = delegation.queueWithdrawals(params); - cheats.stopPrank(); - return withdrawalRoots[0]; - } -} +// import "../test/EigenLayerDeployer.t.sol"; +// import "../contracts/interfaces/ISignatureUtils.sol"; + +// contract EigenLayerTestHelper is EigenLayerDeployer { +// uint8 durationToInit = 2; +// uint256 public SECP256K1N_MODULUS = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141; +// uint256 public SECP256K1N_MODULUS_HALF = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0; + +// uint256[] sharesBefore; +// uint256[] balanceBefore; +// uint256[] priorTotalShares; +// uint256[] strategyTokenBalance; + +// /** +// * @notice Helper function to test `initiateDelegation` functionality. Handles registering as an operator, depositing tokens +// * into both Weth and Eigen strategies, as well as delegating assets from "stakers" to the operator. +// * @param operatorIndex is the index of the operator to use from the test-data/operators.json file +// * @param amountEigenToDeposit amount of eigen token to deposit +// * @param amountEthToDeposit amount of eth to deposit +// */ + +// function _testInitiateDelegation( +// uint8 operatorIndex, +// uint256 amountEigenToDeposit, +// uint256 amountEthToDeposit +// ) public returns (uint256 amountEthStaked, uint256 amountEigenStaked) { +// address operator = getOperatorAddress(operatorIndex); + +// //setting up operator's delegation terms +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: operator, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// _testRegisterAsOperator(operator, operatorDetails); + +// for (uint256 i; i < stakers.length; i++) { +// //initialize weth, eigen and eth balances for staker +// eigenToken.transfer(stakers[i], amountEigenToDeposit); +// weth.transfer(stakers[i], amountEthToDeposit); + +// //deposit staker's eigen and weth into strategy manager +// _testDepositEigen(stakers[i], amountEigenToDeposit); +// _testDepositWeth(stakers[i], amountEthToDeposit); + +// //delegate the staker's deposits to operator +// uint256 operatorEigenSharesBefore = delegation.operatorShares(operator, eigenStrat); +// uint256 operatorWETHSharesBefore = delegation.operatorShares(operator, wethStrat); +// _testDelegateToOperator(stakers[i], operator); +// //verify that `increaseOperatorShares` worked +// assertTrue( +// delegation.operatorShares(operator, eigenStrat) - operatorEigenSharesBefore == amountEigenToDeposit +// ); +// assertTrue(delegation.operatorShares(operator, wethStrat) - operatorWETHSharesBefore == amountEthToDeposit); +// } +// amountEthStaked += delegation.operatorShares(operator, wethStrat); +// amountEigenStaked += delegation.operatorShares(operator, eigenStrat); + +// return (amountEthStaked, amountEigenStaked); +// } + +// /** +// * @notice Register 'sender' as an operator, setting their 'OperatorDetails' in DelegationManager to 'operatorDetails', verifies +// * that the storage of DelegationManager contract is updated appropriately +// * +// * @param sender is the address being registered as an operator +// * @param operatorDetails is the `sender`'s OperatorDetails struct +// */ +// function _testRegisterAsOperator( +// address sender, +// IDelegationManager.OperatorDetails memory operatorDetails +// ) internal { +// cheats.startPrank(sender); +// string memory emptyStringForMetadataURI; +// delegation.registerAsOperator(operatorDetails, emptyStringForMetadataURI); +// assertTrue(delegation.isOperator(sender), "testRegisterAsOperator: sender is not a operator"); + +// assertTrue( +// keccak256(abi.encode(delegation.operatorDetails(sender))) == keccak256(abi.encode(operatorDetails)), +// "_testRegisterAsOperator: operatorDetails not set appropriately" +// ); + +// assertTrue(delegation.isDelegated(sender), "_testRegisterAsOperator: sender not marked as actively delegated"); +// cheats.stopPrank(); +// } + +// /** +// * @notice Deposits `amountToDeposit` of WETH from address `sender` into `wethStrat`. +// * @param sender The address to spoof calls from using `cheats.startPrank(sender)` +// * @param amountToDeposit Amount of WETH that is first *transferred from this contract to `sender`* and then deposited by `sender` into `stratToDepositTo` +// */ +// function _testDepositWeth(address sender, uint256 amountToDeposit) internal returns (uint256 amountDeposited) { +// cheats.assume(amountToDeposit <= wethInitialSupply); +// amountDeposited = _testDepositToStrategy(sender, amountToDeposit, weth, wethStrat); +// } + +// /** +// * @notice Deposits `amountToDeposit` of EIGEN from address `sender` into `eigenStrat`. +// * @param sender The address to spoof calls from using `cheats.startPrank(sender)` +// * @param amountToDeposit Amount of EIGEN that is first *transferred from this contract to `sender`* and then deposited by `sender` into `stratToDepositTo` +// */ +// function _testDepositEigen(address sender, uint256 amountToDeposit) internal returns (uint256 amountDeposited) { +// cheats.assume(amountToDeposit <= eigenTotalSupply); +// amountDeposited = _testDepositToStrategy(sender, amountToDeposit, eigenToken, eigenStrat); +// } + +// /** +// * @notice Deposits `amountToDeposit` of `underlyingToken` from address `sender` into `stratToDepositTo`. +// * *If* `sender` has zero shares prior to deposit, *then* checks that `stratToDepositTo` is correctly added to their `stakerStrategyList` array. +// * +// * @param sender The address to spoof calls from using `cheats.startPrank(sender)` +// * @param amountToDeposit Amount of WETH that is first *transferred from this contract to `sender`* and then deposited by `sender` into `stratToDepositTo` +// */ +// function _testDepositToStrategy( +// address sender, +// uint256 amountToDeposit, +// IERC20 underlyingToken, +// IStrategy stratToDepositTo +// ) internal returns (uint256 amountDeposited) { +// // deposits will revert when amountToDeposit is 0 +// cheats.assume(amountToDeposit > 0); + +// // whitelist the strategy for deposit, in case it wasn't before +// { +// cheats.startPrank(strategyManager.strategyWhitelister()); +// IStrategy[] memory _strategy = new IStrategy[](1); +// bool[] memory _thirdPartyTransfersForbiddenValues = new bool[](1); +// _strategy[0] = stratToDepositTo; +// strategyManager.addStrategiesToDepositWhitelist(_strategy, _thirdPartyTransfersForbiddenValues); +// cheats.stopPrank(); +// } + +// uint256 operatorSharesBefore = strategyManager.stakerStrategyScaledShares(sender, stratToDepositTo); +// // assumes this contract already has the underlying token! +// uint256 contractBalance = underlyingToken.balanceOf(address(this)); +// // check the expected output +// uint256 expectedSharesOut = stratToDepositTo.underlyingToShares(amountToDeposit); +// // logging and error for misusing this function (see assumption above) +// if (amountToDeposit > contractBalance) { +// emit log("amountToDeposit > contractBalance"); +// emit log_named_uint("amountToDeposit is", amountToDeposit); +// emit log_named_uint("while contractBalance is", contractBalance); +// revert("_testDepositToStrategy failure"); +// } else { +// underlyingToken.transfer(sender, amountToDeposit); +// cheats.startPrank(sender); +// underlyingToken.approve(address(strategyManager), type(uint256).max); +// strategyManager.depositIntoStrategy(stratToDepositTo, underlyingToken, amountToDeposit); +// amountDeposited = amountToDeposit; + +// //check if depositor has never used this strat, that it is added correctly to stakerStrategyList array. +// if (operatorSharesBefore == 0) { +// // check that strategy is appropriately added to dynamic array of all of sender's strategies +// assertTrue( +// strategyManager.stakerStrategyList(sender, strategyManager.stakerStrategyListLength(sender) - 1) == +// stratToDepositTo, +// "_testDepositToStrategy: stakerStrategyList array updated incorrectly" +// ); +// } + +// // check that the shares out match the expected amount out +// assertEq( +// strategyManager.stakerStrategyScaledShares(sender, stratToDepositTo) - operatorSharesBefore, +// expectedSharesOut, +// "_testDepositToStrategy: actual shares out should match expected shares out" +// ); +// } +// cheats.stopPrank(); +// } + +// /** +// * @notice tries to delegate from 'staker' to 'operator', verifies that staker has at least some shares +// * delegatedShares update correctly for 'operator' and delegated status is updated correctly for 'staker' +// * @param staker the staker address to delegate from +// * @param operator the operator address to delegate to +// */ +// function _testDelegateToOperator(address staker, address operator) internal { +// //staker-specific information +// (IStrategy[] memory delegateStrategies, uint256[] memory delegateShares) = strategyManager.getDeposits(staker); + +// uint256 numStrats = delegateShares.length; +// assertTrue(numStrats != 0, "_testDelegateToOperator: delegating from address with no deposits"); +// uint256[] memory inititalSharesInStrats = new uint256[](numStrats); +// for (uint256 i = 0; i < numStrats; ++i) { +// inititalSharesInStrats[i] = delegation.operatorShares(operator, delegateStrategies[i]); +// } + +// cheats.startPrank(staker); +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry; +// delegation.delegateTo(operator, signatureWithExpiry, bytes32(0)); +// cheats.stopPrank(); + +// assertTrue( +// delegation.delegatedTo(staker) == operator, +// "_testDelegateToOperator: delegated address not set appropriately" +// ); +// assertTrue(delegation.isDelegated(staker), "_testDelegateToOperator: delegated status not set appropriately"); + +// for (uint256 i = 0; i < numStrats; ++i) { +// uint256 operatorSharesBefore = inititalSharesInStrats[i]; +// uint256 operatorSharesAfter = delegation.operatorShares(operator, delegateStrategies[i]); +// assertTrue( +// operatorSharesAfter == (operatorSharesBefore + delegateShares[i]), +// "_testDelegateToOperator: delegatedShares not increased correctly" +// ); +// } +// } + +// /** +// * @notice deploys 'numStratsToAdd' strategies contracts and initializes them to treat `underlyingToken` as their underlying token +// * and then deposits 'amountToDeposit' to each of them from 'sender' +// * +// * @param sender address that is depositing into the strategies +// * @param amountToDeposit amount being deposited +// * @param numStratsToAdd number of strategies that are being deployed and deposited into +// */ +// function _testDepositStrategies(address sender, uint256 amountToDeposit, uint8 numStratsToAdd) internal { +// // hard-coded input +// IERC20 underlyingToken = weth; + +// cheats.assume(numStratsToAdd > 0 && numStratsToAdd <= 20); +// IStrategy[] memory stratsToDepositTo = new IStrategy[](numStratsToAdd); +// for (uint8 i = 0; i < numStratsToAdd; ++i) { +// stratsToDepositTo[i] = StrategyBase( +// address( +// new TransparentUpgradeableProxy( +// address(baseStrategyImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector(StrategyBase.initialize.selector, underlyingToken, eigenLayerPauserReg) +// ) +// ) +// ); +// _testDepositToStrategy(sender, amountToDeposit, weth, StrategyBase(address(stratsToDepositTo[i]))); +// } +// for (uint8 i = 0; i < numStratsToAdd; ++i) { +// // check that strategy is appropriately added to dynamic array of all of sender's strategies +// assertTrue( +// strategyManager.stakerStrategyList(sender, i) == stratsToDepositTo[i], +// "stakerStrategyList array updated incorrectly" +// ); + +// // TODO: perhaps remove this is we can. seems brittle if we don't track the number of strategies somewhere +// //store strategy in mapping of strategies +// strategies[i] = IStrategy(address(stratsToDepositTo[i])); +// } +// } + +// /** +// * @notice Creates a queued withdrawal from `staker`. Begins by registering the staker as a delegate (if specified), then deposits `amountToDeposit` +// * into the WETH strategy, and then queues a withdrawal using +// * `strategyManager.queueWithdrawal(strategyIndexes, strategyArray, tokensArray, shareAmounts, withdrawer)` +// * @notice After initiating a queued withdrawal, this test checks that `strategyManager.canCompleteQueuedWithdrawal` immediately returns the correct +// * response depending on whether `staker` is delegated or not. +// * @param staker The address to initiate the queued withdrawal +// * @param registerAsOperator If true, `staker` will also register as a delegate in the course of this function +// * @param amountToDeposit The amount of WETH to deposit +// */ +// function _createQueuedWithdrawal( +// address staker, +// bool registerAsOperator, +// uint256 amountToDeposit, +// IStrategy[] memory strategyArray, +// uint256[] memory shareAmounts, +// uint256[] memory strategyIndexes, +// address withdrawer +// ) internal returns (bytes32 withdrawalRoot, IDelegationManager.Withdrawal memory queuedWithdrawal) { +// require(amountToDeposit >= shareAmounts[0], "_createQueuedWithdrawal: sanity check failed"); + +// // we do this here to ensure that `staker` is delegated if `registerAsOperator` is true +// if (registerAsOperator) { +// assertTrue(!delegation.isDelegated(staker), "_createQueuedWithdrawal: staker is already delegated"); +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: staker, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// _testRegisterAsOperator(staker, operatorDetails); +// assertTrue( +// delegation.isDelegated(staker), +// "_createQueuedWithdrawal: staker isn't delegated when they should be" +// ); +// } + +// queuedWithdrawal = IDelegationManager.Withdrawal({ +// strategies: strategyArray, +// scaledShares: shareAmounts, +// staker: staker, +// withdrawer: withdrawer, +// nonce: delegation.cumulativeWithdrawalsQueued(staker), +// delegatedTo: delegation.delegatedTo(staker), +// startBlock: uint32(block.number) +// }); + +// { +// //make deposit in WETH strategy +// uint256 amountDeposited = _testDepositWeth(staker, amountToDeposit); +// // We can't withdraw more than we deposit +// if (shareAmounts[0] > amountDeposited) { +// cheats.expectRevert("StrategyManager._removeShares: shareAmount too high"); +// } +// } + +// //queue the withdrawal +// withdrawalRoot = _testQueueWithdrawal(staker, strategyIndexes, strategyArray, shareAmounts, withdrawer); +// return (withdrawalRoot, queuedWithdrawal); +// } + +// /** +// * Helper for ECDSA signatures: combines V and S into VS - if S is greater than SECP256K1N_MODULUS_HALF, then we +// * get the modulus, so that the leading bit of s is always 0. Then we set the leading +// * bit to be either 0 or 1 based on the value of v, which is either 27 or 28 +// */ +// function getVSfromVandS(uint8 v, bytes32 s) internal view returns (bytes32) { +// if (uint256(s) > SECP256K1N_MODULUS_HALF) { +// s = bytes32(SECP256K1N_MODULUS - uint256(s)); +// } + +// bytes32 vs = s; +// if (v == 28) { +// vs = bytes32(uint256(s) ^ (1 << 255)); +// } + +// return vs; +// } + +// /// @notice registers a fixed address as an operator, delegates to it from a second address, +// /// and checks that the operator's voteWeights increase properly +// /// @param operator is the operator being delegated to. +// /// @param staker is the staker delegating stake to the operator. +// /// @param ethAmount is the amount of ETH to deposit into the operator's strategy. +// /// @param eigenAmount is the amount of EIGEN to deposit into the operator's strategy. +// function _testDelegation( +// address operator, +// address staker, +// uint256 ethAmount, +// uint256 eigenAmount +// ) internal { +// if (!delegation.isOperator(operator)) { +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: operator, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// _testRegisterAsOperator(operator, operatorDetails); +// } + +// uint256 amountBefore = delegation.operatorShares(operator, wethStrat); + +// //making additional deposits to the strategies +// assertTrue(!delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); +// _testDepositWeth(staker, ethAmount); +// _testDepositEigen(staker, eigenAmount); +// _testDelegateToOperator(staker, operator); +// assertTrue(delegation.isDelegated(staker) == true, "testDelegation: staker is not delegate"); + +// (/*IStrategy[] memory updatedStrategies*/, uint256[] memory updatedShares) = strategyManager.getDeposits(staker); + +// IStrategy _strat = wethStrat; +// // IStrategy _strat = strategyManager.stakerStrategyList(staker, 0); +// assertTrue(address(_strat) != address(0), "stakerStrategyList not updated correctly"); + +// assertTrue( +// delegation.operatorShares(operator, _strat) - updatedShares[0] == amountBefore, +// "ETH operatorShares not updated correctly" +// ); +// } + +// /** +// * @notice Helper function to complete an existing queued withdrawal in shares +// * @param depositor is the address of the staker who queued a withdrawal +// * @param strategyArray is the array of strategies to withdraw from +// * @param tokensArray is the array of tokens to withdraw from said strategies +// * @param shareAmounts is the array of shares to be withdrawn from said strategies +// * @param delegatedTo is the address the staker has delegated their shares to +// * @param withdrawalStartBlock the block number of the original queued withdrawal +// * @param middlewareTimesIndex index in the middlewareTimes array used to queue this withdrawal +// */ + +// function _testCompleteQueuedWithdrawalShares( +// address depositor, +// IStrategy[] memory strategyArray, +// IERC20[] memory tokensArray, +// uint256[] memory shareAmounts, +// address delegatedTo, +// address withdrawer, +// uint256 nonce, +// uint32 withdrawalStartBlock, +// uint256 middlewareTimesIndex +// ) internal { +// cheats.startPrank(withdrawer); + +// for (uint256 i = 0; i < strategyArray.length; i++) { +// sharesBefore.push(strategyManager.stakerStrategyScaledShares(withdrawer, strategyArray[i])); +// } +// // emit log_named_uint("strategies", strategyArray.length); +// // emit log_named_uint("tokens", tokensArray.length); +// // emit log_named_uint("shares", shareAmounts.length); +// // emit log_named_address("depositor", depositor); +// // emit log_named_uint("withdrawalStartBlock", withdrawalStartBlock); +// // emit log_named_address("delegatedAddress", delegatedTo); +// // emit log("************************************************************************************************"); + +// IDelegationManager.Withdrawal memory queuedWithdrawal = IDelegationManager.Withdrawal({ +// strategies: strategyArray, +// scaledShares: shareAmounts, +// staker: depositor, +// withdrawer: withdrawer, +// nonce: nonce, +// startBlock: withdrawalStartBlock, +// delegatedTo: delegatedTo +// }); + +// // complete the queued withdrawal +// delegation.completeQueuedWithdrawal(queuedWithdrawal, tokensArray, middlewareTimesIndex, false); + +// for (uint256 i = 0; i < strategyArray.length; i++) { +// require( +// strategyManager.stakerStrategyScaledShares(withdrawer, strategyArray[i]) == sharesBefore[i] + shareAmounts[i], +// "_testCompleteQueuedWithdrawalShares: withdrawer shares not incremented" +// ); +// } +// cheats.stopPrank(); +// } + +// /** +// * @notice Helper function to complete an existing queued withdrawal in tokens +// * @param depositor is the address of the staker who queued a withdrawal +// * @param strategyArray is the array of strategies to withdraw from +// * @param tokensArray is the array of tokens to withdraw from said strategies +// * @param shareAmounts is the array of shares to be withdrawn from said strategies +// * @param delegatedTo is the address the staker has delegated their shares to +// * @param withdrawalStartBlock the block number of the original queued withdrawal +// * @param middlewareTimesIndex index in the middlewareTimes array used to queue this withdrawal +// */ +// function _testCompleteQueuedWithdrawalTokens( +// address depositor, +// IStrategy[] memory strategyArray, +// IERC20[] memory tokensArray, +// uint256[] memory shareAmounts, +// address delegatedTo, +// address withdrawer, +// uint256 nonce, +// uint32 withdrawalStartBlock, +// uint256 middlewareTimesIndex +// ) internal { +// cheats.startPrank(withdrawer); + +// for (uint256 i = 0; i < strategyArray.length; i++) { +// balanceBefore.push(strategyArray[i].underlyingToken().balanceOf(withdrawer)); +// priorTotalShares.push(strategyArray[i].totalShares()); +// strategyTokenBalance.push(strategyArray[i].underlyingToken().balanceOf(address(strategyArray[i]))); +// } + +// IDelegationManager.Withdrawal memory queuedWithdrawal = IDelegationManager.Withdrawal({ +// strategies: strategyArray, +// scaledShares: shareAmounts, +// staker: depositor, +// withdrawer: withdrawer, +// nonce: nonce, +// startBlock: withdrawalStartBlock, +// delegatedTo: delegatedTo +// }); +// // complete the queued withdrawal +// delegation.completeQueuedWithdrawal(queuedWithdrawal, tokensArray, middlewareTimesIndex, true); + +// for (uint256 i = 0; i < strategyArray.length; i++) { +// //uint256 strategyTokenBalance = strategyArray[i].underlyingToken().balanceOf(address(strategyArray[i])); +// uint256 tokenBalanceDelta = (strategyTokenBalance[i] * shareAmounts[i]) / priorTotalShares[i]; + +// // filter out unrealistic case, where the withdrawer is the strategy contract itself +// cheats.assume(withdrawer != address(strategyArray[i])); +// require( +// strategyArray[i].underlyingToken().balanceOf(withdrawer) == balanceBefore[i] + tokenBalanceDelta, +// "_testCompleteQueuedWithdrawalTokens: withdrawer balance not incremented" +// ); +// } +// cheats.stopPrank(); +// } + +// function _testQueueWithdrawal( +// address depositor, +// uint256[] memory /*strategyIndexes*/, +// IStrategy[] memory strategyArray, +// uint256[] memory shareAmounts, +// address withdrawer +// ) internal returns (bytes32) { +// cheats.startPrank(depositor); + +// IDelegationManager.QueuedWithdrawalParams[] memory params = new IDelegationManager.QueuedWithdrawalParams[](1); + +// params[0] = IDelegationManager.QueuedWithdrawalParams({ +// strategies: strategyArray, +// scaledShares: shareAmounts, +// withdrawer: withdrawer +// }); + +// bytes32[] memory withdrawalRoots = new bytes32[](1); +// withdrawalRoots = delegation.queueWithdrawals(params); +// cheats.stopPrank(); +// return withdrawalRoots[0]; +// } +// } \ No newline at end of file diff --git a/src/test/Pausable.t.sol b/src/test/Pausable.t.sol index 9b6b878ec..8284d5abd 100644 --- a/src/test/Pausable.t.sol +++ b/src/test/Pausable.t.sol @@ -2,89 +2,89 @@ pragma solidity ^0.8.12; -import "./EigenLayerTestHelper.t.sol"; - -contract PausableTests is EigenLayerTestHelper { - - /// @notice Emitted when the `pauserRegistry` is set to `newPauserRegistry`. - event PauserRegistrySet(IPauserRegistry pauserRegistry, IPauserRegistry newPauserRegistry); - - ///@dev test that pausing a contract works - function testPausingWithdrawalsFromStrategyManager(uint256 amountToDeposit, uint256 amountToWithdraw) public { - cheats.assume(amountToDeposit <= 1e38 - 1); - cheats.assume(amountToDeposit <= weth.balanceOf(address(this))); - // if first deposit amount to base strategy is too small, it will revert. ignore that case here. - cheats.assume(amountToDeposit >= 1); - cheats.assume(amountToWithdraw <= amountToDeposit); - - address sender = getOperatorAddress(0); - _testDepositToStrategy(sender, amountToDeposit, weth, wethStrat); - - cheats.startPrank(pauser); - strategyManager.pause(type(uint256).max); - cheats.stopPrank(); - - // uint256 strategyIndex = 0; - - cheats.prank(sender); - - // TODO: write this to work with completing a queued withdrawal - // cheats.expectRevert(bytes("Pausable: paused")); - // strategyManager.withdrawFromStrategy(strategyIndex, wethStrat, weth, amountToWithdraw); - // cheats.stopPrank(); - } - - function testUnauthorizedPauserStrategyManager(address unauthorizedPauser) - public - fuzzedAddress(unauthorizedPauser) - { - cheats.assume(!eigenLayerPauserReg.isPauser(unauthorizedPauser)); - cheats.startPrank(unauthorizedPauser); - cheats.expectRevert(bytes("msg.sender is not permissioned as pauser")); - strategyManager.pause(type(uint256).max); - cheats.stopPrank(); - } - - function testSetPauser(address newPauser) public fuzzedAddress(newPauser) { - cheats.startPrank(unpauser); - eigenLayerPauserReg.setIsPauser(newPauser, true); - cheats.stopPrank(); - } - - function testSetUnpauser(address newUnpauser) public fuzzedAddress(newUnpauser) { - cheats.startPrank(unpauser); - eigenLayerPauserReg.setUnpauser(newUnpauser); - cheats.stopPrank(); - } - - function testSetPauserUnauthorized(address fakePauser, address newPauser) - public - fuzzedAddress(newPauser) - fuzzedAddress(fakePauser) - { - cheats.assume(fakePauser != eigenLayerPauserReg.unpauser()); - cheats.startPrank(fakePauser); - cheats.expectRevert(bytes("msg.sender is not permissioned as unpauser")); - eigenLayerPauserReg.setIsPauser(newPauser, true); - cheats.stopPrank(); - } - - function testSetPauserRegistryUnpauser(IPauserRegistry newPauserRegistry) public { - cheats.assume(address(newPauserRegistry) != address(0)); - IPauserRegistry oldPauserRegistry = strategyManager.pauserRegistry(); - cheats.prank(unpauser); - cheats.expectEmit(true, true, true, true, address(strategyManager)); - emit PauserRegistrySet(oldPauserRegistry, newPauserRegistry); - strategyManager.setPauserRegistry(newPauserRegistry); +// import "./EigenLayerTestHelper.t.sol"; + +// contract PausableTests is EigenLayerTestHelper { + +// /// @notice Emitted when the `pauserRegistry` is set to `newPauserRegistry`. +// event PauserRegistrySet(IPauserRegistry pauserRegistry, IPauserRegistry newPauserRegistry); + +// ///@dev test that pausing a contract works +// function testPausingWithdrawalsFromStrategyManager(uint256 amountToDeposit, uint256 amountToWithdraw) public { +// cheats.assume(amountToDeposit <= 1e38 - 1); +// cheats.assume(amountToDeposit <= weth.balanceOf(address(this))); +// // if first deposit amount to base strategy is too small, it will revert. ignore that case here. +// cheats.assume(amountToDeposit >= 1); +// cheats.assume(amountToWithdraw <= amountToDeposit); + +// address sender = getOperatorAddress(0); +// _testDepositToStrategy(sender, amountToDeposit, weth, wethStrat); + +// cheats.startPrank(pauser); +// strategyManager.pause(type(uint256).max); +// cheats.stopPrank(); + +// // uint256 strategyIndex = 0; + +// cheats.prank(sender); + +// // TODO: write this to work with completing a queued withdrawal +// // cheats.expectRevert(bytes("Pausable: paused")); +// // strategyManager.withdrawFromStrategy(strategyIndex, wethStrat, weth, amountToWithdraw); +// // cheats.stopPrank(); +// } + +// function testUnauthorizedPauserStrategyManager(address unauthorizedPauser) +// public +// fuzzedAddress(unauthorizedPauser) +// { +// cheats.assume(!eigenLayerPauserReg.isPauser(unauthorizedPauser)); +// cheats.startPrank(unauthorizedPauser); +// cheats.expectRevert(bytes("msg.sender is not permissioned as pauser")); +// strategyManager.pause(type(uint256).max); +// cheats.stopPrank(); +// } + +// function testSetPauser(address newPauser) public fuzzedAddress(newPauser) { +// cheats.startPrank(unpauser); +// eigenLayerPauserReg.setIsPauser(newPauser, true); +// cheats.stopPrank(); +// } + +// function testSetUnpauser(address newUnpauser) public fuzzedAddress(newUnpauser) { +// cheats.startPrank(unpauser); +// eigenLayerPauserReg.setUnpauser(newUnpauser); +// cheats.stopPrank(); +// } + +// function testSetPauserUnauthorized(address fakePauser, address newPauser) +// public +// fuzzedAddress(newPauser) +// fuzzedAddress(fakePauser) +// { +// cheats.assume(fakePauser != eigenLayerPauserReg.unpauser()); +// cheats.startPrank(fakePauser); +// cheats.expectRevert(bytes("msg.sender is not permissioned as unpauser")); +// eigenLayerPauserReg.setIsPauser(newPauser, true); +// cheats.stopPrank(); +// } + +// function testSetPauserRegistryUnpauser(IPauserRegistry newPauserRegistry) public { +// cheats.assume(address(newPauserRegistry) != address(0)); +// IPauserRegistry oldPauserRegistry = strategyManager.pauserRegistry(); +// cheats.prank(unpauser); +// cheats.expectEmit(true, true, true, true, address(strategyManager)); +// emit PauserRegistrySet(oldPauserRegistry, newPauserRegistry); +// strategyManager.setPauserRegistry(newPauserRegistry); - assertEq(address(newPauserRegistry), address(strategyManager.pauserRegistry())); - } +// assertEq(address(newPauserRegistry), address(strategyManager.pauserRegistry())); +// } - function testSetPauserRegistyUnauthorized(IPauserRegistry newPauserRegistry, address notUnpauser) public fuzzedAddress(notUnpauser) { - cheats.assume(notUnpauser != eigenLayerPauserReg.unpauser()); +// function testSetPauserRegistyUnauthorized(IPauserRegistry newPauserRegistry, address notUnpauser) public fuzzedAddress(notUnpauser) { +// cheats.assume(notUnpauser != eigenLayerPauserReg.unpauser()); - cheats.prank(notUnpauser); - cheats.expectRevert(bytes("msg.sender is not permissioned as unpauser")); - strategyManager.setPauserRegistry(newPauserRegistry); - } -} +// cheats.prank(notUnpauser); +// cheats.expectRevert(bytes("msg.sender is not permissioned as unpauser")); +// strategyManager.setPauserRegistry(newPauserRegistry); +// } +// } \ No newline at end of file diff --git a/src/test/Strategy.t.sol b/src/test/Strategy.t.sol index 3139e92a2..84e40c461 100644 --- a/src/test/Strategy.t.sol +++ b/src/test/Strategy.t.sol @@ -1,58 +1,58 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.12; -import "./EigenLayerTestHelper.t.sol"; -import "../contracts/core/StrategyManagerStorage.sol"; - -contract StrategyTests is EigenLayerTestHelper { - /// @notice This function tests to ensure that a delegation contract - /// cannot be intitialized multiple times - function testCannotInitMultipleTimesDelegation() public cannotReinit { - wethStrat.initialize(weth, eigenLayerPauserReg); - } - - ///@notice This function tests to ensure that only the strategyManager - /// can deposit into a strategy - ///@param invalidDepositor is the non-registered depositor - function testInvalidCalltoDeposit(address invalidDepositor) public fuzzedAddress(invalidDepositor) { - IERC20 underlyingToken = wethStrat.underlyingToken(); - - cheats.startPrank(invalidDepositor); - cheats.expectRevert(bytes("StrategyBase.onlyStrategyManager")); - wethStrat.deposit(underlyingToken, 1e18); - cheats.stopPrank(); - } - - ///@notice This function tests to ensure that only the strategyManager - /// can deposit into a strategy - ///@param invalidWithdrawer is the non-registered withdrawer - ///@param depositor is the depositor for which the shares are being withdrawn - function testInvalidCalltoWithdraw(address depositor, address invalidWithdrawer) - public - fuzzedAddress(invalidWithdrawer) - { - IERC20 underlyingToken = wethStrat.underlyingToken(); - - cheats.startPrank(invalidWithdrawer); - cheats.expectRevert(bytes("StrategyBase.onlyStrategyManager")); - wethStrat.withdraw(depositor, underlyingToken, 1e18); - cheats.stopPrank(); - } - - ///@notice This function tests ensures that withdrawing for a depositor that never - /// actually deposited fails. - ///@param depositor is the depositor for which the shares are being withdrawn - function testWithdrawalExceedsTotalShares(address depositor, uint256 shares) public fuzzedAddress(depositor) { - cheats.assume(shares > strategyManager.stakerStrategyShares(depositor, wethStrat)); - IERC20 underlyingToken = wethStrat.underlyingToken(); - - cheats.startPrank(address(strategyManager)); - - cheats.expectRevert( - bytes("StrategyBase.withdraw: amountShares must be less than or equal to totalShares") - ); - wethStrat.withdraw(depositor, underlyingToken, shares); - - cheats.stopPrank(); - } -} +// import "./EigenLayerTestHelper.t.sol"; +// import "../contracts/core/StrategyManagerStorage.sol"; + +// contract StrategyTests is EigenLayerTestHelper { +// /// @notice This function tests to ensure that a delegation contract +// /// cannot be intitialized multiple times +// function testCannotInitMultipleTimesDelegation() public cannotReinit { +// wethStrat.initialize(weth, eigenLayerPauserReg); +// } + +// ///@notice This function tests to ensure that only the strategyManager +// /// can deposit into a strategy +// ///@param invalidDepositor is the non-registered depositor +// function testInvalidCalltoDeposit(address invalidDepositor) public fuzzedAddress(invalidDepositor) { +// IERC20 underlyingToken = wethStrat.underlyingToken(); + +// cheats.startPrank(invalidDepositor); +// cheats.expectRevert(bytes("StrategyBase.onlyStrategyManager")); +// wethStrat.deposit(underlyingToken, 1e18); +// cheats.stopPrank(); +// } + +// ///@notice This function tests to ensure that only the strategyManager +// /// can deposit into a strategy +// ///@param invalidWithdrawer is the non-registered withdrawer +// ///@param depositor is the depositor for which the shares are being withdrawn +// function testInvalidCalltoWithdraw(address depositor, address invalidWithdrawer) +// public +// fuzzedAddress(invalidWithdrawer) +// { +// IERC20 underlyingToken = wethStrat.underlyingToken(); + +// cheats.startPrank(invalidWithdrawer); +// cheats.expectRevert(bytes("StrategyBase.onlyStrategyManager")); +// wethStrat.withdraw(depositor, underlyingToken, 1e18); +// cheats.stopPrank(); +// } + +// ///@notice This function tests ensures that withdrawing for a depositor that never +// /// actually deposited fails. +// ///@param depositor is the depositor for which the shares are being withdrawn +// function testWithdrawalExceedsTotalShares(address depositor, uint256 shares) public fuzzedAddress(depositor) { +// cheats.assume(shares > strategyManager.stakerStrategyShares(depositor, wethStrat)); +// IERC20 underlyingToken = wethStrat.underlyingToken(); + +// cheats.startPrank(address(strategyManager)); + +// cheats.expectRevert( +// bytes("StrategyBase.withdraw: amountShares must be less than or equal to totalShares") +// ); +// wethStrat.withdraw(depositor, underlyingToken, shares); + +// cheats.stopPrank(); +// } +// } \ No newline at end of file diff --git a/src/test/Withdrawals.t.sol b/src/test/Withdrawals.t.sol index f8f780e7a..9e52dd6f2 100644 --- a/src/test/Withdrawals.t.sol +++ b/src/test/Withdrawals.t.sol @@ -1,285 +1,284 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.12; -import "../test/EigenLayerTestHelper.t.sol"; - -contract WithdrawalTests is EigenLayerTestHelper { - // packed info used to help handle stack-too-deep errors - struct DataForTestWithdrawal { - IStrategy[] delegatorStrategies; - uint256[] delegatorShares; - address withdrawer; - uint96 nonce; - } - - bytes32 defaultOperatorId = bytes32(uint256(0)); - - function setUp() public virtual override { - EigenLayerDeployer.setUp(); - } - - //This function helps with stack too deep issues with "testWithdrawal" test - function testWithdrawalWrapper( - address operator, - address depositor, - uint96 ethAmount, - uint96 eigenAmount, - bool withdrawAsTokens, - bool RANDAO - ) public fuzzedAddress(operator) fuzzedAddress(depositor) { - cheats.assume(depositor != operator); - cheats.assume(ethAmount >= 1 && ethAmount <= 1e18); - cheats.assume(eigenAmount >= 1 && eigenAmount <= 1e18); - - address withdrawer = depositor; - - if (RANDAO) { - _testWithdrawalAndDeregistration(operator, depositor, withdrawer, ethAmount, eigenAmount, withdrawAsTokens); - } else { - _testWithdrawalWithStakeUpdate(operator, depositor, withdrawer, ethAmount, eigenAmount, withdrawAsTokens); - } - } - - /// @notice test staker's ability to undelegate/withdraw from an operator. - /// @param operator is the operator being delegated to. - /// @param depositor is the staker delegating stake to the operator. - function _testWithdrawalAndDeregistration( - address operator, - address depositor, - address withdrawer, - uint96 ethAmount, - uint96 eigenAmount, - bool withdrawAsTokens - ) internal { - _initiateDelegation(operator, depositor, ethAmount, eigenAmount); - - address delegatedTo = delegation.delegatedTo(depositor); - - // packed data structure to deal with stack-too-deep issues - DataForTestWithdrawal memory dataForTestWithdrawal; - - // scoped block to deal with stack-too-deep issues - { - //delegator-specific information - (IStrategy[] memory delegatorStrategies, uint256[] memory delegatorShares) = strategyManager.getDeposits( - depositor - ); - dataForTestWithdrawal.delegatorStrategies = delegatorStrategies; - dataForTestWithdrawal.delegatorShares = delegatorShares; - dataForTestWithdrawal.withdrawer = withdrawer; - // harcoded nonce value - dataForTestWithdrawal.nonce = 0; - } - - uint256[] memory strategyIndexes = new uint256[](2); - IERC20[] memory tokensArray = new IERC20[](2); - { - // hardcoded values - strategyIndexes[0] = 0; - strategyIndexes[1] = 0; - tokensArray[0] = weth; - tokensArray[1] = eigenToken; - } - - cheats.warp(uint32(block.timestamp) + 1 days); - cheats.roll(uint32(block.timestamp) + 1 days); - - _testQueueWithdrawal( - depositor, - strategyIndexes, - dataForTestWithdrawal.delegatorStrategies, - dataForTestWithdrawal.delegatorShares, - withdrawer - ); - uint32 queuedWithdrawalBlock = uint32(block.number); - - //now withdrawal block time is before deregistration - cheats.warp(uint32(block.timestamp) + 2 days); - cheats.roll(uint32(block.timestamp) + 2 days); - - { - //warp past the serve until time, which is 3 days from the beginning. THis puts us at 4 days past that point - cheats.warp(uint32(block.timestamp) + 4 days); - cheats.roll(uint32(block.timestamp) + 4 days); - - uint256 middlewareTimeIndex = 1; - if (withdrawAsTokens) { - _testCompleteQueuedWithdrawalTokens( - depositor, - dataForTestWithdrawal.delegatorStrategies, - tokensArray, - dataForTestWithdrawal.delegatorShares, - delegatedTo, - dataForTestWithdrawal.withdrawer, - dataForTestWithdrawal.nonce, - queuedWithdrawalBlock, - middlewareTimeIndex - ); - } else { - _testCompleteQueuedWithdrawalShares( - depositor, - dataForTestWithdrawal.delegatorStrategies, - tokensArray, - dataForTestWithdrawal.delegatorShares, - delegatedTo, - dataForTestWithdrawal.withdrawer, - dataForTestWithdrawal.nonce, - queuedWithdrawalBlock, - middlewareTimeIndex - ); - } - } - } - - /// @notice test staker's ability to undelegate/withdraw from an operator. - /// @param operator is the operator being delegated to. - /// @param depositor is the staker delegating stake to the operator. - function _testWithdrawalWithStakeUpdate( - address operator, - address depositor, - address withdrawer, - uint96 ethAmount, - uint96 eigenAmount, - bool withdrawAsTokens - ) public { - _initiateDelegation(operator, depositor, ethAmount, eigenAmount); - - // emit log_named_uint("Linked list element 1", uint256(uint160(address(generalServiceManager1)))); - // emit log_named_uint("Linked list element 2", uint256(uint160(address(generalServiceManager2)))); - // emit log("________________________________________________________________"); - // emit log_named_uint("Middleware 1 Update Block", uint32(block.number)); - - cheats.warp(uint32(block.timestamp) + 1 days); - cheats.roll(uint32(block.number) + 1); - - // emit log_named_uint("Middleware 2 Update Block", uint32(block.number)); - - address delegatedTo = delegation.delegatedTo(depositor); - - // packed data structure to deal with stack-too-deep issues - DataForTestWithdrawal memory dataForTestWithdrawal; - - // scoped block to deal with stack-too-deep issues - { - //delegator-specific information - (IStrategy[] memory delegatorStrategies, uint256[] memory delegatorShares) = strategyManager.getDeposits( - depositor - ); - dataForTestWithdrawal.delegatorStrategies = delegatorStrategies; - dataForTestWithdrawal.delegatorShares = delegatorShares; - dataForTestWithdrawal.withdrawer = withdrawer; - // harcoded nonce value - dataForTestWithdrawal.nonce = 0; - } - - uint256[] memory strategyIndexes = new uint256[](2); - IERC20[] memory tokensArray = new IERC20[](2); - { - // hardcoded values - strategyIndexes[0] = 0; - strategyIndexes[1] = 0; - tokensArray[0] = weth; - tokensArray[1] = eigenToken; - } - - cheats.warp(uint32(block.timestamp) + 1 days); - cheats.roll(uint32(block.number) + 1); - - _testQueueWithdrawal( - depositor, - strategyIndexes, - dataForTestWithdrawal.delegatorStrategies, - dataForTestWithdrawal.delegatorShares, - dataForTestWithdrawal.withdrawer - ); - uint32 queuedWithdrawalBlock = uint32(block.number); - - //now withdrawal block time is before deregistration - cheats.warp(uint32(block.timestamp) + 2 days); - cheats.roll(uint32(block.number) + 2); - - // uint256 prevElement = uint256(uint160(address(generalServiceManager2))); - - cheats.warp(uint32(block.timestamp) + 1 days); - cheats.roll(uint32(block.number) + 1); - - // prevElement = uint256(uint160(address(generalServiceManager1))); - - { - //warp past the serve until time, which is 3 days from the beginning. THis puts us at 4 days past that point - cheats.warp(uint32(block.timestamp) + 4 days); - cheats.roll(uint32(block.number) + 4); - - uint256 middlewareTimeIndex = 3; - if (withdrawAsTokens) { - _testCompleteQueuedWithdrawalTokens( - depositor, - dataForTestWithdrawal.delegatorStrategies, - tokensArray, - dataForTestWithdrawal.delegatorShares, - delegatedTo, - dataForTestWithdrawal.withdrawer, - dataForTestWithdrawal.nonce, - queuedWithdrawalBlock, - middlewareTimeIndex - ); - } else { - _testCompleteQueuedWithdrawalShares( - depositor, - dataForTestWithdrawal.delegatorStrategies, - tokensArray, - dataForTestWithdrawal.delegatorShares, - delegatedTo, - dataForTestWithdrawal.withdrawer, - dataForTestWithdrawal.nonce, - queuedWithdrawalBlock, - middlewareTimeIndex - ); - } - } - } - - // @notice This function tests to ensure that a delegator can re-delegate to an operator after undelegating. - // @param operator is the operator being delegated to. - // @param staker is the staker delegating stake to the operator. - function testRedelegateAfterWithdrawal( - address operator, - address depositor, - uint96 ethAmount, - uint96 eigenAmount, - bool withdrawAsShares - ) public fuzzedAddress(operator) fuzzedAddress(depositor) { - cheats.assume(depositor != operator); - //this function performs delegation and subsequent withdrawal - testWithdrawalWrapper(operator, depositor, ethAmount, eigenAmount, withdrawAsShares, true); - - cheats.prank(depositor); - delegation.undelegate(depositor); - - //warps past fraudproof time interval - cheats.warp(block.timestamp + 7 days + 1); - _initiateDelegation(operator, depositor, ethAmount, eigenAmount); - } - - // Helper function to begin a delegation - function _initiateDelegation( - address operator, - address staker, - uint96 ethAmount, - uint96 eigenAmount - ) internal fuzzedAddress(operator) fuzzedAddress(staker) fuzzedAmounts(ethAmount, eigenAmount) { - cheats.assume(staker != operator); - // base strategy will revert if these amounts are too small on first deposit - cheats.assume(ethAmount >= 1); - cheats.assume(eigenAmount >= 2); - - _testDelegation(operator, staker, ethAmount, eigenAmount); - } - - modifier fuzzedAmounts(uint256 ethAmount, uint256 eigenAmount) { - cheats.assume(ethAmount >= 0 && ethAmount <= 1e18); - cheats.assume(eigenAmount >= 0 && eigenAmount <= 1e18); - _; - } -} - +// import "../test/EigenLayerTestHelper.t.sol"; + +// contract WithdrawalTests is EigenLayerTestHelper { +// // packed info used to help handle stack-too-deep errors +// struct DataForTestWithdrawal { +// IStrategy[] delegatorStrategies; +// uint256[] delegatorShares; +// address withdrawer; +// uint96 nonce; +// } + +// bytes32 defaultOperatorId = bytes32(uint256(0)); + +// function setUp() public virtual override { +// EigenLayerDeployer.setUp(); +// } + +// //This function helps with stack too deep issues with "testWithdrawal" test +// function testWithdrawalWrapper( +// address operator, +// address depositor, +// uint96 ethAmount, +// uint96 eigenAmount, +// bool withdrawAsTokens, +// bool RANDAO +// ) public fuzzedAddress(operator) fuzzedAddress(depositor) { +// cheats.assume(depositor != operator); +// cheats.assume(ethAmount >= 1 && ethAmount <= 1e18); +// cheats.assume(eigenAmount >= 1 && eigenAmount <= 1e18); + +// address withdrawer = depositor; + +// if (RANDAO) { +// _testWithdrawalAndDeregistration(operator, depositor, withdrawer, ethAmount, eigenAmount, withdrawAsTokens); +// } else { +// _testWithdrawalWithStakeUpdate(operator, depositor, withdrawer, ethAmount, eigenAmount, withdrawAsTokens); +// } +// } + +// /// @notice test staker's ability to undelegate/withdraw from an operator. +// /// @param operator is the operator being delegated to. +// /// @param depositor is the staker delegating stake to the operator. +// function _testWithdrawalAndDeregistration( +// address operator, +// address depositor, +// address withdrawer, +// uint96 ethAmount, +// uint96 eigenAmount, +// bool withdrawAsTokens +// ) internal { +// _initiateDelegation(operator, depositor, ethAmount, eigenAmount); + +// address delegatedTo = delegation.delegatedTo(depositor); + +// // packed data structure to deal with stack-too-deep issues +// DataForTestWithdrawal memory dataForTestWithdrawal; + +// // scoped block to deal with stack-too-deep issues +// { +// //delegator-specific information +// (IStrategy[] memory delegatorStrategies, uint256[] memory delegatorShares) = strategyManager.getDeposits( +// depositor +// ); +// dataForTestWithdrawal.delegatorStrategies = delegatorStrategies; +// dataForTestWithdrawal.delegatorShares = delegatorShares; +// dataForTestWithdrawal.withdrawer = withdrawer; +// // harcoded nonce value +// dataForTestWithdrawal.nonce = 0; +// } + +// uint256[] memory strategyIndexes = new uint256[](2); +// IERC20[] memory tokensArray = new IERC20[](2); +// { +// // hardcoded values +// strategyIndexes[0] = 0; +// strategyIndexes[1] = 0; +// tokensArray[0] = weth; +// tokensArray[1] = eigenToken; +// } + +// cheats.warp(uint32(block.timestamp) + 1 days); +// cheats.roll(uint32(block.timestamp) + 1 days); + +// _testQueueWithdrawal( +// depositor, +// strategyIndexes, +// dataForTestWithdrawal.delegatorStrategies, +// dataForTestWithdrawal.delegatorShares, +// withdrawer +// ); +// uint32 queuedWithdrawalBlock = uint32(block.number); + +// //now withdrawal block time is before deregistration +// cheats.warp(uint32(block.timestamp) + 2 days); +// cheats.roll(uint32(block.timestamp) + 2 days); + +// { +// //warp past the serve until time, which is 3 days from the beginning. THis puts us at 4 days past that point +// cheats.warp(uint32(block.timestamp) + 4 days); +// cheats.roll(uint32(block.timestamp) + 4 days); + +// uint256 middlewareTimeIndex = 1; +// if (withdrawAsTokens) { +// _testCompleteQueuedWithdrawalTokens( +// depositor, +// dataForTestWithdrawal.delegatorStrategies, +// tokensArray, +// dataForTestWithdrawal.delegatorShares, +// delegatedTo, +// dataForTestWithdrawal.withdrawer, +// dataForTestWithdrawal.nonce, +// queuedWithdrawalBlock, +// middlewareTimeIndex +// ); +// } else { +// _testCompleteQueuedWithdrawalShares( +// depositor, +// dataForTestWithdrawal.delegatorStrategies, +// tokensArray, +// dataForTestWithdrawal.delegatorShares, +// delegatedTo, +// dataForTestWithdrawal.withdrawer, +// dataForTestWithdrawal.nonce, +// queuedWithdrawalBlock, +// middlewareTimeIndex +// ); +// } +// } +// } + +// /// @notice test staker's ability to undelegate/withdraw from an operator. +// /// @param operator is the operator being delegated to. +// /// @param depositor is the staker delegating stake to the operator. +// function _testWithdrawalWithStakeUpdate( +// address operator, +// address depositor, +// address withdrawer, +// uint96 ethAmount, +// uint96 eigenAmount, +// bool withdrawAsTokens +// ) public { +// _initiateDelegation(operator, depositor, ethAmount, eigenAmount); + +// // emit log_named_uint("Linked list element 1", uint256(uint160(address(generalServiceManager1)))); +// // emit log_named_uint("Linked list element 2", uint256(uint160(address(generalServiceManager2)))); +// // emit log("________________________________________________________________"); +// // emit log_named_uint("Middleware 1 Update Block", uint32(block.number)); + +// cheats.warp(uint32(block.timestamp) + 1 days); +// cheats.roll(uint32(block.number) + 1); + +// // emit log_named_uint("Middleware 2 Update Block", uint32(block.number)); + +// address delegatedTo = delegation.delegatedTo(depositor); + +// // packed data structure to deal with stack-too-deep issues +// DataForTestWithdrawal memory dataForTestWithdrawal; + +// // scoped block to deal with stack-too-deep issues +// { +// //delegator-specific information +// (IStrategy[] memory delegatorStrategies, uint256[] memory delegatorShares) = strategyManager.getDeposits( +// depositor +// ); +// dataForTestWithdrawal.delegatorStrategies = delegatorStrategies; +// dataForTestWithdrawal.delegatorShares = delegatorShares; +// dataForTestWithdrawal.withdrawer = withdrawer; +// // harcoded nonce value +// dataForTestWithdrawal.nonce = 0; +// } + +// uint256[] memory strategyIndexes = new uint256[](2); +// IERC20[] memory tokensArray = new IERC20[](2); +// { +// // hardcoded values +// strategyIndexes[0] = 0; +// strategyIndexes[1] = 0; +// tokensArray[0] = weth; +// tokensArray[1] = eigenToken; +// } + +// cheats.warp(uint32(block.timestamp) + 1 days); +// cheats.roll(uint32(block.number) + 1); + +// _testQueueWithdrawal( +// depositor, +// strategyIndexes, +// dataForTestWithdrawal.delegatorStrategies, +// dataForTestWithdrawal.delegatorShares, +// dataForTestWithdrawal.withdrawer +// ); +// uint32 queuedWithdrawalBlock = uint32(block.number); + +// //now withdrawal block time is before deregistration +// cheats.warp(uint32(block.timestamp) + 2 days); +// cheats.roll(uint32(block.number) + 2); + +// // uint256 prevElement = uint256(uint160(address(generalServiceManager2))); + +// cheats.warp(uint32(block.timestamp) + 1 days); +// cheats.roll(uint32(block.number) + 1); + +// // prevElement = uint256(uint160(address(generalServiceManager1))); + +// { +// //warp past the serve until time, which is 3 days from the beginning. THis puts us at 4 days past that point +// cheats.warp(uint32(block.timestamp) + 4 days); +// cheats.roll(uint32(block.number) + 4); + +// uint256 middlewareTimeIndex = 3; +// if (withdrawAsTokens) { +// _testCompleteQueuedWithdrawalTokens( +// depositor, +// dataForTestWithdrawal.delegatorStrategies, +// tokensArray, +// dataForTestWithdrawal.delegatorShares, +// delegatedTo, +// dataForTestWithdrawal.withdrawer, +// dataForTestWithdrawal.nonce, +// queuedWithdrawalBlock, +// middlewareTimeIndex +// ); +// } else { +// _testCompleteQueuedWithdrawalShares( +// depositor, +// dataForTestWithdrawal.delegatorStrategies, +// tokensArray, +// dataForTestWithdrawal.delegatorShares, +// delegatedTo, +// dataForTestWithdrawal.withdrawer, +// dataForTestWithdrawal.nonce, +// queuedWithdrawalBlock, +// middlewareTimeIndex +// ); +// } +// } +// } + +// // @notice This function tests to ensure that a delegator can re-delegate to an operator after undelegating. +// // @param operator is the operator being delegated to. +// // @param staker is the staker delegating stake to the operator. +// function testRedelegateAfterWithdrawal( +// address operator, +// address depositor, +// uint96 ethAmount, +// uint96 eigenAmount, +// bool withdrawAsShares +// ) public fuzzedAddress(operator) fuzzedAddress(depositor) { +// cheats.assume(depositor != operator); +// //this function performs delegation and subsequent withdrawal +// testWithdrawalWrapper(operator, depositor, ethAmount, eigenAmount, withdrawAsShares, true); + +// cheats.prank(depositor); +// delegation.undelegate(depositor); + +// //warps past fraudproof time interval +// cheats.warp(block.timestamp + 7 days + 1); +// _initiateDelegation(operator, depositor, ethAmount, eigenAmount); +// } + +// // Helper function to begin a delegation +// function _initiateDelegation( +// address operator, +// address staker, +// uint96 ethAmount, +// uint96 eigenAmount +// ) internal fuzzedAddress(operator) fuzzedAddress(staker) fuzzedAmounts(ethAmount, eigenAmount) { +// cheats.assume(staker != operator); +// // base strategy will revert if these amounts are too small on first deposit +// cheats.assume(ethAmount >= 1); +// cheats.assume(eigenAmount >= 2); + +// _testDelegation(operator, staker, ethAmount, eigenAmount); +// } + +// modifier fuzzedAmounts(uint256 ethAmount, uint256 eigenAmount) { +// cheats.assume(ethAmount >= 0 && ethAmount <= 1e18); +// cheats.assume(eigenAmount >= 0 && eigenAmount <= 1e18); +// _; +// } +// } diff --git a/src/test/events/IAVSDirectoryEvents.sol b/src/test/events/IAVSDirectoryEvents.sol index a4f0a2962..48f4dce39 100644 --- a/src/test/events/IAVSDirectoryEvents.sol +++ b/src/test/events/IAVSDirectoryEvents.sol @@ -4,12 +4,28 @@ pragma solidity ^0.8.12; import "src/contracts/interfaces/IAVSDirectory.sol"; interface IAVSDirectoryEvents { + /// @notice Emitted when an operator set is created by an AVS. + event OperatorSetCreated(OperatorSet operatorSet); + /** - * @notice Emitted when @param avs indicates that they are updating their MetadataURI string - * @dev Note that these strings are *never stored in storage* and are instead purely emitted in events for off-chain indexing + * @notice Emitted when an operator's registration status with an AVS id udpated + * @notice Only used by legacy M2 AVSs that have not integrated with operatorSets. */ + event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, IAVSDirectory.OperatorAVSRegistrationStatus status); + + /// @notice Emitted when an operator is added to an operator set. + event OperatorAddedToOperatorSet(address indexed operator, OperatorSet operatorSet); + + /// @notice Emitted when an operator is removed from an operator set. + event OperatorRemovedFromOperatorSet(address indexed operator, OperatorSet operatorSet); + + /// @notice Emitted when an AVS updates their metadata URI (Uniform Resource Identifier). + /// @dev The URI is never stored; it is simply emitted through an event for off-chain indexing. event AVSMetadataURIUpdated(address indexed avs, string metadataURI); - /// @notice Emitted when an operator's registration status for an AVS is updated - event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, IAVSDirectory.OperatorAVSRegistrationStatus status); + /// @notice Emitted when an AVS migrates to using operator sets + event AVSMigratedToOperatorSets(address indexed avs); + + /// @notice Emitted when an operator is migrated from M2 registration to operator sets. + event OperatorMigratedToOperatorSets(address indexed operator, address indexed avs, uint32[] operatorSetIds); } diff --git a/src/test/events/IRewardsCoordinatorEvents.sol b/src/test/events/IRewardsCoordinatorEvents.sol index fa406d29f..7200a2ecb 100644 --- a/src/test/events/IRewardsCoordinatorEvents.sol +++ b/src/test/events/IRewardsCoordinatorEvents.sol @@ -29,6 +29,14 @@ interface IRewardsCoordinatorEvents { ); event ActivationDelaySet(uint32 oldActivationDelay, uint32 newActivationDelay); event GlobalCommissionBipsSet(uint16 oldGlobalCommissionBips, uint16 newGlobalCommissionBips); + /// @notice emitted when an operator commission is set for a specific OperatorSet + event OperatorCommissionUpdated( + address indexed operator, + OperatorSet indexed operatorSet, + IRewardsCoordinator.RewardType rewardType, + uint16 newCommissionBips, + uint32 effectTimestamp + ); event ClaimerForSet(address indexed earner, address indexed oldClaimer, address indexed claimer); /// @notice rootIndex is the specific array index of the newly created root in the storage array event DistributionRootSubmitted( @@ -37,6 +45,7 @@ interface IRewardsCoordinatorEvents { uint32 indexed rewardsCalculationEndTimestamp, uint32 activatedAt ); + event DistributionRootDisabled(uint32 indexed rootIndex); /// @notice root is one of the submitted distribution roots that was claimed against event RewardsClaimed( bytes32 root, @@ -46,6 +55,14 @@ interface IRewardsCoordinatorEvents { IERC20 token, uint256 claimedAmount ); + /// @notice emitted when an AVS creates a valid OperatorSetRewardsSubmission + event OperatorSetRewardCreated( + address indexed avs, + uint256 indexed submissionNonce, + bytes32 indexed rewardsSubmissionHash, + IRewardsCoordinator.OperatorSetRewardsSubmission rewardsSubmission + ); + diff --git a/src/test/integration/IntegrationChecks.t.sol b/src/test/integration/IntegrationChecks.t.sol index 2fc360581..dcbdf963f 100644 --- a/src/test/integration/IntegrationChecks.t.sol +++ b/src/test/integration/IntegrationChecks.t.sol @@ -266,11 +266,11 @@ contract IntegrationCheckUtils is IntegrationBase { if (operator != staker) { assert_Snap_Unchanged_TokenBalances(User(operator), "operator should not have any change in underlying token balances"); } - assert_Snap_Added_OperatorShares(User(operator), withdrawal.strategies, withdrawal.shares, "operator should have received shares"); + assert_Snap_Added_OperatorShares(User(operator), withdrawal.strategies, withdrawal.scaledShares, "operator should have received scaledShares"); } } - /// @notice Difference from above is that operator shares do not increase since staker is not delegated + /// @notice Difference from above is that operator scaledShares do not increase since staker is not delegated function check_Withdrawal_AsShares_Undelegated_State( User staker, User operator, diff --git a/src/test/integration/IntegrationDeployer.t.sol b/src/test/integration/IntegrationDeployer.t.sol index d60a52d05..4b55258fa 100644 --- a/src/test/integration/IntegrationDeployer.t.sol +++ b/src/test/integration/IntegrationDeployer.t.sol @@ -256,8 +256,8 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { eigenPodBeacon = new UpgradeableBeacon(address(eigenPodImplementation)); // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs - delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher); + delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager, avsDirectory, allocationManager); + strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher, avsDirectory); slasherImplementation = new Slasher(strategyManager, delegationManager); eigenPodManagerImplementation = new EigenPodManager( ethPOSDeposit, @@ -399,8 +399,8 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { ); // First, deploy the *implementation* contracts, using the *proxy contracts* as inputs - delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher); + delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager, avsDirectory, allocationManager); + strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher, avsDirectory); slasherImplementation = new Slasher(strategyManager, delegationManager); eigenPodManagerImplementation = new EigenPodManager( ethPOSDeposit, @@ -493,8 +493,8 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { ); // First, deploy the *implementation* contracts, using the *proxy contracts* as inputs - delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager); - strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher); + delegationManagerImplementation = new DelegationManager(strategyManager, slasher, eigenPodManager, avsDirectory, allocationManager); + strategyManagerImplementation = new StrategyManager(delegationManager, eigenPodManager, slasher, avsDirectory); slasherImplementation = new Slasher(strategyManager, delegationManager); eigenPodManagerImplementation = new EigenPodManager( ethPOSDeposit, diff --git a/src/test/integration/tests/Deposit_Delegate_Queue_Complete.t.sol b/src/test/integration/tests/Deposit_Delegate_Queue_Complete.t.sol index 7a703dea9..437d1f692 100644 --- a/src/test/integration/tests/Deposit_Delegate_Queue_Complete.t.sol +++ b/src/test/integration/tests/Deposit_Delegate_Queue_Complete.t.sol @@ -60,7 +60,7 @@ contract Integration_Deposit_Delegate_Queue_Complete is IntegrationCheckUtils { _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; i++) { - uint256[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].shares); + uint256[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(withdrawals[i]); check_Withdrawal_AsTokens_State(staker, operator, withdrawals[i], strategies, shares, tokens, expectedTokens); } @@ -192,7 +192,7 @@ contract Integration_Deposit_Delegate_Queue_Complete is IntegrationCheckUtils { // Fast forward to when we can complete the withdrawal _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; i++) { - uint256[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].shares); + uint256[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(withdrawals[i]); check_Withdrawal_AsTokens_State(staker, operator, withdrawals[i], withdrawStrats, withdrawShares, tokens, expectedTokens); } diff --git a/src/test/integration/tests/Deposit_Delegate_Redelegate_Complete.t.sol b/src/test/integration/tests/Deposit_Delegate_Redelegate_Complete.t.sol index e5bc6b91d..ec89d6af1 100644 --- a/src/test/integration/tests/Deposit_Delegate_Redelegate_Complete.t.sol +++ b/src/test/integration/tests/Deposit_Delegate_Redelegate_Complete.t.sol @@ -60,7 +60,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; ++i) { staker.completeWithdrawalAsShares(withdrawals[i]); - check_Withdrawal_AsShares_Undelegated_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares); + check_Withdrawal_AsShares_Undelegated_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares); } // 5. Delegate to a new operator @@ -79,9 +79,9 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti // Complete withdrawals for (uint i = 0; i < withdrawals.length; i++) { - uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].shares); + uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(withdrawals[i]); - check_Withdrawal_AsTokens_State(staker, operator2, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares, tokens, expectedTokens); + check_Withdrawal_AsTokens_State(staker, operator2, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares, tokens, expectedTokens); } } @@ -132,7 +132,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; ++i) { staker.completeWithdrawalAsShares(withdrawals[i]); - check_Withdrawal_AsShares_Undelegated_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares); + check_Withdrawal_AsShares_Undelegated_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares); } // 5. Delegate to a new operator @@ -227,7 +227,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; ++i) { staker.completeWithdrawalAsShares(withdrawals[i]); - check_Withdrawal_AsShares_Undelegated_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares); + check_Withdrawal_AsShares_Undelegated_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares); } // 5. Delegate to a new operator @@ -255,7 +255,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti // Complete withdrawals for (uint i = 0; i < newWithdrawals.length; i++) { - uint[] memory expectedTokens = _calculateExpectedTokens(newWithdrawals[i].strategies, newWithdrawals[i].shares); + uint[] memory expectedTokens = _calculateExpectedTokens(newWithdrawals[i].strategies, newWithdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(newWithdrawals[i]); check_Withdrawal_AsTokens_State(staker, operator2, newWithdrawals[i], strategies, shares, tokens, expectedTokens); } @@ -319,7 +319,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; ++i) { staker.completeWithdrawalAsShares(withdrawals[i]); - check_Withdrawal_AsShares_Undelegated_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares); + check_Withdrawal_AsShares_Undelegated_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares); } // 5. Deposit into Strategies @@ -347,7 +347,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti // Complete withdrawals for (uint i = 0; i < newWithdrawals.length; i++) { - uint[] memory expectedTokens = _calculateExpectedTokens(newWithdrawals[i].strategies, newWithdrawals[i].shares); + uint[] memory expectedTokens = _calculateExpectedTokens(newWithdrawals[i].strategies, newWithdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(newWithdrawals[i]); check_Withdrawal_AsTokens_State(staker, operator2, newWithdrawals[i], strategies, shares, tokens, expectedTokens); } @@ -396,9 +396,9 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti // Fast forward to when we can complete the withdrawal _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; ++i) { - uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].shares); + uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(withdrawals[i]); - check_Withdrawal_AsTokens_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares, tokens, expectedTokens); + check_Withdrawal_AsTokens_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares, tokens, expectedTokens); } //5. Deposit into Strategies @@ -422,7 +422,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti // Complete withdrawals as tokens for (uint i = 0; i < withdrawals.length; i++) { - uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].shares); + uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(withdrawals[i]); check_Withdrawal_AsTokens_State(staker, operator2, withdrawals[i], strategies, shares, tokens, expectedTokens); } @@ -470,9 +470,9 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti // Fast forward to when we can complete the withdrawal _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; ++i) { - uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].shares); + uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(withdrawals[i]); - check_Withdrawal_AsTokens_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares, tokens, expectedTokens); + check_Withdrawal_AsTokens_State(staker, operator1, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares, tokens, expectedTokens); } //5. Deposit into Strategies diff --git a/src/test/integration/tests/Deposit_Delegate_Undelegate_Complete.t.sol b/src/test/integration/tests/Deposit_Delegate_Undelegate_Complete.t.sol index 9307eb358..c7532e030 100644 --- a/src/test/integration/tests/Deposit_Delegate_Undelegate_Complete.t.sol +++ b/src/test/integration/tests/Deposit_Delegate_Undelegate_Complete.t.sol @@ -58,9 +58,9 @@ contract Integration_Deposit_Delegate_Undelegate_Complete is IntegrationCheckUti // Complete withdrawal for (uint256 i = 0; i < withdrawals.length; ++i) { - uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].shares); + uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(withdrawals[i]); - check_Withdrawal_AsTokens_State(staker, operator, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares, tokens, expectedTokens); + check_Withdrawal_AsTokens_State(staker, operator, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares, tokens, expectedTokens); } // Check Final State @@ -121,7 +121,7 @@ contract Integration_Deposit_Delegate_Undelegate_Complete is IntegrationCheckUti for (uint256 i = 0; i < withdrawals.length; ++i) { staker.completeWithdrawalAsShares(withdrawals[i]); - check_Withdrawal_AsShares_Undelegated_State(staker, operator, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares); + check_Withdrawal_AsShares_Undelegated_State(staker, operator, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares); } // Check final state: @@ -176,9 +176,9 @@ contract Integration_Deposit_Delegate_Undelegate_Complete is IntegrationCheckUti _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; ++i) { - uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].shares); + uint[] memory expectedTokens = _calculateExpectedTokens(withdrawals[i].strategies, withdrawals[i].scaledShares); IERC20[] memory tokens = staker.completeWithdrawalAsTokens(withdrawals[i]); - check_Withdrawal_AsTokens_State(staker, operator, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares, tokens, expectedTokens); + check_Withdrawal_AsTokens_State(staker, operator, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares, tokens, expectedTokens); } // Check Final State @@ -233,7 +233,7 @@ contract Integration_Deposit_Delegate_Undelegate_Complete is IntegrationCheckUti _rollBlocksForCompleteWithdrawals(strategies); for (uint256 i = 0; i < withdrawals.length; ++i) { staker.completeWithdrawalAsShares(withdrawals[i]); - check_Withdrawal_AsShares_Undelegated_State(staker, operator, withdrawals[i], withdrawals[i].strategies, withdrawals[i].shares); + check_Withdrawal_AsShares_Undelegated_State(staker, operator, withdrawals[i], withdrawals[i].strategies, withdrawals[i].scaledShares); } // Check final state: diff --git a/src/test/integration/users/User.t.sol b/src/test/integration/users/User.t.sol index 7875e56c6..4ed72e7ce 100644 --- a/src/test/integration/users/User.t.sol +++ b/src/test/integration/users/User.t.sol @@ -85,7 +85,7 @@ contract User is PrintUtils { stakerOptOutWindowBlocks: 0 }); - delegationManager.registerAsOperator(details, "metadata"); + delegationManager.registerAsOperator(details, 0, "metadata"); } /// @dev Delegate to the operator without a signature @@ -107,7 +107,7 @@ contract User is PrintUtils { emit log("expecting withdrawal:"); emit log_named_uint("nonce: ", expectedWithdrawals[i].nonce); emit log_named_address("strat: ", address(expectedWithdrawals[i].strategies[0])); - emit log_named_uint("shares: ", expectedWithdrawals[i].shares[0]); + emit log_named_uint("scaledShares: ", expectedWithdrawals[i].scaledShares[0]); } return expectedWithdrawals; @@ -125,7 +125,7 @@ contract User is PrintUtils { /// @dev Queues a single withdrawal for every share and strategy pair function queueWithdrawals( IStrategy[] memory strategies, - uint[] memory shares + uint[] memory scaledShares ) public createSnapshot virtual returns (IDelegationManager.Withdrawal[] memory) { _logM("queueWithdrawals"); @@ -137,7 +137,7 @@ contract User is PrintUtils { IDelegationManager.QueuedWithdrawalParams[] memory params = new IDelegationManager.QueuedWithdrawalParams[](1); params[0] = IDelegationManager.QueuedWithdrawalParams({ strategies: strategies, - shares: shares, + shares: scaledShares, withdrawer: withdrawer }); @@ -148,9 +148,9 @@ contract User is PrintUtils { delegatedTo: operator, withdrawer: withdrawer, nonce: nonce, - startBlock: uint32(block.number), + startTimestamp: uint32(block.number), //TODO strategies: strategies, - shares: shares + scaledShares: scaledShares }); bytes32[] memory withdrawalRoots = delegationManager.queueWithdrawals(params); @@ -339,7 +339,7 @@ contract User is PrintUtils { } } - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0, receiveAsTokens); + delegationManager.completeQueuedWithdrawal(withdrawal, tokens, receiveAsTokens); return tokens; } @@ -467,7 +467,7 @@ contract User is PrintUtils { /// @notice Gets the expected withdrawals to be created when the staker is undelegated via a call to `DelegationManager.undelegate()` /// @notice Assumes staker and withdrawer are the same and that all strategies and shares are withdrawn function _getExpectedWithdrawalStructsForStaker(address staker) internal view returns (IDelegationManager.Withdrawal[] memory) { - (IStrategy[] memory strategies, uint256[] memory shares) + (IStrategy[] memory strategies, uint256[] memory scaledShares) = delegationManager.getDelegatableShares(staker); IDelegationManager.Withdrawal[] memory expectedWithdrawals = new IDelegationManager.Withdrawal[](strategies.length); @@ -478,15 +478,15 @@ contract User is PrintUtils { IStrategy[] memory singleStrategy = new IStrategy[](1); uint256[] memory singleShares = new uint256[](1); singleStrategy[0] = strategies[i]; - singleShares[0] = shares[i]; + singleShares[0] = scaledShares[i]; expectedWithdrawals[i] = IDelegationManager.Withdrawal({ staker: staker, delegatedTo: delegatedTo, withdrawer: staker, nonce: (nonce + i), - startBlock: uint32(block.number), + startTimestamp: uint32(block.number), //TODO fix strategies: singleStrategy, - shares: singleShares + scaledShares: singleShares }); } diff --git a/src/test/mocks/AVSDirectoryMock.sol b/src/test/mocks/AVSDirectoryMock.sol new file mode 100644 index 000000000..97dbac5e6 --- /dev/null +++ b/src/test/mocks/AVSDirectoryMock.sol @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.9; + +import "forge-std/Test.sol"; +import "../../contracts/interfaces/IAVSDirectory.sol"; + +contract AVSDirectoryMock is IAVSDirectory, Test { + function createOperatorSets(uint32[] calldata operatorSetIds) external {} + + function becomeOperatorSetAVS() external {} + + function migrateOperatorsToOperatorSets( + address[] calldata operators, + uint32[][] calldata operatorSetIds + ) external {} + + function registerOperatorToOperatorSets( + address operator, + uint32[] calldata operatorSetIds, + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature + ) external {} + + function deregisterOperatorFromOperatorSets(address operator, uint32[] calldata operatorSetIds) external {} + + function forceDeregisterFromOperatorSets( + address operator, + address avs, + uint32[] calldata operatorSetIds, + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature + ) external {} + + function registerOperatorToAVS( + address operator, + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature + ) external {} + + function deregisterOperatorFromAVS(address operator) external {} + + function updateFreeMagnitude( + address operator, + IStrategy[] calldata strategies, + uint16[] calldata freeMagnitudes + ) external {} + + function slashOperator( + address operator, + uint32 operatorSetId, + IStrategy[] calldata strategies, + uint16 bipsToSlash + ) external {} + + function updateAVSMetadataURI(string calldata metadataURI) external {} + + function cancelSalt(bytes32 salt) external {} + + function operatorSaltIsSpent(address operator, bytes32 salt) external view returns (bool) {} + + function isMember(address avs, address operator, uint32 operatorSetId) external view returns (bool) {} + + function isOperatorSetAVS(address avs) external view returns (bool) {} + + function isOperatorSet(address avs, uint32 operatorSetId) external view returns (bool) {} + + function isOperatorSlashable(address operator, OperatorSet memory operatorSet) external view returns (bool) {} + + function operatorSetMemberCount(address avs, uint32 operatorSetId) external view returns (uint256) {} + + function calculateOperatorAVSRegistrationDigestHash( + address operator, + address avs, + bytes32 salt, + uint256 expiry + ) external view returns (bytes32) {} + + function calculateOperatorSetRegistrationDigestHash( + address avs, + uint32[] calldata operatorSetIds, + bytes32 salt, + uint256 expiry + ) external view returns (bytes32) {} + + function calculateOperatorSetForceDeregistrationTypehash( + address avs, + uint32[] calldata operatorSetIds, + bytes32 salt, + uint256 expiry + ) external view returns (bytes32) {} + + /// @notice Getter function for the current EIP-712 domain separator for this contract. + /// @dev The domain separator will change in the event of a fork that changes the ChainID. + function domainSeparator() external view returns (bytes32) {} + + /// @notice The EIP-712 typehash for the Registration struct used by the contract. + function OPERATOR_AVS_REGISTRATION_TYPEHASH() external view returns (bytes32) {} + + /// @notice The EIP-712 typehash for the OperatorSetRegistration struct used by the contract. + function OPERATOR_SET_REGISTRATION_TYPEHASH() external view returns (bytes32) {} + + function isMember(address operator, OperatorSet memory operatorSet) external view returns (bool) {} + + function operatorSetsMemberOfAtIndex(address operator, uint256 index) external view returns (OperatorSet memory) {} + + function operatorSetMemberAtIndex(OperatorSet memory operatorSet, uint256 index) external view returns (address) {} + + function getOperatorSetsOfOperator( + address operator, + uint256 start, + uint256 length + ) external view returns (OperatorSet[] memory operatorSets) {} + + function getOperatorsInOperatorSet( + OperatorSet memory operatorSet, + uint256 start, + uint256 length + ) external view returns (address[] memory operators) {} + + function getNumOperatorsInOperatorSet(OperatorSet memory operatorSet) external view returns (uint256) {} + + function inTotalOperatorSets(address operator) external view returns (uint256) {} + + function operatorSetStatus( + address avs, + address operator, + uint32 operatorSetId + ) external view returns (bool registered, uint32 lastDeregisteredTimestamp) {} +} \ No newline at end of file diff --git a/src/test/mocks/DelegationManagerMock.sol b/src/test/mocks/DelegationManagerMock.sol index 4fa56d087..80b8250a1 100644 --- a/src/test/mocks/DelegationManagerMock.sol +++ b/src/test/mocks/DelegationManagerMock.sol @@ -21,7 +21,13 @@ contract DelegationManagerMock is IDelegationManager, Test { mapping (address => address) public delegatedTo; - function registerAsOperator(OperatorDetails calldata /*registeringOperatorDetails*/, string calldata /*metadataURI*/) external pure {} + function registerAsOperator( + OperatorDetails calldata /*registeringOperatorDetails*/, + uint32 /*allocationDelay*/, + string calldata /*metadataURI*/ + ) external pure {} + + function initializeAllocationDelay(uint32 /*delay*/) external {} function updateOperatorMetadataURI(string calldata /*metadataURI*/) external pure {} @@ -46,13 +52,14 @@ contract DelegationManagerMock is IDelegationManager, Test { return withdrawalRoot; } - function increaseDelegatedShares(address /*staker*/, IStrategy /*strategy*/, uint256 /*shares*/) external pure {} - - function decreaseDelegatedShares( - address /*staker*/, - IStrategy /*strategy*/, - uint256 /*shares*/ - ) external pure {} + function increaseDelegatedShares( + address staker, + IStrategy strategy, + uint256 existingShares, + uint256 addedShares + ) external {} + + function decreaseDelegatedShares(address staker, IStrategy strategy, uint256 shares) external {} function operatorDetails(address operator) external pure returns (OperatorDetails memory) { OperatorDetails memory returnValue = OperatorDetails({ @@ -63,6 +70,8 @@ contract DelegationManagerMock is IDelegationManager, Test { return returnValue; } + function operatorAllocationDelay(address operator) external view returns (AllocationDelayDetails memory) {} + function delegationApprover(address operator) external pure returns (address) { return operator; } @@ -85,16 +94,13 @@ contract DelegationManagerMock is IDelegationManager, Test { function strategyWithdrawalDelayBlocks(IStrategy /*strategy*/) external pure returns (uint256) { return 0; } - - function getOperatorShares( - address operator, - IStrategy[] memory strategies - ) external view returns (uint256[] memory) {} function getWithdrawalDelay(IStrategy[] calldata /*strategies*/) public pure returns (uint256) { return 0; } + function operatorScaledShares(address operator, IStrategy strategy) external view returns (uint256) {} + function isDelegated(address staker) external view returns (bool) { return (delegatedTo[staker] != address(0)); } @@ -155,14 +161,12 @@ contract DelegationManagerMock is IDelegationManager, Test { function completeQueuedWithdrawal( Withdrawal calldata withdrawal, IERC20[] calldata tokens, - uint256 middlewareTimesIndex, bool receiveAsTokens ) external {} function completeQueuedWithdrawals( Withdrawal[] calldata withdrawals, IERC20[][] calldata tokens, - uint256[] calldata middlewareTimesIndexes, bool[] calldata receiveAsTokens ) external {} diff --git a/src/test/mocks/EigenPodManagerMock.sol b/src/test/mocks/EigenPodManagerMock.sol index 127fcc49a..855fc54e6 100644 --- a/src/test/mocks/EigenPodManagerMock.sol +++ b/src/test/mocks/EigenPodManagerMock.sol @@ -41,6 +41,10 @@ contract EigenPodManagerMock is IEigenPodManager, Test, Pausable { return false; } + function podOwnerScaledShares(address podOwner) external view returns (int256) { + return podShares[podOwner]; + } + function podOwnerShares(address podOwner) external view returns (int256) { return podShares[podOwner]; } @@ -49,9 +53,9 @@ contract EigenPodManagerMock is IEigenPodManager, Test, Pausable { podShares[podOwner] = shares; } - function addShares(address /*podOwner*/, uint256 shares) external pure returns (uint256) { + function addShares(address /*podOwner*/, uint256 shares) external pure returns (uint256, uint256) { // this is the "increase in delegateable tokens" - return (shares); + // return (shares); } function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) external {} diff --git a/src/test/mocks/StrategyManagerMock.sol b/src/test/mocks/StrategyManagerMock.sol index cefd175fa..14f2d1a74 100644 --- a/src/test/mocks/StrategyManagerMock.sol +++ b/src/test/mocks/StrategyManagerMock.sol @@ -66,9 +66,6 @@ contract StrategyManagerMock is external returns (uint256 shares) {} - /// @notice Returns the current shares of `user` in `strategy` - function stakerStrategyShares(address user, IStrategy strategy) external view returns (uint256 shares) {} - /** * @notice mocks the return value of getDeposits * @param staker staker whose deposits are being mocked @@ -98,6 +95,13 @@ contract StrategyManagerMock is function stakerStrats(address staker) external view returns (IStrategy[] memory) {} uint256 public stakerStrategyListLengthReturnValue; + + /// @notice Returns the current shares of `user` in `strategy` + function stakerStrategyShares( + address user, + IStrategy strategy + ) external view returns (uint256 shares) {} + /// @notice Simple getter function that returns `stakerStrategyList[staker].length`. function stakerStrategyListLength(address /*staker*/) external view returns (uint256) { return stakerStrategyListLengthReturnValue; @@ -113,7 +117,7 @@ contract StrategyManagerMock is function removeShares(address staker, IStrategy strategy, uint256 shares) external {} - function addShares(address staker, IERC20 token, IStrategy strategy, uint256 shares) external {} + function addShares(address staker, IERC20 token, IStrategy strategy, uint256 shares) external returns (uint256 existingShares) {} function withdrawSharesAsTokens(address recipient, IStrategy strategy, uint256 shares, IERC20 token) external {} diff --git a/src/test/unit/AVSDirectoryUnit.t.sol b/src/test/unit/AVSDirectoryUnit.t.sol index 6fd70891f..3139f6ae9 100644 --- a/src/test/unit/AVSDirectoryUnit.t.sol +++ b/src/test/unit/AVSDirectoryUnit.t.sol @@ -4,11 +4,14 @@ pragma solidity ^0.8.12; import "@openzeppelin/contracts/mocks/ERC1271WalletMock.sol"; import "src/contracts/core/DelegationManager.sol"; +import "src/contracts/core/AllocationManager.sol"; import "src/contracts/core/AVSDirectory.sol"; import "src/test/events/IAVSDirectoryEvents.sol"; import "src/test/utils/EigenLayerUnitTestSetup.sol"; +contract EmptyContract {} + /** * @notice Unit testing of the AVSDirectory contract. An AVSs' service manager contract will * call this to register an operator with the AVS. @@ -16,6 +19,10 @@ import "src/test/utils/EigenLayerUnitTestSetup.sol"; * Contracts not mocked: DelegationManager */ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents { + uint256 internal constant MAX_PRIVATE_KEY = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140; + + EmptyContract emptyContract; + // Contract under test AVSDirectory avsDirectory; AVSDirectory avsDirectoryImplementation; @@ -23,6 +30,8 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents { // Contract dependencies DelegationManager delegationManager; DelegationManager delegationManagerImplementation; + AllocationManager allocationManager; + AllocationManager allocationManagerImplementation; // Delegation signer uint256 delegationSignerPrivateKey = uint256(0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80); @@ -40,6 +49,8 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents { // Index for flag that pauses registering/deregistering for AVSs uint8 internal constant PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS = 0; + // Index for flag that pauses operator register/deregister to operator sets when set. + uint8 internal constant PAUSER_OPERATOR_REGISTER_DEREGISTER_TO_OPERATOR_SETS = 1; function setUp() public virtual override { // Setup @@ -48,7 +59,31 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents { // Deploy DelegationManager implmentation and proxy initializeStrategiesToSetDelayBlocks = new IStrategy[](0); initializeWithdrawalDelayBlocks = new uint256[](0); - delegationManagerImplementation = new DelegationManager(strategyManagerMock, slasherMock, eigenPodManagerMock); + + emptyContract = new EmptyContract(); + + avsDirectory = AVSDirectory( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + delegationManager = DelegationManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + allocationManager = AllocationManager( + address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), "")) + ); + + allocationManagerImplementation = new AllocationManager(delegationManager, avsDirectory); + + delegationManagerImplementation = new DelegationManager( + strategyManagerMock, + slasherMock, + eigenPodManagerMock, + avsDirectory, + allocationManager + ); + + avsDirectoryImplementation = new AVSDirectory(delegationManager); + delegationManager = DelegationManager( address( new TransparentUpgradeableProxy( @@ -67,8 +102,6 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents { ) ); - // Deploy AVSDirectory implmentation and proxy - avsDirectoryImplementation = new AVSDirectory(delegationManager); avsDirectory = AVSDirectory( address( new TransparentUpgradeableProxy( @@ -93,11 +126,11 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents { */ /** - * @notice internal function for calculating a signature from the operator corresponding to `_operatorPrivateKey`, delegating them to + * @notice internal function for calculating a signature from the operator corresponding to `operatorPk`, delegating them to * the `operator`, and expiring at `expiry`. */ - function _getOperatorSignature( - uint256 _operatorPrivateKey, + function _getOperatorAVSRegistrationSignature( + uint256 operatorPk, address operator, address avs, bytes32 salt, @@ -107,7 +140,7 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents { operatorSignature.salt = salt; { bytes32 digestHash = avsDirectory.calculateOperatorAVSRegistrationDigestHash(operator, avs, salt, expiry); - (uint8 v, bytes32 r, bytes32 s) = cheats.sign(_operatorPrivateKey, digestHash); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign(operatorPk, digestHash); operatorSignature.signature = abi.encodePacked(r, s, v); } return operatorSignature; @@ -156,7 +189,7 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents { ) internal filterFuzzedAddressInputs(operator) { _filterOperatorDetails(operator, operatorDetails); cheats.prank(operator); - delegationManager.registerAsOperator(operatorDetails, metadataURI); + delegationManager.registerAsOperator(operatorDetails, 0,metadataURI); } function _filterOperatorDetails( @@ -168,21 +201,1087 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents { // filter out disallowed stakerOptOutWindowBlocks values cheats.assume(operatorDetails.stakerOptOutWindowBlocks <= delegationManager.MAX_STAKER_OPT_OUT_WINDOW_BLOCKS()); } + + function _registerOperatorToOperatorSet( + uint256 operatorPk, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) internal virtual { + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + _registerOperatorToOperatorSets(operatorPk, oids, salt, expiry); + } + + function _registerOperatorToOperatorSets( + uint256 operatorPk, + uint32[] memory operatorSetIds, + bytes32 salt, + uint256 expiry + ) internal virtual { + expiry = bound(expiry, 1, type(uint256).max); + cheats.warp(0); + + address operator = cheats.addr(operatorPk); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + operatorPk, + avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), operatorSetIds, salt, expiry) + ); + + // Set AVS as operator set avs + avsDirectory.becomeOperatorSetAVS(); + + _registerOperatorWithBaseDetails(operator); + + avsDirectory.registerOperatorToOperatorSets( + operator, + operatorSetIds, + ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt, expiry) + ); + } + + function _createOperatorSet(uint32 operatorSetId) internal { + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + avsDirectory.createOperatorSets(oids); + } + + function _createOperatorSets(uint32[] memory operatorSetIds) internal { + avsDirectory.createOperatorSets(operatorSetIds); + } +} + +contract AVSDirectoryUnitTests_initialize is AVSDirectoryUnitTests { + function testFuzz_Correctness( + address delegationManager, + address owner, + address pauserRegistry, + uint256 initialPausedStatus + ) public virtual { + AVSDirectory dir = new AVSDirectory(IDelegationManager(delegationManager)); + + assertEq(address(dir.delegation()), delegationManager); + + cheats.expectRevert("Initializable: contract is already initialized"); + dir.initialize(owner, IPauserRegistry(pauserRegistry), initialPausedStatus); + } +} + +contract AVSDirectoryUnitTests_domainSeparator is AVSDirectoryUnitTests { + function test_domainSeparator() public virtual { + // This is just to get coverage up. + avsDirectory.domainSeparator(); + cheats.chainId(0xC0FFEE); + avsDirectory.domainSeparator(); + } +} + +contract AVSDirectoryUnitTests_registerOperatorToOperatorSet is AVSDirectoryUnitTests { + function testFuzz_revert_SignatureIsExpired( + address operator, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) public virtual { + expiry = bound(expiry, 0, type(uint256).max - 1); + cheats.warp(type(uint256).max); + + _createOperatorSet(operatorSetId); + + _registerOperatorWithBaseDetails(operator); + + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + cheats.expectRevert("AVSDirectory.registerOperatorToOperatorSets: operator signature expired"); + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(new bytes(0), salt, expiry) + ); + } + + function testFuzz_revert_notOperatorSetAVS( + uint256 operatorPk, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) public virtual { + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + expiry = bound(expiry, 1, type(uint256).max); + + cheats.warp(0); + + _createOperatorSet(operatorSetId); + + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + address operator = cheats.addr(operatorPk); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + operatorPk, avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), oids, salt, expiry) + ); + + _registerOperatorWithBaseDetails(operator); + + cheats.expectRevert("AVSDirectory.registerOperatorToOperatorSets: AVS is not an operator set AVS"); + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt, expiry) + ); + } + + function testFuzz_revert_OperatorRegistered( + uint256 operatorPk, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) public virtual { + avsDirectory.becomeOperatorSetAVS(); + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + expiry = bound(expiry, 1, type(uint256).max); + + cheats.warp(0); + + _createOperatorSet(operatorSetId); + + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + address operator = cheats.addr(operatorPk); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + operatorPk, avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), oids, salt, expiry) + ); + + _registerOperatorWithBaseDetails(operator); + + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt, expiry) + ); + + (v, r, s) = cheats.sign( + operatorPk, + avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), oids, keccak256(""), expiry) + ); + + cheats.expectRevert("AVSDirectory._registerOperatorToOperatorSets: operator already registered to operator set"); + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), keccak256(""), expiry) + ); + } + + function testFuzz_revert_OperatorNotRegistered( + address operator, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) public virtual { + avsDirectory.becomeOperatorSetAVS(); + cheats.assume(operator != address(0)); + expiry = bound(expiry, 1, type(uint256).max); + cheats.warp(0); + + _createOperatorSet(operatorSetId); + + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + cheats.expectRevert("AVSDirectory.registerOperatorToOperatorSets: operator not registered to EigenLayer yet"); + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(new bytes(0), salt, expiry) + ); + } + + function testFuzz_revert_SaltSpent( + uint256 operatorPk, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) public virtual { + avsDirectory.becomeOperatorSetAVS(); + operatorSetId = uint32(bound(operatorSetId, 1, type(uint32).max)); + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + expiry = bound(expiry, 1, type(uint256).max); + + cheats.warp(0); + + _createOperatorSet(operatorSetId); + + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + address operator = cheats.addr(operatorPk); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + operatorPk, avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), oids, salt, expiry) + ); + + _registerOperatorWithBaseDetails(operator); + + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt, expiry) + ); + + cheats.expectRevert("AVSDirectory.registerOperatorToOperatorSets: salt already spent"); + avsDirectory.registerOperatorToOperatorSets( + operator, new uint32[](0), ISignatureUtils.SignatureWithSaltAndExpiry(new bytes(0), salt, expiry) + ); + } + + function testFuzz_revert_WrongAVS( + address badAvs, + uint256 operatorPk, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) public virtual { + cheats.assume(badAvs != address(this)); + + operatorSetId = uint32(bound(operatorSetId, 1, type(uint32).max)); + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + expiry = bound(expiry, 1, type(uint256).max); + + cheats.warp(0); + + _createOperatorSet(operatorSetId); + + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + address operator = cheats.addr(operatorPk); + + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + operatorPk, avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), oids, salt, expiry) + ); + + _registerOperatorWithBaseDetails(operator); + + cheats.startPrank(badAvs); + avsDirectory.becomeOperatorSetAVS(); + cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: signature not from signer"); + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt, expiry) + ); + cheats.stopPrank(); + } + + function testFuzz_revert_invalidOperatorSet( + uint256 operatorPk, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) public virtual { + avsDirectory.becomeOperatorSetAVS(); + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + expiry = bound(expiry, 1, type(uint256).max); + + cheats.warp(0); + + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + address operator = cheats.addr(operatorPk); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + operatorPk, avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), oids, salt, expiry) + ); + + _registerOperatorWithBaseDetails(operator); + + cheats.expectRevert("AVSDirectory._registerOperatorToOperatorSets: invalid operator set"); + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt, expiry) + ); + } + + function testFuzz_MultipleCorrectness( + uint256 operatorPk, + uint256 totalSets, + bytes32 salt, + uint256 expiry + ) public virtual { + avsDirectory.becomeOperatorSetAVS(); + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + totalSets = bound(totalSets, 1, 64); + expiry = bound(expiry, 1, type(uint256).max); + + cheats.warp(0); + + uint32[] memory oids = new uint32[](totalSets); + for (uint256 i; i < oids.length; ++i) { + oids[i] = uint32(uint256(keccak256(abi.encodePacked(i))) % type(uint32).max); + _createOperatorSet(oids[i]); + } + + address operator = cheats.addr(operatorPk); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + operatorPk, avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), oids, salt, expiry) + ); + + _registerOperatorWithBaseDetails(operator); + + for (uint256 i; i < oids.length; ++i) { + cheats.expectEmit(true, false, false, false, address(avsDirectory)); + emit OperatorAddedToOperatorSet(operator, OperatorSet(address(this), oids[i])); + } + + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt, expiry) + ); + + OperatorSet[] memory operatorSets = + avsDirectory.getOperatorSetsOfOperator(operator, 0, type(uint256).max); + + for (uint256 i; i < oids.length; ++i) { + assertTrue(avsDirectory.isMember(operator, OperatorSet(address(this), oids[i]))); + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), oids[i])), 1); + assertEq(operatorSets[i].avs, address(this)); + assertEq(operatorSets[i].operatorSetId, oids[i]); + } + + for (uint256 i; i < oids.length; ++i) { + address[] memory operators = avsDirectory.getOperatorsInOperatorSet(OperatorSet(address(this), oids[i]), 0, type(uint256).max); + assertEq(operators.length, 1); + assertEq(operators[0], operator); + } + + assertEq(operatorSets.length, totalSets); + assertEq(avsDirectory.inTotalOperatorSets(operator), totalSets); + assertTrue(avsDirectory.operatorSaltIsSpent(operator, salt)); + } + + function testFuzz_Correctness( + uint256 operatorPk, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) public virtual { + avsDirectory.becomeOperatorSetAVS(); + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + expiry = bound(expiry, 1, type(uint256).max); + + cheats.warp(0); + + _createOperatorSet(operatorSetId); + + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + address operator = cheats.addr(operatorPk); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + operatorPk, avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), oids, salt, expiry) + ); + + _registerOperatorWithBaseDetails(operator); + + cheats.expectEmit(true, false, false, false, address(avsDirectory)); + emit OperatorAddedToOperatorSet(operator, OperatorSet(address(this), operatorSetId)); + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt, expiry) + ); + + assertTrue(avsDirectory.isMember(operator, OperatorSet(address(this), operatorSetId))); + + OperatorSet memory operatorSet = avsDirectory.operatorSetsMemberOfAtIndex(operator, 0); + + assertEq(operatorSet.avs, address(this)); + assertEq(operatorSet.operatorSetId, oids[0]); + + address operatorInSet = avsDirectory.operatorSetMemberAtIndex(OperatorSet(address(this), operatorSetId), 0); + assertEq(operator, operatorInSet); + + assertEq(avsDirectory.inTotalOperatorSets(operator), 1); + assertTrue(avsDirectory.operatorSaltIsSpent(operator, salt)); + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), operatorSetId)), 1); + } + + function testFuzz_Correctness_MultipleSets( + uint256 operatorPk, + uint256 totalSets, + bytes32 salt, + uint256 expiry + ) public virtual { + avsDirectory.becomeOperatorSetAVS(); + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + totalSets = bound(totalSets, 1, 64); + expiry = bound(expiry, 1, type(uint256).max); + + cheats.warp(0); + + uint32[] memory oids = new uint32[](totalSets); + + for (uint32 i = 1; i < totalSets + 1; ++i) { + _createOperatorSet(i); + oids[i - 1] = i; + } + + address operator = cheats.addr(operatorPk); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + operatorPk, avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), oids, salt, expiry) + ); + + _registerOperatorWithBaseDetails(operator); + + for (uint32 i = 1; i < totalSets + 1; ++i) { + cheats.expectEmit(true, false, false, false, address(avsDirectory)); + emit OperatorAddedToOperatorSet(operator, OperatorSet(address(this), i)); + } + + avsDirectory.registerOperatorToOperatorSets( + operator, oids, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt, expiry) + ); + + OperatorSet[] memory operatorSets = + avsDirectory.getOperatorSetsOfOperator(operator, 0, type(uint256).max); + + for (uint32 i = 1; i < totalSets + 1; ++i) { + assertTrue(avsDirectory.isMember(operator, OperatorSet(address(this), i))); + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), i)), 1); + + assertEq(operatorSets[i - 1].avs, address(this)); + assertEq(operatorSets[i - 1].operatorSetId, i); + } + + for(uint32 i = 1; i < totalSets + 1; ++i) { + address[] memory operators = avsDirectory.getOperatorsInOperatorSet(OperatorSet(address(this), i), 0, type(uint256).max); + assertEq(operators.length, 1); + assertEq(operators[0], operator); + } + + assertEq(avsDirectory.inTotalOperatorSets(operator), totalSets); + assertTrue(avsDirectory.operatorSaltIsSpent(operator, salt)); + + assertEq(operatorSets.length, totalSets); + } } -contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUnitTests { +contract AVSDirectoryUnitTests_forceDeregisterFromOperatorSets is AVSDirectoryUnitTests { + function testFuzz_revert_OperatorNotInOperatorSet(uint256 operatorPk, uint32 operatorSetId) public virtual { + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + + address operator = cheats.addr(operatorPk); + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + _createOperatorSet(operatorSetId); + + ISignatureUtils.SignatureWithSaltAndExpiry memory emptySig; + + cheats.prank(operator); + cheats.expectRevert("AVSDirectory._deregisterOperatorFromOperatorSet: operator not registered for operator set"); + + avsDirectory.forceDeregisterFromOperatorSets(operator, address(this), oids, emptySig); + } + + function testFuzz_revert_operatorNotCaller(uint256 operatorPk, uint32 operatorSetId) public { + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + + address operator = cheats.addr(operatorPk); + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + _createOperatorSet(operatorSetId); + + ISignatureUtils.SignatureWithSaltAndExpiry memory emptySig; + + cheats.expectRevert("AVSDirectory.forceDeregisterFromOperatorSets: caller must be operator"); + avsDirectory.forceDeregisterFromOperatorSets(operator, address(this), oids, emptySig); + } + + function testFuzz_forceDeregisterFromOperatorSets( + uint256 operatorPk, + uint32 operatorSetId, + uint8 operatorSetsToAdd, + bytes32 salt + ) public { + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + operatorSetsToAdd = uint8(bound(operatorSetsToAdd, 1, 64)); + address operator = cheats.addr(operatorPk); + + // Create operator sets + operatorSetId = uint32(bound(operatorSetId, 1, type(uint32).max - uint32(operatorSetsToAdd))); + uint32[] memory oids = new uint32[](operatorSetsToAdd); + for (uint32 i = 0; i < operatorSetsToAdd; i++) { + oids[i] = operatorSetId + i; + _createOperatorSet(oids[i]); + } + + // Register operator to operator sets + _registerOperatorToOperatorSets(operatorPk, oids, salt, type(uint256).max); + + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), operatorSetId)), 1); + + // Deregister operator from operator sets + ISignatureUtils.SignatureWithSaltAndExpiry memory emptySig; + cheats.prank(operator); + for (uint256 i = 0; i < oids.length; i++) { + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorRemovedFromOperatorSet(operator, OperatorSet(address(this), oids[i])); + } + avsDirectory.forceDeregisterFromOperatorSets(operator, address(this), oids, emptySig); + + for (uint32 i = 0; i < operatorSetsToAdd; i++) { + assertFalse( + avsDirectory.isMember(operator, OperatorSet(address(this), oids[i])), + "operator still in operator set" + ); + + address[] memory operators = avsDirectory.getOperatorsInOperatorSet(OperatorSet(address(this), oids[i]), 0, type(uint256).max); + assertEq(operators.length, 0); + } + + OperatorSet[] memory operatorSets = + avsDirectory.getOperatorSetsOfOperator(operator, 0, type(uint256).max); + + assertEq(operatorSets.length, 0); + assertEq(avsDirectory.inTotalOperatorSets(operator), 0); + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), operatorSetId)), 0); + } + + function testFuzz_revert_sigExpired(uint256 operatorPk, uint32 operatorSetId, bytes32 salt) public { + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + + address operator = cheats.addr(operatorPk); + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + _createOperatorSet(operatorSetId); + + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSig = + _createForceDeregSignature(operatorPk, address(this), oids, 0, salt); + + cheats.warp(type(uint256).max); + cheats.expectRevert("AVSDirectory.forceDeregisterFromOperatorSets: operator signature expired"); + avsDirectory.forceDeregisterFromOperatorSets(operator, address(this), oids, operatorSig); + } + + function testFuzz_revert_saltAlreadySpent(uint256 operatorPk, uint32 operatorSetId, bytes32 salt) public { + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + + address operator = cheats.addr(operatorPk); + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + // Register operator to operator sets + _createOperatorSet(operatorSetId); + _registerOperatorToOperatorSets(operatorPk, oids, salt, type(uint256).max); + + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSig = + _createForceDeregSignature(operatorPk, address(this), oids, type(uint256).max, salt); + + cheats.expectRevert("AVSDirectory.forceDeregisterFromOperatorSets: salt already spent"); + avsDirectory.forceDeregisterFromOperatorSets(operator, address(this), oids, operatorSig); + } + + function testFuzz_forceDeregisterFromOperatorSets_onBehalf( + uint256 operatorPk, + uint32 operatorSetId, + uint8 operatorSetsToAdd, + bytes32 salt1, + bytes32 salt2 + ) public { + cheats.assume(salt1 != salt2); + + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + operatorSetsToAdd = uint8(bound(operatorSetsToAdd, 1, 64)); + address operator = cheats.addr(operatorPk); + + // Create operator sets + operatorSetId = uint32(bound(operatorSetId, 1, type(uint32).max - uint32(operatorSetsToAdd))); + uint32[] memory oids = new uint32[](operatorSetsToAdd); + for (uint32 i = 0; i < oids.length; i++) { + oids[i] = operatorSetId + i; + _createOperatorSet(oids[i]); + } + + // Register operator to operator sets + _registerOperatorToOperatorSets(operatorPk, oids, salt1, type(uint256).max); + + // Deregister operator from operator sets + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSig = + _createForceDeregSignature(operatorPk, address(this), oids, type(uint256).max, salt2); + + for (uint256 i = 0; i < oids.length; i++) { + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorRemovedFromOperatorSet(operator, OperatorSet(address(this), oids[i])); + } + + avsDirectory.forceDeregisterFromOperatorSets(operator, address(this), oids, operatorSig); + + for (uint32 i = 0; i < operatorSetsToAdd; i++) { + assertFalse(avsDirectory.isMember(operator, OperatorSet(address(this), oids[i]))); + } + } + + function _createForceDeregSignature( + uint256 operatorPk, + address avs, + uint32[] memory oids, + uint256 expiry, + bytes32 salt + ) internal view returns (ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature) { + operatorSignature.expiry = expiry; + operatorSignature.salt = salt; + { + bytes32 digestHash = avsDirectory.calculateOperatorSetForceDeregistrationTypehash(avs, oids, salt, expiry); + (uint8 v, bytes32 r, bytes32 s) = cheats.sign(operatorPk, digestHash); + operatorSignature.signature = abi.encodePacked(r, s, v); + } + return operatorSignature; + } +} + +contract AVSDirectoryUnitTests_deregisterOperatorFromOperatorSets is AVSDirectoryUnitTests { + function testFuzz_revert_OperatorNotInOperatorSet(uint256 operatorPk, uint32 operatorSetId) public virtual { + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + + _createOperatorSet(operatorSetId); + + address operator = cheats.addr(operatorPk); + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + cheats.expectRevert("AVSDirectory._deregisterOperatorFromOperatorSet: operator not registered for operator set"); + avsDirectory.deregisterOperatorFromOperatorSets(operator, oids); + } + + function testFuzz_Correctness( + uint256 operatorPk, + uint32 operatorSetId, + bytes32 salt, + uint256 expiry + ) public virtual { + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + + _createOperatorSet(operatorSetId); + + _registerOperatorToOperatorSet(operatorPk, operatorSetId, salt, expiry); + + address operator = cheats.addr(operatorPk); + uint32[] memory oids = new uint32[](1); + oids[0] = operatorSetId; + + // sanity + assertEq(avsDirectory.inTotalOperatorSets(operator), 1); + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), operatorSetId)), 1); + + cheats.expectEmit(true, false, false, false, address(avsDirectory)); + emit OperatorRemovedFromOperatorSet(operator, OperatorSet(address(this), operatorSetId)); + + avsDirectory.deregisterOperatorFromOperatorSets(operator, oids); + + // out of bounds array access + vm.expectRevert(); + avsDirectory.operatorSetsMemberOfAtIndex(operator, 0); + + assertEq(avsDirectory.inTotalOperatorSets(operator), 0); + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), operatorSetId)), 0); + assertEq(avsDirectory.isMember(operator, OperatorSet(address(this), operatorSetId)), false); + } + + function testFuzz_Correctness_MultipleSets( + uint256 operatorPk, + uint256 totalSets, + bytes32 salt, + uint256 expiry + ) public virtual { + operatorPk = bound(operatorPk, 1, MAX_PRIVATE_KEY); + totalSets = bound(totalSets, 1, 64); + + uint32[] memory oids = new uint32[](totalSets); + + for (uint32 i = 1; i < totalSets + 1; ++i) { + _createOperatorSet(i); + oids[i - 1] = i; + } + + _registerOperatorToOperatorSets(operatorPk, oids, salt, expiry); + + for (uint32 i = 1; i < totalSets + 1; ++i) { + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), i)), 1); + } + + address operator = cheats.addr(operatorPk); + + // sanity + assertEq(avsDirectory.inTotalOperatorSets(operator), totalSets); + + for (uint32 i = 1; i < totalSets + 1; ++i) { + cheats.expectEmit(true, false, false, false, address(avsDirectory)); + emit OperatorRemovedFromOperatorSet(operator, OperatorSet(address(this), i)); + } + + avsDirectory.deregisterOperatorFromOperatorSets(operator, oids); + + for (uint32 i = 1; i < totalSets + 1; ++i) { + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), i)), 0); + assertEq(avsDirectory.isMember(operator, OperatorSet(address(this), i)), false); + } + + OperatorSet[] memory operatorSets = + avsDirectory.getOperatorSetsOfOperator(operator, 0, type(uint256).max); + + assertEq(operatorSets.length, 0); + assertEq(avsDirectory.inTotalOperatorSets(operator), 0); + } +} + +contract AVSDirectoryUnitTests_createOperatorSet is AVSDirectoryUnitTests { + function testFuzz_createOperatorSet(uint256 totalSets) public { + totalSets = bound(totalSets, 1, 64); + + uint32[] memory oids = new uint32[](totalSets); + + for (uint32 i; i < totalSets; ++i) { + oids[i] = i + 1; + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorSetCreated(OperatorSet({avs: address(this), operatorSetId: i + 1})); + } + + avsDirectory.createOperatorSets(oids); + + for (uint32 i = 1; i < totalSets + 1; ++i) { + assertTrue(avsDirectory.isOperatorSet(address(this), i)); + } + } + + function test_revert_operatorSetExists() public { + _createOperatorSet(1); + cheats.expectRevert("AVSDirectory.createOperatorSet: operator set already exists"); + _createOperatorSet(1); + } +} + +contract AVSDirectoryUnitTests_becomeOperatorSetAVS is AVSDirectoryUnitTests { + function test_becomeOperatorSetAVS() public { + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit AVSMigratedToOperatorSets(address(this)); + + avsDirectory.becomeOperatorSetAVS(); + + assertTrue(avsDirectory.isOperatorSetAVS(address(this))); + } + + function test_revert_alreadyOperatorSetAVS() public { + avsDirectory.becomeOperatorSetAVS(); + cheats.expectRevert("AVSDirectory.becomeOperatorSetAVS: already an operator set AVS"); + avsDirectory.becomeOperatorSetAVS(); + } +} + +contract AVSDirectoryUnitTests_migrateOperatorsToOperatorSets is AVSDirectoryUnitTests { + address[] operators = new address[](1); + uint32[][] operatorSetIds = new uint32[][](1); + + function test_revert_paused() public { + cheats.prank(pauser); + avsDirectory.pause(2 ** PAUSER_OPERATOR_REGISTER_DEREGISTER_TO_OPERATOR_SETS); + + operators = new address[](1); + operatorSetIds = new uint32[][](1); + + cheats.expectRevert("Pausable: index is paused"); + cheats.prank(defaultAVS); + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + } + + function test_revert_notOperatorSetAVS() public { + cheats.expectRevert("AVSDirectory.migrateOperatorsToOperatorSets: AVS is not an operator set AVS"); + cheats.prank(defaultAVS); + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + } + + function test_revert_operatorNotM2Registered() public { + address operator = cheats.addr(delegationSignerPrivateKey); + operators = new address[](1); + operators[0] = operator; + + avsDirectory.becomeOperatorSetAVS(); + cheats.expectRevert( + "AVSDirectory.migrateOperatorsToOperatorSets: operator already migrated or not a legacy registered operator" + ); + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + } + + function test_revert_operatorAlreadyMigrated(bytes32 salt) public { + // Register Operator to M2 + address operator = cheats.addr(delegationSignerPrivateKey); + _registerOperatorLegacyM2(delegationSignerPrivateKey, salt); + + // Format calldata + operators = new address[](1); + operators[0] = operator; + operatorSetIds = new uint32[][](1); + operatorSetIds[0] = new uint32[](1); + operatorSetIds[0][0] = 1; + + // Setup Operator Sets + _createOperatorSet(1); + avsDirectory.becomeOperatorSetAVS(); + + // Migrate Operator + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + + // Revert when trying to migrate operator again + cheats.expectRevert( + "AVSDirectory.migrateOperatorsToOperatorSets: operator already migrated or not a legacy registered operator" + ); + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + } + + function testFuzz_revert_invalidOperatorSet(bytes32 salt) public { + // Register Operator to M2 + address operator = cheats.addr(delegationSignerPrivateKey); + _registerOperatorLegacyM2(delegationSignerPrivateKey, salt); + + // Format calldata + operators = new address[](1); + operators[0] = operator; + operatorSetIds = new uint32[][](1); + operatorSetIds[0] = new uint32[](1); + operatorSetIds[0][0] = 1; + + // Become operator set AVS + avsDirectory.becomeOperatorSetAVS(); + + // Revert + cheats.expectRevert("AVSDirectory._registerOperatorToOperatorSets: invalid operator set"); + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + } + + function testFuzz_revert_operatorAlreadyRegisteredFromMigration(bytes32 salt) public { + // Register Operator to M2 + address operator = cheats.addr(delegationSignerPrivateKey); + _registerOperatorLegacyM2(delegationSignerPrivateKey, salt); + + // Format calldata + operators = new address[](1); + operators[0] = operator; + operatorSetIds = new uint32[][](1); + operatorSetIds[0] = new uint32[](2); + operatorSetIds[0][0] = 1; + operatorSetIds[0][1] = 1; + + // Become operator set AVS + _createOperatorSet(1); + avsDirectory.becomeOperatorSetAVS(); + + // Revert + cheats.expectRevert("AVSDirectory._registerOperatorToOperatorSets: operator already registered to operator set"); + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + } + + function testFuzz_revert_operatorAlreadyRegisteredFromNormalReg(bytes32 salt1, bytes32 salt2) public { + // Register Operator to M2 + address operator = cheats.addr(delegationSignerPrivateKey); + _registerOperatorLegacyM2(delegationSignerPrivateKey, salt1); + + // Format calldata + operators = new address[](1); + operators[0] = operator; + operatorSetIds = new uint32[][](1); + operatorSetIds[0] = new uint32[](1); + operatorSetIds[0][0] = 1; + + // Register Operator To Operator Set - cannot use helper method since it re-registers operator in DM + avsDirectory.becomeOperatorSetAVS(); + _createOperatorSet(1); + uint256 expiry = type(uint256).max; + (uint8 v, bytes32 r, bytes32 s) = cheats.sign( + delegationSignerPrivateKey, + avsDirectory.calculateOperatorSetRegistrationDigestHash(address(this), operatorSetIds[0], salt2, expiry) + ); + avsDirectory.registerOperatorToOperatorSets( + operator, + operatorSetIds[0], + ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), salt2, expiry) + ); + + // Revert + cheats.expectRevert("AVSDirectory._registerOperatorToOperatorSets: operator already registered to operator set"); + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + } + + function testFuzz_Correctness(bytes32 salt) public { + // Register Operator to M2 + address operator = cheats.addr(delegationSignerPrivateKey); + _registerOperatorLegacyM2(delegationSignerPrivateKey, salt); + + // Format calldata + operators = new address[](1); + operators[0] = operator; + operatorSetIds = new uint32[][](1); + operatorSetIds[0] = new uint32[](1); + operatorSetIds[0][0] = 1; + + // Become operator set AVS + avsDirectory.becomeOperatorSetAVS(); + _createOperatorSet(1); + + // Expect Emits + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorAddedToOperatorSet(operator, OperatorSet(address(this), 1)); + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorAVSRegistrationStatusUpdated( + operator, address(this), IAVSDirectory.OperatorAVSRegistrationStatus.UNREGISTERED + ); + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorMigratedToOperatorSets(operator, address(this), operatorSetIds[0]); + + // Migrate + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + + // Checks + assertTrue(avsDirectory.isMember(operator, OperatorSet(address(this), 1))); + assertTrue( + avsDirectory.avsOperatorStatus(address(this), operator) + == IAVSDirectory.OperatorAVSRegistrationStatus.UNREGISTERED + ); + assertEq(avsDirectory.getNumOperatorsInOperatorSet(OperatorSet(address(this), 1)), 1); + } + + function testFuzz_correctness_multiple( + uint256 privateKey, + uint8 numOperators, + bytes32 salt, + uint8 numOids + ) public { + numOperators = uint8(bound(numOperators, 1, 64)); + numOids = uint8(bound(numOids, 1, 32)); + + // Create Operator Set IDs + uint32[] memory oids = new uint32[](numOids); + for (uint32 i = 0; i < numOids; i++) { + oids[i] = i; + } + + // Create Operators, Initailize Calldata, Register Operators + privateKey = bound(privateKey, 1, MAX_PRIVATE_KEY - numOperators); + operators = new address[](numOperators); + operatorSetIds = new uint32[][](numOperators); + for (uint256 i = 0; i < numOperators; i++) { + _registerOperatorLegacyM2(privateKey + i, salt); + operators[i] = cheats.addr(privateKey + i); + operatorSetIds[i] = oids; + } + + // Become operator set AVS + avsDirectory.becomeOperatorSetAVS(); + _createOperatorSets(oids); + + // Expect Emits + for (uint256 i = 0; i < numOperators; i++) { + for (uint256 j = 0; j < oids.length; j++) { + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorAddedToOperatorSet(operators[i], OperatorSet(address(this), oids[j])); + } + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorAVSRegistrationStatusUpdated( + operators[i], address(this), IAVSDirectory.OperatorAVSRegistrationStatus.UNREGISTERED + ); + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorMigratedToOperatorSets(operators[i], address(this), operatorSetIds[i]); + } + + // Migrate + avsDirectory.migrateOperatorsToOperatorSets(operators, operatorSetIds); + + // Checks + for (uint256 i = 0; i < numOperators; i++) { + for (uint256 j = 0; j < oids.length; j++) { + assertTrue(avsDirectory.isMember(operators[i], OperatorSet(address(this), oids[j]))); + } + assertTrue( + avsDirectory.avsOperatorStatus(address(this), operators[i]) + == IAVSDirectory.OperatorAVSRegistrationStatus.UNREGISTERED + ); + + OperatorSet[] memory opSets = avsDirectory.getOperatorSetsOfOperator(operators[i], 0, type(uint256).max); + assertEq(oids.length, opSets.length); + } + + for(uint256 i = 0; i < oids.length; i++) { + address[] memory operatorsInSet = avsDirectory.getOperatorsInOperatorSet(OperatorSet(address(this), oids[i]), 0, type(uint256).max); + assertEq(operatorsInSet.length, operators.length); + } + } + + function _registerOperatorLegacyM2(uint256 privateKey, bytes32 salt) internal { + address operator = cheats.addr(privateKey); + _registerOperatorWithBaseDetails(operator); + + uint256 expiry = type(uint256).max; + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = + _getOperatorAVSRegistrationSignature(privateKey, operator, address(this), salt, expiry); + + avsDirectory.registerOperatorToAVS(operator, operatorSignature); + } +} + +contract AVSDirectoryUnitTests_legacyOperatorAVSRegistration is AVSDirectoryUnitTests { function test_revert_whenRegisterDeregisterToAVSPaused() public { // set the pausing flag cheats.prank(pauser); avsDirectory.pause(2 ** PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS); cheats.expectRevert("Pausable: index is paused"); - avsDirectory.registerOperatorToAVS(address(0), ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(""), 0, 0)); + avsDirectory.registerOperatorToAVS( + address(0), ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(""), 0, 0) + ); cheats.expectRevert("Pausable: index is paused"); avsDirectory.deregisterOperatorFromAVS(address(0)); } + function test_revert_deregisterOperatorFromAVS_operatorNotRegistered() public { + cheats.expectRevert("AVSDirectory.deregisterOperatorFromAVS: operator not registered"); + avsDirectory.deregisterOperatorFromAVS(address(0)); + } + + function test_revert_deregisterOperatorFromAVS_whenAVSISOperatorSetAVS() public { + // Register operator + bytes32 salt = bytes32(0); + address operator = cheats.addr(delegationSignerPrivateKey); + assertFalse(delegationManager.isOperator(operator), "bad test setup"); + _registerOperatorWithBaseDetails(operator); + + uint256 expiry = type(uint256).max; + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = + _getOperatorAVSRegistrationSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); + + cheats.startPrank(defaultAVS); + avsDirectory.registerOperatorToAVS(operator, operatorSignature); + + // Become operator set AVS + avsDirectory.becomeOperatorSetAVS(); + + // Deregister operator + cheats.expectRevert("AVSDirectory.deregisterOperatorFromAVS: AVS is an operator set AVS"); + avsDirectory.deregisterOperatorFromAVS(operator); + } + + function testFuzz_deregisterOperatorFromAVS(bytes32 salt) public { + address operator = cheats.addr(delegationSignerPrivateKey); + assertFalse(delegationManager.isOperator(operator), "bad test setup"); + _registerOperatorWithBaseDetails(operator); + + uint256 expiry = type(uint256).max; + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = + _getOperatorAVSRegistrationSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); + + cheats.prank(defaultAVS); + avsDirectory.registerOperatorToAVS(operator, operatorSignature); + + cheats.expectEmit(true, true, true, true, address(avsDirectory)); + emit OperatorAVSRegistrationStatusUpdated( + operator, defaultAVS, IAVSDirectory.OperatorAVSRegistrationStatus.UNREGISTERED + ); + + cheats.prank(defaultAVS); + avsDirectory.deregisterOperatorFromAVS(operator); + + assertTrue( + avsDirectory.avsOperatorStatus(defaultAVS, operator) + == IAVSDirectory.OperatorAVSRegistrationStatus.UNREGISTERED + ); + } + // @notice Tests that an avs who calls `updateAVSMetadataURI` will correctly see an `AVSMetadataURIUpdated` event emitted with their input function testFuzz_UpdateAVSMetadataURI(string memory metadataURI) public { // call `updateAVSMetadataURI` and check for event @@ -192,6 +1291,25 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni avsDirectory.updateAVSMetadataURI(metadataURI); } + function testFuzz_revert_whenAVSIsOperatorSetAVS(bytes32 salt) public { + // set the AVS to be an operator set AVS + cheats.prank(defaultAVS); + avsDirectory.becomeOperatorSetAVS(); + + // Register Operator to EigenLayer + address operator = cheats.addr(delegationSignerPrivateKey); + assertFalse(delegationManager.isOperator(operator), "bad test setup"); + _registerOperatorWithBaseDetails(operator); + + uint256 expiry = type(uint256).max; + + cheats.prank(defaultAVS); + ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = + _getOperatorAVSRegistrationSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); + cheats.expectRevert("AVSDirectory.registerOperatorToAVS: AVS is an operator set AVS"); + avsDirectory.registerOperatorToAVS(operator, operatorSignature); + } + // @notice Verifies an operator registers successfull to avs and see an `OperatorAVSRegistrationStatusUpdated` event emitted function testFuzz_registerOperatorToAVS(bytes32 salt) public { address operator = cheats.addr(delegationSignerPrivateKey); @@ -207,9 +1325,14 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni cheats.prank(defaultAVS); ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = - _getOperatorSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); + _getOperatorAVSRegistrationSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); avsDirectory.registerOperatorToAVS(operator, operatorSignature); + + assertTrue( + avsDirectory.avsOperatorStatus(defaultAVS, operator) + == IAVSDirectory.OperatorAVSRegistrationStatus.REGISTERED + ); } // @notice Verifies an operator registers successfull to avs and see an `OperatorAVSRegistrationStatusUpdated` event emitted @@ -220,7 +1343,7 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni cheats.prank(defaultAVS); uint256 expiry = type(uint256).max; ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = - _getOperatorSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); + _getOperatorAVSRegistrationSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); cheats.expectRevert("AVSDirectory.registerOperatorToAVS: operator not registered to EigenLayer yet"); avsDirectory.registerOperatorToAVS(operator, operatorSignature); @@ -234,7 +1357,7 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni uint256 expiry = type(uint256).max; ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = - _getOperatorSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); + _getOperatorAVSRegistrationSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: signature not from signer"); cheats.prank(operator); @@ -242,9 +1365,9 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni } // @notice Verifies an operator registers fails when the signature expiry already expires - function testFuzz_revert_whenExpiryHasExpired( - ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature - ) public { + function testFuzz_revert_whenExpiryHasExpired(ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature) + public + { address operator = cheats.addr(delegationSignerPrivateKey); operatorSignature.expiry = bound(operatorSignature.expiry, 0, block.timestamp - 1); @@ -260,7 +1383,7 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni uint256 expiry = type(uint256).max; ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = - _getOperatorSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); + _getOperatorAVSRegistrationSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); cheats.startPrank(defaultAVS); avsDirectory.registerOperatorToAVS(operator, operatorSignature); @@ -283,10 +1406,14 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni avsDirectory.cancelSalt(salt); assertTrue(avsDirectory.operatorSaltIsSpent(operator, salt), "salt was not successfully cancelled"); - assertFalse(avsDirectory.operatorSaltIsSpent(defaultAVS, salt), "salt should only be cancelled for the operator"); + assertFalse( + avsDirectory.operatorSaltIsSpent(defaultAVS, salt), "salt should only be cancelled for the operator" + ); - bytes32 newSalt; - unchecked { newSalt = bytes32(uint(salt) + 1); } + bytes32 newSalt; + unchecked { + newSalt = bytes32(uint256(salt) + 1); + } assertFalse(salt == newSalt, "bad test setup"); @@ -305,7 +1432,7 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni uint256 expiry = type(uint256).max; ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = - _getOperatorSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); + _getOperatorAVSRegistrationSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); cheats.prank(operator); avsDirectory.cancelSalt(salt); @@ -315,20 +1442,6 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni avsDirectory.registerOperatorToAVS(operator, operatorSignature); } - /// @notice Verifies that an operator cannot cancel the same salt twice - function testFuzz_revert_whenSaltCancelledTwice(bytes32 salt) public { - address operator = cheats.addr(delegationSignerPrivateKey); - assertFalse(delegationManager.isOperator(operator), "bad test setup"); - _registerOperatorWithBaseDetails(operator); - - cheats.startPrank(operator); - avsDirectory.cancelSalt(salt); - - cheats.expectRevert("AVSDirectory.cancelSalt: cannot cancel spent salt"); - avsDirectory.cancelSalt(salt); - cheats.stopPrank(); - } - /// @notice Verifies that an operator cannot cancel the same salt twice function testFuzz_revert_whenCancellingSaltUsedToRegister(bytes32 salt) public { address operator = cheats.addr(delegationSignerPrivateKey); @@ -337,13 +1450,9 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni uint256 expiry = type(uint256).max; ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = - _getOperatorSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); + _getOperatorAVSRegistrationSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry); cheats.prank(defaultAVS); avsDirectory.registerOperatorToAVS(operator, operatorSignature); - - cheats.prank(operator); - cheats.expectRevert("AVSDirectory.cancelSalt: cannot cancel spent salt"); - avsDirectory.cancelSalt(salt); } } diff --git a/src/test/unit/DelegationUnit.t.sol b/src/test/unit/DelegationUnit.t.sol index 79bf46daf..3fbd8db0e 100644 --- a/src/test/unit/DelegationUnit.t.sol +++ b/src/test/unit/DelegationUnit.t.sol @@ -1,3324 +1,3324 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.12; - -import "@openzeppelin/contracts/mocks/ERC1271WalletMock.sol"; -import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; - -import "src/contracts/core/DelegationManager.sol"; -import "src/contracts/strategies/StrategyBase.sol"; - -import "src/test/events/IDelegationManagerEvents.sol"; -import "src/test/utils/EigenLayerUnitTestSetup.sol"; - -/** - * @notice Unit testing of the DelegationManager contract. Withdrawals are tightly coupled - * with EigenPodManager and StrategyManager and are part of integration tests. - * Contracts tested: DelegationManager - * Contracts not mocked: StrategyBase, PauserRegistry - */ -contract DelegationManagerUnitTests is EigenLayerUnitTestSetup, IDelegationManagerEvents { - // Contract under test - DelegationManager delegationManager; - DelegationManager delegationManagerImplementation; - - // Mocks - StrategyBase strategyImplementation; - StrategyBase strategyMock; - IERC20 mockToken; - uint256 mockTokenInitialSupply = 10e50; - - // Delegation signer - uint256 delegationSignerPrivateKey = uint256(0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80); - uint256 stakerPrivateKey = uint256(123_456_789); - - // empty string reused across many tests - string emptyStringForMetadataURI; - - // "empty" / zero salt, reused across many tests - bytes32 emptySalt; - - // reused in various tests. in storage to help handle stack-too-deep errors - address defaultStaker = cheats.addr(uint256(123_456_789)); - address defaultOperator = address(this); - address defaultApprover = cheats.addr(delegationSignerPrivateKey); - address defaultAVS = address(this); - - // 604800 seconds in week / 12 = 50,400 blocks - uint256 minWithdrawalDelayBlocks = 50400; - IStrategy[] public initializeStrategiesToSetDelayBlocks; - uint256[] public initializeWithdrawalDelayBlocks; - - IStrategy public constant beaconChainETHStrategy = IStrategy(0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0); - - // Index for flag that pauses new delegations when set. - uint8 internal constant PAUSED_NEW_DELEGATION = 0; - - // Index for flag that pauses queuing new withdrawals when set. - uint8 internal constant PAUSED_ENTER_WITHDRAWAL_QUEUE = 1; - - // Index for flag that pauses completing existing withdrawals when set. - uint8 internal constant PAUSED_EXIT_WITHDRAWAL_QUEUE = 2; - - // the number of 12-second blocks in 30 days (60 * 60 * 24 * 30 / 12 = 216,000) - uint256 public constant MAX_WITHDRAWAL_DELAY_BLOCKS = 216000; - - /// @notice mappings used to handle duplicate entries in fuzzed address array input - mapping(address => uint256) public totalSharesForStrategyInArray; - mapping(IStrategy => uint256) public delegatedSharesBefore; - - function setUp() public virtual override { - // Setup - EigenLayerUnitTestSetup.setUp(); - - // Deploy DelegationManager implmentation and proxy - initializeStrategiesToSetDelayBlocks = new IStrategy[](0); - initializeWithdrawalDelayBlocks = new uint256[](0); - delegationManagerImplementation = new DelegationManager(strategyManagerMock, slasherMock, eigenPodManagerMock); - delegationManager = DelegationManager( - address( - new TransparentUpgradeableProxy( - address(delegationManagerImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - DelegationManager.initialize.selector, - address(this), - pauserRegistry, - 0, // 0 is initialPausedStatus - minWithdrawalDelayBlocks, - initializeStrategiesToSetDelayBlocks, - initializeWithdrawalDelayBlocks - ) - ) - ) - ); - - // Deploy mock token and strategy - mockToken = new ERC20PresetFixedSupply("Mock Token", "MOCK", mockTokenInitialSupply, address(this)); - strategyImplementation = new StrategyBase(strategyManagerMock); - strategyMock = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(strategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector(StrategyBase.initialize.selector, mockToken, pauserRegistry) - ) - ) - ); - - // Exclude delegation manager from fuzzed tests - addressIsExcludedFromFuzzedInputs[address(delegationManager)] = true; - addressIsExcludedFromFuzzedInputs[defaultApprover] = true; - } - - /** - * INTERNAL / HELPER FUNCTIONS - */ - - /** - * @notice internal function to deploy mock tokens and strategies and have the staker deposit into them. - * Since we are mocking the strategyManager we call strategyManagerMock.setDeposits so that when - * DelegationManager calls getDeposits, we can have these share amounts returned. - */ - function _deployAndDepositIntoStrategies( - address staker, - uint256[] memory sharesAmounts - ) internal returns (IStrategy[] memory) { - uint256 numStrats = sharesAmounts.length; - IStrategy[] memory strategies = new IStrategy[](numStrats); - uint256[] memory withdrawalDelayBlocks = new uint256[](strategies.length); - for (uint8 i = 0; i < numStrats; i++) { - withdrawalDelayBlocks[i] = bound(uint256(keccak256(abi.encode(staker, i))), 0, MAX_WITHDRAWAL_DELAY_BLOCKS); - ERC20PresetFixedSupply token = new ERC20PresetFixedSupply( - string(abi.encodePacked("Mock Token ", i)), - string(abi.encodePacked("MOCK", i)), - mockTokenInitialSupply, - address(this) - ); - strategies[i] = StrategyBase( - address( - new TransparentUpgradeableProxy( - address(strategyImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector(StrategyBase.initialize.selector, token, pauserRegistry) - ) - ) - ); - } - delegationManager.setStrategyWithdrawalDelayBlocks(strategies, withdrawalDelayBlocks); - strategyManagerMock.setDeposits(staker, strategies, sharesAmounts); - return strategies; - } - - /** - * @notice internal function for calculating a signature from the delegationSigner corresponding to `_delegationSignerPrivateKey`, approving - * the `staker` to delegate to `operator`, with the specified `salt`, and expiring at `expiry`. - */ - function _getApproverSignature( - uint256 _delegationSignerPrivateKey, - address staker, - address operator, - bytes32 salt, - uint256 expiry - ) internal view returns (ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry) { - approverSignatureAndExpiry.expiry = expiry; - { - bytes32 digestHash = delegationManager.calculateDelegationApprovalDigestHash( - staker, - operator, - delegationManager.delegationApprover(operator), - salt, - expiry - ); - (uint8 v, bytes32 r, bytes32 s) = cheats.sign(_delegationSignerPrivateKey, digestHash); - approverSignatureAndExpiry.signature = abi.encodePacked(r, s, v); - } - return approverSignatureAndExpiry; - } - - /** - * @notice internal function for calculating a signature from the staker corresponding to `_stakerPrivateKey`, delegating them to - * the `operator`, and expiring at `expiry`. - */ - function _getStakerSignature( - uint256 _stakerPrivateKey, - address operator, - uint256 expiry - ) internal view returns (ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry) { - address staker = cheats.addr(stakerPrivateKey); - stakerSignatureAndExpiry.expiry = expiry; - { - bytes32 digestHash = delegationManager.calculateCurrentStakerDelegationDigestHash(staker, operator, expiry); - (uint8 v, bytes32 r, bytes32 s) = cheats.sign(_stakerPrivateKey, digestHash); - stakerSignatureAndExpiry.signature = abi.encodePacked(r, s, v); - } - return stakerSignatureAndExpiry; - } - - // @notice Assumes operator does not have a delegation approver & staker != approver - function _delegateToOperatorWhoAcceptsAllStakers(address staker, address operator) internal { - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - cheats.prank(staker); - delegationManager.delegateTo(operator, approverSignatureAndExpiry, emptySalt); - } - - function _delegateToOperatorWhoRequiresSig(address staker, address operator, bytes32 salt) internal { - uint256 expiry = type(uint256).max; - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - operator, - salt, - expiry - ); - cheats.prank(staker); - delegationManager.delegateTo(operator, approverSignatureAndExpiry, salt); - } - - function _delegateToOperatorWhoRequiresSig(address staker, address operator) internal { - _delegateToOperatorWhoRequiresSig(staker, operator, emptySalt); - } - - function _delegateToBySignatureOperatorWhoAcceptsAllStakers( - address staker, - address caller, - address operator, - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry, - bytes32 salt - ) internal { - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - cheats.prank(caller); - delegationManager.delegateToBySignature( - staker, - operator, - stakerSignatureAndExpiry, - approverSignatureAndExpiry, - salt - ); - } - - function _delegateToBySignatureOperatorWhoRequiresSig( - address staker, - address caller, - address operator, - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry, - bytes32 salt - ) internal { - uint256 expiry = type(uint256).max; - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - operator, - salt, - expiry - ); - cheats.prank(caller); - delegationManager.delegateToBySignature( - staker, - operator, - stakerSignatureAndExpiry, - approverSignatureAndExpiry, - salt - ); - } - - function _registerOperatorWithBaseDetails(address operator) internal { - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: operator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }); - _registerOperator(operator, operatorDetails, emptyStringForMetadataURI); - } - - function _registerOperatorWithDelegationApprover(address operator) internal { - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: operator, - delegationApprover: defaultApprover, - stakerOptOutWindowBlocks: 0 - }); - _registerOperator(operator, operatorDetails, emptyStringForMetadataURI); - } - - function _registerOperatorWith1271DelegationApprover(address operator) internal returns (ERC1271WalletMock) { - address delegationSigner = defaultApprover; - /** - * deploy a ERC1271WalletMock contract with the `delegationSigner` address as the owner, - * so that we can create valid signatures from the `delegationSigner` for the contract to check when called - */ - ERC1271WalletMock wallet = new ERC1271WalletMock(delegationSigner); - - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: operator, - delegationApprover: address(wallet), - stakerOptOutWindowBlocks: 0 - }); - _registerOperator(operator, operatorDetails, emptyStringForMetadataURI); - - return wallet; - } - - function _registerOperator( - address operator, - IDelegationManager.OperatorDetails memory operatorDetails, - string memory metadataURI - ) internal filterFuzzedAddressInputs(operator) { - _filterOperatorDetails(operator, operatorDetails); - cheats.prank(operator); - delegationManager.registerAsOperator(operatorDetails, metadataURI); - } - - function _filterOperatorDetails( - address operator, - IDelegationManager.OperatorDetails memory operatorDetails - ) internal view { - // filter out zero address since people can't delegate to the zero address and operators are delegated to themselves - cheats.assume(operator != address(0)); - // filter out disallowed stakerOptOutWindowBlocks values - cheats.assume(operatorDetails.stakerOptOutWindowBlocks <= delegationManager.MAX_STAKER_OPT_OUT_WINDOW_BLOCKS()); - } - - /** - * @notice Using this helper function to fuzz withdrawalAmounts since fuzzing two dynamic sized arrays of equal lengths - * reject too many inputs. - */ - function _fuzzWithdrawalAmounts(uint256[] memory depositAmounts) internal view returns (uint256[] memory) { - uint256[] memory withdrawalAmounts = new uint256[](depositAmounts.length); - for (uint256 i = 0; i < depositAmounts.length; i++) { - cheats.assume(depositAmounts[i] > 0); - // generate withdrawal amount within range s.t withdrawAmount <= depositAmount - withdrawalAmounts[i] = bound( - uint256(keccak256(abi.encodePacked(depositAmounts[i]))), - 0, - depositAmounts[i] - ); - } - return withdrawalAmounts; - } - - function _setUpQueueWithdrawalsSingleStrat( - address staker, - address withdrawer, - IStrategy strategy, - uint256 withdrawalAmount - ) internal view returns ( - IDelegationManager.QueuedWithdrawalParams[] memory, - IDelegationManager.Withdrawal memory, - bytes32 - ) { - IStrategy[] memory strategyArray = new IStrategy[](1); - strategyArray[0] = strategy; - uint256[] memory withdrawalAmounts = new uint256[](1); - withdrawalAmounts[0] = withdrawalAmount; - - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams = new IDelegationManager.QueuedWithdrawalParams[](1); - queuedWithdrawalParams[0] = IDelegationManager.QueuedWithdrawalParams({ - strategies: strategyArray, - shares: withdrawalAmounts, - withdrawer: withdrawer - }); - - IDelegationManager.Withdrawal memory withdrawal = IDelegationManager.Withdrawal({ - staker: staker, - delegatedTo: delegationManager.delegatedTo(staker), - withdrawer: withdrawer, - nonce: delegationManager.cumulativeWithdrawalsQueued(staker), - startBlock: uint32(block.number), - strategies: strategyArray, - shares: withdrawalAmounts - }); - bytes32 withdrawalRoot = delegationManager.calculateWithdrawalRoot(withdrawal); +// // SPDX-License-Identifier: BUSL-1.1 +// pragma solidity ^0.8.12; + +// import "@openzeppelin/contracts/mocks/ERC1271WalletMock.sol"; +// import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; + +// import "src/contracts/core/DelegationManager.sol"; +// import "src/contracts/strategies/StrategyBase.sol"; + +// import "src/test/events/IDelegationManagerEvents.sol"; +// import "src/test/utils/EigenLayerUnitTestSetup.sol"; + +// /** +// * @notice Unit testing of the DelegationManager contract. Withdrawals are tightly coupled +// * with EigenPodManager and StrategyManager and are part of integration tests. +// * Contracts tested: DelegationManager +// * Contracts not mocked: StrategyBase, PauserRegistry +// */ +// contract DelegationManagerUnitTests is EigenLayerUnitTestSetup, IDelegationManagerEvents { +// // Contract under test +// DelegationManager delegationManager; +// DelegationManager delegationManagerImplementation; + +// // Mocks +// StrategyBase strategyImplementation; +// StrategyBase strategyMock; +// IERC20 mockToken; +// uint256 mockTokenInitialSupply = 10e50; + +// // Delegation signer +// uint256 delegationSignerPrivateKey = uint256(0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80); +// uint256 stakerPrivateKey = uint256(123_456_789); + +// // empty string reused across many tests +// string emptyStringForMetadataURI; + +// // "empty" / zero salt, reused across many tests +// bytes32 emptySalt; + +// // reused in various tests. in storage to help handle stack-too-deep errors +// address defaultStaker = cheats.addr(uint256(123_456_789)); +// address defaultOperator = address(this); +// address defaultApprover = cheats.addr(delegationSignerPrivateKey); +// address defaultAVS = address(this); + +// // 604800 seconds in week / 12 = 50,400 blocks +// uint256 minWithdrawalDelayBlocks = 50400; +// IStrategy[] public initializeStrategiesToSetDelayBlocks; +// uint256[] public initializeWithdrawalDelayBlocks; + +// IStrategy public constant beaconChainETHStrategy = IStrategy(0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0); + +// // Index for flag that pauses new delegations when set. +// uint8 internal constant PAUSED_NEW_DELEGATION = 0; + +// // Index for flag that pauses queuing new withdrawals when set. +// uint8 internal constant PAUSED_ENTER_WITHDRAWAL_QUEUE = 1; + +// // Index for flag that pauses completing existing withdrawals when set. +// uint8 internal constant PAUSED_EXIT_WITHDRAWAL_QUEUE = 2; + +// // the number of 12-second blocks in 30 days (60 * 60 * 24 * 30 / 12 = 216,000) +// uint256 public constant MAX_WITHDRAWAL_DELAY_BLOCKS = 216000; + +// /// @notice mappings used to handle duplicate entries in fuzzed address array input +// mapping(address => uint256) public totalSharesForStrategyInArray; +// mapping(IStrategy => uint256) public delegatedSharesBefore; + +// function setUp() public virtual override { +// // Setup +// EigenLayerUnitTestSetup.setUp(); + +// // Deploy DelegationManager implmentation and proxy +// initializeStrategiesToSetDelayBlocks = new IStrategy[](0); +// initializeWithdrawalDelayBlocks = new uint256[](0); +// delegationManagerImplementation = new DelegationManager(strategyManagerMock, slasherMock, eigenPodManagerMock); +// delegationManager = DelegationManager( +// address( +// new TransparentUpgradeableProxy( +// address(delegationManagerImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector( +// DelegationManager.initialize.selector, +// address(this), +// pauserRegistry, +// 0, // 0 is initialPausedStatus +// minWithdrawalDelayBlocks, +// initializeStrategiesToSetDelayBlocks, +// initializeWithdrawalDelayBlocks +// ) +// ) +// ) +// ); + +// // Deploy mock token and strategy +// mockToken = new ERC20PresetFixedSupply("Mock Token", "MOCK", mockTokenInitialSupply, address(this)); +// strategyImplementation = new StrategyBase(strategyManagerMock); +// strategyMock = StrategyBase( +// address( +// new TransparentUpgradeableProxy( +// address(strategyImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector(StrategyBase.initialize.selector, mockToken, pauserRegistry) +// ) +// ) +// ); + +// // Exclude delegation manager from fuzzed tests +// addressIsExcludedFromFuzzedInputs[address(delegationManager)] = true; +// addressIsExcludedFromFuzzedInputs[defaultApprover] = true; +// } + +// /** +// * INTERNAL / HELPER FUNCTIONS +// */ + +// /** +// * @notice internal function to deploy mock tokens and strategies and have the staker deposit into them. +// * Since we are mocking the strategyManager we call strategyManagerMock.setDeposits so that when +// * DelegationManager calls getDeposits, we can have these share amounts returned. +// */ +// function _deployAndDepositIntoStrategies( +// address staker, +// uint256[] memory sharesAmounts +// ) internal returns (IStrategy[] memory) { +// uint256 numStrats = sharesAmounts.length; +// IStrategy[] memory strategies = new IStrategy[](numStrats); +// uint256[] memory withdrawalDelayBlocks = new uint256[](strategies.length); +// for (uint8 i = 0; i < numStrats; i++) { +// withdrawalDelayBlocks[i] = bound(uint256(keccak256(abi.encode(staker, i))), 0, MAX_WITHDRAWAL_DELAY_BLOCKS); +// ERC20PresetFixedSupply token = new ERC20PresetFixedSupply( +// string(abi.encodePacked("Mock Token ", i)), +// string(abi.encodePacked("MOCK", i)), +// mockTokenInitialSupply, +// address(this) +// ); +// strategies[i] = StrategyBase( +// address( +// new TransparentUpgradeableProxy( +// address(strategyImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector(StrategyBase.initialize.selector, token, pauserRegistry) +// ) +// ) +// ); +// } +// delegationManager.setStrategyWithdrawalDelayBlocks(strategies, withdrawalDelayBlocks); +// strategyManagerMock.setDeposits(staker, strategies, sharesAmounts); +// return strategies; +// } + +// /** +// * @notice internal function for calculating a signature from the delegationSigner corresponding to `_delegationSignerPrivateKey`, approving +// * the `staker` to delegate to `operator`, with the specified `salt`, and expiring at `expiry`. +// */ +// function _getApproverSignature( +// uint256 _delegationSignerPrivateKey, +// address staker, +// address operator, +// bytes32 salt, +// uint256 expiry +// ) internal view returns (ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry) { +// approverSignatureAndExpiry.expiry = expiry; +// { +// bytes32 digestHash = delegationManager.calculateDelegationApprovalDigestHash( +// staker, +// operator, +// delegationManager.delegationApprover(operator), +// salt, +// expiry +// ); +// (uint8 v, bytes32 r, bytes32 s) = cheats.sign(_delegationSignerPrivateKey, digestHash); +// approverSignatureAndExpiry.signature = abi.encodePacked(r, s, v); +// } +// return approverSignatureAndExpiry; +// } + +// /** +// * @notice internal function for calculating a signature from the staker corresponding to `_stakerPrivateKey`, delegating them to +// * the `operator`, and expiring at `expiry`. +// */ +// function _getStakerSignature( +// uint256 _stakerPrivateKey, +// address operator, +// uint256 expiry +// ) internal view returns (ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry) { +// address staker = cheats.addr(stakerPrivateKey); +// stakerSignatureAndExpiry.expiry = expiry; +// { +// bytes32 digestHash = delegationManager.calculateCurrentStakerDelegationDigestHash(staker, operator, expiry); +// (uint8 v, bytes32 r, bytes32 s) = cheats.sign(_stakerPrivateKey, digestHash); +// stakerSignatureAndExpiry.signature = abi.encodePacked(r, s, v); +// } +// return stakerSignatureAndExpiry; +// } + +// // @notice Assumes operator does not have a delegation approver & staker != approver +// function _delegateToOperatorWhoAcceptsAllStakers(address staker, address operator) internal { +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// cheats.prank(staker); +// delegationManager.delegateTo(operator, approverSignatureAndExpiry, emptySalt); +// } + +// function _delegateToOperatorWhoRequiresSig(address staker, address operator, bytes32 salt) internal { +// uint256 expiry = type(uint256).max; +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// operator, +// salt, +// expiry +// ); +// cheats.prank(staker); +// delegationManager.delegateTo(operator, approverSignatureAndExpiry, salt); +// } + +// function _delegateToOperatorWhoRequiresSig(address staker, address operator) internal { +// _delegateToOperatorWhoRequiresSig(staker, operator, emptySalt); +// } + +// function _delegateToBySignatureOperatorWhoAcceptsAllStakers( +// address staker, +// address caller, +// address operator, +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry, +// bytes32 salt +// ) internal { +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// cheats.prank(caller); +// delegationManager.delegateToBySignature( +// staker, +// operator, +// stakerSignatureAndExpiry, +// approverSignatureAndExpiry, +// salt +// ); +// } + +// function _delegateToBySignatureOperatorWhoRequiresSig( +// address staker, +// address caller, +// address operator, +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry, +// bytes32 salt +// ) internal { +// uint256 expiry = type(uint256).max; +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// operator, +// salt, +// expiry +// ); +// cheats.prank(caller); +// delegationManager.delegateToBySignature( +// staker, +// operator, +// stakerSignatureAndExpiry, +// approverSignatureAndExpiry, +// salt +// ); +// } + +// function _registerOperatorWithBaseDetails(address operator) internal { +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: operator, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }); +// _registerOperator(operator, operatorDetails, emptyStringForMetadataURI); +// } + +// function _registerOperatorWithDelegationApprover(address operator) internal { +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: operator, +// delegationApprover: defaultApprover, +// stakerOptOutWindowBlocks: 0 +// }); +// _registerOperator(operator, operatorDetails, emptyStringForMetadataURI); +// } + +// function _registerOperatorWith1271DelegationApprover(address operator) internal returns (ERC1271WalletMock) { +// address delegationSigner = defaultApprover; +// /** +// * deploy a ERC1271WalletMock contract with the `delegationSigner` address as the owner, +// * so that we can create valid signatures from the `delegationSigner` for the contract to check when called +// */ +// ERC1271WalletMock wallet = new ERC1271WalletMock(delegationSigner); + +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: operator, +// delegationApprover: address(wallet), +// stakerOptOutWindowBlocks: 0 +// }); +// _registerOperator(operator, operatorDetails, emptyStringForMetadataURI); + +// return wallet; +// } + +// function _registerOperator( +// address operator, +// IDelegationManager.OperatorDetails memory operatorDetails, +// string memory metadataURI +// ) internal filterFuzzedAddressInputs(operator) { +// _filterOperatorDetails(operator, operatorDetails); +// cheats.prank(operator); +// delegationManager.registerAsOperator(operatorDetails, metadataURI); +// } + +// function _filterOperatorDetails( +// address operator, +// IDelegationManager.OperatorDetails memory operatorDetails +// ) internal view { +// // filter out zero address since people can't delegate to the zero address and operators are delegated to themselves +// cheats.assume(operator != address(0)); +// // filter out disallowed stakerOptOutWindowBlocks values +// cheats.assume(operatorDetails.stakerOptOutWindowBlocks <= delegationManager.MAX_STAKER_OPT_OUT_WINDOW_BLOCKS()); +// } + +// /** +// * @notice Using this helper function to fuzz withdrawalAmounts since fuzzing two dynamic sized arrays of equal lengths +// * reject too many inputs. +// */ +// function _fuzzWithdrawalAmounts(uint256[] memory depositAmounts) internal view returns (uint256[] memory) { +// uint256[] memory withdrawalAmounts = new uint256[](depositAmounts.length); +// for (uint256 i = 0; i < depositAmounts.length; i++) { +// cheats.assume(depositAmounts[i] > 0); +// // generate withdrawal amount within range s.t withdrawAmount <= depositAmount +// withdrawalAmounts[i] = bound( +// uint256(keccak256(abi.encodePacked(depositAmounts[i]))), +// 0, +// depositAmounts[i] +// ); +// } +// return withdrawalAmounts; +// } + +// function _setUpQueueWithdrawalsSingleStrat( +// address staker, +// address withdrawer, +// IStrategy strategy, +// uint256 withdrawalAmount +// ) internal view returns ( +// IDelegationManager.QueuedWithdrawalParams[] memory, +// IDelegationManager.Withdrawal memory, +// bytes32 +// ) { +// IStrategy[] memory strategyArray = new IStrategy[](1); +// strategyArray[0] = strategy; +// uint256[] memory withdrawalAmounts = new uint256[](1); +// withdrawalAmounts[0] = withdrawalAmount; + +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams = new IDelegationManager.QueuedWithdrawalParams[](1); +// queuedWithdrawalParams[0] = IDelegationManager.QueuedWithdrawalParams({ +// strategies: strategyArray, +// shares: withdrawalAmounts, +// withdrawer: withdrawer +// }); + +// IDelegationManager.Withdrawal memory withdrawal = IDelegationManager.Withdrawal({ +// staker: staker, +// delegatedTo: delegationManager.delegatedTo(staker), +// withdrawer: withdrawer, +// nonce: delegationManager.cumulativeWithdrawalsQueued(staker), +// startBlock: uint32(block.number), +// strategies: strategyArray, +// scaledShares: withdrawalAmounts +// }); +// bytes32 withdrawalRoot = delegationManager.calculateWithdrawalRoot(withdrawal); - return (queuedWithdrawalParams, withdrawal, withdrawalRoot); - } - - function _setUpQueueWithdrawals( - address staker, - address withdrawer, - IStrategy[] memory strategies, - uint256[] memory withdrawalAmounts - ) internal view returns ( - IDelegationManager.QueuedWithdrawalParams[] memory, - IDelegationManager.Withdrawal memory, - bytes32 - ) { - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams = new IDelegationManager.QueuedWithdrawalParams[](1); - queuedWithdrawalParams[0] = IDelegationManager.QueuedWithdrawalParams({ - strategies: strategies, - shares: withdrawalAmounts, - withdrawer: withdrawer - }); +// return (queuedWithdrawalParams, withdrawal, withdrawalRoot); +// } + +// function _setUpQueueWithdrawals( +// address staker, +// address withdrawer, +// IStrategy[] memory strategies, +// uint256[] memory withdrawalAmounts +// ) internal view returns ( +// IDelegationManager.QueuedWithdrawalParams[] memory, +// IDelegationManager.Withdrawal memory, +// bytes32 +// ) { +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams = new IDelegationManager.QueuedWithdrawalParams[](1); +// queuedWithdrawalParams[0] = IDelegationManager.QueuedWithdrawalParams({ +// strategies: strategies, +// shares: withdrawalAmounts, +// withdrawer: withdrawer +// }); - IDelegationManager.Withdrawal memory withdrawal = IDelegationManager.Withdrawal({ - staker: staker, - delegatedTo: delegationManager.delegatedTo(staker), - withdrawer: withdrawer, - nonce: delegationManager.cumulativeWithdrawalsQueued(staker), - startBlock: uint32(block.number), - strategies: strategies, - shares: withdrawalAmounts - }); - bytes32 withdrawalRoot = delegationManager.calculateWithdrawalRoot(withdrawal); +// IDelegationManager.Withdrawal memory withdrawal = IDelegationManager.Withdrawal({ +// staker: staker, +// delegatedTo: delegationManager.delegatedTo(staker), +// withdrawer: withdrawer, +// nonce: delegationManager.cumulativeWithdrawalsQueued(staker), +// startBlock: uint32(block.number), +// strategies: strategies, +// scaledShares: withdrawalAmounts +// }); +// bytes32 withdrawalRoot = delegationManager.calculateWithdrawalRoot(withdrawal); - return (queuedWithdrawalParams, withdrawal, withdrawalRoot); - } - - /** - * Deploy and deposit staker into a single strategy, then set up a queued withdrawal for the staker - * Assumptions: - * - operator is already a registered operator. - * - withdrawalAmount <= depositAmount - */ - function _setUpCompleteQueuedWithdrawalSingleStrat( - address staker, - address withdrawer, - uint256 depositAmount, - uint256 withdrawalAmount - ) internal returns (IDelegationManager.Withdrawal memory, IERC20[] memory, bytes32) { - uint256[] memory depositAmounts = new uint256[](1); - depositAmounts[0] = depositAmount; - IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); - ( - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, - IDelegationManager.Withdrawal memory withdrawal, - bytes32 withdrawalRoot - ) = _setUpQueueWithdrawalsSingleStrat({ - staker: staker, - withdrawer: withdrawer, - strategy: strategies[0], - withdrawalAmount: withdrawalAmount - }); - - cheats.prank(staker); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - // Set the current deposits to be the depositAmount - withdrawalAmount - uint256[] memory currentAmounts = new uint256[](1); - currentAmounts[0] = depositAmount - withdrawalAmount; - strategyManagerMock.setDeposits(staker, strategies, currentAmounts); - - IERC20[] memory tokens = new IERC20[](1); - tokens[0] = strategies[0].underlyingToken(); - return (withdrawal, tokens, withdrawalRoot); - } - - /** - * Deploy and deposit staker into a single strategy, then set up a queued withdrawal for the staker - * Assumptions: - * - operator is already a registered operator. - * - withdrawalAmount <= depositAmount - */ - function _setUpCompleteQueuedWithdrawalBeaconStrat( - address staker, - address withdrawer, - uint256 depositAmount, - uint256 withdrawalAmount - ) internal returns (IDelegationManager.Withdrawal memory, IERC20[] memory, bytes32) { - uint256[] memory depositAmounts = new uint256[](1); - depositAmounts[0] = depositAmount; - IStrategy[] memory strategies = new IStrategy[](1); - strategies[0] = beaconChainETHStrategy; - ( - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, - IDelegationManager.Withdrawal memory withdrawal, - bytes32 withdrawalRoot - ) = _setUpQueueWithdrawalsSingleStrat({ - staker: staker, - withdrawer: withdrawer, - strategy: strategies[0], - withdrawalAmount: withdrawalAmount - }); - - cheats.prank(staker); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - // Set the current deposits to be the depositAmount - withdrawalAmount - uint256[] memory currentAmounts = new uint256[](1); - currentAmounts[0] = depositAmount - withdrawalAmount; - strategyManagerMock.setDeposits(staker, strategies, currentAmounts); - - IERC20[] memory tokens; - // tokens[0] = strategies[0].underlyingToken(); - return (withdrawal, tokens, withdrawalRoot); - } - - /** - * Deploy and deposit staker into strategies, then set up a queued withdrawal for the staker - * Assumptions: - * - operator is already a registered operator. - * - for each i, withdrawalAmount[i] <= depositAmount[i] (see filterFuzzedDepositWithdrawInputs above) - */ - function _setUpCompleteQueuedWithdrawal( - address staker, - address withdrawer, - uint256[] memory depositAmounts, - uint256[] memory withdrawalAmounts - ) internal returns (IDelegationManager.Withdrawal memory, IERC20[] memory, bytes32) { - IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); - - IERC20[] memory tokens = new IERC20[](strategies.length); - for (uint256 i = 0; i < strategies.length; i++) { - tokens[i] = strategies[i].underlyingToken(); - } - - ( - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, - IDelegationManager.Withdrawal memory withdrawal, - bytes32 withdrawalRoot - ) = _setUpQueueWithdrawals({ - staker: staker, - withdrawer: withdrawer, - strategies: strategies, - withdrawalAmounts: withdrawalAmounts - }); - - cheats.prank(staker); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - - return (withdrawal, tokens, withdrawalRoot); - } -} - -contract DelegationManagerUnitTests_Initialization_Setters is DelegationManagerUnitTests { - function test_initialization() public { - assertEq( - address(delegationManager.strategyManager()), - address(strategyManagerMock), - "constructor / initializer incorrect, strategyManager set wrong" - ); - assertEq( - address(delegationManager.slasher()), - address(slasherMock), - "constructor / initializer incorrect, slasher set wrong" - ); - assertEq( - address(delegationManager.pauserRegistry()), - address(pauserRegistry), - "constructor / initializer incorrect, pauserRegistry set wrong" - ); - assertEq(delegationManager.owner(), address(this), "constructor / initializer incorrect, owner set wrong"); - assertEq(delegationManager.paused(), 0, "constructor / initializer incorrect, paused status set wrong"); - } - - /// @notice Verifies that the DelegationManager cannot be iniitalized multiple times - function test_initialize_revert_reinitialization() public { - cheats.expectRevert("Initializable: contract is already initialized"); - delegationManager.initialize( - address(this), - pauserRegistry, - 0, - 0, // minWithdrawalDelayBlocks - initializeStrategiesToSetDelayBlocks, - initializeWithdrawalDelayBlocks - ); - } - - function testFuzz_setMinWithdrawalDelayBlocks_revert_notOwner( - address invalidCaller - ) public filterFuzzedAddressInputs(invalidCaller) { - cheats.assume(invalidCaller != delegationManager.owner()); - cheats.prank(invalidCaller); - cheats.expectRevert("Ownable: caller is not the owner"); - delegationManager.setMinWithdrawalDelayBlocks(0); - } - - function testFuzz_setMinWithdrawalDelayBlocks_revert_tooLarge(uint256 newMinWithdrawalDelayBlocks) external { - // filter fuzzed inputs to disallowed amounts - cheats.assume(newMinWithdrawalDelayBlocks > delegationManager.MAX_WITHDRAWAL_DELAY_BLOCKS()); - - // attempt to set the `minWithdrawalDelayBlocks` variable - cheats.expectRevert("DelegationManager._setMinWithdrawalDelayBlocks: _minWithdrawalDelayBlocks cannot be > MAX_WITHDRAWAL_DELAY_BLOCKS"); - delegationManager.setMinWithdrawalDelayBlocks(newMinWithdrawalDelayBlocks); - } - - function testFuzz_initialize_Revert_WhenWithdrawalDelayBlocksTooLarge( - uint256[] memory withdrawalDelayBlocks, - uint256 invalidStrategyIndex - ) public { - // set withdrawalDelayBlocks to be too large - cheats.assume(withdrawalDelayBlocks.length > 0); - uint256 numStrats = withdrawalDelayBlocks.length; - IStrategy[] memory strategiesToSetDelayBlocks = new IStrategy[](numStrats); - for (uint256 i = 0; i < numStrats; i++) { - strategiesToSetDelayBlocks[i] = IStrategy(address(uint160(uint256(keccak256(abi.encode(strategyMock, i)))))); - } - - // set at least one index to be too large for withdrawalDelayBlocks - invalidStrategyIndex = invalidStrategyIndex % numStrats; - withdrawalDelayBlocks[invalidStrategyIndex] = MAX_WITHDRAWAL_DELAY_BLOCKS + 1; - - // Deploy DelegationManager implmentation and proxy - delegationManagerImplementation = new DelegationManager(strategyManagerMock, slasherMock, eigenPodManagerMock); - cheats.expectRevert( - "DelegationManager._setStrategyWithdrawalDelayBlocks: _withdrawalDelayBlocks cannot be > MAX_WITHDRAWAL_DELAY_BLOCKS" - ); - delegationManager = DelegationManager( - address( - new TransparentUpgradeableProxy( - address(delegationManagerImplementation), - address(eigenLayerProxyAdmin), - abi.encodeWithSelector( - DelegationManager.initialize.selector, - address(this), - pauserRegistry, - 0, // 0 is initialPausedStatus - minWithdrawalDelayBlocks, - strategiesToSetDelayBlocks, - withdrawalDelayBlocks - ) - ) - ) - ); - } -} - -contract DelegationManagerUnitTests_RegisterModifyOperator is DelegationManagerUnitTests { - function test_registerAsOperator_revert_paused() public { - // set the pausing flag - cheats.prank(pauser); - delegationManager.pause(2 ** PAUSED_NEW_DELEGATION); - - cheats.expectRevert("Pausable: index is paused"); - delegationManager.registerAsOperator( - IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: defaultOperator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }), - emptyStringForMetadataURI - ); - } - - // @notice Verifies that someone cannot successfully call `DelegationManager.registerAsOperator(operatorDetails)` again after registering for the first time - function testFuzz_registerAsOperator_revert_cannotRegisterMultipleTimes( - address operator, - IDelegationManager.OperatorDetails memory operatorDetails - ) public filterFuzzedAddressInputs(operator) { - _filterOperatorDetails(operator, operatorDetails); - - // Register once - cheats.startPrank(operator); - delegationManager.registerAsOperator(operatorDetails, emptyStringForMetadataURI); - - // Expect revert when register again - cheats.expectRevert("DelegationManager.registerAsOperator: caller is already actively delegated"); - delegationManager.registerAsOperator(operatorDetails, emptyStringForMetadataURI); - cheats.stopPrank(); - } - - /** - * @notice Verifies that an operator cannot register with `stakerOptOutWindowBlocks` set larger than `MAX_STAKER_OPT_OUT_WINDOW_BLOCKS` - */ - function testFuzz_registerAsOperator_revert_optOutBlocksTooLarge( - IDelegationManager.OperatorDetails memory operatorDetails - ) public { - // filter out *allowed* stakerOptOutWindowBlocks values - cheats.assume(operatorDetails.stakerOptOutWindowBlocks > delegationManager.MAX_STAKER_OPT_OUT_WINDOW_BLOCKS()); - - cheats.prank(defaultOperator); - cheats.expectRevert("DelegationManager._setOperatorDetails: stakerOptOutWindowBlocks cannot be > MAX_STAKER_OPT_OUT_WINDOW_BLOCKS"); - delegationManager.registerAsOperator(operatorDetails, emptyStringForMetadataURI); - } - - /** - * @notice `operator` registers via calling `DelegationManager.registerAsOperator(operatorDetails, metadataURI)` - * Should be able to set any parameters, other than too high value for `stakerOptOutWindowBlocks` - * The set parameters should match the desired parameters (correct storage update) - * Operator becomes delegated to themselves - * Properly emits events – especially the `OperatorRegistered` event, but also `StakerDelegated` & `OperatorDetailsModified` events - * Reverts appropriately if operator was already delegated to someone (including themselves, i.e. they were already an operator) - * @param operator and @param operatorDetails are fuzzed inputs - */ - function testFuzz_registerAsOperator( - address operator, - IDelegationManager.OperatorDetails memory operatorDetails, - string memory metadataURI - ) public filterFuzzedAddressInputs(operator) { - _filterOperatorDetails(operator, operatorDetails); - - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorDetailsModified(operator, operatorDetails); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(operator, operator); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorRegistered(operator, operatorDetails); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorMetadataURIUpdated(operator, metadataURI); - - cheats.prank(operator); - delegationManager.registerAsOperator(operatorDetails, metadataURI); - - // Storage checks - assertEq( - operatorDetails.delegationApprover, - delegationManager.delegationApprover(operator), - "delegationApprover not set correctly" - ); - assertEq( - operatorDetails.stakerOptOutWindowBlocks, - delegationManager.stakerOptOutWindowBlocks(operator), - "stakerOptOutWindowBlocks not set correctly" - ); - assertEq(delegationManager.delegatedTo(operator), operator, "operator not delegated to self"); - } - - // @notice Verifies that a staker who is actively delegated to an operator cannot register as an operator (without first undelegating, at least) - function testFuzz_registerAsOperator_cannotRegisterWhileDelegated( - address staker, - IDelegationManager.OperatorDetails memory operatorDetails - ) public filterFuzzedAddressInputs(staker) { - cheats.assume(staker != defaultOperator); - // Staker becomes an operator, so filter against staker's address - _filterOperatorDetails(staker, operatorDetails); - - // register *this contract* as an operator - _registerOperatorWithBaseDetails(defaultOperator); - - // delegate from the `staker` to the operator - cheats.startPrank(staker); - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); - - // expect revert if attempt to register as operator - cheats.expectRevert("DelegationManager.registerAsOperator: caller is already actively delegated"); - delegationManager.registerAsOperator(operatorDetails, emptyStringForMetadataURI); - - cheats.stopPrank(); - } - - /** - * @notice Tests that an operator can modify their OperatorDetails by calling `DelegationManager.modifyOperatorDetails` - * Should be able to set any parameters, other than setting their `earningsReceiver` to the zero address or too high value for `stakerOptOutWindowBlocks` - * The set parameters should match the desired parameters (correct storage update) - * Properly emits an `OperatorDetailsModified` event - * Reverts appropriately if the caller is not an operator - * Reverts if operator tries to decrease their `stakerOptOutWindowBlocks` parameter - * @param initialOperatorDetails and @param modifiedOperatorDetails are fuzzed inputs - */ - function testFuzz_modifyOperatorParameters( - IDelegationManager.OperatorDetails memory initialOperatorDetails, - IDelegationManager.OperatorDetails memory modifiedOperatorDetails - ) public { - _registerOperator(defaultOperator, initialOperatorDetails, emptyStringForMetadataURI); - - cheats.startPrank(defaultOperator); - - // either it fails for trying to set the stakerOptOutWindowBlocks - if (modifiedOperatorDetails.stakerOptOutWindowBlocks > delegationManager.MAX_STAKER_OPT_OUT_WINDOW_BLOCKS()) { - cheats.expectRevert( - "DelegationManager._setOperatorDetails: stakerOptOutWindowBlocks cannot be > MAX_STAKER_OPT_OUT_WINDOW_BLOCKS" - ); - delegationManager.modifyOperatorDetails(modifiedOperatorDetails); - // or the transition is allowed, - } else if ( - modifiedOperatorDetails.stakerOptOutWindowBlocks >= initialOperatorDetails.stakerOptOutWindowBlocks - ) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorDetailsModified(defaultOperator, modifiedOperatorDetails); - delegationManager.modifyOperatorDetails(modifiedOperatorDetails); - - assertEq( - modifiedOperatorDetails.delegationApprover, - delegationManager.delegationApprover(defaultOperator), - "delegationApprover not set correctly" - ); - assertEq( - modifiedOperatorDetails.stakerOptOutWindowBlocks, - delegationManager.stakerOptOutWindowBlocks(defaultOperator), - "stakerOptOutWindowBlocks not set correctly" - ); - assertEq(delegationManager.delegatedTo(defaultOperator), defaultOperator, "operator not delegated to self"); - // or else the transition is disallowed - } else { - cheats.expectRevert("DelegationManager._setOperatorDetails: stakerOptOutWindowBlocks cannot be decreased"); - delegationManager.modifyOperatorDetails(modifiedOperatorDetails); - } - - cheats.stopPrank(); - } - - // @notice Tests that an address which is not an operator cannot successfully call `updateOperatorMetadataURI`. - function test_updateOperatorMetadataUri_notRegistered() public { - assertFalse(delegationManager.isOperator(defaultOperator), "bad test setup"); - - cheats.prank(defaultOperator); - cheats.expectRevert("DelegationManager.updateOperatorMetadataURI: caller must be an operator"); - delegationManager.updateOperatorMetadataURI(emptyStringForMetadataURI); - } - - /** - * @notice Verifies that a staker cannot call cannot modify their `OperatorDetails` without first registering as an operator - * @dev This is an important check to ensure that our definition of 'operator' remains consistent, in particular for preserving the - * invariant that 'operators' are always delegated to themselves - */ - function testFuzz_updateOperatorMetadataUri_revert_notOperator( - IDelegationManager.OperatorDetails memory operatorDetails - ) public { - cheats.expectRevert("DelegationManager.modifyOperatorDetails: caller must be an operator"); - delegationManager.modifyOperatorDetails(operatorDetails); - } - - // @notice Tests that an operator who calls `updateOperatorMetadataURI` will correctly see an `OperatorMetadataURIUpdated` event emitted with their input - function testFuzz_UpdateOperatorMetadataURI(string memory metadataURI) public { - // register *this contract* as an operator - _registerOperatorWithBaseDetails(defaultOperator); - - // call `updateOperatorMetadataURI` and check for event - cheats.prank(defaultOperator); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorMetadataURIUpdated(defaultOperator, metadataURI); - delegationManager.updateOperatorMetadataURI(metadataURI); - } -} - -contract DelegationManagerUnitTests_delegateTo is DelegationManagerUnitTests { - function test_Revert_WhenPaused() public { - cheats.prank(defaultOperator); - delegationManager.registerAsOperator( - IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: defaultOperator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }), - emptyStringForMetadataURI - ); - - // set the pausing flag - cheats.prank(pauser); - delegationManager.pause(2 ** PAUSED_NEW_DELEGATION); - - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - cheats.prank(defaultStaker); - cheats.expectRevert("Pausable: index is paused"); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); - } - - /** - * @notice Delegates from `staker` to an operator, then verifies that the `staker` cannot delegate to another `operator` (at least without first undelegating) - */ - function testFuzz_Revert_WhenDelegateWhileDelegated( - address staker, - address operator, - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, - bytes32 salt - ) public filterFuzzedAddressInputs(staker) filterFuzzedAddressInputs(operator) { - // filter out input since if the staker tries to delegate again after registering as an operator, we will revert earlier than this test is designed to check - cheats.assume(staker != operator); - - // delegate from the staker to an operator - cheats.assume(operator != address(this)); - _registerOperatorWithBaseDetails(operator); - _delegateToOperatorWhoAcceptsAllStakers(staker, operator); - - // try to delegate again and check that the call reverts - cheats.startPrank(staker); - cheats.expectRevert("DelegationManager.delegateTo: staker is already actively delegated"); - delegationManager.delegateTo(operator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - } - - // @notice Verifies that `staker` cannot delegate to an unregistered `operator` - function testFuzz_Revert_WhenDelegateToUnregisteredOperator( - address staker, - address operator - ) public filterFuzzedAddressInputs(staker) filterFuzzedAddressInputs(operator) { - assertFalse(delegationManager.isOperator(operator), "incorrect test input?"); - - // try to delegate and check that the call reverts - cheats.startPrank(staker); - cheats.expectRevert("DelegationManager.delegateTo: operator is not registered in EigenLayer"); - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - delegationManager.delegateTo(operator, approverSignatureAndExpiry, emptySalt); - cheats.stopPrank(); - } - - /** - * @notice `staker` delegates to an operator who does not require any signature verification (i.e. the operator’s `delegationApprover` address is set to the zero address) - * via the `staker` calling `DelegationManager.delegateTo` - * The function should pass with any `operatorSignature` input (since it should be unused) - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * Reverts if the staker is already delegated (to the operator or to anyone else) - * Reverts if the ‘operator’ is not actually registered as an operator - */ - function testFuzz_OperatorWhoAcceptsAllStakers_StrategyManagerShares( - address staker, - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, - bytes32 salt, - uint256 shares - ) public filterFuzzedAddressInputs(staker) { - // register *this contract* as an operator - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWithBaseDetails(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - // Set staker shares in StrategyManager - IStrategy[] memory strategiesToReturn = new IStrategy[](1); - strategiesToReturn[0] = strategyMock; - uint256[] memory sharesToReturn = new uint256[](1); - sharesToReturn[0] = shares; - strategyManagerMock.setDeposits(staker, strategiesToReturn, sharesToReturn); - uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, staker, strategyMock, shares); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); - - assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); - assertTrue(delegationManager.isOperator(defaultOperator), "staker not registered as operator"); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - } - - /** - * @notice `staker` delegates to an operator who does not require any signature verification (i.e. the operator’s `delegationApprover` address is set to the zero address) - * via the `staker` calling `DelegationManager.delegateTo` - * The function should pass with any `operatorSignature` input (since it should be unused) - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * OperatorSharesIncreased event should only be emitted if beaconShares is > 0. Since a staker can have negative shares nothing should happen in that case - */ - function testFuzz_OperatorWhoAcceptsAllStakers_BeaconChainStrategyShares( - address staker, - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, - bytes32 salt, - int256 beaconShares - ) public filterFuzzedAddressInputs(staker) { - // register *this contract* as an operator - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWithBaseDetails(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - // Set staker shares in BeaconChainStrategy - eigenPodManagerMock.setPodOwnerShares(staker, beaconShares); - uint256 beaconSharesBefore = delegationManager.operatorShares(staker, beaconChainETHStrategy); - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - if (beaconShares > 0) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, staker, beaconChainETHStrategy, uint256(beaconShares)); - } - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); - if (beaconShares <= 0) { - assertEq( - beaconSharesBefore, - beaconSharesAfter, - "operator beaconchain shares should not have increased with negative shares" - ); - } else { - assertEq( - beaconSharesBefore + uint256(beaconShares), - beaconSharesAfter, - "operator beaconchain shares not increased correctly" - ); - } - assertTrue(delegationManager.isOperator(defaultOperator), "staker not registered as operator"); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - } - - /** - * @notice `staker` delegates to an operator who does not require any signature verification (i.e. the operator’s `delegationApprover` address is set to the zero address) - * via the `staker` calling `DelegationManager.delegateTo` - * Similar to tests above but now with staker who has both EigenPod and StrategyManager shares. - */ - function testFuzz_OperatorWhoAcceptsAllStakers_BeaconChainAndStrategyManagerShares( - address staker, - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, - bytes32 salt, - int256 beaconShares, - uint256 shares - ) public filterFuzzedAddressInputs(staker) { - // register *this contract* as an operator - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWithBaseDetails(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - // Set staker shares in BeaconChainStrategy and StrategyMananger - IStrategy[] memory strategiesToReturn = new IStrategy[](1); - strategiesToReturn[0] = strategyMock; - uint256[] memory sharesToReturn = new uint256[](1); - sharesToReturn[0] = shares; - strategyManagerMock.setDeposits(staker, strategiesToReturn, sharesToReturn); - eigenPodManagerMock.setPodOwnerShares(staker, beaconShares); - uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesBefore = delegationManager.operatorShares(staker, beaconChainETHStrategy); - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, staker, strategyMock, shares); - if (beaconShares > 0) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, staker, beaconChainETHStrategy, uint256(beaconShares)); - } - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); - if (beaconShares <= 0) { - assertEq( - beaconSharesBefore, - beaconSharesAfter, - "operator beaconchain shares should not have increased with negative shares" - ); - } else { - assertEq( - beaconSharesBefore + uint256(beaconShares), - beaconSharesAfter, - "operator beaconchain shares not increased correctly" - ); - } - assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); - assertTrue(delegationManager.isOperator(defaultOperator), "staker not registered as operator"); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - } - - /** - * @notice `staker` delegates to a operator who does not require any signature verification similar to test above. - * In this scenario, staker doesn't have any delegatable shares and operator shares should not increase. Staker - * should still be correctly delegated to the operator after the call. - */ - function testFuzz_OperatorWhoAcceptsAllStakers_ZeroDelegatableShares( - address staker, - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, - bytes32 salt - ) public filterFuzzedAddressInputs(staker) { - // register *this contract* as an operator - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWithBaseDetails(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - - assertTrue(delegationManager.isOperator(defaultOperator), "staker not registered as operator"); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - } - - /** - * @notice Like `testDelegateToOperatorWhoRequiresECDSASignature` but using an invalid expiry on purpose and checking that reversion occurs - */ - function testFuzz_Revert_WhenOperatorWhoRequiresECDSASignature_ExpiredDelegationApproverSignature( - address staker, - bytes32 salt, - uint256 expiry - ) public filterFuzzedAddressInputs(staker) { - // roll to a very late timestamp - skip(type(uint256).max / 2); - // filter to only *invalid* `expiry` values - expiry = bound(expiry, 0, block.timestamp - 1); - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWithDelegationApprover(defaultOperator); - - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - defaultOperator, - salt, - expiry - ); - - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectRevert("DelegationManager._delegate: approver signature expired"); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - } - - /** - * @notice Like `testDelegateToOperatorWhoRequiresECDSASignature` but undelegating after delegating and trying the same approveSignature - * and checking that reversion occurs with the same salt - */ - function testFuzz_Revert_WhenOperatorWhoRequiresECDSASignature_PreviouslyUsedSalt( - address staker, - bytes32 salt, - uint256 expiry - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - - // filter inputs, since this will fail when the staker is already registered as an operator - // staker also must not be the delegationApprover so that signature verification process takes place - cheats.assume(staker != defaultOperator); - cheats.assume(staker != defaultApprover); - - _registerOperatorWithDelegationApprover(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - defaultOperator, - salt, - expiry - ); - - // delegate from the `staker` to the operator, undelegate, and then try to delegate again with same approversalt - // to check that call reverts - cheats.startPrank(staker); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - assertTrue( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent not spent?" - ); - delegationManager.undelegate(staker); - cheats.expectRevert("DelegationManager._delegate: approverSalt already spent"); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - } - - /** - * @notice Like `testDelegateToOperatorWhoRequiresECDSASignature` but using an incorrect signature on purpose and checking that reversion occurs - */ - function testFuzz_Revert_WhenOperatorWhoRequiresECDSASignature_WithBadSignature( - address staker, - uint256 expiry - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - expiry = bound(expiry, block.timestamp + 1, type(uint256).max); - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator && staker != defaultApprover); - - _registerOperatorWithDelegationApprover(defaultOperator); - - // calculate the signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - approverSignatureAndExpiry.expiry = expiry; - { - bytes32 digestHash = delegationManager.calculateDelegationApprovalDigestHash( - staker, - defaultOperator, - delegationManager.delegationApprover(defaultOperator), - emptySalt, - expiry - ); - (uint8 v, bytes32 r, bytes32 s) = cheats.sign(delegationSignerPrivateKey, digestHash); - // mess up the signature by flipping v's parity - v = (v == 27 ? 28 : 27); - approverSignatureAndExpiry.signature = abi.encodePacked(r, s, v); - } - - // try to delegate from the `staker` to the operator, and check reversion - cheats.startPrank(staker); - cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: signature not from signer"); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); - cheats.stopPrank(); - } - - /** - * @notice `staker` delegates to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) - * via the `staker` calling `DelegationManager.delegateTo` - * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * Reverts if the staker is already delegated (to the operator or to anyone else) - * Reverts if the ‘operator’ is not actually registered as an operator - */ - function testFuzz_OperatorWhoRequiresECDSASignature( - address staker, - bytes32 salt, - uint256 expiry - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWithDelegationApprover(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - defaultOperator, - salt, - expiry - ); - - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - - if (staker == delegationManager.delegationApprover(defaultOperator)) { - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too incorrectly?" - ); - } else { - // verify that the salt is marked as used - assertTrue( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent not spent?" - ); - } - } - - /** - * @notice `staker` delegates to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) - * via the `staker` calling `DelegationManager.delegateTo` - * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * Operator shares should increase by the amount of shares delegated - * Reverts if the staker is already delegated (to the operator or to anyone else) - * Reverts if the ‘operator’ is not actually registered as an operator - */ - function testFuzz_OperatorWhoRequiresECDSASignature_StrategyManagerShares( - address staker, - bytes32 salt, - uint256 expiry, - uint256 shares - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWithDelegationApprover(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - defaultOperator, - salt, - expiry - ); - - // Set staker shares in StrategyManager - IStrategy[] memory strategiesToReturn = new IStrategy[](1); - strategiesToReturn[0] = strategyMock; - uint256[] memory sharesToReturn = new uint256[](1); - sharesToReturn[0] = shares; - strategyManagerMock.setDeposits(staker, strategiesToReturn, sharesToReturn); - uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); - assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - - if (staker == delegationManager.delegationApprover(defaultOperator)) { - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too incorrectly?" - ); - } else { - // verify that the salt is marked as used - assertTrue( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent not spent?" - ); - } - } - - /** - * @notice `staker` delegates to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) - * via the `staker` calling `DelegationManager.delegateTo` - * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * Operator beaconShares should increase by the amount of shares delegated if beaconShares > 0 - * Reverts if the staker is already delegated (to the operator or to anyone else) - * Reverts if the ‘operator’ is not actually registered as an operator - */ - function testFuzz_OperatorWhoRequiresECDSASignature_BeaconChainStrategyShares( - address staker, - bytes32 salt, - uint256 expiry, - int256 beaconShares - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWithDelegationApprover(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - defaultOperator, - salt, - expiry - ); - - // Set staker shares in BeaconChainStrategy - eigenPodManagerMock.setPodOwnerShares(staker, beaconShares); - uint256 beaconSharesBefore = delegationManager.operatorShares(staker, beaconChainETHStrategy); - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - if (beaconShares > 0) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, staker, beaconChainETHStrategy, uint256(beaconShares)); - } - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); - if (beaconShares <= 0) { - assertEq( - beaconSharesBefore, - beaconSharesAfter, - "operator beaconchain shares should not have increased with negative shares" - ); - } else { - assertEq( - beaconSharesBefore + uint256(beaconShares), - beaconSharesAfter, - "operator beaconchain shares not increased correctly" - ); - } - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - - if (staker == delegationManager.delegationApprover(defaultOperator)) { - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too incorrectly?" - ); - } else { - // verify that the salt is marked as used - assertTrue( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent not spent?" - ); - } - } - - /** - * @notice `staker` delegates to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) - * via the `staker` calling `DelegationManager.delegateTo` - * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * Operator beaconshares should increase by the amount of beaconShares delegated if beaconShares > 0 - * Operator strategy manager shares should icnrease by amount of shares - * Reverts if the staker is already delegated (to the operator or to anyone else) - * Reverts if the ‘operator’ is not actually registered as an operator - */ - function testFuzz_OperatorWhoRequiresECDSASignature_BeaconChainAndStrategyManagerShares( - address staker, - bytes32 salt, - uint256 expiry, - int256 beaconShares, - uint256 shares - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - _registerOperatorWithDelegationApprover(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - defaultOperator, - salt, - expiry - ); - - // Set staker shares in BeaconChainStrategy and StrategyMananger - { - IStrategy[] memory strategiesToReturn = new IStrategy[](1); - strategiesToReturn[0] = strategyMock; - uint256[] memory sharesToReturn = new uint256[](1); - sharesToReturn[0] = shares; - strategyManagerMock.setDeposits(staker, strategiesToReturn, sharesToReturn); - eigenPodManagerMock.setPodOwnerShares(staker, beaconShares); - } - uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesBefore = delegationManager.operatorShares(staker, beaconChainETHStrategy); - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, staker, strategyMock, shares); - if (beaconShares > 0) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, staker, beaconChainETHStrategy, uint256(beaconShares)); - } - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); - if (beaconShares <= 0) { - assertEq( - beaconSharesBefore, - beaconSharesAfter, - "operator beaconchain shares should not have increased with negative shares" - ); - } else { - assertEq( - beaconSharesBefore + uint256(beaconShares), - beaconSharesAfter, - "operator beaconchain shares not increased correctly" - ); - } - assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - - if (staker == delegationManager.delegationApprover(defaultOperator)) { - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too incorrectly?" - ); - } else { - // verify that the salt is marked as used - assertTrue( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent not spent?" - ); - } - } - - /** - * @notice delegateTo test with operator's delegationApprover address set to a contract address - * and check that reversion occurs when the signature is expired - */ - function testFuzz_Revert_WhenOperatorWhoRequiresEIP1271Signature_ExpiredDelegationApproverSignature( - address staker, - uint256 expiry - ) public filterFuzzedAddressInputs(staker) { - // roll to a very late timestamp - skip(type(uint256).max / 2); - // filter to only *invalid* `expiry` values - expiry = bound(expiry, 0, block.timestamp - 1); - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWithDelegationApprover(defaultOperator); - - // create the signature struct - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - approverSignatureAndExpiry.expiry = expiry; - - // try to delegate from the `staker` to the operator, and check reversion - cheats.startPrank(staker); - cheats.expectRevert("DelegationManager._delegate: approver signature expired"); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); - cheats.stopPrank(); - } - - /** - * @notice delegateTo test with operator's delegationApprover address set to a contract address - * and check that reversion occurs when the signature approverSalt is already used. - * Performed by delegating to operator, undelegating, and trying to reuse the same signature - */ - function testFuzz_Revert_WhenOperatorWhoRequiresEIP1271Signature_PreviouslyUsedSalt( - address staker, - bytes32 salt, - uint256 expiry - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - - // register *this contract* as an operator - // filter inputs, since this will fail when the staker is already registered as an operator - ERC1271WalletMock wallet = _registerOperatorWith1271DelegationApprover(defaultOperator); - cheats.assume(staker != address(wallet) && staker != defaultOperator); - - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - defaultOperator, - salt, - expiry - ); - - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - delegationManager.undelegate(staker); - // Reusing same signature should revert with salt already being used - cheats.expectRevert("DelegationManager._delegate: approverSalt already spent"); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - } - - /** - * @notice delegateTo test with operator's delegationApprover address set to a contract address that - * is non compliant with EIP1271 - */ - function testFuzz_Revert_WhenOperatorWhoRequiresEIP1271Signature_NonCompliantWallet( - address staker, - uint256 expiry - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - - // register *this contract* as an operator - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - // deploy a ERC1271MaliciousMock contract that will return an incorrect value when called - ERC1271MaliciousMock wallet = new ERC1271MaliciousMock(); - - // filter fuzzed input, since otherwise we can get a flaky failure here. if the caller itself is the 'delegationApprover' - // then we don't even trigger the signature verification call, so we won't get a revert as expected - cheats.assume(staker != address(wallet)); - - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: defaultOperator, - delegationApprover: address(wallet), - stakerOptOutWindowBlocks: 0 - }); - _registerOperator(defaultOperator, operatorDetails, emptyStringForMetadataURI); - - // create the signature struct - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - approverSignatureAndExpiry.expiry = expiry; - - // try to delegate from the `staker` to the operator, and check reversion - cheats.startPrank(staker); - // because the ERC1271MaliciousMock contract returns the wrong amount of data, we get a low-level "EvmError: Revert" message here rather than the error message bubbling up - cheats.expectRevert(); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); - cheats.stopPrank(); - } - - /** - * @notice delegateTo test with operator's delegationApprover address set to a contract address that - * returns a value other than the EIP1271 "magic bytes" and checking that reversion occurs appropriately - */ - function testFuzz_Revert_WhenOperatorWhoRequiresEIP1271Signature_IsValidSignatureFails( - address staker, - bytes32 salt, - uint256 expiry - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - - // register *this contract* as an operator - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - // deploy a ERC1271WalletMock contract that will return an incorrect value when called - // owner is the 0 address - ERC1271WalletMock wallet = new ERC1271WalletMock(address(1)); - - // filter fuzzed input, since otherwise we can get a flaky failure here. if the caller itself is the 'delegationApprover' - // then we don't even trigger the signature verification call, so we won't get a revert as expected - cheats.assume(staker != address(wallet)); - - IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: defaultOperator, - delegationApprover: address(wallet), - stakerOptOutWindowBlocks: 0 - }); - _registerOperator(defaultOperator, operatorDetails, emptyStringForMetadataURI); - - // calculate the delegationSigner's but this is not the correct signature from the wallet contract - // since the wallet owner is address(1) - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - defaultOperator, - salt, - expiry - ); - - // try to delegate from the `staker` to the operator, and check reversion - cheats.startPrank(staker); - // Signature should fail as the wallet will not return EIP1271_MAGICVALUE - cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: ERC1271 signature verification failed"); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); - cheats.stopPrank(); - } - - /** - * @notice `staker` delegates to an operator who requires signature verification through an EIP1271-compliant contract (i.e. the operator’s `delegationApprover` address is - * set to a nonzero and code-containing address) via the `staker` calling `DelegationManager.delegateTo` - * The function uses OZ's ERC1271WalletMock contract, and thus should pass *only when a valid ECDSA signature from the `owner` of the ERC1271WalletMock contract, - * OR if called by the operator or their delegationApprover themselves - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * Reverts if the staker is already delegated (to the operator or to anyone else) - * Reverts if the ‘operator’ is not actually registered as an operator - */ - function testFuzz_OperatorWhoRequiresEIP1271Signature( - address staker, - bytes32 salt, - uint256 expiry - ) public filterFuzzedAddressInputs(staker) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - - // register *this contract* as an operator - // filter inputs, since this will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - _registerOperatorWith1271DelegationApprover(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - staker, - defaultOperator, - salt, - expiry - ); - - // delegate from the `staker` to the operator - cheats.startPrank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(staker, defaultOperator); - delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); - cheats.stopPrank(); - - assertTrue(delegationManager.isDelegated(staker), "staker not delegated correctly"); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); - assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); - - // check that the nonce incremented appropriately - if (staker == defaultOperator || staker == delegationManager.delegationApprover(defaultOperator)) { - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too incorrectly?" - ); - } else { - // verify that the salt is marked as used - assertTrue( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent not spent?" - ); - } - } -} - -contract DelegationManagerUnitTests_delegateToBySignature is DelegationManagerUnitTests { - function test_revert_paused() public { - cheats.prank(defaultOperator); - delegationManager.registerAsOperator( - IDelegationManager.OperatorDetails({ - __deprecated_earningsReceiver: defaultOperator, - delegationApprover: address(0), - stakerOptOutWindowBlocks: 0 - }), - emptyStringForMetadataURI - ); - - // set the pausing flag - cheats.prank(pauser); - delegationManager.pause(2 ** PAUSED_NEW_DELEGATION); - - uint256 expiry = type(uint256).max; - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( - stakerPrivateKey, - defaultOperator, - expiry - ); - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - cheats.expectRevert("Pausable: index is paused"); - delegationManager.delegateToBySignature( - defaultStaker, - defaultOperator, - stakerSignatureAndExpiry, - approverSignatureAndExpiry, - emptySalt - ); - } - - /// @notice Checks that `DelegationManager.delegateToBySignature` reverts if the staker's signature has expired - function testFuzz_Revert_WhenStakerSignatureExpired( - address staker, - address operator, - uint256 expiry, - bytes memory signature - ) public filterFuzzedAddressInputs(staker) filterFuzzedAddressInputs(operator) { - expiry = bound(expiry, 0, block.timestamp - 1); - cheats.expectRevert("DelegationManager.delegateToBySignature: staker signature expired"); - ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ - signature: signature, - expiry: expiry - }); - delegationManager.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, emptySalt); - } - - /// @notice Checks that `DelegationManager.delegateToBySignature` reverts if the staker's ECDSA signature verification fails - function test_Revert_EOAStaker_WhenStakerSignatureVerificationFails() public { - address invalidStaker = address(1000); - address caller = address(2000); - uint256 expiry = type(uint256).max; - - _registerOperatorWithBaseDetails(defaultOperator); - - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( - stakerPrivateKey, - defaultOperator, - expiry - ); - - // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` - // Should revert from invalid signature as staker is not set as the address of signer - cheats.startPrank(caller); - cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: signature not from signer"); - // use an empty approver signature input since none is needed / the input is unchecked - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - delegationManager.delegateToBySignature( - invalidStaker, - defaultOperator, - stakerSignatureAndExpiry, - approverSignatureAndExpiry, - emptySalt - ); - cheats.stopPrank(); - } - - /// @notice Checks that `DelegationManager.delegateToBySignature` reverts if the staker's contract signature verification fails - function test_Revert_ERC1271Staker_WhenStakerSignatureVerficationFails() public { - address staker = address(new ERC1271WalletMock(address(1))); - address caller = address(2000); - uint256 expiry = type(uint256).max; - - _registerOperatorWithBaseDetails(defaultOperator); - - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( - stakerPrivateKey, - defaultOperator, - expiry - ); - - // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` - // Should revert from invalid signature as staker is not set as the address of signer - cheats.startPrank(caller); - cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: ERC1271 signature verification failed"); - // use an empty approver signature input since none is needed / the input is unchecked - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - delegationManager.delegateToBySignature( - staker, - defaultOperator, - stakerSignatureAndExpiry, - approverSignatureAndExpiry, - emptySalt - ); - cheats.stopPrank(); - } - - /// @notice Checks that `DelegationManager.delegateToBySignature` reverts when the staker is already delegated - function test_Revert_Staker_WhenAlreadyDelegated() public { - address staker = cheats.addr(stakerPrivateKey); - address caller = address(2000); - uint256 expiry = type(uint256).max; - - _registerOperatorWithBaseDetails(defaultOperator); - - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( - stakerPrivateKey, - defaultOperator, - expiry - ); - - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` - // Should revert as `staker` has already delegated to `operator` - cheats.startPrank(caller); - cheats.expectRevert("DelegationManager.delegateToBySignature: staker is already actively delegated"); - // use an empty approver signature input since none is needed / the input is unchecked - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - delegationManager.delegateToBySignature( - staker, - defaultOperator, - stakerSignatureAndExpiry, - approverSignatureAndExpiry, - emptySalt - ); - cheats.stopPrank(); - } - - /// @notice Checks that `delegateToBySignature` reverts when operator is not registered after successful staker signature verification - function test_Revert_EOAStaker_OperatorNotRegistered() public { - address staker = cheats.addr(stakerPrivateKey); - address caller = address(2000); - uint256 expiry = type(uint256).max; - - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( - stakerPrivateKey, - defaultOperator, - expiry - ); - - // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` - // Should revert as `operator` is not registered - cheats.startPrank(caller); - cheats.expectRevert("DelegationManager.delegateToBySignature: operator is not registered in EigenLayer"); - // use an empty approver signature input since none is needed / the input is unchecked - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; - delegationManager.delegateToBySignature( - staker, - defaultOperator, - stakerSignatureAndExpiry, - approverSignatureAndExpiry, - emptySalt - ); - cheats.stopPrank(); - } - - /** - * @notice Checks that `DelegationManager.delegateToBySignature` reverts if the delegationApprover's signature has expired - * after successful staker signature verification - */ - function testFuzz_Revert_WhenDelegationApproverSignatureExpired( - address caller, - uint256 stakerExpiry, - uint256 delegationApproverExpiry - ) public filterFuzzedAddressInputs(caller) { - cheats.assume(caller != defaultOperator); +// return (queuedWithdrawalParams, withdrawal, withdrawalRoot); +// } + +// /** +// * Deploy and deposit staker into a single strategy, then set up a queued withdrawal for the staker +// * Assumptions: +// * - operator is already a registered operator. +// * - withdrawalAmount <= depositAmount +// */ +// function _setUpCompleteQueuedWithdrawalSingleStrat( +// address staker, +// address withdrawer, +// uint256 depositAmount, +// uint256 withdrawalAmount +// ) internal returns (IDelegationManager.Withdrawal memory, IERC20[] memory, bytes32) { +// uint256[] memory depositAmounts = new uint256[](1); +// depositAmounts[0] = depositAmount; +// IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); +// ( +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, +// IDelegationManager.Withdrawal memory withdrawal, +// bytes32 withdrawalRoot +// ) = _setUpQueueWithdrawalsSingleStrat({ +// staker: staker, +// withdrawer: withdrawer, +// strategy: strategies[0], +// withdrawalAmount: withdrawalAmount +// }); + +// cheats.prank(staker); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); +// // Set the current deposits to be the depositAmount - withdrawalAmount +// uint256[] memory currentAmounts = new uint256[](1); +// currentAmounts[0] = depositAmount - withdrawalAmount; +// strategyManagerMock.setDeposits(staker, strategies, currentAmounts); + +// IERC20[] memory tokens = new IERC20[](1); +// tokens[0] = strategies[0].underlyingToken(); +// return (withdrawal, tokens, withdrawalRoot); +// } + +// /** +// * Deploy and deposit staker into a single strategy, then set up a queued withdrawal for the staker +// * Assumptions: +// * - operator is already a registered operator. +// * - withdrawalAmount <= depositAmount +// */ +// function _setUpCompleteQueuedWithdrawalBeaconStrat( +// address staker, +// address withdrawer, +// uint256 depositAmount, +// uint256 withdrawalAmount +// ) internal returns (IDelegationManager.Withdrawal memory, IERC20[] memory, bytes32) { +// uint256[] memory depositAmounts = new uint256[](1); +// depositAmounts[0] = depositAmount; +// IStrategy[] memory strategies = new IStrategy[](1); +// strategies[0] = beaconChainETHStrategy; +// ( +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, +// IDelegationManager.Withdrawal memory withdrawal, +// bytes32 withdrawalRoot +// ) = _setUpQueueWithdrawalsSingleStrat({ +// staker: staker, +// withdrawer: withdrawer, +// strategy: strategies[0], +// withdrawalAmount: withdrawalAmount +// }); + +// cheats.prank(staker); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); +// // Set the current deposits to be the depositAmount - withdrawalAmount +// uint256[] memory currentAmounts = new uint256[](1); +// currentAmounts[0] = depositAmount - withdrawalAmount; +// strategyManagerMock.setDeposits(staker, strategies, currentAmounts); + +// IERC20[] memory tokens; +// // tokens[0] = strategies[0].underlyingToken(); +// return (withdrawal, tokens, withdrawalRoot); +// } + +// /** +// * Deploy and deposit staker into strategies, then set up a queued withdrawal for the staker +// * Assumptions: +// * - operator is already a registered operator. +// * - for each i, withdrawalAmount[i] <= depositAmount[i] (see filterFuzzedDepositWithdrawInputs above) +// */ +// function _setUpCompleteQueuedWithdrawal( +// address staker, +// address withdrawer, +// uint256[] memory depositAmounts, +// uint256[] memory withdrawalAmounts +// ) internal returns (IDelegationManager.Withdrawal memory, IERC20[] memory, bytes32) { +// IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); + +// IERC20[] memory tokens = new IERC20[](strategies.length); +// for (uint256 i = 0; i < strategies.length; i++) { +// tokens[i] = strategies[i].underlyingToken(); +// } + +// ( +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, +// IDelegationManager.Withdrawal memory withdrawal, +// bytes32 withdrawalRoot +// ) = _setUpQueueWithdrawals({ +// staker: staker, +// withdrawer: withdrawer, +// strategies: strategies, +// withdrawalAmounts: withdrawalAmounts +// }); + +// cheats.prank(staker); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); + +// return (withdrawal, tokens, withdrawalRoot); +// } +// } + +// contract DelegationManagerUnitTests_Initialization_Setters is DelegationManagerUnitTests { +// function test_initialization() public { +// assertEq( +// address(delegationManager.strategyManager()), +// address(strategyManagerMock), +// "constructor / initializer incorrect, strategyManager set wrong" +// ); +// assertEq( +// address(delegationManager.slasher()), +// address(slasherMock), +// "constructor / initializer incorrect, slasher set wrong" +// ); +// assertEq( +// address(delegationManager.pauserRegistry()), +// address(pauserRegistry), +// "constructor / initializer incorrect, pauserRegistry set wrong" +// ); +// assertEq(delegationManager.owner(), address(this), "constructor / initializer incorrect, owner set wrong"); +// assertEq(delegationManager.paused(), 0, "constructor / initializer incorrect, paused status set wrong"); +// } + +// /// @notice Verifies that the DelegationManager cannot be iniitalized multiple times +// function test_initialize_revert_reinitialization() public { +// cheats.expectRevert("Initializable: contract is already initialized"); +// delegationManager.initialize( +// address(this), +// pauserRegistry, +// 0, +// 0, // minWithdrawalDelayBlocks +// initializeStrategiesToSetDelayBlocks, +// initializeWithdrawalDelayBlocks +// ); +// } + +// function testFuzz_setMinWithdrawalDelayBlocks_revert_notOwner( +// address invalidCaller +// ) public filterFuzzedAddressInputs(invalidCaller) { +// cheats.assume(invalidCaller != delegationManager.owner()); +// cheats.prank(invalidCaller); +// cheats.expectRevert("Ownable: caller is not the owner"); +// delegationManager.setMinWithdrawalDelayBlocks(0); +// } + +// function testFuzz_setMinWithdrawalDelayBlocks_revert_tooLarge(uint256 newMinWithdrawalDelayBlocks) external { +// // filter fuzzed inputs to disallowed amounts +// cheats.assume(newMinWithdrawalDelayBlocks > delegationManager.MAX_WITHDRAWAL_DELAY_BLOCKS()); + +// // attempt to set the `minWithdrawalDelayBlocks` variable +// cheats.expectRevert("DelegationManager._setMinWithdrawalDelayBlocks: _minWithdrawalDelayBlocks cannot be > MAX_WITHDRAWAL_DELAY_BLOCKS"); +// delegationManager.setMinWithdrawalDelayBlocks(newMinWithdrawalDelayBlocks); +// } + +// function testFuzz_initialize_Revert_WhenWithdrawalDelayBlocksTooLarge( +// uint256[] memory withdrawalDelayBlocks, +// uint256 invalidStrategyIndex +// ) public { +// // set withdrawalDelayBlocks to be too large +// cheats.assume(withdrawalDelayBlocks.length > 0); +// uint256 numStrats = withdrawalDelayBlocks.length; +// IStrategy[] memory strategiesToSetDelayBlocks = new IStrategy[](numStrats); +// for (uint256 i = 0; i < numStrats; i++) { +// strategiesToSetDelayBlocks[i] = IStrategy(address(uint160(uint256(keccak256(abi.encode(strategyMock, i)))))); +// } + +// // set at least one index to be too large for withdrawalDelayBlocks +// invalidStrategyIndex = invalidStrategyIndex % numStrats; +// withdrawalDelayBlocks[invalidStrategyIndex] = MAX_WITHDRAWAL_DELAY_BLOCKS + 1; + +// // Deploy DelegationManager implmentation and proxy +// delegationManagerImplementation = new DelegationManager(strategyManagerMock, slasherMock, eigenPodManagerMock); +// cheats.expectRevert( +// "DelegationManager._setStrategyWithdrawalDelayBlocks: _withdrawalDelayBlocks cannot be > MAX_WITHDRAWAL_DELAY_BLOCKS" +// ); +// delegationManager = DelegationManager( +// address( +// new TransparentUpgradeableProxy( +// address(delegationManagerImplementation), +// address(eigenLayerProxyAdmin), +// abi.encodeWithSelector( +// DelegationManager.initialize.selector, +// address(this), +// pauserRegistry, +// 0, // 0 is initialPausedStatus +// minWithdrawalDelayBlocks, +// strategiesToSetDelayBlocks, +// withdrawalDelayBlocks +// ) +// ) +// ) +// ); +// } +// } + +// contract DelegationManagerUnitTests_RegisterModifyOperator is DelegationManagerUnitTests { +// function test_registerAsOperator_revert_paused() public { +// // set the pausing flag +// cheats.prank(pauser); +// delegationManager.pause(2 ** PAUSED_NEW_DELEGATION); + +// cheats.expectRevert("Pausable: index is paused"); +// delegationManager.registerAsOperator( +// IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: defaultOperator, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }), +// emptyStringForMetadataURI +// ); +// } + +// // @notice Verifies that someone cannot successfully call `DelegationManager.registerAsOperator(operatorDetails)` again after registering for the first time +// function testFuzz_registerAsOperator_revert_cannotRegisterMultipleTimes( +// address operator, +// IDelegationManager.OperatorDetails memory operatorDetails +// ) public filterFuzzedAddressInputs(operator) { +// _filterOperatorDetails(operator, operatorDetails); + +// // Register once +// cheats.startPrank(operator); +// delegationManager.registerAsOperator(operatorDetails, emptyStringForMetadataURI); + +// // Expect revert when register again +// cheats.expectRevert("DelegationManager.registerAsOperator: caller is already actively delegated"); +// delegationManager.registerAsOperator(operatorDetails, emptyStringForMetadataURI); +// cheats.stopPrank(); +// } + +// /** +// * @notice Verifies that an operator cannot register with `stakerOptOutWindowBlocks` set larger than `MAX_STAKER_OPT_OUT_WINDOW_BLOCKS` +// */ +// function testFuzz_registerAsOperator_revert_optOutBlocksTooLarge( +// IDelegationManager.OperatorDetails memory operatorDetails +// ) public { +// // filter out *allowed* stakerOptOutWindowBlocks values +// cheats.assume(operatorDetails.stakerOptOutWindowBlocks > delegationManager.MAX_STAKER_OPT_OUT_WINDOW_BLOCKS()); + +// cheats.prank(defaultOperator); +// cheats.expectRevert("DelegationManager._setOperatorDetails: stakerOptOutWindowBlocks cannot be > MAX_STAKER_OPT_OUT_WINDOW_BLOCKS"); +// delegationManager.registerAsOperator(operatorDetails, emptyStringForMetadataURI); +// } + +// /** +// * @notice `operator` registers via calling `DelegationManager.registerAsOperator(operatorDetails, metadataURI)` +// * Should be able to set any parameters, other than too high value for `stakerOptOutWindowBlocks` +// * The set parameters should match the desired parameters (correct storage update) +// * Operator becomes delegated to themselves +// * Properly emits events – especially the `OperatorRegistered` event, but also `StakerDelegated` & `OperatorDetailsModified` events +// * Reverts appropriately if operator was already delegated to someone (including themselves, i.e. they were already an operator) +// * @param operator and @param operatorDetails are fuzzed inputs +// */ +// function testFuzz_registerAsOperator( +// address operator, +// IDelegationManager.OperatorDetails memory operatorDetails, +// string memory metadataURI +// ) public filterFuzzedAddressInputs(operator) { +// _filterOperatorDetails(operator, operatorDetails); + +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorDetailsModified(operator, operatorDetails); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(operator, operator); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorRegistered(operator, operatorDetails); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorMetadataURIUpdated(operator, metadataURI); + +// cheats.prank(operator); +// delegationManager.registerAsOperator(operatorDetails, metadataURI); + +// // Storage checks +// assertEq( +// operatorDetails.delegationApprover, +// delegationManager.delegationApprover(operator), +// "delegationApprover not set correctly" +// ); +// assertEq( +// operatorDetails.stakerOptOutWindowBlocks, +// delegationManager.stakerOptOutWindowBlocks(operator), +// "stakerOptOutWindowBlocks not set correctly" +// ); +// assertEq(delegationManager.delegatedTo(operator), operator, "operator not delegated to self"); +// } + +// // @notice Verifies that a staker who is actively delegated to an operator cannot register as an operator (without first undelegating, at least) +// function testFuzz_registerAsOperator_cannotRegisterWhileDelegated( +// address staker, +// IDelegationManager.OperatorDetails memory operatorDetails +// ) public filterFuzzedAddressInputs(staker) { +// cheats.assume(staker != defaultOperator); +// // Staker becomes an operator, so filter against staker's address +// _filterOperatorDetails(staker, operatorDetails); + +// // register *this contract* as an operator +// _registerOperatorWithBaseDetails(defaultOperator); + +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); + +// // expect revert if attempt to register as operator +// cheats.expectRevert("DelegationManager.registerAsOperator: caller is already actively delegated"); +// delegationManager.registerAsOperator(operatorDetails, emptyStringForMetadataURI); + +// cheats.stopPrank(); +// } + +// /** +// * @notice Tests that an operator can modify their OperatorDetails by calling `DelegationManager.modifyOperatorDetails` +// * Should be able to set any parameters, other than setting their `earningsReceiver` to the zero address or too high value for `stakerOptOutWindowBlocks` +// * The set parameters should match the desired parameters (correct storage update) +// * Properly emits an `OperatorDetailsModified` event +// * Reverts appropriately if the caller is not an operator +// * Reverts if operator tries to decrease their `stakerOptOutWindowBlocks` parameter +// * @param initialOperatorDetails and @param modifiedOperatorDetails are fuzzed inputs +// */ +// function testFuzz_modifyOperatorParameters( +// IDelegationManager.OperatorDetails memory initialOperatorDetails, +// IDelegationManager.OperatorDetails memory modifiedOperatorDetails +// ) public { +// _registerOperator(defaultOperator, initialOperatorDetails, emptyStringForMetadataURI); + +// cheats.startPrank(defaultOperator); + +// // either it fails for trying to set the stakerOptOutWindowBlocks +// if (modifiedOperatorDetails.stakerOptOutWindowBlocks > delegationManager.MAX_STAKER_OPT_OUT_WINDOW_BLOCKS()) { +// cheats.expectRevert( +// "DelegationManager._setOperatorDetails: stakerOptOutWindowBlocks cannot be > MAX_STAKER_OPT_OUT_WINDOW_BLOCKS" +// ); +// delegationManager.modifyOperatorDetails(modifiedOperatorDetails); +// // or the transition is allowed, +// } else if ( +// modifiedOperatorDetails.stakerOptOutWindowBlocks >= initialOperatorDetails.stakerOptOutWindowBlocks +// ) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorDetailsModified(defaultOperator, modifiedOperatorDetails); +// delegationManager.modifyOperatorDetails(modifiedOperatorDetails); + +// assertEq( +// modifiedOperatorDetails.delegationApprover, +// delegationManager.delegationApprover(defaultOperator), +// "delegationApprover not set correctly" +// ); +// assertEq( +// modifiedOperatorDetails.stakerOptOutWindowBlocks, +// delegationManager.stakerOptOutWindowBlocks(defaultOperator), +// "stakerOptOutWindowBlocks not set correctly" +// ); +// assertEq(delegationManager.delegatedTo(defaultOperator), defaultOperator, "operator not delegated to self"); +// // or else the transition is disallowed +// } else { +// cheats.expectRevert("DelegationManager._setOperatorDetails: stakerOptOutWindowBlocks cannot be decreased"); +// delegationManager.modifyOperatorDetails(modifiedOperatorDetails); +// } + +// cheats.stopPrank(); +// } + +// // @notice Tests that an address which is not an operator cannot successfully call `updateOperatorMetadataURI`. +// function test_updateOperatorMetadataUri_notRegistered() public { +// assertFalse(delegationManager.isOperator(defaultOperator), "bad test setup"); + +// cheats.prank(defaultOperator); +// cheats.expectRevert("DelegationManager.updateOperatorMetadataURI: caller must be an operator"); +// delegationManager.updateOperatorMetadataURI(emptyStringForMetadataURI); +// } + +// /** +// * @notice Verifies that a staker cannot call cannot modify their `OperatorDetails` without first registering as an operator +// * @dev This is an important check to ensure that our definition of 'operator' remains consistent, in particular for preserving the +// * invariant that 'operators' are always delegated to themselves +// */ +// function testFuzz_updateOperatorMetadataUri_revert_notOperator( +// IDelegationManager.OperatorDetails memory operatorDetails +// ) public { +// cheats.expectRevert("DelegationManager.modifyOperatorDetails: caller must be an operator"); +// delegationManager.modifyOperatorDetails(operatorDetails); +// } + +// // @notice Tests that an operator who calls `updateOperatorMetadataURI` will correctly see an `OperatorMetadataURIUpdated` event emitted with their input +// function testFuzz_UpdateOperatorMetadataURI(string memory metadataURI) public { +// // register *this contract* as an operator +// _registerOperatorWithBaseDetails(defaultOperator); + +// // call `updateOperatorMetadataURI` and check for event +// cheats.prank(defaultOperator); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorMetadataURIUpdated(defaultOperator, metadataURI); +// delegationManager.updateOperatorMetadataURI(metadataURI); +// } +// } + +// contract DelegationManagerUnitTests_delegateTo is DelegationManagerUnitTests { +// function test_Revert_WhenPaused() public { +// cheats.prank(defaultOperator); +// delegationManager.registerAsOperator( +// IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: defaultOperator, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }), +// emptyStringForMetadataURI +// ); + +// // set the pausing flag +// cheats.prank(pauser); +// delegationManager.pause(2 ** PAUSED_NEW_DELEGATION); + +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// cheats.prank(defaultStaker); +// cheats.expectRevert("Pausable: index is paused"); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); +// } + +// /** +// * @notice Delegates from `staker` to an operator, then verifies that the `staker` cannot delegate to another `operator` (at least without first undelegating) +// */ +// function testFuzz_Revert_WhenDelegateWhileDelegated( +// address staker, +// address operator, +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, +// bytes32 salt +// ) public filterFuzzedAddressInputs(staker) filterFuzzedAddressInputs(operator) { +// // filter out input since if the staker tries to delegate again after registering as an operator, we will revert earlier than this test is designed to check +// cheats.assume(staker != operator); + +// // delegate from the staker to an operator +// cheats.assume(operator != address(this)); +// _registerOperatorWithBaseDetails(operator); +// _delegateToOperatorWhoAcceptsAllStakers(staker, operator); + +// // try to delegate again and check that the call reverts +// cheats.startPrank(staker); +// cheats.expectRevert("DelegationManager.delegateTo: staker is already actively delegated"); +// delegationManager.delegateTo(operator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// } + +// // @notice Verifies that `staker` cannot delegate to an unregistered `operator` +// function testFuzz_Revert_WhenDelegateToUnregisteredOperator( +// address staker, +// address operator +// ) public filterFuzzedAddressInputs(staker) filterFuzzedAddressInputs(operator) { +// assertFalse(delegationManager.isOperator(operator), "incorrect test input?"); + +// // try to delegate and check that the call reverts +// cheats.startPrank(staker); +// cheats.expectRevert("DelegationManager.delegateTo: operator is not registered in EigenLayer"); +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// delegationManager.delegateTo(operator, approverSignatureAndExpiry, emptySalt); +// cheats.stopPrank(); +// } + +// /** +// * @notice `staker` delegates to an operator who does not require any signature verification (i.e. the operator’s `delegationApprover` address is set to the zero address) +// * via the `staker` calling `DelegationManager.delegateTo` +// * The function should pass with any `operatorSignature` input (since it should be unused) +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * Reverts if the staker is already delegated (to the operator or to anyone else) +// * Reverts if the ‘operator’ is not actually registered as an operator +// */ +// function testFuzz_OperatorWhoAcceptsAllStakers_StrategyManagerShares( +// address staker, +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, +// bytes32 salt, +// uint256 shares +// ) public filterFuzzedAddressInputs(staker) { +// // register *this contract* as an operator +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithBaseDetails(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// // Set staker shares in StrategyManager +// IStrategy[] memory strategiesToReturn = new IStrategy[](1); +// strategiesToReturn[0] = strategyMock; +// uint256[] memory sharesToReturn = new uint256[](1); +// sharesToReturn[0] = shares; +// strategyManagerMock.setDeposits(staker, strategiesToReturn, sharesToReturn); +// uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, staker, strategyMock, shares); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); + +// assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); +// assertTrue(delegationManager.isOperator(defaultOperator), "staker not registered as operator"); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// } + +// /** +// * @notice `staker` delegates to an operator who does not require any signature verification (i.e. the operator’s `delegationApprover` address is set to the zero address) +// * via the `staker` calling `DelegationManager.delegateTo` +// * The function should pass with any `operatorSignature` input (since it should be unused) +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * OperatorSharesIncreased event should only be emitted if beaconShares is > 0. Since a staker can have negative shares nothing should happen in that case +// */ +// function testFuzz_OperatorWhoAcceptsAllStakers_BeaconChainStrategyShares( +// address staker, +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, +// bytes32 salt, +// int256 beaconShares +// ) public filterFuzzedAddressInputs(staker) { +// // register *this contract* as an operator +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithBaseDetails(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// // Set staker shares in BeaconChainStrategy +// eigenPodManagerMock.setPodOwnerShares(staker, beaconShares); +// uint256 beaconSharesBefore = delegationManager.operatorShares(staker, beaconChainETHStrategy); +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// if (beaconShares > 0) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, staker, beaconChainETHStrategy, uint256(beaconShares)); +// } +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); +// if (beaconShares <= 0) { +// assertEq( +// beaconSharesBefore, +// beaconSharesAfter, +// "operator beaconchain shares should not have increased with negative shares" +// ); +// } else { +// assertEq( +// beaconSharesBefore + uint256(beaconShares), +// beaconSharesAfter, +// "operator beaconchain shares not increased correctly" +// ); +// } +// assertTrue(delegationManager.isOperator(defaultOperator), "staker not registered as operator"); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// } + +// /** +// * @notice `staker` delegates to an operator who does not require any signature verification (i.e. the operator’s `delegationApprover` address is set to the zero address) +// * via the `staker` calling `DelegationManager.delegateTo` +// * Similar to tests above but now with staker who has both EigenPod and StrategyManager shares. +// */ +// function testFuzz_OperatorWhoAcceptsAllStakers_BeaconChainAndStrategyManagerShares( +// address staker, +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, +// bytes32 salt, +// int256 beaconShares, +// uint256 shares +// ) public filterFuzzedAddressInputs(staker) { +// // register *this contract* as an operator +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithBaseDetails(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// // Set staker shares in BeaconChainStrategy and StrategyMananger +// IStrategy[] memory strategiesToReturn = new IStrategy[](1); +// strategiesToReturn[0] = strategyMock; +// uint256[] memory sharesToReturn = new uint256[](1); +// sharesToReturn[0] = shares; +// strategyManagerMock.setDeposits(staker, strategiesToReturn, sharesToReturn); +// eigenPodManagerMock.setPodOwnerShares(staker, beaconShares); +// uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesBefore = delegationManager.operatorShares(staker, beaconChainETHStrategy); +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, staker, strategyMock, shares); +// if (beaconShares > 0) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, staker, beaconChainETHStrategy, uint256(beaconShares)); +// } +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); +// if (beaconShares <= 0) { +// assertEq( +// beaconSharesBefore, +// beaconSharesAfter, +// "operator beaconchain shares should not have increased with negative shares" +// ); +// } else { +// assertEq( +// beaconSharesBefore + uint256(beaconShares), +// beaconSharesAfter, +// "operator beaconchain shares not increased correctly" +// ); +// } +// assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); +// assertTrue(delegationManager.isOperator(defaultOperator), "staker not registered as operator"); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// } + +// /** +// * @notice `staker` delegates to a operator who does not require any signature verification similar to test above. +// * In this scenario, staker doesn't have any delegatable shares and operator shares should not increase. Staker +// * should still be correctly delegated to the operator after the call. +// */ +// function testFuzz_OperatorWhoAcceptsAllStakers_ZeroDelegatableShares( +// address staker, +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry, +// bytes32 salt +// ) public filterFuzzedAddressInputs(staker) { +// // register *this contract* as an operator +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithBaseDetails(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); + +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); + +// assertTrue(delegationManager.isOperator(defaultOperator), "staker not registered as operator"); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// } + +// /** +// * @notice Like `testDelegateToOperatorWhoRequiresECDSASignature` but using an invalid expiry on purpose and checking that reversion occurs +// */ +// function testFuzz_Revert_WhenOperatorWhoRequiresECDSASignature_ExpiredDelegationApproverSignature( +// address staker, +// bytes32 salt, +// uint256 expiry +// ) public filterFuzzedAddressInputs(staker) { +// // roll to a very late timestamp +// skip(type(uint256).max / 2); +// // filter to only *invalid* `expiry` values +// expiry = bound(expiry, 0, block.timestamp - 1); +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // calculate the delegationSigner's signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// defaultOperator, +// salt, +// expiry +// ); + +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectRevert("DelegationManager._delegate: approver signature expired"); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// } + +// /** +// * @notice Like `testDelegateToOperatorWhoRequiresECDSASignature` but undelegating after delegating and trying the same approveSignature +// * and checking that reversion occurs with the same salt +// */ +// function testFuzz_Revert_WhenOperatorWhoRequiresECDSASignature_PreviouslyUsedSalt( +// address staker, +// bytes32 salt, +// uint256 expiry +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); + +// // filter inputs, since this will fail when the staker is already registered as an operator +// // staker also must not be the delegationApprover so that signature verification process takes place +// cheats.assume(staker != defaultOperator); +// cheats.assume(staker != defaultApprover); + +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// // calculate the delegationSigner's signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// defaultOperator, +// salt, +// expiry +// ); + +// // delegate from the `staker` to the operator, undelegate, and then try to delegate again with same approversalt +// // to check that call reverts +// cheats.startPrank(staker); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// assertTrue( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent not spent?" +// ); +// delegationManager.undelegate(staker); +// cheats.expectRevert("DelegationManager._delegate: approverSalt already spent"); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// } + +// /** +// * @notice Like `testDelegateToOperatorWhoRequiresECDSASignature` but using an incorrect signature on purpose and checking that reversion occurs +// */ +// function testFuzz_Revert_WhenOperatorWhoRequiresECDSASignature_WithBadSignature( +// address staker, +// uint256 expiry +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// expiry = bound(expiry, block.timestamp + 1, type(uint256).max); +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator && staker != defaultApprover); + +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // calculate the signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// approverSignatureAndExpiry.expiry = expiry; +// { +// bytes32 digestHash = delegationManager.calculateDelegationApprovalDigestHash( +// staker, +// defaultOperator, +// delegationManager.delegationApprover(defaultOperator), +// emptySalt, +// expiry +// ); +// (uint8 v, bytes32 r, bytes32 s) = cheats.sign(delegationSignerPrivateKey, digestHash); +// // mess up the signature by flipping v's parity +// v = (v == 27 ? 28 : 27); +// approverSignatureAndExpiry.signature = abi.encodePacked(r, s, v); +// } + +// // try to delegate from the `staker` to the operator, and check reversion +// cheats.startPrank(staker); +// cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: signature not from signer"); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); +// cheats.stopPrank(); +// } + +// /** +// * @notice `staker` delegates to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) +// * via the `staker` calling `DelegationManager.delegateTo` +// * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * Reverts if the staker is already delegated (to the operator or to anyone else) +// * Reverts if the ‘operator’ is not actually registered as an operator +// */ +// function testFuzz_OperatorWhoRequiresECDSASignature( +// address staker, +// bytes32 salt, +// uint256 expiry +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// // calculate the delegationSigner's signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// defaultOperator, +// salt, +// expiry +// ); + +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); + +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); + +// if (staker == delegationManager.delegationApprover(defaultOperator)) { +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too incorrectly?" +// ); +// } else { +// // verify that the salt is marked as used +// assertTrue( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent not spent?" +// ); +// } +// } + +// /** +// * @notice `staker` delegates to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) +// * via the `staker` calling `DelegationManager.delegateTo` +// * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * Operator shares should increase by the amount of shares delegated +// * Reverts if the staker is already delegated (to the operator or to anyone else) +// * Reverts if the ‘operator’ is not actually registered as an operator +// */ +// function testFuzz_OperatorWhoRequiresECDSASignature_StrategyManagerShares( +// address staker, +// bytes32 salt, +// uint256 expiry, +// uint256 shares +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// // calculate the delegationSigner's signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// defaultOperator, +// salt, +// expiry +// ); + +// // Set staker shares in StrategyManager +// IStrategy[] memory strategiesToReturn = new IStrategy[](1); +// strategiesToReturn[0] = strategyMock; +// uint256[] memory sharesToReturn = new uint256[](1); +// sharesToReturn[0] = shares; +// strategyManagerMock.setDeposits(staker, strategiesToReturn, sharesToReturn); +// uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); +// assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); + +// if (staker == delegationManager.delegationApprover(defaultOperator)) { +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too incorrectly?" +// ); +// } else { +// // verify that the salt is marked as used +// assertTrue( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent not spent?" +// ); +// } +// } + +// /** +// * @notice `staker` delegates to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) +// * via the `staker` calling `DelegationManager.delegateTo` +// * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * Operator beaconShares should increase by the amount of shares delegated if beaconShares > 0 +// * Reverts if the staker is already delegated (to the operator or to anyone else) +// * Reverts if the ‘operator’ is not actually registered as an operator +// */ +// function testFuzz_OperatorWhoRequiresECDSASignature_BeaconChainStrategyShares( +// address staker, +// bytes32 salt, +// uint256 expiry, +// int256 beaconShares +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// // calculate the delegationSigner's signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// defaultOperator, +// salt, +// expiry +// ); + +// // Set staker shares in BeaconChainStrategy +// eigenPodManagerMock.setPodOwnerShares(staker, beaconShares); +// uint256 beaconSharesBefore = delegationManager.operatorShares(staker, beaconChainETHStrategy); +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// if (beaconShares > 0) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, staker, beaconChainETHStrategy, uint256(beaconShares)); +// } +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); +// if (beaconShares <= 0) { +// assertEq( +// beaconSharesBefore, +// beaconSharesAfter, +// "operator beaconchain shares should not have increased with negative shares" +// ); +// } else { +// assertEq( +// beaconSharesBefore + uint256(beaconShares), +// beaconSharesAfter, +// "operator beaconchain shares not increased correctly" +// ); +// } +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); + +// if (staker == delegationManager.delegationApprover(defaultOperator)) { +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too incorrectly?" +// ); +// } else { +// // verify that the salt is marked as used +// assertTrue( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent not spent?" +// ); +// } +// } + +// /** +// * @notice `staker` delegates to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) +// * via the `staker` calling `DelegationManager.delegateTo` +// * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * Operator beaconshares should increase by the amount of beaconShares delegated if beaconShares > 0 +// * Operator strategy manager shares should icnrease by amount of shares +// * Reverts if the staker is already delegated (to the operator or to anyone else) +// * Reverts if the ‘operator’ is not actually registered as an operator +// */ +// function testFuzz_OperatorWhoRequiresECDSASignature_BeaconChainAndStrategyManagerShares( +// address staker, +// bytes32 salt, +// uint256 expiry, +// int256 beaconShares, +// uint256 shares +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); + +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// // calculate the delegationSigner's signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// defaultOperator, +// salt, +// expiry +// ); + +// // Set staker shares in BeaconChainStrategy and StrategyMananger +// { +// IStrategy[] memory strategiesToReturn = new IStrategy[](1); +// strategiesToReturn[0] = strategyMock; +// uint256[] memory sharesToReturn = new uint256[](1); +// sharesToReturn[0] = shares; +// strategyManagerMock.setDeposits(staker, strategiesToReturn, sharesToReturn); +// eigenPodManagerMock.setPodOwnerShares(staker, beaconShares); +// } +// uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesBefore = delegationManager.operatorShares(staker, beaconChainETHStrategy); +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, staker, strategyMock, shares); +// if (beaconShares > 0) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, staker, beaconChainETHStrategy, uint256(beaconShares)); +// } +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); +// if (beaconShares <= 0) { +// assertEq( +// beaconSharesBefore, +// beaconSharesAfter, +// "operator beaconchain shares should not have increased with negative shares" +// ); +// } else { +// assertEq( +// beaconSharesBefore + uint256(beaconShares), +// beaconSharesAfter, +// "operator beaconchain shares not increased correctly" +// ); +// } +// assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); + +// if (staker == delegationManager.delegationApprover(defaultOperator)) { +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too incorrectly?" +// ); +// } else { +// // verify that the salt is marked as used +// assertTrue( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent not spent?" +// ); +// } +// } + +// /** +// * @notice delegateTo test with operator's delegationApprover address set to a contract address +// * and check that reversion occurs when the signature is expired +// */ +// function testFuzz_Revert_WhenOperatorWhoRequiresEIP1271Signature_ExpiredDelegationApproverSignature( +// address staker, +// uint256 expiry +// ) public filterFuzzedAddressInputs(staker) { +// // roll to a very late timestamp +// skip(type(uint256).max / 2); +// // filter to only *invalid* `expiry` values +// expiry = bound(expiry, 0, block.timestamp - 1); +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // create the signature struct +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// approverSignatureAndExpiry.expiry = expiry; + +// // try to delegate from the `staker` to the operator, and check reversion +// cheats.startPrank(staker); +// cheats.expectRevert("DelegationManager._delegate: approver signature expired"); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); +// cheats.stopPrank(); +// } + +// /** +// * @notice delegateTo test with operator's delegationApprover address set to a contract address +// * and check that reversion occurs when the signature approverSalt is already used. +// * Performed by delegating to operator, undelegating, and trying to reuse the same signature +// */ +// function testFuzz_Revert_WhenOperatorWhoRequiresEIP1271Signature_PreviouslyUsedSalt( +// address staker, +// bytes32 salt, +// uint256 expiry +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); + +// // register *this contract* as an operator +// // filter inputs, since this will fail when the staker is already registered as an operator +// ERC1271WalletMock wallet = _registerOperatorWith1271DelegationApprover(defaultOperator); +// cheats.assume(staker != address(wallet) && staker != defaultOperator); + +// // calculate the delegationSigner's signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// defaultOperator, +// salt, +// expiry +// ); + +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// delegationManager.undelegate(staker); +// // Reusing same signature should revert with salt already being used +// cheats.expectRevert("DelegationManager._delegate: approverSalt already spent"); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); +// } + +// /** +// * @notice delegateTo test with operator's delegationApprover address set to a contract address that +// * is non compliant with EIP1271 +// */ +// function testFuzz_Revert_WhenOperatorWhoRequiresEIP1271Signature_NonCompliantWallet( +// address staker, +// uint256 expiry +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); + +// // register *this contract* as an operator +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// // deploy a ERC1271MaliciousMock contract that will return an incorrect value when called +// ERC1271MaliciousMock wallet = new ERC1271MaliciousMock(); + +// // filter fuzzed input, since otherwise we can get a flaky failure here. if the caller itself is the 'delegationApprover' +// // then we don't even trigger the signature verification call, so we won't get a revert as expected +// cheats.assume(staker != address(wallet)); + +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: defaultOperator, +// delegationApprover: address(wallet), +// stakerOptOutWindowBlocks: 0 +// }); +// _registerOperator(defaultOperator, operatorDetails, emptyStringForMetadataURI); + +// // create the signature struct +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// approverSignatureAndExpiry.expiry = expiry; + +// // try to delegate from the `staker` to the operator, and check reversion +// cheats.startPrank(staker); +// // because the ERC1271MaliciousMock contract returns the wrong amount of data, we get a low-level "EvmError: Revert" message here rather than the error message bubbling up +// cheats.expectRevert(); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); +// cheats.stopPrank(); +// } + +// /** +// * @notice delegateTo test with operator's delegationApprover address set to a contract address that +// * returns a value other than the EIP1271 "magic bytes" and checking that reversion occurs appropriately +// */ +// function testFuzz_Revert_WhenOperatorWhoRequiresEIP1271Signature_IsValidSignatureFails( +// address staker, +// bytes32 salt, +// uint256 expiry +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); + +// // register *this contract* as an operator +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// // deploy a ERC1271WalletMock contract that will return an incorrect value when called +// // owner is the 0 address +// ERC1271WalletMock wallet = new ERC1271WalletMock(address(1)); + +// // filter fuzzed input, since otherwise we can get a flaky failure here. if the caller itself is the 'delegationApprover' +// // then we don't even trigger the signature verification call, so we won't get a revert as expected +// cheats.assume(staker != address(wallet)); + +// IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: defaultOperator, +// delegationApprover: address(wallet), +// stakerOptOutWindowBlocks: 0 +// }); +// _registerOperator(defaultOperator, operatorDetails, emptyStringForMetadataURI); + +// // calculate the delegationSigner's but this is not the correct signature from the wallet contract +// // since the wallet owner is address(1) +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// defaultOperator, +// salt, +// expiry +// ); + +// // try to delegate from the `staker` to the operator, and check reversion +// cheats.startPrank(staker); +// // Signature should fail as the wallet will not return EIP1271_MAGICVALUE +// cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: ERC1271 signature verification failed"); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, emptySalt); +// cheats.stopPrank(); +// } + +// /** +// * @notice `staker` delegates to an operator who requires signature verification through an EIP1271-compliant contract (i.e. the operator’s `delegationApprover` address is +// * set to a nonzero and code-containing address) via the `staker` calling `DelegationManager.delegateTo` +// * The function uses OZ's ERC1271WalletMock contract, and thus should pass *only when a valid ECDSA signature from the `owner` of the ERC1271WalletMock contract, +// * OR if called by the operator or their delegationApprover themselves +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * Reverts if the staker is already delegated (to the operator or to anyone else) +// * Reverts if the ‘operator’ is not actually registered as an operator +// */ +// function testFuzz_OperatorWhoRequiresEIP1271Signature( +// address staker, +// bytes32 salt, +// uint256 expiry +// ) public filterFuzzedAddressInputs(staker) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); + +// // register *this contract* as an operator +// // filter inputs, since this will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWith1271DelegationApprover(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// // calculate the delegationSigner's signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// staker, +// defaultOperator, +// salt, +// expiry +// ); + +// // delegate from the `staker` to the operator +// cheats.startPrank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(staker, defaultOperator); +// delegationManager.delegateTo(defaultOperator, approverSignatureAndExpiry, salt); +// cheats.stopPrank(); + +// assertTrue(delegationManager.isDelegated(staker), "staker not delegated correctly"); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker delegated to the wrong address"); +// assertFalse(delegationManager.isOperator(staker), "staker incorrectly registered as operator"); + +// // check that the nonce incremented appropriately +// if (staker == defaultOperator || staker == delegationManager.delegationApprover(defaultOperator)) { +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too incorrectly?" +// ); +// } else { +// // verify that the salt is marked as used +// assertTrue( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent not spent?" +// ); +// } +// } +// } + +// contract DelegationManagerUnitTests_delegateToBySignature is DelegationManagerUnitTests { +// function test_revert_paused() public { +// cheats.prank(defaultOperator); +// delegationManager.registerAsOperator( +// IDelegationManager.OperatorDetails({ +// __deprecated_earningsReceiver: defaultOperator, +// delegationApprover: address(0), +// stakerOptOutWindowBlocks: 0 +// }), +// emptyStringForMetadataURI +// ); + +// // set the pausing flag +// cheats.prank(pauser); +// delegationManager.pause(2 ** PAUSED_NEW_DELEGATION); + +// uint256 expiry = type(uint256).max; +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( +// stakerPrivateKey, +// defaultOperator, +// expiry +// ); +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// cheats.expectRevert("Pausable: index is paused"); +// delegationManager.delegateToBySignature( +// defaultStaker, +// defaultOperator, +// stakerSignatureAndExpiry, +// approverSignatureAndExpiry, +// emptySalt +// ); +// } + +// /// @notice Checks that `DelegationManager.delegateToBySignature` reverts if the staker's signature has expired +// function testFuzz_Revert_WhenStakerSignatureExpired( +// address staker, +// address operator, +// uint256 expiry, +// bytes memory signature +// ) public filterFuzzedAddressInputs(staker) filterFuzzedAddressInputs(operator) { +// expiry = bound(expiry, 0, block.timestamp - 1); +// cheats.expectRevert("DelegationManager.delegateToBySignature: staker signature expired"); +// ISignatureUtils.SignatureWithExpiry memory signatureWithExpiry = ISignatureUtils.SignatureWithExpiry({ +// signature: signature, +// expiry: expiry +// }); +// delegationManager.delegateToBySignature(staker, operator, signatureWithExpiry, signatureWithExpiry, emptySalt); +// } + +// /// @notice Checks that `DelegationManager.delegateToBySignature` reverts if the staker's ECDSA signature verification fails +// function test_Revert_EOAStaker_WhenStakerSignatureVerificationFails() public { +// address invalidStaker = address(1000); +// address caller = address(2000); +// uint256 expiry = type(uint256).max; + +// _registerOperatorWithBaseDetails(defaultOperator); + +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( +// stakerPrivateKey, +// defaultOperator, +// expiry +// ); + +// // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` +// // Should revert from invalid signature as staker is not set as the address of signer +// cheats.startPrank(caller); +// cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: signature not from signer"); +// // use an empty approver signature input since none is needed / the input is unchecked +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// delegationManager.delegateToBySignature( +// invalidStaker, +// defaultOperator, +// stakerSignatureAndExpiry, +// approverSignatureAndExpiry, +// emptySalt +// ); +// cheats.stopPrank(); +// } + +// /// @notice Checks that `DelegationManager.delegateToBySignature` reverts if the staker's contract signature verification fails +// function test_Revert_ERC1271Staker_WhenStakerSignatureVerficationFails() public { +// address staker = address(new ERC1271WalletMock(address(1))); +// address caller = address(2000); +// uint256 expiry = type(uint256).max; + +// _registerOperatorWithBaseDetails(defaultOperator); + +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( +// stakerPrivateKey, +// defaultOperator, +// expiry +// ); + +// // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` +// // Should revert from invalid signature as staker is not set as the address of signer +// cheats.startPrank(caller); +// cheats.expectRevert("EIP1271SignatureUtils.checkSignature_EIP1271: ERC1271 signature verification failed"); +// // use an empty approver signature input since none is needed / the input is unchecked +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// delegationManager.delegateToBySignature( +// staker, +// defaultOperator, +// stakerSignatureAndExpiry, +// approverSignatureAndExpiry, +// emptySalt +// ); +// cheats.stopPrank(); +// } + +// /// @notice Checks that `DelegationManager.delegateToBySignature` reverts when the staker is already delegated +// function test_Revert_Staker_WhenAlreadyDelegated() public { +// address staker = cheats.addr(stakerPrivateKey); +// address caller = address(2000); +// uint256 expiry = type(uint256).max; + +// _registerOperatorWithBaseDetails(defaultOperator); + +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( +// stakerPrivateKey, +// defaultOperator, +// expiry +// ); + +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); +// // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` +// // Should revert as `staker` has already delegated to `operator` +// cheats.startPrank(caller); +// cheats.expectRevert("DelegationManager.delegateToBySignature: staker is already actively delegated"); +// // use an empty approver signature input since none is needed / the input is unchecked +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// delegationManager.delegateToBySignature( +// staker, +// defaultOperator, +// stakerSignatureAndExpiry, +// approverSignatureAndExpiry, +// emptySalt +// ); +// cheats.stopPrank(); +// } + +// /// @notice Checks that `delegateToBySignature` reverts when operator is not registered after successful staker signature verification +// function test_Revert_EOAStaker_OperatorNotRegistered() public { +// address staker = cheats.addr(stakerPrivateKey); +// address caller = address(2000); +// uint256 expiry = type(uint256).max; + +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( +// stakerPrivateKey, +// defaultOperator, +// expiry +// ); + +// // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` +// // Should revert as `operator` is not registered +// cheats.startPrank(caller); +// cheats.expectRevert("DelegationManager.delegateToBySignature: operator is not registered in EigenLayer"); +// // use an empty approver signature input since none is needed / the input is unchecked +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry; +// delegationManager.delegateToBySignature( +// staker, +// defaultOperator, +// stakerSignatureAndExpiry, +// approverSignatureAndExpiry, +// emptySalt +// ); +// cheats.stopPrank(); +// } + +// /** +// * @notice Checks that `DelegationManager.delegateToBySignature` reverts if the delegationApprover's signature has expired +// * after successful staker signature verification +// */ +// function testFuzz_Revert_WhenDelegationApproverSignatureExpired( +// address caller, +// uint256 stakerExpiry, +// uint256 delegationApproverExpiry +// ) public filterFuzzedAddressInputs(caller) { +// cheats.assume(caller != defaultOperator); - // roll to a very late timestamp - skip(type(uint256).max / 2); - - // filter to only valid `stakerExpiry` values - stakerExpiry = bound(stakerExpiry, block.timestamp + 1, type(uint256).max); - // filter to only *invalid* `delegationApproverExpiry` values - delegationApproverExpiry = bound(delegationApproverExpiry, 0, block.timestamp - 1); - - console.log("timestamp: %s", block.timestamp); - console.log(stakerExpiry); - console.log(delegationApproverExpiry); - - - _registerOperatorWithDelegationApprover(defaultOperator); - - // calculate the delegationSigner's signature - ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( - delegationSignerPrivateKey, - defaultStaker, - defaultOperator, - emptySalt, - delegationApproverExpiry - ); - - // calculate the staker signature - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( - stakerPrivateKey, - defaultOperator, - stakerExpiry - ); - - // try delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature`, and check for reversion - cheats.startPrank(caller); - cheats.expectRevert("DelegationManager._delegate: approver signature expired"); - delegationManager.delegateToBySignature( - defaultStaker, - defaultOperator, - stakerSignatureAndExpiry, - approverSignatureAndExpiry, - emptySalt - ); - cheats.stopPrank(); - } - - /** - * @notice `staker` becomes delegated to an operator who does not require any signature verification (i.e. the operator’s `delegationApprover` address is set to the zero address) - * via the `caller` calling `DelegationManager.delegateToBySignature` - * The function should pass with any `operatorSignature` input (since it should be unused) - * The function should pass only with a valid `stakerSignatureAndExpiry` input - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * BeaconChainStrategy and StrategyManager operator shares should increase for operator - * Reverts if the staker is already delegated (to the operator or to anyone else) - * Reverts if the ‘operator’ is not actually registered as an operator - */ - function testFuzz_EOAStaker_OperatorWhoAcceptsAllStakers( - address caller, - uint256 expiry, - int256 beaconShares, - uint256 shares - ) public filterFuzzedAddressInputs(caller) { - cheats.assume(expiry >= block.timestamp); - cheats.assume(shares > 0); - - _registerOperatorWithBaseDetails(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - emptySalt - ), - "salt somehow spent too early?" - ); - { - // Set staker shares in BeaconChainStrategy and StrategyMananger - IStrategy[] memory strategiesToReturn = new IStrategy[](1); - strategiesToReturn[0] = strategyMock; - uint256[] memory sharesToReturn = new uint256[](1); - sharesToReturn[0] = shares; - strategyManagerMock.setDeposits(defaultStaker, strategiesToReturn, sharesToReturn); - eigenPodManagerMock.setPodOwnerShares(defaultStaker, beaconShares); - } - - uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesBefore = delegationManager.operatorShares(defaultStaker, beaconChainETHStrategy); - // fetch the staker's current nonce - uint256 currentStakerNonce = delegationManager.stakerNonce(defaultStaker); - // calculate the staker signature - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( - stakerPrivateKey, - defaultOperator, - expiry - ); - - // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(defaultStaker, defaultOperator); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, defaultStaker, strategyMock, shares); - if (beaconShares > 0) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, defaultStaker, beaconChainETHStrategy, uint256(beaconShares)); - } - _delegateToBySignatureOperatorWhoAcceptsAllStakers( - defaultStaker, - caller, - defaultOperator, - stakerSignatureAndExpiry, - emptySalt - ); - - // Check operator shares increases - uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); - if (beaconShares <= 0) { - assertEq( - beaconSharesBefore, - beaconSharesAfter, - "operator beaconchain shares should not have increased with negative shares" - ); - } else { - assertEq( - beaconSharesBefore + uint256(beaconShares), - beaconSharesAfter, - "operator beaconchain shares not increased correctly" - ); - } - assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); - // check all the delegation status changes - assertTrue(delegationManager.isDelegated(defaultStaker), "staker not delegated correctly"); - assertEq( - delegationManager.delegatedTo(defaultStaker), - defaultOperator, - "staker delegated to the wrong address" - ); - assertFalse(delegationManager.isOperator(defaultStaker), "staker incorrectly registered as operator"); - // check that the staker nonce incremented appropriately - assertEq( - delegationManager.stakerNonce(defaultStaker), - currentStakerNonce + 1, - "staker nonce did not increment" - ); - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - emptySalt - ), - "salt somehow spent too incorrectly?" - ); - } - - /** - * @notice `staker` becomes delegated to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) - * via the `caller` calling `DelegationManager.delegateToBySignature` - * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves - * AND with a valid `stakerSignatureAndExpiry` input - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * BeaconChainStrategy and StrategyManager operator shares should increase for operator - * Reverts if the staker is already delegated (to the operator or to anyone else) - * Reverts if the ‘operator’ is not actually registered as an operator - */ - function testFuzz_EOAStaker_OperatorWhoRequiresECDSASignature( - address caller, - bytes32 salt, - uint256 expiry, - int256 beaconShares, - uint256 shares - ) public filterFuzzedAddressInputs(caller) { - // filter to only valid `expiry` values - cheats.assume(expiry >= block.timestamp); - cheats.assume(shares > 0); - - _registerOperatorWithDelegationApprover(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - { - // Set staker shares in BeaconChainStrategy and StrategyMananger - IStrategy[] memory strategiesToReturn = new IStrategy[](1); - strategiesToReturn[0] = strategyMock; - uint256[] memory sharesToReturn = new uint256[](1); - sharesToReturn[0] = shares; - strategyManagerMock.setDeposits(defaultStaker, strategiesToReturn, sharesToReturn); - eigenPodManagerMock.setPodOwnerShares(defaultStaker, beaconShares); - } - - uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesBefore = delegationManager.operatorShares(defaultStaker, beaconChainETHStrategy); - // fetch the staker's current nonce - uint256 currentStakerNonce = delegationManager.stakerNonce(defaultStaker); - // calculate the staker signature - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( - stakerPrivateKey, - defaultOperator, - expiry - ); - - // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(defaultStaker, defaultOperator); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, defaultStaker, strategyMock, shares); - if (beaconShares > 0) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, defaultStaker, beaconChainETHStrategy, uint256(beaconShares)); - } - _delegateToBySignatureOperatorWhoRequiresSig( - defaultStaker, - caller, - defaultOperator, - stakerSignatureAndExpiry, - salt - ); - { - // Check operator shares increases - uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); - if (beaconShares <= 0) { - assertEq( - beaconSharesBefore, - beaconSharesAfter, - "operator beaconchain shares should not have increased with negative shares" - ); - } else { - assertEq( - beaconSharesBefore + uint256(beaconShares), - beaconSharesAfter, - "operator beaconchain shares not increased correctly" - ); - } - assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); - } - assertTrue(delegationManager.isDelegated(defaultStaker), "staker not delegated correctly"); - assertEq( - delegationManager.delegatedTo(defaultStaker), - defaultOperator, - "staker delegated to the wrong address" - ); - assertFalse(delegationManager.isOperator(defaultStaker), "staker incorrectly registered as operator"); - - // check that the delegationApprover nonce incremented appropriately - if (caller == defaultOperator || caller == delegationManager.delegationApprover(defaultOperator)) { - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too incorrectly?" - ); - } else { - // verify that the salt is marked as used - assertTrue( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent not spent?" - ); - } - - // check that the staker nonce incremented appropriately - assertEq( - delegationManager.stakerNonce(defaultStaker), - currentStakerNonce + 1, - "staker nonce did not increment" - ); - } - - /** - * @notice `staker` becomes delegated to an operatorwho requires signature verification through an EIP1271-compliant contract (i.e. the operator’s `delegationApprover` address is - * set to a nonzero and code-containing address) via the `caller` calling `DelegationManager.delegateToBySignature` - * The function uses OZ's ERC1271WalletMock contract, and thus should pass *only when a valid ECDSA signature from the `owner` of the ERC1271WalletMock contract, - * OR if called by the operator or their delegationApprover themselves - * AND with a valid `stakerSignatureAndExpiry` input - * Properly emits a `StakerDelegated` event - * Staker is correctly delegated after the call (i.e. correct storage update) - * Reverts if the staker is already delegated (to the operator or to anyone else) - * Reverts if the ‘operator’ is not actually registered as an operator - */ - function testFuzz_EOAStaker_OperatorWhoRequiresEIP1271Signature( - address caller, - bytes32 salt, - uint256 expiry, - int256 beaconShares, - uint256 shares - ) public filterFuzzedAddressInputs(caller) { - cheats.assume(expiry >= block.timestamp); - cheats.assume(shares > 0); - - _registerOperatorWith1271DelegationApprover(defaultOperator); - - // verify that the salt hasn't been used before - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too early?" - ); - { - // Set staker shares in BeaconChainStrategy and StrategyMananger - IStrategy[] memory strategiesToReturn = new IStrategy[](1); - strategiesToReturn[0] = strategyMock; - uint256[] memory sharesToReturn = new uint256[](1); - sharesToReturn[0] = shares; - strategyManagerMock.setDeposits(defaultStaker, strategiesToReturn, sharesToReturn); - eigenPodManagerMock.setPodOwnerShares(defaultStaker, beaconShares); - } - - uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesBefore = delegationManager.operatorShares(defaultStaker, beaconChainETHStrategy); - // fetch the staker's current nonce - uint256 currentStakerNonce = delegationManager.stakerNonce(defaultStaker); - // calculate the staker signature - ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( - stakerPrivateKey, - defaultOperator, - expiry - ); - - // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerDelegated(defaultStaker, defaultOperator); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, defaultStaker, strategyMock, shares); - if (beaconShares > 0) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, defaultStaker, beaconChainETHStrategy, uint256(beaconShares)); - } - _delegateToBySignatureOperatorWhoRequiresSig( - defaultStaker, - caller, - defaultOperator, - stakerSignatureAndExpiry, - salt - ); - - { - // Check operator shares increases - uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); - uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); - if (beaconShares <= 0) { - assertEq( - beaconSharesBefore, - beaconSharesAfter, - "operator beaconchain shares should not have increased with negative shares" - ); - } else { - assertEq( - beaconSharesBefore + uint256(beaconShares), - beaconSharesAfter, - "operator beaconchain shares not increased correctly" - ); - } - assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); - } - assertTrue(delegationManager.isDelegated(defaultStaker), "staker not delegated correctly"); - assertEq( - delegationManager.delegatedTo(defaultStaker), - defaultOperator, - "staker delegated to the wrong address" - ); - assertFalse(delegationManager.isOperator(defaultStaker), "staker incorrectly registered as operator"); - - // check that the delegationApprover nonce incremented appropriately - if (caller == defaultOperator || caller == delegationManager.delegationApprover(defaultOperator)) { - // verify that the salt is still marked as unused (since it wasn't checked or used) - assertFalse( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent too incorrectly?" - ); - } else { - // verify that the salt is marked as used - assertTrue( - delegationManager.delegationApproverSaltIsSpent( - delegationManager.delegationApprover(defaultOperator), - salt - ), - "salt somehow spent not spent?" - ); - } - - // check that the staker nonce incremented appropriately - assertEq( - delegationManager.stakerNonce(defaultStaker), - currentStakerNonce + 1, - "staker nonce did not increment" - ); - } - - /** - * @notice Calls same delegateToBySignature test but with the staker address being a ERC1271WalletMock - * Generates valid signatures from the staker to delegate to operator `defaultOperator` - */ - function testFuzz_ERC1271Staker_OperatorWhoAcceptsAllStakers( - address caller, - uint256 expiry, - int256 beaconShares, - uint256 shares - ) public filterFuzzedAddressInputs(caller) { - defaultStaker = address(ERC1271WalletMock(cheats.addr(stakerPrivateKey))); - testFuzz_EOAStaker_OperatorWhoAcceptsAllStakers(caller, expiry, beaconShares, shares); - } - - /** - * @notice Calls same delegateToBySignature test but with the staker address being a ERC1271WalletMock - * Generates valid signatures from the staker to delegate to operator `defaultOperator` who has - * a delegationApprover address set to a nonzero EOA - */ - function testFuzz_ERC1271Staker_OperatorWhoRequiresECDSASignature( - address caller, - bytes32 salt, - uint256 expiry, - int256 beaconShares, - uint256 shares - ) public filterFuzzedAddressInputs(caller) { - // Call same test but with the staker address being a ERC1271WalletMock - defaultStaker = address(ERC1271WalletMock(cheats.addr(stakerPrivateKey))); - testFuzz_EOAStaker_OperatorWhoRequiresECDSASignature(caller, salt, expiry, beaconShares, shares); - } - - /** - * @notice Calls same delegateToBySignature test but with the staker address being a ERC1271WalletMock - * Generates valid signatures from the staker to delegate to operator `defaultOperator` who has - * a delegationApprover address set to a nonzero ERC1271 compliant contract - */ - function testFuzz_ERC1271Staker_OperatorWhoRequiresEIP1271Signature( - address caller, - bytes32 salt, - uint256 expiry, - int256 beaconShares, - uint256 shares - ) public filterFuzzedAddressInputs(caller) { - // Call same test but with the staker address being a ERC1271WalletMock - defaultStaker = address(ERC1271WalletMock(cheats.addr(stakerPrivateKey))); - testFuzz_EOAStaker_OperatorWhoRequiresEIP1271Signature(caller, salt, expiry, beaconShares, shares); - } -} - -contract DelegationManagerUnitTests_ShareAdjustment is DelegationManagerUnitTests { - // @notice Verifies that `DelegationManager.increaseDelegatedShares` reverts if not called by the StrategyManager nor EigenPodManager - function testFuzz_increaseDelegatedShares_revert_invalidCaller( - address invalidCaller, - uint256 shares - ) public filterFuzzedAddressInputs(invalidCaller) { - cheats.assume(invalidCaller != address(strategyManagerMock)); - cheats.assume(invalidCaller != address(eigenPodManagerMock)); - cheats.assume(invalidCaller != address(eigenLayerProxyAdmin)); - - cheats.expectRevert("DelegationManager: onlyStrategyManagerOrEigenPodManager"); - delegationManager.increaseDelegatedShares(invalidCaller, strategyMock, shares); - } - - // @notice Verifies that there is no change in shares if the staker is not delegated - function testFuzz_increaseDelegatedShares_noop(address staker) public { - cheats.assume(staker != defaultOperator); - _registerOperatorWithBaseDetails(defaultOperator); - assertFalse(delegationManager.isDelegated(staker), "bad test setup"); - - cheats.prank(address(strategyManagerMock)); - delegationManager.increaseDelegatedShares(staker, strategyMock, 1); - assertEq(delegationManager.operatorShares(defaultOperator, strategyMock), 0, "shares should not have changed"); - } - - /** - * @notice Verifies that `DelegationManager.increaseDelegatedShares` properly increases the delegated `shares` that the operator - * who the `staker` is delegated to has in the strategy - * @dev Checks that there is no change if the staker is not delegated - */ - function testFuzz_increaseDelegatedShares( - address staker, - uint256 shares, - bool delegateFromStakerToOperator - ) public filterFuzzedAddressInputs(staker) { - // filter inputs, since delegating to the operator will fail when the staker is already registered as an operator - cheats.assume(staker != defaultOperator); - - // Register operator - _registerOperatorWithBaseDetails(defaultOperator); - - // delegate from the `staker` to the operator *if `delegateFromStakerToOperator` is 'true'* - if (delegateFromStakerToOperator) { - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - } - - uint256 _delegatedSharesBefore = delegationManager.operatorShares( - delegationManager.delegatedTo(staker), - strategyMock - ); - - if (delegationManager.isDelegated(staker)) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesIncreased(defaultOperator, staker, strategyMock, shares); - } - - cheats.prank(address(strategyManagerMock)); - delegationManager.increaseDelegatedShares(staker, strategyMock, shares); - - uint256 delegatedSharesAfter = delegationManager.operatorShares( - delegationManager.delegatedTo(staker), - strategyMock - ); - - if (delegationManager.isDelegated(staker)) { - assertEq( - delegatedSharesAfter, - _delegatedSharesBefore + shares, - "delegated shares did not increment correctly" - ); - } else { - assertEq(delegatedSharesAfter, _delegatedSharesBefore, "delegated shares incremented incorrectly"); - assertEq(_delegatedSharesBefore, 0, "nonzero shares delegated to zero address!"); - } - } - - // @notice Verifies that `DelegationManager.decreaseDelegatedShares` reverts if not called by the StrategyManager nor EigenPodManager - function testFuzz_decreaseDelegatedShares_revert_invalidCaller( - address invalidCaller, - uint256 shares - ) public filterFuzzedAddressInputs(invalidCaller) { - cheats.assume(invalidCaller != address(strategyManagerMock)); - cheats.assume(invalidCaller != address(eigenPodManagerMock)); - - cheats.startPrank(invalidCaller); - cheats.expectRevert("DelegationManager: onlyStrategyManagerOrEigenPodManager"); - delegationManager.decreaseDelegatedShares(invalidCaller, strategyMock, shares); - } - - // @notice Verifies that there is no change in shares if the staker is not delegated - function testFuzz_decreaseDelegatedShares_noop(address staker) public { - cheats.assume(staker != defaultOperator); - _registerOperatorWithBaseDetails(defaultOperator); - assertFalse(delegationManager.isDelegated(staker), "bad test setup"); - - cheats.prank(address(strategyManagerMock)); - delegationManager.decreaseDelegatedShares(staker, strategyMock, 1); - assertEq(delegationManager.operatorShares(defaultOperator, strategyMock), 0, "shares should not have changed"); - } - - /** - * @notice Verifies that `DelegationManager.decreaseDelegatedShares` properly decreases the delegated `shares` that the operator - * who the `staker` is delegated to has in the strategies - * @dev Checks that there is no change if the staker is not delegated - */ - function testFuzz_decreaseDelegatedShares( - address staker, - IStrategy[] memory strategies, - uint128 shares, - bool delegateFromStakerToOperator - ) public filterFuzzedAddressInputs(staker) { - // sanity-filtering on fuzzed input length & staker - cheats.assume(strategies.length <= 32); - cheats.assume(staker != defaultOperator); - - // Register operator - _registerOperatorWithBaseDetails(defaultOperator); - - // delegate from the `staker` to the operator *if `delegateFromStakerToOperator` is 'true'* - if (delegateFromStakerToOperator) { - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - } - - uint256[] memory sharesInputArray = new uint256[](strategies.length); - - address delegatedTo = delegationManager.delegatedTo(staker); - - // for each strategy in `strategies`, increase delegated shares by `shares` - // noop if the staker is not delegated - cheats.startPrank(address(strategyManagerMock)); - for (uint256 i = 0; i < strategies.length; ++i) { - delegationManager.increaseDelegatedShares(staker, strategies[i], shares); - // store delegated shares in a mapping - delegatedSharesBefore[strategies[i]] = delegationManager.operatorShares(delegatedTo, strategies[i]); - // also construct an array which we'll use in another loop - sharesInputArray[i] = shares; - totalSharesForStrategyInArray[address(strategies[i])] += sharesInputArray[i]; - } - cheats.stopPrank(); - - bool isDelegated = delegationManager.isDelegated(staker); - - // for each strategy in `strategies`, decrease delegated shares by `shares` - { - cheats.startPrank(address(strategyManagerMock)); - address operatorToDecreaseSharesOf = delegationManager.delegatedTo(staker); - if (isDelegated) { - for (uint256 i = 0; i < strategies.length; ++i) { - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit OperatorSharesDecreased( - operatorToDecreaseSharesOf, - staker, - strategies[i], - sharesInputArray[i] - ); - delegationManager.decreaseDelegatedShares(staker, strategies[i], sharesInputArray[i]); - } - } - cheats.stopPrank(); - } - - // check shares after call to `decreaseDelegatedShares` - for (uint256 i = 0; i < strategies.length; ++i) { - uint256 delegatedSharesAfter = delegationManager.operatorShares(delegatedTo, strategies[i]); - - if (isDelegated) { - assertEq( - delegatedSharesAfter + totalSharesForStrategyInArray[address(strategies[i])], - delegatedSharesBefore[strategies[i]], - "delegated shares did not decrement correctly" - ); - assertEq(delegatedSharesAfter, 0, "nonzero shares delegated to"); - } else { - assertEq( - delegatedSharesAfter, - delegatedSharesBefore[strategies[i]], - "delegated shares decremented incorrectly" - ); - assertEq(delegatedSharesBefore[strategies[i]], 0, "nonzero shares delegated to zero address!"); - } - } - } -} - -contract DelegationManagerUnitTests_Undelegate is DelegationManagerUnitTests { - // @notice Verifies that undelegating is not possible when the "undelegation paused" switch is flipped - function test_undelegate_revert_paused(address staker) public filterFuzzedAddressInputs(staker) { - // set the pausing flag - cheats.prank(pauser); - delegationManager.pause(2 ** PAUSED_ENTER_WITHDRAWAL_QUEUE); - - cheats.prank(staker); - cheats.expectRevert("Pausable: index is paused"); - delegationManager.undelegate(staker); - } - - function testFuzz_undelegate_revert_notDelgated( - address undelegatedStaker - ) public filterFuzzedAddressInputs(undelegatedStaker) { - cheats.assume(undelegatedStaker != defaultOperator); - assertFalse(delegationManager.isDelegated(undelegatedStaker), "bad test setup"); - - cheats.prank(undelegatedStaker); - cheats.expectRevert("DelegationManager.undelegate: staker must be delegated to undelegate"); - delegationManager.undelegate(undelegatedStaker); - } - - // @notice Verifies that an operator cannot undelegate from themself (this should always be forbidden) - function testFuzz_undelegate_revert_stakerIsOperator(address operator) public filterFuzzedAddressInputs(operator) { - _registerOperatorWithBaseDetails(operator); - - cheats.prank(operator); - cheats.expectRevert("DelegationManager.undelegate: operators cannot be undelegated"); - delegationManager.undelegate(operator); - } - - /** - * @notice verifies that `DelegationManager.undelegate` reverts if trying to undelegate an operator from themselves - * @param callFromOperatorOrApprover -- calls from the operator if 'false' and the 'approver' if true - */ - function testFuzz_undelegate_operatorCannotForceUndelegateThemself( - address delegationApprover, - bool callFromOperatorOrApprover - ) public filterFuzzedAddressInputs(delegationApprover) { - // register *this contract* as an operator with the default `delegationApprover` - _registerOperatorWithDelegationApprover(defaultOperator); - - address caller; - if (callFromOperatorOrApprover) { - caller = delegationApprover; - } else { - caller = defaultOperator; - } - - // try to call the `undelegate` function and check for reversion - cheats.prank(caller); - cheats.expectRevert("DelegationManager.undelegate: operators cannot be undelegated"); - delegationManager.undelegate(defaultOperator); - } - - //TODO: verify that this check is even needed - function test_undelegate_revert_zeroAddress() public { - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(address(0), defaultOperator); - - cheats.prank(address(0)); - cheats.expectRevert("DelegationManager.undelegate: cannot undelegate zero address"); - delegationManager.undelegate(address(0)); - } - - /** - * @notice Verifies that the `undelegate` function has proper access controls (can only be called by the operator who the `staker` has delegated - * to or the operator's `delegationApprover`), or the staker themselves - */ - function testFuzz_undelegate_revert_invalidCaller( - address invalidCaller - ) public filterFuzzedAddressInputs(invalidCaller) { - address staker = address(0x123); - // filter out addresses that are actually allowed to call the function - cheats.assume(invalidCaller != staker); - cheats.assume(invalidCaller != defaultOperator); - cheats.assume(invalidCaller != defaultApprover); - - _registerOperatorWithDelegationApprover(defaultOperator); - _delegateToOperatorWhoRequiresSig(staker, defaultOperator); - - cheats.prank(invalidCaller); - cheats.expectRevert("DelegationManager.undelegate: caller cannot undelegate staker"); - delegationManager.undelegate(staker); - } - - /** - * Staker is undelegated from an operator, via a call to `undelegate`, properly originating from the staker's address. - * Reverts if the staker is themselves an operator (i.e. they are delegated to themselves) - * Does nothing if the staker is already undelegated - * Properly undelegates the staker, i.e. the staker becomes “delegated to” the zero address, and `isDelegated(staker)` returns ‘false’ - * Emits a `StakerUndelegated` event - */ - function testFuzz_undelegate_noDelegateableShares(address staker) public filterFuzzedAddressInputs(staker) { - cheats.assume(staker != defaultOperator); +// // roll to a very late timestamp +// skip(type(uint256).max / 2); + +// // filter to only valid `stakerExpiry` values +// stakerExpiry = bound(stakerExpiry, block.timestamp + 1, type(uint256).max); +// // filter to only *invalid* `delegationApproverExpiry` values +// delegationApproverExpiry = bound(delegationApproverExpiry, 0, block.timestamp - 1); + +// console.log("timestamp: %s", block.timestamp); +// console.log(stakerExpiry); +// console.log(delegationApproverExpiry); + + +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // calculate the delegationSigner's signature +// ISignatureUtils.SignatureWithExpiry memory approverSignatureAndExpiry = _getApproverSignature( +// delegationSignerPrivateKey, +// defaultStaker, +// defaultOperator, +// emptySalt, +// delegationApproverExpiry +// ); + +// // calculate the staker signature +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( +// stakerPrivateKey, +// defaultOperator, +// stakerExpiry +// ); + +// // try delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature`, and check for reversion +// cheats.startPrank(caller); +// cheats.expectRevert("DelegationManager._delegate: approver signature expired"); +// delegationManager.delegateToBySignature( +// defaultStaker, +// defaultOperator, +// stakerSignatureAndExpiry, +// approverSignatureAndExpiry, +// emptySalt +// ); +// cheats.stopPrank(); +// } + +// /** +// * @notice `staker` becomes delegated to an operator who does not require any signature verification (i.e. the operator’s `delegationApprover` address is set to the zero address) +// * via the `caller` calling `DelegationManager.delegateToBySignature` +// * The function should pass with any `operatorSignature` input (since it should be unused) +// * The function should pass only with a valid `stakerSignatureAndExpiry` input +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * BeaconChainStrategy and StrategyManager operator shares should increase for operator +// * Reverts if the staker is already delegated (to the operator or to anyone else) +// * Reverts if the ‘operator’ is not actually registered as an operator +// */ +// function testFuzz_EOAStaker_OperatorWhoAcceptsAllStakers( +// address caller, +// uint256 expiry, +// int256 beaconShares, +// uint256 shares +// ) public filterFuzzedAddressInputs(caller) { +// cheats.assume(expiry >= block.timestamp); +// cheats.assume(shares > 0); + +// _registerOperatorWithBaseDetails(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// emptySalt +// ), +// "salt somehow spent too early?" +// ); +// { +// // Set staker shares in BeaconChainStrategy and StrategyMananger +// IStrategy[] memory strategiesToReturn = new IStrategy[](1); +// strategiesToReturn[0] = strategyMock; +// uint256[] memory sharesToReturn = new uint256[](1); +// sharesToReturn[0] = shares; +// strategyManagerMock.setDeposits(defaultStaker, strategiesToReturn, sharesToReturn); +// eigenPodManagerMock.setPodOwnerShares(defaultStaker, beaconShares); +// } + +// uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesBefore = delegationManager.operatorShares(defaultStaker, beaconChainETHStrategy); +// // fetch the staker's current nonce +// uint256 currentStakerNonce = delegationManager.stakerNonce(defaultStaker); +// // calculate the staker signature +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( +// stakerPrivateKey, +// defaultOperator, +// expiry +// ); + +// // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(defaultStaker, defaultOperator); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, defaultStaker, strategyMock, shares); +// if (beaconShares > 0) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, defaultStaker, beaconChainETHStrategy, uint256(beaconShares)); +// } +// _delegateToBySignatureOperatorWhoAcceptsAllStakers( +// defaultStaker, +// caller, +// defaultOperator, +// stakerSignatureAndExpiry, +// emptySalt +// ); + +// // Check operator shares increases +// uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); +// if (beaconShares <= 0) { +// assertEq( +// beaconSharesBefore, +// beaconSharesAfter, +// "operator beaconchain shares should not have increased with negative shares" +// ); +// } else { +// assertEq( +// beaconSharesBefore + uint256(beaconShares), +// beaconSharesAfter, +// "operator beaconchain shares not increased correctly" +// ); +// } +// assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); +// // check all the delegation status changes +// assertTrue(delegationManager.isDelegated(defaultStaker), "staker not delegated correctly"); +// assertEq( +// delegationManager.delegatedTo(defaultStaker), +// defaultOperator, +// "staker delegated to the wrong address" +// ); +// assertFalse(delegationManager.isOperator(defaultStaker), "staker incorrectly registered as operator"); +// // check that the staker nonce incremented appropriately +// assertEq( +// delegationManager.stakerNonce(defaultStaker), +// currentStakerNonce + 1, +// "staker nonce did not increment" +// ); +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// emptySalt +// ), +// "salt somehow spent too incorrectly?" +// ); +// } + +// /** +// * @notice `staker` becomes delegated to an operator who requires signature verification through an EOA (i.e. the operator’s `delegationApprover` address is set to a nonzero EOA) +// * via the `caller` calling `DelegationManager.delegateToBySignature` +// * The function should pass *only with a valid ECDSA signature from the `delegationApprover`, OR if called by the operator or their delegationApprover themselves +// * AND with a valid `stakerSignatureAndExpiry` input +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * BeaconChainStrategy and StrategyManager operator shares should increase for operator +// * Reverts if the staker is already delegated (to the operator or to anyone else) +// * Reverts if the ‘operator’ is not actually registered as an operator +// */ +// function testFuzz_EOAStaker_OperatorWhoRequiresECDSASignature( +// address caller, +// bytes32 salt, +// uint256 expiry, +// int256 beaconShares, +// uint256 shares +// ) public filterFuzzedAddressInputs(caller) { +// // filter to only valid `expiry` values +// cheats.assume(expiry >= block.timestamp); +// cheats.assume(shares > 0); + +// _registerOperatorWithDelegationApprover(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// { +// // Set staker shares in BeaconChainStrategy and StrategyMananger +// IStrategy[] memory strategiesToReturn = new IStrategy[](1); +// strategiesToReturn[0] = strategyMock; +// uint256[] memory sharesToReturn = new uint256[](1); +// sharesToReturn[0] = shares; +// strategyManagerMock.setDeposits(defaultStaker, strategiesToReturn, sharesToReturn); +// eigenPodManagerMock.setPodOwnerShares(defaultStaker, beaconShares); +// } + +// uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesBefore = delegationManager.operatorShares(defaultStaker, beaconChainETHStrategy); +// // fetch the staker's current nonce +// uint256 currentStakerNonce = delegationManager.stakerNonce(defaultStaker); +// // calculate the staker signature +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( +// stakerPrivateKey, +// defaultOperator, +// expiry +// ); + +// // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(defaultStaker, defaultOperator); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, defaultStaker, strategyMock, shares); +// if (beaconShares > 0) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, defaultStaker, beaconChainETHStrategy, uint256(beaconShares)); +// } +// _delegateToBySignatureOperatorWhoRequiresSig( +// defaultStaker, +// caller, +// defaultOperator, +// stakerSignatureAndExpiry, +// salt +// ); +// { +// // Check operator shares increases +// uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); +// if (beaconShares <= 0) { +// assertEq( +// beaconSharesBefore, +// beaconSharesAfter, +// "operator beaconchain shares should not have increased with negative shares" +// ); +// } else { +// assertEq( +// beaconSharesBefore + uint256(beaconShares), +// beaconSharesAfter, +// "operator beaconchain shares not increased correctly" +// ); +// } +// assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); +// } +// assertTrue(delegationManager.isDelegated(defaultStaker), "staker not delegated correctly"); +// assertEq( +// delegationManager.delegatedTo(defaultStaker), +// defaultOperator, +// "staker delegated to the wrong address" +// ); +// assertFalse(delegationManager.isOperator(defaultStaker), "staker incorrectly registered as operator"); + +// // check that the delegationApprover nonce incremented appropriately +// if (caller == defaultOperator || caller == delegationManager.delegationApprover(defaultOperator)) { +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too incorrectly?" +// ); +// } else { +// // verify that the salt is marked as used +// assertTrue( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent not spent?" +// ); +// } + +// // check that the staker nonce incremented appropriately +// assertEq( +// delegationManager.stakerNonce(defaultStaker), +// currentStakerNonce + 1, +// "staker nonce did not increment" +// ); +// } + +// /** +// * @notice `staker` becomes delegated to an operatorwho requires signature verification through an EIP1271-compliant contract (i.e. the operator’s `delegationApprover` address is +// * set to a nonzero and code-containing address) via the `caller` calling `DelegationManager.delegateToBySignature` +// * The function uses OZ's ERC1271WalletMock contract, and thus should pass *only when a valid ECDSA signature from the `owner` of the ERC1271WalletMock contract, +// * OR if called by the operator or their delegationApprover themselves +// * AND with a valid `stakerSignatureAndExpiry` input +// * Properly emits a `StakerDelegated` event +// * Staker is correctly delegated after the call (i.e. correct storage update) +// * Reverts if the staker is already delegated (to the operator or to anyone else) +// * Reverts if the ‘operator’ is not actually registered as an operator +// */ +// function testFuzz_EOAStaker_OperatorWhoRequiresEIP1271Signature( +// address caller, +// bytes32 salt, +// uint256 expiry, +// int256 beaconShares, +// uint256 shares +// ) public filterFuzzedAddressInputs(caller) { +// cheats.assume(expiry >= block.timestamp); +// cheats.assume(shares > 0); + +// _registerOperatorWith1271DelegationApprover(defaultOperator); + +// // verify that the salt hasn't been used before +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too early?" +// ); +// { +// // Set staker shares in BeaconChainStrategy and StrategyMananger +// IStrategy[] memory strategiesToReturn = new IStrategy[](1); +// strategiesToReturn[0] = strategyMock; +// uint256[] memory sharesToReturn = new uint256[](1); +// sharesToReturn[0] = shares; +// strategyManagerMock.setDeposits(defaultStaker, strategiesToReturn, sharesToReturn); +// eigenPodManagerMock.setPodOwnerShares(defaultStaker, beaconShares); +// } + +// uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesBefore = delegationManager.operatorShares(defaultStaker, beaconChainETHStrategy); +// // fetch the staker's current nonce +// uint256 currentStakerNonce = delegationManager.stakerNonce(defaultStaker); +// // calculate the staker signature +// ISignatureUtils.SignatureWithExpiry memory stakerSignatureAndExpiry = _getStakerSignature( +// stakerPrivateKey, +// defaultOperator, +// expiry +// ); + +// // delegate from the `staker` to the operator, via having the `caller` call `DelegationManager.delegateToBySignature` +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerDelegated(defaultStaker, defaultOperator); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, defaultStaker, strategyMock, shares); +// if (beaconShares > 0) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, defaultStaker, beaconChainETHStrategy, uint256(beaconShares)); +// } +// _delegateToBySignatureOperatorWhoRequiresSig( +// defaultStaker, +// caller, +// defaultOperator, +// stakerSignatureAndExpiry, +// salt +// ); + +// { +// // Check operator shares increases +// uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, strategyMock); +// uint256 beaconSharesAfter = delegationManager.operatorShares(defaultOperator, beaconChainETHStrategy); +// if (beaconShares <= 0) { +// assertEq( +// beaconSharesBefore, +// beaconSharesAfter, +// "operator beaconchain shares should not have increased with negative shares" +// ); +// } else { +// assertEq( +// beaconSharesBefore + uint256(beaconShares), +// beaconSharesAfter, +// "operator beaconchain shares not increased correctly" +// ); +// } +// assertEq(operatorSharesBefore + shares, operatorSharesAfter, "operator shares not increased correctly"); +// } +// assertTrue(delegationManager.isDelegated(defaultStaker), "staker not delegated correctly"); +// assertEq( +// delegationManager.delegatedTo(defaultStaker), +// defaultOperator, +// "staker delegated to the wrong address" +// ); +// assertFalse(delegationManager.isOperator(defaultStaker), "staker incorrectly registered as operator"); + +// // check that the delegationApprover nonce incremented appropriately +// if (caller == defaultOperator || caller == delegationManager.delegationApprover(defaultOperator)) { +// // verify that the salt is still marked as unused (since it wasn't checked or used) +// assertFalse( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent too incorrectly?" +// ); +// } else { +// // verify that the salt is marked as used +// assertTrue( +// delegationManager.delegationApproverSaltIsSpent( +// delegationManager.delegationApprover(defaultOperator), +// salt +// ), +// "salt somehow spent not spent?" +// ); +// } + +// // check that the staker nonce incremented appropriately +// assertEq( +// delegationManager.stakerNonce(defaultStaker), +// currentStakerNonce + 1, +// "staker nonce did not increment" +// ); +// } + +// /** +// * @notice Calls same delegateToBySignature test but with the staker address being a ERC1271WalletMock +// * Generates valid signatures from the staker to delegate to operator `defaultOperator` +// */ +// function testFuzz_ERC1271Staker_OperatorWhoAcceptsAllStakers( +// address caller, +// uint256 expiry, +// int256 beaconShares, +// uint256 shares +// ) public filterFuzzedAddressInputs(caller) { +// defaultStaker = address(ERC1271WalletMock(cheats.addr(stakerPrivateKey))); +// testFuzz_EOAStaker_OperatorWhoAcceptsAllStakers(caller, expiry, beaconShares, shares); +// } + +// /** +// * @notice Calls same delegateToBySignature test but with the staker address being a ERC1271WalletMock +// * Generates valid signatures from the staker to delegate to operator `defaultOperator` who has +// * a delegationApprover address set to a nonzero EOA +// */ +// function testFuzz_ERC1271Staker_OperatorWhoRequiresECDSASignature( +// address caller, +// bytes32 salt, +// uint256 expiry, +// int256 beaconShares, +// uint256 shares +// ) public filterFuzzedAddressInputs(caller) { +// // Call same test but with the staker address being a ERC1271WalletMock +// defaultStaker = address(ERC1271WalletMock(cheats.addr(stakerPrivateKey))); +// testFuzz_EOAStaker_OperatorWhoRequiresECDSASignature(caller, salt, expiry, beaconShares, shares); +// } + +// /** +// * @notice Calls same delegateToBySignature test but with the staker address being a ERC1271WalletMock +// * Generates valid signatures from the staker to delegate to operator `defaultOperator` who has +// * a delegationApprover address set to a nonzero ERC1271 compliant contract +// */ +// function testFuzz_ERC1271Staker_OperatorWhoRequiresEIP1271Signature( +// address caller, +// bytes32 salt, +// uint256 expiry, +// int256 beaconShares, +// uint256 shares +// ) public filterFuzzedAddressInputs(caller) { +// // Call same test but with the staker address being a ERC1271WalletMock +// defaultStaker = address(ERC1271WalletMock(cheats.addr(stakerPrivateKey))); +// testFuzz_EOAStaker_OperatorWhoRequiresEIP1271Signature(caller, salt, expiry, beaconShares, shares); +// } +// } + +// contract DelegationManagerUnitTests_ShareAdjustment is DelegationManagerUnitTests { +// // @notice Verifies that `DelegationManager.increaseDelegatedScaledShares` reverts if not called by the StrategyManager nor EigenPodManager +// function testFuzz_increaseDelegatedScaledShares_revert_invalidCaller( +// address invalidCaller, +// uint256 shares +// ) public filterFuzzedAddressInputs(invalidCaller) { +// cheats.assume(invalidCaller != address(strategyManagerMock)); +// cheats.assume(invalidCaller != address(eigenPodManagerMock)); +// cheats.assume(invalidCaller != address(eigenLayerProxyAdmin)); + +// cheats.expectRevert("DelegationManager: onlyStrategyManagerOrEigenPodManager"); +// delegationManager.increaseDelegatedScaledShares(invalidCaller, strategyMock, shares); +// } + +// // @notice Verifies that there is no change in shares if the staker is not delegated +// function testFuzz_increaseDelegatedScaledShares_noop(address staker) public { +// cheats.assume(staker != defaultOperator); +// _registerOperatorWithBaseDetails(defaultOperator); +// assertFalse(delegationManager.isDelegated(staker), "bad test setup"); + +// cheats.prank(address(strategyManagerMock)); +// delegationManager.increaseDelegatedScaledShares(staker, strategyMock, 1); +// assertEq(delegationManager.operatorShares(defaultOperator, strategyMock), 0, "shares should not have changed"); +// } + +// /** +// * @notice Verifies that `DelegationManager.increaseDelegatedScaledShares` properly increases the delegated `shares` that the operator +// * who the `staker` is delegated to has in the strategy +// * @dev Checks that there is no change if the staker is not delegated +// */ +// function testFuzz_increaseDelegatedScaledShares( +// address staker, +// uint256 shares, +// bool delegateFromStakerToOperator +// ) public filterFuzzedAddressInputs(staker) { +// // filter inputs, since delegating to the operator will fail when the staker is already registered as an operator +// cheats.assume(staker != defaultOperator); + +// // Register operator +// _registerOperatorWithBaseDetails(defaultOperator); + +// // delegate from the `staker` to the operator *if `delegateFromStakerToOperator` is 'true'* +// if (delegateFromStakerToOperator) { +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); +// } + +// uint256 _delegatedSharesBefore = delegationManager.operatorShares( +// delegationManager.delegatedTo(staker), +// strategyMock +// ); + +// if (delegationManager.isDelegated(staker)) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesIncreased(defaultOperator, staker, strategyMock, shares); +// } + +// cheats.prank(address(strategyManagerMock)); +// delegationManager.increaseDelegatedScaledShares(staker, strategyMock, shares); + +// uint256 delegatedSharesAfter = delegationManager.operatorShares( +// delegationManager.delegatedTo(staker), +// strategyMock +// ); + +// if (delegationManager.isDelegated(staker)) { +// assertEq( +// delegatedSharesAfter, +// _delegatedSharesBefore + shares, +// "delegated shares did not increment correctly" +// ); +// } else { +// assertEq(delegatedSharesAfter, _delegatedSharesBefore, "delegated shares incremented incorrectly"); +// assertEq(_delegatedSharesBefore, 0, "nonzero shares delegated to zero address!"); +// } +// } + +// // @notice Verifies that `DelegationManager.decreaseDelegatedScaledShares` reverts if not called by the StrategyManager nor EigenPodManager +// function testFuzz_decreaseDelegatedScaledShares_revert_invalidCaller( +// address invalidCaller, +// uint256 shares +// ) public filterFuzzedAddressInputs(invalidCaller) { +// cheats.assume(invalidCaller != address(strategyManagerMock)); +// cheats.assume(invalidCaller != address(eigenPodManagerMock)); + +// cheats.startPrank(invalidCaller); +// cheats.expectRevert("DelegationManager: onlyStrategyManagerOrEigenPodManager"); +// delegationManager.decreaseDelegatedScaledShares(invalidCaller, strategyMock, shares); +// } + +// // @notice Verifies that there is no change in shares if the staker is not delegated +// function testFuzz_decreaseDelegatedScaledShares_noop(address staker) public { +// cheats.assume(staker != defaultOperator); +// _registerOperatorWithBaseDetails(defaultOperator); +// assertFalse(delegationManager.isDelegated(staker), "bad test setup"); + +// cheats.prank(address(strategyManagerMock)); +// delegationManager.decreaseDelegatedScaledShares(staker, strategyMock, 1); +// assertEq(delegationManager.operatorShares(defaultOperator, strategyMock), 0, "shares should not have changed"); +// } + +// /** +// * @notice Verifies that `DelegationManager.decreaseDelegatedScaledShares` properly decreases the delegated `shares` that the operator +// * who the `staker` is delegated to has in the strategies +// * @dev Checks that there is no change if the staker is not delegated +// */ +// function testFuzz_decreaseDelegatedScaledShares( +// address staker, +// IStrategy[] memory strategies, +// uint128 shares, +// bool delegateFromStakerToOperator +// ) public filterFuzzedAddressInputs(staker) { +// // sanity-filtering on fuzzed input length & staker +// cheats.assume(strategies.length <= 32); +// cheats.assume(staker != defaultOperator); + +// // Register operator +// _registerOperatorWithBaseDetails(defaultOperator); + +// // delegate from the `staker` to the operator *if `delegateFromStakerToOperator` is 'true'* +// if (delegateFromStakerToOperator) { +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); +// } + +// uint256[] memory sharesInputArray = new uint256[](strategies.length); + +// address delegatedTo = delegationManager.delegatedTo(staker); + +// // for each strategy in `strategies`, increase delegated shares by `shares` +// // noop if the staker is not delegated +// cheats.startPrank(address(strategyManagerMock)); +// for (uint256 i = 0; i < strategies.length; ++i) { +// delegationManager.increaseDelegatedScaledShares(staker, strategies[i], shares); +// // store delegated shares in a mapping +// delegatedSharesBefore[strategies[i]] = delegationManager.operatorShares(delegatedTo, strategies[i]); +// // also construct an array which we'll use in another loop +// sharesInputArray[i] = shares; +// totalSharesForStrategyInArray[address(strategies[i])] += sharesInputArray[i]; +// } +// cheats.stopPrank(); + +// bool isDelegated = delegationManager.isDelegated(staker); + +// // for each strategy in `strategies`, decrease delegated shares by `shares` +// { +// cheats.startPrank(address(strategyManagerMock)); +// address operatorToDecreaseSharesOf = delegationManager.delegatedTo(staker); +// if (isDelegated) { +// for (uint256 i = 0; i < strategies.length; ++i) { +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit OperatorSharesDecreased( +// operatorToDecreaseSharesOf, +// staker, +// strategies[i], +// sharesInputArray[i] +// ); +// delegationManager.decreaseDelegatedScaledShares(staker, strategies[i], sharesInputArray[i]); +// } +// } +// cheats.stopPrank(); +// } + +// // check shares after call to `decreaseDelegatedScaledShares` +// for (uint256 i = 0; i < strategies.length; ++i) { +// uint256 delegatedSharesAfter = delegationManager.operatorShares(delegatedTo, strategies[i]); + +// if (isDelegated) { +// assertEq( +// delegatedSharesAfter + totalSharesForStrategyInArray[address(strategies[i])], +// delegatedSharesBefore[strategies[i]], +// "delegated shares did not decrement correctly" +// ); +// assertEq(delegatedSharesAfter, 0, "nonzero shares delegated to"); +// } else { +// assertEq( +// delegatedSharesAfter, +// delegatedSharesBefore[strategies[i]], +// "delegated shares decremented incorrectly" +// ); +// assertEq(delegatedSharesBefore[strategies[i]], 0, "nonzero shares delegated to zero address!"); +// } +// } +// } +// } + +// contract DelegationManagerUnitTests_Undelegate is DelegationManagerUnitTests { +// // @notice Verifies that undelegating is not possible when the "undelegation paused" switch is flipped +// function test_undelegate_revert_paused(address staker) public filterFuzzedAddressInputs(staker) { +// // set the pausing flag +// cheats.prank(pauser); +// delegationManager.pause(2 ** PAUSED_ENTER_WITHDRAWAL_QUEUE); + +// cheats.prank(staker); +// cheats.expectRevert("Pausable: index is paused"); +// delegationManager.undelegate(staker); +// } + +// function testFuzz_undelegate_revert_notDelgated( +// address undelegatedStaker +// ) public filterFuzzedAddressInputs(undelegatedStaker) { +// cheats.assume(undelegatedStaker != defaultOperator); +// assertFalse(delegationManager.isDelegated(undelegatedStaker), "bad test setup"); + +// cheats.prank(undelegatedStaker); +// cheats.expectRevert("DelegationManager.undelegate: staker must be delegated to undelegate"); +// delegationManager.undelegate(undelegatedStaker); +// } + +// // @notice Verifies that an operator cannot undelegate from themself (this should always be forbidden) +// function testFuzz_undelegate_revert_stakerIsOperator(address operator) public filterFuzzedAddressInputs(operator) { +// _registerOperatorWithBaseDetails(operator); + +// cheats.prank(operator); +// cheats.expectRevert("DelegationManager.undelegate: operators cannot be undelegated"); +// delegationManager.undelegate(operator); +// } + +// /** +// * @notice verifies that `DelegationManager.undelegate` reverts if trying to undelegate an operator from themselves +// * @param callFromOperatorOrApprover -- calls from the operator if 'false' and the 'approver' if true +// */ +// function testFuzz_undelegate_operatorCannotForceUndelegateThemself( +// address delegationApprover, +// bool callFromOperatorOrApprover +// ) public filterFuzzedAddressInputs(delegationApprover) { +// // register *this contract* as an operator with the default `delegationApprover` +// _registerOperatorWithDelegationApprover(defaultOperator); + +// address caller; +// if (callFromOperatorOrApprover) { +// caller = delegationApprover; +// } else { +// caller = defaultOperator; +// } + +// // try to call the `undelegate` function and check for reversion +// cheats.prank(caller); +// cheats.expectRevert("DelegationManager.undelegate: operators cannot be undelegated"); +// delegationManager.undelegate(defaultOperator); +// } + +// //TODO: verify that this check is even needed +// function test_undelegate_revert_zeroAddress() public { +// _registerOperatorWithBaseDetails(defaultOperator); +// _delegateToOperatorWhoAcceptsAllStakers(address(0), defaultOperator); + +// cheats.prank(address(0)); +// cheats.expectRevert("DelegationManager.undelegate: cannot undelegate zero address"); +// delegationManager.undelegate(address(0)); +// } + +// /** +// * @notice Verifies that the `undelegate` function has proper access controls (can only be called by the operator who the `staker` has delegated +// * to or the operator's `delegationApprover`), or the staker themselves +// */ +// function testFuzz_undelegate_revert_invalidCaller( +// address invalidCaller +// ) public filterFuzzedAddressInputs(invalidCaller) { +// address staker = address(0x123); +// // filter out addresses that are actually allowed to call the function +// cheats.assume(invalidCaller != staker); +// cheats.assume(invalidCaller != defaultOperator); +// cheats.assume(invalidCaller != defaultApprover); + +// _registerOperatorWithDelegationApprover(defaultOperator); +// _delegateToOperatorWhoRequiresSig(staker, defaultOperator); + +// cheats.prank(invalidCaller); +// cheats.expectRevert("DelegationManager.undelegate: caller cannot undelegate staker"); +// delegationManager.undelegate(staker); +// } + +// /** +// * Staker is undelegated from an operator, via a call to `undelegate`, properly originating from the staker's address. +// * Reverts if the staker is themselves an operator (i.e. they are delegated to themselves) +// * Does nothing if the staker is already undelegated +// * Properly undelegates the staker, i.e. the staker becomes “delegated to” the zero address, and `isDelegated(staker)` returns ‘false’ +// * Emits a `StakerUndelegated` event +// */ +// function testFuzz_undelegate_noDelegateableShares(address staker) public filterFuzzedAddressInputs(staker) { +// cheats.assume(staker != defaultOperator); - // register *this contract* as an operator and delegate from the `staker` to them - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerUndelegated(staker, delegationManager.delegatedTo(staker)); - cheats.prank(staker); - bytes32[] memory withdrawalRoots = delegationManager.undelegate(staker); - - assertEq(withdrawalRoots.length, 0, "withdrawalRoot should be an empty array"); - assertEq( - delegationManager.delegatedTo(staker), - address(0), - "undelegated staker should be delegated to zero address" - ); - assertFalse(delegationManager.isDelegated(staker), "staker not undelegated"); - } - - /** - * @notice Verifies that the `undelegate` function allows for a force undelegation - */ - function testFuzz_undelegate_forceUndelegation_noDelegateableShares( - address staker, - bytes32 salt, - bool callFromOperatorOrApprover - ) public filterFuzzedAddressInputs(staker) { - cheats.assume(staker != defaultOperator); - - _registerOperatorWithDelegationApprover(defaultOperator); - _delegateToOperatorWhoRequiresSig(staker, defaultOperator, salt); - - address caller; - if (callFromOperatorOrApprover) { - caller = defaultApprover; - } else { - caller = defaultOperator; - } - - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerForceUndelegated(staker, defaultOperator); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit StakerUndelegated(staker, defaultOperator); - cheats.prank(caller); - bytes32[] memory withdrawalRoots = delegationManager.undelegate(staker); - - assertEq(withdrawalRoots.length, 0, "withdrawalRoot should be an empty array"); - assertEq( - delegationManager.delegatedTo(staker), - address(0), - "undelegated staker should be delegated to zero address" - ); - assertFalse(delegationManager.isDelegated(staker), "staker not undelegated"); - } -} - -contract DelegationManagerUnitTests_queueWithdrawals is DelegationManagerUnitTests { - function test_Revert_WhenEnterQueueWithdrawalsPaused() public { - cheats.prank(pauser); - delegationManager.pause(2 ** PAUSED_ENTER_WITHDRAWAL_QUEUE); - (IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, , ) = _setUpQueueWithdrawalsSingleStrat({ - staker: defaultStaker, - withdrawer: defaultStaker, - strategy: strategyMock, - withdrawalAmount: 100 - }); - cheats.expectRevert("Pausable: index is paused"); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - } - - function test_Revert_WhenQueueWithdrawalParamsLengthMismatch() public { - IStrategy[] memory strategyArray = new IStrategy[](1); - strategyArray[0] = strategyMock; - uint256[] memory shareAmounts = new uint256[](2); - shareAmounts[0] = 100; - shareAmounts[1] = 100; - - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams = new IDelegationManager.QueuedWithdrawalParams[](1); - queuedWithdrawalParams[0] = IDelegationManager.QueuedWithdrawalParams({ - strategies: strategyArray, - shares: shareAmounts, - withdrawer: defaultStaker - }); - - cheats.expectRevert("DelegationManager.queueWithdrawal: input length mismatch"); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - } - - function test_Revert_WhenNotStakerWithdrawer(address withdrawer) public { - cheats.assume(withdrawer != defaultStaker); - - (IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, , ) = _setUpQueueWithdrawalsSingleStrat({ - staker: defaultStaker, - withdrawer: withdrawer, - strategy: strategyMock, - withdrawalAmount: 100 - }); - cheats.expectRevert("DelegationManager.queueWithdrawal: withdrawer must be staker"); - cheats.prank(defaultStaker); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - } - - function test_Revert_WhenEmptyStrategiesArray() public { - IStrategy[] memory strategyArray = new IStrategy[](0); - uint256[] memory shareAmounts = new uint256[](0); - address withdrawer = defaultOperator; - - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams = new IDelegationManager.QueuedWithdrawalParams[](1); - queuedWithdrawalParams[0] = IDelegationManager.QueuedWithdrawalParams({ - strategies: strategyArray, - shares: shareAmounts, - withdrawer: withdrawer - }); - - cheats.expectRevert("DelegationManager._removeSharesAndQueueWithdrawal: strategies cannot be empty"); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - } - - /** - * @notice Verifies that `DelegationManager.queueWithdrawals` properly queues a withdrawal for the `withdrawer` - * from the `strategy` for the `sharesAmount`. - * - Asserts that staker is delegated to the operator - * - Asserts that shares for delegatedTo operator are decreased by `sharesAmount` - * - Asserts that staker cumulativeWithdrawalsQueued nonce is incremented - * - Checks that event was emitted with correct withdrawalRoot and withdrawal - */ - function testFuzz_queueWithdrawal_SingleStrat( - address staker, - uint256 depositAmount, - uint256 withdrawalAmount - ) public filterFuzzedAddressInputs(staker) { - cheats.assume(staker != defaultOperator); - cheats.assume(withdrawalAmount > 0 && withdrawalAmount <= depositAmount); - uint256[] memory sharesAmounts = new uint256[](1); - sharesAmounts[0] = depositAmount; - // sharesAmounts is single element so returns single strategy - IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, sharesAmounts); - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - ( - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, - IDelegationManager.Withdrawal memory withdrawal, - bytes32 withdrawalRoot - ) = _setUpQueueWithdrawalsSingleStrat({ - staker: staker, - withdrawer: staker, - strategy: strategies[0], - withdrawalAmount: withdrawalAmount - }); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker should be delegated to operator"); - uint256 nonceBefore = delegationManager.cumulativeWithdrawalsQueued(staker); - uint256 delegatedSharesBefore = delegationManager.operatorShares(defaultOperator, strategies[0]); - - // queueWithdrawals - cheats.prank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit WithdrawalQueued(withdrawalRoot, withdrawal); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - - uint256 nonceAfter = delegationManager.cumulativeWithdrawalsQueued(staker); - uint256 delegatedSharesAfter = delegationManager.operatorShares(defaultOperator, strategies[0]); - assertEq(nonceBefore + 1, nonceAfter, "staker nonce should have incremented"); - assertEq(delegatedSharesBefore - withdrawalAmount, delegatedSharesAfter, "delegated shares not decreased correctly"); - } - - /** - * @notice Verifies that `DelegationManager.queueWithdrawals` properly queues a withdrawal for the `withdrawer` - * with multiple strategies and sharesAmounts. Depending on length sharesAmounts, deploys corresponding number of strategies - * and deposits sharesAmounts into each strategy for the staker and delegates to operator. - * For each strategy, withdrawAmount <= depositAmount - * - Asserts that staker is delegated to the operator - * - Asserts that shares for delegatedTo operator are decreased by `sharesAmount` - * - Asserts that staker cumulativeWithdrawalsQueued nonce is incremented - * - Checks that event was emitted with correct withdrawalRoot and withdrawal - */ - function testFuzz_queueWithdrawal_MultipleStrats( - address staker, - uint256[] memory depositAmounts - ) public filterFuzzedAddressInputs(staker){ - cheats.assume(staker != defaultOperator); - cheats.assume(depositAmounts.length > 0 && depositAmounts.length <= 32); - uint256[] memory withdrawalAmounts = _fuzzWithdrawalAmounts(depositAmounts); - - IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - ( - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, - IDelegationManager.Withdrawal memory withdrawal, - bytes32 withdrawalRoot - ) = _setUpQueueWithdrawals({ - staker: staker, - withdrawer: staker, - strategies: strategies, - withdrawalAmounts: withdrawalAmounts - }); - // Before queueWithdrawal state values - uint256 nonceBefore = delegationManager.cumulativeWithdrawalsQueued(staker); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker should be delegated to operator"); - uint256[] memory delegatedSharesBefore = new uint256[](strategies.length); - for (uint256 i = 0; i < strategies.length; i++) { - delegatedSharesBefore[i] = delegationManager.operatorShares(defaultOperator, strategies[i]); - } - - // queueWithdrawals - cheats.prank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit WithdrawalQueued(withdrawalRoot, withdrawal); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - - // Post queueWithdrawal state values - for (uint256 i = 0; i < strategies.length; i++) { - assertEq( - delegatedSharesBefore[i] - withdrawalAmounts[i], // Shares before - withdrawal amount - delegationManager.operatorShares(defaultOperator, strategies[i]), // Shares after - "delegated shares not decreased correctly" - ); - } - uint256 nonceAfter = delegationManager.cumulativeWithdrawalsQueued(staker); - assertEq(nonceBefore + 1, nonceAfter, "staker nonce should have incremented"); - } - - /** - * @notice Verifies that `DelegationManager.queueWithdrawals` properly queues a withdrawal for the `withdrawer` - * with multiple strategies and sharesAmounts and with thirdPartyTransfersForbidden for one of the strategies. - * Queuing a withdrawal should pass as the `withdrawer` address is the same as the staker. - * - * Depending on length sharesAmounts, deploys corresponding number of strategies - * and deposits sharesAmounts into each strategy for the staker and delegates to operator. - * For each strategy, withdrawAmount <= depositAmount - * - Asserts that staker is delegated to the operator - * - Asserts that shares for delegatedTo operator are decreased by `sharesAmount` - * - Asserts that staker cumulativeWithdrawalsQueued nonce is incremented - * - Checks that event was emitted with correct withdrawalRoot and withdrawal - */ - function testFuzz_queueWithdrawal_ThirdPartyTransfersForbidden( - address staker, - uint256[] memory depositAmounts, - uint256 randSalt - ) public filterFuzzedAddressInputs(staker){ - cheats.assume(depositAmounts.length > 0 && depositAmounts.length <= 32); - cheats.assume(staker != defaultOperator); - uint256[] memory withdrawalAmounts = _fuzzWithdrawalAmounts(depositAmounts); - - IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); - // Randomly set strategy true for thirdPartyTransfersForbidden - uint256 randStrategyIndex = randSalt % strategies.length; - strategyManagerMock.setThirdPartyTransfersForbidden(strategies[randStrategyIndex], true); - - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - ( - IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, - IDelegationManager.Withdrawal memory withdrawal, - bytes32 withdrawalRoot - ) = _setUpQueueWithdrawals({ - staker: staker, - withdrawer: staker, - strategies: strategies, - withdrawalAmounts: withdrawalAmounts - }); - // Before queueWithdrawal state values - uint256 nonceBefore = delegationManager.cumulativeWithdrawalsQueued(staker); - assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker should be delegated to operator"); - uint256[] memory delegatedSharesBefore = new uint256[](strategies.length); - for (uint256 i = 0; i < strategies.length; i++) { - delegatedSharesBefore[i] = delegationManager.operatorShares(defaultOperator, strategies[i]); - } - - // queueWithdrawals - cheats.prank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit WithdrawalQueued(withdrawalRoot, withdrawal); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - - // Post queueWithdrawal state values - for (uint256 i = 0; i < strategies.length; i++) { - assertEq( - delegatedSharesBefore[i] - withdrawalAmounts[i], // Shares before - withdrawal amount - delegationManager.operatorShares(defaultOperator, strategies[i]), // Shares after - "delegated shares not decreased correctly" - ); - } - uint256 nonceAfter = delegationManager.cumulativeWithdrawalsQueued(staker); - assertEq(nonceBefore + 1, nonceAfter, "staker nonce should have incremented"); - } - - /** - * @notice Randomly selects one of the strategies to set thirdPartyTransfersForbidden to true. - * Verifies that `DelegationManager.queueWithdrawals` properly reverts a queuedWithdrawal since the `withdrawer` - * is not the same as the `staker`. - */ - function testFuzz_queueWithdrawal_Revert_WhenThirdPartyTransfersForbidden( - address staker, - address withdrawer, - uint256[] memory depositAmounts, - uint256 randSalt - ) public filterFuzzedAddressInputs(staker) { - cheats.assume(staker != withdrawer && staker != defaultOperator); - cheats.assume(depositAmounts.length > 0 && depositAmounts.length <= 32); - uint256[] memory withdrawalAmounts = _fuzzWithdrawalAmounts(depositAmounts); - - IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); - // Randomly set strategy true for thirdPartyTransfersForbidden - uint256 randStrategyIndex = randSalt % strategies.length; - strategyManagerMock.setThirdPartyTransfersForbidden(strategies[randStrategyIndex], true); - _registerOperatorWithBaseDetails(defaultOperator); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - (IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, , ) = _setUpQueueWithdrawals({ - staker: staker, - withdrawer: withdrawer, - strategies: strategies, - withdrawalAmounts: withdrawalAmounts - }); - - // queueWithdrawals - // NOTE: Originally, you could queue a withdrawal to a different address, which would fail with a specific error - // if third party transfers were forbidden. Now, withdrawing to a different address is forbidden regardless - // of third party transfer status. - cheats.expectRevert( - "DelegationManager.queueWithdrawal: withdrawer must be staker" - ); - cheats.prank(staker); - delegationManager.queueWithdrawals(queuedWithdrawalParams); - } -} - -contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManagerUnitTests { - function test_Revert_WhenExitWithdrawalQueuePaused() public { - cheats.prank(pauser); - delegationManager.pause(2 ** PAUSED_EXIT_WITHDRAWAL_QUEUE); - _registerOperatorWithBaseDetails(defaultOperator); - ( - IDelegationManager.Withdrawal memory withdrawal, - IERC20[] memory tokens, - /* bytes32 withdrawalRoot */ - ) = _setUpCompleteQueuedWithdrawalSingleStrat({ - staker: defaultStaker, - withdrawer: defaultStaker, - depositAmount: 100, - withdrawalAmount: 100 - }); - _delegateToOperatorWhoAcceptsAllStakers(defaultStaker, defaultOperator); - - cheats.expectRevert("Pausable: index is paused"); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); - } - - function test_Revert_WhenInvalidWithdrawalRoot() public { - _registerOperatorWithBaseDetails(defaultOperator); - ( - IDelegationManager.Withdrawal memory withdrawal, - IERC20[] memory tokens, - bytes32 withdrawalRoot - ) = _setUpCompleteQueuedWithdrawalSingleStrat({ - staker: defaultStaker, - withdrawer: defaultStaker, - depositAmount: 100, - withdrawalAmount: 100 - }); - _delegateToOperatorWhoAcceptsAllStakers(defaultStaker, defaultOperator); - - assertTrue(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be pending"); - cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); - cheats.prank(defaultStaker); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); - assertFalse(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be completed and marked false now"); - - cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); - cheats.expectRevert("DelegationManager._completeQueuedWithdrawal: action is not in queue"); - cheats.prank(defaultStaker); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); - } - - /** - * @notice should revert if minWithdrawalDelayBlocks has not passed, and if - * delegationManager.getWithdrawalDelay returns a value greater than minWithdrawalDelayBlocks - * then it should revert if the validBlockNumber has not passed either. - */ - function test_Revert_WhenWithdrawalDelayBlocksNotPassed( - uint256[] memory depositAmounts, - bool receiveAsTokens - ) public { - cheats.assume(depositAmounts.length > 0 && depositAmounts.length <= 32); - uint256[] memory withdrawalAmounts = _fuzzWithdrawalAmounts(depositAmounts); +// // register *this contract* as an operator and delegate from the `staker` to them +// _registerOperatorWithBaseDetails(defaultOperator); +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); + +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerUndelegated(staker, delegationManager.delegatedTo(staker)); +// cheats.prank(staker); +// bytes32[] memory withdrawalRoots = delegationManager.undelegate(staker); + +// assertEq(withdrawalRoots.length, 0, "withdrawalRoot should be an empty array"); +// assertEq( +// delegationManager.delegatedTo(staker), +// address(0), +// "undelegated staker should be delegated to zero address" +// ); +// assertFalse(delegationManager.isDelegated(staker), "staker not undelegated"); +// } + +// /** +// * @notice Verifies that the `undelegate` function allows for a force undelegation +// */ +// function testFuzz_undelegate_forceUndelegation_noDelegateableShares( +// address staker, +// bytes32 salt, +// bool callFromOperatorOrApprover +// ) public filterFuzzedAddressInputs(staker) { +// cheats.assume(staker != defaultOperator); + +// _registerOperatorWithDelegationApprover(defaultOperator); +// _delegateToOperatorWhoRequiresSig(staker, defaultOperator, salt); + +// address caller; +// if (callFromOperatorOrApprover) { +// caller = defaultApprover; +// } else { +// caller = defaultOperator; +// } + +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerForceUndelegated(staker, defaultOperator); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit StakerUndelegated(staker, defaultOperator); +// cheats.prank(caller); +// bytes32[] memory withdrawalRoots = delegationManager.undelegate(staker); + +// assertEq(withdrawalRoots.length, 0, "withdrawalRoot should be an empty array"); +// assertEq( +// delegationManager.delegatedTo(staker), +// address(0), +// "undelegated staker should be delegated to zero address" +// ); +// assertFalse(delegationManager.isDelegated(staker), "staker not undelegated"); +// } +// } + +// contract DelegationManagerUnitTests_queueWithdrawals is DelegationManagerUnitTests { +// function test_Revert_WhenEnterQueueWithdrawalsPaused() public { +// cheats.prank(pauser); +// delegationManager.pause(2 ** PAUSED_ENTER_WITHDRAWAL_QUEUE); +// (IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, , ) = _setUpQueueWithdrawalsSingleStrat({ +// staker: defaultStaker, +// withdrawer: defaultStaker, +// strategy: strategyMock, +// withdrawalAmount: 100 +// }); +// cheats.expectRevert("Pausable: index is paused"); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); +// } + +// function test_Revert_WhenQueueWithdrawalParamsLengthMismatch() public { +// IStrategy[] memory strategyArray = new IStrategy[](1); +// strategyArray[0] = strategyMock; +// uint256[] memory shareAmounts = new uint256[](2); +// shareAmounts[0] = 100; +// shareAmounts[1] = 100; + +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams = new IDelegationManager.QueuedWithdrawalParams[](1); +// queuedWithdrawalParams[0] = IDelegationManager.QueuedWithdrawalParams({ +// strategies: strategyArray, +// shares: shareAmounts, +// withdrawer: defaultStaker +// }); + +// cheats.expectRevert("DelegationManager.queueWithdrawal: input length mismatch"); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); +// } + +// function test_Revert_WhenNotStakerWithdrawer(address withdrawer) public { +// cheats.assume(withdrawer != defaultStaker); + +// (IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, , ) = _setUpQueueWithdrawalsSingleStrat({ +// staker: defaultStaker, +// withdrawer: withdrawer, +// strategy: strategyMock, +// withdrawalAmount: 100 +// }); +// cheats.expectRevert("DelegationManager.queueWithdrawal: withdrawer must be staker"); +// cheats.prank(defaultStaker); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); +// } + +// function test_Revert_WhenEmptyStrategiesArray() public { +// IStrategy[] memory strategyArray = new IStrategy[](0); +// uint256[] memory shareAmounts = new uint256[](0); +// address withdrawer = defaultOperator; + +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams = new IDelegationManager.QueuedWithdrawalParams[](1); +// queuedWithdrawalParams[0] = IDelegationManager.QueuedWithdrawalParams({ +// strategies: strategyArray, +// shares: shareAmounts, +// withdrawer: withdrawer +// }); + +// cheats.expectRevert("DelegationManager._removeSharesAndQueueWithdrawal: strategies cannot be empty"); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); +// } + +// /** +// * @notice Verifies that `DelegationManager.queueWithdrawals` properly queues a withdrawal for the `withdrawer` +// * from the `strategy` for the `sharesAmount`. +// * - Asserts that staker is delegated to the operator +// * - Asserts that shares for delegatedTo operator are decreased by `sharesAmount` +// * - Asserts that staker cumulativeWithdrawalsQueued nonce is incremented +// * - Checks that event was emitted with correct withdrawalRoot and withdrawal +// */ +// function testFuzz_queueWithdrawal_SingleStrat( +// address staker, +// uint256 depositAmount, +// uint256 withdrawalAmount +// ) public filterFuzzedAddressInputs(staker) { +// cheats.assume(staker != defaultOperator); +// cheats.assume(withdrawalAmount > 0 && withdrawalAmount <= depositAmount); +// uint256[] memory sharesAmounts = new uint256[](1); +// sharesAmounts[0] = depositAmount; +// // sharesAmounts is single element so returns single strategy +// IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, sharesAmounts); +// _registerOperatorWithBaseDetails(defaultOperator); +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); +// ( +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, +// IDelegationManager.Withdrawal memory withdrawal, +// bytes32 withdrawalRoot +// ) = _setUpQueueWithdrawalsSingleStrat({ +// staker: staker, +// withdrawer: staker, +// strategy: strategies[0], +// withdrawalAmount: withdrawalAmount +// }); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker should be delegated to operator"); +// uint256 nonceBefore = delegationManager.cumulativeWithdrawalsQueued(staker); +// uint256 delegatedSharesBefore = delegationManager.operatorShares(defaultOperator, strategies[0]); + +// // queueWithdrawals +// cheats.prank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit WithdrawalQueued(withdrawalRoot, withdrawal); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); + +// uint256 nonceAfter = delegationManager.cumulativeWithdrawalsQueued(staker); +// uint256 delegatedSharesAfter = delegationManager.operatorShares(defaultOperator, strategies[0]); +// assertEq(nonceBefore + 1, nonceAfter, "staker nonce should have incremented"); +// assertEq(delegatedSharesBefore - withdrawalAmount, delegatedSharesAfter, "delegated shares not decreased correctly"); +// } + +// /** +// * @notice Verifies that `DelegationManager.queueWithdrawals` properly queues a withdrawal for the `withdrawer` +// * with multiple strategies and sharesAmounts. Depending on length sharesAmounts, deploys corresponding number of strategies +// * and deposits sharesAmounts into each strategy for the staker and delegates to operator. +// * For each strategy, withdrawAmount <= depositAmount +// * - Asserts that staker is delegated to the operator +// * - Asserts that shares for delegatedTo operator are decreased by `sharesAmount` +// * - Asserts that staker cumulativeWithdrawalsQueued nonce is incremented +// * - Checks that event was emitted with correct withdrawalRoot and withdrawal +// */ +// function testFuzz_queueWithdrawal_MultipleStrats( +// address staker, +// uint256[] memory depositAmounts +// ) public filterFuzzedAddressInputs(staker){ +// cheats.assume(staker != defaultOperator); +// cheats.assume(depositAmounts.length > 0 && depositAmounts.length <= 32); +// uint256[] memory withdrawalAmounts = _fuzzWithdrawalAmounts(depositAmounts); + +// IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); +// _registerOperatorWithBaseDetails(defaultOperator); +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); +// ( +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, +// IDelegationManager.Withdrawal memory withdrawal, +// bytes32 withdrawalRoot +// ) = _setUpQueueWithdrawals({ +// staker: staker, +// withdrawer: staker, +// strategies: strategies, +// withdrawalAmounts: withdrawalAmounts +// }); +// // Before queueWithdrawal state values +// uint256 nonceBefore = delegationManager.cumulativeWithdrawalsQueued(staker); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker should be delegated to operator"); +// uint256[] memory delegatedSharesBefore = new uint256[](strategies.length); +// for (uint256 i = 0; i < strategies.length; i++) { +// delegatedSharesBefore[i] = delegationManager.operatorShares(defaultOperator, strategies[i]); +// } + +// // queueWithdrawals +// cheats.prank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit WithdrawalQueued(withdrawalRoot, withdrawal); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); + +// // Post queueWithdrawal state values +// for (uint256 i = 0; i < strategies.length; i++) { +// assertEq( +// delegatedSharesBefore[i] - withdrawalAmounts[i], // Shares before - withdrawal amount +// delegationManager.operatorShares(defaultOperator, strategies[i]), // Shares after +// "delegated shares not decreased correctly" +// ); +// } +// uint256 nonceAfter = delegationManager.cumulativeWithdrawalsQueued(staker); +// assertEq(nonceBefore + 1, nonceAfter, "staker nonce should have incremented"); +// } + +// /** +// * @notice Verifies that `DelegationManager.queueWithdrawals` properly queues a withdrawal for the `withdrawer` +// * with multiple strategies and sharesAmounts and with thirdPartyTransfersForbidden for one of the strategies. +// * Queuing a withdrawal should pass as the `withdrawer` address is the same as the staker. +// * +// * Depending on length sharesAmounts, deploys corresponding number of strategies +// * and deposits sharesAmounts into each strategy for the staker and delegates to operator. +// * For each strategy, withdrawAmount <= depositAmount +// * - Asserts that staker is delegated to the operator +// * - Asserts that shares for delegatedTo operator are decreased by `sharesAmount` +// * - Asserts that staker cumulativeWithdrawalsQueued nonce is incremented +// * - Checks that event was emitted with correct withdrawalRoot and withdrawal +// */ +// function testFuzz_queueWithdrawal_ThirdPartyTransfersForbidden( +// address staker, +// uint256[] memory depositAmounts, +// uint256 randSalt +// ) public filterFuzzedAddressInputs(staker){ +// cheats.assume(depositAmounts.length > 0 && depositAmounts.length <= 32); +// cheats.assume(staker != defaultOperator); +// uint256[] memory withdrawalAmounts = _fuzzWithdrawalAmounts(depositAmounts); + +// IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); +// // Randomly set strategy true for thirdPartyTransfersForbidden +// uint256 randStrategyIndex = randSalt % strategies.length; +// strategyManagerMock.setThirdPartyTransfersForbidden(strategies[randStrategyIndex], true); + +// _registerOperatorWithBaseDetails(defaultOperator); +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); +// ( +// IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, +// IDelegationManager.Withdrawal memory withdrawal, +// bytes32 withdrawalRoot +// ) = _setUpQueueWithdrawals({ +// staker: staker, +// withdrawer: staker, +// strategies: strategies, +// withdrawalAmounts: withdrawalAmounts +// }); +// // Before queueWithdrawal state values +// uint256 nonceBefore = delegationManager.cumulativeWithdrawalsQueued(staker); +// assertEq(delegationManager.delegatedTo(staker), defaultOperator, "staker should be delegated to operator"); +// uint256[] memory delegatedSharesBefore = new uint256[](strategies.length); +// for (uint256 i = 0; i < strategies.length; i++) { +// delegatedSharesBefore[i] = delegationManager.operatorShares(defaultOperator, strategies[i]); +// } + +// // queueWithdrawals +// cheats.prank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit WithdrawalQueued(withdrawalRoot, withdrawal); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); + +// // Post queueWithdrawal state values +// for (uint256 i = 0; i < strategies.length; i++) { +// assertEq( +// delegatedSharesBefore[i] - withdrawalAmounts[i], // Shares before - withdrawal amount +// delegationManager.operatorShares(defaultOperator, strategies[i]), // Shares after +// "delegated shares not decreased correctly" +// ); +// } +// uint256 nonceAfter = delegationManager.cumulativeWithdrawalsQueued(staker); +// assertEq(nonceBefore + 1, nonceAfter, "staker nonce should have incremented"); +// } + +// /** +// * @notice Randomly selects one of the strategies to set thirdPartyTransfersForbidden to true. +// * Verifies that `DelegationManager.queueWithdrawals` properly reverts a queuedWithdrawal since the `withdrawer` +// * is not the same as the `staker`. +// */ +// function testFuzz_queueWithdrawal_Revert_WhenThirdPartyTransfersForbidden( +// address staker, +// address withdrawer, +// uint256[] memory depositAmounts, +// uint256 randSalt +// ) public filterFuzzedAddressInputs(staker) { +// cheats.assume(staker != withdrawer && staker != defaultOperator); +// cheats.assume(depositAmounts.length > 0 && depositAmounts.length <= 32); +// uint256[] memory withdrawalAmounts = _fuzzWithdrawalAmounts(depositAmounts); + +// IStrategy[] memory strategies = _deployAndDepositIntoStrategies(staker, depositAmounts); +// // Randomly set strategy true for thirdPartyTransfersForbidden +// uint256 randStrategyIndex = randSalt % strategies.length; +// strategyManagerMock.setThirdPartyTransfersForbidden(strategies[randStrategyIndex], true); +// _registerOperatorWithBaseDetails(defaultOperator); +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); +// (IDelegationManager.QueuedWithdrawalParams[] memory queuedWithdrawalParams, , ) = _setUpQueueWithdrawals({ +// staker: staker, +// withdrawer: withdrawer, +// strategies: strategies, +// withdrawalAmounts: withdrawalAmounts +// }); + +// // queueWithdrawals +// // NOTE: Originally, you could queue a withdrawal to a different address, which would fail with a specific error +// // if third party transfers were forbidden. Now, withdrawing to a different address is forbidden regardless +// // of third party transfer status. +// cheats.expectRevert( +// "DelegationManager.queueWithdrawal: withdrawer must be staker" +// ); +// cheats.prank(staker); +// delegationManager.queueWithdrawals(queuedWithdrawalParams); +// } +// } + +// contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManagerUnitTests { +// function test_Revert_WhenExitWithdrawalQueuePaused() public { +// cheats.prank(pauser); +// delegationManager.pause(2 ** PAUSED_EXIT_WITHDRAWAL_QUEUE); +// _registerOperatorWithBaseDetails(defaultOperator); +// ( +// IDelegationManager.Withdrawal memory withdrawal, +// IERC20[] memory tokens, +// /* bytes32 withdrawalRoot */ +// ) = _setUpCompleteQueuedWithdrawalSingleStrat({ +// staker: defaultStaker, +// withdrawer: defaultStaker, +// depositAmount: 100, +// withdrawalAmount: 100 +// }); +// _delegateToOperatorWhoAcceptsAllStakers(defaultStaker, defaultOperator); + +// cheats.expectRevert("Pausable: index is paused"); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); +// } + +// function test_Revert_WhenInvalidWithdrawalRoot() public { +// _registerOperatorWithBaseDetails(defaultOperator); +// ( +// IDelegationManager.Withdrawal memory withdrawal, +// IERC20[] memory tokens, +// bytes32 withdrawalRoot +// ) = _setUpCompleteQueuedWithdrawalSingleStrat({ +// staker: defaultStaker, +// withdrawer: defaultStaker, +// depositAmount: 100, +// withdrawalAmount: 100 +// }); +// _delegateToOperatorWhoAcceptsAllStakers(defaultStaker, defaultOperator); + +// assertTrue(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be pending"); +// cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); +// cheats.prank(defaultStaker); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); +// assertFalse(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be completed and marked false now"); + +// cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); +// cheats.expectRevert("DelegationManager._completeQueuedWithdrawal: action is not in queue"); +// cheats.prank(defaultStaker); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); +// } + +// /** +// * @notice should revert if minWithdrawalDelayBlocks has not passed, and if +// * delegationManager.getWithdrawalDelay returns a value greater than minWithdrawalDelayBlocks +// * then it should revert if the validBlockNumber has not passed either. +// */ +// function test_Revert_WhenWithdrawalDelayBlocksNotPassed( +// uint256[] memory depositAmounts, +// bool receiveAsTokens +// ) public { +// cheats.assume(depositAmounts.length > 0 && depositAmounts.length <= 32); +// uint256[] memory withdrawalAmounts = _fuzzWithdrawalAmounts(depositAmounts); - _registerOperatorWithBaseDetails(defaultOperator); - ( - IDelegationManager.Withdrawal memory withdrawal, - IERC20[] memory tokens, - /* bytes32 withdrawalRoot */ - ) = _setUpCompleteQueuedWithdrawal({ - staker: defaultStaker, - withdrawer: defaultStaker, - depositAmounts: depositAmounts, - withdrawalAmounts: withdrawalAmounts - }); - - // prank as withdrawer address - cheats.startPrank(defaultStaker); - - cheats.expectRevert( - "DelegationManager._completeQueuedWithdrawal: minWithdrawalDelayBlocks period has not yet passed" - ); - cheats.roll(block.number + minWithdrawalDelayBlocks - 1); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, receiveAsTokens); - - uint256 validBlockNumber = delegationManager.getWithdrawalDelay(withdrawal.strategies); - if (validBlockNumber > minWithdrawalDelayBlocks) { - cheats.expectRevert( - "DelegationManager._completeQueuedWithdrawal: withdrawalDelayBlocks period has not yet passed for this strategy" - ); - cheats.roll(validBlockNumber - 1); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, receiveAsTokens); - } - - cheats.stopPrank(); - } - - /** - * @notice should revert when the withdrawalDelayBlocks period has not yet passed for the - * beacon chain strategy - */ - function test_Revert_WhenWithdrawalDelayBlocksNotPassed_BeaconStrat( - uint256 depositAmount, - uint256 withdrawalAmount, - uint256 beaconWithdrawalDelay - ) public { - cheats.assume(depositAmount > 1 && withdrawalAmount <= depositAmount); - beaconWithdrawalDelay = bound(beaconWithdrawalDelay, minWithdrawalDelayBlocks, MAX_WITHDRAWAL_DELAY_BLOCKS); - _registerOperatorWithBaseDetails(defaultOperator); - ( - IDelegationManager.Withdrawal memory withdrawal, - IERC20[] memory tokens, - // bytes32 withdrawalRoot - ) = _setUpCompleteQueuedWithdrawalBeaconStrat({ - staker: defaultStaker, - withdrawer: defaultStaker, - depositAmount: depositAmount, - withdrawalAmount: withdrawalAmount - }); - - IStrategy[] memory strategies = new IStrategy[](1); - strategies[0] = beaconChainETHStrategy; - uint256[] memory withdrawalDelayBlocks = new uint256[](1); - delegationManager.setStrategyWithdrawalDelayBlocks(withdrawal.strategies, withdrawalDelayBlocks); - - // prank as withdrawer address - cheats.startPrank(defaultStaker); - - cheats.expectRevert( - "DelegationManager._completeQueuedWithdrawal: minWithdrawalDelayBlocks period has not yet passed" - ); - cheats.roll(block.number + minWithdrawalDelayBlocks - 1); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); - - uint256 validBlockNumber = delegationManager.getWithdrawalDelay(withdrawal.strategies); - if (validBlockNumber > minWithdrawalDelayBlocks) { - cheats.expectRevert( - "DelegationManager._completeQueuedWithdrawal: withdrawalDelayBlocks period has not yet passed for this strategy" - ); - cheats.roll(validBlockNumber - 1); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); - } - - cheats.stopPrank(); - } - - function test_Revert_WhenNotCalledByWithdrawer() public { - _registerOperatorWithBaseDetails(defaultOperator); - ( - IDelegationManager.Withdrawal memory withdrawal, - IERC20[] memory tokens, - /*bytes32 withdrawalRoot*/ - ) = _setUpCompleteQueuedWithdrawalSingleStrat({ - staker: defaultStaker, - withdrawer: defaultStaker, - depositAmount: 100, - withdrawalAmount: 100 - }); - _delegateToOperatorWhoAcceptsAllStakers(defaultStaker, defaultOperator); - - cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); - cheats.expectRevert("DelegationManager._completeQueuedWithdrawal: only withdrawer can complete action"); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); - } - - function test_Revert_WhenTokensArrayLengthMismatch() public { - _registerOperatorWithBaseDetails(defaultOperator); - (IDelegationManager.Withdrawal memory withdrawal, , ) = _setUpCompleteQueuedWithdrawalSingleStrat({ - staker: defaultStaker, - withdrawer: defaultStaker, - depositAmount: 100, - withdrawalAmount: 100 - }); - _delegateToOperatorWhoAcceptsAllStakers(defaultStaker, defaultOperator); - - IERC20[] memory tokens = new IERC20[](0); - cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); - cheats.expectRevert("DelegationManager._completeQueuedWithdrawal: input length mismatch"); - cheats.prank(defaultStaker); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, true); - } - - /** - * @notice Verifies that `DelegationManager.completeQueuedWithdrawal` properly completes a queued withdrawal for the `withdrawer` - * for a single strategy. Withdraws as tokens so there are no operator shares increase. - * - Asserts that the withdrawalRoot is True before `completeQueuedWithdrawal` and False after - * - Asserts operatorShares is unchanged after `completeQueuedWithdrawal` - * - Checks that event `WithdrawalCompleted` is emitted with withdrawalRoot - */ - function test_completeQueuedWithdrawal_SingleStratWithdrawAsTokens( - address staker, - uint256 depositAmount, - uint256 withdrawalAmount - ) public filterFuzzedAddressInputs(staker) { - cheats.assume(staker != defaultOperator); - cheats.assume(withdrawalAmount > 0 && withdrawalAmount <= depositAmount); - _registerOperatorWithBaseDetails(defaultOperator); - ( - IDelegationManager.Withdrawal memory withdrawal, - IERC20[] memory tokens, - bytes32 withdrawalRoot - ) = _setUpCompleteQueuedWithdrawalSingleStrat({ - staker: staker, - withdrawer: staker, - depositAmount: depositAmount, - withdrawalAmount: withdrawalAmount - }); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, withdrawal.strategies[0]); - assertTrue(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be pending"); - - // completeQueuedWithdrawal - cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); - cheats.prank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit WithdrawalCompleted(withdrawalRoot); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, true); - - uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, withdrawal.strategies[0]); - assertEq(operatorSharesAfter, operatorSharesBefore, "operator shares should be unchanged"); - assertFalse(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be completed and marked false now"); - } - - /** - * @notice Verifies that `DelegationManager.completeQueuedWithdrawal` properly completes a queued withdrawal for the `withdrawer` - * for a single strategy. Withdraws as shares so if the withdrawer is delegated, operator shares increase. In the test case, this only - * happens if staker and withdrawer are fuzzed the same address (i.e. staker == withdrawer) - * - Asserts that the withdrawalRoot is True before `completeQueuedWithdrawal` and False after - * - Asserts if staker == withdrawer, operatorShares increase, otherwise operatorShares are unchanged - * - Checks that event `WithdrawalCompleted` is emitted with withdrawalRoot - */ - function test_completeQueuedWithdrawal_SingleStratWithdrawAsShares( - address staker, - uint256 depositAmount, - uint256 withdrawalAmount - ) public filterFuzzedAddressInputs(staker) { - cheats.assume(staker != defaultOperator); - cheats.assume(withdrawalAmount > 0 && withdrawalAmount <= depositAmount); - _registerOperatorWithBaseDetails(defaultOperator); - - ( - IDelegationManager.Withdrawal memory withdrawal, - IERC20[] memory tokens, - bytes32 withdrawalRoot - ) = _setUpCompleteQueuedWithdrawalSingleStrat({ - staker: staker, - withdrawer: staker, - depositAmount: depositAmount, - withdrawalAmount: withdrawalAmount - }); - _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); - uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, withdrawal.strategies[0]); - assertTrue(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be pending"); - - // completeQueuedWithdrawal - cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); - cheats.prank(staker); - cheats.expectEmit(true, true, true, true, address(delegationManager)); - emit WithdrawalCompleted(withdrawalRoot); - delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); - - uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, withdrawal.strategies[0]); - // Since staker is delegated, operatorShares get incremented - assertEq(operatorSharesAfter, operatorSharesBefore + withdrawalAmount, "operator shares not increased correctly"); - assertFalse(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be completed and marked false now"); - } -} +// _registerOperatorWithBaseDetails(defaultOperator); +// ( +// IDelegationManager.Withdrawal memory withdrawal, +// IERC20[] memory tokens, +// /* bytes32 withdrawalRoot */ +// ) = _setUpCompleteQueuedWithdrawal({ +// staker: defaultStaker, +// withdrawer: defaultStaker, +// depositAmounts: depositAmounts, +// withdrawalAmounts: withdrawalAmounts +// }); + +// // prank as withdrawer address +// cheats.startPrank(defaultStaker); + +// cheats.expectRevert( +// "DelegationManager._completeQueuedWithdrawal: minWithdrawalDelayBlocks period has not yet passed" +// ); +// cheats.roll(block.number + minWithdrawalDelayBlocks - 1); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, receiveAsTokens); + +// uint256 validBlockNumber = delegationManager.getWithdrawalDelay(withdrawal.strategies); +// if (validBlockNumber > minWithdrawalDelayBlocks) { +// cheats.expectRevert( +// "DelegationManager._completeQueuedWithdrawal: withdrawalDelayBlocks period has not yet passed for this strategy" +// ); +// cheats.roll(validBlockNumber - 1); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, receiveAsTokens); +// } + +// cheats.stopPrank(); +// } + +// /** +// * @notice should revert when the withdrawalDelayBlocks period has not yet passed for the +// * beacon chain strategy +// */ +// function test_Revert_WhenWithdrawalDelayBlocksNotPassed_BeaconStrat( +// uint256 depositAmount, +// uint256 withdrawalAmount, +// uint256 beaconWithdrawalDelay +// ) public { +// cheats.assume(depositAmount > 1 && withdrawalAmount <= depositAmount); +// beaconWithdrawalDelay = bound(beaconWithdrawalDelay, minWithdrawalDelayBlocks, MAX_WITHDRAWAL_DELAY_BLOCKS); +// _registerOperatorWithBaseDetails(defaultOperator); +// ( +// IDelegationManager.Withdrawal memory withdrawal, +// IERC20[] memory tokens, +// // bytes32 withdrawalRoot +// ) = _setUpCompleteQueuedWithdrawalBeaconStrat({ +// staker: defaultStaker, +// withdrawer: defaultStaker, +// depositAmount: depositAmount, +// withdrawalAmount: withdrawalAmount +// }); + +// IStrategy[] memory strategies = new IStrategy[](1); +// strategies[0] = beaconChainETHStrategy; +// uint256[] memory withdrawalDelayBlocks = new uint256[](1); +// delegationManager.setStrategyWithdrawalDelayBlocks(withdrawal.strategies, withdrawalDelayBlocks); + +// // prank as withdrawer address +// cheats.startPrank(defaultStaker); + +// cheats.expectRevert( +// "DelegationManager._completeQueuedWithdrawal: minWithdrawalDelayBlocks period has not yet passed" +// ); +// cheats.roll(block.number + minWithdrawalDelayBlocks - 1); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); + +// uint256 validBlockNumber = delegationManager.getWithdrawalDelay(withdrawal.strategies); +// if (validBlockNumber > minWithdrawalDelayBlocks) { +// cheats.expectRevert( +// "DelegationManager._completeQueuedWithdrawal: withdrawalDelayBlocks period has not yet passed for this strategy" +// ); +// cheats.roll(validBlockNumber - 1); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); +// } + +// cheats.stopPrank(); +// } + +// function test_Revert_WhenNotCalledByWithdrawer() public { +// _registerOperatorWithBaseDetails(defaultOperator); +// ( +// IDelegationManager.Withdrawal memory withdrawal, +// IERC20[] memory tokens, +// /*bytes32 withdrawalRoot*/ +// ) = _setUpCompleteQueuedWithdrawalSingleStrat({ +// staker: defaultStaker, +// withdrawer: defaultStaker, +// depositAmount: 100, +// withdrawalAmount: 100 +// }); +// _delegateToOperatorWhoAcceptsAllStakers(defaultStaker, defaultOperator); + +// cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); +// cheats.expectRevert("DelegationManager._completeQueuedWithdrawal: only withdrawer can complete action"); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); +// } + +// function test_Revert_WhenTokensArrayLengthMismatch() public { +// _registerOperatorWithBaseDetails(defaultOperator); +// (IDelegationManager.Withdrawal memory withdrawal, , ) = _setUpCompleteQueuedWithdrawalSingleStrat({ +// staker: defaultStaker, +// withdrawer: defaultStaker, +// depositAmount: 100, +// withdrawalAmount: 100 +// }); +// _delegateToOperatorWhoAcceptsAllStakers(defaultStaker, defaultOperator); + +// IERC20[] memory tokens = new IERC20[](0); +// cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); +// cheats.expectRevert("DelegationManager._completeQueuedWithdrawal: input length mismatch"); +// cheats.prank(defaultStaker); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, true); +// } + +// /** +// * @notice Verifies that `DelegationManager.completeQueuedWithdrawal` properly completes a queued withdrawal for the `withdrawer` +// * for a single strategy. Withdraws as tokens so there are no operator shares increase. +// * - Asserts that the withdrawalRoot is True before `completeQueuedWithdrawal` and False after +// * - Asserts operatorShares is unchanged after `completeQueuedWithdrawal` +// * - Checks that event `WithdrawalCompleted` is emitted with withdrawalRoot +// */ +// function test_completeQueuedWithdrawal_SingleStratWithdrawAsTokens( +// address staker, +// uint256 depositAmount, +// uint256 withdrawalAmount +// ) public filterFuzzedAddressInputs(staker) { +// cheats.assume(staker != defaultOperator); +// cheats.assume(withdrawalAmount > 0 && withdrawalAmount <= depositAmount); +// _registerOperatorWithBaseDetails(defaultOperator); +// ( +// IDelegationManager.Withdrawal memory withdrawal, +// IERC20[] memory tokens, +// bytes32 withdrawalRoot +// ) = _setUpCompleteQueuedWithdrawalSingleStrat({ +// staker: staker, +// withdrawer: staker, +// depositAmount: depositAmount, +// withdrawalAmount: withdrawalAmount +// }); +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); +// uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, withdrawal.strategies[0]); +// assertTrue(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be pending"); + +// // completeQueuedWithdrawal +// cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); +// cheats.prank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit WithdrawalCompleted(withdrawalRoot); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, true); + +// uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, withdrawal.strategies[0]); +// assertEq(operatorSharesAfter, operatorSharesBefore, "operator shares should be unchanged"); +// assertFalse(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be completed and marked false now"); +// } + +// /** +// * @notice Verifies that `DelegationManager.completeQueuedWithdrawal` properly completes a queued withdrawal for the `withdrawer` +// * for a single strategy. Withdraws as shares so if the withdrawer is delegated, operator shares increase. In the test case, this only +// * happens if staker and withdrawer are fuzzed the same address (i.e. staker == withdrawer) +// * - Asserts that the withdrawalRoot is True before `completeQueuedWithdrawal` and False after +// * - Asserts if staker == withdrawer, operatorShares increase, otherwise operatorShares are unchanged +// * - Checks that event `WithdrawalCompleted` is emitted with withdrawalRoot +// */ +// function test_completeQueuedWithdrawal_SingleStratWithdrawAsShares( +// address staker, +// uint256 depositAmount, +// uint256 withdrawalAmount +// ) public filterFuzzedAddressInputs(staker) { +// cheats.assume(staker != defaultOperator); +// cheats.assume(withdrawalAmount > 0 && withdrawalAmount <= depositAmount); +// _registerOperatorWithBaseDetails(defaultOperator); + +// ( +// IDelegationManager.Withdrawal memory withdrawal, +// IERC20[] memory tokens, +// bytes32 withdrawalRoot +// ) = _setUpCompleteQueuedWithdrawalSingleStrat({ +// staker: staker, +// withdrawer: staker, +// depositAmount: depositAmount, +// withdrawalAmount: withdrawalAmount +// }); +// _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); +// uint256 operatorSharesBefore = delegationManager.operatorShares(defaultOperator, withdrawal.strategies[0]); +// assertTrue(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be pending"); + +// // completeQueuedWithdrawal +// cheats.roll(block.number + delegationManager.getWithdrawalDelay(withdrawal.strategies)); +// cheats.prank(staker); +// cheats.expectEmit(true, true, true, true, address(delegationManager)); +// emit WithdrawalCompleted(withdrawalRoot); +// delegationManager.completeQueuedWithdrawal(withdrawal, tokens, 0 /* middlewareTimesIndex */, false); + +// uint256 operatorSharesAfter = delegationManager.operatorShares(defaultOperator, withdrawal.strategies[0]); +// // Since staker is delegated, operatorShares get incremented +// assertEq(operatorSharesAfter, operatorSharesBefore + withdrawalAmount, "operator shares not increased correctly"); +// assertFalse(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be completed and marked false now"); +// } +// } diff --git a/src/test/unit/EigenPodManagerUnit.t.sol b/src/test/unit/EigenPodManagerUnit.t.sol index b31d1d404..a0c5d0819 100644 --- a/src/test/unit/EigenPodManagerUnit.t.sol +++ b/src/test/unit/EigenPodManagerUnit.t.sol @@ -417,9 +417,9 @@ contract EigenPodManagerUnitTests_BeaconChainETHBalanceUpdateTests is EigenPodMa eigenPodManager.recordBeaconChainETHBalanceUpdate(defaultStaker, sharesDelta); } - function testFuzz_recordBalanceUpdateX(int224 sharesBefore, int224 sharesDelta) public { + function testFuzz_recordBalanceUpdateX(int224 scaledSharesBefore, int224 sharesDelta) public { // Constrain inputs - int256 scaledSharesBefore = sharesBefore * int256(GWEI_TO_WEI); + int256 scaledSharesBefore = scaledSharesBefore * int256(GWEI_TO_WEI); int256 scaledSharesDelta = sharesDelta * int256(GWEI_TO_WEI); // Initialize shares @@ -456,35 +456,35 @@ contract EigenPodManagerUnitTests_ShareAdjustmentCalculationTests is EigenPodMan eigenLayerProxyAdmin.upgrade(TransparentUpgradeableProxy(payable(address(eigenPodManager))), address(eigenPodManagerWrapper)); } - function testFuzz_shareAdjustment_negativeToNegative(int256 sharesBefore, int256 sharesAfter) public { - cheats.assume(sharesBefore <= 0); - cheats.assume(sharesAfter <= 0); + function testFuzz_shareAdjustment_negativeToNegative(int256 scaledSharesBefore, int256 scaledSharesAfter) public { + cheats.assume(scaledSharesBefore <= 0); + cheats.assume(scaledSharesAfter <= 0); - int256 sharesDelta = eigenPodManagerWrapper.calculateChangeInDelegatableShares(sharesBefore, sharesAfter); + int256 sharesDelta = eigenPodManagerWrapper.calculateChangeInDelegatableShares(scaledSharesBefore, scaledSharesAfter); assertEq(sharesDelta, 0, "Shares delta must be 0"); } - function testFuzz_shareAdjustment_negativeToPositive(int256 sharesBefore, int256 sharesAfter) public { - cheats.assume(sharesBefore <= 0); - cheats.assume(sharesAfter > 0); + function testFuzz_shareAdjustment_negativeToPositive(int256 scaledSharesBefore, int256 scaledSharesAfter) public { + cheats.assume(scaledSharesBefore <= 0); + cheats.assume(scaledSharesAfter > 0); - int256 sharesDelta = eigenPodManagerWrapper.calculateChangeInDelegatableShares(sharesBefore, sharesAfter); - assertEq(sharesDelta, sharesAfter, "Shares delta must be equal to sharesAfter"); + int256 sharesDelta = eigenPodManagerWrapper.calculateChangeInDelegatableShares(scaledSharesBefore, scaledSharesAfter); + assertEq(sharesDelta, scaledSharesAfter, "Shares delta must be equal to scaledSharesAfter"); } - function testFuzz_shareAdjustment_positiveToNegative(int256 sharesBefore, int256 sharesAfter) public { - cheats.assume(sharesBefore > 0); - cheats.assume(sharesAfter <= 0); + function testFuzz_shareAdjustment_positiveToNegative(int256 scaledSharesBefore, int256 scaledSharesAfter) public { + cheats.assume(scaledSharesBefore > 0); + cheats.assume(scaledSharesAfter <= 0); - int256 sharesDelta = eigenPodManagerWrapper.calculateChangeInDelegatableShares(sharesBefore, sharesAfter); - assertEq(sharesDelta, -sharesBefore, "Shares delta must be equal to the negative of sharesBefore"); + int256 sharesDelta = eigenPodManagerWrapper.calculateChangeInDelegatableShares(scaledSharesBefore, scaledSharesAfter); + assertEq(sharesDelta, -scaledSharesBefore, "Shares delta must be equal to the negative of scaledSharesBefore"); } - function testFuzz_shareAdjustment_positiveToPositive(int256 sharesBefore, int256 sharesAfter) public { - cheats.assume(sharesBefore > 0); - cheats.assume(sharesAfter > 0); + function testFuzz_shareAdjustment_positiveToPositive(int256 scaledSharesBefore, int256 scaledSharesAfter) public { + cheats.assume(scaledSharesBefore > 0); + cheats.assume(scaledSharesAfter > 0); - int256 sharesDelta = eigenPodManagerWrapper.calculateChangeInDelegatableShares(sharesBefore, sharesAfter); - assertEq(sharesDelta, sharesAfter - sharesBefore, "Shares delta must be equal to the difference between sharesAfter and sharesBefore"); + int256 sharesDelta = eigenPodManagerWrapper.calculateChangeInDelegatableShares(scaledSharesBefore, scaledSharesAfter); + assertEq(sharesDelta, scaledSharesAfter - scaledSharesBefore, "Shares delta must be equal to the difference between scaledSharesAfter and scaledSharesBefore"); } } diff --git a/src/test/unit/RewardsCoordinatorUnit.t.sol b/src/test/unit/RewardsCoordinatorUnit.t.sol index 609472199..9dafb9718 100644 --- a/src/test/unit/RewardsCoordinatorUnit.t.sol +++ b/src/test/unit/RewardsCoordinatorUnit.t.sol @@ -55,8 +55,18 @@ contract RewardsCoordinatorUnitTests is EigenLayerUnitTestSetup, IRewardsCoordin /// @notice absolute min timestamp that a rewards can start at uint32 GENESIS_REWARDS_TIMESTAMP = 1712188800; + /// @notice Lower bound start range is ~1 month into the past, multiple of CALCULATION_INTERVAL_SECONDS + uint32 OPERATOR_SET_MAX_RETROACTIVE_LENGTH = 28 days; + /// @notice absolute min timestamp (seconds) that an operatorSet rewards submission can start at + uint32 OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP = 1720656000; + + /// @notice Delay in timestamp before a posted root can be claimed against uint32 activationDelay = 7 days; + /// @notice The activation delay until an updated operator's commission bips takes effect + uint32 OPERATOR_COMMISSION_ACTIVATION_DELAY = 17.5 days; + /// @notice The maximum commission bips that can be set for an operator + uint16 MAX_COMMISSION_BIPS = 10000; /// @notice the commission for all operators across all avss uint16 globalCommissionBips = 1000; @@ -74,7 +84,10 @@ contract RewardsCoordinatorUnitTests is EigenLayerUnitTestSetup, IRewardsCoordin uint8 internal constant PAUSED_PROCESS_CLAIM = 2; /// @dev Index for flag that pauses submitRoots - uint8 internal constant PAUSED_SUBMIT_ROOTS = 3; + uint8 internal constant PAUSED_SUBMIT_DISABLE_ROOTS = 3; + + /// @dev Index for flag that pauses calling rewardOperatorSetForRange + uint8 internal constant PAUSED_REWARD_OPERATOR_SET = 4; // RewardsCoordinator entities address rewardsUpdater = address(1000); @@ -90,11 +103,14 @@ contract RewardsCoordinatorUnitTests is EigenLayerUnitTestSetup, IRewardsCoordin rewardsCoordinatorImplementation = new RewardsCoordinator( delegationManagerMock, strategyManagerMock, + avsDirectoryMock, CALCULATION_INTERVAL_SECONDS, MAX_REWARDS_DURATION, MAX_RETROACTIVE_LENGTH, MAX_FUTURE_LENGTH, - GENESIS_REWARDS_TIMESTAMP + GENESIS_REWARDS_TIMESTAMP, + OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, + OPERATOR_SET_MAX_RETROACTIVE_LENGTH ); rewardsCoordinator = RewardsCoordinator( address( @@ -1123,7 +1139,7 @@ contract RewardsCoordinatorUnitTests_submitRoot is RewardsCoordinatorUnitTests { function test_Revert_WhenSubmitRootPaused() public { cheats.prank(pauser); - rewardsCoordinator.pause(2 ** PAUSED_SUBMIT_ROOTS); + rewardsCoordinator.pause(2 ** PAUSED_SUBMIT_DISABLE_ROOTS); cheats.expectRevert("Pausable: index is paused"); rewardsCoordinator.submitRoot(bytes32(0), 0); @@ -2038,3 +2054,706 @@ contract RewardsCoordinatorUnitTests_processClaim is RewardsCoordinatorUnitTests return claims; } } + +contract RewardsCoordinatorUnitTests_disableRoot is RewardsCoordinatorUnitTests { + function testFuzz_disableRoot_Revert_WhenNotRewardsUpdater( + address invalidRewardsUpdater + ) public filterFuzzedAddressInputs(invalidRewardsUpdater) { + cheats.prank(invalidRewardsUpdater); + + cheats.expectRevert("RewardsCoordinator: caller is not the rewardsUpdater"); + rewardsCoordinator.disableRoot(0); + } + + function test_disableRoot_Revert_WhenPaused() public { + cheats.prank(pauser); + rewardsCoordinator.pause(2 ** PAUSED_SUBMIT_DISABLE_ROOTS); + + cheats.expectRevert("Pausable: index is paused"); + rewardsCoordinator.disableRoot(0); + } + + function testFuzz_disableRoot_Revert_WhenRootIndexOutOfBounds(uint32 rootIndex) public { + // submitRoots with indexes 0,1,2 + _submitRoots(); + cheats.assume(rootIndex > 2); + + cheats.expectRevert("RewardsCoordinator.disableRoot: invalid rootIndex"); + cheats.prank(rewardsUpdater); + rewardsCoordinator.disableRoot(rootIndex); + } + + function testFuzz_disableRoot_Revert_WhenRootAlreadyDisabled(uint32 rootIndex) public { + // submitRoots with indexes 0,1,2 + _submitRoots(); + rootIndex = uint32(bound(uint256(rootIndex), 0, 2)); + + cheats.startPrank(rewardsUpdater); + rewardsCoordinator.disableRoot(rootIndex); + + cheats.expectRevert("RewardsCoordinator.disableRoot: root already disabled"); + rewardsCoordinator.disableRoot(rootIndex); + cheats.stopPrank(); + } + + function testeFuzz_disableRoot_Revert_WhenRootAlreadyActivated(uint32 rootIndex) public { + // submitRoots with indexes 0,1,2 + _submitRoots(); + rootIndex = uint32(bound(uint256(rootIndex), 0, 2)); + cheats.warp(block.timestamp + activationDelay); + + cheats.expectRevert("RewardsCoordinator.disableRoot: root already activated"); + cheats.prank(rewardsUpdater); + rewardsCoordinator.disableRoot(rootIndex); + } + + function testFuzz_disableRoot(uint32 rootIndex, uint256 randSalt) public { + // Set timestamp to some value in the future + cheats.warp(bound(randSalt, 1e5, 1e6)); + uint256 currTimestamp = block.timestamp; + // submitRoots with indexes 0,1,2 + _submitRoots(); + rootIndex = uint32(bound(uint256(rootIndex), 0, 2)); + + cheats.warp(currTimestamp); + + cheats.expectEmit(true, true, true, true, address(rewardsCoordinator)); + emit DistributionRootDisabled(rootIndex); + cheats.prank(rewardsUpdater); + rewardsCoordinator.disableRoot(rootIndex); + + assertEq( + rewardsCoordinator.getDistributionRootAtIndex(rootIndex).disabled, + true, + "root should be disabled" + ); + } + + function _submitRoots() internal { + cheats.warp(1e6); + + // submitRoots with indexes 0,1,2 + cheats.startPrank(rewardsUpdater); + rewardsCoordinator.submitRoot(bytes32("0"), uint32(block.timestamp - 1)); + + cheats.warp(block.timestamp + 2); + rewardsCoordinator.submitRoot(bytes32("1"), uint32(block.timestamp - 1)); + + cheats.warp(block.timestamp + 2); + rewardsCoordinator.submitRoot(bytes32("2"), uint32(block.timestamp - 1)); + + cheats.stopPrank(); + } +} + +contract RewardsCoordinatorUnitTests_operatorCommission is RewardsCoordinatorUnitTests { + uint8 numberOfRewardTypes = 1; + + function testFuzz_operatorCommissionBips_EmptyHistory( + address operator, + OperatorSet calldata operatorSet, + uint8 rewardTypeEnum + ) public { + rewardTypeEnum = uint8(bound(rewardTypeEnum, 0, numberOfRewardTypes - 1)); + IRewardsCoordinator.RewardType rewardType = IRewardsCoordinator.RewardType(rewardTypeEnum); + rewardType = IRewardsCoordinator.RewardType(uint8(bound(uint256(rewardType), 0, 1))); + // Check operator commission + uint32 operatorCommissionBipsStored = rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType); + assertEq( + globalCommissionBips, + operatorCommissionBipsStored, + "Incorrect default operator commission bips" + ); + } + + function testFuzz_setOperatorCommissionBips_Reverts_WhenBipsGreaterThanMax( + address operator, + OperatorSet calldata operatorSet, + uint8 rewardTypeEnum, + uint16 newOperatorCommissionBips + ) public filterFuzzedAddressInputs(operator) { + rewardTypeEnum = uint8(bound(rewardTypeEnum, 0, numberOfRewardTypes - 1)); + IRewardsCoordinator.RewardType rewardType = IRewardsCoordinator.RewardType(rewardTypeEnum); + cheats.assume(newOperatorCommissionBips > MAX_COMMISSION_BIPS); + cheats.expectRevert("RewardsCoordinator.setOperatorCommissionBips: commissionBips too high"); + cheats.prank(operator); + rewardsCoordinator.setOperatorCommissionBips(operatorSet, rewardType, newOperatorCommissionBips); + } + + /// @notice test setting operator commission bips to a new value with empty history + function testFuzz_setOperatorCommissionBips_EmptyHistory( + address operator, + OperatorSet calldata operatorSet, + uint8 rewardTypeEnum, + uint16 newOperatorCommissionBips, + uint256 randSalt + ) public filterFuzzedAddressInputs(operator) { + rewardTypeEnum = uint8(bound(rewardTypeEnum, 0, numberOfRewardTypes - 1)); + IRewardsCoordinator.RewardType rewardType = IRewardsCoordinator.RewardType(rewardTypeEnum); + cheats.assume(newOperatorCommissionBips != globalCommissionBips); + cheats.assume(newOperatorCommissionBips <= MAX_COMMISSION_BIPS); + // 1. Set operator commission and check updated value hasn't taken effect yet + uint16 prevOperatorCommissionBips = rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType); + cheats.prank(operator); + uint32 effectTimestamp = rewardsCoordinator.setOperatorCommissionBips( + operatorSet, + rewardType, + newOperatorCommissionBips + ); + assertTrue( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType) == prevOperatorCommissionBips, + "Operator commission bips should not be updated" + ); + assertTrue( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType) != newOperatorCommissionBips, + "Operator commission bips should not be updated" + ); + + // 2. warp timestamp forwards to random time that is not the effectTimestamp + uint256 warpTimestamp = bound(randSalt, block.timestamp, effectTimestamp - 1); + cheats.warp(warpTimestamp); + assertTrue( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType) != newOperatorCommissionBips, + "Operator commission bips should still be not updated" + ); + + // 3. warp timestamp forwards to effectTimestamp, operator commission should be updated now + cheats.warp(effectTimestamp); + assertTrue( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType) == newOperatorCommissionBips, + "Operator commission bips should be updated" + ); + } + + /// @notice test setting operator commission bips to a new value with non empty history + function testFuzz_setOperatorCommissionBips_WithHistory( + address operator, + OperatorSet calldata operatorSet, + uint8 rewardTypeEnum, + uint16 newOperatorCommissionBips, + uint256 randSalt + ) public filterFuzzedAddressInputs(operator) { + rewardTypeEnum = uint8(bound(rewardTypeEnum, 0, numberOfRewardTypes - 1)); + IRewardsCoordinator.RewardType rewardType = IRewardsCoordinator.RewardType(rewardTypeEnum); + cheats.assume(newOperatorCommissionBips <= MAX_COMMISSION_BIPS); + + // 1. Set operator commission to initial value with existing history + uint16 prevOperatorCommissionBips = uint16(bound(randSalt, 0, MAX_COMMISSION_BIPS)); + cheats.assume(prevOperatorCommissionBips != newOperatorCommissionBips); + cheats.prank(operator); + uint32 effectTimestamp = rewardsCoordinator.setOperatorCommissionBips( + operatorSet, + rewardType, + prevOperatorCommissionBips + ); + cheats.warp(effectTimestamp); + assertTrue( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType) == prevOperatorCommissionBips, + "1. Operator commission bips should be initialized properly" + ); + assertEq( + rewardsCoordinator.getOperatorCommissionUpdateHistoryLength(operator, operatorSet, rewardType), + 1, + "2. Invalid commission history length" + ); + + // 2. Set operator commission and check updated value hasn't taken effect yet + cheats.prank(operator); + effectTimestamp = rewardsCoordinator.setOperatorCommissionBips( + operatorSet, + rewardType, + newOperatorCommissionBips + ); + assertEq( + rewardsCoordinator.getOperatorCommissionUpdateHistoryLength(operator, operatorSet, rewardType), + 2, + "3. Invalid commission history length" + ); + assertTrue( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType) == prevOperatorCommissionBips, + "4. Operator commission bips should not be updated" + ); + assertTrue( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType) != newOperatorCommissionBips, + "5. Operator commission bips should not be updated" + ); + + // 3. warp timestamp forwards to random time that is not the effectTimestamp + uint256 warpTimestamp = bound(randSalt, block.timestamp, effectTimestamp - 1); + + cheats.warp(warpTimestamp); + assertTrue( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType) == prevOperatorCommissionBips, + "6. Operator commission bips should still be not updated" + ); + + // 4. warp timestamp forwards to effectTimestamp, operator commission should be updated now + cheats.warp(effectTimestamp); + assertTrue( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType) == newOperatorCommissionBips, + "7.Operator commission bips should be updated" + ); + } + + /// @notice test setting operator commission bips to a new value with pending update + /// has same effectTimestamp. Should overrwrite previous value + function testFuzz_setOperatorCommissionBips_SameBlockUpdate( + address operator, + OperatorSet calldata operatorSet, + uint8 rewardTypeEnum, + uint16 pendingCommissionBips, + uint16 overwriteCommissionBips + ) public filterFuzzedAddressInputs(operator) { + rewardTypeEnum = uint8(bound(rewardTypeEnum, 0, numberOfRewardTypes - 1)); + IRewardsCoordinator.RewardType rewardType = IRewardsCoordinator.RewardType(rewardTypeEnum); + cheats.assume(pendingCommissionBips <= MAX_COMMISSION_BIPS); + cheats.assume(overwriteCommissionBips <= MAX_COMMISSION_BIPS); + cheats.prank(operator); + uint32 effectTimestamp = rewardsCoordinator.setOperatorCommissionBips( + operatorSet, + rewardType, + pendingCommissionBips + ); + assertEq( + rewardsCoordinator.getOperatorCommissionUpdateHistoryLength(operator, operatorSet, rewardType), + 1, + "1. Invalid commission history length" + ); + cheats.prank(operator); + uint32 effectTimestamp2 = rewardsCoordinator.setOperatorCommissionBips( + operatorSet, + rewardType, + overwriteCommissionBips + ); + assertEq( + rewardsCoordinator.getOperatorCommissionUpdateHistoryLength(operator, operatorSet, rewardType), + 1, + "2. Invalid commission history length" + ); + assertEq( + effectTimestamp, + effectTimestamp2, + "3. Effect timestamp should be the same" + ); + cheats.warp(effectTimestamp); + assertEq( + rewardsCoordinator.getOperatorCommissionBips(operator, operatorSet, rewardType), + overwriteCommissionBips, + "4. Operator commission bips should be updated" + ); + } +} + +contract RewardsCoordinatorUnitTests_rewardOperatorSetForRange is RewardsCoordinatorUnitTests { + uint32 defaultOperatorSetId = 0; + uint32 validDuration = 2 weeks; + uint32 validStartTimestamp = OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP; + + function test_Revert_WhenPaused() public { + cheats.prank(pauser); + rewardsCoordinator.pause(2 ** PAUSED_REWARD_OPERATOR_SET); + + cheats.expectRevert("Pausable: index is paused"); + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions; + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_WhenReentrancy() public { + uint256 amount = 1e38-1; + Reenterer reenterer = new Reenterer(); + + reenterer.prepareReturnData(abi.encode(amount)); + + address targetToUse = address(rewardsCoordinator); + uint256 msgValueToUse = 0; + + _deployMockRewardTokens(address(this), 1); + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(reenterer)), + amount: amount, + startTimestamp: uint32(block.timestamp), + duration: 0 + }); + + bytes memory calldataToUse = abi.encodeWithSelector(RewardsCoordinator.createAVSRewardsSubmission.selector, rewardsSubmissions); + reenterer.prepare(targetToUse, msgValueToUse, calldataToUse, bytes("ReentrancyGuard: reentrant call")); + + cheats.expectRevert(); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_EmptyStratsAndMultipliers() public { + IRewardsCoordinator.StrategyAndMultiplier[] memory emptyStratsAndMultipliers; + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: emptyStratsAndMultipliers, + token: IERC20(address(this)), + amount: 1, + startTimestamp: uint32(block.timestamp), + duration: 0 + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: no strategies set"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_ZeroAmount() public { + uint256 amount = 0; + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(this)), + amount: amount, + startTimestamp: uint32(block.timestamp), + duration: 0 + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: amount cannot be 0"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_AmountTooLarge() public { + uint256 amount = 1e38; + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(this)), + amount: amount, + startTimestamp: uint32(block.timestamp), + duration: 0 + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: amount too large"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_DurationTooLarge() public { + uint32 duration = MAX_REWARDS_DURATION + 1; + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(this)), + amount: 1, + startTimestamp: uint32(block.timestamp), + duration: duration + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: duration exceeds MAX_REWARDS_DURATION"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_DurationInvalidMultiple(uint256 duration) public { + uint256 duration = CALCULATION_INTERVAL_SECONDS - 1; + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(this)), + amount: 1, + startTimestamp: uint32(block.timestamp), + duration: uint32(duration) + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: duration must be a multiple of CALCULATION_INTERVAL_SECONDS"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_InvalidStartTimestamp() public { + uint32 startTimestamp = OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP + 1; + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(this)), + amount: 1, + startTimestamp: startTimestamp, + duration: validDuration + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: startTimestamp must be a multiple of CALCULATION_INTERVAL_SECONDS"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_StartTimestampPriorToGenesis() public { + uint256 startTimestamp = OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP - CALCULATION_INTERVAL_SECONDS; + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(this)), + amount: 1, + startTimestamp: uint32(startTimestamp), + duration: validDuration + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: startTimestamp too far in the past"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + /// @notice Warps block timestamp & attemps to go make a reward to genesis + function test_Revert_StartTimestampGoesFarBack() public { + /// Warp to a timestamp past max retroactive length + cheats.warp(OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP + OPERATOR_SET_MAX_RETROACTIVE_LENGTH + CALCULATION_INTERVAL_SECONDS); + uint256 startTimestamp = OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP; + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(this)), + amount: 1, + startTimestamp: uint32(startTimestamp), + duration: validDuration + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: startTimestamp too far in the past"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_StartTimestampTooFarInFuture() public { + cheats.warp(OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP); + + uint256 startTimestamp = OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP + MAX_FUTURE_LENGTH + CALCULATION_INTERVAL_SECONDS; + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(this)), + amount: 1, + startTimestamp: uint32(startTimestamp), + duration: validDuration + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: startTimestamp too far in the future"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_InvalidStrategyConsidered() public { + cheats.warp(OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP); + defaultStrategyAndMultipliers[0].strategy = IStrategy(address(999)); + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: IERC20(address(this)), + amount: 1, + startTimestamp: validStartTimestamp, + duration: validDuration + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: invalid strategy considered"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function test_Revert_StrategiesNotOrdered() public { + cheats.warp(OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP); + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + IRewardsCoordinator.StrategyAndMultiplier[] + memory dupStratsAndMultipliers = new IRewardsCoordinator.StrategyAndMultiplier[](2); + dupStratsAndMultipliers[0] = defaultStrategyAndMultipliers[0]; + dupStratsAndMultipliers[1] = defaultStrategyAndMultipliers[0]; + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: dupStratsAndMultipliers, + token: IERC20(address(this)), + amount: 1, + startTimestamp: validStartTimestamp, + duration: validDuration + }); + + cheats.prank(defaultAVS); + cheats.expectRevert("RewardsCoordinator._validateRewardsSubmission: strategies must be in ascending order to handle duplicates"); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + } + + function testFuzz_RewardOperatorSetForRange_SingleSubmission( + uint256 startTimestamp, + uint256 duration, + uint256 amount + ) public { + cheats.warp(OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP); + + // 1. Bound fuzz inputs to valid ranges and amounts + IERC20 rewardToken = new ERC20PresetFixedSupply("dog wif hat", "MOCK1", mockTokenInitialSupply, defaultAVS); + amount = bound(amount, 1, mockTokenInitialSupply); + duration = bound(duration, 0, MAX_REWARDS_DURATION); + duration = duration - (duration % CALCULATION_INTERVAL_SECONDS); + startTimestamp = bound( + startTimestamp, + uint256(_maxTimestamp(OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, uint32(block.timestamp) - OPERATOR_SET_MAX_RETROACTIVE_LENGTH)) + + CALCULATION_INTERVAL_SECONDS - + 1, + block.timestamp + uint256(MAX_FUTURE_LENGTH) + ); + startTimestamp = startTimestamp - (startTimestamp % CALCULATION_INTERVAL_SECONDS); + + // 2. Create rewards submission input param + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](1); + rewardsSubmissions[0] = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: rewardToken, + amount: amount, + startTimestamp: uint32(startTimestamp), + duration: uint32(duration) + }); + + // 3. call createAVSRewardsSubmission() with expected event emitted + uint256 avsBalanceBefore = rewardToken.balanceOf(defaultAVS); + uint256 rewardsCoordinatorBalanceBefore = rewardToken.balanceOf(address(rewardsCoordinator)); + + cheats.startPrank(defaultAVS); + rewardToken.approve(address(rewardsCoordinator), amount); + uint256 currSubmissionNonce = rewardsCoordinator.submissionNonce(defaultAVS); + bytes32 rewardsSubmissionHash = keccak256(abi.encode(defaultAVS, currSubmissionNonce, rewardsSubmissions[0])); + + cheats.expectEmit(true, true, true, true, address(rewardsCoordinator)); + emit OperatorSetRewardCreated(defaultAVS, currSubmissionNonce, rewardsSubmissionHash, rewardsSubmissions[0]); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + cheats.stopPrank(); + + assertTrue(rewardsCoordinator.isAVSRewardsSubmissionHash(defaultAVS, rewardsSubmissionHash), "rewards submission hash not submitted"); + assertEq(currSubmissionNonce + 1, rewardsCoordinator.submissionNonce(defaultAVS), "submission nonce not incremented"); + assertEq( + avsBalanceBefore - amount, + rewardToken.balanceOf(defaultAVS), + "AVS balance not decremented by amount of rewards submission" + ); + assertEq( + rewardsCoordinatorBalanceBefore + amount, + rewardToken.balanceOf(address(rewardsCoordinator)), + "RewardsCoordinator balance not incremented by amount of rewards submission" + ); + } + + /** + * @notice test multiple rewards submissions asserting for the following + * - correct event emitted + * - submission nonce incrementation by numSubmissions, and rewards submission hashes being set in storage. + * - rewards submission hash being set in storage + * - token balances before and after of avs and rewardsCoordinator + */ + function testFuzz_RewardOperatorSetForRange_MultipleSubmissions( + uint256 startTimestamp, + uint256 duration, + uint256 amount, + uint256 numSubmissions + ) public { + cheats.assume(2 <= numSubmissions && numSubmissions <= 10); + cheats.warp(OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP); + + IRewardsCoordinator.OperatorSetRewardsSubmission[] memory rewardsSubmissions = new IRewardsCoordinator.OperatorSetRewardsSubmission[](numSubmissions); + bytes32[] memory rewardsSubmissionHashes = new bytes32[](numSubmissions); + uint256 startSubmissionNonce = rewardsCoordinator.submissionNonce(defaultAVS); + _deployMockRewardTokens(defaultAVS, numSubmissions); + + uint256[] memory avsBalancesBefore = _getBalanceForTokens(rewardTokens, defaultAVS); + uint256[] memory rewardsCoordinatorBalancesBefore = _getBalanceForTokens( + rewardTokens, + address(rewardsCoordinator) + ); + uint256[] memory amounts = new uint256[](numSubmissions); + + // Create multiple rewards submissions and their expected event + for (uint256 i = 0; i < numSubmissions; ++i) { + // 1. Bound fuzz inputs to valid ranges and amounts using randSeed for each + amount = bound(amount + i, 1, mockTokenInitialSupply); + amounts[i] = amount; + duration = bound(duration + i, 0, MAX_REWARDS_DURATION); + duration = duration - (duration % CALCULATION_INTERVAL_SECONDS); + startTimestamp = bound( + startTimestamp + i, + uint256(_maxTimestamp(OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP, uint32(block.timestamp) - OPERATOR_SET_MAX_RETROACTIVE_LENGTH)) + + CALCULATION_INTERVAL_SECONDS - + 1, + block.timestamp + uint256(MAX_FUTURE_LENGTH) + ); + startTimestamp = startTimestamp - (startTimestamp % CALCULATION_INTERVAL_SECONDS); + + // 2. Create rewards submission input param + IRewardsCoordinator.OperatorSetRewardsSubmission memory rewardsSubmission = IRewardsCoordinator.OperatorSetRewardsSubmission({ + rewardType: IRewardsCoordinator.RewardType.DELEGATED_STAKE, + operatorSetId: defaultOperatorSetId, + strategiesAndMultipliers: defaultStrategyAndMultipliers, + token: rewardTokens[i], + amount: amounts[i], + startTimestamp: uint32(startTimestamp), + duration: uint32(duration) + }); + rewardsSubmissions[i] = rewardsSubmission; + + // 3. expected event emitted for this rewardsSubmission + rewardsSubmissionHashes[i] = keccak256(abi.encode(defaultAVS, startSubmissionNonce + i, rewardsSubmissions[i])); + cheats.expectEmit(true, true, true, true, address(rewardsCoordinator)); + emit OperatorSetRewardCreated(defaultAVS, startSubmissionNonce + i, rewardsSubmissionHashes[i], rewardsSubmissions[i]); + } + + // 4. call createAVSRewardsSubmission() + cheats.prank(defaultAVS); + rewardsCoordinator.rewardOperatorSetForRange(rewardsSubmissions); + + // 5. Check for submissionNonce() and rewardsSubmissionHashes being set + assertEq( + startSubmissionNonce + numSubmissions, + rewardsCoordinator.submissionNonce(defaultAVS), + "submission nonce not incremented properly" + ); + + for (uint256 i = 0; i < numSubmissions; ++i) { + assertTrue( + rewardsCoordinator.isAVSRewardsSubmissionHash(defaultAVS, rewardsSubmissionHashes[i]), + "rewards submission hash not submitted" + ); + assertEq( + avsBalancesBefore[i] - amounts[i], + rewardTokens[i].balanceOf(defaultAVS), + "AVS balance not decremented by amount of rewards submission" + ); + assertEq( + rewardsCoordinatorBalancesBefore[i] + amounts[i], + rewardTokens[i].balanceOf(address(rewardsCoordinator)), + "RewardsCoordinator balance not incremented by amount of rewards submission" + ); + } + } +} diff --git a/src/test/unit/StrategyManagerUnit.t.sol b/src/test/unit/StrategyManagerUnit.t.sol index 189c495cd..309ad3757 100644 --- a/src/test/unit/StrategyManagerUnit.t.sol +++ b/src/test/unit/StrategyManagerUnit.t.sol @@ -37,7 +37,7 @@ contract StrategyManagerUnitTests is EigenLayerUnitTestSetup, IStrategyManagerEv function setUp() public override { EigenLayerUnitTestSetup.setUp(); - strategyManagerImplementation = new StrategyManager(delegationManagerMock, eigenPodManagerMock, slasherMock); + strategyManagerImplementation = new StrategyManager(delegationManagerMock, eigenPodManagerMock, slasherMock, avsDirectoryMock); strategyManager = StrategyManager( address( new TransparentUpgradeableProxy( @@ -848,7 +848,7 @@ contract StrategyManagerUnitTests_removeShares is StrategyManagerUnitTests { * @notice deposit single strategy and removeShares() for less than the deposited amount * Shares should be updated correctly with stakerStrategyListLength unchanged */ - function testFuzz_RemoveSharesLessThanDeposit( + function testFuzz_RemoveScaledSharesLessThanDeposit( address staker, uint256 depositAmount, uint256 removeSharesAmount @@ -950,7 +950,7 @@ contract StrategyManagerUnitTests_removeShares is StrategyManagerUnitTests { * Removing Shares could result in removing from staker strategy list if depositAmounts[i] == sharesAmounts[i]. * Only callable by DelegationManager */ - function testFuzz_RemoveShares(uint256[3] memory depositAmounts, uint256[3] memory sharesAmounts) external { + function testFuzz_RemoveScaledShares(uint256[3] memory depositAmounts, uint256[3] memory sharesAmounts) external { address staker = address(this); IStrategy[] memory strategies = new IStrategy[](3); strategies[0] = dummyStrat; @@ -1042,7 +1042,7 @@ contract StrategyManagerUnitTests_addShares is StrategyManagerUnitTests { assertTrue(_isDepositedStrategy(staker, dummyStrat), "strategy should be deposited"); } - function testFuzz_AddSharesToExistingShares( + function testFuzz_AddScaledSharesToExistingShares( address staker, uint256 sharesAmount ) external filterFuzzedAddressInputs(staker) { diff --git a/src/test/utils/EigenLayerUnitTestSetup.sol b/src/test/utils/EigenLayerUnitTestSetup.sol index ee2664f23..32b0e2724 100644 --- a/src/test/utils/EigenLayerUnitTestSetup.sol +++ b/src/test/utils/EigenLayerUnitTestSetup.sol @@ -5,6 +5,7 @@ import "src/test/mocks/StrategyManagerMock.sol"; import "src/test/mocks/DelegationManagerMock.sol"; import "src/test/mocks/SlasherMock.sol"; import "src/test/mocks/EigenPodManagerMock.sol"; +import "src/test/mocks/AVSDirectoryMock.sol"; import "src/test/utils/EigenLayerUnitTestBase.sol"; abstract contract EigenLayerUnitTestSetup is EigenLayerUnitTestBase { @@ -13,6 +14,7 @@ abstract contract EigenLayerUnitTestSetup is EigenLayerUnitTestBase { DelegationManagerMock public delegationManagerMock; SlasherMock public slasherMock; EigenPodManagerMock public eigenPodManagerMock; + AVSDirectoryMock public avsDirectoryMock; function setUp() public virtual override { EigenLayerUnitTestBase.setUp(); @@ -20,6 +22,7 @@ abstract contract EigenLayerUnitTestSetup is EigenLayerUnitTestBase { delegationManagerMock = new DelegationManagerMock(); slasherMock = new SlasherMock(); eigenPodManagerMock = new EigenPodManagerMock(pauserRegistry); + avsDirectoryMock = new AVSDirectoryMock(); addressIsExcludedFromFuzzedInputs[address(0)] = true; addressIsExcludedFromFuzzedInputs[address(strategyManagerMock)] = true;