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

Flatten removes "pragma experimental ABIEncoderV2;" #2378

Closed
2 tasks done
sakulstra opened this issue Jul 19, 2022 · 0 comments · Fixed by #6936 · May be fixed by gakonst/ethers-rs#2645
Closed
2 tasks done

Flatten removes "pragma experimental ABIEncoderV2;" #2378

sakulstra opened this issue Jul 19, 2022 · 0 comments · Fixed by #6936 · May be fixed by gakonst/ethers-rs#2645
Labels
C-forge Command: forge Cmd-forge-flatten Command: forge flatten T-bug Type: bug

Comments

@sakulstra
Copy link
Contributor

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (44f3a4b 2022-07-18T00:10:06.735136619Z)

What command(s) is the bug in?

forge flatten

Operating System

Linux

Describe the bug

forge flatten will remove pragma experimental ABIEncoderV2; from the code and thus break it.

To reproduce I can run cast etherscan-source -d etherscan/0x7b2a3cf972c3193f26cdec6217d27379b6417bd0 0x7b2a3cf972c3193f26cdec6217d27379b6417bd0 to download https://etherscan.io/address/0x7b2a3cf972c3193f26cdec6217d27379b6417bd0#code
The ILendingPool.sol will correctly contain pragma experimental ABIEncoderV2;.

If you now run:

forge flatten ./etherscan/0x7b2a3cf972c3193f26cdec6217d27379b6417bd0/AToken/@aave/protocol-v2/contracts/protocol/tokenization/AToken.sol --output ./etherscan/0x7b2a3cf972c3193f26cdec6217d27379b6417bd0/Flattened.sol

The code will be flattened, but pragma experimental ABIEncoderV2; will be lost, breaking the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-flatten Command: forge flatten T-bug Type: bug
Projects
No open projects
Archived in project
2 participants