Skip to content

Commit ae964c2

Browse files
committed
release 0.0.1-rc.55-v1
1 parent 1ac2b7a commit ae964c2

4 files changed

Lines changed: 106 additions & 78 deletions

File tree

migrate-dao.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ async function migrateDAO ({ arcVersion, web3, spinner, confirm, opts, migration
5959
GenericScheme,
6060
GenericSchemeMultiCallFactory,
6161
ContinuousLocking4ReputationFactory,
62+
CompetitionFactory,
6263
GenesisProtocol,
6364
GlobalConstraintRegistrar,
6465
UpgradeScheme
@@ -130,6 +131,15 @@ async function migrateDAO ({ arcVersion, web3, spinner, confirm, opts, migration
130131
)
131132
}
132133

134+
let competitionFactory
135+
if (getArcVersionNumber(arcVersion) >= 55) {
136+
competitionFactory = new web3.eth.Contract(
137+
utils.importAbi(`./${contractsDir}/${arcVersion}/CompetitionFactory.json`).abi,
138+
CompetitionFactory,
139+
opts
140+
)
141+
}
142+
133143
let randomName = utils.generateRnadomName()
134144

135145
if (deploymentState.orgName !== undefined) {
@@ -877,6 +887,24 @@ async function migrateDAO ({ arcVersion, web3, spinner, confirm, opts, migration
877887
schemeParamsHash = '0x0000000000000000000000000000000000000000000000000000000000000000'
878888
tx = (await sendTx(createCL4R, `Deploying ContinuousLocking4Reputation with Factory...`)).receipt
879889
await logTx(tx, `Deployed ContinuousLocking4Reputation with Factory.`)
890+
} else if (customeScheme.schemeName === 'ContributionRewardExt') {
891+
console.log(schemeParams)
892+
const createCompetition = competitionFactory.methods.createCompetition(...schemeParams)
893+
const competitionFactoryAddresses = await createCompetition.call()
894+
const competitionAddress = competitionFactoryAddresses['0']
895+
const creAddress = competitionFactoryAddresses['1']
896+
schemeContract = new web3.eth.Contract(abi, creAddress, opts)
897+
schemeParamsHash = '0x0000000000000000000000000000000000000000000000000000000000000000'
898+
tx = (await sendTx(createCompetition, `Deploying ContinuousLocking4Reputation with Factory...`)).receipt
899+
deploymentState.StandAloneContracts.push(
900+
{
901+
name: 'Competition',
902+
alias: 'Competition',
903+
address: competitionAddress,
904+
arcVersion: (customeScheme.arcVersion ? customeScheme.arcVersion : arcVersion)
905+
}
906+
)
907+
await logTx(tx, `Deployed ContinuousLocking4Reputation with Factory.`)
880908
} else {
881909
continue
882910
}

0 commit comments

Comments
 (0)