-
Notifications
You must be signed in to change notification settings - Fork 602
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
Add transfer helper #480
Add transfer helper #480
Conversation
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.
Looks great! If possible address the GitHub action lints (about lines too long) but other than that looks good to me
} | ||
|
||
// Call the conduit and execute bulk transfers. | ||
ConduitInterface(conduit).execute(conduitTransfers); |
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.
There is no validation this returns the magic, so solely TransferHelper
depends on setup correctly with a valid conduit.
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.
Actually this piece doesn't even use the conduitController
, but derives an address from from the key. So as long as returndata is returned this is considered successful. Should really check the magic.
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.
and/or should perform the same check the ConduitController
is doing: conduit.codehash == _CONDUIT_RUNTIME_CODE_HASH
.
else { | ||
// Derive the conduit address from the deployer, conduit key | ||
// and creation code hash. | ||
address conduit = address( |
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.
I wonder if it would make sense instead having a public function for this on the conduit, though that has a call cost.
Motivation
Add a helper contract to allow bulk transfers of ERC20/ERC721/ERC1155 to a specified recipient.
Solution
TransferHelper.sol
,TransferHelperInterface.sol
, andTransferHelperStructs.sol