IIClaimSetupManager
#
Source | Inherits from IClaimSetupManager
Internal interface for the ClaimSetupManager
contract.
Events#
AllowedClaimRecipientsChanged
#
event AllowedClaimRecipientsChanged(
address owner,
address[] recipients
)
ClaimExecutorFeeValueChanged
#
event ClaimExecutorFeeValueChanged(
address executor,
uint256 validFromRewardEpoch,
uint256 feeValueWei
)
ClaimExecutorsChanged
#
event ClaimExecutorsChanged(
address owner,
address[] executors
)
DelegationAccountCreated
#
event DelegationAccountCreated(
address owner,
contract IDelegationAccount delegationAccount
)
DelegationAccountUpdated
#
event DelegationAccountUpdated(
address owner,
contract IDelegationAccount delegationAccount,
bool enabled
)
ExecutorRegistered
#
event ExecutorRegistered(
address executor
)
ExecutorUnregistered
#
event ExecutorUnregistered(
address executor,
uint256 validFromRewardEpoch
)
RegisterExecutorFeeSet
#
event RegisterExecutorFeeSet(
uint256 registerExecutorFeeValueWei
)
SetExecutorsExcessAmountRefunded
#
event SetExecutorsExcessAmountRefunded(
address owner,
uint256 excessAmount
)
Functions#
accountToDelegationAccount
#
function accountToDelegationAccount(
address _owner
) external view returns (
address);
Gets the PDA of an account.
Parameters | Type | Description |
---|---|---|
_owner |
address |
Account to query. |
Returns | Type | Description |
---|---|---|
[0] | address |
Address of its PDA or address(0) if it has not been created yet. |
allowedClaimRecipients
#
function allowedClaimRecipients(
address _rewardOwner
) external view returns (
address[]);
Gets the addresses of recipients allowed to receive rewards on behalf of an account.
Beside these, the owner of the rewards is always authorized.
See setAllowedClaimRecipients
.
Parameters | Type | Description |
---|---|---|
_rewardOwner |
address |
The account to query. |
Returns | Type | Description |
---|---|---|
[0] | address[] |
Addresses of all set authorized recipients. |
batchDelegate
#
function batchDelegate(
address[] _delegatees,
uint256[] _bips
) external;
Undelegates all percentage delegations from the caller's
PDA and then delegate
to a list of accounts.
See delegate
.
Parameters | Type | Description |
---|---|---|
_delegatees |
address[] |
The addresses of the new recipients. |
_bips |
uint256[] |
The percentage of voting power to be delegated to each delegatee, expressed in basis points (1/100 of one percent). Total of all _bips values must be lower than 10000. |
checkExecutorAndAllowedRecipient
#
function checkExecutorAndAllowedRecipient(
address _executor,
address _owner,
address _recipient
) external view;
Checks if an executor can claim on behalf of a given account and send funds to a given recipient address.
Reverts if claiming is not possible, does nothing otherwise.
Parameters | Type | Description |
---|---|---|
_executor |
address |
The executor to query. |
_owner |
address |
The reward owner to query. |
_recipient |
address |
The address where the reward would be sent. |
claimExecutors
#
function claimExecutors(
address _owner
) external view returns (
address[]);
Gets the addresses of executors authorized to claim for an account.
See setClaimExecutors
.
Parameters | Type | Description |
---|---|---|
_owner |
address |
The account to query. |
Returns | Type | Description |
---|---|---|
[0] | address[] |
Addresses of all set executors. |
delegate
#
function delegate(
address _to,
uint256 _bips
) external;
Delegates a percentage of the caller's PDA's voting power to another address.
Parameters | Type | Description |
---|---|---|
_to |
address |
The address of the recipient. |
_bips |
uint256 |
The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: Every call resets the delegation value. A value of 0 revokes delegation. |
delegateGovernance
#
function delegateGovernance(
address _to
) external;
Delegates all the governance vote power of the caller's PDA to another account.
Parameters | Type | Description |
---|---|---|
_to |
address |
Address of the recipient of the delegation. |
disableDelegationAccount
#
function disableDelegationAccount(
) external;
Disables the Personal Delegation Account (PDA).
When using automatic claiming, all airdrops and FTSO rewards will be sent to the owner's account. Rewards accrued by the PDA will no longer be automatically claimed.
Reverts if there is no PDA.
enableDelegationAccount
#
function enableDelegationAccount(
) external returns (
contract IDelegationAccount);
Enables (or creates) a Personal Delegation Account (PDA).
When using automatic claiming, all airdrops and FTSO rewards will be sent to the PDA, and any rewards accrued by the PDA will be claimed too.
Returns | Type | Description |
---|---|---|
[0] | contract IDelegationAccount |
Address of the delegation account contract. |
getAutoClaimAddressesAndExecutorFee
#
function getAutoClaimAddressesAndExecutorFee(
address _executor,
address[] _owners
) external view returns (
address[] _recipients,
uint256 _executorFeeValue);
Gets the Personal Delegation Account (PDA) for a list of accounts for which an executor is claiming. Returns owner address instead if the PDA is not created yet or not enabled.
Parameters | Type | Description |
---|---|---|
_executor |
address |
Executor to query. |
_owners |
address[] |
Array of reward owners which must have set _executor as their executor. |
Returns | Type | Description |
---|---|---|
_recipients |
address[] |
Addresses which will receive the claimed rewards. Can be the reward owners or their PDAs. |
_executorFeeValue |
uint256 |
Executor's fee value, in wei. |
getDelegationAccountData
#
function getDelegationAccountData(
address _owner
) external view returns (
contract IDelegationAccount _delegationAccount,
bool _enabled);
Gets PDA data for an account.
Parameters | Type | Description |
---|---|---|
_owner |
address |
Account to query. |
Returns | Type | Description |
---|---|---|
_delegationAccount |
contract IDelegationAccount |
Account's PDA address or address(0) if it has not been created yet. |
_enabled |
bool |
Whether the PDA is enabled. |
getExecutorCurrentFeeValue
#
function getExecutorCurrentFeeValue(
address _executor
) external view returns (
uint256);
Returns the current fee of a registered executor. Reverts if the executor is not registered.
Parameters | Type | Description |
---|---|---|
_executor |
address |
The executor to query. |
Returns | Type | Description |
---|---|---|
[0] | uint256 |
Fee in wei. |
getExecutorFeeValue
#
function getExecutorFeeValue(
address _executor,
uint256 _rewardEpoch
) external view returns (
uint256);
Returns the fee of an executor at a given reward epoch.
Parameters | Type | Description |
---|---|---|
_executor |
address |
The executor to query. |
_rewardEpoch |
uint256 |
Reward Epoch ID to query. |
Returns | Type | Description |
---|---|---|
[0] | uint256 |
Fee in wei at that reward epoch. |
getExecutorInfo
#
function getExecutorInfo(
address _executor
) external view returns (
bool _registered,
uint256 _currentFeeValue);
Returns information about an executor.
Parameters | Type | Description |
---|---|---|
_executor |
address |
The executor to query. |
Returns | Type | Description |
---|---|---|
_registered |
bool |
Whether the executor is registered. |
_currentFeeValue |
uint256 |
Executor's current fee value, if registered. |
getExecutorScheduledFeeValueChanges
#
function getExecutorScheduledFeeValueChanges(
address _executor
) external view returns (
uint256[] _feeValue,
uint256[] _validFromEpoch,
bool[] _fixed);
Returns the currently scheduled fee changes of an executor.
Parameters | Type | Description |
---|---|---|
_executor |
address |
Executor to query. |
Returns | Type | Description |
---|---|---|
_feeValue |
uint256[] |
Array of scheduled fees. |
_validFromEpoch |
uint256[] |
Array of reward epochs ID where the scheduled fees will become effective. |
_fixed |
bool[] |
Array of booleans indicating if an scheduled fee change is fixed or it might still be changed. |
getRegisteredExecutors
#
function getRegisteredExecutors(
uint256 _start,
uint256 _end
) external view returns (
address[] _registeredExecutors,
uint256 _totalLength);
Returns the list of executors registered through registerExecutor
.
Supports paging.
Parameters | Type | Description |
---|---|---|
_start |
uint256 |
First executor to return. |
_end |
uint256 |
Last executor to return. |
Returns | Type | Description |
---|---|---|
_registeredExecutors |
address[] |
Addresses of the registered executors. |
_totalLength |
uint256 |
Total amount of executors. |
isClaimExecutor
#
function isClaimExecutor(
address _owner,
address _executor
) external view returns (
bool);
Returns whether an executor is authorized to claim on behalf of a reward owner.
See setClaimExecutors
.
Parameters | Type | Description |
---|---|---|
_owner |
address |
The reward owner to query. |
_executor |
address |
The executor to query. |
registerExecutor
#
function registerExecutor(
uint256 _feeValue
) external payable returns (
uint256);
Registers the caller as an executor and sets its initial fee value.
If the executor was already registered, this method only updates the fee, which will take effect after
feeValueUpdateOffset
reward epochs have elapsed.
Executor must pay a fee in order to register. See registerExecutorFeeValueWei
.
Parameters | Type | Description |
---|---|---|
_feeValue |
uint256 |
Desired fee, in wei. Must be between minFeeValueWei and maxFeeValueWei . 0 means no fee. |
Returns | Type | Description |
---|---|---|
[0] | uint256 |
Reward epoch ID when the changes become effective. |
revokeDelegationAt
#
function revokeDelegationAt(
address _who,
uint256 _blockNumber
) external;
Revokes all delegation from the caller's PDA to a given account at a given block.
Only affects the reads via votePowerOfAtCached()
in the specified block.
This method should be used only to prevent rogue delegate
voting in the current voting block.
To stop delegating use delegate
with percentage of 0 or undelegateAll
.
Parameters | Type | Description |
---|---|---|
_who |
address |
The account to revoke. |
_blockNumber |
uint256 |
Block number where the revoking will take place. Must be in the past. |
setAllowedClaimRecipients
#
function setAllowedClaimRecipients(
address[] _recipients
) external;
Set the addresses of allowed recipients. The reward owner is always an allowed recipient.
Parameters | Type | Description |
---|---|---|
_recipients |
address[] |
The new allowed recipients. All old recipients will be deleted and replaced by these. |
setAutoClaiming
#
function setAutoClaiming(
address[] _executors,
bool _enableDelegationAccount
) external payable;
Sets the addresses of executors and optionally enables (creates) a Personal Delegation Account (PDA).
If any of the executors is a registered executor, some fee needs to be paid.
Parameters | Type | Description |
---|---|---|
_executors |
address[] |
The new executors. All old executors will be deleted and replaced by these. |
_enableDelegationAccount |
bool |
Whether the PDA should be enabled. |
setClaimExecutors
#
function setClaimExecutors(
address[] _executors
) external payable;
Sets the addresses of executors.
If any of the executors is a registered executor, some fee needs to be paid.
Parameters | Type | Description |
---|---|---|
_executors |
address[] |
The new executors. All old executors will be deleted and replaced by these. |
setLibraryAddress
#
function setLibraryAddress(
address _libraryAddress
) external;
Sets new library address.
setMaxFeeValueWei
#
function setMaxFeeValueWei(
uint256 _maxFeeValueWei
) external;
Sets maximum fee allowed for executors, in wei.
setMinFeeValueWei
#
function setMinFeeValueWei(
uint256 _minFeeValueWei
) external;
Sets minimum fee allowed for executors, in wei.
setRegisterExecutorFeeValueWei
#
function setRegisterExecutorFeeValueWei(
uint256 _registerExecutorFeeValueWei
) external;
Sets the fee required to register an executor, which must be higher than 0.
transferExternalToken
#
function transferExternalToken(
contract IERC20 _token,
uint256 _amount
) external;
Allows the caller to transfer ERC-20 tokens from their PDA to the owner account.
The main use case is to move ERC-20 tokes received by mistake (by an airdrop, for example) out of the PDA and into the main account, where they can be more easily managed.
Reverts if the target token is the WNat
contract: use method withdraw
for that.
Parameters | Type | Description |
---|---|---|
_token |
contract IERC20 |
Target token contract address. |
_amount |
uint256 |
Amount of tokens to transfer. |
undelegateGovernance
#
function undelegateGovernance(
) external;
Undelegates all governance vote power currently delegated by the caller's PDA.
unregisterExecutor
#
function unregisterExecutor(
) external returns (
uint256);
Unregisters the caller as an executor.
Returns | Type | Description |
---|---|---|
[0] | uint256 |
Reward epoch ID when the change becomes effective. |
updateExecutorFeeValue
#
function updateExecutorFeeValue(
uint256 _feeValue
) external returns (
uint256);
Sets the caller's executor fee. The caller must be an executor registered through registerExecutor
.
When called multiple times inside the same reward epoch, only the last value remains.
Parameters | Type | Description |
---|---|---|
_feeValue |
uint256 |
Desired fee, in wei. Must be between minFeeValueWei and maxFeeValueWei . 0 means no fee. |
Returns | Type | Description |
---|---|---|
[0] | uint256 |
Reward epoch ID when the changes become effective. |