Contract bytecode generated by Hardhat is two times larger than generated by Foundry #5120
Unanswered
sergey-tuna
asked this question in
Troubleshooting
Replies: 1 comment 1 reply
-
Hey @makovkins, this is unexpected. Both Hardhat and Foundry are leveraging Is this repo open source? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm developing a contract using both hardhat and foundry. For some reason hardhat generates bytecode that is two times larger than the one generated in foundry. Why does it happen? How do I fix it?
Source code:
Foundry 0.2.0:
6080604052348015600f57600080fd5b506004361060285760003560e01c80638da5cb5b14602d575b600080fd5b60537f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f3fea26469706673582212207bf5089fc3128e2f0334465c3ed0fd8e1fc3b11be15a78a8e19d374e7403358664736f6c634300080a0033
Hardhat 2.20.1:
60a060405234801561001057600080fd5b503373ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff168152505060805160f761005d60003960006049015260f76000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80638da5cb5b14602d575b600080fd5b60336047565b604051603e919060a8565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000609482606b565b9050919050565b60a281608b565b82525050565b600060208201905060bb6000830184609b565b9291505056fea26469706673582212205136b4d8c8bfd8c67e9ec8db167301214bac3a9d5086b1fb9ceba0683d1dca9064736f6c634300080a0033
Foundry config:
Hardhat config:
Beta Was this translation helpful? Give feedback.
All reactions