diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f19fc8..ff35eb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [comment]: <> (## [Unreleased](https://github.com/lidofinance/lido-python-sdk) - 2021-09-15) +## [4.0.0](https://github.com/lidofinance/lido-python-sdk/pull/89) - 2023-03-10 +### Fixed +- Support to Zhejiang testnet V2 + ## [3.0.4](https://github.com/lidofinance/lido-python-sdk/pull/86) - 2023-02-12 ### Fixed - Node Operators has no keys issue. diff --git a/lido_sdk/contract/abi/Lido.json b/lido_sdk/contract/abi/Lido.json index 1d68935..eaea020 100644 --- a/lido_sdk/contract/abi/Lido.json +++ b/lido_sdk/contract/abi/Lido.json @@ -156,20 +156,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "constant": true, - "inputs": [], - "name": "TOTAL_BASIS_POINTS", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, { "constant": true, "inputs": [ @@ -295,6 +281,20 @@ "stateMutability": "view", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "name": "_newDepositedValidators", + "type": "uint256" + } + ], + "name": "unsafeChangeDepositedValidators", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": true, "inputs": [], @@ -388,8 +388,8 @@ ], "name": "initialize", "outputs": [], - "payable": false, - "stateMutability": "nonpayable", + "payable": true, + "stateMutability": "payable", "type": "function" }, { @@ -638,6 +638,32 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "name": "name", + "type": "string" + }, + { + "name": "version", + "type": "string" + }, + { + "name": "chainId", + "type": "uint256" + }, + { + "name": "verifyingContract", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [], @@ -703,6 +729,20 @@ "stateMutability": "pure", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "getEIP712StETH", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": false, "inputs": [ @@ -845,6 +885,20 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [], @@ -867,6 +921,15 @@ "stateMutability": "view", "type": "function" }, + { + "constant": false, + "inputs": [], + "name": "removeStakingLimit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ @@ -895,9 +958,13 @@ "type": "uint256" }, { - "name": "_lastFinalizableRequestId", + "name": "_sharesRequestedToBurn", "type": "uint256" }, + { + "name": "_withdrawalFinalizationBatches", + "type": "uint256[]" + }, { "name": "_simulatedShareRate", "type": "uint256" @@ -906,44 +973,14 @@ "name": "handleOracleReport", "outputs": [ { - "name": "totalPooledEther", - "type": "uint256" - }, - { - "name": "totalShares", - "type": "uint256" - }, - { - "name": "withdrawals", - "type": "uint256" - }, - { - "name": "elRewards", - "type": "uint256" + "name": "postRebaseAmounts", + "type": "uint256[4]" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, - { - "constant": false, - "inputs": [], - "name": "removeStakingLimit", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "receiveStakingRouterDepositRemainder", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - }, { "constant": true, "inputs": [], @@ -1103,6 +1140,20 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "getDepositableEther", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [ @@ -1185,6 +1236,40 @@ "name": "StakingLimitRemoved", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "reportTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "name": "preCLValidators", + "type": "uint256" + }, + { + "indexed": false, + "name": "postCLValidators", + "type": "uint256" + } + ], + "name": "CLValidatorsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "depositedValidators", + "type": "uint256" + } + ], + "name": "DepositedValidatorsChanged", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -1334,18 +1419,6 @@ "name": "Unbuffered", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "amount", - "type": "uint256" - } - ], - "name": "StakingRouterDepositRemainderReceived", - "type": "event" - }, { "anonymous": false, "inputs": [ diff --git a/lido_sdk/contract/abi/NodeOperatorsRegistry.json b/lido_sdk/contract/abi/NodeOperatorsRegistry.json index 8ee562e..9e82bbe 100644 --- a/lido_sdk/contract/abi/NodeOperatorsRegistry.json +++ b/lido_sdk/contract/abi/NodeOperatorsRegistry.json @@ -76,16 +76,17 @@ "constant": false, "inputs": [ { - "name": "_locator", - "type": "address" - }, + "name": "_nodeOperatorId", + "type": "uint256" + } + ], + "name": "clearNodeOperatorPenalty", + "outputs": [ { - "name": "_type", - "type": "bytes32" + "name": "", + "type": "bool" } ], - "name": "finalizeUpgrade_v2", - "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" @@ -270,19 +271,19 @@ "constant": false, "inputs": [ { - "name": "_nodeOperatorId", - "type": "uint256" + "name": "_locator", + "type": "address" }, { - "name": "_isTargetLimitActive", - "type": "bool" + "name": "_type", + "type": "bytes32" }, { - "name": "_targetLimit", - "type": "uint64" + "name": "_stuckPenaltyDelay", + "type": "uint256" } ], - "name": "updateTargetValidatorsLimits", + "name": "initialize", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -462,15 +463,6 @@ "stateMutability": "view", "type": "function" }, - { - "constant": false, - "inputs": [], - "name": "onAllValidatorCountersUpdated", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, { "constant": true, "inputs": [], @@ -555,6 +547,20 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "onRewardsMinted", + "outputs": [], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [], @@ -657,6 +663,28 @@ "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": [], @@ -679,6 +707,42 @@ "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": [ @@ -766,6 +830,28 @@ "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": [ @@ -876,24 +962,6 @@ "stateMutability": "view", "type": "function" }, - { - "constant": false, - "inputs": [ - { - "name": "_locator", - "type": "address" - }, - { - "name": "_type", - "type": "bytes32" - } - ], - "name": "initialize", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, { "constant": false, "inputs": [ @@ -908,10 +976,6 @@ ], "name": "obtainDepositData", "outputs": [ - { - "name": "depositsCount", - "type": "uint256" - }, { "name": "publicKeys", "type": "bytes" @@ -1029,18 +1093,9 @@ "type": "function" }, { - "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_exitedValidatorsCount", - "type": "uint256" - } - ], - "name": "updateExitedValidatorsCount", + "constant": true, + "inputs": [], + "name": "MAX_STUCK_PENALTY_DELAY", "outputs": [ { "name": "", @@ -1048,22 +1103,13 @@ } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "constant": false, - "inputs": [ - { - "name": "_nodeOperatorId", - "type": "uint256" - }, - { - "name": "_stuckValidatorsCount", - "type": "uint256" - } - ], - "name": "updateStuckValidatorsCount", + "inputs": [], + "name": "onExitedAndStuckValidatorsCountsUpdated", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -1101,20 +1147,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "handleRewardsMinted", - "outputs": [], - "payable": false, - "stateMutability": "view", - "type": "function" - }, { "constant": false, "inputs": [ @@ -1127,7 +1159,7 @@ "type": "uint256" }, { - "name": "_stuckValidatorsKeysCount", + "name": "_stuckValidatorsCount", "type": "uint256" } ], @@ -1151,6 +1183,25 @@ "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": [ @@ -1229,40 +1280,6 @@ "name": "NodeOperatorRewardAddressSet", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "stakingLimit", - "type": "uint64" - } - ], - "name": "NodeOperatorStakingLimitSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, - { - "indexed": false, - "name": "totalStopped", - "type": "uint64" - } - ], - "name": "NodeOperatorTotalStoppedValidatorsReported", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -1292,18 +1309,6 @@ "name": "KeysOpIndexSet", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "version", - "type": "uint256" - } - ], - "name": "ContractVersionSet", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -1428,18 +1433,13 @@ { "anonymous": false, "inputs": [ - { - "indexed": true, - "name": "nodeOperatorId", - "type": "uint256" - }, { "indexed": false, - "name": "stuckValidatorsCount", + "name": "stuckPenaltyDelay", "type": "uint256" } ], - "name": "StuckValidatorsCountChanged", + "name": "StuckPenaltyDelayChanged", "type": "event" }, { @@ -1452,11 +1452,21 @@ }, { "indexed": false, - "name": "RefundedValidatorsCount", + "name": "stuckValidatorsCount", + "type": "uint256" + }, + { + "indexed": false, + "name": "refundedValidatorsCount", + "type": "uint256" + }, + { + "indexed": false, + "name": "stuckPenaltyEndTimestamp", "type": "uint256" } ], - "name": "RefundedValidatorsCountChanged", + "name": "StuckPenaltyStateChanged", "type": "event" }, { @@ -1493,6 +1503,18 @@ "name": "NodeOperatorPenalized", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "version", + "type": "uint256" + } + ], + "name": "ContractVersionSet", + "type": "event" + }, { "anonymous": false, "inputs": [ diff --git a/lido_sdk/contract/load_contract.py b/lido_sdk/contract/load_contract.py index f7117df..7868bb6 100644 --- a/lido_sdk/contract/load_contract.py +++ b/lido_sdk/contract/load_contract.py @@ -12,7 +12,7 @@ Network.Rinkeby: "0xF4242f9d78DB7218Ad72Ee3aE14469DBDE8731eD", Network.Kintsugi: "0x3a6a994AC0CC96b6DDbaA99F10769384Fa14227B", Network.Kiln: "0x3E50180cf438e185ec52Ade55855718584541476", - Network.Zhejiang: "0xEC9ac956D7C7fE5a94919fD23BAc4a42f950A403", + Network.Zhejiang: "0xDe82ADEd58dA35add75Ea4676239Ca169c8dCD15", } NODE_OPS_ADDRESSES = { @@ -22,7 +22,7 @@ Network.Rinkeby: "0x776dFe7Ec5D74526Aa65898B7d77FCfdf15ffBe6", Network.Kintsugi: "0xeb7D01f713F59EFfB350D05b7AF66720373D4F41", Network.Kiln: "0xb849C5b35DC45277Bad5c6F2c6C77183d842367c", - Network.Zhejiang: "0x8a1E2986E52b441058325c315f83C9D4129bDF72", + Network.Zhejiang: "0xB099EC462e42Ac2570fB298B42083D7A499045D8", } diff --git a/pyproject.toml b/pyproject.toml index e33914c..15779b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "lido-sdk" -version = "3.0.4" +version = "4.0.0" description = "This library consolidates various functions to efficiently load network data for Lido, validate node operator keys and find key duplicates." authors = ["Lido "] license = "MIT License" diff --git a/setup.py b/setup.py index a120884..5825de9 100644 --- a/setup.py +++ b/setup.py @@ -80,7 +80,7 @@ # Where the magic happens: setup( name="lido-sdk", - version="3.0.4", + version="4.0.0", description="This library consolidates various functions to efficiently load network data for Lido," " validate node operator keys and find key duplicates.", long_description=long_description,