Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ColonyNetworkClient

Hierarchy

  • IColonyNetwork
    • ColonyNetworkClient

Indexable

[name: string]: ContractFunction | any

Index

Constructors

Properties

Methods

Constructors

constructor

  • new ColonyNetworkClient(addressOrName: string, contractInterface: Array<string | FunctionFragment | EventFragment | ParamType> | string | Interface, signerOrProvider: Signer | Provider): ColonyNetworkClient
  • Parameters

    • addressOrName: string
    • contractInterface: Array<string | FunctionFragment | EventFragment | ParamType> | string | Interface
    • signerOrProvider: Signer | Provider

    Returns ColonyNetworkClient

Properties

address

address: string

addressPromise

addressPromise: Promise<string>

clientType

clientType: NetworkClient

deployTransaction

deployTransaction: TransactionResponse

estimate

estimate: ExtendedEstimate

filters

filters: { AuctionCreated: any; ColonyAdded: any; ColonyLabelRegistered: any; ColonyNetworkInitialised: any; ColonyVersionAdded: any; MetaColonyCreated: any; MiningCycleResolverSet: any; NetworkFeeInverseSet: any; RecoveryRoleSet: any; ReputationMiningCycleComplete: any; ReputationMiningInitialised: any; ReputationRootHashSet: any; SkillAdded: any; TokenLockingAddressSet: any; UserLabelRegistered: any }

Type declaration

  • AuctionCreated: function
    • AuctionCreated(auction: null, token: null, quantity: null): EventFilter
  • ColonyAdded: function
    • ColonyAdded(colonyId: BigNumberish | null, colonyAddress: string | null, token: null): EventFilter
  • ColonyLabelRegistered: function
    • ColonyLabelRegistered(colony: string | null, label: null): EventFilter
  • ColonyNetworkInitialised: function
    • ColonyNetworkInitialised(resolver: null): EventFilter
  • ColonyVersionAdded: function
    • ColonyVersionAdded(version: null, resolver: null): EventFilter
  • MetaColonyCreated: function
    • MetaColonyCreated(metaColony: null, token: null, rootSkillId: null): EventFilter
  • MiningCycleResolverSet: function
    • MiningCycleResolverSet(miningCycleResolver: null): EventFilter
  • NetworkFeeInverseSet: function
    • NetworkFeeInverseSet(feeInverse: null): EventFilter
  • RecoveryRoleSet: function
    • RecoveryRoleSet(user: string | null, setTo: null): EventFilter
  • ReputationMiningCycleComplete: function
    • ReputationMiningCycleComplete(hash: null, nNodes: null): EventFilter
  • ReputationMiningInitialised: function
    • ReputationMiningInitialised(inactiveReputationMiningCycle: null): EventFilter
  • ReputationRootHashSet: function
    • ReputationRootHashSet(newHash: null, newNNodes: null, stakers: null, reward: null): EventFilter
  • SkillAdded: function
    • SkillAdded(skillId: null, parentSkillId: null): EventFilter
  • TokenLockingAddressSet: function
    • TokenLockingAddressSet(tokenLocking: null): EventFilter
  • UserLabelRegistered: function
    • UserLabelRegistered(user: string | null, label: null): EventFilter

functions

functions: { addColonyVersion: any; addSkill: any; addr: any; appendReputationUpdateLog: any; approveExitRecovery: any; calculateMinerWeight: any; checkNotAdditionalProtectedVariable: any; createColony(address): any; createColony(address,uint256,string,string,bool): any; createMetaColony: any; deprecateSkill: any; enterRecoveryMode: any; exitRecoveryMode: any; getChildSkillId: any; getColony: any; getColonyCount: any; getColonyVersionResolver: any; getCurrentColonyVersion: any; getENSRegistrar: any; getFeeInverse: any; getMetaColony: any; getMiningResolver: any; getParentSkillId: any; getProfileDBAddress: any; getReplacementReputationUpdateLogEntry: any; getReplacementReputationUpdateLogsExist: any; getReputationMiningCycle: any; getReputationMiningSkillId: any; getReputationRootHash: any; getReputationRootHashNNodes: any; getSkill: any; getSkillCount: any; getTokenLocking: any; initialise: any; initialiseReputationMining: any; isColony: any; isInRecoveryMode: any; lookupRegisteredENSDomain: any; numRecoveryRoles: any; registerColonyLabel: any; registerUserLabel: any; removeRecoveryRole: any; setFeeInverse: any; setMiningResolver: any; setRecoveryRole: any; setReplacementReputationUpdateLogEntry: any; setReputationRootHash: any; setStorageSlotRecovery: any; setTokenLocking: any; setupRegistrar: any; startNextCycle: any; startTokenAuction: any; supportsInterface: any; updateColonyOrbitDB: any; updateUserOrbitDB: any }

Type declaration

  • addColonyVersion: function
    • addColonyVersion(_version: BigNumberish, _resolver: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • 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

      • _version: BigNumberish

        The new Colony contract version

      • _resolver: string

        Address of the Resolver contract which will be used with the underlying EtherRouter contract

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • addSkill: function
    • addSkill(_parentSkillId: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Errors if the parent skill does not exist or if this is called by an unauthorised sender. 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.

      Parameters

      • _parentSkillId: BigNumberish

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

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

      skillId Id of the added skill

  • addr: function
    • addr(node: Arrayish): Promise<string>
    • Returns the address the supplied node resolves do, if we are the resolver.

      Parameters

      • node: Arrayish

        The namehash of the ENS address being requested

      Returns Promise<string>

      address The address the supplied node resolves to

  • appendReputationUpdateLog: function
    • appendReputationUpdateLog(_user: string, _amount: BigNumberish, _skillId: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Errors if it is called by anyone but a colony or if skill with id _skillId does not exist or. Adds a reputation update entry to log.

      Parameters

      • _user: string

        The address of the user for the reputation update

      • _amount: BigNumberish

        The amount of reputation change for the update, this can be a negative as well as a positive value

      • _skillId: BigNumberish

        The skill for the reputation update

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • approveExitRecovery: function
  • calculateMinerWeight: function
    • calculateMinerWeight(_timeStaked: BigNumberish, _submissonIndex: BigNumberish): Promise<BigNumber>
    • Calculate raw miner weight in WADs.

      Parameters

      • _timeStaked: BigNumberish

        Amount of time (in seconds) that the miner has staked their CLNY

      • _submissonIndex: BigNumberish

        Index of reputation hash submission (between 0 and 11)

      Returns Promise<BigNumber>

      minerWeight The weight of miner reward

  • checkNotAdditionalProtectedVariable: function
    • checkNotAdditionalProtectedVariable(_slot: BigNumberish): Promise<void>
    • No return value, but should throw if protected.This is public, but is only expected to be called from ContractRecovery; no need toexpose this to any users. Check whether the supplied slot is a protected variable specific to this contract

      Parameters

      • _slot: BigNumberish

        The storage slot number to check.

      Returns Promise<void>

  • createColony(address): function
    • createColony(address)(_tokenAddress: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • This is now deprecated and will be removed in a future versionFor the colony to mint tokens, token ownership must be transferred to the new colony Creates a new colony in the network, at version 3

      Parameters

      • _tokenAddress: string

        Address of an ERC20 token to serve as the colony token.

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

      colonyAddress Address of the newly created colony

  • createColony(address,uint256,string,string,bool): function
    • createColony(address,uint256,string,string,bool)(_tokenAddress: string, _version: BigNumberish, _colonyName: string, _orbitdb: string, _useExtensionManager: boolean, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • For the colony to mint tokens, token ownership must be transferred to the new colony Overload of the simpler createColony -- creates a new colony in the network with a variety of options

      Parameters

      • _tokenAddress: string

        Address of an ERC20 token to serve as the colony token

      • _version: BigNumberish

        The version of colony to deploy (pass 0 for the current version)

      • _colonyName: string

        The label to register (if null, no label is registered)

      • _orbitdb: string

        The path of the orbitDB database associated with the user profile

      • _useExtensionManager: boolean

        If true, give the ExtensionManager the root role in the colony

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

      colonyAddress Address of the newly created colony

  • createMetaColony: function
    • createMetaColony(_tokenAddress: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • deprecateSkill: function
    • deprecateSkill(_skillId: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • enterRecoveryMode: function
  • exitRecoveryMode: function
  • getChildSkillId: function
    • getChildSkillId(_skillId: BigNumberish, _childSkillIndex: BigNumberish): Promise<BigNumber>
    • Get the id of the child skill at index _childSkillIndex for skill with Id _skillId.

      Parameters

      • _skillId: BigNumberish

        Id of the skill

      • _childSkillIndex: BigNumberish

        Index of the skill.children array to get

      Returns Promise<BigNumber>

      skillId Skill Id of the requested child skill

  • getColony: function
    • getColony(_id: BigNumberish): Promise<string>
    • Get a colony address by its Id in the network.

      Parameters

      • _id: BigNumberish

        Id of the colony to get

      Returns Promise<string>

      colonyAddress The colony address, if no colony was found, returns 0x0

  • getColonyCount: function
    • getColonyCount(): Promise<BigNumber>
  • getColonyVersionResolver: function
    • getColonyVersionResolver(_version: BigNumberish): Promise<string>
    • Get the Resolver address for Colony contract version _version.

      Parameters

      • _version: BigNumberish

        The Colony contract version

      Returns Promise<string>

      resolverAddress Address of the Resolver contract

  • getCurrentColonyVersion: function
    • getCurrentColonyVersion(): Promise<BigNumber>
    • Returns the latest Colony contract version. This is the version used to create all new colonies.

      Returns Promise<BigNumber>

      version The current / latest Colony contract version

  • getENSRegistrar: function
    • getENSRegistrar(): Promise<string>
  • getFeeInverse: function
    • getFeeInverse(): Promise<BigNumber>
    • Return 1 / the fee to pay to the network. e.g. if the fee is 1% (or 0.01), return 100.

      Returns Promise<BigNumber>

      _feeInverse The inverse of the network fee

  • getMetaColony: function
    • getMetaColony(): Promise<string>
  • getMiningResolver: function
    • getMiningResolver(): Promise<string>
    • Get the resolver to be used by new instances of ReputationMiningCycle.

      Returns Promise<string>

      miningResolverAddress The address of the mining cycle resolver currently used by new instances

  • getParentSkillId: function
    • getParentSkillId(_skillId: BigNumberish, _parentSkillIndex: BigNumberish): Promise<BigNumber>
    • Get the id of the parent skill at index _parentSkillIndex for skill with Id _skillId.

      Parameters

      • _skillId: BigNumberish

        Id of the skill

      • _parentSkillIndex: BigNumberish

        Index 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

      Returns Promise<BigNumber>

      skillId Skill Id of the requested parent skill

  • getProfileDBAddress: function
    • getProfileDBAddress(node: Arrayish): Promise<string>
    • Retrieve the orbitdb address corresponding to a registered account.

      Parameters

      • node: Arrayish

        The Namehash of the account being queried.

      Returns Promise<string>

      orbitDB A string containing the address of the orbit database

  • getReplacementReputationUpdateLogEntry: function
    • getReplacementReputationUpdateLogEntry(_reputationMiningCycle: string, _id: BigNumberish): Promise<{ 0: string; 1: BigNumber; 2: BigNumber; 3: string; 4: BigNumber; 5: BigNumber; amount: BigNumber; colony: string; nPreviousUpdates: BigNumber; nUpdates: BigNumber; skillId: BigNumber; user: string }>
    • Get a replacement log entry (if set) for the log entry _id in the mining cycle that was at the address _reputationMiningCycle.

      Parameters

      • _reputationMiningCycle: string

        The address of the reputation mining cycle we are asking about

      • _id: BigNumberish

        The log entry number we wish to see if there is a replacement for

      Returns Promise<{ 0: string; 1: BigNumber; 2: BigNumber; 3: string; 4: BigNumber; 5: BigNumber; amount: BigNumber; colony: string; nPreviousUpdates: BigNumber; nUpdates: BigNumber; skillId: BigNumber; user: string }>

      reputationLogEntry ReputationLogEntry instance with the details of the log entry (if it exists)

  • getReplacementReputationUpdateLogsExist: function
    • getReplacementReputationUpdateLogsExist(_reputationMiningCycle: string): Promise<boolean>
    • Get whether any replacement log entries have been set for the supplied reputation mining cycle.Used by the client to avoid doubling the number of RPC calls when syncing from scratch.

      Parameters

      • _reputationMiningCycle: string

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

      Returns Promise<boolean>

      exists Boolean indicating whether there is a replacement log

  • getReputationMiningCycle: function
    • getReputationMiningCycle(_active: boolean): Promise<string>
    • 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

      • _active: boolean

        Whether the user wants the active or inactive reputation mining cycle

      Returns Promise<string>

      repMiningCycleAddress address of active or inactive ReputationMiningCycle

  • getReputationMiningSkillId: function
    • getReputationMiningSkillId(): Promise<BigNumber>
    • Get the skillId of the reputation mining skill. Only set once the metacolony is set up.

      Returns Promise<BigNumber>

      skillId The skillId of the reputation mining skill.

  • getReputationRootHash: function
    • getReputationRootHash(): Promise<string>
  • getReputationRootHashNNodes: function
    • getReputationRootHashNNodes(): Promise<BigNumber>
    • 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. Get the number of nodes in the current reputation state tree.

      Returns Promise<BigNumber>

      nNodes uint256 The number of nodes in the state tree

  • getSkill: function
    • getSkill(_skillId: BigNumberish): Promise<{ 0: BigNumber; 1: BigNumber; 2: BigNumber[]; 3: BigNumber[]; 4: boolean; 5: boolean; children: BigNumber[]; deprecated: boolean; globalSkill: boolean; nChildren: BigNumber; nParents: BigNumber; parents: BigNumber[] }>
    • Get the nParents and nChildren of skill with id _skillId.

      Parameters

      • _skillId: BigNumberish

        Id of the skill

      Returns Promise<{ 0: BigNumber; 1: BigNumber; 2: BigNumber[]; 3: BigNumber[]; 4: boolean; 5: boolean; children: BigNumber[]; deprecated: boolean; globalSkill: boolean; nChildren: BigNumber; nParents: BigNumber; parents: BigNumber[] }>

      skill The Skill struct

  • getSkillCount: function
    • getSkillCount(): Promise<BigNumber>
  • getTokenLocking: function
    • getTokenLocking(): Promise<string>
  • initialise: function
    • initialise(_resolver: string, _version: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Only allowed to be run once, by the Network owner before any Colony versions are added. Initialises the colony network by setting the first Colony version resolver to _resolver address.

      Parameters

      • _resolver: string

        Address of the resolver for Colony contract

      • _version: BigNumberish

        Version of the Colony contract the resolver represents

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • initialiseReputationMining: function
  • isColony: function
    • isColony(_colony: string): Promise<boolean>
    • Check if specific address is a colony created on colony network.

      Parameters

      • _colony: string

        Address of the colony

      Returns Promise<boolean>

      addressIsColony true if specified address is a colony, otherwise false

  • isInRecoveryMode: function
    • isInRecoveryMode(): Promise<boolean>
  • lookupRegisteredENSDomain: function
    • lookupRegisteredENSDomain(addr: string): Promise<string>
    • Reverse lookup a username from an address.

      Parameters

      • addr: string

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

      Returns Promise<string>

      domain A string containing the colony-based ENS name corresponding to addr

  • numRecoveryRoles: function
    • numRecoveryRoles(): Promise<BigNumber>
  • registerColonyLabel: function
    • registerColonyLabel(colonyName: string, orbitdb: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Register a "colony.joincolony.eth" label. Can only be called by a Colony.

      Parameters

      • colonyName: string

        The label to register.

      • orbitdb: string

        The path of the orbitDB database associated with the colony name

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • registerUserLabel: function
    • registerUserLabel(username: string, orbitdb: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Register a "user.joincolony.eth" label.

      Parameters

      • username: string

        The label to register

      • orbitdb: string

        The path of the orbitDB database associated with the user profile

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • removeRecoveryRole: function
  • setFeeInverse: function
    • setFeeInverse(_feeInverse: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Set the colony network fee to pay. e.g. if the fee is 1% (or 0.01), pass 100 as _feeInverse.

      Parameters

      • _feeInverse: BigNumberish

        The inverse of the network fee to set

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • setMiningResolver: function
    • setMiningResolver(miningResolverAddress: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Set the resolver to be used by new instances of ReputationMiningCycle.

      Parameters

      • miningResolverAddress: string

        The address of the Resolver contract with the functions correctly wired.

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • setRecoveryRole: function
  • setReplacementReputationUpdateLogEntry: function
    • setReplacementReputationUpdateLogEntry(_reputationMiningCycle: string, _id: BigNumberish, _user: string, _amount: BigNumberish, _skillId: BigNumberish, _colony: string, _nUpdates: BigNumberish, _nPreviousUpdates: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • 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. Set a replacement log entry if we're in recovery mode.

      Parameters

      • _reputationMiningCycle: string

        The address of the reputation mining cycle that the log was in.

      • _id: BigNumberish

        The number of the log entry in the reputation mining cycle in question.

      • _user: string

        The address of the user earning / losing the reputation

      • _amount: BigNumberish

        The amount of reputation being earned / lost

      • _skillId: BigNumberish

        The id of the origin skill for the reputation update

      • _colony: string

        The address of the colony being updated

      • _nUpdates: BigNumberish

        The number of updates the log entry corresponds to

      • _nPreviousUpdates: BigNumberish

        The number of updates in the log before this entry

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • setReputationRootHash: function
    • setReputationRootHash(newHash: Arrayish, newNNodes: BigNumberish, stakers: string[], reward: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Set a new Reputation root hash and starts a new mining cycle. Can only be called by the ReputationMiningCycle contract.

      Parameters

      • newHash: Arrayish

        The reputation root hash

      • newNNodes: BigNumberish

        The updated nodes count value

      • stakers: string[]

        Array of users who submitted or backed the hash, being accepted here as the new reputation root hash

      • reward: BigNumberish

        Amount of CLNY to be distributed as reward to miners

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • setStorageSlotRecovery: function
    • setStorageSlotRecovery(_slot: BigNumberish, _value: Arrayish, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • certain critical variables are protected from editing in this function Update value of arbitrary storage variable. Can only be called by user with recovery role.

      Parameters

      • _slot: BigNumberish

        Uint address of storage slot to be updated

      • _value: Arrayish

        word of data to be set

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • setTokenLocking: function
    • setTokenLocking(_tokenLockingAddress: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • setupRegistrar: function
    • setupRegistrar(_ens: string, _rootNode: Arrayish, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • startNextCycle: function
  • startTokenAuction: function
    • Create and start a new DutchAuction for the entire amount of _token owned by the Colony Network.

      Parameters

      • _token: string

        Address of the token held by the network to be auctioned

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • supportsInterface: function
    • supportsInterface(interfaceID: Arrayish): Promise<boolean>
    • Interface identification is specified in ERC-165. Query if a contract implements an interface

      Parameters

      • interfaceID: Arrayish

        The interface identifier, as specified in ERC-165

      Returns Promise<boolean>

      status true if the contract implements interfaceID

  • updateColonyOrbitDB: function
    • updateColonyOrbitDB(orbitdb: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Update a colony's orbitdb address. Can only be called by a colony with a registered subdomain

      Parameters

      • orbitdb: string

        The path of the orbitDB database to be associated with the colony

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

  • updateUserOrbitDB: function
    • updateUserOrbitDB(orbitdb: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
    • Update a user's orbitdb address. Can only be called by a user with a registered subdomain

      Parameters

      • orbitdb: string

        The path of the orbitDB database to be associated with the user

      • Optional overrides: TransactionOverrides

      Returns Promise<ContractTransaction>

interface

interface: IColonyNetworkInterface

network

network: Network

oneTxPaymentFactoryClient

oneTxPaymentFactoryClient: OneTxPaymentFactoryClient

provider

provider: Provider

reputationOracleEndpoint

reputationOracleEndpoint: string

signer

signer: Signer

Methods

_deployed

  • _deployed(blockTag?: BlockTag): Promise<Contract>
  • Parameters

    • Optional blockTag: BlockTag

    Returns Promise<Contract>

addColonyVersion

  • addColonyVersion(_version: BigNumberish, _resolver: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • 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

    • _version: BigNumberish

      The new Colony contract version

    • _resolver: string

      Address of the Resolver contract which will be used with the underlying EtherRouter contract

    • Optional overrides: TransactionOverrides

    Returns Promise<ContractTransaction>

addListener

  • addListener(eventName: EventFilter | string, listener: Listener): IColonyNetwork

addSkill

  • addSkill(_parentSkillId: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • Errors if the parent skill does not exist or if this is called by an unauthorised sender. 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.

    Parameters

    • _parentSkillId: BigNumberish

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

    • Optional overrides: TransactionOverrides

    Returns Promise<ContractTransaction>

    skillId Id of the added skill

addr

  • addr(node: Arrayish): Promise<string>
  • Returns the address the supplied node resolves do, if we are the resolver.

    Parameters

    • node: Arrayish

      The namehash of the ENS address being requested

    Returns Promise<string>

    address The address the supplied node resolves to

appendReputationUpdateLog

  • appendReputationUpdateLog(_user: string, _amount: BigNumberish, _skillId: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • Errors if it is called by anyone but a colony or if skill with id _skillId does not exist or. Adds a reputation update entry to log.

    Parameters

    • _user: string

      The address of the user for the reputation update

    • _amount: BigNumberish

      The amount of reputation change for the update, this can be a negative as well as a positive value

    • _skillId: BigNumberish

      The skill for the reputation update

    • Optional overrides: TransactionOverrides

    Returns Promise<ContractTransaction>

approveExitRecovery

attach

  • attach(addressOrName: string): IColonyNetwork

calculateMinerWeight

  • calculateMinerWeight(_timeStaked: BigNumberish, _submissonIndex: BigNumberish): Promise<BigNumber>
  • Calculate raw miner weight in WADs.

    Parameters

    • _timeStaked: BigNumberish

      Amount of time (in seconds) that the miner has staked their CLNY

    • _submissonIndex: BigNumberish

      Index of reputation hash submission (between 0 and 11)

    Returns Promise<BigNumber>

    minerWeight The weight of miner reward

checkNotAdditionalProtectedVariable

  • checkNotAdditionalProtectedVariable(_slot: BigNumberish): Promise<void>

connect

  • connect(signerOrProvider: Signer | Provider | string): IColonyNetwork

createColony(address)

  • createColony(address)(_tokenAddress: string, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • This is now deprecated and will be removed in a future versionFor the colony to mint tokens, token ownership must be transferred to the new colony Creates a new colony in the network, at version 3

    Parameters

    • _tokenAddress: string

      Address of an ERC20 token to serve as the colony token.

    • Optional overrides: TransactionOverrides

    Returns Promise<ContractTransaction>

    colonyAddress Address of the newly created colony

createColony(address,uint256,string,string,bool)

  • createColony(address,uint256,string,string,bool)(_tokenAddress: string, _version: BigNumberish, _colonyName: string, _orbitdb: string, _useExtensionManager: boolean, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • For the colony to mint tokens, token ownership must be transferred to the new colony Overload of the simpler createColony -- creates a new colony in the network with a variety of options

    Parameters

    • _tokenAddress: string

      Address of an ERC20 token to serve as the colony token

    • _version: BigNumberish

      The version of colony to deploy (pass 0 for the current version)

    • _colonyName: string

      The label to register (if null, no label is registered)

    • _orbitdb: string

      The path of the orbitDB database associated with the user profile

    • _useExtensionManager: boolean

      If true, give the ExtensionManager the root role in the colony

    • Optional overrides: TransactionOverrides

    Returns Promise<ContractTransaction>

    colonyAddress Address of the newly created colony

createMetaColony

  • createMetaColony(_tokenAddress: string, overrides?: TransactionOverrides): Promise<ContractTransaction>

deployToken

  • deployToken(name: string, symbol: string, decimals?: undefined | number): Promise<ContractTransaction>
  • Deploy an ERC20 token contract, compatible with Colony

    remarks

    For valid values see the spec here: https://eips.ethereum.org/EIPS/eip-20

    Parameters

    • name: string

      The token name. Can be any string. Be creative

    • symbol: string

      The symbol of the token (e.g. CLNY)

    • Optional decimals: undefined | number

      The number of token decimals

    Returns Promise<ContractTransaction>

    ethers compatible ContractTransaction

deployed

  • deployed(): Promise<IColonyNetwork>

deprecateSkill

  • deprecateSkill(_skillId: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>

emit

  • emit(eventName: EventFilter | string, ...args: Array<any>): boolean
  • Parameters

    • eventName: EventFilter | string
    • Rest ...args: Array<any>

    Returns boolean

enterRecoveryMode

exitRecoveryMode

fallback

  • fallback(overrides?: TransactionRequest): Promise<TransactionResponse>
  • Parameters

    • Optional overrides: TransactionRequest

    Returns Promise<TransactionResponse>

getChildSkillId

  • getChildSkillId(_skillId: BigNumberish, _childSkillIndex: BigNumberish): Promise<BigNumber>
  • Get the id of the child skill at index _childSkillIndex for skill with Id _skillId.

    Parameters

    • _skillId: BigNumberish

      Id of the skill

    • _childSkillIndex: BigNumberish

      Index of the skill.children array to get

    Returns Promise<BigNumber>

    skillId Skill Id of the requested child skill

getColony

  • getColony(_id: BigNumberish): Promise<string>

getColonyClient

  • getColonyClient(addressOrId: string | number): Promise<ColonyClient>
  • Get a ColonyClient instance for the currently deployed version of that Colony by providing the address or the integer colony number

    Parameters

    • addressOrId: string | number

      The colony address (string) or the auto-incremented Colony id (integer)

    Returns Promise<ColonyClient>

    The corresponding initialized ColonyClient instance

getColonyCount

  • getColonyCount(): Promise<BigNumber>

getColonyVersionResolver

  • getColonyVersionResolver(_version: BigNumberish): Promise<string>

getCurrentColonyVersion

  • getCurrentColonyVersion(): Promise<BigNumber>

getENSRegistrar

  • getENSRegistrar(): Promise<string>

getFeeInverse

  • getFeeInverse(): Promise<BigNumber>

getMetaColony

  • getMetaColony(): Promise<string>

getMetaColonyClient

getMiningResolver

  • getMiningResolver(): Promise<string>

getParentSkillId

  • getParentSkillId(_skillId: BigNumberish, _parentSkillIndex: BigNumberish): Promise<BigNumber>
  • Get the id of the parent skill at index _parentSkillIndex for skill with Id _skillId.

    Parameters

    • _skillId: BigNumberish

      Id of the skill

    • _parentSkillIndex: BigNumberish

      Index 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

    Returns Promise<BigNumber>

    skillId Skill Id of the requested parent skill

getProfileDBAddress

  • getProfileDBAddress(node: Arrayish): Promise<string>

getReplacementReputationUpdateLogEntry

  • getReplacementReputationUpdateLogEntry(_reputationMiningCycle: string, _id: BigNumberish): Promise<{ 0: string; 1: BigNumber; 2: BigNumber; 3: string; 4: BigNumber; 5: BigNumber; amount: BigNumber; colony: string; nPreviousUpdates: BigNumber; nUpdates: BigNumber; skillId: BigNumber; user: string }>
  • Get a replacement log entry (if set) for the log entry _id in the mining cycle that was at the address _reputationMiningCycle.

    Parameters

    • _reputationMiningCycle: string

      The address of the reputation mining cycle we are asking about

    • _id: BigNumberish

      The log entry number we wish to see if there is a replacement for

    Returns Promise<{ 0: string; 1: BigNumber; 2: BigNumber; 3: string; 4: BigNumber; 5: BigNumber; amount: BigNumber; colony: string; nPreviousUpdates: BigNumber; nUpdates: BigNumber; skillId: BigNumber; user: string }>

    reputationLogEntry ReputationLogEntry instance with the details of the log entry (if it exists)

getReplacementReputationUpdateLogsExist

  • getReplacementReputationUpdateLogsExist(_reputationMiningCycle: string): Promise<boolean>
  • Get whether any replacement log entries have been set for the supplied reputation mining cycle.Used by the client to avoid doubling the number of RPC calls when syncing from scratch.

    Parameters

    • _reputationMiningCycle: string

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

    Returns Promise<boolean>

    exists Boolean indicating whether there is a replacement log

getReputationMiningCycle

  • getReputationMiningCycle(_active: boolean): Promise<string>
  • 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

    • _active: boolean

      Whether the user wants the active or inactive reputation mining cycle

    Returns Promise<string>

    repMiningCycleAddress address of active or inactive ReputationMiningCycle

getReputationMiningSkillId

  • getReputationMiningSkillId(): Promise<BigNumber>

getReputationRootHash

  • getReputationRootHash(): Promise<string>

getReputationRootHashNNodes

  • getReputationRootHashNNodes(): Promise<BigNumber>

getSkill

  • getSkill(_skillId: BigNumberish): Promise<{ 0: BigNumber; 1: BigNumber; 2: BigNumber[]; 3: BigNumber[]; 4: boolean; 5: boolean; children: BigNumber[]; deprecated: boolean; globalSkill: boolean; nChildren: BigNumber; nParents: BigNumber; parents: BigNumber[] }>
  • Get the nParents and nChildren of skill with id _skillId.

    Parameters

    • _skillId: BigNumberish

      Id of the skill

    Returns Promise<{ 0: BigNumber; 1: BigNumber; 2: BigNumber[]; 3: BigNumber[]; 4: boolean; 5: boolean; children: BigNumber[]; deprecated: boolean; globalSkill: boolean; nChildren: BigNumber; nParents: BigNumber; parents: BigNumber[] }>

    skill The Skill struct

getSkillCount

  • getSkillCount(): Promise<BigNumber>

getTokenLocking

  • getTokenLocking(): Promise<string>

getTokenLockingClient

initialise

  • initialise(_resolver: string, _version: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • Only allowed to be run once, by the Network owner before any Colony versions are added. Initialises the colony network by setting the first Colony version resolver to _resolver address.

    Parameters

    • _resolver: string

      Address of the resolver for Colony contract

    • _version: BigNumberish

      Version of the Colony contract the resolver represents

    • Optional overrides: TransactionOverrides

    Returns Promise<ContractTransaction>

initialiseReputationMining

isColony

  • isColony(_colony: string): Promise<boolean>

isInRecoveryMode

  • isInRecoveryMode(): Promise<boolean>

listenerCount

  • listenerCount(eventName?: EventFilter | string): number
  • Parameters

    • Optional eventName: EventFilter | string

    Returns number

listeners

  • listeners(eventName: EventFilter | string): Array<Listener>
  • Parameters

    • eventName: EventFilter | string

    Returns Array<Listener>

lookupRegisteredENSDomain

  • lookupRegisteredENSDomain(addr: string): Promise<string>

lookupRegisteredENSDomainWithGoerliPatch

  • lookupRegisteredENSDomainWithGoerliPatch(address: string): Promise<string>
  • Like lookupRegisteredENSDomain, but also working on the Goerli testnet

    remarks

    On Goerli, all ens domains have the .test suffix. The contracts return .eth anyways. We patch the original function to fix this problem. On any other network it will return the original function

    Parameters

    • address: string

    Returns Promise<string>

    an ENS name in the form of [username].user.joincolony.eth or [colonyName].colony.joincolony.eth

numRecoveryRoles

  • numRecoveryRoles(): Promise<BigNumber>

on

  • on(event: EventFilter | string, listener: Listener): IColonyNetwork

once

  • once(event: EventFilter | string, listener: Listener): IColonyNetwork

registerColonyLabel

  • registerColonyLabel(colonyName: string, orbitdb: string, overrides?: TransactionOverrides): Promise<ContractTransaction>

registerUserLabel

  • registerUserLabel(username: string, orbitdb: string, overrides?: TransactionOverrides): Promise<ContractTransaction>

removeAllListeners

  • removeAllListeners(eventName: EventFilter | string): IColonyNetwork

removeListener

  • removeListener(eventName: any, listener: Listener): IColonyNetwork

removeRecoveryRole

setFeeInverse

  • setFeeInverse(_feeInverse: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>

setMiningResolver

  • setMiningResolver(miningResolverAddress: string, overrides?: TransactionOverrides): Promise<ContractTransaction>

setRecoveryRole

setReplacementReputationUpdateLogEntry

  • setReplacementReputationUpdateLogEntry(_reputationMiningCycle: string, _id: BigNumberish, _user: string, _amount: BigNumberish, _skillId: BigNumberish, _colony: string, _nUpdates: BigNumberish, _nPreviousUpdates: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • 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. Set a replacement log entry if we're in recovery mode.

    Parameters

    • _reputationMiningCycle: string

      The address of the reputation mining cycle that the log was in.

    • _id: BigNumberish

      The number of the log entry in the reputation mining cycle in question.

    • _user: string

      The address of the user earning / losing the reputation

    • _amount: BigNumberish

      The amount of reputation being earned / lost

    • _skillId: BigNumberish

      The id of the origin skill for the reputation update

    • _colony: string

      The address of the colony being updated

    • _nUpdates: BigNumberish

      The number of updates the log entry corresponds to

    • _nPreviousUpdates: BigNumberish

      The number of updates in the log before this entry

    • Optional overrides: TransactionOverrides

    Returns Promise<ContractTransaction>

setReputationRootHash

  • setReputationRootHash(newHash: Arrayish, newNNodes: BigNumberish, stakers: string[], reward: BigNumberish, overrides?: TransactionOverrides): Promise<ContractTransaction>
  • Set a new Reputation root hash and starts a new mining cycle. Can only be called by the ReputationMiningCycle contract.

    Parameters

    • newHash: Arrayish

      The reputation root hash

    • newNNodes: BigNumberish

      The updated nodes count value

    • stakers: string[]

      Array of users who submitted or backed the hash, being accepted here as the new reputation root hash

    • reward: BigNumberish

      Amount of CLNY to be distributed as reward to miners

    • Optional overrides: TransactionOverrides

    Returns Promise<ContractTransaction>

setStorageSlotRecovery

  • setStorageSlotRecovery(_slot: BigNumberish, _value: Arrayish, overrides?: TransactionOverrides): Promise<ContractTransaction>

setTokenLocking

  • setTokenLocking(_tokenLockingAddress: string, overrides?: TransactionOverrides): Promise<ContractTransaction>

setupRegistrar

  • setupRegistrar(_ens: string, _rootNode: Arrayish, overrides?: TransactionOverrides): Promise<ContractTransaction>

startNextCycle

startTokenAuction

supportsInterface

  • supportsInterface(interfaceID: Arrayish): Promise<boolean>

updateColonyOrbitDB

  • updateColonyOrbitDB(orbitdb: string, overrides?: TransactionOverrides): Promise<ContractTransaction>

updateUserOrbitDB

  • updateUserOrbitDB(orbitdb: string, overrides?: TransactionOverrides): Promise<ContractTransaction>

Static isIndexed

  • isIndexed(value: any): value is Indexed
  • Parameters

    • value: any

    Returns value is Indexed

Generated using TypeDoc