RewardDistributor.sol
Implementation of the {IRewardDistributor} interface.
This contract has the simple logic to distribute ERC20 tokens to the desired address (e.g. SpoolStaking). It can be called from the whitelisted addresses to pay the rewards. Reward tokens should be sent to this contract in advance. The contract is pausable by the Spool DAO or the pauser.
function isDistributor(address) external view returns (bool)
Is the address reward distributor
e.g. Spool staking contract
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function isPauser(address) external view returns (bool)
Can the address pause the contract
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function pause() external nonpayable
Stops the controller.
Requirements: - the caller must be the pauser or the contract owner (Spool DAO)
function paused() external view returns (bool)
Returns true if the contract is paused, and false otherwise.
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function payReward(address account, contract IERC20 token, uint256 amount) external nonpayable
Pay ERC20 token reward to
account
Requirements: - the caller must be the distributor
Name | Type | Description |
---|---|---|
account | address | address to retrieve the token to |
token | contract IERC20 | ERC20 token to send |
amount | uint256 | amount of reward to send |
function payRewards(address account, contract IERC20[] tokens, uint256[] amounts) external nonpayable
Pay ERC20 token rewards to
account
Requirements: - the caller must be the distributor
Name | Type | Description |
---|---|---|
account | address | address to retrieve the token to |
tokens | contract IERC20[] | ERC20 tokens to send |
amounts | uint256[] | amount of rewards to send |
function retrieveRewards(address account, contract IERC20 token, uint256 amount) external nonpayable
Retrieve the reward tokens from this contract
Requirements: - the caller must be the contract owner (Spool DAO)
Name | Type | Description |
---|---|---|
account | address | address to retrieve the token to |
token | contract IERC20 | ERC20 token to retrieve |
amount | uint256 | amount to retrieve |
function setDistributor(address account, bool _set) external nonpayable
Add or remove the reward distributer
Requirements: - the caller must be the contract owner (Spool DAO)
Name | Type | Description |
---|---|---|
account | address | address to manage the distributer role for |
_set | bool | true to set the role, flase to remove |
function setPauser(address account, bool _set) external nonpayable
Add or remove the pauser role
Requirements: - the caller must be the contract owner (Spool DAO)
Name | Type | Description |
---|---|---|
account | address | address to manage the pauser role for |
_set | bool | true to set the role, flase to remove |
function unpause() external nonpayable
Resumes the reward distribution.
Requirements: - the caller must be the contract owner (Spool DAO)
event DistributorUpdated(address indexed user, bool set)
Name | Type | Description |
---|---|---|
user indexed | address | undefined |
set | bool | undefined |
event Paused(address account)
Name | Type | Description |
---|---|---|
account | address | undefined |
event PauserUpdated(address indexed user, bool set)
Name | Type | Description |
---|---|---|
user indexed | address | undefined |
set | bool | undefined |
event RewardPaid(contract IERC20 token, address indexed account, uint256 amount)
Name | Type | Description |
---|---|---|
token | contract IERC20 | undefined |
account indexed | address | undefined |
amount | uint256 | undefined |
event RewardRetrieved(contract IERC20 token, address indexed account, uint256 amount)
Name | Type | Description |
---|---|---|
token | contract IERC20 | undefined |
account indexed | address | undefined |
amount | uint256 | undefined |
event Unpaused(address account)
Name | Type | Description |
---|---|---|
account | address | undefined |
Last modified 10mo ago