# HOW TO STAKE ON ZENCHAIN'S TESTNET USING CODE.

By [Daniel Josiah](https://paragraph.com/@daniel-josiah) · 2025-07-23

---

This article is a detailed guide on how to stake zenchain’s testnet tokens on zenchain’s testnet using [https://docs.zenchain.io/docs/how-to-stake/stake-with-code](https://docs.zenchain.io/docs/how-to-stake/stake-with-code) as a reference.

**Preparation Guide**
=====================

To get started you will need to get the INativeStaking.sol code or file from zenchain’s code repository,which is located here — [https://github.com/zenchain-protocol/precompile-interfaces/blob/main/INativeStaking.sol](https://github.com/zenchain-protocol/precompile-interfaces/blob/main/INativeStaking.sol).

![](https://storage.googleapis.com/papyrus_images/fe0e0a7b5cf4ad145b701c394c1506e12033d8e51550e371f78be19c41dc0862.jpg)

After copying the code or downloading the file locally to your device,You have two options to import your code:

*   🔹 Copy & Paste Method: If you copied the code from a webpage, click "New File" in RemixIDE and paste the code into the editor.
    
*   🔹 Download & Upload Method: If you downloaded the code as a raw file, click "Open Files" in RemixIDE and select the downloaded file from your computer.
    

![](https://storage.googleapis.com/papyrus_images/ed7468f7920936b28be8fd18725fcd1f34d7c8f2f8c245634c8bb55b646a4121.jpg)

When you have the code on your remix terminal go to Solidity Compiler tab, and expand Advanced Configuration, next select EVM Version — shanghai. And click “Compile INativeStaking.sol” button for compile contract.

![](https://storage.googleapis.com/papyrus_images/c7a6f998c8fd4d22d3a81a167f391438710d0f039828f88ef008cd03c9af68bb.jpg)

Now, navigate to the Deploy & Run Transactions section. Under Environment, choose Injected Provider — MetaMask. Make sure that MetaMask is connected to the Zenchain testnet — this will be confirmed in RemixIDE by displaying Custom (8408) network.

_If the Account field is empty, go to the Environment dropdown and select WalletConnect. Then click the Connect Wallet button and choose MetaMask from the available wallet options._

If MetaMask prompts you to switch to another network, decline the request as this may occasionally occur. In the Account field you can see your wallet address.

Next, enter the contract address `0x00000000000000000000000000000000000000000800` in the field beside the **At Address** button, then click the button. You should now see the contract's methods listed under the **Deployed Contracts** section below.

![](https://storage.googleapis.com/papyrus_images/0acad34678a3bb18c62d2dc495f4a06876ea401bdcc2a7b73a1dca2b3f63c37d.jpg)

You will notice a window will pop up under the deployed contract section

![](https://storage.googleapis.com/papyrus_images/c3d08911e6988afd12358f671875df46ff400141a2371fc56bf226f8f12fd253.jpg)

**STAKING PROCESS**  
According to the [Zenchain staking documentation](https://docs.zenchain.io/docs/how-to-stake/stake-with-code#bond-zcx), you'll need to use two key methods: `bondWithRewardDestination` and `bondExtra`.

Start by calling `bondWithRewardDestination`. Here, you’ll specify the number of ZCX tokens you want to stake and indicate where the rewards should be sent using the `value` and `dest` parameters. For example, if you're staking 1,000 ZCX and want the rewards to be added back to your stake, set `dest` to `0`.  
  
_Note that the value must be multiplied by 10000000000000000000 (since integer values ​​are used to describe floating point numbers)._

The values in this scenario are:  
bondWithRewardDestination  
value: _1000000000000000000000_  
dest: _0_

![](https://storage.googleapis.com/papyrus_images/7bf945a0b4ca54cc29e9851bd5367a676c60295b2f319c4f915d7c8ff20b11d0.jpg)

Click the “**transact**” button and after that you will need to confirm the transaction in MetaMask.

> _We can also call bondExtra to add tokens to the stake (the amount is specified the same as in the previous example). After confirmation, the amount in the stake will be increased._

**Activate staking**
====================

Using [activate-your-stake](https://docs.zenchain.io/docs/how-to-stake/stake-with-code#activate-your-stake) for reference, you need to call either validate (if you are a validator) or nominate (if you want to support any validators).

**For validators**  
If you're acting as a validator, the `validate` method allows you to set your commission rate as a percentage (multiplied by 10,000,000). For instance, a 10% commission would be represented as `100000000`. You can also set the `blocked` parameter, which determines whether new nominations are allowed. For example:  
  
validate  
commission: 100000000  
blocked: false

![](https://storage.googleapis.com/papyrus_images/478224576c0a416075b0eeb9adb38466f3fb42bc40bce604b1390a4aee59c8a6.jpg)

**For nominators**  
If you're not a validator, use the `nominate` method instead. This method requires only one parameter: the wallet addresses of the validators you want to delegate your tokens to. Keep in mind that each time you call this method, it will replace the previously set values. You can delegate to up to 16 validators at once.  
  
nominate  
targets: \["0x6D5....B459", "0x6D5....B459"\]  
  
_You can get the validators’ addresses from the documentation:_ `nominate(["0x46A148316EBA94539642f3fD6908dcAB10994D1A", "0x10e4f95a5655b932A724eaDea4766eb6671d0cA5"])`\*.Alternatively, you can copy the addresses from an API query to Zentrace: [https://zentrace.io/api/v2/blocks?type=block%20%7C%20uncle%20%7C%20reorg](https://zentrace.io/api/v2/blocks?type=block+%7C+uncle+%7C+reorg), and retrieve the \*`miner.hash` _values for the latest blocks._

---

*Originally published on [Daniel Josiah](https://paragraph.com/@daniel-josiah/how-to-stake-on-zenchain-s-testnet-using-code)*
