Search…
Unstaking from the Beta Rewards Contract
Unstaking from the StandardRewards contract requires the user to indicate the program ID and the token amount. Follow these steps to collect this data before trying to leave and collect the bnTokens back to your wallet. Once the bnTokens are back in your wallet, you can reclaim your deposit by following the instructions in the Withdraw Tokens guide.

1. Program ID

This step will explain how to identify the ID of the rewards program you are staked in
  • Visit StandardRewards contract on etherscan
  • Execute the providerProgramIds function (this is a Read function)
Input variable
Name
Type
Description
_provider
address
User wallet address
Output response
List of 1+ IDs to represent the different programs you are staked in
Save the IDs that are returned for use in later steps.

2. Identify which ID to use

If you only have 1 ID (extracted in step 1), skip to step 3.
If you are actively staked in more than 1 program, this step will explain how to identify the program ID for the rewards program you would like to unstake from
  • Visit StandardRewards contract on etherscan
  • Execute the programs function (this is a Read function)
Input variable
Name
Type
Description
ids
uint256
An array of 1 or more reward program IDs
Output response
Name
Type
Description
id
uint256
The unique identifier of the rewards program
pool
Token
The deposited token (i.e BNT, ETH, DAI, LINK) address
poolToken
IPoolToken
The relevant bnToken address
rewardsToken
Token
The address of the rewards token that is given in this program
isEnabled
bool
True/False indication if the program is active
startTime
uint32
The start time of the program
endTime
uint32
The end time of the program
rewardRate
uint256
The amount of tokens per second that are distributed
Using the output data,
  1. 1.
    Identify the program with the pool token you would like to withdrawal
  2. 2.
    Identify the program id to use in the following step

3. Available amount

This step will explain how to identify the amount of available tokens to unstake from the contract
  • Visit StandardRewards contract on etherscan
  • Execute the providerStake function (this is a Read function)
Input variable
Name
Type
Description
provider
address
Your wallet address
id
uint256
The unique identifier of the rewards program
Output response
Name
Type
Description
Amount
uint256
The bnToken amount staked into the rewards program
Note the number returned by the function - this is the number of pool tokens you own, which you will need to input during the unstaking process. Note that this value is already returned in wei format, so you will not need to add zeroes to it when unstaking

4. Unstaking from StandardRewards

This step will explain how to complete the unstaking process and leave the rewards program
  • Visit StandardRewards contract on etherscan
  • Execute the leave function (this is a Write function)
Input variable
Name
Type
Description
id
uint256
The unique identifier of the rewards program (found in steps 1 and 2)
poolTokenAmount
uint256
The amount of bnTokens to unstake (found in step 3)
Output
You will receive the bnToken amount to your wallet
Now that the bnTokens are in your wallet, you can follow the Withdraw Tokens guide