OpenZeppelin / openzeppelin-contracts

OpenZeppelin Contracts is a library for secure smart contract development.
https://openzeppelin.com/contracts
MIT License
24.44k stars 11.68k forks source link

Reduce memory leakage from returndata in SafeERC20 #5090

Closed Amxx closed 5 days ago

Amxx commented 1 week ago

When we know the relevant part of the result is limited to a fixed length (in that case 1 word), then we don't to get all the returndata to memory. That risks a returns bom, and even if it doesnt, the memory expension has a cost.

changeset-bot[bot] commented 1 week ago

⚠️ No Changeset found

Latest commit: e027da88200853a2962d4f54c80818f36b0d4aac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR