You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
The command truffle compile will fail to generate the bytecode in .json files for contracts that have their interface defined in other contracts that are also being compiled.
Steps to Reproduce
Step 1. Create two very simple contracts. Let's call them TestA.sol and TestB.sol. Step 2. TestB.sol contains an interface definition of the TestA.sol contract.
This version of the problem might be easier to solve than contracts overwriting contracts. In my use cases it is more "okay" for a contract to overwrite an interface, since I am not going to deploy an interface.
Having an interface that overwrites the bytecode of a contract seems like a more subtle problem. For a long time I didn't know why my contract compiled and had no bytecode. I just thought truffle was broken.
My workaround was to install an earlier version of truffle: Truffle v5.1.21
With this version I could compile a couple times and it would work. With the current version of truffle this doesn't work.
There might be a workaround here, to omit artifacts for interfaces. If you'd like to take a look at doing this, would love a PR! (Or maybe just open an issue for that specific task)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue
The command
truffle compile
will fail to generate the bytecode in .json files for contracts that have their interface defined in other contracts that are also being compiled.Steps to Reproduce
Step 1. Create two very simple contracts. Let's call them TestA.sol and TestB.sol.
Step 2. TestB.sol contains an interface definition of the TestA.sol contract.
Here is what TestA.sol looks like:
Here is what TestB.sol looks like:
Step 3. Put these two contracts in a directory called "contracts". Then execute "truffle compile".
Step 4. Look at the generated bytecode for contract TestA.json that should exist in the TestA.json file. It does not exist. Here is a screenshot:
Expected Behavior
I expected the bytecode for contract TestA.sol to be in TestA.json.
Actual Results
The bytecode for TestA.sol was missing in TestA.json.
Perhaps TestA.json was created for the interface rather than the contract. I think it should be the other way around.
Environment
The text was updated successfully, but these errors were encountered: