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

Deployment config #314

Merged
merged 15 commits into from
Jul 14, 2021
Merged

Deployment config #314

merged 15 commits into from
Jul 14, 2021

Conversation

fforbeck
Copy link
Contributor

@fforbeck fforbeck commented Jun 15, 2021

Main changes:

  1. All contracts must be declared in the deployment/contracts.config.js file following the structure:
{
    name: "ContractName",
    path: "../contracts/path/ContractName",
    enabled: true,
    version: "1.0.0",
    type: ContractType.TYPE,
  },
  • name: the name of the contract declared in the .sol file;
  • path: the path of the contract in the contracts folder;
  • enabled: the flag indicating if that contract must be deployed/enabled;
  • version: the version of the contract that will be used to write/read to/from the DaoArtifacts contract;
  • type: the type of the contract (Core = 0, Factory = 1, Extension = 2, Adapter = 3, Util = 4, Test = 5)
  1. Each contract can be removed from the deployment process, all you need to do is to added the contract name to the corresponding network config file in the deployment/*.config.js. Any contract name added to the disabled list will be skipped during the deployment. It is useful make sure you deploy only contracts that are really mandatory to your DAO.

  2. Added the Alchemy url as environment variable for the HD Truffle Wallet in truffle.config.js.

  3. Increased the block polling time to reduce rate-limit issues.

  4. TruffleUtil was updated to build the deploymentFunctionFactory using the new DaoArtifacts contract. If the DaoArtifacts address is not provided as environment variables, a new contract gets created and every new Adapter, Factory and Utility contracts gets added to the new DaoArtifacts contract, so they can be reused on future deployments. The deploy function for truffle migrate task was updated to attempt to load the contracts by Id, Version, Owner and Type from the DaoArtifacts first, if there is a match, that contract gets attached to the new DAO - this approach saves gas during the deployment step because we don't need to create all the Adapters, Factories or Utilities contracts every time.

  5. The owner of the artifacts in the DaoArtifacts contract can be specified via environment variable: DAO_ARTIFACTS_OWNER_ADDR, if not specified, the DAO_OWNER_ADDR will be used as the default owner.

  6. The DaoArtifacts contract can be specified via environment variable: DAO_ARTIFACTS_CONTRACT_ADDR, if none is specified, then a new contract gets deployed.

TODO:

  • Mainnet deployment
  • Update docs

@fforbeck fforbeck self-assigned this Jun 15, 2021
@fforbeck fforbeck force-pushed the deploy-config branch 2 times, most recently from ec815d5 to d97c0f2 Compare July 5, 2021 21:13
@fforbeck fforbeck requested a review from adridadou July 12, 2021 20:24
@fforbeck fforbeck marked this pull request as ready for review July 12, 2021 20:25
@fforbeck fforbeck requested a review from jdville03 July 12, 2021 20:52
adridadou
adridadou previously approved these changes Jul 13, 2021
Copy link
Member

@adridadou adridadou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a little error that should happen in tests IMO bu otherwise it looks good to me!

utils/TruffleUtil.js Outdated Show resolved Hide resolved
utils/TruffleUtil.js Outdated Show resolved Hide resolved
utils/OZTestUtil.js Outdated Show resolved Hide resolved
@fforbeck fforbeck changed the title WIP: deployment config Deployment config Jul 14, 2021
@fforbeck fforbeck merged commit 1b90e94 into master Jul 14, 2021
@fforbeck fforbeck deleted the deploy-config branch July 14, 2021 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants