colonyClient issue while connecting

I am facing an issue while creating colony client.
Here is link of referral docs : https://colony.io/dev/docs/colonyjs/intro-get-started
Here is the error.

1 Like

Hey @Vishal_Yadav!

I just ran through the instructions again and could not replicate the issue. Hmm…

Are you using a local testnet rather than goerli or mainnet? If so, it looks like you deployed an older version of the colonyNetwork contracts and you are using the latest version of colonyJS.

1 Like

Actually, this should not be an error in the latest version of colonyJS and is now an optional log in verbose mode. Are you using the latest version of colonyJS (ie, 1.13.1)?

1 Like

Yes I am using latest version (i.e. , 1.13.1 )

Currently I am using local testnet. I also tried using goerli all steps are ok but at payment claiming process it shows Error message: gas required exceeds allowance (8000000) or always failing transaction. I have .0399 ETH in my goerli testnet account

Ok, I was able to reproduce using a local testnet by following the instructions in Local Setup. It looks like the issue is the colonyJS version but it’s because the latest tag on npm is not set to 1.13.2, which is actually the latest version. The issue should be resolved if you update your package.json:

    "@colony/colony-js-client": "^1.13.2",

Sorry about that! Not sure why 1.13.2 was not updated to latest on npm when published. Let me know if updating to 1.13.2 solves the issue for you as well.

1 Like

Thanks now colony client issue is solved but at Payment claim another error occurs


In case of goerli testnet payment claim issue is :

Here is my package.json file :
packagefile

This problem is solved as @ryanchristo mentioned above the issue is of using different version. This is solved by using colony-starter.

1 Like

Looks like you found the solution in colony-starter! The colony-token-unauthorizd revert error might have been caused by missing a step.

Unfortunately the error is not as clear on goerli but sometimes the gasLimit is not estimated correctly and increasing the gasLimit will resolve the issue. For example:

  await colonyClient.claimPayment.send({
    paymentId,
    token: tokenAddress,
  }, {
    gasLimit: 100000
  });
1 Like

@ryanchristo thanks for the support.

1 Like

Hi I have been having a simlar problem. I’m using a local setup with the colony-example-vue build. I created the colony.js from https://colony.io/dev/docs/colonyjs/intro-get-started and most of colony.js succeeds except for the payment claim:

| => node colony

Wallet Address: 0xb77D57F4959eAfA0339424b83FcFaf9c15407461
Network Address: 0xde3EDaBA7c15F845F59D1058eCD70Ed33FfdB2b9
Token Address: 0x0aE8B6525A0a030d25048d60a4641fC8Df8f089f
Colony Address: 0x0a0e9A5781B26D9450D5e1D53aBB3dA887a67d7F
Tokens minted!
Colony funds claimed!
Payment Data: { paymentId: 1, potId: 2 }
Funds moved to payment pot!
Payment finalized!
{ Error: VM Exception while processing transaction: revert colony-token-unauthorised
at getResult (/Users/heiho1/dev/ether/911-data/node_modules/ethers/providers/json-rpc-provider.js:34:21)
at exports.XMLHttpRequest.request.onreadystatechange (/Users/heiho1/dev/ether/911-data/node_modules/ethers/providers/provider.js:621:30)
at exports.XMLHttpRequest.dispatchEvent (/Users/heiho1/dev/ether/911-data/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
at setState (/Users/heiho1/dev/ether/911-data/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
at IncomingMessage. (/Users/heiho1/dev/ether/911-data/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:447:13)
at IncomingMessage.emit (events.js:198:15)
at endReadableNT (_stream_readable.js:1139:12)
at processTicksAndRejections (internal/process/task_queues.js:81:17)
code: -32000,
data:
{ ‘0x0113aa2dbea9c4e282d5c00cbb11600a97b4de7e14adedc3e3f0b141203263ae’:
{ error: ‘revert’,
program_counter: 297,
return:
‘0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000019636f6c6f6e792d746f6b656e2d756e617574686f726973656400000000000000’,
reason: ‘colony-token-unauthorised’ },
stack:
‘o: VM Exception while processing transaction: revert colony-token-unauthorised\n at Function.o.fromResults (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:10:81931)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:115793\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:96242\n at p (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:95899)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:95952\n at t.default (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:52:487932)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:96866\n at w.n.emit (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:61:1220752)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:61:1859551\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:61:1859574\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:61:509144\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:2:26262\n at i (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:2:41317)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:2:21785\n at processTicksAndRejections (internal/process/task_queues.js:79:9)’,
name: ‘o’ },
url: ‘http://localhost:8545’,
body:
‘{“method”:“eth_sendRawTransaction”,“params”:[“0xf8aa81e88504a817c80082f216940a0e9a5781b26d9450d5e1d53abb3da887a67d7f80b8440f4c52f300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000ae8b6525a0a030d25048d60a4641fc8df8f089f25a037d7444e393157b144de26f71f59d2c92a15ef5def14faa293a40f03d9a2177ea079651c0a2c43ffe8869d4a770e2bcac8ae54739ef55a463534f7953764d37f0b”],“id”:42,“jsonrpc”:“2.0”}’,
responseText:
‘{“id”:42,“jsonrpc”:“2.0”,“result”:“0x0113aa2dbea9c4e282d5c00cbb11600a97b4de7e14adedc3e3f0b141203263ae”,“error”:{“message”:“VM Exception while processing transaction: revert colony-token-unauthorised”,“code”:-32000,“data”:{“0x0113aa2dbea9c4e282d5c00cbb11600a97b4de7e14adedc3e3f0b141203263ae”:{“error”:“revert”,“program_counter”:297,“return”:“0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000019636f6c6f6e792d746f6b656e2d756e617574686f726973656400000000000000”,“reason”:“colony-token-unauthorised”},“stack”:“o: VM Exception while processing transaction: revert colony-token-unauthorised\n at Function.o.fromResults (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:10:81931)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:115793\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:96242\n at p (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:95899)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:95952\n at t.default (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:52:487932)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:47:96866\n at w.n.emit (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:61:1220752)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:61:1859551\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:61:1859574\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:61:509144\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:2:26262\n at i (/Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:2:41317)\n at /Users/heiho1/dev/ether/911-data/node_modules/ganache-cli/build/ganache-core.node.cli.js:2:21785\n at processTicksAndRejections (internal/process/task_queues.js:79:9)”,“name”:“o”}}}’ }

How may I debug this failure? I’m fairly new to the Colony contracts but I’m mainly looking for the source of the revert.

Thanks,

James

1 Like

Hi James,

First off, sorry for the difficulty you’ve encountered with the tutorial. That looks like it’s our fault.

The key line in that trace is:

Error: VM Exception while processing transaction: revert colony-token-unauthorised

That’s suggesting that the transfer is being prevented by the token. While it does not appear to be mentioned in the tutorial you have followed, if you are using our ERC20 Token implementation (as the tutorial suggests), there is an additional choice to make regarding the token.

By default, our token does not allow arbitrary transfers between accounts i.e. Alice cannot send tokens to Bob as-is. There are two solutions, depending on the use case you are looking for.

Option 1. Allow everyone to transfer tokens as normal.
This is the choice you should probably go for if you’re unsure, as it’s the behaviour most tokens exhibit. To unlock the token, add the line

await colonyClient.tokenClient.unlock.send();

to the script the tutorial gets you to make, any time after colonyClient is defined - step six where the tokens are being minted is a good place, for example.

Option 2. Only allow some people to transfer tokens as normal
To do this, add the following code in the same place as option 1 (i.e. at the end of step six).

const tokenAuthorityAddress = await colonyClient.tokenClient.createTokenAuthority.send({allowedToTransfer: [], colonyAddress, tokenAddress});
await colonyClient.tokenClient.setAuthority.send({authority: tokenAuthorityAddress.meta.receipt.contractAddress})

This creates a TokenAuthority which defines who is allowed to send tokens. With the above code, the colony is the only additional address that is able to send tokens (as well as mint them). So the payout from the tutorial would work, but the recipient would be unable to send them on (unless they are you, the owner of the token). To add additional addresses that are able to send tokens (but not mint them), add them to the (currently empty) array passed in as the allowedToTransfer parameter. As I say, however, option 1 is probably what you want for now.

Apologies again for the fact this was missing from the tutorial and I hope it hasn’t dented your enthusiasm for working with the contracts. Feel free to reach out again if you run in to any more difficulty.

1 Like

Hi area,

That was indeed the problem.

Updating my colony.js to

  // Step 11: Unlock Token

await colonyClient.tokenClient.unlock.send();
console.log(‘Token unlocked’);

// Step 12: Claim Payment
await colonyClient.claimPayment.send({
paymentId,
token: tokenAddress,
});

produces the desired result:

| => node colony

Wallet Address: 0xb77D57F4959eAfA0339424b83FcFaf9c15407461
Network Address: 0xde3EDaBA7c15F845F59D1058eCD70Ed33FfdB2b9
Token Address: 0xdE2Cb5D1D657880b51457831C44768B8612EC866
Colony Address: 0x0a0e9A5781B26D9450D5e1D53aBB3dA887a67d7F
Tokens minted!
Colony funds claimed!
Payment Data: { paymentId: 1, potId: 2 }
Funds moved to payment pot!
Payment finalized!
Token unlocked
Payment claimed!

I’m actually evaluating Colony for a non-profit organization so it’s my job to work through such issues and I’m happy to do so.

Thanks for the speedy response!

1 Like