IFlowERC20V3
Mints itself according to some predefined schedule. The schedule is
expressed as an expression and the claim
function is world-callable.
Intended behaviour is to avoid sybils infinitely minting by putting the
claim functionality behind a TierV2
contract. The flow contract
itself implements ReadOnlyTier
and every time a claim is processed it
logs the block number of the claim against every tier claimed. So the block
numbers in the tier report for FlowERC20
are the last time that tier
was claimed against this contract. The simplest way to make use of this
information is to take the max block for the underlying tier and the last
claim and then diff it against the current block number.
See test/Claim/FlowERC20.sol.ts
for examples, including providing
staggered rewards where more tokens are minted for higher tier accounts.
Functions
previewFlow
As per IFlowV3
but returns a FlowERC20IOV1
instead of a
FlowTransferV1
.
function previewFlow(
Evaluable calldata evaluable,
uint256[] calldata callerContext,
SignedContextV1[] calldata signedContexts
) external view returns (FlowERC20IOV1 calldata flowERC20IO);
Parameters
Name | Type | Description |
---|---|---|
evaluable | Evaluable | The Evaluable to use to evaluate the flow. |
callerContext | uint256[] | The caller context to use to evaluate the flow. |
signedContexts | SignedContextV1[] | The signed contexts to use to evaluate the flow. |
Returns
Name | Type | Description |
---|---|---|
flowERC20IO | FlowERC20IOV1 | The FlowERC20IOV1 that occurred. |
flow
As per IFlowV3
but returns a FlowERC20IOV1
instead of a
FlowTransferV1
and mints/burns itself as an ERC20 accordingly.
function flow(Evaluable calldata evaluable, uint256[] calldata callerContext, SignedContextV1[] calldata signedContexts)
external
returns (FlowERC20IOV1 calldata flowERC20IO);
Parameters
Name | Type | Description |
---|---|---|
evaluable | Evaluable | The Evaluable to use to evaluate the flow. |
callerContext | uint256[] | The caller context to use to evaluate the flow. |
signedContexts | SignedContextV1[] | The signed contexts to use to evaluate the flow. |
Returns
Name | Type | Description |
---|---|---|
flowERC20IO | FlowERC20IOV1 | The FlowERC20IOV1 that occurred. |
Events
Initialize
Contract has initialized.
event Initialize(address sender, FlowERC20Config config);
Parameters
Name | Type | Description |
---|---|---|
sender | address | msg.sender initializing the contract (factory). |
config | FlowERC20Config | All initialized config. |