Skip to main content

Colony (IColony)

The main body of functionality of a colony. If extensions can be thought of as "applications", providing specific functionality, then this contract can be thought of as the "operating system", providing "system calls" for managing a colony's underlying resources, such as managing roles & permissions, creating new domains and expenditures, and moving resources throughout a colony. Extensions express their functionality by calling these functions on the colony on which they are installed, and users with the proper permissions can call these functions directly.

Interface Methods

addDomain(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _parentDomainId)

Add a colony domain, and its respective local skill under skill with id _parentSkillId. New funding pot is created and associated with the domain here.

Note: Adding new domains is currently retricted to one level only, i.e. _parentDomainId has to be the root domain id: 1.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_parentDomainIduint256Id of the domain under which the new one will be added

addDomain(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _parentDomainId, string memory _metadata)

Add a colony domain, and its respective local skill under skill with id _parentSkillId. New funding pot is created and associated with the domain here.

Note: Adding new domains is currently retricted to one level only, i.e. _parentDomainId has to be the root domain id: 1.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_parentDomainIduint256Id of the domain under which the new one will be added
_metadatastringMetadata relating to the domain. Expected to be the IPFS hash of a JSON blob, but not enforced by the contracts.

addLocalSkill()

Add a new local skill for the colony. Secured function to authorised members.

addPayment(uint256 _permissionDomainId, uint256 _childSkillIndex, address _recipient, address _token, uint256 _amount, uint256 _domainId, uint256 _skillId):uint256 paymentId

Add a new payment in the colony. Secured function to authorised members.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId, (only used if _permissionDomainId is different to _domainId)
_recipientaddressAddress of the payment recipient
_tokenaddressAddress of the token, 0x0 value indicates Ether
_amountuint256Payout amount
_domainIduint256The domain where the payment belongs
_skillIduint256The skill associated with the payment

Return Parameters

NameTypeDescription
paymentIduint256Identifier of the newly created payment

annotateTransaction(bytes32 _txHash, string memory _metadata)

Emit a metadata string for a transaction

Parameters

NameTypeDescription
_txHashbytes32Hash of transaction being annotated (0x0 for current tx)
_metadatastringString of metadata for tx

approveStake(address _approvee, uint256 _domainId, uint256 _amount)

Allow the _approvee to obligate some amount of tokens as a stake.

Parameters

NameTypeDescription
_approveeaddressAddress of the account we are willing to let obligate us.
_domainIduint256Domain in which we are willing to be obligated.
_amountuint256Amount of internal token up to which we are willing to be obligated.

authority():address colonyAuthority

Get the ColonyAuthority for the colony.

Return Parameters

NameTypeDescription
colonyAuthorityaddressThe ColonyAuthority contract address

bootstrapColony(address[] memory _users, int[] memory _amount)

Allows the colony to bootstrap itself by having initial reputation and token _amount assigned to _users. This reputation is assigned in the colony-wide domain. Secured function to authorised members.

Note: Only allowed to be called when taskCount is 0 by authorized addresses.

Parameters

NameTypeDescription
_usersaddress[]Array of address to bootstrap with reputation
_amountint[]Amount of reputation/tokens for every address

burnTokens(address token, uint256 amount)

Burn tokens held by the colony. Can only burn tokens held in the root funding pot.

Parameters

NameTypeDescription
tokenaddressThe address of the token to burn
amountuint256The amount of tokens to burn

cancelExpenditure(uint256 _id)

Cancels the expenditure and prevents further editing. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier

cancelTask(uint256 _id)

Cancel a task at any point before it is finalized. Secured function to authorised members. Any funds assigned to its funding pot can be moved back to the domain via IColony.moveFundsBetweenPots.

Note: Set the task.status property to 1.

Parameters

NameTypeDescription
_iduint256Id of the task

claimColonyFunds(address _token)

Move any funds received by the colony in _token denomination to the top-level domain pot, siphoning off a small amount to the reward pot. If called against a colony's own token, no fee is taken.

Parameters

NameTypeDescription
_tokenaddressAddress of the token, 0x0 value indicates Ether

claimExpenditurePayout(uint256 _id, uint256 _slot, address _token)

Claim the payout for an expenditure slot. Here the network receives a fee from each payout.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_slotuint256Number of the slot
_tokenaddressAddress of the token, 0x0 value indicates Ether

claimPayment(uint256 _id, address _token)

Claim the payout in _token denomination for payment _id. Here the network receives its fee from each payout. Same as for tasks, ether fees go straight to the Meta Colony whereas Token fees go to the Network to be auctioned off.

Parameters

NameTypeDescription
_iduint256Payment identifier
_tokenaddressAddress of the token, 0x0 value indicates Ether

claimRewardPayout(uint256 _payoutId, uint256[[object Object]] memory _squareRoots, bytes memory key, bytes memory value, uint256 branchMask, bytes32[] memory siblings)

Claim the reward payout at _payoutId. User needs to provide their reputation and colony-wide reputation which will be proven via Merkle proof inside this function. Can only be called if payout is active, i.e if 60 days have not passed from its creation. Can only be called if next in queue.

Parameters

NameTypeDescription
_payoutIduint256Id of the reward payout
_squareRootsuint256[7]Square roots of values used in equation: _squareRoots[0] - square root of user reputation, _squareRoots[1] - square root of user tokens (deposited in TokenLocking), _squareRoots[2] - square root of total reputation, _squareRoots[3] - square root of total tokens, _squareRoots[4] - square root of numerator (user reputation user tokens), _squareRoots[5] - square root of denominator (total reputation total tokens), _squareRoots[6] - square root of payout amount.
keybytesSome Reputation hash tree key
valuebytesReputation value
branchMaskuint256The branchmask of the proof
siblingsbytes32[]The siblings of the proof

claimTaskPayout(uint256 _id, uint8 _role, address _token)

Claim the payout in _token denomination for work completed in task _id by contributor with role _role. Allowed only after task is finalized. Here the network receives its fee from each payout. Ether fees go straight to the Meta Colony whereas Token fees go to the Network to be auctioned off.

Parameters

NameTypeDescription
_iduint256Id of the task
_roleuint8Id of the role, as defined in TaskRole enum
_tokenaddressAddress of the token, 0x0 value indicates Ether

completeTask(uint256 _id)

Mark a task as complete after the due date has passed. This allows the task to be rated and finalized (and funds recovered) even in the presence of a worker who has disappeared. Note that if the due date was not set, then this function will throw.

Parameters

NameTypeDescription
_iduint256Id of the task

deobligateStake(address _user, uint256 _domainId, uint256 _amount)

Deobligate the user some amount of tokens, releasing the stake.

Parameters

NameTypeDescription
_useraddressAddress of the account we are deobligating.
_domainIduint256Domain in which we are deobligating the user.
_amountuint256Amount of internal token we are deobligating.

deprecateDomain(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _domainId, bool _deprecated)

Deprecate a domain, preventing certain actions from happening there

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_domainIduint256Id of the domain being deprecated
_deprecatedboolWhether or not the domain is deprecated

deprecateExtension(bytes32 extensionId, bool deprecated)

Set the deprecation of an extension in a colony. Secured function to authorised members.

Parameters

NameTypeDescription
extensionIdbytes32keccak256 hash of the extension name, used as an indentifier
deprecatedboolWhether to deprecate the extension or not

deprecateLocalSkill(uint256 localSkillId, bool deprecated)

Deprecate a local skill for the colony. Secured function to authorised members.

Parameters

NameTypeDescription
localSkillIduint256Id for the local skill
deprecatedboolDeprecation status to set for the skill

editColony(string memory _metadata)

Called to change the metadata associated with a colony. Expected to be a IPFS hash of a JSON blob, but not enforced to any degree by the contracts

Parameters

NameTypeDescription
_metadatastringIPFS hash of the metadata

editColonyByDelta(string memory _metadataDelta)

Called to change the metadata associated with a colony. Expected to be a IPFS hash of a delta to a JSON blob, but not enforced to any degree by the contracts

Parameters

NameTypeDescription
_metadataDeltastringIPFS hash of the metadata delta

editDomain(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _domainId, string memory _metadata)

Add a colony domain, and its respective local skill under skill with id _parentSkillId. New funding pot is created and associated with the domain here.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_domainIduint256Id of the domain being edited
_metadatastringMetadata relating to the domain. Expected to be the IPFS hash of a JSON blob, but not enforced by the contracts.

emitDomainReputationPenalty(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _domainId, address _user, int256 _amount)

Emit a negative domain reputation update. Available only to Arbitration role holders

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I hold the Arbitration role
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_domainIduint256The domain where the user will lose reputation
_useraddressThe user who will lose reputation
_amountint256The (negative) amount of reputation to lose

emitDomainReputationReward(uint256 _domainId, address _user, int256 _amount)

Emit a positive domain reputation update. Available only to Root role holders

Parameters

NameTypeDescription
_domainIduint256The domain where the user will gain reputation
_useraddressThe user who will gain reputation
_amountint256The (positive) amount of reputation to gain

emitSkillReputationPenalty(uint256 _skillId, address _user, int256 _amount)

Emit a negative skill reputation update. Available only to Arbitration role holders in the root domain

Parameters

NameTypeDescription
_skillIduint256The skill where the user will lose reputation
_useraddressThe user who will lose reputation
_amountint256The (negative) amount of reputation to lose

emitSkillReputationReward(uint256 _skillId, address _user, int256 _amount)

Emit a positive skill reputation update. Available only to Root role holders

Parameters

NameTypeDescription
_skillIduint256The skill where the user will gain reputation
_useraddressThe user who will gain reputation
_amountint256The (positive) amount of reputation to gain

executeTaskChange(uint8[] memory _sigV, bytes32[] memory _sigR, bytes32[] memory _sigS, uint8[] memory _mode, uint256 _value, bytes memory _data)

Executes a task update transaction _data which is approved and signed by two of its roles (e.g. manager and worker) using the detached signatures for these users.

Note: The Colony functions which require approval and the task roles to review these are set in IColony.initialiseColony at colony creation. Upon successful execution the taskChangeNonces entry for the task is incremented.

Parameters

NameTypeDescription
_sigVuint8[]recovery id
_sigRbytes32[]r output of the ECDSA signature of the transaction
_sigSbytes32[]s output of the ECDSA signature of the transaction
_modeuint8[]How the signature was generated - 0 for Geth-style (usual), 1 for Trezor-style (only Trezor does this)
_valueuint256The transaction value, i.e. number of wei to be sent when the transaction is executed Currently we only accept 0 value transactions but this is kept as a future option
_databytesThe transaction data

executeTaskRoleAssignment(uint8[] memory _sigV, bytes32[] memory _sigR, bytes32[] memory _sigS, uint8[] memory _mode, uint256 _value, bytes memory _data)

Executes a task role update transaction _data which is approved and signed by two of addresses. depending of which function we are calling. Allowed functions are setTaskManagerRole, setTaskEvaluatorRole and setTaskWorkerRole. Upon successful execution the taskChangeNonces entry for the task is incremented.

Parameters

NameTypeDescription
_sigVuint8[]recovery id
_sigRbytes32[]r output of the ECDSA signature of the transaction
_sigSbytes32[]s output of the ECDSA signature of the transaction
_modeuint8[]How the signature was generated - 0 for Geth-style (usual), 1 for Trezor-style (only Trezor does this)
_valueuint256The transaction value, i.e. number of wei to be sent when the transaction is executed Currently we only accept 0 value transactions but this is kept as a future option
_databytesThe transaction data

finalizeExpenditure(uint256 _id)

Finalizes the expenditure and allows for funds to be claimed. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier

finalizePayment(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _id)

Finalizes the payment and logs the reputation log updates. Allowed to be called once after payment is fully funded. Secured function to authorised members.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_iduint256Payment identifier

finalizeRewardPayout(uint256 _payoutId)

Finalises the reward payout. Allows creation of next reward payouts for token that has been used in _payoutId. Can only be called when reward payout cycle is finished i.e when 60 days have passed from its creation.

Parameters

NameTypeDescription
_payoutIduint256Id of the reward payout

finalizeTask(uint256 _id)

Called after task work rating is complete which closes the task and logs the respective reputation log updates. Allowed to be called once per task. Secured function to authorised members.

Note: Set the task.finalized property to true

Parameters

NameTypeDescription
_iduint256Id of the task

finishUpgrade()

A function to be called after an upgrade has been done from v2 to v3.

Note: Can only be called by the colony itself, and only expected to be called as part of the upgrade() call. Required to be external so it can be an external call.

generateSecret(bytes32 _salt, uint256 _value):bytes32 secret

Helper function used to generage consistently the rating secret using salt value _salt and value to hide _value

Parameters

NameTypeDescription
_saltbytes32Salt value
_valueuint256Value to hide

Return Parameters

NameTypeDescription
secretbytes32keccak256 hash of joint _salt and _value

getApproval(address _user, address _obligator, uint256 _domainId):uint256 approval

View an approval to obligate tokens.

Parameters

NameTypeDescription
_useraddressUser allowing their tokens to be obligated.
_obligatoraddressAddress of the account we are willing to let obligate us.
_domainIduint256Domain in which we are willing to be obligated.

Return Parameters

NameTypeDescription
approvaluint256The amount the user has approved

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

getColonyNetwork():address colonyNetwork

Returns the colony network address set on the Colony.

Note: The colonyNetworkAddress we read here is set once, during initialiseColony.

Return Parameters

NameTypeDescription
colonyNetworkaddressThe address of Colony Network instance

getDomain(uint256 _id):Domain domain

Get a domain by id.

Parameters

NameTypeDescription
_iduint256Id of the domain which details to get

Return Parameters

NameTypeDescription
domainDomainThe domain

getDomainCount():uint256 count

Get the number of domains in the colony.

Return Parameters

NameTypeDescription
countuint256The domain count. Min 1 as the root domain is created at the same time as the colony

getDomainFromFundingPot(uint256 _fundingPotId):uint256 domainId

Get the domain corresponding to a funding pot

Parameters

NameTypeDescription
_fundingPotIduint256Id of the funding pot

Return Parameters

NameTypeDescription
domainIduint256Id of the corresponding domain

getExpenditure(uint256 _id):Expenditure expenditure

Returns an existing expenditure.

Parameters

NameTypeDescription
_iduint256Expenditure identifier

Return Parameters

NameTypeDescription
expenditureExpenditureThe expenditure

getExpenditureCount():uint256 count

Get the number of expenditures in the colony.

Return Parameters

NameTypeDescription
countuint256The expenditure count

getExpenditureSlot(uint256 _id, uint256 _slot):ExpenditureSlot expenditureSlot

Returns an existing expenditure slot.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_slotuint256Expenditure slot

Return Parameters

NameTypeDescription
expenditureSlotExpenditureSlotThe expenditure slot

getExpenditureSlotPayout(uint256 _id, uint256 _slot, address _token):uint256 amount

Returns an existing expenditure slot's payout for a token.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_slotuint256Expenditure slot
_tokenaddressToken address

Return Parameters

NameTypeDescription
amountuint256Amount of the payout for that slot/token.

getFundingPot(uint256 _id):FundingPotAssociatedType associatedType, uint256 associatedTypeId, uint256 payoutsWeCannotMake

Get the non-mapping properties of a pot by id.

Note: For the reward funding pot (e.g. id: 0) this returns (0, 0, 0).

Parameters

NameTypeDescription
_iduint256Id of the pot which details to get

Return Parameters

NameTypeDescription
associatedTypeFundingPotAssociatedTypeThe FundingPotAssociatedType value of the current funding pot, e.g. Domain, Task, Payout
associatedTypeIduint256Id of the associated type, e.g. if associatedType = FundingPotAssociatedType.Domain, this refers to the domainId
payoutsWeCannotMakeuint256Number of payouts that cannot be completed with the current funding

getFundingPotBalance(uint256 _potId, address _token):uint256 balance

Get the _token balance of pot with id _potId.

Parameters

NameTypeDescription
_potIduint256Id of the funding pot
_tokenaddressAddress of the token, 0x0 value indicates Ether

Return Parameters

NameTypeDescription
balanceuint256Funding pot supply balance

getFundingPotCount():uint256 count

Get the number of funding pots in the colony.

Return Parameters

NameTypeDescription
countuint256The funding pots count

getFundingPotPayout(uint256 _potId, address _token):uint256 payout

Get the assigned _token payouts of pot with id _potId.

Parameters

NameTypeDescription
_potIduint256Id of the funding pot
_tokenaddressAddress of the token, 0x0 value indicates Ether

Return Parameters

NameTypeDescription
payoutuint256Funding pot payout amount

getNonRewardPotsTotal(address _token):uint256 amount

Get the total amount of tokens _token minus amount reserved to be paid to the reputation and token holders as rewards.

Parameters

NameTypeDescription
_tokenaddressAddress of the token, 0x0 value indicates Ether

Return Parameters

NameTypeDescription
amountuint256Total amount of tokens in funding pots other than the rewards pot (id 0)

getObligation(address _user, address _obligator, uint256 _domainId):uint256 obligation

View an obligation of tokens.

Parameters

NameTypeDescription
_useraddressUser whose tokens are obligated.
_obligatoraddressAddress of the account who obligated us.
_domainIduint256Domain in which we are obligated.

Return Parameters

NameTypeDescription
obligationuint256The amount that is currently obligated

getPayment(uint256 _id):Payment payment

Returns an exiting payment.

Parameters

NameTypeDescription
_iduint256Payment identifier

Return Parameters

NameTypeDescription
paymentPaymentThe Payment data structure

getPaymentCount():uint256 count

Get the number of payments in the colony.

Return Parameters

NameTypeDescription
countuint256The payment count

getRewardInverse():uint256 rewardInverse

Return 1 / the reward to pay out from revenue. e.g. if the fee is 1% (or 0.01), return 100.

Return Parameters

NameTypeDescription
rewardInverseuint256The inverse of the reward

getRewardPayoutInfo(uint256 _payoutId):RewardPayoutCycle rewardPayoutCycle

Get useful information about specific reward payout.

Parameters

NameTypeDescription
_payoutIduint256Id of the reward payout

Return Parameters

NameTypeDescription
rewardPayoutCycleRewardPayoutCycleRewardPayoutCycle, containing propertes: reputationState Reputation root hash at the time of creation, colonyWideReputation Colony wide reputation in reputationState, totalTokens Total colony tokens at the time of creation, amount Total amount of tokens taken aside for reward payout, tokenAddress Token address, blockTimestamp Block number at the time of creation.

getRootLocalSkill():uint256 rootLocalSkill

Get the root local skill id

Return Parameters

NameTypeDescription
rootLocalSkilluint256The root local skill id

getTask(uint256 _id):bytes32 specificationHash, bytes32 deliverableHash, TaskStatus status, uint256 dueDate, uint256 fundingPotId, uint256 completionTimestamp, uint256 domainId, uint256[] skillIds

Get a task with id _id

Parameters

NameTypeDescription
_iduint256Id of the task

Return Parameters

NameTypeDescription
specificationHashbytes32Task brief hash
deliverableHashbytes32Task deliverable hash
statusTaskStatusTaskStatus property. 0 - Active. 1 - Cancelled. 2 - Finalized
dueDateuint256Due date
fundingPotIduint256Id of funding pot for task
completionTimestampuint256Task completion timestamp
domainIduint256Task domain id, default is root colony domain with id 1
skillIdsuint256[]Array of global skill ids assigned to task

getTaskChangeNonce(uint256 _id):uint256 nonce

Starts from 0 and is incremented on every co-reviewed task change via executeTaskChange call.

Parameters

NameTypeDescription
_iduint256Id of the task

Return Parameters

NameTypeDescription
nonceuint256The current task change nonce value

getTaskCount():uint256 count

Get the number of tasks in the colony.

Return Parameters

NameTypeDescription
countuint256The task count

getTaskPayout(uint256 _id, uint8 _role, address _token):uint256 amount

Get payout amount in _token denomination for role _role in task _id.

Parameters

NameTypeDescription
_iduint256Id of the task
_roleuint8Id of the role, as defined in TaskRole enum
_tokenaddressAddress of the token, 0x0 value indicates Ether

Return Parameters

NameTypeDescription
amountuint256Payout amount

getTaskRole(uint256 _id, uint8 _role):Role role

Get the Role properties back for role _role in task _id.

Parameters

NameTypeDescription
_iduint256Id of the task
_roleuint8Id of the role, as defined in TaskRole enum

Return Parameters

NameTypeDescription
roleRoleThe Role

getTaskWorkRatingSecret(uint256 _id, uint8 _role):bytes32 secret

Get the rating secret submitted for role _role in task _id

Parameters

NameTypeDescription
_iduint256Id of the task
_roleuint8Id of the role, as defined in TaskRole enum

Return Parameters

NameTypeDescription
secretbytes32Rating secret bytes32 value

getTaskWorkRatingSecretsInfo(uint256 _id):uint256 nSecrets, uint256 lastSubmittedAt

Get the ColonyStorage.RatingSecrets information for task _id.

Parameters

NameTypeDescription
_iduint256Id of the task

Return Parameters

NameTypeDescription
nSecretsuint256Number of secrets
lastSubmittedAtuint256Timestamp of the last submitted rating secret

getToken():address tokenAddress

Get the colony token.

Return Parameters

NameTypeDescription
tokenAddressaddressAddress of the token contract

getTokenApproval(address token, address spender):uint256 amount

Get the current approval amount

Parameters

NameTypeDescription
tokenaddressThe address of the token which was approved
spenderaddressThe account we have approved

Return Parameters

NameTypeDescription
amountuint256The token approval amount

getTotalTokenApproval(address token):uint256 amount

Get the current total approval amount across all spenders

Parameters

NameTypeDescription
tokenaddressThe address of the token which was approved

Return Parameters

NameTypeDescription
amountuint256The total token approval amount

getUserRoles(address _user, uint256 _domain):bytes32 roles

Gets the bytes32 representation of the roles for a user in a given domain

Parameters

NameTypeDescription
_useraddressThe user whose roles we want to get
_domainuint256The domain we want to get roles in

Return Parameters

NameTypeDescription
rolesbytes32bytes32 representation of the held roles

hasInheritedUserRole(address _user, uint256 _domainId, ColonyRole _role, uint256 _childSkillIndex, uint256 _childDomainId):bool hasRole

Check whether a given user has a given role for the colony, in a child domain. Calls the function of the same name on the colony's authority contract and an internal inheritance validator function

Parameters

NameTypeDescription
_useraddressThe user whose role we want to check
_domainIduint256Domain in which the caller has the role
_roleColonyRoleThe role we want to check for
_childSkillIndexuint256The index that the _childDomainId is relative to _domainId
_childDomainIduint256The domain where we want to use the role

Return Parameters

NameTypeDescription
hasRoleboolBoolean indicating whether the given user has the given role in domain

hasUserRole(address _user, uint256 _domainId, ColonyRole _role):bool hasRole

Check whether a given user has a given role for the colony. Calls the function of the same name on the colony's authority contract.

Parameters

NameTypeDescription
_useraddressThe user whose role we want to check
_domainIduint256The domain where we want to check for the role
_roleColonyRoleThe role we want to check for

Return Parameters

NameTypeDescription
hasRoleboolBoolean indicating whether the given user has the given role in domain

initialiseColony(address _colonyNetworkAddress, address _token)

Called once when the colony is created to initialise certain storage slot values.

Note: Sets the reward inverse to the uint max 2**256 - 1.

Parameters

NameTypeDescription
_colonyNetworkAddressaddressAddress of the colony network
_tokenaddressAddress of the colony ERC20 Token

initialiseRootLocalSkill()

Initialise the local skill tree for the colony.

installExtension(bytes32 extensionId, uint256 version)

Install an extension to the colony. Secured function to authorised members.

Parameters

NameTypeDescription
extensionIdbytes32keccak256 hash of the extension name, used as an indentifier
versionuint256The new extension version to install

lockExpenditure(uint256 _id)

Locks the expenditure and prevents further editing. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier

lockToken():uint256 timesLocked

Lock the colony's token. Can only be called by a network-managed extension.

Return Parameters

NameTypeDescription
timesLockeduint256The amount of times the token was locked

makeArbitraryTransaction(address _to, bytes memory _action):bool success

Execute arbitrary transaction on behalf of the Colony

Parameters

NameTypeDescription
_toaddressContract to receive the function call (cannot be this contract, network or token locking)
_actionbytesBytes array encoding the function call and arguments

Return Parameters

NameTypeDescription
successboolBoolean indicating whether the transaction succeeded

makeArbitraryTransactions(address[] memory _targets, bytes[] memory _actions, bool _strict):bool success

Execute arbitrary transactions on behalf of the Colony in series

Parameters

NameTypeDescription
_targetsaddress[]Array of addressed to be targeted
_actionsbytes[]Array of Bytes arrays encoding the function calls and arguments
_strictboolBoolean indicating whether if one transaction fails, the whole call to this function should fail.

Return Parameters

NameTypeDescription
successboolBoolean indicating whether the transactions succeeded

makeExpenditure(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _domainId):uint256 expenditureId

Add a new expenditure in the colony. Secured function to authorised members.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId, (only used if _permissionDomainId is different to _domainId)
_domainIduint256The domain where the expenditure belongs

Return Parameters

NameTypeDescription
expenditureIduint256Identifier of the newly created expenditure

makeSingleArbitraryTransaction(address _target, bytes memory _action):bool success

Executes a single arbitrary transaction

Note: Only callable by the colony itself. If you wish to use this functionality, you should use the makeAbitraryTransactions function

Parameters

NameTypeDescription
_targetaddressContract to receive the function call
_actionbytesBytes array encoding the function call and arguments

Return Parameters

NameTypeDescription
successboolBoolean indicating whether the transactions succeeded

makeTask(uint256 _permissionDomainId, uint256 _childSkillIndex, bytes32 _specificationHash, uint256 _domainId, uint256 _skillId, uint256 _dueDate)

Make a new task in the colony. Secured function to authorised members.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_specificationHashbytes32Database identifier where the task specification is stored
_domainIduint256The domain where the task belongs
_skillIduint256The skill associated with the task, can set to 0 for no-op
_dueDateuint256The due date of the task, can set to 0 for no-op

mintTokens(uint256 _wad)

Mint _wad amount of colony tokens. Secured function to authorised members.

Parameters

NameTypeDescription
_waduint256Amount to mint

mintTokensFor(address _guy, uint256 _wad)

Mint _wad amount of colony tokens and send to _guy. Secured function to authorised members.

Parameters

NameTypeDescription
_guyaddressRecipient of new tokens
_waduint256Amount to mint

moveFundsBetweenPots(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _domainId, uint256 _fromChildSkillIndex, uint256 _toChildSkillIndex, uint256 _fromPot, uint256 _toPot, uint256 _amount, address _token)

Move a given amount: _amount of _token funds from funding pot with id _fromPot to one with id _toPot.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The child index in _permissionDomainId where I will be taking this action
_domainIduint256The domain where I am taking this action, pointed to by _permissionDomainId and _childSkillIndex
_fromChildSkillIndexuint256In the array of child skills for the skill associated with the domain pointed to by _permissionDomainId + _childSkillIndex, the index of the skill associated with the domain that contains _fromPot
_toChildSkillIndexuint256The same, but for the _toPot which the funds are being moved to
_fromPotuint256Funding pot id providing the funds
_toPotuint256Funding pot id receiving the funds
_amountuint256Amount of funds
_tokenaddressAddress of the token, 0x0 value indicates Ether

moveFundsBetweenPots(uint256 _permissionDomainId, uint256 _fromChildSkillIndex, uint256 _toChildSkillIndex, uint256 _fromPot, uint256 _toPot, uint256 _amount, address _token)

Move a given amount: _amount of _token funds from funding pot with id _fromPot to one with id _toPot.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_fromChildSkillIndexuint256The child index in _permissionDomainId where we can find the domain for _fromPotId
_toChildSkillIndexuint256The child index in _permissionDomainId where we can find the domain for _toPotId
_fromPotuint256Funding pot id providing the funds
_toPotuint256Funding pot id receiving the funds
_amountuint256Amount of funds
_tokenaddressAddress of the token, 0x0 value indicates Ether

obligateStake(address _user, uint256 _domainId, uint256 _amount)

Obligate the user some amount of tokens as a stake.

Parameters

NameTypeDescription
_useraddressAddress of the account we are obligating.
_domainIduint256Domain in which we are obligating the user.
_amountuint256Amount of internal token we are obligating.

owner():address colonyOwner

Get the colony owner address. This should be address(0x0) at all times.

Note: Used for testing.

Return Parameters

NameTypeDescription
colonyOwneraddressAddress of the colony owner

registerColonyLabel(string memory colonyName, string memory orbitdb)

Register colony's ENS label.

Parameters

NameTypeDescription
colonyNamestringThe label to register.
orbitdbstringThe path of the orbitDB database associated with the colony name

removeTaskEvaluatorRole(uint256 _id)

Removing evaluator role. Agreed between manager and currently assigned evaluator.

Parameters

NameTypeDescription
_iduint256Id of the task

removeTaskWorkerRole(uint256 _id)

Removing worker role. Agreed between manager and currently assigned worker.

Parameters

NameTypeDescription
_iduint256Id of the task

revealTaskWorkRating(uint256 _id, uint8 _role, uint8 _rating, bytes32 _salt)

Reveal the secret rating submitted in IColony.submitTaskWorkRating for task _id and task role with id _role. Allowed within 5 days period starting which whichever is first from either both rating secrets being submitted (via IColony.submitTaskWorkRating) or the 5 day rating period expiring.

Note: Compares the keccak256(_salt, _rating) output with the previously submitted rating secret and if they match, sets the task role properties rated to true and rating to _rating.

Parameters

NameTypeDescription
_iduint256Id of the task
_roleuint8Id of the role, as defined in TaskRole enum
_ratinguint80-50 rating score (in increments of 10, .e.g 0, 10, 20, 30, 40 or 50)
_saltbytes32Salt value used to generate the rating secret

setAdministrationRole(uint256 _permissionDomainId, uint256 _childSkillIndex, address _user, uint256 _domainId, bool _setTo)

Set new colony admin role. Can be called by root role or architecture role.

Parameters

NameTypeDescription
_permissionDomainIduint256Domain in which the caller has root/architecture role
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_useraddressUser we want to give an admin role to
_domainIduint256Domain in which we are giving user the role
_setToboolThe state of the role permission (true assign the permission, false revokes it)

setAllTaskPayouts(uint256 _id, address _token, uint256 _managerAmount, uint256 _evaluatorAmount, uint256 _workerAmount)

Set _token payout for all roles in task _id to the respective amounts.

Note: Can only call if evaluator and worker are unassigned or manager, otherwise need signature.

Parameters

NameTypeDescription
_iduint256Id of the task
_tokenaddressAddress of the token, 0x0 value indicates Ether
_managerAmountuint256Payout amount for manager
_evaluatorAmountuint256Payout amount for evaluator
_workerAmountuint256Payout amount for worker

setArbitrationRole(uint256 _permissionDomainId, uint256 _childSkillIndex, address _user, uint256 _domainId, bool _setTo)

Set new colony arbitration role. Can be called by root role or architecture role.

Parameters

NameTypeDescription
_permissionDomainIduint256Domain in which the caller has root role
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_useraddressUser we want to give an arbitration role to
_domainIduint256Domain in which we are giving user the role
_setToboolThe state of the role permission (true assign the permission, false revokes it)

setArchitectureRole(uint256 _permissionDomainId, uint256 _childSkillIndex, address _user, uint256 _domainId, bool _setTo)

Set new colony architecture role. Can be called by root role or architecture role.

Parameters

NameTypeDescription
_permissionDomainIduint256Domain in which the caller has root/architecture role
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_useraddressUser we want to give an architecture role to
_domainIduint256Domain in which we are giving user the role
_setToboolThe state of the role permission (true assign the permission, false revokes it)

setDefaultGlobalClaimDelay(uint256 _globalClaimDelay)

Update the default global claim delay for expenditures

Parameters

NameTypeDescription
_globalClaimDelayuint256The new default global claim delay

setExpenditureClaimDelay(uint256 _id, uint256 _slot, uint256 _claimDelay)

Sets the claim delay on an expenditure slot. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_slotuint256Number of the slot
_claimDelayuint256Duration of time (in seconds) to delay

setExpenditureClaimDelays(uint256 _id, uint256[] memory _slots, uint256[] memory _claimDelays)

Sets the claim delays in given expenditure slots. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_slotsuint256[]Array of slots to set claim delays
_claimDelaysuint256[]Durations of time (in seconds) to delay

setExpenditureMetadata(uint256 _id, string memory _metadata)

Sets the metadata for an expenditure. Can only be called by expenditure owner.

Note: Can only be called while expenditure is in draft state.

Parameters

NameTypeDescription
_iduint256Id of the expenditure
_metadatastringIPFS hash of the metadata

setExpenditureMetadata(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _id, string memory _metadata)

Sets the metadata for an expenditure. Can only be called by Arbitration role.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId,
_iduint256Id of the expenditure
_metadatastringIPFS hash of the metadata

setExpenditurePayout(uint256 _id, uint256 _slot, address _token, uint256 _amount)

Set the token payout on an expenditure slot. Can only be called by expenditure owner.

Note: Can only be called while expenditure is in draft state.

Parameters

NameTypeDescription
_iduint256Id of the expenditure
_slotuint256Number of the slot
_tokenaddressAddress of the token, 0x0 value indicates Ether
_amountuint256Payout amount

setExpenditurePayout(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _id, uint256 _slot, address _token, uint256 _amount)

Set the token payout in a given expenditure slot. Can only be called by an Arbitration user.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_iduint256Id of the expenditure
_slotuint256The slot to set the payout
_tokenaddressAddress of the token, 0x0 value indicates Ether
_amountuint256Payout amount

setExpenditurePayoutModifiers(uint256 _id, uint256[] memory _slots, int256[] memory _payoutModifiers)

Sets the payout modifiers in given expenditure slots. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_slotsuint256[]Array of slots to set payout modifiers
_payoutModifiersint256[]Values (between +/- WAD) to modify the payout & reputation bonus

setExpenditurePayouts(uint256 _id, uint256[] memory _slots, address _token, uint256[] memory _amounts)

Set the token payouts in given expenditure slots. Can only be called by expenditure owner.

Note: Can only be called while expenditure is in draft state.

Parameters

NameTypeDescription
_iduint256Id of the expenditure
_slotsuint256[]Array of slots to set payouts
_tokenaddressAddress of the token, 0x0 value indicates Ether
_amountsuint256[]Payout amounts

setExpenditureRecipient(uint256 _id, uint256 _slot, address _recipient)

Sets the recipient on an expenditure slot. Can only be called by expenditure owner.

Note: Can only be called while expenditure is in draft state.

Parameters

NameTypeDescription
_iduint256Id of the expenditure
_slotuint256Slot for the recipient address
_recipientaddressAddress of the recipient

setExpenditureRecipients(uint256 _id, uint256[] memory _slots, address[] memory _recipients)

Sets the recipients in given expenditure slots. Can only be called by expenditure owner.

Note: Can only be called while expenditure is in draft state.

Parameters

NameTypeDescription
_iduint256Id of the expenditure
_slotsuint256[]Array of slots to set recipients
_recipientsaddress[]Addresses of the recipients

setExpenditureSkill(uint256 _id, uint256 _slot, uint256 _skillId)

Sets the skill on an expenditure slot. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_slotuint256Number of the slot
_skillIduint256Id of the new skill to set

setExpenditureSkills(uint256 _id, uint256[] memory _slots, uint256[] memory _skillIds)

Sets the skill on an expenditure slot. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_slotsuint256[]Array of slots to set skills
_skillIdsuint256[]Ids of the new skills to set

setExpenditureState(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _id, uint256 _storageSlot, bool[] memory _mask, bytes32[] memory _keys, bytes32 _value)

Set arbitrary state on an expenditure slot. Can only be called by Arbitration role.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId, (only used if _permissionDomainId is different to _domainId)
_iduint256Expenditure identifier
_storageSlotuint256Number of the top-level storage slot (25, 26, or 27)
_maskbool[]Array of booleans indicated whether a key is a mapping (F) or an array index (T).
_keysbytes32[]Array of additional keys (for mappings & arrays)
_valuebytes32Value to set at location

setExpenditureValues(uint256 _id, uint256[] memory _recipientSlots, address[] memory _recipients, uint256[] memory _skillIdSlots, uint256[] memory _skillIds, uint256[] memory _claimDelaySlots, uint256[] memory _claimDelays, uint256[] memory _payoutModifierSlots, int256[] memory _payoutModifiers, address[] memory _payoutTokens, undefined[] memory _payoutSlots, undefined[] memory _payoutValues)

Set many values of an expenditure simultaneously. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_recipientSlotsuint256[]Array of slots to set recipients
_recipientsaddress[]Addresses of the recipients
_skillIdSlotsuint256[]Array of slots to set skills
_skillIdsuint256[]Ids of the new skills to set
_claimDelaySlotsuint256[]Array of slots to set claim delays
_claimDelaysuint256[]Durations of time (in seconds) to delay
_payoutModifierSlotsuint256[]Array of slots to set payout modifiers
_payoutModifiersint256[]Values (between +/- WAD) to modify the payout & reputation bonus
_payoutTokensaddress[]Addresses of the tokens, 0x0 value indicates Ether
_payoutSlotsundefined[]2-dimensional array of slots to set payouts
_payoutValuesundefined[]2-dimensional array of the payout amounts

setFundingRole(uint256 _permissionDomainId, uint256 _childSkillIndex, address _user, uint256 _domainId, bool _setTo)

Set new colony funding role. Can be called by root role or architecture role.

Parameters

NameTypeDescription
_permissionDomainIduint256Domain in which the caller has root/architecture role
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_useraddressUser we want to give an funding role to
_domainIduint256Domain in which we are giving user the role
_setToboolThe state of the role permission (true assign the permission, false revokes it)

setPaymentPayout(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _id, address _token, uint256 _amount)

Sets the payout for a given token on an existing payment. Secured function to authorised members.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_iduint256Payment identifier
_tokenaddressAddress of the token, 0x0 value indicates Ether
_amountuint256Payout amount

setPaymentRecipient(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _id, address _recipient)

Sets the recipient on an existing payment. Secured function to authorised members.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_iduint256Payment identifier
_recipientaddressAddress of the payment recipient

setPaymentSkill(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _id, uint256 _skillId)

Sets the skill on an existing payment. Secured function to authorised members.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_iduint256Payment identifier
_skillIduint256Id of the new skill to set

setRewardInverse(uint256 _rewardInverse)

Set the reward inverse to pay out from revenue. e.g. if the fee is 1% (or 0.01), set 100.

Parameters

NameTypeDescription
_rewardInverseuint256The inverse of the reward

setRootRole(address _user, bool _setTo)

Set new colony root role. Can be called by root role only.

Parameters

NameTypeDescription
_useraddressUser we want to give an root role to
_setToboolThe state of the role permission (true assign the permission, false revokes it)

setTaskBrief(uint256 _id, bytes32 _specificationHash)

Set the hash for the task brief, aka task work specification, which identifies the task brief content in ddb. Allowed before a task is finalized.

Parameters

NameTypeDescription
_iduint256Id of the task
_specificationHashbytes32Unique hash of the task brief in ddb

setTaskDueDate(uint256 _id, uint256 _dueDate)

Set the due date on task _id. Allowed before a task is finalized.

Parameters

NameTypeDescription
_iduint256Id of the task
_dueDateuint256Due date as seconds since unix epoch

setTaskEvaluatorPayout(uint256 _id, address _token, uint256 _amount)

Set _token payout for evaluator in task _id to _amount.

Parameters

NameTypeDescription
_iduint256Id of the task
_tokenaddressAddress of the token, 0x0 value indicates Ether
_amountuint256Payout amount

setTaskEvaluatorRole(uint256 _id, address _user)

Assigning evaluator role. Can only be set if there is no one currently assigned to be an evaluator. Manager of the task and user we want to assign role to both need to agree. Managers can assign themselves to this role, if there is no one currently assigned to it.

Note: This function can only be called through executeTaskRoleAssignment.

Parameters

NameTypeDescription
_iduint256Id of the task
_useraddressAddress of the user we want to give a evaluator role to

setTaskManagerPayout(uint256 _id, address _token, uint256 _amount)

Set _token payout for manager in task _id to _amount.

Parameters

NameTypeDescription
_iduint256Id of the task
_tokenaddressAddress of the token, 0x0 value indicates Ether
_amountuint256Payout amount

setTaskManagerRole(uint256 _id, address _user, uint256 _permissionDomainId, uint256 _childSkillIndex)

Assigning manager role. Current manager and user we want to assign role to both need to agree. User we want to set here also needs to be an admin. Note that the domain proof data comes at the end here to not interfere with the assembly argument unpacking.

Note: This function can only be called through executeTaskRoleAssignment.

Parameters

NameTypeDescription
_iduint256Id of the task
_useraddressAddress of the user we want to give a manager role to
_permissionDomainIduint256The domain ID in which _user has the Administration permission
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId

setTaskSkill(uint256 _id, uint256 _skillId)

Set the skill for task _id.

Note: Currently we only allow one skill per task although we have provisioned for an array of skills in Task struct. Allowed before a task is finalized.

Parameters

NameTypeDescription
_iduint256Id of the task
_skillIduint256Id of the skill which has to be a global skill

setTaskWorkerPayout(uint256 _id, address _token, uint256 _amount)

Set _token payout for worker in task _id to _amount.

Parameters

NameTypeDescription
_iduint256Id of the task
_tokenaddressAddress of the token, 0x0 value indicates Ether
_amountuint256Payout amount

setTaskWorkerRole(uint256 _id, address _user)

Assigning worker role. Can only be set if there is no one currently assigned to be a worker. Manager of the task and user we want to assign role to both need to agree.

Note: This function can only be called through executeTaskRoleAssignment.

Parameters

NameTypeDescription
_iduint256Id of the task
_useraddressAddress of the user we want to give a worker role to

setUserRoles(uint256 _permissionDomainId, uint256 _childSkillIndex, address _user, uint256 _domainId, bytes32 _roles)

Set several roles in one transaction. Can be called by root role or architecture role.

Parameters

NameTypeDescription
_permissionDomainIduint256Domain in which the caller has root/architecture role
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId
_useraddressUser we want to give a role to
_domainIduint256Domain in which we are giving user the role
_rolesbytes32Byte array representing the desired role setting (1 for on, 0 for off)

startNextRewardPayout(address _token, bytes memory key, bytes memory value, uint256 branchMask, bytes32[] memory siblings)

Add a new payment in the colony. Can only be called by users with root permission. All tokens will be locked, and can be unlocked by calling waiveRewardPayout or claimRewardPayout.

Parameters

NameTypeDescription
_tokenaddressAddress of the token used for reward payout
keybytesSome Reputation hash tree key
valuebytesReputation value
branchMaskuint256The branchmask of the proof
siblingsbytes32[]The siblings of the proof

submitTaskDeliverable(uint256 _id, bytes32 _deliverableHash)

Submit the task deliverable, i.e. the output of the work performed for task _id. Submission is allowed only to the assigned worker before the task due date. Submissions cannot be overwritten.

Note: Set the task.deliverableHash and task.completionTimestamp properties.

Parameters

NameTypeDescription
_iduint256Id of the task
_deliverableHashbytes32Unique hash of the task deliverable content in ddb

submitTaskDeliverableAndRating(uint256 _id, bytes32 _deliverableHash, bytes32 _ratingSecret)

Submit the task deliverable for Worker and rating for Manager.

Note: Internally call submitTaskDeliverable and submitTaskWorkRating in sequence.

Parameters

NameTypeDescription
_iduint256Id of the task
_deliverableHashbytes32Unique hash of the task deliverable content in ddb
_ratingSecretbytes32Rating secret for manager

submitTaskWorkRating(uint256 _id, uint8 _role, bytes32 _ratingSecret)

Submit a hashed secret of the rating for work in task _id which was performed by user with task role id _role. Allowed within 5 days period starting which whichever is first from either the deliverable being submitted or the dueDate been reached. Allowed only for evaluator to rate worker and for worker to rate manager performance. Once submitted ratings can not be changed or overwritten.

Parameters

NameTypeDescription
_iduint256Id of the task
_roleuint8Id of the role, as defined in TaskRole enum
_ratingSecretbytes32keccak256 hash of a salt and 0-50 rating score (in increments of 10, .e.g 0, 10, 20, 30, 40 or 50). Can be generated via IColony.generateSecret helper function.

transferExpenditure(uint256 _id, address _newOwner)

Updates the expenditure owner. Can only be called by expenditure owner.

Parameters

NameTypeDescription
_iduint256Expenditure identifier
_newOwneraddressNew owner of expenditure

transferExpenditureViaArbitration(uint256 _permissionDomainId, uint256 _childSkillIndex, uint256 _id, address _newOwner)

Updates the expenditure owner. Can only be called by Arbitration role.

Note: This is now deprecated and will be removed in a future version

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action
_childSkillIndexuint256The index that the _domainId is relative to _permissionDomainId, (only used if _permissionDomainId is different to _domainId)
_iduint256Expenditure identifier
_newOwneraddressNew owner of expenditure

transferStake(uint256 _permissionDomainId, uint256 _childSkillIndex, address _obligator, address _user, uint256 _domainId, uint256 _amount, address _recipient)

Transfer some amount of obligated tokens. Can be called by the arbitration role.

Parameters

NameTypeDescription
_permissionDomainIduint256The domainId in which I have the permission to take this action.
_childSkillIndexuint256The child index in _permissionDomainId where we can find _domainId.
_obligatoraddressAddress of the account who set the obligation.
_useraddressAddress of the account we are transferring.
_domainIduint256Domain in which we are transferring the tokens.
_amountuint256Amount of internal token we are transferring.
_recipientaddressRecipient of the transferred tokens.

uninstallExtension(bytes32 extensionId)

Uninstall an extension from a colony. Secured function to authorised members.

Note: This is a permanent action -- re-installing the extension will deploy a new contract

Parameters

NameTypeDescription
extensionIdbytes32keccak256 hash of the extension name, used as an indentifier

unlockToken()

unlock the native colony token, if possible

unlockTokenForUser(address user, uint256 lockId)

Unlock the colony's token for a user. Can only be called by a network-managed extension.

Parameters

NameTypeDescription
useraddressThe user to unlock
lockIduint256The specific lock to unlock

updateApprovalAmount(address token, address spender)

Update the internal bookkeeping around external ERC20 approvals

Parameters

NameTypeDescription
tokenaddressThe address of the token which was approved
spenderaddressThe account we have approved

updateColonyOrbitDB(string memory orbitdb)

Update a colony's orbitdb address. Can only be called by a colony with a registered subdomain

Parameters

NameTypeDescription
orbitdbstringThe path of the orbitDB database to be associated with the colony

upgrade(uint _newVersion)

Upgrades a colony to a new Colony contract version _newVersion.

Note: Downgrades are not allowed, i.e. _newVersion should be higher than the currect colony version.

Parameters

NameTypeDescription
_newVersionuintThe target version for the upgrade

upgradeExtension(bytes32 extensionId, uint256 newVersion)

Upgrade an extension in a colony. Secured function to authorised members.

Parameters

NameTypeDescription
extensionIdbytes32keccak256 hash of the extension name, used as an indentifier
newVersionuint256The version to upgrade to (must be one larger than the current version)

userCanSetRoles(address _user, uint256 _domainId, uint256 _childSkillIndex, uint256 _childDomainId):bool canSet

Check whether a given user can modify roles in the target domain _childDomainId. Mostly a convenience function to provide a uniform interface for extension contracts validating permissions

Parameters

NameTypeDescription
_useraddressThe user whose permissions we want to check
_domainIduint256Domain in which the caller has the role (currently Root or Architecture)
_childSkillIndexuint256The index that the _childDomainId is relative to _domainId
_childDomainIduint256The domain where we want to edit roles

Return Parameters

NameTypeDescription
canSetboolBoolean indicating whether the given user is allowed to edit roles in the target domain.

verifyReputationProof(bytes memory key, bytes memory value, uint256 branchMask, bytes32[] memory siblings):bool isValid

Helper function that can be used by a client to verify the correctness of a patricia proof they have been supplied with.

Note: For more detail about branchMask and siblings, examine the PatriciaTree implementation. While external, likely only to be used by the Colony contracts, as it checks that the user is proving their own reputation in the current colony. The verifyProof function can be used to verify any proof, though this function is not currently exposed on the Colony's EtherRouter.

Parameters

NameTypeDescription
keybytesThe key of the element the proof is for.
valuebytesThe value of the element that the proof is for.
branchMaskuint256The branchmask of the proof
siblingsbytes32[]The siblings of the proof

Return Parameters

NameTypeDescription
isValidboolTrue if the proof is valid, false otherwise.

version():uint256 colonyVersion

Get the Colony contract version. Starts from 1 and is incremented with every deployed contract change.

Return Parameters

NameTypeDescription
colonyVersionuint256Version number