Overview
Prerequisites
Before you begin, ensure you have the following:
A web3-compatible wallet (e.g., MetaMask) connected to Gnosis Chain.
Some xDAI in your wallet to cover transaction fees.
The TokenLocking Contract ABI (provided below).
For reference, the token contract address for CLNY on Gnosis Chain is:
0xc9B6218AffE8Aba68a13899Cbf7cF7f14DDd304C
Step 1: Load the Contract ABI
Go to the Ethereum Smart Contract Interaction Tool.
Enter the TokenLocking Contract ABI provided below.
Connect your wallet to the site using the "Connect Wallet" button.
TokenLocking Contract ABI:
[
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_amount",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_user",
"type": "address"
}
],
"name": "getUserLock",
"outputs": [
{
"components": [
{
"name": "lockCount",
"type": "uint256"
},
{
"name": "balance",
"type": "uint256"
},
{
"name": "timestamp",
"type": "uint256"
}
],
"name": "lock",
"type": "tuple"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]
Step 2: Check Your Locked Tokens
Navigate to Read Functions in the tool.
Locate the function:
"Read Function: getUserLock"
.Enter the Token Address.
For example CLNY (
0xc9B6218AffE8Aba68a13899Cbf7cF7f14DDd304C
).
Click "CALL GETUSERLOCK".
The function will return an array of values, similar to:
[ "0", "10006113344029417188709", "0" ]
The second value represents the number of tokens you have locked. This value can be used as a number in the next step.
Step 3: Initiate Unstaking
Navigate to Write Functions.
Locate the function:
"Write Function: withdraw"
.Enter the following details:
Token Contract Address:
For example CLNY
0xc9B6218AffE8Aba68a13899Cbf7cF7f14DDd304C
Amount:
The amount of tokens to withdraw.
i.e. the second value from the
getUserLock
response in the previous step
Click "Call Withdraw" and confirm the transaction in your wallet.
Step 4: Confirm the Transaction
After submitting, wait for the transaction to be confirmed on Gnosis Chain.
Once complete, your tokens should be available in your wallet.
Troubleshooting
Ensure you are connected to Gnosis Chain.
Use the same wallet that originally locked the tokens.
Make sure you have enough xDAI for gas fees.
If the transaction fails, double-check the token address and amount.
Additional Resources
GnosisScan: Check your transaction status
MetaMask Guide: Connecting to Gnosis Chain
By following this guide, you will successfully unstake your tokens from the TokenLocking contract. π