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

Build: Setup initial hardhat compilations #423

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

CruzMolina
Copy link
Contributor

@CruzMolina CruzMolina commented Jun 3, 2021

  • build: add hardhat as devDep
  • build: initial hardhat config w/ solidity settings
  • refactor: add artifacts & cache to gitignore
  • build: add npm hardhat compile script
  • refactor: port hardhat config from js to ts
  • refactor: rm unused calculateContractBytecode script
  • build: add calculate-contract-bytecode npm script

@haythemsellami
Copy link
Member

Why removing calculateContractBytecode script ? I sometime use it to check contract bytecode size, I think it is useful.

@haythemsellami
Copy link
Member

haythemsellami commented Jun 3, 2021

This is good, I think it will be great if u do a walkthrough of the setup or hardhat overall in a learning session before merging this.

@CruzMolina
Copy link
Contributor Author

Ah, my bad @haythem96 . It looked like an unused script. Will re-add.

@antoncoding
Copy link
Contributor

Use this instead of the script:
https://hardhat.org/plugins/hardhat-contract-sizer.html

@CruzMolina
Copy link
Contributor Author

CruzMolina commented Jun 4, 2021

@antoncoding the output of the script that plugin runs is different than the calculateContractBytecode script.
hardhat-contract-sizer outputs a table of each contract's bytecode size in KB but doesn't show how much space is left.

What do you think @haythem96?

Also, IIRC, by default ganache-cli maintains the EIP-170 limit. A contract breaching the limit should not deploy locally.

@haythemsellami
Copy link
Member

@antoncoding the output of the script that plugin runs is different than the calculateContractBytecode script.
hardhat-contract-sizer outputs a table of each contract's bytecode size in KB but doesn't show how much space is left.

What do you think @haythem96?

Also, IIRC, by default ganache-cli maintains the EIP-170 limit. A contract breaching the limit should not deploy locally.

Yes that's true, I think it is fine to keep the script, it is already working and doesn't need any maintenance even if we don't mainly use it, so I don't see a cons of keeping it.

@CruzMolina
Copy link
Contributor Author

@haythem96 the issue I see with keeping is that it's very specific to truffle's framework. However, if we decide to remove truffle as a devDependency, it shouldn't be difficult to modify the hardhat plugin script to also calculate and provide similar output.

@antoncoding
Copy link
Contributor

antoncoding commented Jun 6, 2021

@haythem96 the issue I see with keeping is that it's very specific to truffle's framework. However, if we decide to remove truffle as a devDependency, it shouldn't be difficult to modify the hardhat plugin script to also calculate and provide similar output.

I think we can keep it for now, and open another PR to modify all truffle script to hardhat, and then remove truffle as dev dependency

@haythemsellami
Copy link
Member

Do not merge

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.

4 participants