-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcreateTestMultiCallDAO.js
66 lines (53 loc) · 1.39 KB
/
createTestMultiCallDAO.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
66
const fs = require('fs');
const path = require('path');
const Web3 = require('web3')
const { options } = require('./deployEthereum')
const { migrateDAO } = require('@daostack/migration')
const opts = {}
async function createTestDAO(options) {
const arcVersion = '0.0.1-rc.47'
// get the params suitable for v47
options.arcVersion = arcVersion
options.params = require('./testdao-multicall-params-v47.json')
const result = await migrateDAO(options)
const daoInfo = result.dao[options.arcVersion]
return result
}
async function submitGSMultiCallProposal ({
avatarAddress,
callData,
descHash,
genericSchemeAddress,
opts ,
web3
}) {
let tx
const genericScheme = new web3.eth.Contract(
require('@daostack/arc/build/contracts/GenericScheme.json').abi,
genericSchemeAddress,
opts
)
const prop = genericScheme.methods.proposeCall(
avatarAddress,
callData,
0,
descHash
)
const proposalId = await prop.call()
tx = await prop.send()
// await this.logTx(tx, 'Submit new Proposal.')
return proposalId
}
/**
* if called directly, run this function
*/
async function main() {
console.log(`starting migration with options`)
console.log(options)
let migration = createTestDAO(options);
}
if (require.main === module) {
main().then(console.log(`done`)).catch(err => {console.error(err);process.exit(1)})
} else {
module.exports = createTestDAO
}