Skip to content

Commit b99f6f9

Browse files
authored
Merge pull request #577 from JoinColony/docs/spring-improvements
Docs/spring improvements
2 parents f67bdb7 + 0a4a15d commit b99f6f9

23 files changed

+326
-109
lines changed

docs/_Docs_GetStarted.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
---
22
title: Get Started
33
section: Docs
4-
order: 2
4+
order: 4
55
---
66

7-
The [colonyNetwork](https://github.com/JoinColony/colonyNetwork) smart contracts are currently live on `rinkeby` and will soon be live on `mainnet` but the best way to get started is to run your own version on a local network for testing and development.
7+
The [glider](https://github.com/JoinColony/colonyNetwork) release is currently live on `rinkeby` and will soon be deployed on `mainnet`.
88

9-
## Prerequisites
9+
This page is written for developers contributing features or direct smart contract extensions with the Colony Network.
10+
11+
See our [guidelines](https://github.com/JoinColony/colonyNetwork/blob/develop/docs/CONTRIBUTING.md) if you're interested in contributing to the colonyNetwork codebase.
12+
13+
If you want to build a dapp or other integration that doesn't directly extend the Colony Network contracts, it's recommended that you use colonyJS. Analogous instructions for colonyJS can be found in [Local Setup](/colonyjs/intro-local-setup/) for colonyJS.
1014

11-
First of all, we will need to make sure we have all the necessary prerequisites.
15+
An even more 'complete' starting point is the [colonyStarter kit](/colonystarter/docs-overview/), which contains boilerplate examples for dapp development, including frontend frameworks like react.
16+
17+
## Prerequisites
1218

1319
### Node
1420

docs/_Docs_NetworkOverview.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

docs/_Docs_Overview.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Overview
3+
section: Docs
4+
order: 1
5+
---
6+
7+
*The colonyNetwork repository is developed as free software; if you are interested in contributing, or want to report an issue or bug, please see the [GitHub repository.](https://github.com/JoinColony/colonyNetwork)*
8+
9+
The Colony Network is a large set of contracts that together define how all colonies operate and interact with people and other smart contracts on the Ethereum blockchain.
10+
11+
Colony is designed to be modular, upgradable, and eternally backwards-compatible. This is achieved through a sophisticated contract architecture that requires a bit of exposition. It is recommended that any developer seeking to understand the Colony Network solidity implementation first read the [Colony Whitepaper](https://colony.io/whitepaper/), or at the very least, the [whitepaper Whitepaper TL;DR](/colonynetwork/whitepaper-tldr-colony/).
12+
13+
==TOC==
14+
15+
## Overview of Contracts
16+
Broadly speaking, the Colony Network contracts can be divided into a few categories:
17+
18+
* Core contracts that facilitate upgrades, versioning, and emergency functions
19+
* `EtherRouter.sol`
20+
* `Resolver.sol`
21+
* `ContractRecovery.sol`
22+
* `ContractEditing.sol`
23+
24+
* Interface contracts that collate and register public functions on the network.
25+
* `IColony.sol`
26+
* `IMetaColony.sol`
27+
* `IColonyNetwork.sol`
28+
* `IReputationMiningCycle.sol`
29+
* `ITokenLocking.sol`
30+
* `IRecovery.sol`
31+
32+
* Authority contracts that define who can call which registered functions.
33+
* `CommonAuthority.sol`
34+
* `ColonyAuthority.sol`
35+
* `ColonyNetworkAuthority.sol`
36+
37+
* Colony contracts that define the state of an individual colony, such as funding pots, tasks, domains, and skills.
38+
* `Colony.sol`
39+
* `ColonyFunding.sol`
40+
* `ColonyTask.sol`
41+
* `ColonyStorage.sol`
42+
* `ColonyDataTypes.sol`
43+
44+
* Network contracts that define a global state shared by all colonies, such as reputation, token auctions and ENS.
45+
* `ColonyNetwork.sol`
46+
* `ColonyNetworkAuction.sol`
47+
* `ColonyNetworkENS.sol`
48+
* `ColonyNetworkMining.sol`
49+
* `ColonyNetworkStorage.sol`
50+
* `ColonyNetworkDataTypes.sol`
51+
52+
* Reputation Mining contracts that define a consensus protocol for validators of the global reputation state.
53+
* `ReputationMiningCycle.sol`
54+
* `ReputationMiningCycleDataTypes.sol`
55+
* `ReputationMiningCycleStorage.sol`
56+
* `ReputationMiningCycleRespond.sol`
57+
58+
* Token contracts that define the CLNY token.
59+
* `TokenLocking.sol`
60+
* `TokenLockingStorage.sol`
61+
* `TokenLockingDataTypes.sol`
62+
63+
64+
## Inheritance Architecture
65+
The Colony Network contracts are separated out into functional layers, and named according to their context.
66+
67+
![Interface, Logic, Data](img/architecture_colonyNetwork_r7.png)
68+
69+
Starting from the lowest level, all data types are declared in a DataTypes contract.
70+
71+
All storage variables are declared and stored in a storage contract, which inherits a DataTypes contract.
72+
73+
The actual logic of functions is implemented in separate contracts, which inherit a storage contract. All functions which are implemented in this layer must only modify storage varibles declared in the appropriate storage contract.
74+
75+
Finally, all public functions are composed from all logic contracts into a single interface contract, which is used to register functions with EtherRouter (see the next section).

docs/_Docs_Releases.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Releases
3+
section: Docs
4+
order: 3
5+
---
6+
7+
8+
The current colonyNetwork release is `glider`, which implements some, but not all, of the Colony Protocol:
9+
10+
* Tokens and Funding pots
11+
* Reputation
12+
* Funding Pots and payments
13+
* Single-level domains
14+
* Skill tags
15+
* Tasks and work ratings
16+
* Roles and domain-level permissions
17+
* ENS

docs/_Docs_Upgrades.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
11
---
2-
title: Upgrades to the Colony Network
2+
title: The Delegate Proxy Pattern
33
section: Docs
4-
order: 10
4+
order: 2
55
---
6+
The contracts comprising the Colony Network are upgradeable using the Delegate Proxy design pattern.
67

7-
Improvements to the Colony Network are expected to be continuously developed and periodically deployed.
8+
Providing an upgrade path is important to allow for the continuous improvement of the Colony Network. At the same time, all depreciated versions of Colony should remain functional indefinitely after deployment, so that the organizations created are not predicated upon the actions/efforts of a third party.
89

9-
Providing an upgrade path is important to allow people to use Colony without preventing themselves using new features as they are added to the Network. At the same time, all depreciated versions of Colony should remain functional indefinitely after deployment, so that the organizations created are not predicated upon the actions/efforts of a third party.
10+
In other words, upgrades to any individual colony on the network are "opt-in", while the network as a whole remains eternally backwards-compatible.
1011

11-
The contracts comprising the Colony Network are upgradeable using the design pattern called EtherRouter.
12+
## For whom the delegate calls
13+
Interacting with both the Colony Network and individual colonies on the network is somewhat different than many other smart contract interactions that a blockchain developer might not be accustomed to.
1214

13-
## EtherRouter
14-
This pattern uses two contracts in addition to the contract(s) providing their intended functionality:
15+
Rather than calling functions directly from the contract in which they are deployed, all transactions are signed and sent to the `EtherRouter` contract.
1516

16-
* The `EtherRouter` contract which passes transactions (via `delegatecall`) to the contract that implements the called function.
17-
* A `Resolver` contract where the addresses of the contracts that implement the desired function are defined.
17+
Whenever a transaction is received by the `EtherRouter` contract, it looks the function up in a `Resolver` contract, using the function signature.
1818

19-
Whenever a transaction is received by the `EtherRouter` contract, it looks up the contract that implements that function (if any) in the `Resolver`, and then `delegatecall`s that contract.
19+
The `Resolver` contract contains a mapping of whitelisted function signatures to addresses (`mapping ( bytes4 => address )`).
20+
21+
A function signature lookup will return the address of the contracts that implement the desired function. `EtherRouter` in turn calls the function via `delegatecall`, and passes any returns from the call back to `msg.sender`.
2022

2123
![EtherRouter](img/delegateProxyCallchain_1.png)
2224

23-
In order to upgrade, new contracts are deployed with new functionality, and then contracts that the `Resolver` contract points to must be changed to point to these new contracts.
25+
This pattern enables both fine-grained control of permissions for individual functions (see below), well as eternal backwards-compatibility following network upgrades. To learn more about planned upgrades to the Colony Network, please see [Releases](/colonynetwork/docs-releases/).
26+
27+
## It calls for `roleId`
28+
Most functions in colony are *authorized* by a separate contract which defines the rules for who can call which functions. Any function that is decorated with the `auth` modifier will perform an authorization check before granting access to the function.
29+
30+
In the current Glider release, authority is based on roles, which are defined in the relevant "authority" contracts, e.g. `ColonyAuthority.sol`.
31+
32+
Roles within Colony act as a white-list for functions, registering specific addresses to a `Founder` or `Admin` role, approved to call a certain set of functions within a colony.
2433

25-
In order to avoid a situation where the contract partially implements both old and new functionality, a new instance of `Resolver` will be deployed for each upgrade, and then a single transaction can point `EtherRouter` at the new Resolver.
34+
Roles also are used in task-level permissions. A more specific example of task roles can be seen in the [task workflow](https://docs.colony.io/colonyjs/topics-task-lifecycle/#task-roles).
2635

27-
This pattern applies for both upgrades to individual colonies as well as to the Network-level contracts.
36+
In future releases, this pattern will allow for reputation-mediated authority in Colony.

docs/_Intro_Welcome.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Welcome
3+
section: Intro
4+
order: 0
5+
---
6+
7+
Colony is a platform for organizations that operate via software rather than paperwork and management hierarchy.
8+
9+
At its core, a colony is a set of smart contracts that describe all aspects of a traditional organization, as well as some new capabilities that would only be possible using a decentralized protocol like Ethereum.
10+
11+
It's infrastructure for the future of the firm, built to organize/incentivize teams, projects, and communities.
12+
13+
### The Colony Protocol
14+
15+
The Colony whitepaper describes a complete protocol for organizations, with crypto-economic processes for:
16+
17+
* Ownership and permissions
18+
* Reputation
19+
* Dispute resolution and decision-making
20+
* Work management and delegation
21+
* Financial management, including rewards and payments
22+
23+
To learn more about the Colony Protocol, dig in to the [Colony Whitepaper](https://colony.io/whitepaper/) or read the [whitepaper TL;DR](/colonynetwork/whitepaper-tldr-colony/)
24+
25+
### The Colony Network
26+
The Colony Network is the infrastructure upon which all colonies run.
27+
28+
The colonyNetwork repository contains the solidity implementation of Colony, which is developed as free software. See our [guidelines](https://github.com/JoinColony/colonyNetwork/blob/develop/docs/CONTRIBUTING.md) if you're interested in contributing to the colonyNetwork codebase. Developers interested in contributing to the Colony Network are encouraged to look at the code on [GitHub](https://github.com/JoinColony/colonyNetwork), and to come say hi on [Gitter](https://gitter.im/JoinColony/colonyNetwork).
29+
30+
The current colonyNetwork release is [glider]. Glider implements some, but not all, of the Colony Protocol:
31+
32+
* Ownership and permissions (through roles)
33+
* Reputation
34+
* Funding Pots and payments
35+
* Domains and Skills
36+
* Tasks and work ratings
37+
38+
To learn more about Glider, see the [releases] page.
39+
40+
The Colony Network is maintained and improved by the [Meta Colony] (which is, itself, a colony on the network with special permissions).
41+
42+
Membership in the Meta Colony is open to all (and heartily encouraged!), but changes such as [network upgrades](/colonynetwork/docs-the-delegate-proxy-pattern/) require a minimum *reputation* within the Meta Colony to proceed.
43+
44+
### ColonyJS (and colonyStarter?)
45+
ColonyJS is a javascript library designed to make interaction with the Colony Network as straightforward as possible for (d)app developers.
46+
47+
Using colonyJS, all of the functions of a colony can be imported and called as methods within a javascript application.
48+
49+
Things like parsing returned parameters from a transaction, connecting to the right network version, and signing transactions with a wallet provider are all handled by this library.
50+
51+
To learn more about how to use colonyJS with your (d)app, or to get specific info about the colonyJS API, see [the colonyJS docs]
52+
53+
### Developer Forums (to switch to developer portal)
54+
If you didn't get here from there, have a look at our developer portal for links to [tutorials], [starter kits], and [developer forums].
55+
56+
Or, if you're feeling old skool and just want to chat, send an email to [email protected] to chat with our DevRel team. We're nice people!

0 commit comments

Comments
 (0)