diff --git a/contracts/EVMScriptFactories/UpdateTargetValidatorLimits.sol b/contracts/EVMScriptFactories/UpdateTargetValidatorLimits.sol index 48a9ea83..9c79b291 100644 --- a/contracts/EVMScriptFactories/UpdateTargetValidatorLimits.sol +++ b/contracts/EVMScriptFactories/UpdateTargetValidatorLimits.sol @@ -12,7 +12,7 @@ import "../interfaces/INodeOperatorsRegistry.sol"; contract UpdateTargetValidatorLimits is TrustedCaller, IEVMScriptFactory { struct TargetValidatorsLimit { uint256 nodeOperatorId; - bool isTargetLimitActive; + uint256 targetLimitMode; uint256 targetLimit; } diff --git a/contracts/interfaces/INodeOperatorsRegistry.sol b/contracts/interfaces/INodeOperatorsRegistry.sol index f48798d6..a2930fc3 100644 --- a/contracts/interfaces/INodeOperatorsRegistry.sol +++ b/contracts/interfaces/INodeOperatorsRegistry.sol @@ -52,7 +52,7 @@ interface INodeOperatorsRegistry { function updateTargetValidatorsLimits( uint256 _nodeOperatorId, - bool _isTargetLimitActive, + uint256 _targetLimitMode, uint256 _targetLimit ) external; } diff --git a/interfaces/NodeOperatorsRegistry.json b/interfaces/NodeOperatorsRegistry.json index c4d45bb4..1e08783d 100644 --- a/interfaces/NodeOperatorsRegistry.json +++ b/interfaces/NodeOperatorsRegistry.json @@ -1,1567 +1,1668 @@ [ - { - "constant": true, - "inputs": [], - "name": "hasInitialized", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_keysCount", - "type": "uint256" - }, - { - "name": "_publicKeys", - "type": "bytes" - }, - { - "name": "_signatures", - "type": "bytes" - } - ], - "name": "addSigningKeys", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getType", - "outputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_script", - "type": "bytes" - } - ], - "name": "getEVMScriptExecutor", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - } - ], - "name": "clearNodeOperatorPenalty", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getRecoveryVault", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_offset", - "type": "uint256" - }, - { - "name": "_limit", - "type": "uint256" - } - ], - "name": "getNodeOperatorIds", - "outputs": [ - { - "name": "nodeOperatorIds", - "type": "uint256[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_offset", - "type": "uint256" - }, - { - "name": "_limit", - "type": "uint256" - } - ], - "name": "getSigningKeys", - "outputs": [ - { - "name": "pubkeys", - "type": "bytes" - }, - { - "name": "signatures", - "type": "bytes" - }, - { - "name": "used", - "type": "bool[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_fromIndex", - "type": "uint256" - }, - { - "name": "_keysCount", - "type": "uint256" - } - ], - "name": "removeSigningKeysOperatorBH", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - } - ], - "name": "getNodeOperatorIsActive", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_name", - "type": "string" - } - ], - "name": "setNodeOperatorName", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_totalRewardShares", - "type": "uint256" - } - ], - "name": "getRewardsDistribution", - "outputs": [ - { - "name": "recipients", - "type": "address[]" - }, - { - "name": "shares", - "type": "uint256[]" - }, - { - "name": "penalized", - "type": "bool[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_indexFrom", - "type": "uint256" - }, - { - "name": "_indexTo", - "type": "uint256" - } - ], - "name": "invalidateReadyToDepositKeysRange", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_locator", - "type": "address" - }, - { - "name": "_type", - "type": "bytes32" - }, - { - "name": "_stuckPenaltyDelay", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_delay", - "type": "uint256" - } - ], - "name": "setStuckPenaltyDelay", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getStuckPenaltyDelay", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_index", - "type": "uint256" - } - ], - "name": "removeSigningKey", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_fromIndex", - "type": "uint256" - }, - { - "name": "_keysCount", - "type": "uint256" - } - ], - "name": "removeSigningKeys", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - } - ], - "name": "isOperatorPenalized", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - } - ], - "name": "deactivateNodeOperator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "token", - "type": "address" - } - ], - "name": "allowRecoverability", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "STAKING_ROUTER_ROLE", - "outputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_keysCount", - "type": "uint256" - }, - { - "name": "_publicKeys", - "type": "bytes" - }, - { - "name": "_signatures", - "type": "bytes" - } - ], - "name": "addSigningKeysOperatorBH", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "appId", - "outputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getActiveNodeOperatorsCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_name", - "type": "string" - }, - { - "name": "_rewardAddress", - "type": "address" - } - ], - "name": "addNodeOperator", - "outputs": [ - { - "name": "id", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getContractVersion", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getInitializationBlock", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - } - ], - "name": "getUnusedSigningKeyCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "onRewardsMinted", - "outputs": [], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MANAGE_NODE_OPERATOR_ROLE", - "outputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "onWithdrawalCredentialsChanged", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - } - ], - "name": "activateNodeOperator", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_rewardAddress", - "type": "address" - } - ], - "name": "setNodeOperatorRewardAddress", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_fullInfo", - "type": "bool" - } - ], - "name": "getNodeOperator", - "outputs": [ - { - "name": "active", - "type": "bool" - }, - { - "name": "name", - "type": "string" - }, - { - "name": "rewardAddress", - "type": "address" - }, - { - "name": "totalVettedValidators", - "type": "uint64" - }, - { - "name": "totalExitedValidators", - "type": "uint64" - }, - { - "name": "totalAddedValidators", - "type": "uint64" - }, - { - "name": "totalDepositedValidators", - "type": "uint64" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_locator", - "type": "address" - }, - { - "name": "_type", - "type": "bytes32" - }, - { - "name": "_stuckPenaltyDelay", - "type": "uint256" - } - ], - "name": "finalizeUpgrade_v2", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getStakingModuleSummary", - "outputs": [ - { - "name": "totalExitedValidators", - "type": "uint256" - }, - { - "name": "totalDepositedValidators", - "type": "uint256" - }, - { - "name": "depositableValidatorsCount", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorIds", - "type": "bytes" - }, - { - "name": "_exitedValidatorsCounts", - "type": "bytes" - } - ], - "name": "updateExitedValidatorsCount", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorIds", - "type": "bytes" - }, - { - "name": "_stuckValidatorsCounts", - "type": "bytes" - } - ], - "name": "updateStuckValidatorsCount", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_token", - "type": "address" - } - ], - "name": "transferToVault", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_sender", - "type": "address" - }, - { - "name": "_role", - "type": "bytes32" - }, - { - "name": "_params", - "type": "uint256[]" - } - ], - "name": "canPerform", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_refundedValidatorsCount", - "type": "uint256" - } - ], - "name": "updateRefundedValidatorsCount", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getEVMScriptRegistry", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNodeOperatorsCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_isTargetLimitActive", - "type": "bool" - }, - { - "name": "_targetLimit", - "type": "uint256" - } - ], - "name": "updateTargetValidatorsLimits", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_vettedSigningKeysCount", - "type": "uint64" - } - ], - "name": "setNodeOperatorStakingLimit", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - } - ], - "name": "getNodeOperatorSummary", - "outputs": [ - { - "name": "isTargetLimitActive", - "type": "bool" - }, - { - "name": "targetValidatorsCount", - "type": "uint256" - }, - { - "name": "stuckValidatorsCount", - "type": "uint256" - }, - { - "name": "refundedValidatorsCount", - "type": "uint256" - }, - { - "name": "stuckPenaltyEndTimestamp", - "type": "uint256" - }, - { - "name": "totalExitedValidators", - "type": "uint256" - }, - { - "name": "totalDepositedValidators", - "type": "uint256" - }, - { - "name": "depositableValidatorsCount", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_index", - "type": "uint256" - } - ], - "name": "getSigningKey", - "outputs": [ - { - "name": "key", - "type": "bytes" - }, - { - "name": "depositSignature", - "type": "bytes" - }, - { - "name": "used", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_NODE_OPERATOR_NAME_LENGTH", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_depositsCount", - "type": "uint256" - }, - { - "name": "", - "type": "bytes" - } - ], - "name": "obtainDepositData", - "outputs": [ - { - "name": "publicKeys", - "type": "bytes" - }, - { - "name": "signatures", - "type": "bytes" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getKeysOpIndex", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNonce", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "kernel", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getLocator", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "SET_NODE_OPERATOR_LIMIT_ROLE", - "outputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - } - ], - "name": "getTotalSigningKeyCount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "isPetrified", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_STUCK_PENALTY_DELAY", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "onExitedAndStuckValidatorsCountsUpdated", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_NODE_OPERATORS_COUNT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_index", - "type": "uint256" - } - ], - "name": "removeSigningKeyOperatorBH", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_exitedValidatorsCount", - "type": "uint256" - }, - { - "name": "_stuckValidatorsCount", - "type": "uint256" - } - ], - "name": "unsafeUpdateValidatorsCount", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MANAGE_SIGNING_KEYS", - "outputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - } - ], - "name": "isOperatorPenaltyCleared", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "name", - "type": "string" - }, - { - "indexed": false, - "name": "rewardAddress", - "type": "address" - }, - { - "indexed": false, - "name": "stakingLimit", - "type": "uint64" - } - ], - "name": "NodeOperatorAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "active", - "type": "bool" - } - ], - "name": "NodeOperatorActiveSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "name", - "type": "string" - } - ], - "name": "NodeOperatorNameSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "rewardAddress", - "type": "address" - } - ], - "name": "NodeOperatorRewardAddressSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "totalKeysTrimmed", - "type": "uint64" - } - ], - "name": "NodeOperatorTotalKeysTrimmed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "keysOpIndex", - "type": "uint256" - } - ], - "name": "KeysOpIndexSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "moduleType", - "type": "bytes32" - } - ], - "name": "StakingModuleTypeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "rewardAddress", - "type": "address" - }, - { - "indexed": false, - "name": "sharesAmount", - "type": "uint256" - } - ], - "name": "RewardsDistributed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "locatorAddress", - "type": "address" - } - ], - "name": "LocatorContractSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "approvedValidatorsCount", - "type": "uint256" - } - ], - "name": "VettedSigningKeysCountChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "depositedValidatorsCount", - "type": "uint256" - } - ], - "name": "DepositedSigningKeysCountChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "exitedValidatorsCount", - "type": "uint256" - } - ], - "name": "ExitedSigningKeysCountChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "totalValidatorsCount", - "type": "uint256" - } - ], - "name": "TotalSigningKeysCountChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "nonce", - "type": "uint256" - } - ], - "name": "NonceChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "stuckPenaltyDelay", - "type": "uint256" - } - ], - "name": "StuckPenaltyDelayChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "stuckValidatorsCount", - "type": "uint256" - }, - { - "indexed": false, - "name": "refundedValidatorsCount", - "type": "uint256" - }, - { - "indexed": false, - "name": "stuckPenaltyEndTimestamp", - "type": "uint256" - } - ], - "name": "StuckPenaltyStateChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "targetValidatorsCount", - "type": "uint256" - } - ], - "name": "TargetValidatorsCountChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "recipientAddress", - "type": "address" - }, - { - "indexed": false, - "name": "sharesPenalizedAmount", - "type": "uint256" - } - ], - "name": "NodeOperatorPenalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "version", - "type": "uint256" - } - ], - "name": "ContractVersionSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "executor", - "type": "address" - }, - { - "indexed": false, - "name": "script", - "type": "bytes" - }, - { - "indexed": false, - "name": "input", - "type": "bytes" - }, - { - "indexed": false, - "name": "returnData", - "type": "bytes" - } - ], - "name": "ScriptResult", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "vault", - "type": "address" - }, - { - "indexed": true, - "name": "token", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - } - ], - "name": "RecoverToVault", - "type": "event" - } -] + { + "constant": true, + "inputs": [], + "name": "hasInitialized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_targetLimitMode", + "type": "uint256" + }, + { + "name": "_targetLimit", + "type": "uint256" + } + ], + "name": "updateTargetValidatorsLimits", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_keysCount", + "type": "uint256" + }, + { + "name": "_publicKeys", + "type": "bytes" + }, + { + "name": "_signatures", + "type": "bytes" + } + ], + "name": "addSigningKeys", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getType", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_script", + "type": "bytes" + } + ], + "name": "getEVMScriptExecutor", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "clearNodeOperatorPenalty", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getRecoveryVault", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_offset", + "type": "uint256" + }, + { + "name": "_limit", + "type": "uint256" + } + ], + "name": "getNodeOperatorIds", + "outputs": [ + { + "name": "nodeOperatorIds", + "type": "uint256[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_offset", + "type": "uint256" + }, + { + "name": "_limit", + "type": "uint256" + } + ], + "name": "getSigningKeys", + "outputs": [ + { + "name": "pubkeys", + "type": "bytes" + }, + { + "name": "signatures", + "type": "bytes" + }, + { + "name": "used", + "type": "bool[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_fromIndex", + "type": "uint256" + }, + { + "name": "_keysCount", + "type": "uint256" + } + ], + "name": "removeSigningKeysOperatorBH", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "getNodeOperatorIsActive", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_name", + "type": "string" + } + ], + "name": "setNodeOperatorName", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_totalRewardShares", + "type": "uint256" + } + ], + "name": "getRewardsDistribution", + "outputs": [ + { + "name": "recipients", + "type": "address[]" + }, + { + "name": "shares", + "type": "uint256[]" + }, + { + "name": "penalized", + "type": "bool[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_indexFrom", + "type": "uint256" + }, + { + "name": "_indexTo", + "type": "uint256" + } + ], + "name": "invalidateReadyToDepositKeysRange", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_locator", + "type": "address" + }, + { + "name": "_type", + "type": "bytes32" + }, + { + "name": "_stuckPenaltyDelay", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_delay", + "type": "uint256" + } + ], + "name": "setStuckPenaltyDelay", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "finalizeUpgrade_v3", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getStuckPenaltyDelay", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_index", + "type": "uint256" + } + ], + "name": "removeSigningKey", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getRewardDistributionState", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_fromIndex", + "type": "uint256" + }, + { + "name": "_keysCount", + "type": "uint256" + } + ], + "name": "removeSigningKeys", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "isOperatorPenalized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "deactivateNodeOperator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "token", + "type": "address" + } + ], + "name": "allowRecoverability", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "STAKING_ROUTER_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_keysCount", + "type": "uint256" + }, + { + "name": "_publicKeys", + "type": "bytes" + }, + { + "name": "_signatures", + "type": "bytes" + } + ], + "name": "addSigningKeysOperatorBH", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "appId", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getActiveNodeOperatorsCount", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_name", + "type": "string" + }, + { + "name": "_rewardAddress", + "type": "address" + } + ], + "name": "addNodeOperator", + "outputs": [ + { + "name": "id", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getContractVersion", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getInitializationBlock", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "getUnusedSigningKeyCount", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "onRewardsMinted", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MANAGE_NODE_OPERATOR_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "distributeReward", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "onWithdrawalCredentialsChanged", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "activateNodeOperator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_rewardAddress", + "type": "address" + } + ], + "name": "setNodeOperatorRewardAddress", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_fullInfo", + "type": "bool" + } + ], + "name": "getNodeOperator", + "outputs": [ + { + "name": "active", + "type": "bool" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "rewardAddress", + "type": "address" + }, + { + "name": "totalVettedValidators", + "type": "uint64" + }, + { + "name": "totalExitedValidators", + "type": "uint64" + }, + { + "name": "totalAddedValidators", + "type": "uint64" + }, + { + "name": "totalDepositedValidators", + "type": "uint64" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_locator", + "type": "address" + }, + { + "name": "_type", + "type": "bytes32" + }, + { + "name": "_stuckPenaltyDelay", + "type": "uint256" + } + ], + "name": "finalizeUpgrade_v2", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getStakingModuleSummary", + "outputs": [ + { + "name": "totalExitedValidators", + "type": "uint256" + }, + { + "name": "totalDepositedValidators", + "type": "uint256" + }, + { + "name": "depositableValidatorsCount", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorIds", + "type": "bytes" + }, + { + "name": "_exitedValidatorsCounts", + "type": "bytes" + } + ], + "name": "updateExitedValidatorsCount", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorIds", + "type": "bytes" + }, + { + "name": "_stuckValidatorsCounts", + "type": "bytes" + } + ], + "name": "updateStuckValidatorsCount", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_token", + "type": "address" + } + ], + "name": "transferToVault", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_sender", + "type": "address" + }, + { + "name": "_role", + "type": "bytes32" + }, + { + "name": "_params", + "type": "uint256[]" + } + ], + "name": "canPerform", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_refundedValidatorsCount", + "type": "uint256" + } + ], + "name": "updateRefundedValidatorsCount", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getEVMScriptRegistry", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNodeOperatorsCount", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_isTargetLimitActive", + "type": "bool" + }, + { + "name": "_targetLimit", + "type": "uint256" + } + ], + "name": "updateTargetValidatorsLimits", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_vettedSigningKeysCount", + "type": "uint64" + } + ], + "name": "setNodeOperatorStakingLimit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "getNodeOperatorSummary", + "outputs": [ + { + "name": "targetLimitMode", + "type": "uint256" + }, + { + "name": "targetValidatorsCount", + "type": "uint256" + }, + { + "name": "stuckValidatorsCount", + "type": "uint256" + }, + { + "name": "refundedValidatorsCount", + "type": "uint256" + }, + { + "name": "stuckPenaltyEndTimestamp", + "type": "uint256" + }, + { + "name": "totalExitedValidators", + "type": "uint256" + }, + { + "name": "totalDepositedValidators", + "type": "uint256" + }, + { + "name": "depositableValidatorsCount", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_index", + "type": "uint256" + } + ], + "name": "getSigningKey", + "outputs": [ + { + "name": "key", + "type": "bytes" + }, + { + "name": "depositSignature", + "type": "bytes" + }, + { + "name": "used", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_NODE_OPERATOR_NAME_LENGTH", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorIds", + "type": "bytes" + }, + { + "name": "_vettedSigningKeysCounts", + "type": "bytes" + } + ], + "name": "decreaseVettedSigningKeysCount", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_depositsCount", + "type": "uint256" + }, + { + "name": "", + "type": "bytes" + } + ], + "name": "obtainDepositData", + "outputs": [ + { + "name": "publicKeys", + "type": "bytes" + }, + { + "name": "signatures", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getKeysOpIndex", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getNonce", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "kernel", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getLocator", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "SET_NODE_OPERATOR_LIMIT_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "getTotalSigningKeyCount", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isPetrified", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_STUCK_PENALTY_DELAY", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "onExitedAndStuckValidatorsCountsUpdated", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_NODE_OPERATORS_COUNT", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_index", + "type": "uint256" + } + ], + "name": "removeSigningKeyOperatorBH", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + }, + { + "name": "_exitedValidatorsCount", + "type": "uint256" + }, + { + "name": "_stuckValidatorsCount", + "type": "uint256" + } + ], + "name": "unsafeUpdateValidatorsCount", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MANAGE_SIGNING_KEYS", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "isOperatorPenaltyCleared", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "name", + "type": "string" + }, + { + "indexed": false, + "name": "rewardAddress", + "type": "address" + }, + { + "indexed": false, + "name": "stakingLimit", + "type": "uint64" + } + ], + "name": "NodeOperatorAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "active", + "type": "bool" + } + ], + "name": "NodeOperatorActiveSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "name", + "type": "string" + } + ], + "name": "NodeOperatorNameSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "rewardAddress", + "type": "address" + } + ], + "name": "NodeOperatorRewardAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "totalKeysTrimmed", + "type": "uint64" + } + ], + "name": "NodeOperatorTotalKeysTrimmed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "keysOpIndex", + "type": "uint256" + } + ], + "name": "KeysOpIndexSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "moduleType", + "type": "bytes32" + } + ], + "name": "StakingModuleTypeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "rewardAddress", + "type": "address" + }, + { + "indexed": false, + "name": "sharesAmount", + "type": "uint256" + } + ], + "name": "RewardsDistributed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "state", + "type": "uint8" + } + ], + "name": "RewardDistributionStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "locatorAddress", + "type": "address" + } + ], + "name": "LocatorContractSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "approvedValidatorsCount", + "type": "uint256" + } + ], + "name": "VettedSigningKeysCountChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "depositedValidatorsCount", + "type": "uint256" + } + ], + "name": "DepositedSigningKeysCountChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "exitedValidatorsCount", + "type": "uint256" + } + ], + "name": "ExitedSigningKeysCountChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "totalValidatorsCount", + "type": "uint256" + } + ], + "name": "TotalSigningKeysCountChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "nonce", + "type": "uint256" + } + ], + "name": "NonceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "stuckPenaltyDelay", + "type": "uint256" + } + ], + "name": "StuckPenaltyDelayChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "stuckValidatorsCount", + "type": "uint256" + }, + { + "indexed": false, + "name": "refundedValidatorsCount", + "type": "uint256" + }, + { + "indexed": false, + "name": "stuckPenaltyEndTimestamp", + "type": "uint256" + } + ], + "name": "StuckPenaltyStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + }, + { + "indexed": false, + "name": "targetValidatorsCount", + "type": "uint256" + }, + { + "indexed": false, + "name": "targetLimitMode", + "type": "uint256" + } + ], + "name": "TargetValidatorsCountChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "recipientAddress", + "type": "address" + }, + { + "indexed": false, + "name": "sharesPenalizedAmount", + "type": "uint256" + } + ], + "name": "NodeOperatorPenalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "nodeOperatorId", + "type": "uint256" + } + ], + "name": "NodeOperatorPenaltyCleared", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "version", + "type": "uint256" + } + ], + "name": "ContractVersionSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "executor", + "type": "address" + }, + { + "indexed": false, + "name": "script", + "type": "bytes" + }, + { + "indexed": false, + "name": "input", + "type": "bytes" + }, + { + "indexed": false, + "name": "returnData", + "type": "bytes" + } + ], + "name": "ScriptResult", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "vault", + "type": "address" + }, + { + "indexed": true, + "name": "token", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "RecoverToVault", + "type": "event" + } +] \ No newline at end of file diff --git a/scripts/deploy_simple_dvt_factories.py b/scripts/deploy_simple_dvt_factories.py index 7e52a720..fc3606c1 100644 --- a/scripts/deploy_simple_dvt_factories.py +++ b/scripts/deploy_simple_dvt_factories.py @@ -134,10 +134,10 @@ def main(): } # UpdateTargetValidatorLimits - update_tareget_validator_limits = UpdateTargetValidatorLimits.deploy(trusted_caller, simple_dvt, tx_params) + update_target_validator_limits = UpdateTargetValidatorLimits.deploy(trusted_caller, simple_dvt, tx_params) deployment_artifacts["UpdateTargetValidatorLimits"] = { "contract": "UpdateTargetValidatorLimits", - "address": update_tareget_validator_limits.address, + "address": update_target_validator_limits.address, "constructorArgs": [trusted_caller, simple_dvt], } @@ -162,12 +162,12 @@ def main(): "Deployed SetNodeOperatorRewardAddresses", set_node_operator_reward.address, ) - log.ok("Deployed UpdateTargetValidatorLimits", update_tareget_validator_limits.address) + log.ok("Deployed UpdateTargetValidatorLimits", update_target_validator_limits.address) log.ok("Deployed ChangeNodeOperatorManagers", change_node_operator_manager.address) log.br() log.nb("All factories have been deployed.") - log.nb("Saving atrifacts...") + log.nb("Saving artifacts...") with open(f"deployed-{network_name}.json", "w") as outfile: json.dump(deployment_artifacts, outfile) @@ -182,7 +182,7 @@ def main(): IncreaseVettedValidatorsLimit.publish_source(increase_vetted_validators_limits) SetNodeOperatorNames.publish_source(set_node_operator_names) SetNodeOperatorRewardAddresses.publish_source(set_node_operator_reward) - UpdateTargetValidatorLimits.publish_source(update_tareget_validator_limits) + UpdateTargetValidatorLimits.publish_source(update_target_validator_limits) ChangeNodeOperatorManagers.publish_source(change_node_operator_manager) log.br() diff --git a/scripts/deploy_update_target_limit_factory.py b/scripts/deploy_update_target_limit_factory.py new file mode 100644 index 00000000..a44488df --- /dev/null +++ b/scripts/deploy_update_target_limit_factory.py @@ -0,0 +1,88 @@ +import json +import os + +from brownie import chain, UpdateTargetValidatorLimits, web3 + +from utils import lido, log +from utils.config import ( + get_is_live, + get_deployer_account, + prompt_bool, + get_network_name, +) + + +def get_trusted_caller(): + if "TRUSTED_CALLER" not in os.environ: + raise EnvironmentError("Please set TRUSTED_CALLER env variable") + trusted_caller = os.environ["TRUSTED_CALLER"] + + assert web3.isAddress(trusted_caller), "Trusted caller address is not valid" + + return trusted_caller + + +def main(): + network_name = get_network_name() + contracts = lido.contracts(network=network_name) + + deployer = get_deployer_account(get_is_live(), network=network_name) + trusted_caller = get_trusted_caller() + simple_dvt = contracts.simple_dvt.address + + log.br() + + log.nb("Current network", network_name, color_hl=log.color_magenta) + log.nb("Using deployed addresses for", network_name, color_hl=log.color_yellow) + log.nb("chain id", chain.id) + + log.br() + + log.ok("Deployer", deployer) + + log.br() + + log.ok("Simple DVT module address", simple_dvt) + log.ok("Trusted caller", trusted_caller) + + log.br() + + print("Proceed? [yes/no]: ") + + if not prompt_bool(): + log.nb("Aborting") + return + + tx_params = {"from": deployer, "priority_fee": "2 gwei", "max_fee": "50 gwei"} + + log.br() + + deployment_artifacts = {} + + # UpdateTargetValidatorLimits + update_target_validator_limits = UpdateTargetValidatorLimits.deploy( + trusted_caller, simple_dvt, tx_params + ) + deployment_artifacts["UpdateTargetValidatorLimits"] = { + "contract": "UpdateTargetValidatorLimits", + "address": update_target_validator_limits.address, + "constructorArgs": [trusted_caller, simple_dvt], + } + + log.ok( + "Deployed UpdateTargetValidatorLimits", update_target_validator_limits.address + ) + + log.br() + log.nb("All factories have been deployed.") + log.nb("Saving artifacts...") + + with open(f"deployed-{network_name}.json", "w") as outfile: + json.dump(deployment_artifacts, outfile) + + log.nb("Starting code verification.") + log.br() + + UpdateTargetValidatorLimits.publish_source(update_target_validator_limits) + + log.br() diff --git a/tests/evm_script_factories/test_update_target_validators_limits.py b/tests/evm_script_factories/test_update_target_validators_limits.py index 8fe1bbb6..b46f62e6 100644 --- a/tests/evm_script_factories/test_update_target_validators_limits.py +++ b/tests/evm_script_factories/test_update_target_validators_limits.py @@ -9,7 +9,7 @@ def create_calldata(data): return ( "0x" + encode( - ["(uint256,bool,uint256)[]"], + ["(uint256,uint256,uint256)[]"], [data], ).hex() ) @@ -44,11 +44,11 @@ def test_non_sorted_calldata(owner, update_target_validator_limits_factory): "Must revert with message 'NODE_OPERATORS_IS_NOT_SORTED' when operator ids isn't sorted" with reverts("NODE_OPERATORS_IS_NOT_SORTED"): - NON_SORTED_CALLDATA = create_calldata([(1, True, 1), (0, False, 2)]) + NON_SORTED_CALLDATA = create_calldata([(1, 1, 1), (0, 0, 2)]) update_target_validator_limits_factory.createEVMScript(owner, NON_SORTED_CALLDATA) with reverts("NODE_OPERATORS_IS_NOT_SORTED"): - NON_SORTED_CALLDATA = create_calldata([(0, True, 1), (0, True, 2)]) + NON_SORTED_CALLDATA = create_calldata([(0, 1, 1), (0, 1, 2)]) update_target_validator_limits_factory.createEVMScript(owner, NON_SORTED_CALLDATA) @@ -57,7 +57,7 @@ def test_operator_id_out_of_range(owner, update_target_validator_limits_factory, with reverts("NODE_OPERATOR_INDEX_OUT_OF_RANGE"): node_operators_count = node_operators_registry.getNodeOperatorsCount() - CALLDATA = create_calldata([(node_operators_count, True, 1)]) + CALLDATA = create_calldata([(node_operators_count, 1, 1)]) update_target_validator_limits_factory.createEVMScript(owner, CALLDATA) @@ -68,7 +68,7 @@ def test_create_evm_script( ): "Must create correct EVMScript if all requirements are met" - input_params = [(0, True, 1), (1, True, 1)] + input_params = [(0, 1, 1), (1, 1, 1)] EVM_SCRIPT_CALLDATA = create_calldata(input_params) evm_script = update_target_validator_limits_factory.createEVMScript(owner, EVM_SCRIPT_CALLDATA) @@ -76,7 +76,7 @@ def test_create_evm_script( [ ( node_operators_registry.address, - node_operators_registry.updateTargetValidatorsLimits.encode_input( + node_operators_registry.updateTargetValidatorsLimits['uint256,uint256,uint256'].encode_input( input_param[0], input_param[1], input_param[2] ), ) @@ -88,7 +88,7 @@ def test_create_evm_script( def test_decode_evm_script_call_data(node_operators_registry, update_target_validator_limits_factory): "Must decode EVMScript call data correctly" - input_params = [(0, True, 1), (1, True, 1)] + input_params = [(0, 1, 1), (1, 1, 1)] EVM_SCRIPT_CALLDATA = create_calldata(input_params) assert update_target_validator_limits_factory.decodeEVMScriptCallData(EVM_SCRIPT_CALLDATA) == input_params diff --git a/tests/scenario/conftest.py b/tests/scenario/conftest.py index e5ebd8fc..1adda228 100644 --- a/tests/scenario/conftest.py +++ b/tests/scenario/conftest.py @@ -399,7 +399,7 @@ def change_node_operator_manager_factory( @pytest.fixture(scope="module") -def update_tareget_validator_limits_factory( +def update_target_validator_limits_factory( et_contracts, voting, simple_dvt, @@ -416,12 +416,12 @@ def update_tareget_validator_limits_factory( assert factory.nodeOperatorsRegistry() == simple_dvt assert factory.trustedCaller() == commitee_multisig - update_tareget_validators_limits_permission = ( - simple_dvt.address + simple_dvt.updateTargetValidatorsLimits.signature[2:] + update_target_validators_limits_permission = ( + simple_dvt.address + simple_dvt.updateTargetValidatorsLimits['uint256,uint256,uint256'].signature[2:] ) et_contracts.easy_track.addEVMScriptFactory( factory, - update_tareget_validators_limits_permission, + update_target_validators_limits_permission, {"from": voting}, ) evm_script_factories = et_contracts.easy_track.getEVMScriptFactories() diff --git a/tests/scenario/test_dvt_scenario.py b/tests/scenario/test_dvt_scenario.py index b975b1d4..d3f9f638 100644 --- a/tests/scenario/test_dvt_scenario.py +++ b/tests/scenario/test_dvt_scenario.py @@ -40,15 +40,23 @@ def simple_dvt( nor_proxy = interface.AragonAppProxy(node_operators_registry) module_name = "simple-dvt-registry" name = web3.keccak(text=module_name).hex() - simple_DVT_tx = kernel.newAppInstance(name, nor_proxy.implementation(), {"from": voting}) + simple_DVT_tx = kernel.newAppInstance( + name, nor_proxy.implementation(), {"from": voting} + ) - simple_dvt_contract = interface.NodeOperatorsRegistry(simple_DVT_tx.new_contracts[0]) + simple_dvt_contract = interface.NodeOperatorsRegistry( + simple_DVT_tx.new_contracts[0] + ) simple_dvt_contract.initialize(locator, "0x01", 0, {"from": voting}) - staking_router.grantRole(web3.keccak(text="STAKING_MODULE_MANAGE_ROLE").hex(), agent, {"from": agent}) + staking_router.grantRole( + web3.keccak(text="STAKING_MODULE_MANAGE_ROLE").hex(), agent, {"from": agent} + ) - staking_router.addStakingModule("Simple DVT", simple_dvt_contract, 10_000, 500, 500, {"from": agent}) + staking_router.addStakingModule( + "Simple DVT", simple_dvt_contract, 10_000, 500, 500, {"from": agent} + ) acl.createPermission( agent, @@ -76,7 +84,7 @@ def test_simple_dvt_scenario( set_node_operator_reward_address_factory, set_vetted_validators_limit_factory, change_node_operator_manager_factory, - update_tareget_validator_limits_factory, + update_target_validator_limits_factory, increase_vetted_validators_limit_factory, stranger, ): @@ -116,12 +124,17 @@ def test_simple_dvt_scenario( ["uint256", "(string,address,address)[]"], [ 0, - [(cluster["name"], cluster["address"], cluster["manager"]) for cluster in clusters], + [ + (cluster["name"], cluster["address"], cluster["manager"]) + for cluster in clusters + ], ], ).hex() ) - easytrack_executor(commitee_multisig, add_node_operators_factory, add_node_operators_calldata) + easytrack_executor( + commitee_multisig, add_node_operators_factory, add_node_operators_calldata + ) for cluster_index in range(len(clusters)): cluster = simple_dvt.getNodeOperator(cluster_index, True) @@ -147,9 +160,13 @@ def test_simple_dvt_scenario( deactivate_node_operators_data = [] for cluster_index in range(2, 5): - deactivate_node_operators_data.append((cluster_index, clusters[cluster_index]["manager"])) + deactivate_node_operators_data.append( + (cluster_index, clusters[cluster_index]["manager"]) + ) - deactivate_node_operators_calldata = "0x" + encode(["(uint256,address)[]"], [deactivate_node_operators_data]).hex() + deactivate_node_operators_calldata = ( + "0x" + encode(["(uint256,address)[]"], [deactivate_node_operators_data]).hex() + ) easytrack_executor( commitee_multisig, @@ -175,9 +192,13 @@ def test_simple_dvt_scenario( activate_node_operators_data = [] for cluster_index in range(2, 5): - activate_node_operators_data.append((cluster_index, clusters[cluster_index]["manager"])) + activate_node_operators_data.append( + (cluster_index, clusters[cluster_index]["manager"]) + ) - activate_node_operators_calldata = "0x" + encode(["(uint256,address)[]"], [activate_node_operators_data]).hex() + activate_node_operators_calldata = ( + "0x" + encode(["(uint256,address)[]"], [activate_node_operators_data]).hex() + ) easytrack_executor( commitee_multisig, @@ -200,7 +221,9 @@ def test_simple_dvt_scenario( # Set name of node operator - set_node_operator_name_calldata = "0x" + encode(["(uint256,string)[]"], [[(6, "New Name")]]).hex() + set_node_operator_name_calldata = ( + "0x" + encode(["(uint256,string)[]"], [[(6, "New Name")]]).hex() + ) easytrack_executor( commitee_multisig, @@ -259,7 +282,9 @@ def test_simple_dvt_scenario( {"from": clusters[6]["manager"]}, ) - set_vetted_validators_limit_calldata = "0x" + encode(["(uint256,uint256)[]"], [[(no_5_id, 4), (no_6_id, 3)]]).hex() + set_vetted_validators_limit_calldata = ( + "0x" + encode(["(uint256,uint256)[]"], [[(no_5_id, 4), (no_6_id, 3)]]).hex() + ) easytrack_executor( commitee_multisig, set_vetted_validators_limit_factory, @@ -280,7 +305,9 @@ def test_simple_dvt_scenario( {"from": clusters[5]["manager"]}, ) - increase_vetted_validators_limit_calldata = "0x" + encode(["(uint256,uint256)"], [(no_5_id, 6)]).hex() + increase_vetted_validators_limit_calldata = ( + "0x" + encode(["(uint256,uint256)"], [(no_5_id, 6)]).hex() + ) easytrack_executor( clusters[5]["manager"], increase_vetted_validators_limit_factory, @@ -292,20 +319,23 @@ def test_simple_dvt_scenario( # Update target validators limits - update_tareget_validator_limits_calldata = ( - "0x" + encode(["(uint256,bool,uint256)[]"], [[(no_5_id, True, 1), (no_6_id, True, 10)]]).hex() + update_target_validator_limits_calldata = ( + "0x" + + encode( + ["(uint256,uint256,uint256)[]"], [[(no_5_id, 2, 1), (no_6_id, 1, 10)]] + ).hex() ) easytrack_executor( commitee_multisig, - update_tareget_validator_limits_factory, - update_tareget_validator_limits_calldata, + update_target_validator_limits_factory, + update_target_validator_limits_calldata, ) no_5_summary = simple_dvt.getNodeOperatorSummary(no_5_id) no_6_summary = simple_dvt.getNodeOperatorSummary(no_6_id) - assert no_5_summary["isTargetLimitActive"] == True - assert no_6_summary["isTargetLimitActive"] == True + assert no_5_summary["targetLimitMode"] == 2 + assert no_6_summary["targetLimitMode"] == 1 assert no_5_summary["targetValidatorsCount"] == 1 assert no_6_summary["targetValidatorsCount"] == 10 @@ -341,19 +371,21 @@ def test_simple_dvt_scenario( agent, simple_dvt, web3.keccak(text="MANAGE_SIGNING_KEYS").hex() ) - set_permission_manager_calldata = et_contracts.evm_script_executor.executeEVMScript.encode_input( - encode_call_script( - [ - ( - acl.address, - acl.setPermissionManager.encode_input( - agent, - simple_dvt, - web3.keccak(text="MANAGE_SIGNING_KEYS").hex(), - ), - ) - ] - ), + set_permission_manager_calldata = ( + et_contracts.evm_script_executor.executeEVMScript.encode_input( + encode_call_script( + [ + ( + acl.address, + acl.setPermissionManager.encode_input( + agent, + simple_dvt, + web3.keccak(text="MANAGE_SIGNING_KEYS").hex(), + ), + ) + ] + ), + ) ) et_contracts.evm_script_executor.setEasyTrack(agent, {"from": voting}) @@ -363,6 +395,10 @@ def test_simple_dvt_scenario( set_permission_manager_calldata, {"from": voting}, ) - et_contracts.evm_script_executor.setEasyTrack(et_contracts.easy_track, {"from": voting}) + et_contracts.evm_script_executor.setEasyTrack( + et_contracts.easy_track, {"from": voting} + ) - assert acl.getPermissionManager(simple_dvt, simple_dvt.MANAGE_SIGNING_KEYS()) == agent + assert ( + acl.getPermissionManager(simple_dvt, simple_dvt.MANAGE_SIGNING_KEYS()) == agent + ) diff --git a/tests/scenario/test_dvt_scenario_collisions.py b/tests/scenario/test_dvt_scenario_collisions.py index 5d0b463a..ddbf83fb 100644 --- a/tests/scenario/test_dvt_scenario_collisions.py +++ b/tests/scenario/test_dvt_scenario_collisions.py @@ -115,8 +115,8 @@ def prepare_set_node_operator_reward_address_calldata(operator, address): return "0x" + encode(["(uint256,address)[]"], [[(operator, address)]]).hex() -def prepare_update_target_validator_limits_calldata(id_operator, is_active, target_limits): - return "0x" + encode(["(uint256,bool,uint256)[]"], [[(id_operator, is_active, target_limits)]]).hex() +def prepare_update_target_validator_limits_calldata(id_operator, limit_mode, target_limits): + return "0x" + encode(["(uint256,uint256,uint256)[]"], [[(id_operator, limit_mode, target_limits)]]).hex() def prepare_set_vetted_validators_limit_calldata(id_operator, vetted_limit): @@ -143,7 +143,6 @@ def test_simple_dvt_scenario( set_node_operator_reward_address_factory, set_vetted_validators_limit_factory, change_node_operator_manager_factory, - update_tareget_validator_limits_factory, increase_vetted_validators_limit_factory, ): # Grant roles diff --git a/utils/evm_script.py b/utils/evm_script.py index 354a94ba..fd03ec99 100644 --- a/utils/evm_script.py +++ b/utils/evm_script.py @@ -1,6 +1,5 @@ import eth_abi -from web3 import Web3 -from eth_typing.evm import HexAddress +from brownie.convert import to_bytes EMPTY_CALLSCRIPT = "0x00000001" @@ -16,7 +15,7 @@ def strip_byte_prefix(hexstr): def encode_call_script(actions, spec_id=1): result = create_executor_id(spec_id) for to, calldata in actions: - addr_bytes = Web3.to_bytes(hexstr=HexAddress(to)).hex() + addr_bytes = to_bytes(to, "bytes").hex() calldata_bytes = strip_byte_prefix(calldata) length = eth_abi.encode(["uint32"], [len(calldata_bytes) // 2]).hex() result += addr_bytes + length[56:] + calldata_bytes