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

Data location not enforced between abstract contract and implementation #13678

Closed
decanus opened this issue Nov 3, 2022 · 1 comment
Closed

Comments

@decanus
Copy link

decanus commented Nov 3, 2022

Given the following function signature in an abstract contract:

    function _withdraw(
        uint256,
        address,
        uint256,
        bytes memory /* data */
    ) internal virtual;

We would expect that the following code not compile:

    function _withdraw(
        uint256,
        address,
        uint256,
        bytes calldata /* data */
    ) internal override { }

However it does, and when overriding it skews with the values of the previous parameters. The easiest way to prevent this mistake is to not allow changing the storage location.

@cameel
Copy link
Member

cameel commented Nov 3, 2022

Are you using the latest compiler? This could be a serious issue with our previous fix, but it's more likely that you're running into this bug that has already been fixed in 0.8.14:

@decanus decanus closed this as completed Nov 8, 2022
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