This document explains how to integrate Copper's UI with Single Nominator TON smart contract that allows staking TON coins in a secure way. We assume that some other party is running the validator node and has already deployed the single nominator smart contract. Such party is for example Kiln.
- Single-Nominator - The single-nominator contract we are sending opcodes to, example: Ef9P..W1sl
- Owner - The Copper custodian wallet that is sending the opcodes, example: UQA6..SXYf
- Validator - The validator wallet operated by Kiln, example: Uf_a..xFa0
This operation does not require any special integration by Copper. Deposit is just a simple transfer of TON coins from the Copper custodian wallet (Owner) to the contract (Single-Nominator).
This operation is extremely easy to integrate because it's just a simple transfer of 0.1 TON with the comment "w" from the Copper custodian wallet (Owner) to the contract (Single-Nominator).
This operation is not mandatory and only nice to have. It's a little harder to integrate because it requires an input argument (the withdraw amount) and requires crafting a custom message. The custom op is 0x1000 and it needs to be sent with a message containing 0.1 TON from the Copper custodian wallet (Owner) to the contract (Single-Nominator).
const WITHDRAW = 0x1000;
const payload = beginCell()
.storeUint(WITHDRAW, 32)
.storeUint(0, 64)
.storeCoins(toNano(amount.toFixed(2)))
.endCell();You can see a JavaScript example of sending this message in the official Single Nominator client.
If you need any technical support with this integration, please contact Doron, email: doron@orbs.com, telegram: d0xni. He worked on implementing the single-nominator contract itself, so he is an expert.
Thanks.