Build on aragonOS #62
@ -6,6 +6,7 @@ const argv = require('yargs').argv
|
||||
|
|
||||
const namehash = require('eth-ens-namehash').hash
|
||||
|
||||
const fileInject = require('./helpers/file_inject.js')
|
||||
const getNetworkId = require('./helpers/networkid.js')
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
|
||||
const DAOFactory = artifacts.require('DAOFactory')
|
||||
const KreditsKit = artifacts.require('KreditsKit')
|
||||
@ -18,18 +19,7 @@ const daoFactoryAddress = arapp.environments[environment].daoFactory || process.
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
|
||||
|
||||
module.exports = async function(callback) {
|
||||
|
Are you a javascript pro, now? Are you a javascript pro, now?
a pro in being desperate :) a pro in being desperate :)
those scripts are executed in some truffle context and debugging sometimes is a pain because truffle swallows the errors and traces... so I sometimes threw everything on it :D
Much better with a normal function! Much better with a normal function!
|
||||
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
// load networkId; will change with updated truffle
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
const networkPromise = new Promise((resolve, reject) => {
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
web3.version.getNetwork((err, network) => {
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
if (err) {
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
reject(err);
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
} else {
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
resolve(network);
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
}
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
})
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
})
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
const networkId = await networkPromise;
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
const networkId = await getNetworkId(web3)
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
console.log(`Deploying to networkId: ${networkId}`)
|
||||
|
||||
if (!ensAddr) {
|
||||
|
||||
|
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
What about:
What about:
```js
const KreditsKit = artifacts.require('KreditsKit')
const kreditsKitFile = 'KreditsKit.json'
// ...
let addresseFile = path.join(addressesPath, kreditsKitFile);
```
`const networkId = await getNetworkId(web3);`
`const networkId = await getNetworkId(web3);`
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.) Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
|
||||
@ -2,23 +2,14 @@ const fs = require('fs');
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
`const networkId = await getNetworkId(web3);`
|
||||
const path = require('path');
|
||||
|
||||
const fileInject = require('./helpers/file_inject.js');
|
||||
const getNetworkId = require('./helpers/networkid.js');
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
|
||||
const addressesPath = path.join(__dirname, '..', 'lib/addresses');
|
||||
|
||||
const KreditsKit = artifacts.require('KreditsKit')
|
||||
|
||||
module.exports = async function(callback) {
|
||||
// load networkId; will change with updated truffle
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
const networkPromise = new Promise((resolve, reject) => {
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
web3.version.getNetwork((err, network) => {
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
if (err) {
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
reject(err);
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
} else {
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
resolve(network);
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
}
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
})
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
})
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
const networkId = await networkPromise;
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
const networkId = await getNetworkId(web3)
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
|
||||
console.log(`Deploying to networkId: ${networkId}`)
|
||||
|
||||
let kitAddresseFile = path.join(addressesPath, 'KreditsKit.json');
|
||||
|
||||
|
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
Haha, make a function to update the Haha, make a function to update the `addresseFile`.
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
yep, did that now finally. and added a `helpers' directory... yep, did that now finally. and added a `helpers' directory...
do you have a good name for that file/function that injects that data based on the networkId?
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
I was thinking about I was thinking about `updateAddresses` but as it also updates IDs I think `fileInject` works fine.
`const networkId = await getNetworkId(web3);`
`const networkId = await getNetworkId(web3);`
|
||||
@ -1,15 +1,16 @@
|
||||
const path = require('path');
|
||||
const each = require('async-each-series');
|
||||
const ethers = require('ethers');
|
||||
|
||||
const Kredits = require('../lib/kredits');
|
||||
|
`const networkId = await getNetworkId(web3);`
|
||||
const getNetworkId = require('./helpers/networkid.js')
|
||||
|
||||
const seeds = require(path.join(__dirname, '..', '/config/seeds.js'));
|
||||
|
||||
const ethers = require('ethers');
|
||||
const Kredits = require('../lib/kredits');
|
||||
|
||||
const each = require('async-each-series');
|
||||
|
||||
module.exports = async function(callback) {
|
||||
const networkId = parseInt(web3.version.network);
|
||||
const networkId = await getNetworkId(web3)
|
||||
const provider = new ethers.providers.Web3Provider(
|
||||
web3.currentProvider, { chainId: networkId }
|
||||
web3.currentProvider, { chainId: parseInt(networkId) }
|
||||
);
|
||||
const kredits = await new Kredits(provider, provider.getSigner()).init();
|
||||
|
||||
|
||||
What about:
What about:
const networkId = await getNetworkId(web3);const networkId = await getNetworkId(web3);Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)
Have you tried the new suggestion feature in these comments? It's pretty useful! (And you'll be credited in the commit.)