ITokenLocking

Interface Methods

deposit

Deposit _amount of colony tokens. Can only be called if user tokens are not locked. Before calling this function user has to allow that their tokens can be transferred by token locking contract.

Parameters

NameTypeDescription
_tokenaddressAddress of the token to deposit
_amountuint256Amount to deposit

getColonyNetwork

Get ColonyNetwork address.

Return Parameters

NameTypeDescription
networkAddressaddressColonyNetwork address

getTotalLockCount

Get global lock count for a specific token.

Parameters

NameTypeDescription
_tokenaddressAddress of the token

Return Parameters

NameTypeDescription
lockCountuint256Global token lock count

getUserLock

Get user token lock info (lock count and deposited amount).

Parameters

NameTypeDescription
_tokenaddressAddress of the token
_useraddressAddress of the user

Return Parameters

NameTypeDescription
lockLockLock object containing: lockCount User's token lock count, amount User's deposited amount, timestamp Timestamp of deposit.

incrementLockCounterTo

Increments sender's lock count to _lockId.

Parameters

NameTypeDescription
_tokenaddressAddress of the token we want to increment lock count for
_lockIduint256Id of the lock user wants to increment to

lockToken

Locks everyones' tokens on _token address.

Parameters

NameTypeDescription
_tokenaddressAddress of the token we want to lock

Return Parameters

NameTypeDescription
lockCountuint256Updated total token lock count

punishStakers

Function called to punish people who staked against a new reputation root hash that turned out to be incorrect.

Note: While public, it can only be called successfully by the current ReputationMiningCycle.

Parameters

NameTypeDescription
_stakersaddress[]Array of the addresses of stakers to punish
_beneficiaryaddressAddress of beneficiary to receive forfeited stake
_amountuint256Amount of stake to slash

setColonyNetwork

Set the ColonyNetwork contract address.

Note: ColonyNetwork is used for checking if sender is a colony created on colony network.

Parameters

NameTypeDescription
_colonyNetworkaddressAddress of the ColonyNetwork

unlockTokenForUser

Increments the lock counter to _lockId for the _user if user's lock count is less than _lockId by 1. Can only be called by a colony.

Parameters

NameTypeDescription
_tokenaddressAddress of the token we want to unlock
_useraddressAddress of the user
_lockIduint256Id of the lock we want to increment to

withdraw

Withdraw _amount of deposited tokens. Can only be called if user tokens are not locked.

Parameters

NameTypeDescription
_tokenaddressAddress of the token to withdraw from
_amountuint256Amount to withdraw

Support

Questions? Problems? Existential dilemmas? We’re here to help!

Improve this doc.

All improvements to documentation are welcome and encouraged. Submit a PR for documentation on GitHub.