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

Pashov L-04 display Native instead of the zero address #373

Merged
merged 10 commits into from
Oct 31, 2024
Merged

Conversation

dianakocsis
Copy link
Contributor

Related Issue

Pashov L-04 Using zero address for native token can be confusing for end users

Description of changes

display Native instead of the zero address

library SafeCurrencyMetadata {
using CurrencyLibrary for Currency;

library SafeERC20Metadata {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you rename this back? it was currency because it also handles native right? why is it ERC20 now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm i renamed it back since we're not unwrapping the currency in the file anymore, its just working with address

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm but its not only working with ERC20s either...? its still working with native e.g.

        if (addr == address(0)) {
            return nativeLabel;
        }

i'd personally still rather the name "currency"? its still working with both native and ERC20s even if its not using the Currency type

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AddressRatioSortOrder is fine.. could you address if you prefer. But ERC20 is still wrong imo

src/libraries/Descriptor.sol Outdated Show resolved Hide resolved
library SafeCurrencyMetadata {
using CurrencyLibrary for Currency;

library SafeERC20Metadata {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm but its not only working with ERC20s either...? its still working with native e.g.

        if (addr == address(0)) {
            return nativeLabel;
        }

i'd personally still rather the name "currency"? its still working with both native and ERC20s even if its not using the Currency type

library SafeCurrencyMetadata {
using CurrencyLibrary for Currency;

library SafeERC20Metadata {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AddressRatioSortOrder is fine.. could you address if you prefer. But ERC20 is still wrong imo

assertEq(token.name, "Uniswap - 0.3% - TEST/ETH - 1.0060<>1.0121");
assertEq(
token.description,
unicode"This NFT represents a liquidity position in a Uniswap v4 TEST-ETH pool. The owner of this NFT can modify or redeem the position.\n\nPool Manager Address: 0x5615deb798bb3e4dfa0139dfa1b3d433cc23b72f\nTEST Address: 0x5991a2df15a8f6a256d3ec51e99254cd3fb576a9\nETH Address: Native\nHook Address: 0x0000000000000000000000000000000000000000\nFee Tier: 0.3%\nToken ID: 1\n\n⚠️ DISCLAIMER: Due diligence is imperative when assessing this NFT. Make sure addresses match the expected addresses, as symbols may be imitated."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should say "No Hook" right? Maybe you didnt merge main

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i didnt merge main!

@dianakocsis dianakocsis merged commit 1a21920 into main Oct 31, 2024
3 checks passed
@dianakocsis dianakocsis deleted the pashov-l04 branch October 31, 2024 22:44
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

Successfully merging this pull request may close these issues.

2 participants