ClaimPlugin
Inherits: UUPSUpgradeable, OwnableUpgradeable, ERC165Upgradeable, Claimable
Author: Mure Implements UUPSUpgradeable for upgradeability, OwnableUpgradeable for access control, ERC165Upgradeable for interface support, and Claimable interface for compatibility checks. Facilitates the calculation and execution of reward claims, allowing depositors to receive their entitled rewards along with their shares from the total collected pool funds.
Contract managing reward distribution to users of an application.
Functions
initialize
function initialize(address owner) external initializer;
claim
Sends reward funds from the delegate to depositor.
function claim(ClaimRecord calldata claimRecord) external returns (uint256 depositDelta, uint256 claimDelta);
Parameters
Name | Type | Description |
---|---|---|
claimRecord | ClaimRecord | struct containing all information needed to compute and execute a claimRecord. See Claimable.ClaimRecord for more information |
deltas
Returns the refund amount, claim amount and fee.
function deltas(ClaimRecord calldata claimRecord)
public
pure
returns (uint256 depositDelta, uint256 claimDelta, uint256 fee);
Parameters
Name | Type | Description |
---|---|---|
claimRecord | ClaimRecord | struct containing all information needed to compute and execute a claimRecord. See Claimable.ClaimRecord for more information |
Returns
Name | Type | Description |
---|---|---|
depositDelta | uint256 | amount from the original deposit to be refunded |
claimDelta | uint256 | amount from the claim reserves to be claimed |
fee | uint256 | fee to be charged from claimDelta |
_calculateShare
Calculates the user share amount.
function _calculateShare(uint256 share, uint256 supply, uint256 reserve) private pure returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
share | uint256 | share of the user |
supply | uint256 | total supply |
reserve | uint256 | current reserve |
calculateFee
Calculates the fee to be charged.
function calculateFee(uint256 amount, uint256 feePercentage) private pure returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | total amount |
feePercentage | uint256 | fee percentage in basis points |
supportsInterface
See IERC165-supportsInterface.
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165Upgradeable, IERC165)
returns (bool);
_authorizeUpgrade
required by the OZ UUPS module
function _authorizeUpgrade(address) internal override onlyOwner;