Deployment hacking while trying to deploy on rinkeby
This currently breaks the local usage because of the different appIds: <name>.open.aragonpm.eth vs. <name>.aragonpm.eth (local)
This commit is contained in:
parent
fbda45376e
commit
3c2cdf4376
@ -14,11 +14,11 @@
|
||||
"environments": {
|
||||
"default": {
|
||||
"network": "development",
|
||||
"appName": "contribution.aragonpm.eth"
|
||||
"appName": "kredits-contribution.open.aragonpm.eth"
|
||||
},
|
||||
"staging": {
|
||||
"rinkeby": {
|
||||
"registry": "0x98df287b6c145399aaa709692c8d308357bc085d",
|
||||
"appName": "contribution.open.aragonpm.eth",
|
||||
"appName": "kredits-contribution.open.aragonpm.eth",
|
||||
"wsRPC": "wss://rinkeby.eth.aragon.network/ws",
|
||||
"network": "rinkeby"
|
||||
},
|
||||
|
@ -11,7 +11,7 @@ contract Contribution is AragonApp {
|
||||
bytes32 public constant ADD_CONTRIBUTION_ROLE = keccak256("ADD_CONTRIBUTION_ROLE");
|
||||
|
||||
bytes32 public constant KERNEL_APP_ADDR_NAMESPACE = 0xd6f028ca0e8edb4a8c9757ca4fdccab25fa1e0317da1188108f7d2dee14902fb;
|
||||
bytes32 public constant TOKEN_APP_ID = 0xe04a882e7a6adf5603207d545ea49aec17e6b936c4d9eae3d74dbe482264991a;
|
||||
bytes32 public constant TOKEN_APP_ID = 0x82c0e483537d703bb6f0fc799d2cc60d8f62edcb0f6d26d5571a92be8485b112;
|
||||
|
||||
struct ContributionData {
|
||||
address contributor;
|
||||
|
@ -9,11 +9,11 @@
|
||||
"environments": {
|
||||
"default": {
|
||||
"network": "development",
|
||||
"appName": "contributor.aragonpm.eth"
|
||||
"appName": "kredits-contributor.open.aragonpm.eth"
|
||||
},
|
||||
"staging": {
|
||||
"rinkeby": {
|
||||
"registry": "0x98df287b6c145399aaa709692c8d308357bc085d",
|
||||
"appName": "contributor.open.aragonpm.eth",
|
||||
"appName": "kredits-contributor.open.aragonpm.eth",
|
||||
"wsRPC": "wss://rinkeby.eth.aragon.network/ws",
|
||||
"network": "rinkeby"
|
||||
},
|
||||
|
@ -9,26 +9,16 @@
|
||||
"name": "Vote proposals",
|
||||
"id": "VOTE_PROPOSAL_ROLE",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"name": "Add contribution",
|
||||
"id": "ADD_CONTRIBUTION_ROLE",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
"name": "Manage contributors",
|
||||
"id": "MANAGE_CONTRIBUTORS_ROLE",
|
||||
"params": []
|
||||
}
|
||||
],
|
||||
"environments": {
|
||||
"default": {
|
||||
"network": "development",
|
||||
"appName": "proposal.aragonpm.eth"
|
||||
"appName": "kredits-proposal.open.aragonpm.eth"
|
||||
},
|
||||
"staging": {
|
||||
"rinkeby": {
|
||||
"registry": "0x98df287b6c145399aaa709692c8d308357bc085d",
|
||||
"appName": "proposal.open.aragonpm.eth",
|
||||
"appName": "kredits-proposal.open.aragonpm.eth",
|
||||
"wsRPC": "wss://rinkeby.eth.aragon.network/ws",
|
||||
"network": "rinkeby"
|
||||
},
|
||||
|
@ -19,8 +19,8 @@ contract Proposal is AragonApp {
|
||||
bytes32 public constant VOTE_PROPOSAL_ROLE = keccak256("VOTE_PROPOSAL_ROLE");
|
||||
|
||||
bytes32 public constant KERNEL_APP_ADDR_NAMESPACE = 0xd6f028ca0e8edb4a8c9757ca4fdccab25fa1e0317da1188108f7d2dee14902fb;
|
||||
bytes32 public constant CONTRIBUTOR_APP_ID = 0xe9140f1e39c8a1d04167c3b710688a3eecea2976f34735c8eb98956f4764635b;
|
||||
bytes32 public constant CONTRIBUTION_APP_ID = 0x7fcf91283b719b30c2fa954ff0da021e1b91aed09d7aa13df5e8078a4a1007eb;
|
||||
bytes32 public constant CONTRIBUTOR_APP_ID = 0x8e50972b062e83b48dbb2a68d8a058f2a07227ca183c144dc974e6da3186d7e9;
|
||||
bytes32 public constant CONTRIBUTION_APP_ID = 0x09f5274cba299b46c5be722ef672d10eef7a2ef980b612aef529d74fb9da7643;
|
||||
|
||||
struct Proposal {
|
||||
address creatorAccount;
|
||||
|
@ -9,17 +9,17 @@
|
||||
"environments": {
|
||||
"default": {
|
||||
"network": "development",
|
||||
"appName": "token.aragonpm.eth"
|
||||
"appName": "kredits-token.open.aragonpm.eth"
|
||||
},
|
||||
"staging": {
|
||||
"rinkeby": {
|
||||
"registry": "0x98df287b6c145399aaa709692c8d308357bc085d",
|
||||
"appName": "token.open.aragonpm.eth",
|
||||
"appName": "kredits-token.open.aragonpm.eth",
|
||||
"wsRPC": "wss://rinkeby.eth.aragon.network/ws",
|
||||
"network": "rinkeby"
|
||||
},
|
||||
"production": {
|
||||
"mainnet": {
|
||||
"registry": "0x314159265dd8dbb310642f98f50c066173c1259b",
|
||||
"appName": "token.open.aragonpm.eth",
|
||||
"appName": "kredits-token.open.aragonpm.eth",
|
||||
"wsRPC": "wss://mainnet.eth.aragon.network/ws",
|
||||
"network": "mainnet"
|
||||
}
|
||||
|
19
arapp.json
19
arapp.json
@ -27,23 +27,28 @@
|
||||
}
|
||||
],
|
||||
"environments": {
|
||||
"rinkeby": {
|
||||
"wsRPC": "wss://rinkeby.eth.aragon.network/ws",
|
||||
"registry": "0x98Df287B6C145399Aaa709692c8D308357bC085D",
|
||||
"appName": "dummy.open.aragonpm.eth",
|
||||
"network": "rinkeby"
|
||||
},
|
||||
"development": {
|
||||
"network": "development",
|
||||
"apm": "aragonpm.eth",
|
||||
"registry": "0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1",
|
||||
"appName": "dummy.aragonpm.eth"
|
||||
},
|
||||
"rinkeby": {
|
||||
"network": "rinkeby",
|
||||
"registry": "0x98Df287B6C145399Aaa709692c8D308357bC085D",
|
||||
"wsRPC": "wss://rinkeby.eth.aragon.network/ws",
|
||||
"daoFactory": "0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d",
|
||||
"appName": "dummy.open.aragonpm.eth",
|
||||
"apm": "open.aragonpm.eth"
|
||||
},
|
||||
"kovan": {
|
||||
"network": "kovan",
|
||||
"appName": "dummy.aragonpm.eth"
|
||||
},
|
||||
"default": {
|
||||
"network": "development",
|
||||
"appName": "dummy.aragonpm.eth"
|
||||
"appName": "dummy.aragonpm.eth",
|
||||
"apm": "open.aragonpm.eth"
|
||||
}
|
||||
},
|
||||
"path": "contracts/misc/DummyApp.sol"
|
||||
|
@ -3,27 +3,26 @@ pragma solidity 0.4.24;
|
||||
import "@aragon/os/contracts/apps/AragonApp.sol";
|
||||
import "@aragon/os/contracts/kernel/Kernel.sol";
|
||||
import "@aragon/os/contracts/acl/ACL.sol";
|
||||
import "@aragon/os/contracts/acl/ACLSyntaxSugar.sol";
|
||||
|
||||
import "@aragon/kits-base/contracts/KitBase.sol";
|
||||
import "./misc/APMNamehashOpen.sol";
|
||||
|
||||
import "../apps/contribution/contracts/Contribution.sol";
|
||||
import "../apps/contributor/contracts/Contributor.sol";
|
||||
import "../apps/token/contracts/Token.sol";
|
||||
import "../apps/proposal/contracts/Proposal.sol";
|
||||
|
||||
contract KreditsKit is KitBase, APMNamehashOpen, ACLSyntaxSugar {
|
||||
bytes32 public contributorAppId = apmNamehash("contributor"); // 0xe9140f1e39c8a1d04167c3b710688a3eecea2976f34735c8eb98956f4764635b
|
||||
bytes32 public contributionAppId = apmNamehash("contribution"); // 0x7fcf91283b719b30c2fa954ff0da021e1b91aed09d7aa13df5e8078a4a1007eb
|
||||
bytes32 public tokenAppId = apmNamehash("token"); // 0xe04a882e7a6adf5603207d545ea49aec17e6b936c4d9eae3d74dbe482264991a
|
||||
bytes32 public proposalAppId = apmNamehash("proposal"); // 0xaf5fe5c3b0d9581ee88974bbc8699e6fa71efd1b321e44b2227103c9ef21dbdb
|
||||
contract KreditsKit is KitBase {
|
||||
|
||||
// ensure alphabetic order
|
||||
enum Apps { Contribution, Contributor, Proposal, Token }
|
||||
bytes32[4] public appIds;
|
||||
|
||||
event DeployInstance(address dao);
|
||||
event InstalledApp(address dao, address appProxy, bytes32 appId);
|
||||
|
||||
constructor (DAOFactory _fac, ENS _ens) public KitBase(_fac, _ens) {}
|
||||
constructor (DAOFactory _fac, ENS _ens, bytes32[4] _appIds) public KitBase(_fac, _ens) {
|
||||
appIds = _appIds;
|
||||
}
|
||||
|
||||
function newInstance() public returns (Kernel dao) {
|
||||
address root = msg.sender;
|
||||
@ -32,17 +31,17 @@ contract KreditsKit is KitBase, APMNamehashOpen, ACLSyntaxSugar {
|
||||
|
||||
acl.createPermission(this, dao, dao.APP_MANAGER_ROLE(), this);
|
||||
|
||||
Contributor contributor = Contributor(_installApp(dao, contributorAppId));
|
||||
Contributor contributor = Contributor(_installApp(dao, appIds[uint8(Apps.Contributor)]));
|
||||
contributor.initialize(root);
|
||||
acl.createPermission(root, contributor, contributor.MANAGE_CONTRIBUTORS_ROLE(), root);
|
||||
|
||||
Token token = Token(_installApp(dao, tokenAppId));
|
||||
Token token = Token(_installApp(dao, appIds[uint8(Apps.Token)]));
|
||||
token.initialize();
|
||||
|
||||
Contribution contribution = Contribution(_installApp(dao, contributionAppId));
|
||||
Contribution contribution = Contribution(_installApp(dao, appIds[uint8(Apps.Contribution)]));
|
||||
contribution.initialize();
|
||||
|
||||
Proposal proposal = Proposal(_installApp(dao, proposalAppId));
|
||||
Proposal proposal = Proposal(_installApp(dao, appIds[uint8(Apps.Proposal)]));
|
||||
proposal.initialize();
|
||||
|
||||
acl.createPermission(root, contribution, contribution.ADD_CONTRIBUTION_ROLE(), this);
|
||||
|
19
deployments/rinkeby/contribution.md
Normal file
19
deployments/rinkeby/contribution.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Contribution deployments
|
||||
|
||||
## 2019-03-25
|
||||
|
||||
### v2.0.0 updated appid hashes
|
||||
from account: 0x18f6d06de7e6d556b1bbb5875f8cfafb5eaef9c5
|
||||
✔ Successfully published kredits-contribution.open.aragonpm.eth v2.0.0:
|
||||
ℹ Contract address: 0x2765F13d82B83C0C9d770715e1fB376ab01C0361
|
||||
ℹ Content (ipfs): QmYiv1cMh6cj8pcbmaTUAWxf93k4UhN8mPJWeqEo7BEkMx
|
||||
ℹ Transaction hash: 0xe4841a6552527c8fbeb6aa44769f95ce60d99413958c6289f67e8ec83823ee96
|
||||
|
||||
|
||||
### v1.0.0
|
||||
from account: 0x18f6d06de7e6d556b1bbb5875f8cfafb5eaef9c5
|
||||
✔ Successfully published kredits-contribution.open.aragonpm.eth v1.0.0:
|
||||
ℹ Contract address: 0x1F460107361047064d982f61002D1BdEb02Ce705
|
||||
ℹ Content (ipfs): QmQ6rTWCGcseCmGb6thYG2kwijHk6W84qaFPeftZ4bUY2k
|
||||
ℹ Transaction hash: 0xeee90c5d18a8cb8ac845f52a4202cd62b27c23b4251b69c3681a854786b6e336
|
||||
|
9
deployments/rinkeby/contributor.md
Normal file
9
deployments/rinkeby/contributor.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Contributor deployments
|
||||
|
||||
## 2019-03-25
|
||||
from account: 0x18f6d06de7e6d556b1bbb5875f8cfafb5eaef9c5
|
||||
✔ Successfully published kredits-contributor.open.aragonpm.eth v1.0.0:
|
||||
ℹ Contract address: 0x6D80EFEE6F9A40AA86Ef7c4C95c8b2e453d260fb
|
||||
ℹ Content (ipfs): QmbGSQPwi3AXHjDFG2fkMpJrBJLtyuaA6DVPMkFTfMpksn
|
||||
ℹ Transaction hash: 0x26376c59dfdb617c35b740a0f110bf3040cdad0103593cdc788267a84d9847b9
|
||||
|
16
deployments/rinkeby/dao.md
Normal file
16
deployments/rinkeby/dao.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Kredits deployment
|
||||
|
||||
### 2010-03-25
|
||||
|
||||
kredits/truffle-kredits@aragonos » aragon contracts exec scripts/new-dao.js --network=rinkeby
|
||||
ℹ Use of `--network` is deprecated and has been replaced with `--environment`. You may need to update your arapp.json
|
||||
ℹ Passing the command to Truffle
|
||||
Using network 'rinkeby'.
|
||||
|
||||
Deploying to networkId: 4
|
||||
Using KreditsKit at: 0xf4f3963718e5c2b426dd5c3ef0ab4b31ffb7a318
|
||||
|
||||
Created new DAO at: 0x8b7c0bec9476ce08d9769a87d272b03b350712e2
|
||||
|
||||
from account: 0x18f6d06de7e6d556b1bbb5875f8cfafb5eaef9c5
|
||||
https://rinkeby.etherscan.io/tx/0x4deb02b3740b3baa7735097d57c1456a5cb329ee741d123478fdb5114e2c305b
|
39
deployments/rinkeby/kreditskit.md
Normal file
39
deployments/rinkeby/kreditskit.md
Normal file
@ -0,0 +1,39 @@
|
||||
# KreditsKit deployments
|
||||
|
||||
## 2019-03-25
|
||||
|
||||
### fixed kit with correct appids
|
||||
|
||||
kredits/truffle-kredits@aragonos » aragon contracts exec scripts/deploy-kit.js --debug --network=rinkeby
|
||||
ℹ Use of `--network` is deprecated and has been replaced with `--environment`. You may need to update your arapp.json
|
||||
ℹ Passing the command to Truffle
|
||||
Using network 'rinkeby'.
|
||||
|
||||
Deploying to networkId: 4
|
||||
Using ENS at: 0x98Df287B6C145399Aaa709692c8D308357bC085D
|
||||
Using DAOFactory at: 0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d
|
||||
Found apps: [contribution,contributor,proposal,token].open.aragonpm.eth
|
||||
Deployed KreditsKit at: 0xf4f3963718e5c2b426dd5c3ef0ab4b31ffb7a318
|
||||
|
||||
from account: 0x18f6d06de7e6d556b1bbb5875f8cfafb5eaef9c5
|
||||
|
||||
### test with fixed deploy script
|
||||
kredits/truffle-kredits@aragonos » ENS=0x98df287b6c145399aaa709692c8d308357bc085d DAO_FACTORY=0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d truffle exec scripts/deploy-kit.js --network=rinkeby
|
||||
Using network 'rinkeby'.
|
||||
|
||||
Deploying to networkId: 4
|
||||
Using ENS at: 0x98df287b6c145399aaa709692c8d308357bc085d
|
||||
Using DAOFactory at: 0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d
|
||||
Deployed KreditsKit at: 0x83afd3c99563fc467aec69e0187ffd53fc8faa76
|
||||
|
||||
### success
|
||||
kredits/truffle-kredits@aragonos » ENS=0x98df287b6c145399aaa709692c8d308357bc085d DAO_FACTORY=0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d truffle exec scripts/deploy-kit.js --network=rinkeby
|
||||
Using network 'rinkeby'.
|
||||
|
||||
Using ENS at: 0x98df287b6c145399aaa709692c8d308357bc085d
|
||||
Using DAOFactory at: 0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d
|
||||
Deployed KreditsKit at: 0x1fd2f9206addaf86f3ef921a3b7c84400374ba68
|
||||
|
||||
### deployment script error:
|
||||
deployment script failure at: https://rinkeby.etherscan.io/tx/0x3571b889b6b9b2b3f26dd0ee7fb82c7ece90b28d910078f2e06753d878832af4"
|
||||
|
17
deployments/rinkeby/proposal.md
Normal file
17
deployments/rinkeby/proposal.md
Normal file
@ -0,0 +1,17 @@
|
||||
# Proposal deployments
|
||||
|
||||
## 2019-03-25
|
||||
|
||||
### v2.0.0 updated appid hashes
|
||||
from account: 0x18f6d06de7e6d556b1bbb5875f8cfafb5eaef9c5
|
||||
✔ Successfully published kredits-proposal.open.aragonpm.eth v2.0.0:
|
||||
ℹ Contract address: 0x0a48dc5415f4d7A3B2B4a9aaD4A7a8775f923ce3
|
||||
ℹ Content (ipfs): QmZej9xPJN7aTiQ7SzWziRuzEjjfMzjPakcGYcoN8QQBMH
|
||||
ℹ Transaction hash: 0xf14c308b9f92b43a719fab2602c624dc2e11d0f629a0be9a6ec8ac47719ee9ca
|
||||
|
||||
### v1.0.0
|
||||
from account: 0x18f6d06de7e6d556b1bbb5875f8cfafb5eaef9c5
|
||||
✔ Successfully published kredits-proposal.open.aragonpm.eth v1.0.0:
|
||||
ℹ Contract address: 0xFc04eB3eF666507F96A22d330d8a852d8eC996EA
|
||||
ℹ Content (ipfs): QmRTzoYr7B5f8gDGY8RmoodJkMm59D4jSJLZNRnhAd4wCg
|
||||
ℹ Transaction hash: 0xce419d9d555551eefc624a7ac87c19b5d660eb9c4fe0da611cd5e28e3ee6844f
|
8
deployments/rinkeby/token.md
Normal file
8
deployments/rinkeby/token.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Token deployments
|
||||
|
||||
## 2019-03-25
|
||||
from account: 0x18f6d06de7e6d556b1bbb5875f8cfafb5eaef9c5
|
||||
✔ Successfully published kredits-token.open.aragonpm.eth v1.0.0:
|
||||
ℹ Contract address: 0xB4147Be6d4bcC790c6CbD3d508354DDfd3EbC8e6
|
||||
ℹ Content (ipfs): QmQPue7WzQhaXbTLJwyZXSHaRY1u5ezWxyVmBP8bEgGoTE
|
||||
ℹ Transaction hash: 0xa7866d81e236adfeaff6bf2d5dbc9f9757fbc1b0ce689357901194913fe93a3b"
|
@ -1 +1 @@
|
||||
{"55632786":"0x4d97bd8efacf46b33c4438ed0b7b6aabfa2359fb"}
|
||||
{"4":"0xf4f3963718e5c2b426dd5c3ef0ab4b31ffb7a318","14945560":"0x6e0745b6b18d0233708554049eeaab0cb81c4ab0","42097210":"0x15d7adc7d6283d57d45017512567985e3a768b83","51657314":"0x053e2ebaf79eb0ccc5139a40b2a3ddca79409cdc","55632786":"0x4d97bd8efacf46b33c4438ed0b7b6aabfa2359fb","84923523":"0x48c2eac33521070509f9819a824a3d5686ba5ce8"}
|
@ -1 +1 @@
|
||||
{"23827572":"0xe4e0e7fe54d9189df29a80c07ab733fc9a212761","55632786":"0x4fde16c57ddf6d4870d5edd599074bb50dc96f88","65047207":"0xb67567175ac213f6f622b23d3d972d5b877c4813"}
|
||||
{"4":"0x8b7c0bec9476ce08d9769a87d272b03b350712e2","14945560":"0x183af3950364390a266edff2a0e7c4c2f95c0691","23827572":"0xe4e0e7fe54d9189df29a80c07ab733fc9a212761","42097210":"0x183af3950364390a266edff2a0e7c4c2f95c0691","51657314":"0xad3a80686847d55d7b14b930bc6db53681ae1b1e","55632786":"0x4fde16c57ddf6d4870d5edd599074bb50dc96f88","65047207":"0xb67567175ac213f6f622b23d3d972d5b877c4813"}
|
@ -10,10 +10,10 @@ class Kernel extends Base {
|
||||
|
||||
appNamehash(appName) {
|
||||
return {
|
||||
Contributor: '0xe9140f1e39c8a1d04167c3b710688a3eecea2976f34735c8eb98956f4764635b',
|
||||
Contribution: '0x7fcf91283b719b30c2fa954ff0da021e1b91aed09d7aa13df5e8078a4a1007eb',
|
||||
Token: '0xe04a882e7a6adf5603207d545ea49aec17e6b936c4d9eae3d74dbe482264991a',
|
||||
Proposal: '0xaf5fe5c3b0d9581ee88974bbc8699e6fa71efd1b321e44b2227103c9ef21dbdb'
|
||||
Contributor: '0x7829d33291d6e118d115ce321de9341894a2da120bd35505fc03b98f715c606d',
|
||||
Contribution: '0xe401b988b8af39119004de5c7691a60391d69d873b3120682a8c61306a4883ce',
|
||||
Token: '0x85b0f626cecde6188d11940904fedeb16a4d49b0e8c878b9d109b23d38062ca7',
|
||||
Proposal: '0x15d03d435b24a74317868c24fda4646302076b59272241a122a3868eb5c745da'
|
||||
}[appName];
|
||||
}
|
||||
}
|
||||
|
5
package-lock.json
generated
5
package-lock.json
generated
@ -2856,7 +2856,6 @@
|
||||
"version": "2.0.8",
|
||||
"resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz",
|
||||
"integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"idna-uts46-hx": "^2.3.1",
|
||||
"js-sha3": "^0.5.7"
|
||||
@ -10146,7 +10145,6 @@
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz",
|
||||
"integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"punycode": "2.1.0"
|
||||
},
|
||||
@ -10154,8 +10152,7 @@
|
||||
"punycode": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz",
|
||||
"integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=",
|
||||
"dev": true
|
||||
"integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0="
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -41,6 +41,7 @@
|
||||
"solc": "^0.4.25"
|
||||
},
|
||||
"dependencies": {
|
||||
"eth-ens-namehash": "^2.0.8",
|
||||
"ethers": "3.0.15",
|
||||
"ipfs-api": "^19.0.0",
|
||||
"rsvp": "^4.8.2"
|
||||
|
@ -2,15 +2,37 @@ const deployDAOFactory = require('@aragon/os/scripts/deploy-daofactory.js')
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const argv = require('yargs').argv
|
||||
const namehash = require('eth-ens-namehash').hash
|
||||
|
||||
const libPath = path.join(__dirname, '..', 'lib');
|
||||
const addressesPath = path.join(libPath, 'addresses');
|
||||
|
||||
const DAOFactory = artifacts.require('DAOFactory')
|
||||
const KreditsKit = artifacts.require('KreditsKit')
|
||||
|
||||
const ensAddr = process.env.ENS
|
||||
const daoFactoryAddress = process.env.DAO_FACTORY
|
||||
const arapp = require('../arapp.json')
|
||||
const environment = argv['network'] || argv['environment'] || 'development'
|
||||
const apm = arapp.environments[environment].apm
|
||||
const ensAddr = arapp.environments[environment].registry || process.env.ENS
|
||||
const daoFactoryAddress = arapp.environments[environment].daoFactory || process.env.DAO_FACTORY
|
||||
|
||||
|
||||
module.exports = async function(callback) {
|
||||
|
||||
// load networkId; will change with updated truffle
|
||||
const networkPromise = new Promise((resolve, reject) => {
|
||||
web3.version.getNetwork((err, network) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(network);
|
||||
}
|
||||
})
|
||||
})
|
||||
const networkId = await networkPromise;
|
||||
console.log(`Deploying to networkId: ${networkId}`)
|
||||
|
||||
if (!ensAddr) {
|
||||
callback(new Error("ENS address not found in environment variable ENS"))
|
||||
}
|
||||
@ -24,9 +46,12 @@ module.exports = async function(callback) {
|
||||
}
|
||||
console.log(`Using DAOFactory at: ${daoFactory.address}`)
|
||||
|
||||
let kreditsKit = await KreditsKit.new(daoFactory.address, ensAddr)
|
||||
const apps = fs.readdirSync('./apps')
|
||||
console.log(`Found apps: [${apps}].${apm}`)
|
||||
const appIds = apps.map(app => namehash(`kredits-${app}.${apm}`))
|
||||
|
||||
const networkId = parseInt(web3.version.network);
|
||||
KreditsKit.new(daoFactory.address, ensAddr, appIds).then((kreditsKit) => {
|
||||
console.log(`Deployed KreditsKit at: ${kreditsKit.address}`);
|
||||
|
||||
let addresseFile = path.join(addressesPath, `KreditsKit.json`);
|
||||
let addresses = JSON.parse(fs.readFileSync(addresseFile));
|
||||
@ -34,6 +59,9 @@ module.exports = async function(callback) {
|
||||
addresses[networkId] = kreditsKit.address;
|
||||
fs.writeFileSync(addresseFile, JSON.stringify(addresses));
|
||||
|
||||
console.log(`Deployed KreditsKit at: ${kreditsKit.address}`);
|
||||
callback();
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
callback(e);
|
||||
})
|
||||
}
|
||||
|
@ -6,7 +6,18 @@ const addressesPath = path.join(libPath, 'addresses');
|
||||
const KreditsKit = artifacts.require('KreditsKit')
|
||||
|
||||
module.exports = async function(callback) {
|
||||
const networkId = parseInt(web3.version.network);
|
||||
// load networkId; will change with updated truffle
|
||||
const networkPromise = new Promise((resolve, reject) => {
|
||||
web3.version.getNetwork((err, network) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(network);
|
||||
}
|
||||
})
|
||||
})
|
||||
const networkId = await networkPromise;
|
||||
console.log(`Deploying to networkId: ${networkId}`)
|
||||
|
||||
let kitAddresseFile = path.join(addressesPath, 'KreditsKit.json');
|
||||
let kitAddresses = JSON.parse(fs.readFileSync(kitAddresseFile));
|
||||
|
Loading…
x
Reference in New Issue
Block a user