Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCR: Staking deferred lock. Adapt to last app changes #18

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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