Skip to content

Use safe transfer for take - #102

Merged
willpote merged 4 commits into
mainfrom
take-safe
Jun 5, 2022
Merged

willpote merged 4 commits into
mainfrom
take-safe

Conversation

@willpote

Copy link
Copy Markdown
Contributor

Adds around 600 gas

Fixes #85

@moodysalem

Copy link
Copy Markdown
Contributor

might want to compare the gas of TransferHelper with the other existing SafeTransfer libs

@marktoda

marktoda commented Jun 3, 2022 •

Copy link
Copy Markdown
Contributor

See #105, pretty significant gas improvements by using the solmate implementation

* feat: improve gas of TransferHelper

This commit uses the solmate SafeTransfer library implementation
which has much improved gas performance over the existing
implementation. See https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol#L63

We copy the implementation in rather than import for typechecking as the
somlate library uses their custom ERC20 implementation and I didn't want
to have add ugly casts everywhere

* Fix code style issues with Prettier

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
@willpote

willpote commented Jun 5, 2022

Copy link
Copy Markdown
Contributor Author

@marktoda thanks for merging in the transfer helper!

@willpote
willpote merged commit 299e9df into main Jun 5, 2022
@willpote
willpote deleted the take-safe branch June 5, 2022 23:47
Jun1on pushed a commit to Jun1on/v4-core that referenced this pull request Jul 29, 2026
* Update package.json files

* Start

* Fix code style issues with Prettier

* feat: improve gas of TransferHelper (Uniswap#105)

* feat: improve gas of TransferHelper

This commit uses the solmate SafeTransfer library implementation
which has much improved gas performance over the existing
implementation. See https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol#L63

We copy the implementation in rather than import for typechecking as the
somlate library uses their custom ERC20 implementation and I didn't want
to have add ugly casts everywhere

* Fix code style issues with Prettier

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
Co-authored-by: marktoda <40770586+marktoda@users.noreply.github.com>
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.

PoolManager#take should use #safeTransfer

4 participants