From fa077ce7b1ebb1de113e444af67ff4b510cf5234 Mon Sep 17 00:00:00 2001 From: gichiba Date: Sat, 13 Apr 2019 15:09:53 +0800 Subject: [PATCH 1/4] Add another minter to 4_nifty_minter.js --- migrations/4_nifty_minter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/migrations/4_nifty_minter.js b/migrations/4_nifty_minter.js index ea14b75..0c3c8d7 100644 --- a/migrations/4_nifty_minter.js +++ b/migrations/4_nifty_minter.js @@ -4,4 +4,5 @@ const VoluntaryCarbonUnit = artifacts.require('./VoluntaryCarbonUnit.sol'); module.exports = async (deployer) => { const vcu = await VoluntaryCarbonUnit.deployed(); await vcu.addMinter('0xa24491d6378e843D7fe84bf20C589cFc5aC77562'); + await vcu.addMinter('0x6D758C3A656869bbb9431b6c67E500d24a838959'); }; From baae282cdedc75a0e345ccf8c487cba9e0b4e952 Mon Sep 17 00:00:00 2001 From: gichiba Date: Sat, 13 Apr 2019 15:39:36 +0800 Subject: [PATCH 2/4] Add start:chain script and update migration This is in the interest of making local development easier to automate. The `start:chain` script runs /scripts/start_blockchain.sh, which starts a local instance of ganache with keys pre-defined in ganache-accounts.json --- migrations/4_nifty_minter.js | 3 +-- package.json | 3 ++- scripts/start_blockchain.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 scripts/start_blockchain.sh diff --git a/migrations/4_nifty_minter.js b/migrations/4_nifty_minter.js index 0c3c8d7..4e19955 100644 --- a/migrations/4_nifty_minter.js +++ b/migrations/4_nifty_minter.js @@ -3,6 +3,5 @@ const VoluntaryCarbonUnit = artifacts.require('./VoluntaryCarbonUnit.sol'); // eslint-disable-next-line no-unused-vars module.exports = async (deployer) => { const vcu = await VoluntaryCarbonUnit.deployed(); - await vcu.addMinter('0xa24491d6378e843D7fe84bf20C589cFc5aC77562'); - await vcu.addMinter('0x6D758C3A656869bbb9431b6c67E500d24a838959'); + await vcu.addMinter('0xb77d57f4959eafa0339424b83fcfaf9c15407461'); }; diff --git a/package.json b/package.json index b38528d..52f2bed 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "lint:js:fix": "npx eslint . --fix", "lint:sol": "npx solhint --max-warnings 0 \"contracts/**/*.sol\"", "coverage": "npx solidity-coverage", - "migrate:local": "npx truffle migrate --network local --reset && cp build/contracts/* app/src/contracts/", + "start:chain": "scripts/start_blockchain.sh", + "migrate:local": "npx truffle migrate --network local --compile-all --reset && cp build/contracts/* app/src/contracts/", "migrate:rinkeby": "npx truffle migrate --network rinkeby --reset && cp build/contracts/* app/src/contracts/", "migrate:kovan": "npx truffle migrate --network kovan --reset && cp build/contracts/* app/src/contracts/", "deploy": "npx truffle deploy", diff --git a/scripts/start_blockchain.sh b/scripts/start_blockchain.sh old mode 100644 new mode 100755 index 27c1370..a8a53bc --- a/scripts/start_blockchain.sh +++ b/scripts/start_blockchain.sh @@ -1,7 +1,7 @@ #!/bin/bash # Start local test network -ganache-cli --acctKeys "./ganache-accounts.json" --noVMErrorsOnRPCResponse --gasLimit 6721975 \ +ganache-cli -v --acctKeys "./ganache-accounts.json" --gasLimit 6721975 \ --account="0x0355596cdb5e5242ad082c4fe3f8bbe48c9dba843fe1f99dd8272f487e70efae, 100000000000000000000" \ --account="0xe9aebe8791ad1ebd33211687e9c53f13fe8cca53b271a6529c7d7ba05eda5ce2, 100000000000000000000" \ --account="0x6f36842c663f5afc0ef3ac986ec62af9d09caa1bbf59a50cdb7334c9cc880e65, 100000000000000000000" \ From 53830d2506d2017ba06ecfb9becbbe3a976f603d Mon Sep 17 00:00:00 2001 From: gichiba Date: Tue, 16 Apr 2019 16:20:24 +0800 Subject: [PATCH 3/4] use local (npx) ganache-cli instead of global --- scripts/start_blockchain.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start_blockchain.sh b/scripts/start_blockchain.sh index a8a53bc..f582be0 100755 --- a/scripts/start_blockchain.sh +++ b/scripts/start_blockchain.sh @@ -1,7 +1,7 @@ #!/bin/bash # Start local test network -ganache-cli -v --acctKeys "./ganache-accounts.json" --gasLimit 6721975 \ +npx ganache-cli -v --acctKeys "./ganache-accounts.json" --gasLimit 6721975 \ --account="0x0355596cdb5e5242ad082c4fe3f8bbe48c9dba843fe1f99dd8272f487e70efae, 100000000000000000000" \ --account="0xe9aebe8791ad1ebd33211687e9c53f13fe8cca53b271a6529c7d7ba05eda5ce2, 100000000000000000000" \ --account="0x6f36842c663f5afc0ef3ac986ec62af9d09caa1bbf59a50cdb7334c9cc880e65, 100000000000000000000" \ From 7d027020733e7a05a4a2c0fb62e77e71ea08296c Mon Sep 17 00:00:00 2001 From: gichiba Date: Tue, 16 Apr 2019 16:28:48 +0800 Subject: [PATCH 4/4] Change `addMinter` account to (2) --- migrations/4_nifty_minter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/4_nifty_minter.js b/migrations/4_nifty_minter.js index 4e19955..383ce01 100644 --- a/migrations/4_nifty_minter.js +++ b/migrations/4_nifty_minter.js @@ -3,5 +3,5 @@ const VoluntaryCarbonUnit = artifacts.require('./VoluntaryCarbonUnit.sol'); // eslint-disable-next-line no-unused-vars module.exports = async (deployer) => { const vcu = await VoluntaryCarbonUnit.deployed(); - await vcu.addMinter('0xb77d57f4959eafa0339424b83fcfaf9c15407461'); + await vcu.addMinter('0x9df24e73f40b2a911eb254a8825103723e13209c'); };