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

Merge after 2.5.3. #267

Merged
merged 16 commits into from
Mar 19, 2024
Merged

Merge after 2.5.3. #267

merged 16 commits into from
Mar 19, 2024

Conversation

steven2308
Copy link
Collaborator

Update after v2.5.3

Checklist

  • Verified code additions
  • Updated NatSpec comments (if applicable)
  • Regenerated docs
  • Ran prettier
  • Added tests to fully cover the changes

steven2308 and others added 15 commits March 2, 2024 22:03
RMRKTokenHolder (IERC7590-Draft Implementation) now reverts if transferred ERC-20 balance is not the specified amount.
Improves @dev comment on IERC7401, directOwnerOf method.
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.
Copy link

openzeppelin-code bot commented Mar 19, 2024

Merge after 2.5.3.

Generated at commit: 3e72f33aac61d2c0ed7d031062cf19c0b6f9c913

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
0
0
4
26
32
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

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
Copy link
Member

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

Copy link
Collaborator Author

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:

  1. If the balance of the contract did not increase by the exact amount, then it reverts. (Safest, but does not support tokens with taxes).
  2. Instead of increasing the token's balance to what was supposedly transfer, only increase it by the actually increased balance.
    I implemented 1.

Copy link
Member

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

Copy link
Collaborator Author

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.

@steven2308 steven2308 merged commit b0f1ca6 into master Mar 19, 2024
4 checks passed
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