Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Conversation

@ben-chain
Copy link
Collaborator

Description

Reworks the contracts to allow for constructing new bridges via inheritable hooks. This will allow folks to easily use their desired ERC20 implementations.

Contributing Agreement

@ben-chain ben-chain requested a review from maurelian February 26, 2021 02:47
@ben-chain ben-chain marked this pull request as draft February 26, 2021 02:47
* @param _to Account to give the deposit to on L2
* @param _amount Amount of the ERC20 to deposit.
* @param _from L1 address ETH is being deposited from
* @param _to L2 address that the ETH is being deposited to
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit... these param descriptions make me wonder if we should change the arguments to something like:
_l1Sender, _l2Recipient. Might be a useful cue to devs to help them follow the logic.

/*******************
* Contract Events *
*******************/
contract OVM_L2DepositedERC20 is Abs_L2DepositedERC20, UniswapV2ERC20 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should rename UniswapV2ERC20 to ERC20? We can recognize them in the comments on the file header, but it feels a bit odd to see the project explicitly called out here.

Copy link
Contributor

@transmissions11 transmissions11 Feb 28, 2021

Choose a reason for hiding this comment

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

Maybe PermitERC20/PermissibleERC20?

@ben-chain ben-chain changed the title [WIP] Extensible deposit withdraw Extensible deposit withdraw Mar 1, 2021
@ben-chain ben-chain marked this pull request as ready for review March 1, 2021 17:08
…m-optimism/contracts into feat/extensible-deposit-withdraw
smartcontracts
smartcontracts previously approved these changes Mar 2, 2021
Copy link
Collaborator

@smartcontracts smartcontracts left a comment

Choose a reason for hiding this comment

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

LGTM, could use some cleanup (extra whitespace in some places) but logic looks good to me.


// Construct calldata for l2DepositedToken.finalizeDeposit(_to, _amount)
bytes memory data = abi.encodeWithSelector(
iOVM_L2DepositedToken.finalizeDeposit.selector,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Whoa! When did Solidity add this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's been there for a bit, but it still lets you pass in the wrong argument types sooo meh lol

)
external
override
onlyFromCrossDomainAccount(l2DepositedToken)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe worth asking around about the naming here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Gonna merge since this is a bit time-sensitive, and this is not a change from the previous PR, but let's def revisit this.

Copy link
Contributor

@K-Ho K-Ho left a comment

Choose a reason for hiding this comment

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

lgtm!

@ben-chain ben-chain merged commit d72f24e into master Mar 3, 2021
@smartcontracts smartcontracts deleted the feat/extensible-deposit-withdraw branch March 25, 2021 17:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants