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..fce58a4b --- /dev/null +++ b/abi/NodeOperatorsRegistry.abi.json @@ -0,0 +1,520 @@ +[ + { + "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/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/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/constants.ts b/modules/motions/constants.ts index 455faca9..342fb154 100644 --- a/modules/motions/constants.ts +++ b/modules/motions/constants.ts @@ -3,8 +3,9 @@ import { ContractEvmSandboxNodeOperatorIncreaseLimit, ContractNodeOperatorsRegistry, ContractSandboxNodeOperatorsRegistry, + ContractSDVTRegistry, } from 'modules/blockChain/contracts' -import { MotionType } from 'modules/motions/types' +import { MotionType, StakingModule } from 'modules/motions/types' export const MOTION_ATTENTION_PERIOD = 1 / 24 @@ -17,12 +18,12 @@ export const noSigningKeysRoleError = export const INCREASE_LIMIT_MOTION_MAP = { [MotionType.NodeOperatorIncreaseLimit]: { evmContract: ContractEvmNodeOperatorIncreaseLimit, - registryType: 'curated', + stakingModule: StakingModule.Curated, motionType: MotionType.NodeOperatorIncreaseLimit, }, [MotionType.SandboxNodeOperatorIncreaseLimit]: { evmContract: ContractEvmSandboxNodeOperatorIncreaseLimit, - registryType: 'sandbox', + stakingModule: StakingModule.Sandbox, motionType: MotionType.SandboxNodeOperatorIncreaseLimit, }, } as const @@ -30,8 +31,7 @@ export const INCREASE_LIMIT_MOTION_MAP = { export type IncreaseLimitMotionType = keyof typeof INCREASE_LIMIT_MOTION_MAP export const NODE_OPERATORS_REGISTRY_MAP = { - curated: ContractNodeOperatorsRegistry, - sandbox: ContractSandboxNodeOperatorsRegistry, + [StakingModule.Curated]: ContractNodeOperatorsRegistry, + [StakingModule.SimpleDVT]: ContractSDVTRegistry, + [StakingModule.Sandbox]: ContractSandboxNodeOperatorsRegistry, } as const - -export type NodeOperatorsRegistryType = keyof typeof NODE_OPERATORS_REGISTRY_MAP 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/index.ts b/modules/motions/hooks/index.ts index 866803bf..f41e5dc1 100644 --- a/modules/motions/hooks/index.ts +++ b/modules/motions/hooks/index.ts @@ -12,4 +12,5 @@ export * from './useRewardPrograms' export * from './useAvailableMotions' export * from './useRegistryWithLimits' export * from './useTokenByTopUpType' -export * from './useRegistrySDVT' +export * from './useNodeOperatorNameLimit' +export * from './useNodeOperatorsCount' diff --git a/modules/motions/hooks/useAvailableMotions.ts b/modules/motions/hooks/useAvailableMotions.ts index 29124f58..5d847a61 100644 --- a/modules/motions/hooks/useAvailableMotions.ts +++ b/modules/motions/hooks/useAvailableMotions.ts @@ -9,7 +9,7 @@ import { import { useNodeOperatorsList } from './useNodeOperatorsList' import { EVM_CONTRACTS } from './useContractEvmScript' -import { MotionTypeForms } from 'modules/motions/types' +import { MotionTypeForms, StakingModule } from 'modules/motions/types' import { useSWR } from 'modules/network/hooks/useSwr' const isHasTrustedCaller = ( @@ -38,12 +38,12 @@ export const useAvailableMotions = () => { const { chainId, walletAddress } = useWeb3() const { data: nodeOperators, initialLoading: isNodeOperatorsDataLoading } = - useNodeOperatorsList('curated') + useNodeOperatorsList({ module: StakingModule.Curated }) const { data: sandboxNodeOperators, initialLoading: isSandboxNodeOperatorsDataLoading, - } = useNodeOperatorsList('sandbox') + } = useNodeOperatorsList({ module: StakingModule.Sandbox }) const { data: availableMotions, 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/useNodeOperatorKeysInfo.ts b/modules/motions/hooks/useNodeOperatorKeysInfo.ts index c76c1f15..b320e6e4 100644 --- a/modules/motions/hooks/useNodeOperatorKeysInfo.ts +++ b/modules/motions/hooks/useNodeOperatorKeysInfo.ts @@ -2,21 +2,16 @@ import { useSWR } from 'modules/network/hooks/useSwr' import { useWeb3 } from 'modules/blockChain/hooks/useWeb3' import { nodeOperatorsKeysInfo } from 'modules/network/utils/urlsApi' import { fetcherStandard } from 'modules/network/utils/fetcherStandard' -import { KeysInfo } from '../types' -import { - NodeOperatorsRegistryType, - NODE_OPERATORS_REGISTRY_MAP, -} from '../constants' +import { KeysInfo, StakingModule } from '../types' +import { NODE_OPERATORS_REGISTRY_MAP } from '../constants' -export function useNodeOperatorKeysInfo( - registryType: NodeOperatorsRegistryType, -) { +export function useNodeOperatorKeysInfo(module: StakingModule) { const { chainId, walletAddress } = useWeb3() const nodeOperatorsInfo = useSWR( nodeOperatorsKeysInfo( chainId, `${walletAddress}`, - `${NODE_OPERATORS_REGISTRY_MAP[registryType].address[chainId]}`, + `${NODE_OPERATORS_REGISTRY_MAP[module].address[chainId]}`, ), fetcherStandard, ) diff --git a/modules/motions/hooks/useNodeOperatorNameLimit.ts b/modules/motions/hooks/useNodeOperatorNameLimit.ts new file mode 100644 index 00000000..361053e2 --- /dev/null +++ b/modules/motions/hooks/useNodeOperatorNameLimit.ts @@ -0,0 +1,18 @@ +import { useLidoSWR } from '@lido-sdk/react' +import { useWeb3 } from 'modules/blockChain/hooks/useWeb3' +import { NODE_OPERATORS_REGISTRY_MAP } from '../constants' +import { StakingModule } from '../types' + +export function useNodeOperatorNameLimit(module: StakingModule) { + const { chainId } = useWeb3() + + return useLidoSWR( + ['swr:useNodeOperatorNameLimit', chainId, module], + async (_key: string, _chainId: number, _module: StakingModule) => { + const registry = NODE_OPERATORS_REGISTRY_MAP[_module].connectRpc({ + chainId: _chainId, + }) + return registry.MAX_NODE_OPERATOR_NAME_LENGTH() + }, + ) +} diff --git a/modules/motions/hooks/useNodeOperatorsCount.ts b/modules/motions/hooks/useNodeOperatorsCount.ts new file mode 100644 index 00000000..81787d8f --- /dev/null +++ b/modules/motions/hooks/useNodeOperatorsCount.ts @@ -0,0 +1,22 @@ +import { useLidoSWR } from '@lido-sdk/react' +import { useWeb3 } from 'modules/blockChain/hooks/useWeb3' +import { NODE_OPERATORS_REGISTRY_MAP } from '../constants' +import { StakingModule } from '../types' + +export function useNodeOperatorsCount(module: StakingModule) { + const { chainId } = useWeb3() + + return useLidoSWR( + ['swr:useNodeOperatorsCount', chainId, module], + async (_key: string, _chainId: number, _module: StakingModule) => { + const registry = NODE_OPERATORS_REGISTRY_MAP[_module].connectRpc({ + chainId: _chainId, + }) + const [current, max] = await Promise.all([ + registry.getNodeOperatorsCount(), + registry.MAX_NODE_OPERATORS_COUNT(), + ]) + return { current: current.toNumber(), max: max.toNumber() } + }, + ) +} diff --git a/modules/motions/hooks/useNodeOperatorsList.ts b/modules/motions/hooks/useNodeOperatorsList.ts index 2d007fbd..fcdcca7a 100644 --- a/modules/motions/hooks/useNodeOperatorsList.ts +++ b/modules/motions/hooks/useNodeOperatorsList.ts @@ -1,26 +1,69 @@ -import { useSWR } from 'modules/network/hooks/useSwr' +import { BigNumber, utils } from 'ethers' import { useWeb3 } from 'modules/blockChain/hooks/useWeb3' -import { - NodeOperatorsRegistryType, - NODE_OPERATORS_REGISTRY_MAP, -} from '../constants' +import { getManagerAddressesMap } from '../utils/getManagerAddressesMap' +import { useLidoSWR } from '@lido-sdk/react' +import { CHAINS } from '@lido-sdk/constants' +import { NODE_OPERATORS_REGISTRY_MAP } from '../constants' +import { UnpackedPromise } from 'modules/shared/utils/utilTypes' +import { NodeOperatorsRegistryAbi } from 'generated' +import { StakingModule } from '../types' -export function useNodeOperatorsList(registryType: NodeOperatorsRegistryType) { - const { chainId, account } = useWeb3() +type NodeOperatorSummary = UnpackedPromise< + ReturnType +> - const nodeOperatorsList = useSWR( - `${chainId}-${account}-${registryType}-operators-list`, - async () => { +type Args = { + module: StakingModule + withSummary?: boolean +} + +export function useNodeOperatorsList(args: Args) { + const { chainId } = useWeb3() + + return useLidoSWR( + [`swr:useNodeOperatorsList`, chainId, args.module, args.withSummary], + async ( + _key: string, + _chainId: CHAINS, + _module: StakingModule, + _withSummary: boolean | undefined, + ) => { try { - const registry = NODE_OPERATORS_REGISTRY_MAP[registryType].connectRpc({ - chainId, + const registry = NODE_OPERATORS_REGISTRY_MAP[_module].connectRpc({ + chainId: _chainId, }) - const count = (await registry.getNodeOperatorsCount()).toNumber() + const MANAGE_SIGNING_KEYS_ROLE = await registry.MANAGE_SIGNING_KEYS() + + const managerAddressesMap = await getManagerAddressesMap( + registry.address, + MANAGE_SIGNING_KEYS_ROLE, + _chainId, + ) + const nodeOperators = await Promise.all( Array.from(Array(count)).map(async (_, i) => { - const nodeOperator = await registry.getNodeOperator(i, true) - return { ...nodeOperator, id: i } + const nodeOperatorInfo = await registry.getNodeOperator(i, true) + let nodeOperatorSummary: NodeOperatorSummary | undefined + + if (_withSummary) { + nodeOperatorSummary = await registry.getNodeOperatorSummary(i) + } + + const rawPermissionParam = BigNumber.from(1).shl(240).add(i) + const permissionParam = utils.solidityKeccak256( + ['uint256'], + [rawPermissionParam], + ) + + const managerAddress = managerAddressesMap[permissionParam] + + return { + ...nodeOperatorInfo, + id: i, + managerAddress, + ...nodeOperatorSummary, + } }), ) return nodeOperators @@ -28,8 +71,9 @@ export function useNodeOperatorsList(registryType: NodeOperatorsRegistryType) { return [] } }, - { revalidateOnFocus: false, revalidateOnReconnect: false }, + { + revalidateOnFocus: false, + revalidateOnReconnect: false, + }, ) - - return nodeOperatorsList } diff --git a/modules/motions/hooks/useRegistrySDVT.ts b/modules/motions/hooks/useRegistrySDVT.ts deleted file mode 100644 index ed26dae9..00000000 --- a/modules/motions/hooks/useRegistrySDVT.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { useSWR } from 'modules/network/hooks/useSwr' -import { useWeb3 } from 'modules/blockChain/hooks/useWeb3' -import { ContractSDVTRegistry } from 'modules/blockChain/contracts' - -export function useSDVTOperatorsCounts() { - const { chainId } = useWeb3() - const registry = ContractSDVTRegistry.useRpc() - - return useSWR( - `sdvt-operators-counts-${chainId}-${registry.address}`, - async () => { - const [current, max] = await Promise.all([ - registry.getNodeOperatorsCount(), - registry.MAX_NODE_OPERATORS_COUNT(), - ]) - return { current: current.toNumber(), max: max.toNumber() } - }, - ) -} - -export function useSDVTOperatorNameLimit() { - const { chainId } = useWeb3() - const registry = ContractSDVTRegistry.useRpc() - - return useSWR( - `sdvt-operator-name-length-${chainId}-${registry.address}`, - async () => registry.MAX_NODE_OPERATOR_NAME_LENGTH(), - ) -} diff --git a/modules/motions/hooks/useSDVTNodeOperatorsList.ts b/modules/motions/hooks/useSDVTNodeOperatorsList.ts deleted file mode 100644 index fd3394af..00000000 --- a/modules/motions/hooks/useSDVTNodeOperatorsList.ts +++ /dev/null @@ -1,80 +0,0 @@ -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 { getManagerAddressesMap } from '../utils/getManagerAddressesMap' - -type NodeOperatorSummary = { - targetValidatorsCount: BigNumber - stuckValidatorsCount: BigNumber - refundedValidatorsCount: BigNumber - stuckPenaltyEndTimestamp: BigNumber - totalExitedValidators: BigNumber - totalDepositedValidators: BigNumber - depositableValidatorsCount: BigNumber - // TODO: fix type once v2 is merged with v1 - isTargetLimitActive?: any - targetLimitMode?: any -} - -type Args = { - withSummary?: boolean - v2?: boolean -} - -export function useSDVTNodeOperatorsList(args?: Args) { - const { chainId, account } = useWeb3() - - return useSWR( - `${chainId}-${account}-${args?.v2 ? 'v2' : 'v1'}-operators-list${ - args?.withSummary ? '-with-summary' : '' - }`, - async () => { - const registry = ( - args?.v2 ? ContractSDVTRegistryV2 : ContractSDVTRegistry - ).connectRpc({ chainId }) - const count = (await registry.getNodeOperatorsCount()).toNumber() - const MANAGE_SIGNING_KEYS_ROLE = await registry.MANAGE_SIGNING_KEYS() - - const managerAddressesMap = await getManagerAddressesMap( - registry.address, - MANAGE_SIGNING_KEYS_ROLE, - chainId, - ) - - const nodeOperators = await Promise.all( - Array.from(Array(count)).map(async (_, i) => { - const nodeOperatorInfo = await registry.getNodeOperator(i, true) - let nodeOperatorSummary: NodeOperatorSummary | undefined - - if (args?.withSummary) { - nodeOperatorSummary = await registry.getNodeOperatorSummary(i) - } - - const rawPermissionParam = BigNumber.from(1).shl(240).add(i) - const permissionParam = utils.solidityKeccak256( - ['uint256'], - [rawPermissionParam], - ) - - const managerAddress = managerAddressesMap[permissionParam] - - return { - ...nodeOperatorInfo, - id: i, - managerAddress, - ...nodeOperatorSummary, - } - }), - ) - return nodeOperators - }, - { - revalidateOnFocus: false, - revalidateOnReconnect: false, - }, - ) -} diff --git a/modules/motions/types.ts b/modules/motions/types.ts index 6f21c0ca..5ad70eb8 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', @@ -168,3 +167,13 @@ export type KeysInfoOperator = { export type KeysInfo = { operators?: KeysInfoOperator[] } + +export const StakingModule = { + Curated: 'curated', + Sandbox: 'sandbox', + SimpleDVT: 'sdvt', +} as const + +// intentionally +// eslint-disable-next-line @typescript-eslint/no-redeclare +export type StakingModule = typeof StakingModule[keyof typeof StakingModule] diff --git a/modules/motions/ui/MotionDescription/DescNodeOperatorLimitIncrease.tsx b/modules/motions/ui/MotionDescription/DescNodeOperatorLimitIncrease.tsx index db282b63..e4ad49d6 100644 --- a/modules/motions/ui/MotionDescription/DescNodeOperatorLimitIncrease.tsx +++ b/modules/motions/ui/MotionDescription/DescNodeOperatorLimitIncrease.tsx @@ -2,7 +2,7 @@ import { useNodeOperatorsList } from 'modules/motions/hooks/useNodeOperatorsList import { EvmIncreaseNodeOperatorStakingLimitAbi } from 'generated' import { NestProps } from './types' import { IncreaseLimitMotionType } from 'modules/motions/constants' -import { getNodeOperatorRegistryType } from 'modules/motions/utils/getNodeOperatorRegistryType' +import { getStakingModuleByMotionType } from 'modules/motions/utils' // IncreaseNodeOperatorLimit export function DescNodeOperatorIncreaseLimit({ @@ -14,8 +14,8 @@ export function DescNodeOperatorIncreaseLimit({ motionType: IncreaseLimitMotionType }) { const nodeOperatorId = Number(callData._nodeOperatorId) - const registryType = getNodeOperatorRegistryType(motionType) - const { data: nodeOperators } = useNodeOperatorsList(registryType) + const module = getStakingModuleByMotionType(motionType) + const { data: nodeOperators } = useNodeOperatorsList({ module }) const nodeOperatorName = nodeOperators?.[nodeOperatorId]?.name ?? '' return ( diff --git a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorManagersChange.tsx b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorManagersChange.tsx index ba5c9685..521f2d83 100644 --- a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorManagersChange.tsx +++ b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorManagersChange.tsx @@ -1,13 +1,16 @@ import { ChangeNodeOperatorManagersAbi } from 'generated' import { NestProps } from './types' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { AddressInlineWithPop } from 'modules/shared/ui/Common/AddressInlineWithPop' +import { useNodeOperatorsList } from 'modules/motions/hooks' +import { StakingModule } from 'modules/motions/types' // ChangeNodeOperatorManagers export function DescSDVTNodeOperatorManagersChange({ callData, }: NestProps) { - const { data: nodeOperatorsList } = useSDVTNodeOperatorsList() + const { data: nodeOperatorsList } = useNodeOperatorsList({ + module: StakingModule.SimpleDVT, + }) return ( <> {callData.map((item, index) => { diff --git a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorNamesSet.tsx b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorNamesSet.tsx index bbfc018c..0ccaa22e 100644 --- a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorNamesSet.tsx +++ b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorNamesSet.tsx @@ -1,13 +1,16 @@ import { SetNodeOperatorNamesAbi } from 'generated' import { NestProps } from './types' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' +import { useNodeOperatorsList } from 'modules/motions/hooks' +import { StakingModule } from 'modules/motions/types' // SetNodeOperatorNames export function DescSDVTNodeOperatorNamesSet({ callData, isOnChain, }: NestProps) { - const { data: nodeOperatorsList } = useSDVTNodeOperatorsList() + const { data: nodeOperatorsList } = useNodeOperatorsList({ + module: StakingModule.SimpleDVT, + }) return ( <> {callData.map((item, index) => { diff --git a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorRewardAddressesSet.tsx b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorRewardAddressesSet.tsx index 39c6c6d2..3ef68b35 100644 --- a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorRewardAddressesSet.tsx +++ b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorRewardAddressesSet.tsx @@ -1,14 +1,17 @@ import { SetNodeOperatorRewardAddressesAbi } from 'generated' import { NestProps } from './types' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { AddressInlineWithPop } from 'modules/shared/ui/Common/AddressInlineWithPop' +import { useNodeOperatorsList } from 'modules/motions/hooks' +import { StakingModule } from 'modules/motions/types' // SetNodeOperatorRewardAddresses export function DescSDVTNodeOperatorRewardAddressesSet({ callData, isOnChain, }: NestProps) { - const { data: nodeOperatorsList } = useSDVTNodeOperatorsList() + const { data: nodeOperatorsList } = useNodeOperatorsList({ + module: StakingModule.SimpleDVT, + }) return ( <> {callData.map((item, index) => { diff --git a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorsActivate.tsx b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorsActivate.tsx index a3c56aae..67942e63 100644 --- a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorsActivate.tsx +++ b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorsActivate.tsx @@ -1,13 +1,16 @@ import { ActivateNodeOperatorsAbi } from 'generated' import { NestProps } from './types' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { AddressInlineWithPop } from 'modules/shared/ui/Common/AddressInlineWithPop' +import { useNodeOperatorsList } from 'modules/motions/hooks' +import { StakingModule } from 'modules/motions/types' // ActivateNodeOperators export function DescSDVTNodeOperatorsActivate({ callData, }: NestProps) { - const { data: nodeOperatorsList } = useSDVTNodeOperatorsList() + const { data: nodeOperatorsList } = useNodeOperatorsList({ + module: StakingModule.SimpleDVT, + }) return ( <> {callData.map((item, index) => { diff --git a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorsDeactivate.tsx b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorsDeactivate.tsx index 42079957..f3650946 100644 --- a/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorsDeactivate.tsx +++ b/modules/motions/ui/MotionDescription/DescSDVTNodeOperatorsDeactivate.tsx @@ -1,13 +1,16 @@ import { DeactivateNodeOperatorsAbi } from 'generated' import { NestProps } from './types' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { AddressInlineWithPop } from 'modules/shared/ui/Common/AddressInlineWithPop' +import { useNodeOperatorsList } from 'modules/motions/hooks' +import { StakingModule } from 'modules/motions/types' // DeactivateNodeOperators export function DescSDVTNodeOperatorsDeactivate({ callData, }: NestProps) { - const { data: nodeOperatorsList } = useSDVTNodeOperatorsList() + const { data: nodeOperatorsList } = useNodeOperatorsList({ + module: StakingModule.SimpleDVT, + }) return ( <> {callData.map((item, index) => { diff --git a/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdate.tsx b/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdate.tsx index fecb135e..e42d2307 100644 --- a/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdate.tsx +++ b/modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdate.tsx @@ -1,13 +1,15 @@ import { UpdateTargetValidatorLimitsAbi } from 'generated' import { NestProps } from './types' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' +import { useNodeOperatorsList } from 'modules/motions/hooks' +import { StakingModule } from 'modules/motions/types' // UpdateTargetValidatorLimits export function DescSDVTTargetValidatorLimitsUpdate({ callData, isOnChain, }: NestProps) { - const { data: nodeOperatorsList } = useSDVTNodeOperatorsList({ + const { data: nodeOperatorsList } = useNodeOperatorsList({ + module: StakingModule.SimpleDVT, withSummary: true, }) return ( @@ -15,10 +17,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 +42,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/DescSDVTVettedValidatorsLimitsSet.tsx b/modules/motions/ui/MotionDescription/DescSDVTVettedValidatorsLimitsSet.tsx index f8a906e2..6127fe69 100644 --- a/modules/motions/ui/MotionDescription/DescSDVTVettedValidatorsLimitsSet.tsx +++ b/modules/motions/ui/MotionDescription/DescSDVTVettedValidatorsLimitsSet.tsx @@ -1,13 +1,15 @@ import { SetVettedValidatorsLimitsAbi } from 'generated' import { NestProps } from './types' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' +import { useNodeOperatorsList } from 'modules/motions/hooks' +import { StakingModule } from 'modules/motions/types' // SetVettedValidatorsLimits export function DescSDVTVettedValidatorsLimitsSet({ callData, isOnChain, }: NestProps) { - const { data: nodeOperatorsList } = useSDVTNodeOperatorsList({ + const { data: nodeOperatorsList } = useNodeOperatorsList({ + module: StakingModule.SimpleDVT, withSummary: true, }) return ( 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..7ea44243 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewNodeOperatorLimitIncrease.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewNodeOperatorLimitIncrease.tsx @@ -14,7 +14,7 @@ import { Fieldset, MessageBox } from '../CreateMotionFormStyle' import { createMotionFormPart } from './createMotionFormPart' import { estimateGasFallback } from 'modules/motions/utils/estimateGasFallback' import { IncreaseLimitMotionType } from 'modules/motions/constants' -import { getNodeOperatorRegistryType } from 'modules/motions/utils/getNodeOperatorRegistryType' +import { getStakingModuleByMotionType } from 'modules/motions/utils' import { validateUintValue } from 'modules/motions/utils/validateUintValue' export const formParts = ({ @@ -49,9 +49,9 @@ export const formParts = ({ }) { const { setValue } = useFormContext() const { walletAddress } = useWeb3() - const registryType = getNodeOperatorRegistryType(motionType) - const nodeOperators = useNodeOperatorsList(registryType) - const keysInfo = useNodeOperatorKeysInfo(registryType) + const module = getStakingModuleByMotionType(motionType) + const nodeOperators = useNodeOperatorsList({ module }) + const keysInfo = useNodeOperatorKeysInfo(module) const currentNodeOperator = useMemo(() => { if (!walletAddress || !nodeOperators.data) { @@ -125,7 +125,7 @@ export const formParts = ({ label={ <> New limit (current limit is{' '} - {currentNodeOperator.stakingLimit.toString()}) + {connectedKeysInfo.info.stakingLimit.toString()}) } rules={{ @@ -137,8 +137,7 @@ export const formParts = ({ } const valueNum = Number(value) - const limit = currentNodeOperator.stakingLimit.toNumber() - if (valueNum <= limit) { + if (valueNum <= connectedKeysInfo.info.stakingLimit) { return 'New limit value should be greater than current' } if (valueNum > connectedKeysInfo.info.totalSigningKeys) { diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorManagersChange.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorManagersChange.tsx index 3878989d..9e458e24 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorManagersChange.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorManagersChange.tsx @@ -16,15 +16,15 @@ import { } from '../CreateMotionFormStyle' import { ContractSDVTNodeOperatorManagerChange } from 'modules/blockChain/contracts' -import { MotionType } from 'modules/motions/types' +import { MotionType, StakingModule } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' import { estimateGasFallback } from 'modules/motions/utils' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { InputControl } from 'modules/shared/ui/Controls/Input' import { checkIsAddressManagerOfNodeOperator } from 'modules/motions/utils/checkAddressManagerRole' import { noSigningKeysRoleError } from 'modules/motions/constants' import { validateAddress } from 'modules/motions/utils/validateAddress' import { NodeOperatorSelectControl } from '../../NodeOperatorSelectControl' +import { useNodeOperatorsList } from 'modules/motions/hooks' type NodeOperator = { id: string @@ -75,7 +75,7 @@ export const formParts = createMotionFormPart({ const { data: nodeOperatorsList, initialLoading: isNodeOperatorsDataLoading, - } = useSDVTNodeOperatorsList() + } = useNodeOperatorsList({ module: StakingModule.SimpleDVT }) const activeNodeOperators = nodeOperatorsList?.filter( nodeOperator => nodeOperator.active, diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorNamesSet.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorNamesSet.tsx index 20394638..69eade2c 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorNamesSet.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorNamesSet.tsx @@ -16,12 +16,14 @@ import { } from '../CreateMotionFormStyle' import { ContractSDVTNodeOperatorNamesSet } from 'modules/blockChain/contracts' -import { MotionType } from 'modules/motions/types' +import { MotionType, StakingModule } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' import { estimateGasFallback } from 'modules/motions/utils' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { InputControl } from 'modules/shared/ui/Controls/Input' -import { useSDVTOperatorNameLimit } from 'modules/motions/hooks' +import { + useNodeOperatorsList, + useNodeOperatorNameLimit, +} from 'modules/motions/hooks' import { validateNodeOperatorName } from 'modules/motions/utils/validateNodeOperatorName' import { NodeOperatorSelectControl } from '../../NodeOperatorSelectControl' @@ -69,12 +71,12 @@ export const formParts = createMotionFormPart({ const { data: nodeOperatorsList, initialLoading: isNodeOperatorsDataLoading, - } = useSDVTNodeOperatorsList() + } = useNodeOperatorsList({ module: StakingModule.SimpleDVT }) const { data: maxNodeOperatorNameLength, initialLoading: isNodeOperatorMaxNameLengthLoading, - } = useSDVTOperatorNameLimit() + } = useNodeOperatorNameLimit(StakingModule.SimpleDVT) const trustedCaller = ContractSDVTNodeOperatorNamesSet.useSwrWeb3( 'trustedCaller', diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorRewardAddressesSet.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorRewardAddressesSet.tsx index 900594f2..51fc2413 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorRewardAddressesSet.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorRewardAddressesSet.tsx @@ -16,15 +16,15 @@ import { } from '../CreateMotionFormStyle' import { ContractSDVTNodeOperatorRewardAddressesSet } from 'modules/blockChain/contracts' -import { MotionType } from 'modules/motions/types' +import { MotionType, StakingModule } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' import { estimateGasFallback } from 'modules/motions/utils' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { InputControl } from 'modules/shared/ui/Controls/Input' import { STETH } from 'modules/blockChain/contractAddresses' import { validateAddress } from 'modules/motions/utils/validateAddress' import { NodeOperatorSelectControl } from '../../NodeOperatorSelectControl' import { MotionInfoBox } from 'modules/shared/ui/Common/MotionInfoBox' +import { useNodeOperatorsList } from 'modules/motions/hooks' type NodeOperator = { id: string @@ -70,7 +70,7 @@ export const formParts = createMotionFormPart({ const { data: nodeOperatorsList, initialLoading: isNodeOperatorsDataLoading, - } = useSDVTNodeOperatorsList() + } = useNodeOperatorsList({ module: StakingModule.SimpleDVT }) const trustedCaller = ContractSDVTNodeOperatorRewardAddressesSet.useSwrWeb3( 'trustedCaller', diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorsActivate.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorsActivate.tsx index 12351326..4cc84d25 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorsActivate.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorsActivate.tsx @@ -16,14 +16,14 @@ import { } from '../CreateMotionFormStyle' import { ContractSDVTNodeOperatorsActivate } from 'modules/blockChain/contracts' -import { MotionType } from 'modules/motions/types' +import { MotionType, StakingModule } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' import { estimateGasFallback } from 'modules/motions/utils' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { InputControl } from 'modules/shared/ui/Controls/Input' import { checkAddressForManageSigningKeysRole } from 'modules/motions/utils/checkAddressManagerRole' import { validateAddress } from 'modules/motions/utils/validateAddress' import { NodeOperatorSelectControl } from '../../NodeOperatorSelectControl' +import { useNodeOperatorsList } from 'modules/motions/hooks' type NodeOperator = { id: string @@ -69,7 +69,7 @@ export const formParts = createMotionFormPart({ const { data: nodeOperatorsList, initialLoading: isNodeOperatorsDataLoading, - } = useSDVTNodeOperatorsList() + } = useNodeOperatorsList({ module: StakingModule.SimpleDVT }) const deactivatedNodeOperators = nodeOperatorsList?.filter( nodeOperator => !nodeOperator.active, diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorsDeactivate.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorsDeactivate.tsx index ae8bd637..d5f77d9a 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorsDeactivate.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTNodeOperatorsDeactivate.tsx @@ -16,15 +16,15 @@ import { } from '../CreateMotionFormStyle' import { ContractSDVTNodeOperatorsDeactivate } from 'modules/blockChain/contracts' -import { MotionType } from 'modules/motions/types' +import { MotionType, StakingModule } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' import { estimateGasFallback } from 'modules/motions/utils' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { InputControl } from 'modules/shared/ui/Controls/Input' import { checkIsAddressManagerOfNodeOperator } from 'modules/motions/utils/checkAddressManagerRole' import { noSigningKeysRoleError } from 'modules/motions/constants' import { validateAddress } from 'modules/motions/utils/validateAddress' import { NodeOperatorSelectControl } from '../../NodeOperatorSelectControl' +import { useNodeOperatorsList } from 'modules/motions/hooks' type NodeOperator = { id: string @@ -70,7 +70,7 @@ export const formParts = createMotionFormPart({ const { data: nodeOperatorsList, initialLoading: isNodeOperatorsDataLoading, - } = useSDVTNodeOperatorsList() + } = useNodeOperatorsList({ module: StakingModule.SimpleDVT }) const activeNodeOperators = nodeOperatorsList?.filter( nodeOperator => nodeOperator.active, diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdate.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdate.tsx index d49a33d7..12aff2d9 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdate.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTTargetValidatorLimitsUpdate.tsx @@ -16,18 +16,18 @@ import { } from '../CreateMotionFormStyle' import { ContractSDVTTargetValidatorLimitsUpdate } from 'modules/blockChain/contracts' -import { MotionType } from 'modules/motions/types' +import { MotionType, StakingModule } 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' +import { useNodeOperatorsList } from 'modules/motions/hooks' type NodeOperator = { id: number | undefined - isTargetLimitActive: boolean + targetLimitMode: string targetLimit: string } @@ -42,12 +42,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 +66,7 @@ export const formParts = createMotionFormPart({ nodeOperators: [ { id: undefined, - isTargetLimitActive: false, + targetLimitMode: '', targetLimit: '', }, ] as NodeOperator[], @@ -76,7 +76,10 @@ export const formParts = createMotionFormPart({ const { data: nodeOperatorsList, initialLoading: isNodeOperatorsDataLoading, - } = useSDVTNodeOperatorsList({ withSummary: true }) + } = useNodeOperatorsList({ + module: StakingModule.SimpleDVT, + withSummary: true, + }) const trustedCaller = ContractSDVTTargetValidatorLimitsUpdate.useSwrWeb3( 'trustedCaller', @@ -104,7 +107,7 @@ export const formParts = createMotionFormPart({ const handleAddUpdate = () => fieldsArr.append({ id: undefined, - isTargetLimitActive: false, + targetLimitMode: '', targetLimit: '', } as NodeOperator) @@ -154,18 +157,28 @@ export const formParts = createMotionFormPart({ const nodeOperator = nodeOperatorsList[Number(value)] setValue( - `${fieldNames.nodeOperators}.${fieldIndex}.isTargetLimitActive`, - Boolean(nodeOperator.isTargetLimitActive), + `${fieldNames.nodeOperators}.${fieldIndex}.targetLimitMode`, + Number(nodeOperator.targetLimitMode), ) }} />
- + + + + +
@@ -183,7 +196,9 @@ export const formParts = createMotionFormPart({ ) } disabled={ - !selectedNodeOperators[fieldIndex]?.isTargetLimitActive + Number( + selectedNodeOperators[fieldIndex]?.targetLimitMode, + ) == 0 } rules={{ required: 'Field is required', 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/StartNewSDVTVettedValidatorsLimitsSet.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTVettedValidatorsLimitsSet.tsx index 0f089e6b..1b8747d6 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTVettedValidatorsLimitsSet.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewSDVTVettedValidatorsLimitsSet.tsx @@ -16,13 +16,13 @@ import { } from '../CreateMotionFormStyle' import { ContractSDVTVettedValidatorsLimitsSet } from 'modules/blockChain/contracts' -import { MotionType } from 'modules/motions/types' +import { MotionType, StakingModule } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' import { estimateGasFallback } from 'modules/motions/utils' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { InputNumberControl } from 'modules/shared/ui/Controls/InputNumber' import { validateUintValue } from 'modules/motions/utils/validateUintValue' import { NodeOperatorSelectControl } from 'modules/motions/ui/NodeOperatorSelectControl' +import { useNodeOperatorsList } from 'modules/motions/hooks' type NodeOperator = { id: string @@ -68,7 +68,10 @@ export const formParts = createMotionFormPart({ const { data: nodeOperatorsList, initialLoading: isNodeOperatorsDataLoading, - } = useSDVTNodeOperatorsList({ withSummary: true }) + } = useNodeOperatorsList({ + module: StakingModule.SimpleDVT, + withSummary: true, + }) const nodeOperatorsWithValidators = nodeOperatorsList?.filter( nodeOperator => nodeOperator.totalAddedValidators.gt(0), diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartSDVTNodeOperatorsAdd.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartSDVTNodeOperatorsAdd.tsx index 8b77549f..8c20b32f 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartSDVTNodeOperatorsAdd.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartSDVTNodeOperatorsAdd.tsx @@ -20,16 +20,16 @@ import { import { ContractSDVTNodeOperatorsAdd } from 'modules/blockChain/contracts' -import { MotionTypeForms } from 'modules/motions/types' +import { MotionTypeForms, StakingModule } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' import { estimateGasFallback } from 'modules/motions/utils' import { - useSDVTOperatorNameLimit, - useSDVTOperatorsCounts, + useNodeOperatorsList, + useNodeOperatorNameLimit, + useNodeOperatorsCount, } from 'modules/motions/hooks' import { STETH } from 'modules/blockChain/contractAddresses' import { checkAddressForManageSigningKeysRole } from 'modules/motions/utils/checkAddressManagerRole' -import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' import { validateNodeOperatorName } from 'modules/motions/utils/validateNodeOperatorName' import { validateAddress } from 'modules/motions/utils/validateAddress' @@ -39,14 +39,6 @@ type NodeOperator = { managerAddress: string } -// DONE: The current number of node operators in the registry MUST be equal to the _nodeOperatorsCount -// DONE: (exec also) The total number of node operators in the registry, after adding the new ones, MUST NOT exceed nodeOperatorsRegistry.MAX_NODE_OPERATORS_COUNT() -// DONE: Manager addresses MUST NOT have duplicates -// DONE: Manager addresses MUST NOT be used as managers for previously added node operators -// DONE: Reward addresses of newly added node operators MUST NOT contain the address of the stETH token -// DONE: Reward addresses of newly added node operators MUST NOT contain zero addresses -// DONE: The names of newly added node operators MUST NOT be an empty string -// DONE: The name lengths of each newly added node operator MUST NOT exceed the nodeOperatorsRegistry.MAX_NODE_OPERATOR_NAME_LENGTH() export const formParts = () => createMotionFormPart({ motionType: MotionTypeForms.SDVTNodeOperatorsAdd, @@ -93,13 +85,13 @@ export const formParts = () => const { data: nodeOperatorsList, initialLoading: isNodeOperatorsListLoading, - } = useSDVTNodeOperatorsList() + } = useNodeOperatorsList({ module: StakingModule.SimpleDVT }) const { data: maxNodeOperatorNameLength, initialLoading: NONameLengthLoading, - } = useSDVTOperatorNameLimit() + } = useNodeOperatorNameLimit(StakingModule.SimpleDVT) const { data: NOCounts, initialLoading: maxOperatorsLoading } = - useSDVTOperatorsCounts() + useNodeOperatorsCount(StakingModule.SimpleDVT) const fieldsArr = useFieldArray({ name: fieldNames.nodeOperators }) const selectedNodeOperators: NodeOperator[] = watch( 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', diff --git a/modules/motions/utils/getNodeOperatorRegistryType.ts b/modules/motions/utils/getStakingModuleByMotionType.ts similarity index 55% rename from modules/motions/utils/getNodeOperatorRegistryType.ts rename to modules/motions/utils/getStakingModuleByMotionType.ts index eca5755b..17eec430 100644 --- a/modules/motions/utils/getNodeOperatorRegistryType.ts +++ b/modules/motions/utils/getStakingModuleByMotionType.ts @@ -3,8 +3,8 @@ import { INCREASE_LIMIT_MOTION_MAP, } from '../constants' -export function getNodeOperatorRegistryType( +export function getStakingModuleByMotionType( motionType: IncreaseLimitMotionType, ) { - return INCREASE_LIMIT_MOTION_MAP[motionType].registryType + return INCREASE_LIMIT_MOTION_MAP[motionType].stakingModule } diff --git a/modules/motions/utils/index.ts b/modules/motions/utils/index.ts index 22507bcc..bc834a4c 100644 --- a/modules/motions/utils/index.ts +++ b/modules/motions/utils/index.ts @@ -15,3 +15,4 @@ export * from './getMotionTypeDisplayName' export * from './getLimits' export * from './getPeriodData' export * from './getEventsLegoDAIRecipientAdded' +export * from './getStakingModuleByMotionType'