Unlocker
ITokenTableUnlockerV2
The lightweight interface for TokenTableUnlockerV2(.5.x), which handles token unlocking and distribution for TokenTable.
PresetCreated
ActualCreated
ActualCancelled
TokensClaimed
TokensWithdrawn
ClaimingDelegateSet
CreateDisabled
CancelDisabled
HookDisabled
WithdrawDisabled
InvalidPresetFormat
0x0ef8e8dc
PresetExists
0x7cbb15b4
PresetDoesNotExist
0xbd88ff7b
ActualDoesNotExist
0x06aed316
InvalidSkipAmount
0x78c0fc43
NotPermissioned
0x7f63bd0f
initialize
This contract should be deployed with TTUDeployerLite
, which calls this function with the correct parameters.
Parameters
projectToken
address
The address of the token that the founder intends to unlock and distribute.
futureToken_
address
The address of the associated FutureToken.
deployer_
address
The address of the deployer. It helps call the fee collector during claim.
isCancelable_
bool
If the founder is allowed to cancel schedules. Can be disabled later, but cannot be enabled again.
isHookable_
bool
If the founder is allowed to attach external hooks to function calls. Can be disabled later, but cannot be enabled again.
isWithdrawable_
bool
If the founder is allowed to withdraw deposited tokens. Can be disabled later, but cannot be enabled again.
createPresets
Creates an unlocking schedule preset template.
Emits PresetCreated
. Only callable by the owner.
Parameters
presetIds
bytes32[]
These IDs can be the hashes of a plaintext preset names but really there is no restriction. Will revert if they already exist.
presets
struct Preset[]
An array of Preset
structs.
batchId
uint256
Emitted as an event reserved for EthSign frontend use. This parameter has no effect on contract execution.
extraData
bytes
An ERC-5750 parameter that's passed to the hook directly.
createActuals
Creates an actual unlocking schedule based on a preset.
Emits ActualCreated
. A FutureToken is minted in the process with tokenId == actualId
.
Parameters
recipients
address[]
An array of token recipients for the schedules. Note that claiming eligibility can be modified by transfering the corresponding FutureToken.
actuals
struct Actual[]
An array of Actual
structs.
recipientIds
uint256[]
Emitted as an event reserved for EthSign frontend use. This parameter has no effect on contract execution.
batchId
uint256
Emitted as an event reserved for EthSign frontend use. This parameter has no effect on contract execution.
extraData
bytes
An ERC-5750 parameter that's passed to the hook directly.
withdrawDeposit
Withdraws existing deposit from the contract.
Emits TokensWithdrawn
. Only callable by the owner.
Parameters
amount
uint256
Amount of deposited funds the founder wishes to withdraw.
extraData
bytes
An ERC-5750 parameter that's passed to the hook directly.
claim
Claims claimable tokens for the specified schedules to the specified addresses respectively.
Emits TokensClaimed
. Only callable by the FutureToken owner.
Parameters
actualIds
uint256[]
The IDs of the unlocking schedules that we are trying to claim from.
claimTos
address[]
If we want to send the claimed tokens to an address other than the caller. To send the claimed tokens to the caller (default behavior), pass in ethers.constants.AddressZero
.
batchId
uint256
Emitted as an event reserved for EthSign frontend use. This parameter has no effect on contract execution.
extraData
bytes
An ERC-5750 parameter that's passed to the hook directly.
delegateClaim
Claims claimable tokens for the specified schedules on behalf of recipients. Claimed tokens are sent to the schedule recipients.
Emits TokensClaimed
. Only callable by the claiming delegate.
Parameters
actualIds
uint256[]
The IDs of the unlocking schedules that we are trying to claim from on behalf of the recipients.
batchId
uint256
Emitted as an event reserved for EthSign frontend use. This parameter has no effect on contract execution.
extraData
bytes
An ERC-5750 parameter that's passed to the hook directly.
cancel
Cancels an array of unlocking schedules effective immediately. Tokens not yet claimed but are already unlocked will be tallied.
Emits ActualCancelled
. Only callable by the owner.
Parameters
actualIds
uint256[]
The ID of the actual unlocking schedule that we want to cancel.
shouldWipeClaimableBalance
bool[]
If the unlocked and claimable balance of the canceled schedule should be wiped. This is usually used to delete an erroneously created schedule that has already started unlocking.
batchId
uint256
Emitted as an event reserved for EthSign frontend use. This parameter has no effect on contract execution.
extraData
bytes
An ERC-5750 parameter that's passed to the hook directly.
Return Values
pendingAmountClaimables
uint256[]
Number of tokens eligible to be claimed by the affected stakeholders at the moment of cancellation.
setHook
Sets the hook contract.
Only callable by the owner.
Parameters
hook
contract ITTHook
The address of the ITTHook
hook contract.
setClaimingDelegate
Sets the claiming delegate who can trigger claims on behalf of recipients.
Only callable by the owner.
Parameters
delegate
address
The claiming delegate we wish to set.
status
bool
Whether the delegate is added(true) or revoked(false).
disableCreate
Permanently disables the createActuals()
function.
Only callable by the owner.
disableCancel
Permanently disables the cancel()
function.
Only callable by the owner.
disableHook
Permanently disables the hook.
Only callable by the owner.
disableWithdraw
Permanently prevents the founder from withdrawing deposits.
Only callable by the owner.
deployer
Return Values
[0]
contract ITTUDeployer
The deployer instance associated with this Unlocker.
futureToken
Return Values
[0]
contract ITTFutureTokenV2
The FutureToken instance associated with this Unlocker.
hook
Return Values
[0]
contract ITTHook
The external hook associated with this Unlocker.
claimingDelegates
Return Values
[0]
address[]
Returns the array of claiming delegates who can trigger claims on behalf of schedule recipients.
isCreateable
Return Values
[0]
bool
If the founder is allowed to create new schedules.
isCancelable
Return Values
[0]
bool
If the founder is allowed to cancel schedules.
isHookable
Return Values
[0]
bool
If the founder can attach external hooks to function calls.
isWithdrawable
Return Values
[0]
bool
If the founder can withdraw deposited but unclaimed tokens.
pendingAmountClaimableForCancelledActuals
Parameters
actualId
uint256
The canceled schedule ID.
Return Values
[0]
uint256
The amount of tokens from canceled schedules that have been unlocked but unclaimed by the stakeholder.
getEncodedPreset
To decode in JS, use:
Parameters
presetId
bytes32
The ID of the preset we are trying to read.
Return Values
[0]
bytes
An ABI-encoded Preset
, as nested objects cannot be returned directly in Solidity.
actuals
Returns the Actual struct based on the input ID.
BIPS_PRECISION
Return Values
[0]
uint256
The basis point precision of this Unlocker.
calculateAmountClaimable
Calculates the amount of unlocked tokens that have yet to be claimed in an actual unlocking schedule.
This is the most complex part of the smart contract. Quite a bit of calculations are performed here.
Parameters
actualId
uint256
The ID of the actual unlocking schedule that we are working with.
Return Values
deltaAmountClaimable
uint256
Amount of tokens claimable right now.
updatedAmountClaimed
uint256
New total amount of tokens claimed. This is the sum of all previously claimed tokens and deltaAmountClaimable
.
simulateAmountClaimable
Simulates the amount of unlocked tokens that have yet to be claimed at a specific time in an actual unlocking schedule.
This is the most complex part of the smart contract. Quite a bit of calculations are performed here.
Parameters
actualId
uint256
The ID of the actual unlocking schedule that we are working with.
claimTimestampAbsolute
uint256
The simulated time of claim.
Return Values
deltaAmountClaimable
uint256
Amount of tokens claimable right now.
updatedAmountClaimed
uint256
New total amount of tokens claimed. This is the sum of all previously claimed tokens and deltaAmountClaimable
.
Last updated