Every app receives the B3TR from weekly allocation rounds in a contract called X2EarnRewardsPool.
Instead of withdrawing and transferring B3TR tokens to your users, you should distribute the rewards directly from that contract. By doing such you will:
Allow VeBetterDAO and the community to track your reward distribution
Attach proofs and impacts to each reward distribution
Increase the identity score of your users allowing them to participate in governance voting
There are 3 functions available in the X2EarnRewardsPool contract that will allow you to distribute the rewards:
1) appId is the ID of your app that you can find on your VeBetterDAO App page;
2) amount is the quantity of B3TR to transfer
3) The receiver is the address to who you want to transfer B3TR
4) The last parameter should be an empty string
How to implement the distribution method
If you are currently sending tokens with a normal transfer then the following guides should help you to start using the X2EarnRewardsPool contract.
Upgrade Smart Contract
Import the IX2EarnRewardsPoolinterface in your smart contract, and call the X2EarnRewardsPool contract to distribute the rewards instead of the B3TR token contract.
In solidity, a normal token transfer looks like this:
IERC20 token =IERC20(rewardToken);require( token.transfer(receiver, rewardAmount),"Reward transfer failed");
To use the VeBetterDAO contract you should replace that with the following:
IX2EarnRewardsPool x2EarnRewardsPool =IX2EarnRewardsPool(rewardsPoolAddress);// If distributeReward fails, it will revertx2EarnRewardsPool.distributeReward( APP_ID,// get it from the VeBetterDAO dApp rewardAmount, receiver,"",);
Look at the integration guide to see what your final contract should look like.
Upgrade Backend
If you were distributing rewards through a backend script by calling the transfer method on the B3TR contract, it should look like this:
You are now required to provide proof of the sustainable action the user performed to receive the reward. You can still set the proof to "" and not provide it but this will have a bad impact on your reputation and could lead to the expulsion from VeBetterDAO.
Read more about the proof standard and how we expect you to provide it in the Sustainability Proofs section.