Skip to content

Build: Setup initial hardhat compilations#423

Open
CruzMolina wants to merge 8 commits into
masterfrom
build/hardhat-compile
Open

Build: Setup initial hardhat compilations#423
CruzMolina wants to merge 8 commits into
masterfrom
build/hardhat-compile

Conversation

@CruzMolina

@CruzMolina CruzMolina commented Jun 3, 2021

Copy link
Copy Markdown
Contributor
  • 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
Copy Markdown
Contributor

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

@haythemsellami

haythemsellami commented Jun 3, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@CruzMolina CruzMolina force-pushed the build/hardhat-compile branch from c309729 to 6b47969 Compare June 3, 2021 23:58
@CruzMolina CruzMolina force-pushed the build/hardhat-compile branch from 166516a to 1f2961f Compare June 3, 2021 23:59
@antoncoding

Copy link
Copy Markdown
Contributor

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

@CruzMolina

CruzMolina commented Jun 4, 2021

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
Contributor

@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
Copy Markdown
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

antoncoding commented Jun 6, 2021

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

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