-
Notifications
You must be signed in to change notification settings - Fork 60
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
use transferFrom(pool -> receiver) over hop through offRamp #1258
Conversation
LCOV of commit
|
# Conflicts: # core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt
@@ -478,7 +478,7 @@ contract TokenPoolAndProxy is EVM2EVMOnRampSetup { | |||
vm.startPrank(address(s_fakeOffRamp)); | |||
|
|||
vm.expectEmit(address(s_legacyPool)); | |||
emit Minted(address(s_pool), s_fakeOffRamp, amount); | |||
emit Minted(address(s_pool), address(s_pool), amount); |
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.
suggestion: we should verify the Approve event as well
); | ||
i_token.approve(msg.sender, releaseOrMintIn.amount); |
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.
q: shouldn't we check the bool
output value and revert if it's false in all approve
instances?
Although this would bubble up to the transferFrom
function failing in the OffRamp, so not strictly necessary
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 want to keep these function as low in gas as possible, so given this isn't strictly necessary I'd vote to do it through the implicit check over explicit
# Conflicts: # contracts/gas-snapshots/ccip.gas-snapshot # core/gethwrappers/ccip/generated/evm_2_evm_multi_offramp/evm_2_evm_multi_offramp.go # core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt
|
## Motivation Change the hop through the offRamp to a transferFrom so the funds never touch CCIP contracts outside of the pool ## Solution
Motivation
Change the hop through the offRamp to a transferFrom so the funds never touch CCIP contracts outside of the pool
Solution