Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Remove default README and unnecessary TODO #67

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

michaelkaplan13
Copy link
Collaborator

Why this should be merged

Minor clean up

How this works

In Solidity, calls to internal library functions are automatically inlined, so there is no gas savings to copying the logic. From the Solidity docs:

Note that all external library calls are actual EVM function calls. This means that if you pass memory or value types, a copy will be performed, even in case of the self variable. The only situation where no copy will be performed is when storage reference variables are used or when internal library functions are called.

How this was tested

N/A

How is this documented

N/A

@geoff-vball
Copy link
Contributor

Just needs regenerated go bindings. Thanks for the cleanup :)

@@ -75,8 +75,6 @@ contract ERC20Destination is IERC20Bridge, TeleporterTokenDestination, ERC20 {
* @dev See {TeleportTokenDestination-_deposit}
*/
function _deposit(uint256 amount) internal virtual override returns (uint256) {
// TODO: can copy logic from SafeERC20TransferFrom.safeTransferFrom directly
// figure out if has gas savings.
return SafeERC20TransferFrom.safeTransferFrom(this, amount);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment explaining this for internal library functions

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO a comment here is not necessary, otherwise we'd want to leave similar comments at every internal library call to remain consistent.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup agreed, ideally I'd want to add that comment in teleporter where the actual library code is, but thought this was easier. Not a big pref either way.

@michaelkaplan13 michaelkaplan13 merged commit ceeae09 into main Apr 5, 2024
12 of 13 checks passed
@michaelkaplan13 michaelkaplan13 deleted the remove-todo-and-default-readme branch April 5, 2024 20:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants