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

feat(contracts): replace hardhat with foundry toolkit #51

Merged
merged 11 commits into from Jul 5, 2022
Merged

Conversation

alvrs
Copy link
Member

@alvrs alvrs commented Jul 1, 2022

Situation before this PR

  • We had to maintain two different deploy scripts (one for hardhat to deploy to real chains, one for forge to use in tests)
  • Hardhat deploy has no easy method of using command-line arguments, which we need to be able to pass the address of an existing persona (or world or diamond) deployment
  • When modifying the forge deploy script we had to manually craft the diamond cut in solidity in the Deploy script (by adding all function selectors, allocating memory, etc)
  • We had to manually craft yarn scripts to deploy the contracts to different chains and provide all the command line args

Changes in this PR

  • Use forge scripts to deploy contracts instead of hardhat
    • Add deploy.json file for easy configuration of components and diamond facets without having to touch deploy script
    • Add codegen for LibDeploy.sol, which can be used to deploy to real chains as well as in forge tests
  • Use anvil as local node instead of hardhat
  • Update mud deploy script to support chainSpec and our new deploy scripts. Mud deploy allows for interactive deployment (you get prompted for every param), command line args or config files.
  • Add run-pty to root for an easy way to start up a mud project

Followup todos:

  • Use LibDeploy.sol for forge tests too (right now it is only used for the Broadcast deploy script)
  • Add separate LibInit library for configuring methods to be called after deploying the diamond instead of in the LibDeploy library (LibDeploy should be as general as possible)

@alvrs alvrs changed the base branch from main to nyc-sprint-1 July 1, 2022 15:47
@@ -0,0 +1,45 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the config file in which we declare which components / facets we want to deploy

@alvrs alvrs requested a review from ludns July 1, 2022 15:51
@alvrs alvrs changed the base branch from nyc-sprint-1 to main July 3, 2022 02:34
ludns
ludns previously approved these changes Jul 4, 2022
@alvrs alvrs merged commit 2c0e4a9 into main Jul 5, 2022
davidkol pushed a commit that referenced this pull request Jul 7, 2022
* fix: add missing components and methods to BroadcastDeploy

* feat(contracts): move deploy logic to library

* feat(contracts): add codegen for deploy script

* feat(contracs): add functionality to upgrade diamond

* feat(contracts): add functionality to reuse world and components

* chore(contracts): remove hardhat, use foundry toolkit for everything

* fix(cli): fix mud deploy

* feat: add yarn start:ri script to workspace root

* fix(cli): add fetch and fix chainSpec parsing

* chore: clean up package.json

* fix: make deploy script pass local persona contracts to launcher
@alvrs alvrs deleted the alvrs/deploy branch July 19, 2022 19:49
LPSCRYPT pushed a commit to LPSCRYPT/esp that referenced this pull request Jan 23, 2023
* fix: add missing components and methods to BroadcastDeploy

* feat(contracts): move deploy logic to library

* feat(contracts): add codegen for deploy script

* feat(contracs): add functionality to upgrade diamond

* feat(contracts): add functionality to reuse world and components

* chore(contracts): remove hardhat, use foundry toolkit for everything

* fix(cli): fix mud deploy

* feat: add yarn start:ri script to workspace root

* fix(cli): add fetch and fix chainSpec parsing

* chore: clean up package.json

* fix: make deploy script pass local persona contracts to launcher
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.

None yet

2 participants