Unlocker

ITokenTableUnlockerV2

The lightweight interface for TokenTableUnlockerV2(.5.x), which handles token unlocking and distribution for TokenTable.

PresetCreated

event PresetCreated(bytes32 presetId, uint256 batchId)

ActualCreated

event ActualCreated(bytes32 presetId, uint256 actualId, address recipient, uint256 recipientId, uint256 batchId)

ActualCancelled

event ActualCancelled(uint256 actualId, uint256 pendingAmountClaimable, bool didWipeClaimableBalance, uint256 batchId)

TokensClaimed

event TokensClaimed(uint256 actualId, address caller, address to, uint256 amount, uint256 feesCharged, uint256 batchId)

TokensWithdrawn

event TokensWithdrawn(address by, uint256 amount)

ClaimingDelegateSet

event ClaimingDelegateSet(address delegate, bool status)

CreateDisabled

event CreateDisabled()

CancelDisabled

event CancelDisabled()

HookDisabled

event HookDisabled()

WithdrawDisabled

event WithdrawDisabled()

InvalidPresetFormat

error InvalidPresetFormat()

0x0ef8e8dc

PresetExists

error PresetExists()

0x7cbb15b4

PresetDoesNotExist

error PresetDoesNotExist()

0xbd88ff7b

ActualDoesNotExist

error ActualDoesNotExist()

0x06aed316

InvalidSkipAmount

error InvalidSkipAmount()

0x78c0fc43

NotPermissioned

error NotPermissioned()

0x7f63bd0f

initialize

function initialize(address projectToken, address futureToken_, address deployer_, bool isCancelable_, bool isHookable_, bool isWithdrawable_) external virtual

This contract should be deployed with TTUDeployerLite, which calls this function with the correct parameters.

Parameters

createPresets

function createPresets(bytes32[] presetIds, struct Preset[] presets, uint256 batchId, bytes extraData) external virtual

Creates an unlocking schedule preset template.

Emits PresetCreated. Only callable by the owner.

Parameters

createActuals

function createActuals(address[] recipients, struct Actual[] actuals, uint256[] recipientIds, uint256 batchId, bytes extraData) external virtual

Creates an actual unlocking schedule based on a preset.

Emits ActualCreated. A FutureToken is minted in the process with tokenId == actualId.

Parameters

withdrawDeposit

function withdrawDeposit(uint256 amount, bytes extraData) external virtual

Withdraws existing deposit from the contract.

Emits TokensWithdrawn. Only callable by the owner.

Parameters

claim

function claim(uint256[] actualIds, address[] claimTos, uint256 batchId, bytes extraData) external virtual

Claims claimable tokens for the specified schedules to the specified addresses respectively.

Emits TokensClaimed. Only callable by the FutureToken owner.

Parameters

delegateClaim

function delegateClaim(uint256[] actualIds, uint256 batchId, bytes extraData) external virtual

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

cancel

function cancel(uint256[] actualIds, bool[] shouldWipeClaimableBalance, uint256 batchId, bytes extraData) external virtual returns (uint256[] pendingAmountClaimables)

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

Return Values

setHook

function setHook(contract ITTHook hook) external virtual

Sets the hook contract.

Only callable by the owner.

Parameters

setClaimingDelegate

function setClaimingDelegate(address delegate, bool status) external virtual

Sets the claiming delegate who can trigger claims on behalf of recipients.

Only callable by the owner.

Parameters

disableCreate

function disableCreate() external virtual

Permanently disables the createActuals() function.

Only callable by the owner.

disableCancel

function disableCancel() external virtual

Permanently disables the cancel() function.

Only callable by the owner.

disableHook

function disableHook() external virtual

Permanently disables the hook.

Only callable by the owner.

disableWithdraw

function disableWithdraw() external virtual

Permanently prevents the founder from withdrawing deposits.

Only callable by the owner.

deployer

function deployer() external view virtual returns (contract ITTUDeployer)

Return Values

futureToken

function futureToken() external view virtual returns (contract ITTFutureTokenV2)

Return Values

hook

function hook() external view virtual returns (contract ITTHook)

Return Values

claimingDelegates

function claimingDelegates() external view virtual returns (address[])

Return Values

isCreateable

function isCreateable() external view virtual returns (bool)

Return Values

isCancelable

function isCancelable() external view virtual returns (bool)

Return Values

isHookable

function isHookable() external view virtual returns (bool)

Return Values

isWithdrawable

function isWithdrawable() external view virtual returns (bool)

Return Values

pendingAmountClaimableForCancelledActuals

function pendingAmountClaimableForCancelledActuals(uint256 actualId) external view virtual returns (uint256)

Parameters

Return Values

getEncodedPreset

function getEncodedPreset(bytes32 presetId) external view virtual returns (bytes)

To decode in JS, use:

ethers.utils.defaultAbiCoder.decode(
  ["uint256[]", "uint256", "uint256[]", "uint256[]", "bool"],
  encodedPreset
);

Parameters

Return Values

actuals

function actuals(uint256 actualId) external view virtual returns (struct Actual)

Returns the Actual struct based on the input ID.

BIPS_PRECISION

function BIPS_PRECISION() external pure virtual returns (uint256)

Return Values

calculateAmountClaimable

function calculateAmountClaimable(uint256 actualId) public view virtual returns (uint256 deltaAmountClaimable, uint256 updatedAmountClaimed)

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

Return Values

simulateAmountClaimable

function simulateAmountClaimable(uint256 actualId, uint256 claimTimestampAbsolute) public view virtual returns (uint256 deltaAmountClaimable, uint256 updatedAmountClaimed)

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

Return Values

Last updated