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

Program displays empty output boxes #12

Open
MathiusEire opened this issue Jul 7, 2021 · 6 comments
Open

Program displays empty output boxes #12

MathiusEire opened this issue Jul 7, 2021 · 6 comments

Comments

@MathiusEire
Copy link

as stated the output of the program after it runs is just 2 empty output boxes with their corresponding contract and size labels

@daniel-iobuilders
Copy link
Contributor

Hi @MathiusEire
this happens when the plugin does not find any contracts. Is the project where this happens open source? It would help a lot to see the configuration of the project to narrow down the bug.

@MathiusEire
Copy link
Author

MathiusEire commented Jul 8, 2021 via email

@daniel-iobuilders
Copy link
Contributor

I executed the following commands:

mkdir optimism-box
cd optimism-box
truffle unbox optimism-box
npm install truffle-contract-size
# add plugin to truffle-config.js
npx truffle compile
npx truffle run contract-size

Then I got the following result:

│ Contract                                                             │ Size     │
│ SimpleStorage                                                   │ 0.19 KiB │

So it seems to work. Have you maybe not compiled the contracts before executing truffle run contract-size? The contracts need to be compiled first in order to calculate the contract size. If not an empty table is shown.

@MathiusEire
Copy link
Author

MathiusEire commented Jul 8, 2021 via email

@daniel-iobuilders
Copy link
Contributor

I did not realize that there is another truffle configuration file in the project for the ovm. You have to specify it when running any truffle command if not it will always use the default configuration, which points to the EVM contracts. With the following commands it works:

npm install truffle-contract-size
# add plugin configuration to truffle-config.ovm.js
npm run compile:ovm
npx truffle run contract-size --config truffle-config.ovm.js

Then I get:

Contract                                                         │ Size      │
SimpleStorage                                               │ 0.45 KiB |

@MathiusEire
Copy link
Author

MathiusEire commented Jul 8, 2021 via email

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

No branches or pull requests

2 participants