Coder Social home page Coder Social logo

config.json is not actually used about tcr HOT 2 CLOSED

skmgoldin avatar skmgoldin commented on August 22, 2024
config.json is not actually used

from tcr.

Comments (2)

kangarang avatar kangarang commented on August 22, 2024

@derekchiang , you're correct -- the config.json at the moment isn't very useful. prior to our recent factory/proxy refactoring, we were using the config file during migrations. lately i've been using a custom external script to deploy proxies, but have yet to merge it into this repo. here's the snippet:

command: truffle exec --network [network] ./scripts/deploy_proxies.js

/scripts/deploy_proxies.js

/* global artifacts */
const fs = require('fs');

const RegistryFactory = artifacts.require('./RegistryFactory.sol');

const config = JSON.parse(fs.readFileSync('../conf/config.json'));
const paramConfig = config.paramDefaults;

module.exports = (callback) => {
  async function deployRegistry() {
    const registryFactory = await RegistryFactory.at('0xcc0df91b86795f21c3d43dbeb3ede0dfcf8dccaf'); // address of registry factory for current network
    const registryReceipt = await registryFactory.newRegistryWithToken(
      config.token.supply,
      config.token.name,
      config.token.decimals,
      config.token.symbol,
      [
        paramConfig.minDeposit,
        paramConfig.pMinDeposit,
        paramConfig.applyStageLength,
        paramConfig.pApplyStageLength,
        paramConfig.commitStageLength,
        paramConfig.pCommitStageLength,
        paramConfig.revealStageLength,
        paramConfig.pRevealStageLength,
        paramConfig.dispensationPct,
        paramConfig.pDispensationPct,
        paramConfig.voteQuorum,
        paramConfig.pVoteQuorum,
      ],
      config.name,
    );

    const {
      token,
      plcr,
      parameterizer,
      registry,
    } = registryReceipt.logs[0].args;

    console.log('\n');
    console.log('token:', token);
    console.log('voting:', plcr);
    console.log('parameterizer', parameterizer);
    console.log('registry:', registry);
    console.log('\n');

    return true;
  }

  deployRegistry().then(() => callback());
}

from tcr.

kangarang avatar kangarang commented on August 22, 2024

more info here: https://truffleframework.com/docs/getting_started/scripts

from tcr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.