| name | ton-staking |
| description | Activate when the user works with TON staking, WTON, seigniorage, SeigManager, DepositManager, staking balance queries, layer2 operators, or TON/WTON decimal conversion. Covers the ton-staking-v2 system.
|
| license | MIT |
| metadata | {"author":"tokamak-network","version":"1.0.0"} |
TON Staking V2
TON Staking V2 distributes seigniorage (newly minted TON) to L2 sequencers proportional to each L2's TVL. Stakers deposit TON → convert to WTON → stake on a layer2 operator.
Critical: Decimal Precision
This is the most common source of bugs in Tokamak development.
| Token | Decimals | Unit Name | Example: "100 tokens" |
|---|
| TON | 18 | WAD | 100 * 1e18 |
| WTON | 27 | RAY | 100 * 1e27 |
All staking functions return values in WTON (27 decimals).
// WRONG: dividing by 1e18 to get human-readable
uint256 staked = seigManager.stakeOf(layer2, account);
uint256 humanReadable = staked / 1e18; // WRONG! Off by 1e9
// CORRECT: divide by 1e27 for WTON values
uint256 staked = seigManager.stakeOf(layer2, account);
uint256 humanReadable = staked / 1e27; // Correct
staked = seigManager.(layer2, account);
display = ethers.(staked);
staked = seigManager.(layer2, account);
display = ethers.(staked, );