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

extraData set to 0 after token transfer #385

Open
akhater opened this issue Jul 20, 2022 · 3 comments
Open

extraData set to 0 after token transfer #385

akhater opened this issue Jul 20, 2022 · 3 comments

Comments

@akhater
Copy link

akhater commented Jul 20, 2022

I am packing some variables in the newly implemented "ExtraData" in 4.1.0 however, upon transferring a token the .extraData is set to 0 and not is carried over

@akhater
Copy link
Author

akhater commented Jul 20, 2022

ok it seems like i need to override _extraData function for it to work

if I need the .extraData to be carried as is i wrote my function as

function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view override returns (uint24) {
    return previousExtraData;
}

does it look OK?

@Vectorized
Copy link
Collaborator

Yes. That’s how you do it.

@akhater
Copy link
Author

akhater commented Jul 21, 2022

Thank you

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