Skip to content

Commit 02afb02

Browse files
committed
release 0.1.1-rc.13-v1
1 parent 2e2feb9 commit 02afb02

File tree

4 files changed

+63
-95
lines changed

4 files changed

+63
-95
lines changed

migrate-dao.js

Lines changed: 18 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ async function migrateDAO ({ arcVersion, web3, spinner, confirm, opts, migration
6060
opts
6161
)
6262

63-
const genesisProtocol = new web3.eth.Contract(
64-
utils.importAbi(`./${contractsDir}/${arcVersion}/GenesisProtocol.json`).abi,
65-
GenesisProtocol,
66-
opts
67-
)
68-
6963
let randomName = utils.generateRandomName()
7064

7165
if (deploymentState.orgName !== undefined) {
@@ -173,57 +167,7 @@ async function migrateDAO ({ arcVersion, web3, spinner, confirm, opts, migration
173167
deploymentState.schemesData = '0x'
174168
deploymentState.schemesInitializeDataLens = []
175169
deploymentState.permissions = []
176-
deploymentState.votingMachinesParams = []
177-
}
178-
179-
if (migrationParams.VotingMachinesParams !== undefined && migrationParams.VotingMachinesParams.length > 0) {
180-
if (deploymentState.registeredGenesisProtocolParamsCount === undefined) {
181-
deploymentState.registeredGenesisProtocolParamsCount = 0
182-
}
183-
for (deploymentState.registeredGenesisProtocolParamsCount;
184-
deploymentState.registeredGenesisProtocolParamsCount < migrationParams.VotingMachinesParams.length;
185-
deploymentState.registeredGenesisProtocolParamsCount++) {
186-
setState(deploymentState, network)
187-
if (migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].votingParamsHash !== undefined) {
188-
deploymentState.votingMachinesParams.push(migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].votingParamsHash)
189-
setState(deploymentState, network)
190-
continue
191-
}
192-
let parameters = [
193-
[
194-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].queuedVoteRequiredPercentage.toString(),
195-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].queuedVotePeriodLimit.toString(),
196-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].boostedVotePeriodLimit.toString(),
197-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].preBoostedVotePeriodLimit.toString(),
198-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].thresholdConst.toString(),
199-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].quietEndingPeriod.toString(),
200-
web3.utils.toWei(migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].proposingRepReward.toString()),
201-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].votersReputationLossRatio.toString(),
202-
web3.utils.toWei(migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].minimumDaoBounty.toString()),
203-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].daoBountyConst.toString(),
204-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].activationTime.toString()
205-
],
206-
migrationParams.VotingMachinesParams[deploymentState.registeredGenesisProtocolParamsCount].voteOnBehalf
207-
]
208-
const genesisProtocolSetParams = genesisProtocol.methods.setParameters(...parameters)
209-
210-
let votingMachinesParams = await genesisProtocolSetParams.call()
211-
const votingMachineCheckParams = await genesisProtocol.methods.parameters(votingMachinesParams).call()
212-
if (votingMachineCheckParams.minimumDaoBounty === '0') {
213-
tx = (await sendTx(genesisProtocolSetParams, 'Setting GenesisProtocol parameters...')).receipt
214-
await logTx(tx,
215-
'GenesisProtocol parameters set. | Params Hash: ' +
216-
votingMachinesParams + '\nParameters:\n' +
217-
parameters.toString().replace(/,/g, ',\n')
218-
)
219-
}
220-
221-
deploymentState.votingMachinesParams.push(votingMachinesParams)
222-
setState(deploymentState, network)
223-
}
224170
}
225-
deploymentState.registeredGenesisProtocolParamsCount++
226-
setState(deploymentState, network)
227171

228172
let runFunctions = async function (object, contract) {
229173
if (object.runFunctions !== undefined) {
@@ -342,7 +286,24 @@ async function migrateDAO ({ arcVersion, web3, spinner, confirm, opts, migration
342286
let schemeParams = [avatar.options.address]
343287
for (let i in scheme.params) {
344288
if (scheme.params[i].voteParams !== undefined) {
345-
schemeParams.push(deploymentState.votingMachinesParams[scheme.params[i].voteParams])
289+
let votingParameters = [
290+
[
291+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].queuedVoteRequiredPercentage.toString(),
292+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].queuedVotePeriodLimit.toString(),
293+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].boostedVotePeriodLimit.toString(),
294+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].preBoostedVotePeriodLimit.toString(),
295+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].thresholdConst.toString(),
296+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].quietEndingPeriod.toString(),
297+
web3.utils.toWei(migrationParams.VotingMachinesParams[scheme.params[i].voteParams].proposingRepReward.toString()),
298+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].votersReputationLossRatio.toString(),
299+
web3.utils.toWei(migrationParams.VotingMachinesParams[scheme.params[i].voteParams].minimumDaoBounty.toString()),
300+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].daoBountyConst.toString(),
301+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].activationTime.toString()
302+
],
303+
migrationParams.VotingMachinesParams[scheme.params[i].voteParams].voteOnBehalf,
304+
'0x0000000000000000000000000000000000000000000000000000000000000000'
305+
]
306+
schemeParams.push(...votingParameters)
346307
} else if (scheme.params[i] === 'GenesisProtocolAddress') {
347308
schemeParams.push(GenesisProtocol)
348309
} else if (scheme.params[i].StandAloneContract !== undefined) {

migration-params.json

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
"permissions": "0x00000000",
2828
"params": [
2929
"GenesisProtocolAddress",
30-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
31-
"0x0000000000000000000000000000000000000000",
32-
"0x0000000000000000000000000000000000000000"
30+
{ "voteParams": 0 }
3331
]
3432
},
3533
{
@@ -38,12 +36,8 @@
3836
"permissions": "0x0000001F",
3937
"params": [
4038
"GenesisProtocolAddress",
41-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
42-
"0x0000000000000000000000000000000000000000",
43-
"0x0000000000000000000000000000000000000000",
44-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
45-
"0x0000000000000000000000000000000000000000",
46-
"0x0000000000000000000000000000000000000000"
39+
{ "voteParams": 0 },
40+
{ "voteParams": 0 }
4741
]
4842
},
4943
{
@@ -52,9 +46,7 @@
5246
"permissions": "0x00000004",
5347
"params": [
5448
"GenesisProtocolAddress",
55-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
56-
"0x0000000000000000000000000000000000000000",
57-
"0x0000000000000000000000000000000000000000"
49+
{ "voteParams": 0 }
5850
]
5951
},
6052
{
@@ -63,9 +55,7 @@
6355
"permissions": "0x00000010",
6456
"params": [
6557
"GenesisProtocolAddress",
66-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
67-
"0x0000000000000000000000000000000000000000",
68-
"0x0000000000000000000000000000000000000000",
58+
{ "voteParams": 0 },
6959
{ "packageContract": "Package" }
7060
]
7161
},
@@ -75,9 +65,7 @@
7565
"permissions": "0x00000010",
7666
"params": [
7767
"GenesisProtocolAddress",
78-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
79-
"0x0000000000000000000000000000000000000000",
80-
"0x0000000000000000000000000000000000000000",
68+
{ "voteParams": 0 },
8169
"0x0000000000000000000000000000000000000000"
8270
]
8371
},
@@ -87,9 +75,7 @@
8775
"permissions": "0x00000010",
8876
"params": [
8977
"GenesisProtocolAddress",
90-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
91-
"0x0000000000000000000000000000000000000000",
92-
"0x0000000000000000000000000000000000000000",
78+
{ "voteParams": 0 },
9379
"0x0000000000000000000000000000000000000001"
9480
]
9581
},
@@ -99,9 +85,7 @@
9985
"permissions":"0x00000000",
10086
"params":[
10187
"GenesisProtocolAddress",
102-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
103-
"0x0000000000000000000000000000000000000000",
104-
"0x0000000000000000000000000000000000000000",
88+
{ "voteParams":0 },
10589
{ "StandAloneContract": 1 }
10690
],
10791
"useCompetition": true
@@ -112,9 +96,7 @@
11296
"permissions": "0x0000001F",
11397
"params": [
11498
"GenesisProtocolAddress",
115-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
116-
"0x0000000000000000000000000000000000000000",
117-
"0x0000000000000000000000000000000000000000",
99+
{ "voteParams": 0 },
118100
{ "packageContract": "DAOFactoryInstance" }
119101
]
120102
},
@@ -124,9 +106,7 @@
124106
"permissions": "0x00000000",
125107
"params": [
126108
"GenesisProtocolAddress",
127-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
128-
"0x0000000000000000000000000000000000000000",
129-
"0x0000000000000000000000000000000000000000",
109+
{ "voteParams": 0 },
130110
"0x0000000000000000000000000000000000000000",
131111
"100",
132112
"100",
@@ -140,9 +120,7 @@
140120
"permissions": "0x00000000",
141121
"params": [
142122
"GenesisProtocolAddress",
143-
[50, 1800, 600, 600, 2000, 300, 5, 1, 100, 10, 0],
144-
"0x0000000000000000000000000000000000000000",
145-
"0x0000000000000000000000000000000000000000",
123+
{ "voteParams": 0 },
146124
"0x0000000000000000000000000000000000000000"
147125
]
148126
}

package-lock.json

Lines changed: 33 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@daostack/migration-experimental",
3-
"version": "0.1.1-rc.13-v0",
3+
"version": "0.1.1-rc.13-v1",
44
"description": "A repo for handling DAOstack contract migrations",
55
"main": "index.js",
66
"bin": {

0 commit comments

Comments
 (0)