Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ccd4c3410b |
20
README.md
20
README.md
@@ -174,26 +174,6 @@ Runs `npm install` for each app and publishes a new version.
|
|||||||
or
|
or
|
||||||
$ npm run deploy:apps
|
$ npm run deploy:apps
|
||||||
|
|
||||||
## Deployment
|
|
||||||
|
|
||||||
### Apps deployment
|
|
||||||
|
|
||||||
To deploy a new app version run:
|
|
||||||
|
|
||||||
$ aragon apm publish major --environment=NETWORK_TO_DEPLOY
|
|
||||||
|
|
||||||
### KreditsKit
|
|
||||||
|
|
||||||
deploy the KreditsKit as Kit to create new DAOs
|
|
||||||
|
|
||||||
$ truffle exec scripts/deploy-kit.js --network=NETWORK_TO_DEPLOY
|
|
||||||
|
|
||||||
### Creating a new DAO
|
|
||||||
|
|
||||||
make sure all apps and the KreditsKit are deployed, then create a new DAO:
|
|
||||||
|
|
||||||
$ truffle exec scripts/new-dao.js --network=NETWORK_TO_DEPLOY
|
|
||||||
|
|
||||||
## ACL / Permissions
|
## ACL / Permissions
|
||||||
|
|
||||||
## Upgradeable contracts
|
## Upgradeable contracts
|
||||||
|
|||||||
@@ -14,15 +14,11 @@ contract Token is ERC20Token, AragonApp {
|
|||||||
|
|
||||||
function initialize(bytes32[4] _appIds) public onlyInit {
|
function initialize(bytes32[4] _appIds) public onlyInit {
|
||||||
appIds = _appIds;
|
appIds = _appIds;
|
||||||
name = 'Kredits';
|
|
||||||
symbol = '₭S';
|
|
||||||
decimals = 18;
|
|
||||||
initialized();
|
initialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
function mintFor(address contributorAccount, uint256 amount, uint32 contributionId) public isInitialized auth(MINT_TOKEN_ROLE) {
|
function mintFor(address contributorAccount, uint256 amount, uint32 contributionId) public isInitialized auth(MINT_TOKEN_ROLE) {
|
||||||
uint256 amountInWei = amount.mul(1 ether);
|
_mint(contributorAccount, amount);
|
||||||
_mint(contributorAccount, amountInWei);
|
|
||||||
emit LogMint(contributorAccount, amount, contributionId);
|
emit LogMint(contributorAccount, amount, contributionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
# Contribution deployments
|
# Contribution deployments
|
||||||
|
|
||||||
## 2019-04-10 - Weltempfänger release
|
|
||||||
|
|
||||||
✔ Successfully published kredits-contribution.open.aragonpm.eth v5.0.0:
|
|
||||||
ℹ Contract address: 0xe0f7dB486321b917e3A986Bdb2F2b9d51BA98fa9
|
|
||||||
ℹ Content (ipfs): QmU3XEBb4f5jU8MFFEpwaa95C1mhc82UeYLRWLrKsvcQNw
|
|
||||||
ℹ Transaction hash: 0xd736ff5f79f8142be3fad1a50580fb40aa468838da397f8630285fd91a445af3
|
|
||||||
|
|
||||||
|
|
||||||
## 2019-04-04
|
## 2019-04-04
|
||||||
|
|
||||||
✔ Successfully published kredits-contribution.open.aragonpm.eth v4.0.0:
|
✔ Successfully published kredits-contribution.open.aragonpm.eth v4.0.0:
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
# Contributor deployments
|
# Contributor deployments
|
||||||
|
|
||||||
## 2019-04-10 - Weltempfänger release
|
|
||||||
|
|
||||||
✔ Successfully published kredits-contributor.open.aragonpm.eth v4.0.0:
|
|
||||||
ℹ Contract address: 0x08a6D4D915FCAA5524F05F5F715a6C17cB6eeA6B
|
|
||||||
ℹ Content (ipfs): QmR62PWwe1EzommfkhJDYcTvHoZjbXuv9dTG6vCn5dWCsb
|
|
||||||
ℹ Transaction hash: 0xd5317c9e207a413485c55ec3046b09d467d978443680304737a6d7d3db0c90e1
|
|
||||||
|
|
||||||
|
|
||||||
## 2019-04-04
|
## 2019-04-04
|
||||||
|
|
||||||
✔ Successfully published kredits-contributor.open.aragonpm.eth v3.0.0:
|
✔ Successfully published kredits-contributor.open.aragonpm.eth v3.0.0:
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
# Kredits deployment
|
# Kredits deployment
|
||||||
|
|
||||||
## 2019-04-10 - Weltempfänger release
|
|
||||||
|
|
||||||
Using KreditsKit at: 0x76e069b47b79442657eaf0555a32c6b16fa1b8b4
|
|
||||||
Created new DAO at: 0xc34edf7d11b7f8433d597f0bb0697acdff55ef14
|
|
||||||
|
|
||||||
## 2019-04-04
|
## 2019-04-04
|
||||||
|
|
||||||
Using KreditsKit at: 0x76e069b47b79442657eaf0555a32c6b16fa1b8b4
|
Using KreditsKit at: 0x76e069b47b79442657eaf0555a32c6b16fa1b8b4
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
# Proposal deployments
|
# Proposal deployments
|
||||||
|
|
||||||
## 2019-04-10 - Weltempfänger release
|
|
||||||
|
|
||||||
✔ Successfully published kredits-proposal.open.aragonpm.eth v5.0.0:
|
|
||||||
ℹ Contract address: 0x4ce5b0286483c66b861e5599a199054687434552
|
|
||||||
ℹ Content (ipfs): QmNYXEcmvKTGxYiob7WUf85oZhdmFDCuGiA6TsRrDE9TYb
|
|
||||||
ℹ Transaction hash: 0x0482b58a1ba87d494c6391026399d0ac41b45384330d916f3f99ba70e501584b
|
|
||||||
|
|
||||||
|
|
||||||
## 2019-04-04
|
## 2019-04-04
|
||||||
|
|
||||||
✔ Successfully published kredits-proposal.open.aragonpm.eth v4.0.0:
|
✔ Successfully published kredits-proposal.open.aragonpm.eth v4.0.0:
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
# Token deployments
|
# Token deployments
|
||||||
|
|
||||||
## 2019-04-10 - Weltempfänger release
|
|
||||||
|
|
||||||
✔ Successfully published kredits-token.open.aragonpm.eth v4.0.0:
|
|
||||||
ℹ Contract address: 0x05E0C2bbdA8e5BeE22AC1E20C1457dA4de63aE26
|
|
||||||
ℹ Content (ipfs): QmUuYLRMRNZcundUk2pxVaSjMNvtB7hzdf3eyoaUNqDPow
|
|
||||||
ℹ Transaction hash: 0x98c28b5ca645904d56eb83c4783682f018c0fcee015b3a3d5fa8bd609223fb89
|
|
||||||
|
|
||||||
|
|
||||||
## 2019-04-04
|
## 2019-04-04
|
||||||
|
|
||||||
✔ Successfully published kredits-token.open.aragonpm.eth v3.0.0:
|
✔ Successfully published kredits-token.open.aragonpm.eth v3.0.0:
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"4": "0x76e069b47b79442657eaf0555a32c6b16fa1b8b4"
|
"4": "0x76e069b47b79442657eaf0555a32c6b16fa1b8b4",
|
||||||
|
"41787949": "0xa35aacdfccac54d3d96e0d29050c773b251c2c83"
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"4": "0xc34edf7d11b7f8433d597f0bb0697acdff55ef14"
|
"4": "0xcd75458fbc4aa2231252d5b21f1391fd031e5cb2",
|
||||||
|
"41787949": "0x183af3950364390a266edff2a0e7c4c2f95c0691"
|
||||||
}
|
}
|
||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "kredits-contracts",
|
"name": "kredits-contracts",
|
||||||
"version": "4.0.2",
|
"version": "4.0.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "kredits-contracts",
|
"name": "kredits-contracts",
|
||||||
"version": "4.0.2",
|
"version": "4.0.1",
|
||||||
"description": "Ethereum contracts and npm wrapper for Kredits",
|
"description": "Ethereum contracts and npm wrapper for Kredits",
|
||||||
"main": "./lib/kredits.js",
|
"main": "./lib/kredits.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"repl": "truffle exec scripts/repl.js",
|
"repl": "truffle exec scripts/repl.js",
|
||||||
"seeds": "truffle exec scripts/seeds.js",
|
"seeds": "truffle exec scripts/seeds.js",
|
||||||
"compile-contracts": "aragon contracts compile --all",
|
"compile-contracts": "aragon contracts compile --all",
|
||||||
"bootstrap": "npm run reset:hard && npm run seeds",
|
"bootstrap": "./scripts/every-app.sh \"npm install \" && npm run reset:hard && npm run seeds",
|
||||||
"reset": "npm run deploy:kit && npm run deploy:dao",
|
"reset": "npm run deploy:kit && npm run deploy:dao",
|
||||||
"reset:hard": "npm run deploy:apps && npm run reset",
|
"reset:hard": "npm run deploy:apps && npm run reset",
|
||||||
"deploy:kit": "npm run compile-contracts && aragon contracts exec scripts/deploy-kit.js",
|
"deploy:kit": "npm run compile-contracts && aragon contracts exec scripts/deploy-kit.js",
|
||||||
|
|||||||
@@ -1,363 +0,0 @@
|
|||||||
const namehash = require('eth-ens-namehash').hash
|
|
||||||
const keccak256 = require('js-sha3').keccak_256
|
|
||||||
|
|
||||||
const deployENS = require('@aragon/os/scripts/deploy-test-ens')
|
|
||||||
const deployDaoFactory = require('@aragon/os/scripts/deploy-daofactory')
|
|
||||||
const logDeploy = require('@aragon/os/scripts//helpers/deploy-logger')
|
|
||||||
const getAccounts = require('@aragon/os/scripts//helpers/get-accounts')
|
|
||||||
|
|
||||||
const globalArtifacts = this.artifacts // Not injected unless called directly via truffle
|
|
||||||
const globalWeb3 = this.web3 // Not injected unless called directly via truffle
|
|
||||||
|
|
||||||
const ZERO_ADDR = '0x0000000000000000000000000000000000000000'
|
|
||||||
|
|
||||||
const defaultOwner = process.env.OWNER
|
|
||||||
const defaultDaoFactoryAddress = process.env.DAO_FACTORY
|
|
||||||
const defaultENSAddress = process.env.ENS
|
|
||||||
|
|
||||||
module.exports = async (
|
|
||||||
truffleExecCallback,
|
|
||||||
{
|
|
||||||
artifacts = globalArtifacts,
|
|
||||||
web3 = globalWeb3,
|
|
||||||
ensAddress = defaultENSAddress,
|
|
||||||
owner = defaultOwner,
|
|
||||||
daoFactoryAddress = defaultDaoFactoryAddress,
|
|
||||||
verbose = true
|
|
||||||
} = {}
|
|
||||||
) => {
|
|
||||||
const log = (...args) => {
|
|
||||||
if (verbose) { console.log(...args) }
|
|
||||||
}
|
|
||||||
|
|
||||||
const APMRegistry = artifacts.require('APMRegistry')
|
|
||||||
const Repo = artifacts.require('Repo')
|
|
||||||
const ENSSubdomainRegistrar = artifacts.require('ENSSubdomainRegistrar')
|
|
||||||
|
|
||||||
const DAOFactory = artifacts.require('DAOFactory')
|
|
||||||
const APMRegistryFactory = artifacts.require('APMRegistryFactory')
|
|
||||||
const ENS = artifacts.require('ENS')
|
|
||||||
|
|
||||||
const Kernel = artifacts.require('Kernel')
|
|
||||||
const ACL = artifacts.require('ACL')
|
|
||||||
|
|
||||||
const tldName = 'eth'
|
|
||||||
const labelName = 'aragonpm'
|
|
||||||
const tldHash = namehash(tldName)
|
|
||||||
const labelHash = '0x'+keccak256(labelName)
|
|
||||||
const apmNode = namehash(`${labelName}.${tldName}`)
|
|
||||||
|
|
||||||
let ens
|
|
||||||
|
|
||||||
log('Deploying APM...')
|
|
||||||
|
|
||||||
const accounts = await getAccounts(web3)
|
|
||||||
if (!owner) {
|
|
||||||
owner = accounts[0]
|
|
||||||
log('OWNER env variable not found, setting APM owner to the provider\'s first account')
|
|
||||||
}
|
|
||||||
log('Owner:', owner)
|
|
||||||
|
|
||||||
if (!ensAddress) {
|
|
||||||
log('=========')
|
|
||||||
log('Missing ENS! Deploying a custom ENS...')
|
|
||||||
ens = (await deployENS(null, { artifacts, owner, verbose: false })).ens
|
|
||||||
ensAddress = ens.address
|
|
||||||
} else {
|
|
||||||
ens = ENS.at(ensAddress)
|
|
||||||
}
|
|
||||||
|
|
||||||
log('ENS:', ensAddress)
|
|
||||||
log(`TLD: ${tldName} (${tldHash})`)
|
|
||||||
log(`Label: ${labelName} (${labelHash})`)
|
|
||||||
log(`apmNode: ${apmNode}`)
|
|
||||||
|
|
||||||
log('=========')
|
|
||||||
log('Deploying APM bases...')
|
|
||||||
|
|
||||||
const apmRegistryBase = await APMRegistry.new()
|
|
||||||
await logDeploy(apmRegistryBase, { verbose })
|
|
||||||
const apmRepoBase = await Repo.new()
|
|
||||||
await logDeploy(apmRepoBase, { verbose })
|
|
||||||
const ensSubdomainRegistrarBase = await ENSSubdomainRegistrar.new()
|
|
||||||
await logDeploy(ensSubdomainRegistrarBase, { verbose })
|
|
||||||
|
|
||||||
let daoFactory
|
|
||||||
if (daoFactoryAddress) {
|
|
||||||
daoFactory = DAOFactory.at(daoFactoryAddress)
|
|
||||||
const hasEVMScripts = await daoFactory.regFactory() !== ZERO_ADDR
|
|
||||||
|
|
||||||
log(`Using provided DAOFactory (with${hasEVMScripts ? '' : 'out' } EVMScripts):`, daoFactoryAddress)
|
|
||||||
} else {
|
|
||||||
log('Deploying DAOFactory with EVMScripts...')
|
|
||||||
daoFactory = (await deployDaoFactory(null, { artifacts, withEvmScriptRegistryFactory: true, verbose: false })).daoFactory
|
|
||||||
}
|
|
||||||
|
|
||||||
log('Deploying APMRegistryFactory...')
|
|
||||||
const apmFactory = await APMRegistryFactory.new(
|
|
||||||
daoFactory.address,
|
|
||||||
apmRegistryBase.address,
|
|
||||||
apmRepoBase.address,
|
|
||||||
ensSubdomainRegistrarBase.address,
|
|
||||||
ensAddress,
|
|
||||||
'0x00'
|
|
||||||
)
|
|
||||||
await logDeploy(apmFactory, { verbose })
|
|
||||||
|
|
||||||
|
|
||||||
log(`Assigning ENS name (${labelName}.${tldName}) to factory... ${apmFactory.address}`)
|
|
||||||
|
|
||||||
if (await ens.owner(apmNode) === accounts[0]) {
|
|
||||||
log('Transferring name ownership from deployer to APMRegistryFactory')
|
|
||||||
await ens.setOwner(apmNode, apmFactory.address)
|
|
||||||
} else {
|
|
||||||
log('Creating subdomain and assigning it to APMRegistryFactory')
|
|
||||||
try {
|
|
||||||
await ens.setSubnodeOwner(tldHash, labelHash, apmFactory.address)
|
|
||||||
//await ens.setSubnodeOwner(apmNode, keccak256('open'), apmFactory.address)
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
console.error(
|
|
||||||
`Error: could not set the owner of '${labelName}.${tldName}' on the given ENS instance`,
|
|
||||||
`(${ensAddress}). Make sure you have ownership rights over the subdomain.`
|
|
||||||
)
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
log('Deploying APM...')
|
|
||||||
const receipt = await apmFactory.newAPM(tldHash, labelHash, owner)
|
|
||||||
|
|
||||||
log('=========')
|
|
||||||
const apmAddr = receipt.logs.filter(l => l.event == 'DeployAPM')[0].args.apm
|
|
||||||
console.log(receipt.logs);
|
|
||||||
const apmDAO = APMRegistry.at(apmAddr);
|
|
||||||
|
|
||||||
log('Address:', apmAddr)
|
|
||||||
log('Transaction hash:', receipt.tx)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log('Deploying subdomain APM bases...')
|
|
||||||
|
|
||||||
const subApmRegistryBase = await APMRegistry.new()
|
|
||||||
await logDeploy(subApmRegistryBase, { verbose })
|
|
||||||
const subApmRepoBase = await Repo.new()
|
|
||||||
await logDeploy(subApmRepoBase, { verbose })
|
|
||||||
const subEnsSubdomainRegistrarBase = await ENSSubdomainRegistrar.new()
|
|
||||||
await logDeploy(subEnsSubdomainRegistrarBase, { verbose })
|
|
||||||
|
|
||||||
log('Deploying APMRegistryFactory...')
|
|
||||||
const subApmFactory = await APMRegistryFactory.new(
|
|
||||||
daoFactory.address,
|
|
||||||
subApmRegistryBase.address,
|
|
||||||
subApmRepoBase.address,
|
|
||||||
subEnsSubdomainRegistrarBase.address,
|
|
||||||
ensAddress,
|
|
||||||
'0x00'
|
|
||||||
)
|
|
||||||
await logDeploy(subApmFactory, { verbose })
|
|
||||||
|
|
||||||
|
|
||||||
const kernelAddr = await apmDAO.kernel();
|
|
||||||
console.log(kernelAddr);
|
|
||||||
const aclAddr = await Kernel.at(kernelAddr).acl();
|
|
||||||
const acl = ACL.at(aclAddr);
|
|
||||||
|
|
||||||
const role = await ensSubdomainRegistrarBase.CREATE_NAME_ROLE();
|
|
||||||
const registrarAddr = await apmDAO.registrar();
|
|
||||||
const registrar = ENSSubdomainRegistrar.at(registrarAddr);
|
|
||||||
|
|
||||||
console.log(owner, registrarAddr, role);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await acl.grantPermission(owner, registrarAddr, role);
|
|
||||||
|
|
||||||
log('Deploying subdomain APM...')
|
|
||||||
|
|
||||||
console.log(await acl.hasPermission(owner, registrar.address, role))
|
|
||||||
console.log(subApmFactory.address)
|
|
||||||
await registrar.createNameAndPoint(namehash('open'), subApmFactory.address)
|
|
||||||
|
|
||||||
const subReceipt = await subApmFactory.newAPM(namehash('aragonpm.eth'), namehash('open'), owner)
|
|
||||||
|
|
||||||
log('=========')
|
|
||||||
const subApmAddr = subReceipt.logs.filter(l => l.event == 'DeployAPM')[0].args.apm
|
|
||||||
console.log(subReceipt.logs);
|
|
||||||
console.log(subApmAddr);
|
|
||||||
|
|
||||||
} catch(e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof truffleExecCallback === 'function') {
|
|
||||||
// Called directly via `truffle exec`
|
|
||||||
truffleExecCallback()
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
apmFactory,
|
|
||||||
ens,
|
|
||||||
apm: APMRegistry.at(apmAddr),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
"
|
|
||||||
|
|
||||||
const namehash = require('eth-ens-namehash').hash
|
|
||||||
const keccak256 = require('js-sha3').keccak_256
|
|
||||||
|
|
||||||
const deployENS = require('@aragon/os/scripts/deploy-test-ens')
|
|
||||||
const deployDaoFactory = require('@aragon/os/scripts/deploy-daofactory')
|
|
||||||
const logDeploy = require('@aragon/os/scripts//helpers/deploy-logger')
|
|
||||||
const getAccounts = require('@aragon/os/scripts//helpers/get-accounts')
|
|
||||||
|
|
||||||
const globalArtifacts = this.artifacts // Not injected unless called directly via truffle
|
|
||||||
const globalWeb3 = this.web3 // Not injected unless called directly via truffle
|
|
||||||
|
|
||||||
const ZERO_ADDR = '0x0000000000000000000000000000000000000000'
|
|
||||||
|
|
||||||
const defaultOwner = process.env.OWNER
|
|
||||||
const defaultDaoFactoryAddress = process.env.DAO_FACTORY
|
|
||||||
const defaultENSAddress = process.env.ENS
|
|
||||||
|
|
||||||
module.exports = async (
|
|
||||||
truffleExecCallback,
|
|
||||||
{
|
|
||||||
artifacts = globalArtifacts,
|
|
||||||
web3 = globalWeb3,
|
|
||||||
ensAddress = defaultENSAddress,
|
|
||||||
owner = defaultOwner,
|
|
||||||
daoFactoryAddress = defaultDaoFactoryAddress,
|
|
||||||
verbose = true
|
|
||||||
} = {}
|
|
||||||
) => {
|
|
||||||
const log = (...args) => {
|
|
||||||
if (verbose) { console.log(...args) }
|
|
||||||
}
|
|
||||||
|
|
||||||
const APMRegistry = artifacts.require('APMRegistry')
|
|
||||||
const Repo = artifacts.require('Repo')
|
|
||||||
const ENSSubdomainRegistrar = artifacts.require('ENSSubdomainRegistrar')
|
|
||||||
|
|
||||||
const DAOFactory = artifacts.require('DAOFactory')
|
|
||||||
const APMRegistryFactory = artifacts.require('APMRegistryFactory')
|
|
||||||
const ENS = artifacts.require('ENS')
|
|
||||||
|
|
||||||
const tldName = 'eth'
|
|
||||||
const labelName = 'open.aragonpm'
|
|
||||||
const tldHash = namehash(tldName)
|
|
||||||
const labelHash = '0x'+keccak256(labelName)
|
|
||||||
const apmNode = namehash(`${labelName}.${tldName}`)
|
|
||||||
|
|
||||||
let ens
|
|
||||||
|
|
||||||
log('Deploying APM...')
|
|
||||||
|
|
||||||
const accounts = await getAccounts(web3)
|
|
||||||
if (!owner) {
|
|
||||||
owner = accounts[0]
|
|
||||||
log('OWNER env variable not found, setting APM owner to the provider\'s first account')
|
|
||||||
}
|
|
||||||
log('Owner:', owner)
|
|
||||||
|
|
||||||
if (!ensAddress) {
|
|
||||||
log('=========')
|
|
||||||
log('Missing ENS! Deploying a custom ENS...')
|
|
||||||
ens = (await deployENS(null, { artifacts, owner, verbose: false })).ens
|
|
||||||
ensAddress = ens.address
|
|
||||||
} else {
|
|
||||||
ens = ENS.at(ensAddress)
|
|
||||||
}
|
|
||||||
|
|
||||||
log('ENS:', ensAddress)
|
|
||||||
log(`TLD: ${tldName} (${tldHash})`)
|
|
||||||
log(`Label: ${labelName} (${labelHash})`)
|
|
||||||
|
|
||||||
log('=========')
|
|
||||||
log('Deploying APM bases...')
|
|
||||||
|
|
||||||
const apmRegistryBase = await APMRegistry.new()
|
|
||||||
await logDeploy(apmRegistryBase, { verbose })
|
|
||||||
const apmRepoBase = await Repo.new()
|
|
||||||
await logDeploy(apmRepoBase, { verbose })
|
|
||||||
const ensSubdomainRegistrarBase = await ENSSubdomainRegistrar.new()
|
|
||||||
await logDeploy(ensSubdomainRegistrarBase, { verbose })
|
|
||||||
|
|
||||||
let daoFactory
|
|
||||||
if (daoFactoryAddress) {
|
|
||||||
daoFactory = DAOFactory.at(daoFactoryAddress)
|
|
||||||
const hasEVMScripts = await daoFactory.regFactory() !== ZERO_ADDR
|
|
||||||
|
|
||||||
log(`Using provided DAOFactory (with${hasEVMScripts ? '' : 'out' } EVMScripts):`, daoFactoryAddress)
|
|
||||||
} else {
|
|
||||||
log('Deploying DAOFactory with EVMScripts...')
|
|
||||||
daoFactory = (await deployDaoFactory(null, { artifacts, withEvmScriptRegistryFactory: true, verbose: false })).daoFactory
|
|
||||||
}
|
|
||||||
|
|
||||||
log('Deploying APMRegistryFactory...')
|
|
||||||
const apmFactory = await APMRegistryFactory.new(
|
|
||||||
daoFactory.address,
|
|
||||||
apmRegistryBase.address,
|
|
||||||
apmRepoBase.address,
|
|
||||||
ensSubdomainRegistrarBase.address,
|
|
||||||
ensAddress,
|
|
||||||
'0x00'
|
|
||||||
)
|
|
||||||
await logDeploy(apmFactory, { verbose })
|
|
||||||
|
|
||||||
log(`Assigning ENS name (${labelName}.${tldName}) to factory...`)
|
|
||||||
|
|
||||||
if (await ens.owner(apmNode) === accounts[0]) {
|
|
||||||
log('Transferring name ownership from deployer to APMRegistryFactory')
|
|
||||||
await ens.setOwner(apmNode, apmFactory.address)
|
|
||||||
} else {
|
|
||||||
log('Creating subdomain and assigning it to APMRegistryFactory')
|
|
||||||
try {
|
|
||||||
await ens.setSubnodeOwner(tldHash, labelHash, apmFactory.address)
|
|
||||||
} catch (err) {
|
|
||||||
console.error(
|
|
||||||
`Error: could not set the owner of '${labelName}.${tldName}' on the given ENS instance`,
|
|
||||||
`(${ensAddress}). Make sure you have ownership rights over the subdomain.`
|
|
||||||
)
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
log('Deploying APM...')
|
|
||||||
const receipt = await apmFactory.newAPM(tldHash, labelHash, owner)
|
|
||||||
|
|
||||||
log('=========')
|
|
||||||
const apmAddr = receipt.logs.filter(l => l.event == 'DeployAPM')[0].args.apm
|
|
||||||
log('# APM:')
|
|
||||||
log('Address:', apmAddr)
|
|
||||||
log('Transaction hash:', receipt.tx)
|
|
||||||
log('=========')
|
|
||||||
|
|
||||||
try {
|
|
||||||
const kernel = await ensSubdomainRegistrarBase.kernel();
|
|
||||||
const acl = await kernel.acl();
|
|
||||||
console.log(acl);
|
|
||||||
let ret = await ensSubdomainRegistrarBase.createNameAndPoint(labelHash, apmAddr).then(console.log).catch(console.log);
|
|
||||||
console.log(ret);
|
|
||||||
} catch(e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (typeof truffleExecCallback === 'function') {
|
|
||||||
// Called directly via `truffle exec`
|
|
||||||
truffleExecCallback()
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
apmFactory,
|
|
||||||
ens,
|
|
||||||
apm: APMRegistry.at(apmAddr),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
@@ -20,10 +20,10 @@ module.exports = async function(callback) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
let blockNumber = await kredits.provider.getBlockNumber();
|
let blockNumber = await kredits.provider.getBlockNumber();
|
||||||
let contributions = await kredits.Contribution.all();
|
let contributions = await kredits.Contribution.all()
|
||||||
|
|
||||||
contributions.forEach((c) => {
|
contributions.forEach((c) => {
|
||||||
const confirmed = c.confirmedAtBlock <= blockNumber;
|
const confirmed = !!(c.claimAtBlock < blockNumber)
|
||||||
|
|
||||||
table.push([
|
table.push([
|
||||||
c.id.toString(),
|
c.id.toString(),
|
||||||
@@ -34,9 +34,9 @@ module.exports = async function(callback) {
|
|||||||
c.vetoed,
|
c.vetoed,
|
||||||
c.claimed,
|
c.claimed,
|
||||||
])
|
])
|
||||||
});
|
})
|
||||||
|
|
||||||
console.log(table.toString());
|
console.log(table.toString())
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
const promptly = require('promptly');
|
const promptly = require('promptly');
|
||||||
const Table = require('cli-table');
|
const Table = require('cli-table');
|
||||||
const ethers = require('ethers');
|
|
||||||
|
|
||||||
const initKredits = require('./helpers/init_kredits.js');
|
const initKredits = require('./helpers/init_kredits.js');
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ module.exports = async function(callback) {
|
|||||||
c.account,
|
c.account,
|
||||||
c.isCore,
|
c.isCore,
|
||||||
`${c.name}`,
|
`${c.name}`,
|
||||||
ethers.utils.formatEther(c.balance)
|
c.balance.toString()
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
console.log(table.toString())
|
console.log(table.toString())
|
||||||
|
|||||||
Reference in New Issue
Block a user