-
Notifications
You must be signed in to change notification settings - Fork 408
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
fix: Show approval editor for ERC721 approvals #3991
Conversation
Branch preview✅ Deploy successful! Storybook: |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
948.79 KB (🟡 +39 B) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
const title = isErc721 ? 'Allow access to tokens?' : 'Allow access to tokens?' | ||
const subtitle = isErc721 | ||
? 'This allows the spender to transfer the specified token.' | ||
: 'This allows the spender to spend the specified amount of your tokens.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can keep the title the same for both erc20 and erc721.
Coverage report
Show files with reduced coverage 🔻
Test suite run success1447 tests passing in 200 suites. Report generated by 🧪jest coverage report action from 9562263 |
try { | ||
tokenInfo = await getERC20TokenInfoOnChain(approval.tokenAddress) | ||
} catch (e) { | ||
isErc721 = await isErc721Token(approval.tokenAddress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also try to fetch some minimal token information here. At least the name or symbol of the collection for instance.
Also we need to display the id
that you are giving your approval to.
Currently the modal says "This allows the spender to transfer the specified token."
But we do not specify any token underneath.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I added a call to fetch the symbol and decided to only fetch the symbol instead of the name or both because they are part of the same contract so either both exist or both don't and symbol is already part of the approval object.
I've also added a different message and included the token id. Let me know if this works for you:
ESLint Summary View Full Report
Report generated by eslint-plus-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the info 🚀
@usame-algan , I see only a collection name. Do we agree to display only it ? |
I would suggest for simplicity that we only display the symbol since we only load NFTs when the user visits the NFT page so they are most likely not there. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
verified |
What it solves
Resolves #3774
How this PR fixes it
supportsInterface
with the ERC721 identifier to at least know if its an ERC721 token or not.Caveat: If its a multisend that contains both ERC20 and ERC721 approvals all of them will be read-only now.
How to test it
approve
transaction and continueScreenshots
Checklist