GammaProtocol icon indicating copy to clipboard operation
GammaProtocol copied to clipboard

Build: Setup initial hardhat compilations

Open CruzMolina opened this issue 4 years ago • 9 comments

  • 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

CruzMolina avatar Jun 03 '21 17:06 CruzMolina

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

haythemsellami avatar Jun 03 '21 19:06 haythemsellami

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.

haythemsellami avatar Jun 03 '21 19:06 haythemsellami

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

CruzMolina avatar Jun 03 '21 19:06 CruzMolina

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

antoncoding avatar Jun 04 '21 08:06 antoncoding

@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.

CruzMolina avatar Jun 04 '21 15:06 CruzMolina

@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.

haythemsellami avatar Jun 04 '21 15:06 haythemsellami

@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.

CruzMolina avatar Jun 04 '21 15:06 CruzMolina

@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

antoncoding avatar Jun 06 '21 03:06 antoncoding

Do not merge

haythemsellami avatar Sep 09 '22 13:09 haythemsellami