From 1956e909b7580f0a2ce3f9b2a11abfb7d6b71ea7 Mon Sep 17 00:00:00 2001 From: Christian Maniewski Date: Thu, 14 Jun 2018 17:33:56 +0200 Subject: [PATCH 1/4] Minor loader changes - Make address not required per default in query - Remove network from contract query --- packages/colony-js-contract-loader/src/defaults.js | 2 +- .../colony-js-contract-loader/src/interface/ContractLoader.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/colony-js-contract-loader/src/defaults.js b/packages/colony-js-contract-loader/src/defaults.js index be1d0e20e..e6cad3605 100644 --- a/packages/colony-js-contract-loader/src/defaults.js +++ b/packages/colony-js-contract-loader/src/defaults.js @@ -3,6 +3,6 @@ // eslint-disable-next-line import/prefer-default-export export const DEFAULT_REQUIRED_CONTRACT_PROPS = { abi: true, - address: true, + address: false, bytecode: false, }; diff --git a/packages/colony-js-contract-loader/src/interface/ContractLoader.js b/packages/colony-js-contract-loader/src/interface/ContractLoader.js index 43723e2ff..1cd044acb 100644 --- a/packages/colony-js-contract-loader/src/interface/ContractLoader.js +++ b/packages/colony-js-contract-loader/src/interface/ContractLoader.js @@ -3,7 +3,6 @@ export type Query = { contractAddress?: string, contractName?: string, - networkId?: number, routerAddress?: string, routerName?: string, version?: string, From 57d44b05ca3e489b8e47f11aa928e1c58d8e7b7d Mon Sep 17 00:00:00 2001 From: Christian Maniewski Date: Thu, 14 Jun 2018 18:37:30 +0200 Subject: [PATCH 2/4] Remove networkId definition from truffleTransform --- .../src/transforms/truffleTransform.js | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/packages/colony-js-contract-loader/src/transforms/truffleTransform.js b/packages/colony-js-contract-loader/src/transforms/truffleTransform.js index 80070f50a..e0afe4153 100644 --- a/packages/colony-js-contract-loader/src/transforms/truffleTransform.js +++ b/packages/colony-js-contract-loader/src/transforms/truffleTransform.js @@ -1,7 +1,5 @@ /* @flow */ -import type { Query } from '../interface/ContractLoader'; - type TruffleArtifact = { abi: Array<{}>, bytecode: string, @@ -12,23 +10,15 @@ type TruffleArtifact = { }, }; -export default function truffleTransform( - { abi = [], bytecode, networks = {} }: TruffleArtifact = {}, - { networkId }: Query = {}, -) { - let address; - +export default function truffleTransform({ + abi = [], + bytecode, + networks = {}, +}: TruffleArtifact = {}) { const networkIds = Object.keys(networks); - - if (networkId && networkIds.length) { - if (!networks[networkId]) - throw new Error(`Network ID ${networkId} not found in contract`); - ({ address } = networks[networkId]); - } else { - // Pick the last network (assumed to be the most recent) - ({ address } = - networks[parseInt(networkIds[networkIds.length - 1], 10)] || {}); - } + // Pick the last network (assumed to be the most recent) + const { address } = + networks[parseInt(networkIds[networkIds.length - 1], 10)] || {}; return { abi, From bcc33b66594aefa323f914452f1756fd7939b6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Lefr=C3=A8re?= Date: Fri, 15 Jun 2018 11:22:57 +0200 Subject: [PATCH 3/4] Fix docs link --- docs/_Docs_GetStarted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_Docs_GetStarted.md b/docs/_Docs_GetStarted.md index b4f4b6c17..d1cf3d5fb 100644 --- a/docs/_Docs_GetStarted.md +++ b/docs/_Docs_GetStarted.md @@ -176,7 +176,7 @@ Save the file, and run with `$ node example.js` - You should see your new cool c ## Funding your Colony -Whether you've brought your ERC20 token from an existing token contract or created a new one at the same time as the colony (as shown in the above example), you can use the [tokenClient](/colonyJS/api-tokenclient/) to call and sent transactions relating to your colony's funding. This client handles all the functions in the ERC20 standard interface, as well as `mint` and `burn`. Functions that would ordinarily be performed by the contract owner may be performed by anyone in the colony with ADMIN authority. You can learn more about authority roles in the [authorityClient API](/docs-authorityclient/). +Whether you've brought your ERC20 token from an existing token contract or created a new one at the same time as the colony (as shown in the above example), you can use the [tokenClient](/colonyJS/api-tokenclient/) to call and sent transactions relating to your colony's funding. This client handles all the functions in the ERC20 standard interface, as well as `mint` and `burn`. Functions that would ordinarily be performed by the contract owner may be performed by anyone in the colony with ADMIN authority. You can learn more about authority roles in the [authorityClient API](/colonyJS/api-authorityclient/). Your colony's token is an important component in the [reputation system](/colonyNetwork/docs-reputation/). Any task payouts in the native token of the colony grant the recipient reputation (proportional to the task rating). Any member of the colony's combined reputation and token holdings determine the amount they can claim from the [rewards pot](/colonyNetwork/docs-pots-and-funding/). From 6f3e97111af00889c1200ba56a4de864f529e08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Lefr=C3=A8re?= Date: Fri, 15 Jun 2018 11:24:08 +0200 Subject: [PATCH 4/4] docgen --- docs/_API_ColonyClient.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_API_ColonyClient.md b/docs/_API_ColonyClient.md index 89424b530..e0ab27280 100644 --- a/docs/_API_ColonyClient.md +++ b/docs/_API_ColonyClient.md @@ -410,7 +410,7 @@ Sets the payout given to the MANAGER role when the task is finalized. This Sende |Argument|Type|Description| |---|---|---| |taskId|number|Integer taskId.| -|source|Payable address|ddress to send funds from, e.g. the token's contract address, or empty address (`0x0` for Ether)| +|source|Payable address|Address to send funds from, e.g. the token's contract address, or empty address (`0x0` for Ether)| |amount|BigNumber|Amount to be paid.| **Returns**