Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...
Expand Down Expand Up @@ -513,4 +515,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/)
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/)
12 changes: 6 additions & 6 deletions test/BaseDelegation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion test/LiquidDelegation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion test/NonLiquidDelegation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down