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

contracts under openzeppelin are not included #49

Open
KimiWu123 opened this issue Oct 26, 2020 · 8 comments
Open

contracts under openzeppelin are not included #49

KimiWu123 opened this issue Oct 26, 2020 · 8 comments

Comments

@KimiWu123
Copy link

KimiWu123 commented Oct 26, 2020

used poa-solidity-flattener to flatten my contract to upload to etherscan. xxx_flat.sol was generated successfully but we have some @OpenZeppelin dependencies, like IERC20, Context... were not be included in the final xxx_falt.sol. Not sure what happened. Here are some messages saying those files are not found in the beginning, but found later. But they are not included in the output file.

{"name":"solidity-flattener","hostname":"kimiwude-mbp.lan","pid":96101,"level":40,"msg":"!!! @openzeppelin/contracts-ethereum-package/contracts/math/SignedSafeMath.sol SOURCE FILE WAS NOT FOUND. I'M TRYING TO FIND IT RECURSIVELY !!!","time":"2020-10-26T07:47:54.428Z","v":0}
{"name":"solidity-flattener","hostname":"kimiwude-mbp.lan","pid":96101,"level":30,"msg":"@openzeppelin/contracts-ethereum-package/contracts/math/SignedSafeMath.sol SOURCE FILE WAS FOUND","time":"2020-10-26T07:47:54.439Z","v":0}
...
{"name":"solidity-flattener","hostname":"kimiwude-mbp.lan","pid":95092,"level":40,"msg":"!!! @openzeppelin/contracts/token/ERC20/IERC20.sol SOURCE FILE WAS NOT FOUND. I'M TRYING TO FIND IT RECURSIVELY !!!","time":"2020-10-26T07:32:36.865Z","v":0}
{"name":"solidity-flattener","hostname":"kimiwude-mbp.lan","pid":95092,"level":30,"msg":"@openzeppelin/contracts/token/ERC20/IERC20.sol SOURCE FILE WAS FOUND","time":"2020-10-26T07:32:36.875Z","v":0}

poa-solidity-flattener version: 3.0.6
build environment: buidler

@arnoudcommandeur
Copy link

I @KimiWu123 I have the same issue. Have you already found a solution?

@KimiWu123
Copy link
Author

@arnoudcommandeur , no idea how to fix it, we use truffle-flattener now.

@arnoudcommandeur
Copy link

Ok, thanks. @KimiWu123

@arnoudcommandeur
Copy link

Hi @KimiWu123, I had some issues using truffle-flattener because my directoryname contained soms special characters. Now I have changed the name to c:\Temp and the truffle-flattener is working. Thanks!

@ngduc
Copy link

ngduc commented Jul 15, 2021

I tried truffle-flattener but it failed.

For this issue, copy the openzepplin's "contracts" directory to ./node_modules/.bin/poa-solidity-flattener
then it should work.
your contract should look use import with relative path like this:
import "./contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
It works in this https://github.com/ngduc/flatten-sol

@ozh
Copy link

ozh commented Aug 20, 2021

sol-merger works fine, contrary to this script.

npm install sol-merger -g
sol-merger ./contracts/my.sol ./merged

@kilogold
Copy link

Thanks @ozh. You solved my problem!

@hapetherw
Copy link

Haha, thanks @ozh!
Now, it's too simple.

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

6 participants