Gelato Network

Rewards Payout


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