Skip to main content

Token Supplier (TokenSupplier)

A simple extension which allows a colony to automatically manage the token supply. A colony can configure a maximum supply and a rate of issuance, at which point anyone can continually mint tokens and have them sent to the colony.

Interface Methods

deprecate(bool _deprecated)

Called when deprecating (or undeprecating) the extension

Parameters

NameTypeDescription
_deprecatedboolIndicates whether the extension should be deprecated or undeprecated

finishUpgrade()

Called when upgrading the extension (currently a no-op)

getLastPinged():uint256 lastPinged

Get the time of the last token minting event

Return Parameters

NameTypeDescription
lastPingeduint256The timestamp of the last ping

getLastRateUpdate():uint256 lastUpdate

Get the time of the last change in issuance rate

Return Parameters

NameTypeDescription
lastUpdateuint256The timestamp of the last update

getMetatransactionNonce(address userAddress):uint256 nonce

Gets the next nonce for a meta-transaction

Parameters

NameTypeDescription
userAddressaddressThe user's address

Return Parameters

NameTypeDescription
nonceuint256The nonce

getTokenIssuanceRate():uint256 issuanceRate

Get the token issuance rate

Return Parameters

NameTypeDescription
issuanceRateuint256The token issuance rate

getTokenSupplyCeiling():uint256 supplyCeiling

Get the token supply ceiling

Return Parameters

NameTypeDescription
supplyCeilinguint256The token supply ceiling

identifier():bytes32 _identifier

Returns the identifier of the extension

Return Parameters

NameTypeDescription
_identifierbytes32The extension's identifier

initialise(uint256 _tokenSupplyCeiling, uint256 _tokenIssuanceRate)

Initialise the extension, must be called before any tokens can be issued

Parameters

NameTypeDescription
_tokenSupplyCeilinguint256Total amount of tokens to issue
_tokenIssuanceRateuint256Number of tokens to issue per day

install(address _colony)

Configures the extension

Parameters

NameTypeDescription
_colonyaddressThe colony in which the extension holds permissions

issueTokens()

Issue the appropriate amount of tokens

setTokenIssuanceRate(uint256 _tokenIssuanceRate)

Update the tokenIssuanceRate

Parameters

NameTypeDescription
_tokenIssuanceRateuint256Number of tokens to issue per day

setTokenSupplyCeiling(uint256 _tokenSupplyCeiling)

Update the tokenSupplyCeiling, cannot set below current tokenSupply

Parameters

NameTypeDescription
_tokenSupplyCeilinguint256Total amount of tokens to issue

uninstall()

Called when uninstalling the extension

version():uint256 _version

Returns the version of the extension

Return Parameters

NameTypeDescription
_versionuint256The extension's version number