-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.js
65 lines (53 loc) · 1.84 KB
/
deploy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* globals artifacts web3 */
global.artifacts = artifacts
global.web3 = web3
const { Contracts, SimpleProject } = require('zos-lib')
const StandaloneERC20 = Contracts.getFromLocal('StandaloneERC20')
const PLCRVoting = Contracts.getFromLocal('PLCRVoting')
const PLCRVotingChallengeFactory = Contracts.getFromLocal('PLCRVotingChallengeFactory')
const TokenCuratedRegistry = Contracts.getFromLocal('TokenCuratedRegistry')
const [ sender ] = web3.eth.accounts
const minStake = 10 * 10 ** 18
const challengerStake = 10 * 10 ** 18
const applicationPeriod = 60 * 60 * 24
const commitStageLength = 60 * 60 * 24
const revealStageLength = 60 * 60 * 24
const voteQuorum = 50
const percentVoterReward = 50
module.exports = async (callback) => {
const project = new SimpleProject('TokenCuratedRegistryExample')
const token = await project.createProxy(StandaloneERC20, { initArgs: [
'Shrimp Coin',
'SHRMP',
18,
[ sender ],
[ sender ]
]})
console.log('deployed StandaloneERC20 proxy: ', token.address)
const plcrVoting = await project.createProxy(PLCRVoting, { initArgs: [ token.address ]})
console.log('deployed PLCRVoting proxy: ', plcrVoting.address)
const plcrVotingChallengeFactory = await project.createProxy(
PLCRVotingChallengeFactory,
{ initArgs: [
challengerStake,
plcrVoting.address,
commitStageLength,
revealStageLength,
voteQuorum,
percentVoterReward
]}
)
console.log('deployed PLCRVotingChallengeFactory proxy: ', plcrVotingChallengeFactory.address)
const tokenCuratedRegistry = await project.createProxy(
TokenCuratedRegistry,
{ initArgs: [
token.address,
minStake,
applicationPeriod,
plcrVotingChallengeFactory.address
]}
)
console.log('deployed TokenCuratedRegistry proxy: ', tokenCuratedRegistry.address)
console.log('')
callback()
}