diff --git a/abi/NodeOperators.abi.json b/abi/NodeOperators.abi.json deleted file mode 100644 index 964ae4d2..00000000 --- a/abi/NodeOperators.abi.json +++ /dev/null @@ -1 +0,0 @@ -[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_rewardAddress","type":"address"},{"name":"_stakingLimit","type":"uint64"}],"name":"addNodeOperator","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operator_id","type":"uint256"},{"name":"_quantity","type":"uint256"},{"name":"_pubkeys","type":"bytes"},{"name":"_signatures","type":"bytes"}],"name":"addSigningKeys","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_numKeys","type":"uint256"}],"name":"assignNextSigningKeys","outputs":[{"name":"pubkeys","type":"bytes"},{"name":"signatures","type":"bytes"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"SIGNATURE_LENGTH","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"SET_NODE_OPERATOR_ADDRESS_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","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[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_active","type":"bool"}],"name":"setNodeOperatorActive","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"SET_NODE_OPERATOR_NAME_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_operator_id","type":"uint256"},{"name":"_index","type":"uint256"}],"name":"removeSigningKey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ADD_NODE_OPERATOR_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_operator_id","type":"uint256"},{"name":"_quantity","type":"uint256"},{"name":"_pubkeys","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":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_operator_id","type":"uint256"}],"name":"getUnusedSigningKeyCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_rewardAddress","type":"address"}],"name":"setNodeOperatorRewardAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"},{"name":"_fullInfo","type":"bool"}],"name":"getNodeOperator","outputs":[{"name":"active","type":"bool"},{"name":"name","type":"string"},{"name":"rewardAddress","type":"address"},{"name":"stakingLimit","type":"uint64"},{"name":"stoppedValidators","type":"uint64"},{"name":"totalSigningKeys","type":"uint64"},{"name":"usedSigningKeys","type":"uint64"}],"payable":false,"stateMutability":"view","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":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PUBKEY_LENGTH","outputs":[{"name":"","type":"uint256"}],"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":"_id","type":"uint256"},{"name":"_stakingLimit","type":"uint64"}],"name":"setNodeOperatorStakingLimit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_operator_id","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":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_stoppedIncrement","type":"uint64"}],"name":"reportStoppedValidators","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_lido","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"REPORT_STOPPED_VALIDATORS_ROLE","outputs":[{"name":"","type":"bytes32"}],"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":"SET_NODE_OPERATOR_ACTIVE_ROLE","outputs":[{"name":"","type":"bytes32"}],"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":"_operator_id","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":false,"inputs":[{"name":"_operator_id","type":"uint256"},{"name":"_index","type":"uint256"}],"name":"removeSigningKeyOperatorBH","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":false,"inputs":[],"name":"trimUnusedKeys","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"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"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","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":"id","type":"uint256"},{"indexed":false,"name":"active","type":"bool"}],"name":"NodeOperatorActiveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"name","type":"string"}],"name":"NodeOperatorNameSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"rewardAddress","type":"address"}],"name":"NodeOperatorRewardAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"stakingLimit","type":"uint64"}],"name":"NodeOperatorStakingLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"totalStopped","type":"uint64"}],"name":"NodeOperatorTotalStoppedValidatorsReported","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"operatorId","type":"uint256"},{"indexed":false,"name":"pubkey","type":"bytes"}],"name":"SigningKeyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"operatorId","type":"uint256"},{"indexed":false,"name":"pubkey","type":"bytes"}],"name":"SigningKeyRemoved","type":"event"}] diff --git a/abi/NodeOperatorsRegistry.abi.json b/abi/NodeOperatorsRegistry.abi.json new file mode 100644 index 00000000..619ae169 --- /dev/null +++ b/abi/NodeOperatorsRegistry.abi.json @@ -0,0 +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": "_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" + } +] diff --git a/abi/dvt/SDVTRegistry.abi.json b/abi/dvt/SDVTRegistry.abi.json deleted file mode 100644 index f8d7ac1b..00000000 --- a/abi/dvt/SDVTRegistry.abi.json +++ /dev/null @@ -1,892 +0,0 @@ -[ - { - "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" - } -] diff --git a/abi/dvt/SDVTRegistryV2.abi.json b/abi/dvt/SDVTRegistryV2.abi.json deleted file mode 100644 index b59840e7..00000000 --- a/abi/dvt/SDVTRegistryV2.abi.json +++ /dev/null @@ -1,951 +0,0 @@ -[ - { - "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": 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" - } -] diff --git a/abi/dvt/UpdateTargetValidatorLimits.abi.json b/abi/dvt/UpdateTargetValidatorLimits.abi.json index fd83e5b1..f4202e51 100644 --- a/abi/dvt/UpdateTargetValidatorLimits.abi.json +++ b/abi/dvt/UpdateTargetValidatorLimits.abi.json @@ -39,9 +39,9 @@ "type": "uint256" }, { - "internalType": "bool", - "name": "isTargetLimitActive", - "type": "bool" + "internalType": "uint256", + "name": "targetLimitMode", + "type": "uint256" }, { "internalType": "uint256", diff --git a/abi/dvt/UpdateTargetValidatorLimitsV2.abi.json b/abi/dvt/UpdateTargetValidatorLimitsV2.abi.json deleted file mode 100644 index f4202e51..00000000 --- a/abi/dvt/UpdateTargetValidatorLimitsV2.abi.json +++ /dev/null @@ -1,80 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "_trustedCaller", - "type": "address" - }, - { - "internalType": "address", - "name": "_nodeOperatorsRegistry", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { "internalType": "address", "name": "_creator", "type": "address" }, - { "internalType": "bytes", "name": "_evmScriptCallData", "type": "bytes" } - ], - "name": "createEVMScript", - "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes", "name": "_evmScriptCallData", "type": "bytes" } - ], - "name": "decodeEVMScriptCallData", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "targetLimitMode", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "targetLimit", - "type": "uint256" - } - ], - "internalType": "struct UpdateTargetValidatorLimits.TargetValidatorsLimit[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "nodeOperatorsRegistry", - "outputs": [ - { - "internalType": "contract INodeOperatorsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "trustedCaller", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - } -] diff --git a/modules/blockChain/contractAddresses.ts b/modules/blockChain/contractAddresses.ts index 151d4591..b349ea37 100644 --- a/modules/blockChain/contractAddresses.ts +++ b/modules/blockChain/contractAddresses.ts @@ -201,6 +201,7 @@ export const StonksStablesAllowedRecipientsRegistry: ChainAddressMap = { } export const CSMRegistry: ChainAddressMap = { + [CHAINS.Mainnet]: '0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F', [CHAINS.Holesky]: '0x4562c3e63c2e586cd1651b958c22f88135acad4f', } diff --git a/modules/blockChain/contracts.ts b/modules/blockChain/contracts.ts index c6c5520c..15dac7cc 100644 --- a/modules/blockChain/contracts.ts +++ b/modules/blockChain/contracts.ts @@ -17,7 +17,7 @@ export type ContractTypeAllowedRecipientRegistry = export type ContractTypeRegistryWithLimits = TypeChain.RegistryWithLimitsAbi export const ContractNodeOperatorsRegistry = createContractHelpers({ - factory: TypeChain.NodeOperatorsAbi__factory, + factory: TypeChain.NodeOperatorsRegistryAbi__factory, address: CONTRACT_ADDRESSES.NodeOperatorsRegistry, }) @@ -280,13 +280,8 @@ export const ContractRewardsShareProgramTopUp = createContractHelpers({ address: EvmAddressesByType[MotionType.RewardsShareProgramTopUp], }) -// TODO: merge these two once UpdateTargetValidatorLimits v2 is deployed on the Mainnet export const ContractSDVTRegistry = createContractHelpers({ - factory: TypeChain.SDVTRegistryAbi__factory, - address: CONTRACT_ADDRESSES.SDVTRegistry, -}) -export const ContractSDVTRegistryV2 = createContractHelpers({ - factory: TypeChain.SDVTRegistryV2Abi__factory, + factory: TypeChain.NodeOperatorsRegistryAbi__factory, address: CONTRACT_ADDRESSES.SDVTRegistry, }) @@ -327,18 +322,13 @@ export const ContractSDVTNodeOperatorManagerChange = createContractHelpers({ address: EvmAddressesByType[MotionType.SDVTNodeOperatorManagerChange], }) -// TODO: merge these two once v2 is deployed on the Mainnet export const ContractSDVTTargetValidatorLimitsUpdate = createContractHelpers({ factory: TypeChain.UpdateTargetValidatorLimitsAbi__factory, address: EvmAddressesByType[MotionType.SDVTTargetValidatorLimitsUpdate], }) -export const ContractSDVTTargetValidatorLimitsUpdateV2 = createContractHelpers({ - factory: TypeChain.UpdateTargetValidatorLimitsV2Abi__factory, - address: EvmAddressesByType[MotionType.SDVTTargetValidatorLimitsUpdateV2], -}) export const ContractSandboxNodeOperatorsRegistry = createContractHelpers({ - factory: TypeChain.NodeOperatorsAbi__factory, + factory: TypeChain.NodeOperatorsRegistryAbi__factory, address: CONTRACT_ADDRESSES.SandboxNodeOperatorsRegistry, }) diff --git a/modules/motions/evmAddresses.ts b/modules/motions/evmAddresses.ts index 63fb0375..1fbeaffd 100644 --- a/modules/motions/evmAddresses.ts +++ b/modules/motions/evmAddresses.ts @@ -58,7 +58,7 @@ export const EvmAddressesByChain: EvmAddresses = { [MotionType.SDVTVettedValidatorsLimitsSet]: '0xD75778b855886Fc5e1eA7D6bFADA9EB68b35C19D', [MotionType.SDVTTargetValidatorLimitsUpdate]: - '0x41CF3DbDc939c5115823Fba1432c4EC5E7bD226C', + '0x161a4552a625844c822954c5acbac928ee0f399b', [MotionType.SDVTNodeOperatorRewardAddressesSet]: '0x589e298964b9181D9938B84bB034C3BB9024E2C0', [MotionType.SDVTNodeOperatorNamesSet]: @@ -103,6 +103,8 @@ export const EvmAddressesByChain: EvmAddresses = { [MotionType.LegoDAITopUp]: '0x0535a67ea2D6d46f85fE568B7EaA91Ca16824FEC', [MotionType.AllianceOpsStablesTopUp]: '0xe5656eEe7eeD02bdE009d77C88247BC8271e26Eb', + [MotionType.CSMSettleElStealingPenalty]: + '0xF6B6E7997338C48Ea3a8BCfa4BB64a315fDa76f4', }, // Goerli @@ -217,7 +219,7 @@ export const EvmAddressesByChain: EvmAddresses = { '0x88d247cdf4ff4A4AAA8B3DD9dd22D1b89219FB3B', [MotionType.SDVTVettedValidatorsLimitsSet]: '0x30Cb36DBb0596aD9Cf5159BD2c4B1456c18e47E8', - [MotionType.SDVTTargetValidatorLimitsUpdateV2]: + [MotionType.SDVTTargetValidatorLimitsUpdate]: '0x431a156BEba95803a95452441C1959c4479710e1', [MotionType.SDVTNodeOperatorRewardAddressesSet]: '0x6Bfc576018C7f3D2a9180974E5c8e6CFa021f617', diff --git a/modules/motions/hooks/useContractEvmScript.ts b/modules/motions/hooks/useContractEvmScript.ts index e3ca8295..f15a0990 100644 --- a/modules/motions/hooks/useContractEvmScript.ts +++ b/modules/motions/hooks/useContractEvmScript.ts @@ -58,8 +58,6 @@ export const EVM_CONTRACTS = { CONTRACTS.ContractSDVTVettedValidatorsLimitsSet, [MotionType.SDVTTargetValidatorLimitsUpdate]: CONTRACTS.ContractSDVTTargetValidatorLimitsUpdate, - [MotionType.SDVTTargetValidatorLimitsUpdateV2]: - CONTRACTS.ContractSDVTTargetValidatorLimitsUpdateV2, [MotionType.SDVTNodeOperatorRewardAddressesSet]: CONTRACTS.ContractSDVTNodeOperatorRewardAddressesSet, [MotionType.SDVTNodeOperatorNamesSet]: diff --git a/modules/motions/hooks/useEVMScriptDecoder.ts b/modules/motions/hooks/useEVMScriptDecoder.ts index 3e29b230..bfb493e8 100644 --- a/modules/motions/hooks/useEVMScriptDecoder.ts +++ b/modules/motions/hooks/useEVMScriptDecoder.ts @@ -25,7 +25,13 @@ export function useEVMScriptDecoder() { .ReferralPartnersRegistryAbi__factory.abi as any, [KEYS.RewardProgramRegistry]: abis.RewardProgramRegistryAbi__factory.abi, - [KEYS.NodeOperatorsRegistry]: abis.NodeOperatorsAbi__factory.abi, + [KEYS.AragonACL]: abis.AragonACLAbi__factory.abi, + [KEYS.NodeOperatorsRegistry]: + abis.NodeOperatorsRegistryAbi__factory.abi, + [KEYS.SDVTRegistry]: abis.NodeOperatorsRegistryAbi__factory.abi, + [KEYS.CSMRegistry]: abis.CSMRegistryAbi__factory.abi, + [KEYS.SandboxNodeOperatorsRegistry]: + abis.NodeOperatorsRegistryAbi__factory.abi, [KEYS.Finance]: abis.FinanceAbi__factory.abi, [KEYS.AllowedRecipientRegistry]: abis.AllowedRecipientsRegistryAbi__factory.abi, @@ -44,9 +50,7 @@ export function useEVMScriptDecoder() { [KEYS.StethGasSupplyRegistry]: abis.RegistryWithLimitsAbi__factory.abi, [KEYS.RewardsShareProgramRegistry]: abis.RegistryWithLimitsAbi__factory.abi, - [KEYS.AragonACL]: abis.AragonACLAbi__factory.abi, - [KEYS.SDVTRegistry]: abis.SDVTRegistryAbi__factory.abi, - [KEYS.SandboxNodeOperatorsRegistry]: abis.NodeOperatorsAbi__factory.abi, + [KEYS.RccStethAllowedRecipientsRegistry]: abis.RegistryWithLimitsAbi__factory.abi, [KEYS.PmlStethAllowedRecipientsRegistry]: @@ -57,7 +61,6 @@ export function useEVMScriptDecoder() { abis.RegistryWithLimitsAbi__factory.abi, [KEYS.StonksStablesAllowedRecipientsRegistry]: abis.RegistryWithLimitsAbi__factory.abi, - [KEYS.CSMRegistry]: abis.CSMRegistryAbi__factory.abi, [KEYS.AllianceOpsAllowedRecipientsRegistry]: abis.RegistryWithLimitsAbi__factory.abi, }), diff --git a/modules/motions/hooks/useSDVTNodeOperatorsList.ts b/modules/motions/hooks/useSDVTNodeOperatorsList.ts index fd3394af..0229824e 100644 --- a/modules/motions/hooks/useSDVTNodeOperatorsList.ts +++ b/modules/motions/hooks/useSDVTNodeOperatorsList.ts @@ -1,10 +1,7 @@ import { BigNumber, utils } from 'ethers' import { useSWR } from 'modules/network/hooks/useSwr' import { useWeb3 } from 'modules/blockChain/hooks/useWeb3' -import { - ContractSDVTRegistry, - ContractSDVTRegistryV2, -} from 'modules/blockChain/contracts' +import { ContractSDVTRegistry } from 'modules/blockChain/contracts' import { getManagerAddressesMap } from '../utils/getManagerAddressesMap' type NodeOperatorSummary = { @@ -15,27 +12,20 @@ type NodeOperatorSummary = { totalExitedValidators: BigNumber totalDepositedValidators: BigNumber depositableValidatorsCount: BigNumber - // TODO: fix type once v2 is merged with v1 - isTargetLimitActive?: any - targetLimitMode?: any + targetLimitMode: BigNumber } type Args = { withSummary?: boolean - v2?: boolean } export function useSDVTNodeOperatorsList(args?: Args) { - const { chainId, account } = useWeb3() + const { chainId } = useWeb3() return useSWR( - `${chainId}-${account}-${args?.v2 ? 'v2' : 'v1'}-operators-list${ - args?.withSummary ? '-with-summary' : '' - }`, + `${chainId}-sdvt-operators-list${args?.withSummary ? '-with-summary' : ''}`, async () => { - const registry = ( - args?.v2 ? ContractSDVTRegistryV2 : ContractSDVTRegistry - ).connectRpc({ chainId }) + const registry = ContractSDVTRegistry.connectRpc({ chainId }) const count = (await registry.getNodeOperatorsCount()).toNumber() const MANAGE_SIGNING_KEYS_ROLE = await registry.MANAGE_SIGNING_KEYS() diff --git a/modules/motions/hooks/utils.test.ts b/modules/motions/hooks/utils.test.ts index 6e12f2e2..c2182808 100644 --- a/modules/motions/hooks/utils.test.ts +++ b/modules/motions/hooks/utils.test.ts @@ -20,8 +20,12 @@ describe('calcPeriodData', () => { const periodData = { alreadySpentAmount: '500', spendableBalanceInPeriod: '500', - periodStartTimestamp: moment().unix() - EIGTH_HOURS_SECONDS, - periodEndTimestamp: moment().unix() + EIGTH_HOURS_SECONDS * 2, + periodStartTimestamp: moment().startOf('month').unix(), + periodEndTimestamp: moment() + .startOf('month') + .add(limits.periodDurationMonths, 'M') + .startOf('month') + .unix(), } const isPending = false @@ -49,8 +53,12 @@ describe('calcPeriodData', () => { const periodData = { alreadySpentAmount: '500', spendableBalanceInPeriod: '500', - periodStartTimestamp: moment().unix() - EIGTH_HOURS_SECONDS * 10, - periodEndTimestamp: moment().unix() - EIGTH_HOURS_SECONDS * 2, + periodStartTimestamp: moment() + .startOf('month') + .subtract(limits.periodDurationMonths, 'M') + .startOf('month') + .unix(), + periodEndTimestamp: moment().startOf('month').unix(), } const isPending = false @@ -88,9 +96,13 @@ describe('calcPeriodData', () => { periodDurationMonths: 2, } - const startOfMonth = moment().startOf('month') - const endOfMonth = moment().endOf('month') - const currentDateMock = moment(endOfMonth).subtract(5, 'hours') + const startOfPeriod = moment('2024-01-11').startOf('month') + const endOfPeriod = moment('2024-03-11').startOf('month') + + const currentDateMock = moment(endOfPeriod).subtract(5, 'hours') + + const newStartTime = moment('2024-03-11').startOf('month') + const newEndTime = moment('2024-05-11').startOf('month') jest .spyOn(Date, 'now') @@ -101,8 +113,8 @@ describe('calcPeriodData', () => { const periodData = { alreadySpentAmount: '500', spendableBalanceInPeriod: '500', - periodStartTimestamp: moment(startOfMonth).subtract(1, 'month').unix(), - periodEndTimestamp: moment(endOfMonth).unix(), + periodStartTimestamp: startOfPeriod.unix(), + periodEndTimestamp: endOfPeriod.unix(), } const isPending = false @@ -113,14 +125,6 @@ describe('calcPeriodData', () => { isPending, }) - const newStartTime = moment - .unix(periodData.periodStartTimestamp) - .add(limits.periodDurationMonths, 'M') - .startOf('month') - const newEndTime = moment(newStartTime) - .add(limits.periodDurationMonths, 'M') - .startOf('month') - const expectPeriodData = { ...periodData, periodStartTimestamp: newStartTime.unix(), @@ -262,48 +266,57 @@ describe('calcPeriodData', () => { }) }) - it('Motion start in next N period and end in current', () => { - const motionDuration = BigNumber.from(MONTH_HOURS_SECONDS) // seconds - const limits = { - limit: '1000', - periodDurationMonths: 2, // month - } - const periodData = { - alreadySpentAmount: '500', - spendableBalanceInPeriod: '500', - periodStartTimestamp: moment().subtract(6, 'month').unix(), - periodEndTimestamp: moment().subtract(4, 'month').unix(), - } - const isPending = false - - const result = calcPeriodData({ - motionDuration, - limits, - periodData, - isPending, - }) - - const newStartTime = moment - .unix(periodData.periodStartTimestamp) - .add(6, 'M') - .startOf('month') - const newEndTime = moment(newStartTime) - .add(limits.periodDurationMonths, 'M') - .startOf('month') - - const expectPeriodData = { - ...periodData, - periodStartTimestamp: newStartTime.unix(), - periodEndTimestamp: newEndTime.unix(), - alreadySpentAmount: '0', - spendableBalanceInPeriod: limits.limit, - } - - expect(result).toEqual({ - limits, - periodData: expectPeriodData, - motionDuration: motionDuration.toNumber() / 60 / 60, // hours - isEndInNextPeriod: false, - }) - }) + it.each([7, 8, 9])( + 'Motion start in next N period and end in current (month № %p)', + _7to9 => { + const motionDuration = BigNumber.from(EIGTH_HOURS_SECONDS) // seconds + const limits = { + limit: '1000', + periodDurationMonths: 3, // month + } + + const startOfPeriod = moment('2024-01-11').startOf('month') + const endOfPeriod = moment('2024-04-11').startOf('month') + + const currentDateMock = moment(`2024-0${_7to9}-11`) + + const newStartTime = moment('2024-07-11').startOf('month') + const newEndTime = moment('2024-10-11').startOf('month') + + jest + .spyOn(Date, 'now') + .mockImplementation(() => + new Date(currentDateMock.toISOString()).getTime(), + ) + + const periodData = { + alreadySpentAmount: '500', + spendableBalanceInPeriod: '500', + periodStartTimestamp: startOfPeriod.unix(), + periodEndTimestamp: endOfPeriod.unix(), + } + const isPending = false + + const result = calcPeriodData({ + motionDuration, + limits, + periodData, + isPending, + }) + + const expectPeriodData = { + periodStartTimestamp: newStartTime.unix(), + periodEndTimestamp: newEndTime.unix(), + alreadySpentAmount: '0', + spendableBalanceInPeriod: limits.limit, + } + + expect(result).toEqual({ + limits, + periodData: expectPeriodData, + motionDuration: motionDuration.toNumber() / 60 / 60, // hours + isEndInNextPeriod: false, + }) + }, + ) }) diff --git a/modules/motions/hooks/utils.ts b/modules/motions/hooks/utils.ts index ac1806ef..3578a115 100644 --- a/modules/motions/hooks/utils.ts +++ b/modules/motions/hooks/utils.ts @@ -36,49 +36,46 @@ export const calcPeriodData = ({ }) => { let currentPeriodData = { ...periodData } - const dateOfEndMotionPeriod = moment.unix(periodData.periodEndTimestamp) + const dateOfEndMotionPeriod = moment.unix( + currentPeriodData.periodEndTimestamp, + ) + const dateOfStartMotionPeriod = moment.unix( + currentPeriodData.periodStartTimestamp, + ) const isStartInNextPeriod = moment().isAfter(dateOfEndMotionPeriod) + if (isStartInNextPeriod) { + // will be more than 2 + const diffMonthCount = moment() + .startOf('month') + .diff(dateOfStartMotionPeriod.startOf('month'), 'months') + // for period 3 => 3,4,5 = 1, 6,7,8 = 2, ... + let periodRatio = Math.floor(diffMonthCount / limits.periodDurationMonths) - const dateOfEndMotion = moment().add(motionDuration.toNumber(), 'seconds') - const periodEnd = isStartInNextPeriod - ? moment() - .startOf('month') - .add(limits.periodDurationMonths, 'M') - .startOf('month') - : moment.unix(periodData.periodEndTimestamp) + const newPeriodStartTime = dateOfStartMotionPeriod.add( + limits.periodDurationMonths * periodRatio, + 'M', + ) - const isEndInNextPeriod = dateOfEndMotion.isAfter(periodEnd) - - if (isEndInNextPeriod && !isPending) { currentPeriodData = getNewPeriod({ periodLimit: limits.limit, periodDurationMonths: limits.periodDurationMonths, - newPeriodStartTime: moment - .unix(periodData.periodStartTimestamp) - .add(limits.periodDurationMonths, 'M') - .startOf('month'), + newPeriodStartTime, }) } - if (isStartInNextPeriod) { - const diffMonthCount = moment() - .startOf('month') - .diff(dateOfEndMotionPeriod.startOf('month'), 'months') - let periodRatio = Math.ceil(diffMonthCount / limits.periodDurationMonths) - if (isEndInNextPeriod) periodRatio += 1 + const dateOfEndMotion = moment().add(motionDuration.toNumber(), 'seconds') + const periodEnd = moment.unix(currentPeriodData.periodEndTimestamp) - const newPeriodStartTime = - diffMonthCount >= limits.periodDurationMonths - ? dateOfEndMotionPeriod.add( - limits.periodDurationMonths * periodRatio, - 'M', - ) - : dateOfEndMotionPeriod + const isEndInNextPeriod = dateOfEndMotion.isAfter(periodEnd) + if (isEndInNextPeriod && !isPending) { currentPeriodData = getNewPeriod({ periodLimit: limits.limit, periodDurationMonths: limits.periodDurationMonths, - newPeriodStartTime, + newPeriodStartTime: moment + .unix(currentPeriodData.periodStartTimestamp) + .add(limits.periodDurationMonths, 'M') + .startOf('month'), }) } diff --git a/modules/motions/types.ts b/modules/motions/types.ts index 6f21c0ca..95d8d787 100644 --- a/modules/motions/types.ts +++ b/modules/motions/types.ts @@ -27,7 +27,6 @@ export const MotionTypeForms = { SDVTNodeOperatorsDeactivate: 'SDVTNodeOperatorsDeactivate', SDVTVettedValidatorsLimitsSet: 'SDVTVettedValidatorsLimitsSet', SDVTTargetValidatorLimitsUpdate: 'SDVTTargetValidatorLimitsUpdate', - SDVTTargetValidatorLimitsUpdateV2: 'SDVTTargetValidatorLimitsUpdateV2', SDVTNodeOperatorRewardAddressesSet: 'SDVTNodeOperatorRewardAddressesSet', SDVTNodeOperatorNamesSet: 'SDVTNodeOperatorNamesSet', SDVTNodeOperatorManagerChange: 'SDVTNodeOperatorManagerChange', diff --git a/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdate.tsx b/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdate.tsx index fecb135e..6450e05f 100644 --- a/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdate.tsx +++ b/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdate.tsx @@ -15,10 +15,15 @@ export function DescSDVTTargetValidatorLimitsUpdate({ {callData.map((item, index) => { const nodeOperatorId = item.nodeOperatorId.toNumber() const nodeOperator = nodeOperatorsList?.[nodeOperatorId] + const targetLimitMode = item.targetLimitMode.toNumber() + + let targetLimitModeDesc = 'disabled' + if (targetLimitMode == 1) targetLimitModeDesc = 'soft' + if (targetLimitMode == 2) targetLimitModeDesc = 'boosted exits' const nodeOperatorName = nodeOperator ? nodeOperator.name : '' - if (!item.isTargetLimitActive) { + if (targetLimitMode == 0) { return (
Disable target validator limit for Node Operator{' '} @@ -35,7 +40,7 @@ export function DescSDVTTargetValidatorLimitsUpdate({ {nodeOperator && isOnChain ? `from ${nodeOperator.targetValidatorsCount} ` : ''} - {`to ${item.targetLimit}`} + {`to ${item.targetLimit} in ${targetLimitModeDesc} mode`} {index === callData.length - 1 ? '.' : '; '}
) diff --git a/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdateV2.tsx b/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdateV2.tsx deleted file mode 100644 index a64448e1..00000000 --- a/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdateV2.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { UpdateTargetValidatorLimitsV2Abi } from 'generated' -import { NestProps } from './types' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' - -// UpdateTargetValidatorLimitsV2 -export function DescSDVTTargetValidatorLimitsUpdateV2({ - callData, - isOnChain, -}: NestProps) { - const { data: nodeOperatorsList } = useSDVTNodeOperatorsList({ - withSummary: true, - }) - return ( - <> - {callData.map((item, index) => { - const nodeOperatorId = item.nodeOperatorId.toNumber() - const nodeOperator = nodeOperatorsList?.[nodeOperatorId] - const targetLimitMode = item.targetLimitMode.toNumber() - - let targetLimitModeDesc = 'disabled' - if (targetLimitMode == 1) targetLimitModeDesc = 'soft' - if (targetLimitMode == 2) targetLimitModeDesc = 'boosted exits' - - const nodeOperatorName = nodeOperator ? nodeOperator.name : '' - - if (targetLimitMode == 0) { - return ( -
- Disable target validator limit for Node Operator{' '} - {nodeOperatorName} (id: {nodeOperatorId}) - {index === callData.length - 1 ? '.' : '; '} -
- ) - } - - return ( -
- Set target validator limit for Node Operator{' '} - {nodeOperatorName} (id: {nodeOperatorId}){' '} - {nodeOperator && isOnChain - ? `from ${nodeOperator.targetValidatorsCount} ` - : ''} - {`to ${item.targetLimit} in ${targetLimitModeDesc} mode`} - {index === callData.length - 1 ? '.' : '; '} -
- ) - })} - - ) -} diff --git a/modules/motions/ui/MotionDescription/MotionDescription.tsx b/modules/motions/ui/MotionDescription/MotionDescription.tsx index 8886d691..e05ed59c 100644 --- a/modules/motions/ui/MotionDescription/MotionDescription.tsx +++ b/modules/motions/ui/MotionDescription/MotionDescription.tsx @@ -38,7 +38,6 @@ import { DescSDVTNodeOperatorsDeactivate } from './DescSDVTNodeOperatorsDeactiva import { DescSDVTNodeOperatorsActivate } from './DescSDVTNodeOperatorsActivate' import { DescSDVTVettedValidatorsLimitsSet } from './DescSDVTVettedValidatorsLimitsSet' import { DescSDVTTargetValidatorLimitsUpdate } from './DescSDVTTargetValidatorLimitsUpdate' -import { DescSDVTTargetValidatorLimitsUpdateV2 } from './DescSDVTTargetValidatorLimitsUpdateV2' import { DescSDVTNodeOperatorRewardAddressesSet } from './DescSDVTNodeOperatorRewardAddressesSet' import { DescSDVTNodeOperatorNamesSet } from './DescSDVTNodeOperatorNamesSet' import { DescSDVTNodeOperatorsAdd } from './DescSDVTNodeOperatorsAdd' @@ -225,8 +224,6 @@ const MOTION_DESCRIPTIONS = { [MotionType.SDVTNodeOperatorNamesSet]: DescSDVTNodeOperatorNamesSet, [MotionType.SDVTTargetValidatorLimitsUpdate]: DescSDVTTargetValidatorLimitsUpdate, - [MotionType.SDVTTargetValidatorLimitsUpdateV2]: - DescSDVTTargetValidatorLimitsUpdateV2, [MotionType.SDVTNodeOperatorManagerChange]: DescSDVTNodeOperatorManagersChange, [MotionType.SandboxNodeOperatorIncreaseLimit]: ( diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewNodeOperatorLimitIncrease.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewNodeOperatorLimitIncrease.tsx index f57192e1..2b7bd29c 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewNodeOperatorLimitIncrease.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewNodeOperatorLimitIncrease.tsx @@ -125,7 +125,7 @@ export const formParts = ({ label={ <> New limit (current limit is{' '} - {currentNodeOperator.stakingLimit.toString()}) + {currentNodeOperator.totalVettedValidators.toString()}) } rules={{ @@ -137,7 +137,8 @@ export const formParts = ({ } const valueNum = Number(value) - const limit = currentNodeOperator.stakingLimit.toNumber() + const limit = + currentNodeOperator.totalVettedValidators.toNumber() if (valueNum <= limit) { return 'New limit value should be greater than current' } diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdate.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdate.tsx index d49a33d7..93b4f81b 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdate.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdate.tsx @@ -20,19 +20,25 @@ import { MotionType } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' import { estimateGasFallback } from 'modules/motions/utils' import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' -import { CheckboxControl } from 'modules/shared/ui/Controls/Checkbox' import { validateUintValue } from 'modules/motions/utils/validateUintValue' import { NodeOperatorSelectControl } from 'modules/motions/ui/NodeOperatorSelectControl' import { InputNumberControl } from 'modules/shared/ui/Controls/InputNumber' +import { SelectControl, Option } from 'modules/shared/ui/Controls/Select' type NodeOperator = { id: number | undefined - isTargetLimitActive: boolean + targetLimitMode: string targetLimit: string } const UINT_64_MAX = BigNumber.from('0xFFFFFFFFFFFFFFFF') +const TARGET_LIMIT_MODES: Partial> = { + '0': 'Disabled', + '1': 'Soft limit', + '2': 'Boosted exits', +} + export const formParts = createMotionFormPart({ motionType: MotionType.SDVTTargetValidatorLimitsUpdate, populateTx: async ({ evmScriptFactory, formData, contract }) => { @@ -42,12 +48,12 @@ export const formParts = createMotionFormPart({ const encodedCallData = new utils.AbiCoder().encode( [ - 'tuple(uint256 nodeOperatorId, bool isTargetLimitActive, uint256 targetLimit)[]', + 'tuple(uint256 nodeOperatorId, uint256 targetLimitMode, uint256 targetLimit)[]', ], [ sortedNodeOperators.map(nodeOperator => ({ nodeOperatorId: Number(nodeOperator.id), - isTargetLimitActive: nodeOperator.isTargetLimitActive, + targetLimitMode: Number(nodeOperator.targetLimitMode), targetLimit: Number(nodeOperator.targetLimit), })), ], @@ -66,7 +72,7 @@ export const formParts = createMotionFormPart({ nodeOperators: [ { id: undefined, - isTargetLimitActive: false, + targetLimitMode: '', targetLimit: '', }, ] as NodeOperator[], @@ -84,7 +90,8 @@ export const formParts = createMotionFormPart({ ) const fieldsArr = useFieldArray({ name: fieldNames.nodeOperators }) - const { watch, setValue } = useFormContext() + const { watch, setError } = useFormContext() + const selectedNodeOperators: NodeOperator[] = watch( fieldNames.nodeOperators, ) @@ -104,7 +111,7 @@ export const formParts = createMotionFormPart({ const handleAddUpdate = () => fieldsArr.append({ id: undefined, - isTargetLimitActive: false, + targetLimitMode: '', targetLimit: '', } as NodeOperator) @@ -128,6 +135,15 @@ export const formParts = createMotionFormPart({ ? nodeOperatorsList[selectedNodeOperators[fieldIndex].id!] : null + const currentTargetLimitMode = + currentNodeOperator?.targetLimitMode?.toString() + + const targetLimitModeLabel = currentTargetLimitMode + ? TARGET_LIMIT_MODES[currentTargetLimitMode] + : null + const currentTargetLimit = + currentNodeOperator?.targetValidatorsCount?.toString() + return ( @@ -153,38 +169,66 @@ export const formParts = createMotionFormPart({ onChange={(value: string) => { const nodeOperator = nodeOperatorsList[Number(value)] - setValue( - `${fieldNames.nodeOperators}.${fieldIndex}.isTargetLimitActive`, - Boolean(nodeOperator.isTargetLimitActive), - ) + fieldsArr.update(fieldIndex, { + targetLimitMode: + nodeOperator.targetLimitMode?.toString() ?? '', + targetLimit: + nodeOperator.targetValidatorsCount?.toString() ?? '', + }) }} />
- + { + const currentMode = Number(currentTargetLimitMode) + const modeToUpdate = Number(value) + + const currentLimit = Number(currentTargetLimit) + const limitToUpdate = Number( + selectedNodeOperators[fieldIndex].targetLimit, + ) + + if ( + modeToUpdate !== currentMode && + currentLimit === limitToUpdate + ) { + setError( + `${fieldNames.nodeOperators}.${fieldIndex}.targetLimit`, + { message: undefined }, + ) + return true + } + + return true + }, + }} + > + {Object.entries(TARGET_LIMIT_MODES).map(([key, value]) => ( + + ))} +
- New limit (current limit is{' '} - {currentNodeOperator.targetValidatorsCount?.toString()} - ) - - ) : ( - `New limit` - ) - } - disabled={ - !selectedNodeOperators[fieldIndex]?.isTargetLimitActive - } + label={`New limit ${ + currentTargetLimit + ? ` (current limit is ${currentTargetLimit})` + : '' + }`} rules={{ required: 'Field is required', validate: value => { @@ -197,6 +241,21 @@ export const formParts = createMotionFormPart({ return `Value must be less than or equal to ${UINT_64_MAX}` } + const currentMode = Number(currentTargetLimitMode) + const modeToUpdate = Number( + selectedNodeOperators[fieldIndex].targetLimitMode, + ) + + const currentLimit = Number(currentTargetLimit) + const limitToUpdate = Number(value) + + if ( + currentMode === modeToUpdate && + currentLimit === limitToUpdate + ) { + return 'Both mode and limit are the same as current' + } + return true }, }} diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdateV2.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdateV2.tsx deleted file mode 100644 index 8456ca68..00000000 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdateV2.tsx +++ /dev/null @@ -1,241 +0,0 @@ -import { BigNumber, utils } from 'ethers' - -import { Fragment } from 'react' -import { useFieldArray, useFormContext } from 'react-hook-form' -import { Plus, ButtonIcon } from '@lidofinance/lido-ui' -import { useWeb3 } from 'modules/blockChain/hooks/useWeb3' - -import { PageLoader } from 'modules/shared/ui/Common/PageLoader' -import { - Fieldset, - MessageBox, - RemoveItemButton, - FieldsWrapper, - FieldsHeader, - FieldsHeaderDesc, -} from '../CreateMotionFormStyle' - -import { ContractSDVTTargetValidatorLimitsUpdateV2 } from 'modules/blockChain/contracts' -import { MotionType } from 'modules/motions/types' -import { createMotionFormPart } from './createMotionFormPart' -import { estimateGasFallback } from 'modules/motions/utils' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' -import { validateUintValue } from 'modules/motions/utils/validateUintValue' -import { NodeOperatorSelectControl } from 'modules/motions/ui/NodeOperatorSelectControl' -import { InputNumberControl } from 'modules/shared/ui/Controls/InputNumber' -import { SelectControl, Option } from 'modules/shared/ui/Controls/Select' - -type NodeOperator = { - id: number | undefined - targetLimitMode: string - targetLimit: string -} - -const UINT_64_MAX = BigNumber.from('0xFFFFFFFFFFFFFFFF') - -export const formParts = createMotionFormPart({ - motionType: MotionType.SDVTTargetValidatorLimitsUpdate, - populateTx: async ({ evmScriptFactory, formData, contract }) => { - const sortedNodeOperators = formData.nodeOperators.sort( - (a, b) => Number(a.id) - Number(b.id), - ) - - const encodedCallData = new utils.AbiCoder().encode( - [ - 'tuple(uint256 nodeOperatorId, uint256 targetLimitMode, uint256 targetLimit)[]', - ], - [ - sortedNodeOperators.map(nodeOperator => ({ - nodeOperatorId: Number(nodeOperator.id), - targetLimitMode: Number(nodeOperator.targetLimitMode), - targetLimit: Number(nodeOperator.targetLimit), - })), - ], - ) - const gasLimit = await estimateGasFallback( - contract.estimateGas.createMotion(evmScriptFactory, encodedCallData), - ) - const tx = await contract.populateTransaction.createMotion( - evmScriptFactory, - encodedCallData, - { gasLimit }, - ) - return tx - }, - getDefaultFormData: () => ({ - nodeOperators: [ - { - id: undefined, - targetLimitMode: '', - targetLimit: '', - }, - ] as NodeOperator[], - }), - Component: ({ fieldNames, submitAction }) => { - const { walletAddress } = useWeb3() - const { - data: nodeOperatorsList, - initialLoading: isNodeOperatorsDataLoading, - } = useSDVTNodeOperatorsList({ withSummary: true, v2: true }) - - const trustedCaller = ContractSDVTTargetValidatorLimitsUpdateV2.useSwrWeb3( - 'trustedCaller', - [], - ) - - const fieldsArr = useFieldArray({ name: fieldNames.nodeOperators }) - const { watch, setValue } = useFormContext() - const selectedNodeOperators: NodeOperator[] = watch( - fieldNames.nodeOperators, - ) - - const getFilteredOptions = (fieldIdx: number) => { - if (!nodeOperatorsList?.length) { - return [] - } - - const selectedIds = selectedNodeOperators.map(({ id }) => id) - const thisId = selectedNodeOperators[fieldIdx]?.id - return nodeOperatorsList.filter( - ({ id }) => !selectedIds.includes(id) || id === thisId, - ) - } - - const handleAddUpdate = () => - fieldsArr.append({ - id: undefined, - targetLimitMode: '', - targetLimit: '', - } as NodeOperator) - - if (trustedCaller.initialLoading || isNodeOperatorsDataLoading) { - return - } - - if (trustedCaller.data !== walletAddress) { - return You should be connected as trusted caller - } - - if (!nodeOperatorsList?.length) { - return Node operator list is empty - } - - return ( - <> - {fieldsArr.fields.map((item, fieldIndex) => { - const currentNodeOperator = - typeof selectedNodeOperators[fieldIndex].id === 'number' - ? nodeOperatorsList[selectedNodeOperators[fieldIndex].id!] - : null - - return ( - - - - {fieldsArr.fields.length > 1 && ( - - Update #{fieldIndex + 1} - - )} - {fieldsArr.fields.length > 1 && ( - fieldsArr.remove(fieldIndex)} - > - Remove update {fieldIndex + 1} - - )} - - -
- { - const nodeOperator = nodeOperatorsList[Number(value)] - - setValue( - `${fieldNames.nodeOperators}.${fieldIndex}.targetLimitMode`, - Number(nodeOperator.targetLimitMode), - ) - }} - /> -
- -
- - - - - -
- -
- - New limit (current limit is{' '} - {currentNodeOperator.targetValidatorsCount?.toString()} - ) - - ) : ( - `New limit` - ) - } - disabled={ - Number( - selectedNodeOperators[fieldIndex]?.targetLimitMode, - ) == 0 - } - rules={{ - required: 'Field is required', - validate: value => { - const uintError = validateUintValue(value) - if (uintError) { - return uintError - } - - if (UINT_64_MAX.lt(value)) { - return `Value must be less than or equal to ${UINT_64_MAX}` - } - - return true - }, - }} - /> -
-
-
- ) - })} - - {selectedNodeOperators.length < nodeOperatorsList.length && ( -
- } - color="secondary" - > - One more update - -
- )} - - {submitAction} - - ) - }, -}) diff --git a/modules/motions/ui/MotionFormStartNew/Parts/index.ts b/modules/motions/ui/MotionFormStartNew/Parts/index.ts index 9003dce1..92892303 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/index.ts +++ b/modules/motions/ui/MotionFormStartNew/Parts/index.ts @@ -10,7 +10,6 @@ import * as StartNewSDVTNodeOperatorsActivate from './StartNewSDVTNodeOperatorsA import * as StartNewSDVTNodeOperatorsDeactivate from './StartNewSDVTNodeOperatorsDeactivate' import * as StartNewSDVTVettedValidatorsLimitsSet from './StartNewSDVTVettedValidatorsLimitsSet' import * as StartNewSDVTTargetValidatorLimitsUpdate from './StartNewSDVTTargetValidatorLimitsUpdate' -import * as StartNewSDVTTargetValidatorLimitsUpdateV2 from './StartNewSDVTTargetValidatorLimitsUpdateV2' import * as StartNewSDVTNodeOperatorRewardAddressesSet from './StartNewSDVTNodeOperatorRewardAddressesSet' import * as StartNewSDVTNodeOperatorNamesSet from './StartNewSDVTNodeOperatorNamesSet' import * as StartNewSDVTNodeOperatorManagersChange from './StartNewSDVTNodeOperatorManagersChange' @@ -81,8 +80,6 @@ export const formParts = { StartNewSDVTVettedValidatorsLimitsSet.formParts, [MotionTypeForms.SDVTTargetValidatorLimitsUpdate]: StartNewSDVTTargetValidatorLimitsUpdate.formParts, - [MotionTypeForms.SDVTTargetValidatorLimitsUpdateV2]: - StartNewSDVTTargetValidatorLimitsUpdateV2.formParts, [MotionTypeForms.SDVTNodeOperatorRewardAddressesSet]: StartNewSDVTNodeOperatorRewardAddressesSet.formParts, [MotionTypeForms.SDVTNodeOperatorNamesSet]: diff --git a/modules/motions/utils/getMotionTypeDisplayName.ts b/modules/motions/utils/getMotionTypeDisplayName.ts index 06e78e5c..bb206c0b 100644 --- a/modules/motions/utils/getMotionTypeDisplayName.ts +++ b/modules/motions/utils/getMotionTypeDisplayName.ts @@ -29,8 +29,6 @@ export const MotionTypeDisplayNames: Record< [MotionType.SDVTVettedValidatorsLimitsSet]: 'Set vetted validators limits', [MotionType.SDVTTargetValidatorLimitsUpdate]: 'Update target validator limits', - [MotionType.SDVTTargetValidatorLimitsUpdateV2]: - 'Update target validator limits', [MotionType.SDVTNodeOperatorRewardAddressesSet]: 'Set node operators reward addresses', [MotionType.SDVTNodeOperatorManagerChange]: 'Change node operators managers',