"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const index_1 = require("../index");
/**
 * Migration callback
 */
class GenesisDaoCreator {
    constructor(web3) {
        this.web3 = web3;
    }
    run() {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const spec = {
                founders: [
                    {
                        address: "0xb0c908140fe6fd6fbd4990a5c2e35ca6dc12bfb2",
                        reputation: "1000",
                        tokens: "1000",
                    },
                    {
                        address: "0x9c7f9f45a22ad3d667a5439f72b563df3aa70aae",
                        reputation: "1000",
                        tokens: "1000",
                    },
                    {
                        address: "0xa2a064b3b22fc892dfb71923a6d844b953aa247c",
                        reputation: "1000",
                        tokens: "1000",
                    },
                    {
                        address: "0xdeeaa92e025ca7fe34679b0b92cd4ffa162c8de8",
                        reputation: "1000",
                        tokens: "1000",
                    },
                    {
                        address: "0x81cfdaf70273745a291a7cf9af801a4cffa87a95",
                        reputation: "1000",
                        tokens: "1000",
                    },
                    {
                        address: "0x8ec400484deb5330bcd0bc005c13a557c5247727",
                        reputation: "1000",
                        tokens: "1000",
                    },
                ],
                name: "Genesis Test",
                schemes: [
                    {
                        name: "SchemeRegistrar",
                        votingMachineParams: {
                            votingMachineName: "AbsoluteVote",
                        },
                    },
                    {
                        name: "GlobalConstraintRegistrar",
                        votingMachineParams: {
                            votingMachineName: "AbsoluteVote",
                        },
                    },
                    {
                        name: "UpgradeScheme",
                        votingMachineParams: {
                            votingMachineName: "AbsoluteVote",
                        },
                    },
                    {
                        name: "ContributionReward",
                        votingMachineParams: {
                            votingMachineName: "GenesisProtocol",
                        },
                    },
                ],
                tokenName: "Genesis Test",
                tokenSymbol: "GDT",
            };
            yield index_1.InitializeArcJs();
            spec.founders = spec.founders.map((f) => {
                return {
                    address: f.address,
                    reputation: this.web3.toWei(f.reputation),
                    tokens: this.web3.toWei(f.tokens),
                };
            });
            console.log(`Genesis Test DAO with ${spec.founders.length} founders...`);
            const dao = yield index_1.DAO.new(spec);
            console.log(`new DAO created at: ${dao.avatar.address}`);
            console.log(`native token: ${dao.token.address}`);
            return Promise.resolve();
        });
    }
}
exports.GenesisDaoCreator = GenesisDaoCreator;
//# sourceMappingURL=createGenesisDao.js.map