From 64b1140cd6a660caf07a7be8091f1517f2a2d165 Mon Sep 17 00:00:00 2001 From: DrZoltanFazekas Date: Thu, 19 Jun 2025 22:24:40 +0200 Subject: [PATCH 1/3] Update audit section in readme --- README.md | 2 +- test/BaseDelegation.t.sol | 12 ++++++------ test/LiquidDelegation.t.sol | 2 +- test/NonLiquidDelegation.t.sol | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 770d178..f138095 100644 --- a/README.md +++ b/README.md @@ -513,4 +513,4 @@ If the execution reverts, you can look up the error based on the first 4 bytes o ## Audit -Version `1.0.0` of the contracts was audited in March 2025: [audit report](https://hacken.io/audits/zilliqa/sca-zilliqa-delegated-staking-mar2025/) \ No newline at end of file +Version `1.0.0` of the contracts was audited in March 2025, and version `1.1.1` was retested in June 2025: [audit report](https://hacken.io/audits/zilliqa/sca-zilliqa-delegated-staking-mar2025/) \ No newline at end of file diff --git a/test/BaseDelegation.t.sol b/test/BaseDelegation.t.sol index a56bb6f..609a2e4 100644 --- a/test/BaseDelegation.t.sol +++ b/test/BaseDelegation.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.28; /* solhint-disable no-console */ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import { Deposit } from "@zilliqa/zq2/deposit_v6.sol"; +import { Deposit } from "@zilliqa/zq2/deposit_v5.sol"; import { Test } from "forge-std/Test.sol"; import { Console } from "script/Console.s.sol"; import { BaseDelegation } from "src/BaseDelegation.sol"; @@ -60,11 +60,11 @@ abstract contract BaseDelegationTest is Test { delegation.DEPOSIT_CONTRACT(), address(new Deposit()).code ); - vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740a)), bytes32(uint256(block.number / 10))); - vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740b)), bytes32(uint256(10_000_000 ether))); - vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740c)), bytes32(uint256(256))); - vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740d)), bytes32(uint256(10))); - vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740e)), bytes32(uint256(300))); + vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740b)), bytes32(uint256(block.number / 10))); + vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740c)), bytes32(uint256(10_000_000 ether))); + vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740d)), bytes32(uint256(256))); + vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740e)), bytes32(uint256(10))); + vm.store(delegation.DEPOSIT_CONTRACT(), bytes32(uint256(0x958a6cf6390bd7165e3519675caa670ab90f0161508a9ee714d3db7edc50740f)), bytes32(uint256(300))); /* Console.log("Deposit.minimimStake() =", Deposit(delegation.DEPOSIT_CONTRACT()).minimumStake()); Console.log("Deposit.maximumStakers() =", Deposit(delegation.DEPOSIT_CONTRACT()).maximumStakers()); diff --git a/test/LiquidDelegation.t.sol b/test/LiquidDelegation.t.sol index 9f54eec..4a46187 100644 --- a/test/LiquidDelegation.t.sol +++ b/test/LiquidDelegation.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.28; /* solhint-disable no-console */ import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; -import { Deposit } from "@zilliqa/zq2/deposit_v6.sol"; +import { Deposit } from "@zilliqa/zq2/deposit_v5.sol"; import { Vm } from "forge-std/Test.sol"; import { Console } from "script/Console.s.sol"; import { BaseDelegation } from "src/BaseDelegation.sol"; diff --git a/test/NonLiquidDelegation.t.sol b/test/NonLiquidDelegation.t.sol index b5698c4..364dd4a 100644 --- a/test/NonLiquidDelegation.t.sol +++ b/test/NonLiquidDelegation.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.28; /* solhint-disable no-console */ import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; -import { Deposit } from "@zilliqa/zq2/deposit_v6.sol"; +import { Deposit } from "@zilliqa/zq2/deposit_v5.sol"; import { Console } from "script/Console.s.sol"; import { BaseDelegation } from "src/BaseDelegation.sol"; import { IDelegation } from "src/IDelegation.sol"; From 918d8729a7501a14e3111573be507f464d11cb94 Mon Sep 17 00:00:00 2001 From: DrZoltanFazekas Date: Fri, 20 Jun 2025 06:28:05 +0200 Subject: [PATCH 2/3] Update max number of validators per pool --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f138095..bbb4163 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ forge script script/Configure.s.sol --broadcast --legacy --sig "commissionReceiv ## Validator Addition and Removal -A staking pool can operate with up to 255 validator nodes. +A staking pool can operate with up to 100 validator nodes. If your node has already been activated as a validator i.e. solo staker, it can join a staking pool. Run ```bash From b41f6299345041edf4549817e614715fd46d4708 Mon Sep 17 00:00:00 2001 From: DrZoltanFazekas Date: Fri, 20 Jun 2025 06:41:53 +0200 Subject: [PATCH 3/3] Explain the minimum stake limit in readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bbb4163..a0a5beb 100644 --- a/README.md +++ b/README.md @@ -283,6 +283,8 @@ To query the current price of an LST, run cast to-unit $(cast call 0x7A0b7e6D24eDe78260c9ddBD98e828B0e11A8EA2 "getPrice()(uint256)" --block latest | sed 's/\[[^]]*\]//g') ether ``` +Note that the minimum amount that can be staked in one transaction is 100 ZIL. In the non-liquid variant, the same minimum amount of ZIL applies to unstaking as well, unless everything is unstaked, which can be less than 100 ZIL. + To unstake e.g. 100 LST (liquid variant) or 100 ZIL (non-liquid variant), run ```bash forge script script/Unstake.s.sol --broadcast --legacy --sig "run(address payable, uint256)" 0x7A0b7e6D24eDe78260c9ddBD98e828B0e11A8EA2 100000000000000000000 --private-key 0x...