Skip to main content

Colony Extension (IColonyExtension)

Colony extensions are free-standing contracts which augment Colonies with additional functionality. In addition to their specific functionality, all extensions conform to a standard interface, defined in this file.

Interface Methods

deprecate(bool _deprecated)

Called when deprecating (or undeprecating) the extension

Parameters

NameTypeDescription
_deprecatedboolIndicates whether the extension should be deprecated or undeprecated

executeMetaTransaction(address userAddress, bytes memory payload, bytes32 sigR, bytes32 sigS, uint8 sigV):bytes returnData

Executes a metatransaction targeting this contract

Parameters

NameTypeDescription
userAddressaddressThe address of the user that signed the metatransaction
payloadbytesThe transaction data that will be executed if signature valid
sigRbytes32The 'r' part of the signature
sigSbytes32The 's' part of the signature
sigVuint8The 'v' part of the signature

Return Parameters

NameTypeDescription
returnDatabytesThe return data of the executed transaction

finishUpgrade()

Called when upgrading the extension (can be a no-op)

getCapabilityRoles(bytes4 _sig):bytes32 roles

Gets the bytes32 representation of the roles authorized to call a function

Parameters

NameTypeDescription
_sigbytes4The function signature

Return Parameters

NameTypeDescription
rolesbytes32bytes32 representation of the authorized roles

getColony():address colony

Gets the address of the extension's colony

Return Parameters

NameTypeDescription
colonyaddressThe address of the colony

getDeprecated():bool deprecated

Gets the boolean indicating whether or not the extension is deprecated

Return Parameters

NameTypeDescription
deprecatedboolBoolean indicating whether or not the extension is deprecated

getMetatransactionNonce(address userAddress):uint256 nonce

Gets the next metatransaction nonce for user that should be used targeting this contract

Parameters

NameTypeDescription
userAddressaddressThe address of the user that will sign the metatransaction

Return Parameters

NameTypeDescription
nonceuint256The nonce that should be used for the next metatransaction

identifier():bytes32 identifier

Returns the identifier of the extension

Return Parameters

NameTypeDescription
identifierbytes32The extension's identifier

install(address _colony)

Configures the extension

Parameters

NameTypeDescription
_colonyaddressThe colony in which the extension holds permissions

multicall(bytes[] calldata _data):bytes[] results

Call multiple functions in the current contract and return the data from all of them if they all succeed

Note: The msg.value should not be trusted for any method callable from multicall.

Parameters

NameTypeDescription
_databytes[]The encoded function data for each of the calls to make to this contract

Return Parameters

NameTypeDescription
resultsbytes[]The results from each of the calls passed in via data

uninstall()

Called when uninstalling the extension

version():uint256 version

Returns the version of the extension

Return Parameters

NameTypeDescription
versionuint256The extension's version number