IColonyNetwork

Interface Methods

addColonyVersion

Adds a new Colony contract version and the address of associated _resolver contract. Secured function to authorised members. Allowed to be called by the Meta Colony only.

Parameters

NameTypeDescription
_versionuint256The new Colony contract version
_resolveraddressAddress of the Resolver contract which will be used with the underlying EtherRouter contract

addr

Returns the address the supplied node resolves do, if we are the resolver.

Parameters

NameTypeDescription
nodebytes32The namehash of the ENS address being requested

Return Parameters

NameTypeDescription
addressaddressThe address the supplied node resolves to

addSkill

Adds a new skill to the global or local skills tree, under skill _parentSkillId. Only the Meta Colony is allowed to add a global skill, called via IColony.addGlobalSkill. Any colony is allowed to add a local skill and which is associated with a new domain via IColony.addDomain.

Note: Errors if the parent skill does not exist or if this is called by an unauthorised sender.

Parameters

NameTypeDescription
_parentSkillIduint256Id of the skill under which the new skill will be added. If 0, a global skill is added with no parent.

Return Parameters

NameTypeDescription
skillIduint256Id of the added skill

appendReputationUpdateLog

Adds a reputation update entry to log.

Note: Errors if it is called by anyone but a colony or if skill with id _skillId does not exist or.

Parameters

NameTypeDescription
_useraddressThe address of the user for the reputation update
_amountint256The amount of reputation change for the update, this can be a negative as well as a positive value
_skillIduint256The skill for the reputation update

calculateMinerWeight

Calculate raw miner weight in WADs.

Parameters

NameTypeDescription
_timeStakeduint256Amount of time (in seconds) that the miner has staked their CLNY
_submissonIndexuint256Index of reputation hash submission (between 0 and 11)

Return Parameters

NameTypeDescription
minerWeightuint256The weight of miner reward

createColony

Creates a new colony in the network. Note that the token ownership (if there is one) has to be transferred to the newly created colony.

Parameters

NameTypeDescription
_tokenAddressaddressAddress of an ERC20 token to serve as the colony token. Additionally token can optionally support mint as defined in ERC20Extended. Support for mint is mandatory only for the Meta Colony Token.

Return Parameters

NameTypeDescription
colonyAddressaddressAddress of the newly created colony

createMetaColony

Create the Meta Colony, same as a normal colony plus the root skill.

Parameters

NameTypeDescription
_tokenAddressaddressAddress of the CLNY token

deprecateSkill

Mark a global skill as deprecated which stops new tasks and payments from using it.

Parameters

NameTypeDescription
_skillIduint256Id of the skill

getChildSkillId

Get the id of the child skill at index _childSkillIndex for skill with Id _skillId.

Parameters

NameTypeDescription
_skillIduint256Id of the skill
_childSkillIndexuint256Index of the skill.children array to get

Return Parameters

NameTypeDescription
skillIduint256Skill Id of the requested child skill

getColony

Get a colony address by its Id in the network.

Parameters

NameTypeDescription
_iduint256Id of the colony to get

Return Parameters

NameTypeDescription
colonyAddressaddressThe colony address, if no colony was found, returns 0x0

getColonyCount

Get the number of colonies in the network.

Return Parameters

NameTypeDescription
countuint256The colony count

getColonyVersionResolver

Get the Resolver address for Colony contract version _version.

Parameters

NameTypeDescription
_versionuint256The Colony contract version

Return Parameters

NameTypeDescription
resolverAddressaddressAddress of the Resolver contract

getCurrentColonyVersion

Returns the latest Colony contract version. This is the version used to create all new colonies.

Return Parameters

NameTypeDescription
versionuint256The current / latest Colony contract version

getENSRegistrar

Returns the address of the ENSRegistrar for the Network.

Return Parameters

NameTypeDescription
addressaddressThe address the ENSRegistrar resolves to

getFeeInverse

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

Return Parameters

NameTypeDescription
_feeInverseuint256The inverse of the network fee

getMetaColony

Get the Meta Colony address.

Return Parameters

NameTypeDescription
colonyAddressaddressThe Meta colony address, if no colony was found, returns 0x0

getMiningResolver

Get the resolver to be used by new instances of ReputationMiningCycle.

Return Parameters

NameTypeDescription
miningResolverAddressaddressThe address of the mining cycle resolver currently used by new instances

getParentSkillId

Get the id of the parent skill at index _parentSkillIndex for skill with Id _skillId.

Parameters

NameTypeDescription
_skillIduint256Id of the skill
_parentSkillIndexuint256Index of the skill.parents array to get Note that not all parent skill ids are stored here. See Skill.parents member for definition on which parents are stored

Return Parameters

NameTypeDescription
skillIduint256Skill Id of the requested parent skill

getProfileDBAddress

Retrieve the orbitdb address corresponding to a registered account.

Parameters

NameTypeDescription
nodebytes32The Namehash of the account being queried.

Return Parameters

NameTypeDescription
orbitDBstringA string containing the address of the orbit database

getReplacementReputationUpdateLogEntry

Get a replacement log entry (if set) for the log entry _id in the mining cycle that was at the address _reputationMiningCycle.

Parameters

NameTypeDescription
_reputationMiningCycleaddressThe address of the reputation mining cycle we are asking about
_iduint256The log entry number we wish to see if there is a replacement for

Return Parameters

NameTypeDescription
reputationLogEntryReputationLogEntryReputationLogEntry instance with the details of the log entry (if it exists)

getReplacementReputationUpdateLogsExist

Used by the client to avoid doubling the number of RPC calls when syncing from scratch.

Parameters

NameTypeDescription
_reputationMiningCycleaddressThe reputation mining cycle address we want to know if any entries have been replaced in.

Return Parameters

NameTypeDescription
existsboolBoolean indicating whether there is a replacement log

getReputationMiningCycle

Get the address of either the active or inactive reputation mining cycle, based on active. The active reputation mining cycle is the one currently under consideration by reputation miners. The inactive reputation cycle is the one with the log that is being appended to.

Parameters

NameTypeDescription
_activeboolWhether the user wants the active or inactive reputation mining cycle

Return Parameters

NameTypeDescription
repMiningCycleAddressaddressaddress of active or inactive ReputationMiningCycle

getReputationMiningSkillId

Get the skillId of the reputation mining skill. Only set once the metacolony is set up.

Return Parameters

NameTypeDescription
skillIduint256The skillId of the reputation mining skill.

getReputationRootHash

Get the root hash of the current reputation state tree.

Return Parameters

NameTypeDescription
rootHashbytes32The current Reputation Root Hash

getReputationRootHashNNodes

Get the number of nodes in the current reputation state tree.

Note: I cannot see a reason why a user's client would need to call this - only stored to help with some edge cases in reputation mining dispute resolution.

Return Parameters

NameTypeDescription
nNodesuint256uint256 The number of nodes in the state tree

getSkill

Get the nParents and nChildren of skill with id _skillId.

Parameters

NameTypeDescription
_skillIduint256Id of the skill

Return Parameters

NameTypeDescription
skillSkillThe Skill struct

getSkillCount

Get the number of skills in the network including both global and local skills.

Return Parameters

NameTypeDescription
countuint256The skill count

getTokenLocking

Get token locking contract address.

Return Parameters

NameTypeDescription
lockingAddressaddressToken locking contract address

initialise

Initialises the colony network by setting the first Colony version resolver to _resolver address.

Note: Only allowed to be run once, by the Network owner before any Colony versions are added.

Parameters

NameTypeDescription
_resolveraddressAddress of the resolver for Colony contract
_versionuint256Version of the Colony contract the resolver represents

initialiseReputationMining

Creates initial inactive reputation mining cycle.

isColony

Check if specific address is a colony created on colony network.

Parameters

NameTypeDescription
_colonyaddressAddress of the colony

Return Parameters

NameTypeDescription
addressIsColonybooltrue if specified address is a colony, otherwise false

lookupRegisteredENSDomain

Reverse lookup a username from an address.

Parameters

NameTypeDescription
addraddressThe address we wish to find the corresponding ENS domain for (if any)

Return Parameters

NameTypeDescription
domainstringA string containing the colony-based ENS name corresponding to addr

registerColonyLabel

Register a "colony.joincolony.eth" label. Can only be called by a Colony.

Parameters

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

registerUserLabel

Register a "user.joincolony.eth" label.

Parameters

NameTypeDescription
usernamestringThe label to register
orbitdbstringThe path of the orbitDB database associated with the user profile

setFeeInverse

Set the colony network fee to pay. e.g. if the fee is 1% (or 0.01), pass 100 as _feeInverse.

Parameters

NameTypeDescription
_feeInverseuint256The inverse of the network fee to set

setMiningResolver

Set the resolver to be used by new instances of ReputationMiningCycle.

Parameters

NameTypeDescription
miningResolverAddressaddressThe address of the Resolver contract with the functions correctly wired.

setReplacementReputationUpdateLogEntry

Set a replacement log entry if we're in recovery mode.

Note: Note that strictly, _nUpdates and _nPreviousUpdates don't need to be set - they're only used during dispute resolution, which these replacement log entries are never used for. However, for ease of resyncing the client, we have decided to include them for now.

Parameters

NameTypeDescription
_reputationMiningCycleaddressThe address of the reputation mining cycle that the log was in.
_iduint256The number of the log entry in the reputation mining cycle in question.
_useraddressThe address of the user earning / losing the reputation
_amountintThe amount of reputation being earned / lost
_skillIduint256The id of the origin skill for the reputation update
_colonyaddressThe address of the colony being updated
_nUpdatesuint128The number of updates the log entry corresponds to
_nPreviousUpdatesuint128The number of updates in the log before this entry

setReputationRootHash

Set a new Reputation root hash and starts a new mining cycle. Can only be called by the ReputationMiningCycle contract.

Parameters

NameTypeDescription
newHashbytes32The reputation root hash
newNNodesuint256The updated nodes count value
stakersaddress[]Array of users who submitted or backed the hash, being accepted here as the new reputation root hash
rewarduint256Amount of CLNY to be distributed as reward to miners

setTokenLocking

Sets the token locking address. This is only set once, and can't be changed afterwards.

Parameters

NameTypeDescription
_tokenLockingAddressaddressAddress of the locking contract

setupRegistrar

Setup registrar with ENS and root node.

Parameters

NameTypeDescription
_ensaddressAddress of ENS registrar
_rootNodebytes32Namehash of the root node for the domain

startNextCycle

Starts a new Reputation Mining cycle. Explicitly called only the first time, subsequently called from within setReputationRootHash.

startTokenAuction

Create and start a new DutchAuction for the entire amount of _token owned by the Colony Network.

Parameters

NameTypeDescription
_tokenaddressAddress of the token held by the network to be auctioned

supportsInterface

Query if a contract implements an interface

Note: Interface identification is specified in ERC-165.

Parameters

NameTypeDescription
interfaceIDbytes4The interface identifier, as specified in ERC-165

Return Parameters

NameTypeDescription
boolbool

updateColonyOrbitDB

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

updateUserOrbitDB

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

Parameters

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

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.