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

Compiles but Error: invalid bytecode when trying to deploy #14335

Closed
migoldfinger opened this issue Jun 19, 2023 · 1 comment
Closed

Compiles but Error: invalid bytecode when trying to deploy #14335

migoldfinger opened this issue Jun 19, 2023 · 1 comment
Labels

Comments

@migoldfinger
Copy link

migoldfinger commented Jun 19, 2023

Description

I have one specific function which compiles fine but when I try to deploy the contract which it is on with hardhat-deploy I get an Error: invalid bytecode . I do use libraries but these libraries are used in other contracts too without any problem

Environment

Compiler version: 0.8.20
Framework/IDE: hardhat
EVM execution environment / backend / blockchain client: hardhat network
Operating system: windows

Steps to Reproduce

clone https://github.com/DFX-Protocol/dfx-contracts/tree/stackError

Manual:
Compile PositionManager contract with hardhat compile using 0.8.20 (solc-js)
No compilation error.
Try to deploy the PositionManager contract with hardhat-deploy
Get Error: invalid bytecode
Automatic:
Run npm run deploy:sepolia

@migoldfinger
Copy link
Author

Found it. There was a library used in the BasePositionManager. Since this is a update attempt there was also an old version of that library with the same name present. Looks like hardhat or solc mixed that up. Since the library uses external functions I think the use as external library is intended. I just did not see (and still do not see) this in the old deploy scripts used for that contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant