Skip to content

ERC20RewardDistributor

ERC20RewardDistributor

ERC20RewardDistributorInitParams

struct ERC20RewardDistributorInitParams {
  contract IACL acl;
  contract IMetahub metahub;
}

constructor

constructor() public

Constructor that gets called for the implementation contract.

initialize

function initialize(struct ERC20RewardDistributor.ERC20RewardDistributorInitParams params) external

distributeExternalReward

function distributeExternalReward(uint256 agreementId, address token, uint256 rewardAmount) external returns (struct Accounts.RentalEarnings rentalExternalRewardEarnings)

Executes a single distribution of external ERC20 reward.

Before calling this function, an ERC20 increase allowance should be given for the `tokenAmount` of `token` by caller for Metahub.

Name Type Description
agreementId uint256 The ID of related to the distribution Rental Agreement.
token address Represents the ERC20 token that is being distributed.
rewardAmount uint256 Represents the `token` amount to be distributed as a reward.
Name Type Description
rentalExternalRewardEarnings struct Accounts.RentalEarnings Represents external reward based earnings for all entities.

contractKey

function contractKey() external pure returns (bytes4)

Returns implemented contract key.

Name Type Description
[0] bytes4 Contract key;

supportsInterface

function supportsInterface(bytes4 interfaceId) public view returns (bool)

_Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.

This function call must use less than 30 000 gas._

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

_Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by {upgradeTo} and {upgradeToAndCall}.

Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.

```solidity function authorizeUpgrade(address) internal override onlyOwner {} ```

_acl

function _acl() internal view returns (contract IACL)

return the IACL address