-
Notifications
You must be signed in to change notification settings - Fork 36
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
Merge after 2.5.3. #267
Merge after 2.5.3. #267
Conversation
RMRKTokenHolder (IERC7590-Draft Implementation) now reverts if transferred ERC-20 balance is not the specified amount. Improves @dev comment on IERC7401, directOwnerOf method.
…ions and tokenIds on setters and getters.
No long uses structs as return values for batch getters. If a single attribute is sent on batch getter/setters it will use it for all collections and tokens.
Bumps [squirrelly](https://github.com/squirrellyjs/squirrelly) from 8.0.8 to 9.0.0. - [Release notes](https://github.com/squirrellyjs/squirrelly/releases) - [Commits](squirrellyjs/squirrelly@v8.0.8...v9.0.0) --- updated-dependencies: - dependency-name: squirrelly dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
Interface was refactoring purely for ordering purposes.
Renames methods to set and get collection attributes metadata to make it explicit they are per collection.
Merge after 2.5.3.
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
uint256 initBalance = erc20.balanceOf(address(this)); | ||
erc20.transferFrom(msg.sender, address(this), amount); | ||
uint256 newBalance = erc20.balanceOf(address(this)); | ||
// Here you can either use the difference as the amount, or revert if the difference is not equal to the amount and you don't want to support transfer fees |
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.
to me this comment is not very clear tbh
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.
Turns out there are ERC20 tokens with "Tax". So you call token.transfer(10)
but only 9.9 are sent.
Initially, the token holder was assuming that the transferred value was received, so the balances of the NFT would be 10, but the contract would actually only have 9.9 in this case.
To fix this there are 2 options:
- If the balance of the contract did not increase by the exact amount, then it reverts. (Safest, but does not support tokens with taxes).
- Instead of increasing the token's balance to what was supposedly transfer, only increase it by the actually increased balance.
I implemented 1.
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, but I meant more about the comment :D maybe if I didn't get it, others won't too, so we should improve the comment
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.
Oh.. haha. I guess I'll just copy paste this explanation.
Update after v2.5.3
Checklist