Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(async (resolve, reject) => {
const aragon = new Aragon(this.kernel.address, {
accounts:
{ providedAccounts: [this.pando.options.ethereum.account] },
provider: this.pando.options.ethereum.provider,
apm: { ensRegistryAddress: this.pando.options.apm.ens }
})
console.log(aragon)
await aragon.init({
accounts:
{ providedAccounts: [this.pando.options.ethereum.account] }
// provider: this.pando.options.ethereum.provider,
// apm: { ensRegistryAddress: this.pando.options.apm.ens }
})
// await aragon.initApps()
const handler = async argv => {
try {
let txHash
let spinner
const pando = await Pando.create(defaultsDeep(options(), { ethereum: { network: argv.network } }))
const appId = pando.options.ethereum.network === 'devchain' ? namehash.hash('pando-colony.aragonpm.eth') : namehash.hash('pando-colony.open.aragonpm.eth')
const wrapper = new Aragon(argv.organization, {
apm: {
ensRegistryAddress: pando.options.apm.ens,
ipfs: pando.options.ipfs.gateway,
},
defaultGasPriceFn: () => String(5e9), // gwei
provider: pando.options.ethereum.provider,
})
await wrapper.init({ accounts: { providedAccounts: [pando.options.ethereum.account] } })
const apps = await _apps(wrapper)
const colonyAddress = apps.filter(app => app.appId === appId)[0].proxyAddress
const colony = await pando.artifacts.PandoColony.at(colonyAddress)
try {
spinner = ora(`Deploying repository '${argv.name}' on ${pando.options.ethereum.network}`).start()
colony
public async deploy(organization: string, name: string, description: string): Promise {
// TODO: assert that organization address is the one of an Aragon DAO
// TODO: if we are in a git directory also try to resolve the organization by the name of the remote
// TODO: handle transaction pathing
const wrapper = new Aragon(organization, {
provider: this.pando.options.ethereum.provider,
defaultGasPriceFn: () => String(5e9), // gwei
apm: {
ipfs: {},
ensRegistryAddress: this.pando.options.apm.ens,
},
})
await wrapper.init({ accounts: { providedAccounts: [this.pando.options.ethereum.account] } })
const apps = await this._apps(wrapper)
const address = apps.filter(app => app.appId === COLONY_APP_ID)[0].proxyAddress
const colony = await this.pando.artifacts.PandoColony.at(address)
const receipt = await colony.createRepository(name, '')
return this._getRepositoryAddressFromReceipt(receipt)
}