Skip to content

Commit

Permalink
Adapt to last app changes
Browse files Browse the repository at this point in the history
- Registry: must be initialized
- Staking: can overlock and defer locks
- Curation: changed redistribution method (see PR #13)
  • Loading branch information
bingen committed Jul 26, 2018
1 parent fb7fce1 commit 90bdd69
Show file tree
Hide file tree
Showing 5 changed files with 3,917 additions and 202 deletions.
6 changes: 3 additions & 3 deletions kits/tcr/contracts/TCRKit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ contract TCRKit is KitBase {

deployApps(dao);

//registry.initialize();
staking.initialize(stakingToken, new bytes(0), new bytes(0), new bytes(0));
voteStaking.initialize(stakingToken, new bytes(0), new bytes(0), new bytes(0));
registry.initialize();
staking.initialize(false, stakingToken, new bytes(0), new bytes(0), new bytes(0));
voteStaking.initialize(true, stakingToken, new bytes(0), new bytes(0), new bytes(0));
plcr.initialize(voteStaking, voteQuorum, minorityBlocSlash, commitDuration, revealDuration);

// ACLs
Expand Down
70 changes: 36 additions & 34 deletions kits/tcr/migrations/2_deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,44 @@ const newRepo = async (apm, name, acc, contract, contentURI = "ipfs:") => {
return await apm.newRepoWithVersion(name, acc, [1, 0, 0], c.address, contentURI)
}

module.exports = async (deployer, network, accounts) => {
let indexFileName
if (network != 'rpc' && network != 'devnet') {
indexFileName = 'index.js'
} else {
indexFileName = 'index_local.js'
}
let indexObj = require('../' + indexFileName)

console.log('ens', indexObj.networks[network].ens)
const ens = ENS.at(indexObj.networks[network].ens)

const apmAddr = await artifacts.require('PublicResolver').at(await ens.resolver(namehash('aragonpm.eth'))).addr(namehash('aragonpm.eth'))
console.log('APM address', apmAddr)

if (network == 'rpc' || network == 'devnet') { // Useful for testing to avoid manual deploys with aragon-dev-cli
if (await ens.owner(curationAppId) == '0x0000000000000000000000000000000000000000') {
const apm = artifacts.require('APMRegistry').at(apmAddr)

await newRepo(apm, 'registry', accounts[0], 'RegistryApp')
await newRepo(apm, 'staking', accounts[0], 'Staking')
await newRepo(apm, 'plcr', accounts[0], 'PLCR')
await newRepo(apm, 'tcr', accounts[0], 'Curation')
module.exports = function (deployer, network, accounts) {
deployer.then(async () => {
let indexFileName
if (network != 'rpc' && network != 'devnet') {
indexFileName = 'index.js'
} else {
indexFileName = 'index_local.js'
}
}
let indexObj = require('../' + indexFileName)

const { daoFact } = await daoFactoryMigration(deployer, network, accounts, artifacts)
console.log('ens', indexObj.networks[network].ens)
const ens = ENS.at(indexObj.networks[network].ens)

const kit = await TCRKit.new(daoFact.address, ens.address)
console.log('TCRKit:', kit.address)
const apmAddr = await artifacts.require('PublicResolver').at(await ens.resolver(namehash('aragonpm.eth'))).addr(namehash('aragonpm.eth'))
console.log('APM address', apmAddr)

if (indexObj.networks[network] === undefined)
indexObj.networks[network] = {}
indexObj.networks[network].ens = ens.address
indexObj.networks[network].tcr_kit = kit.address
const indexFile = 'module.exports = ' + JSON.stringify(indexObj, null, 2)
fs.writeFileSync(indexFileName, indexFile)
console.log('Settings saved to ' + indexFileName)
if (network == 'rpc' || network == 'devnet') { // Useful for testing to avoid manual deploys with aragon-dev-cli
if (await ens.owner(curationAppId) == '0x0000000000000000000000000000000000000000') {
const apm = artifacts.require('APMRegistry').at(apmAddr)

await newRepo(apm, 'registry', accounts[0], 'RegistryApp')
await newRepo(apm, 'staking', accounts[0], 'Staking')
await newRepo(apm, 'plcr', accounts[0], 'PLCR')
await newRepo(apm, 'tcr', accounts[0], 'Curation')
}
}

const { daoFact } = await daoFactoryMigration(deployer, network, accounts, artifacts)

const kit = await TCRKit.new(daoFact.address, ens.address)
console.log('TCRKit:', kit.address)

if (indexObj.networks[network] === undefined)
indexObj.networks[network] = {}
indexObj.networks[network].ens = ens.address
indexObj.networks[network].tcr_kit = kit.address
const indexFile = 'module.exports = ' + JSON.stringify(indexObj, null, 2)
fs.writeFileSync(indexFileName, indexFile)
console.log('Settings saved to ' + indexFileName)
})
}
Loading

0 comments on commit 90bdd69

Please sign in to comment.