Skip to content

ClaimSetupManager#

Source | Inherits from IIClaimSetupManager, Governed, AddressUpdatable, CloneFactory, ReentrancyGuard

Manages automation of operations related to reward claiming.

Rewards include FTSO rewards and airdrops. Managed operations include Automatic Claiming and Personal Delegation Accounts.

Functions#

accountToDelegationAccount#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

function allowedClaimRecipients(
    address _owner
) 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
_owner address
Returns Type Description
[0] address[] Addresses of all set authorized recipients.

batchDelegate#

Defined in ClaimSetupManager (Docs, Source).

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.

cancelGovernanceCall#

Defined in GovernedBase (Docs, Source).

function cancelGovernanceCall(
    bytes4 _selector
) external;

Cancel a timelocked governance call before it has been executed.

Only governance can call this method.

Parameters Type Description
_selector bytes4 The method selector.

checkExecutorAndAllowedRecipient#

Defined in ClaimSetupManager (Docs, Source).

function checkExecutorAndAllowedRecipient(
    address _executor,
    address _claimFor,
    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.
_claimFor address
_recipient address The address where the reward would be sent.

claimExecutors#

Defined in ClaimSetupManager (Docs, Source).

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.

constructor#

Defined in ClaimSetupManager (Docs, Source).

constructor(
    address _governance,
    address _addressUpdater,
    uint256 _feeValueUpdateOffset,
    uint256 _minFeeValueWei,
    uint256 _maxFeeValueWei,
    uint256 _registerExecutorFeeValueWei
) public;

constructor#

Defined in Governed (Docs, Source).

constructor(
    address _governance
) public;
Parameters Type Description
_governance address Governance contract. Must not be zero.

delegate#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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.

executeGovernanceCall#

Defined in GovernedBase (Docs, Source).

function executeGovernanceCall(
    bytes4 _selector
) external;

Execute the timelocked governance calls once the timelock period expires.

Only executor can call this method.

Parameters Type Description
_selector bytes4 The method selector (only one timelocked call per method is stored).

getAddressUpdater#

Defined in AddressUpdatable (Docs, Source).

function getAddressUpdater(
) public view returns (
    address _addressUpdater);

Returns the configured address updater.

Returns Type Description
_addressUpdater address The AddresUpdater contract that can update our contract address list, as a response to a governance call.

getAutoClaimAddressesAndExecutorFee#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

function getExecutorCurrentFeeValue(
    address _executor
) public 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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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.

governance#

Defined in GovernedBase (Docs, Source).

function governance(
) public view returns (
    address);

Returns the current effective governance address.

isClaimExecutor#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

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#

Defined in ClaimSetupManager (Docs, Source).

function setLibraryAddress(
    address _libraryAddress
) external;

Sets new library address.

Only governance can call this.

setMaxFeeValueWei#

Defined in ClaimSetupManager (Docs, Source).

function setMaxFeeValueWei(
    uint256 _maxFeeValueWei
) external;

Sets maximum fee allowed for executors, in wei.

Only governance can call this.

setMinFeeValueWei#

Defined in ClaimSetupManager (Docs, Source).

function setMinFeeValueWei(
    uint256 _minFeeValueWei
) external;

Sets minimum fee allowed for executors, in wei.

Only governance can call this.

setRegisterExecutorFeeValueWei#

Defined in ClaimSetupManager (Docs, Source).

function setRegisterExecutorFeeValueWei(
    uint256 _registerExecutorFeeValueWei
) external;

Sets the fee required to register an executor, which must be higher than 0.

Only governance can call this.

switchToProductionMode#

Defined in GovernedBase (Docs, Source).

function switchToProductionMode(
) external;

Enter the production mode after all the initial governance settings have been set. This enables timelocks and the governance can be obtained afterward by calling governanceSettings.getGovernanceAddress(). Emits GovernedProductionModeEntered.

transferExternalToken#

Defined in ClaimSetupManager (Docs, Source).

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.

undelegateAll#

Defined in ClaimSetupManager (Docs, Source).

function undelegateAll(
) external;

Removes all delegations from the caller's PDA.

undelegateGovernance#

Defined in ClaimSetupManager (Docs, Source).

function undelegateGovernance(
) external;

Undelegates all governance vote power currently delegated by the caller's PDA.

unregisterExecutor#

Defined in ClaimSetupManager (Docs, Source).

function unregisterExecutor(
) external returns (
    uint256 _validFromEpoch);

Unregisters the caller as an executor.

Returns Type Description
_validFromEpoch uint256 Reward epoch ID when the change becomes effective.

updateContractAddresses#

Defined in AddressUpdatable (Docs, Source).

function updateContractAddresses(
    bytes32[] _contractNameHashes,
    address[] _contractAddresses
) external;

External method called from AddressUpdater only.

updateExecutorFeeValue#

Defined in ClaimSetupManager (Docs, Source).

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.

wNat#

Defined in IIClaimSetupManager (Docs, Source).

function wNat(
) external view returns (
    contract WNat);

Returns the WNat contract.

withdraw#

Defined in ClaimSetupManager (Docs, Source).

function withdraw(
    uint256 _amount
) external;

Allows the caller to transfer WNat wrapped tokens from their PDA to the owner account.

Parameters Type Description
_amount uint256 Amount of tokens to transfer, in wei.

Modifiers#

nonReentrant#

Defined in ReentrancyGuard (Source).

modifier nonReentrant()

Prevents a contract from calling itself, directly or indirectly. Calling a nonReentrant function from another nonReentrant function is not supported. It is possible to prevent this from happening by making the nonReentrant function external, and make it call a private function that does the actual work.

onlyAddressUpdater#

Defined in AddressUpdatable (Docs, Source).

modifier onlyAddressUpdater()

Only the AdressUpdater contract can call this method. Its address is set at construction time but it can also update itself.

onlyGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyGovernance()

onlyImmediateGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyImmediateGovernance()

onlyOwnerOrExecutor#

Defined in ClaimSetupManager (Docs, Source).

modifier onlyOwnerOrExecutor(    address _executor,
    address[] _owners)

Structures#

DelegationAccountData#

Defined in ClaimSetupManager (Docs, Source).

struct DelegationAccountData {
  contract IIDelegationAccount delegationAccount;
  bool enabled;
}

ExecutorFee#

Defined in ClaimSetupManager (Docs, Source).

struct ExecutorFee {
  uint256 value;
  uint256 validFromEpoch;
}

TimelockedCall#

Defined in GovernedBase (Docs, Source).

struct TimelockedCall {
  uint256 allowedAfterTimestamp;
  bytes encodedCall;
}

Variables#

feeValueUpdateOffset#

Defined in ClaimSetupManager (Docs, Source).

    uint256 feeValueUpdateOffset

Number of reward epochs that must elapse before an executor's fee change takes effect.

ftsoManager#

Defined in ClaimSetupManager (Docs, Source).

    contract IFtsoManager ftsoManager

The FtsoManager contract.

governanceSettings#

Defined in GovernedBase (Docs, Source).

    contract IGovernanceSettings governanceSettings

Governance Settings.

governanceVP#

Defined in ClaimSetupManager (Docs, Source).

    contract IGovernanceVotePower governanceVP

The GovernanceVotePower contract.

libraryAddress#

Defined in ClaimSetupManager (Docs, Source).

    address libraryAddress

maxFeeValueWei#

Defined in ClaimSetupManager (Docs, Source).

    uint256 maxFeeValueWei

Maximum allowed value for an executor's fee.

minFeeValueWei#

Defined in ClaimSetupManager (Docs, Source).

    uint256 minFeeValueWei

Minimum allowed value for an executor's fee.

productionMode#

Defined in GovernedBase (Docs, Source).

    bool productionMode

When true, governance is enabled and cannot be disabled. See switchToProductionMode.

registerExecutorFeeValueWei#

Defined in ClaimSetupManager (Docs, Source).

    uint256 registerExecutorFeeValueWei

Fee that must be paid to register an executor.

timelockedCalls#

Defined in GovernedBase (Docs, Source).

    mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls

List of pending timelocked governance calls.

wNat#

Defined in ClaimSetupManager (Docs, Source).

    contract WNat wNat

The WNat contract.