Rewards payout

Unicly

Unicly uses Gelato Ops for daily rewards generation for stakers.
Gelato calls this addRewards in their staking contract recurringly once everyday.
1
function addRewards(address rewardToken, uint256 amount) override external poolExists(rewardToken) {
2
require(amount > 0, "UnicStaking: Amount must be greater than zero");
3
IERC20Upgradeable(rewardToken).safeTransferFrom(msg.sender, address(this), amount);
4
RewardPool storage pool = pools[rewardToken];
5
pool.totalRewardAmount = pool.totalRewardAmount.add(amount);
6
emit AddRewards(rewardToken, amount);
7
}
Copied!
Since the condition to call this function is time-dependent, writing a resolver is not required.
You can create a task through the Gelato Ops UI directly.
On the task creation page, select the Time option for "When" and input your desired interval between executions.
Last modified 14d ago
Copy link