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

Standardized ETH and ERC20 Gateways #222

Merged
merged 58 commits into from
Feb 23, 2021
Merged

Standardized ETH and ERC20 Gateways #222

merged 58 commits into from
Feb 23, 2021

Conversation

ben-chain
Copy link
Collaborator

Description

This draft PR builds on #219, implementing the gateway contracts and extending them for use with ETH in particular.

Note: We do have plans to add a withdrawAndCall function, but probably gonna merge this in without before doing that.

Questions

  • Are the events indexed how we want them to be? (cc @gigamesh)

Metadata

Fixes

  • Fixes roadmap567

Contributing Agreement

@ben-chain ben-chain marked this pull request as draft February 12, 2021 16:27
@ben-chain ben-chain marked this pull request as ready for review February 19, 2021 09:32
@ben-chain ben-chain changed the title [wip] Standard ERC20 Gateway Standard ERC20 Gateway Feb 19, 2021
@ben-chain ben-chain changed the title Standard ERC20 Gateway Standard ETH and ERC20 Gateways Feb 19, 2021
@ben-chain ben-chain changed the title Standard ETH and ERC20 Gateways Standardized ETH and ERC20 Gateways Feb 19, 2021
@ben-chain ben-chain requested a review from K-Ho February 22, 2021 05:45
Copy link
Contributor

@karlfloersch karlfloersch left a comment

Choose a reason for hiding this comment

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

This looks dope! Left a few comments/nits but overall imo we're verrrry close to a merge!

}

receive() external payable {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this receive(..) function supposed to be empty?

sendCrossDomainMessage(
address(l1ERC20Gateway),
data,
8999999 // TODO: meter and set with some buffer (actually I think its currently unused in this direction)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to inherit this value from the EM. And maybe do something like ExecutionManager.GAS_LIMIT - 1 or something

18,
'ETH',
'0x4200000000000000000000000000000000000007',
'0x0000000000000000000000000000000000000000', // will be overridden by geth when state dump is ingested. Storage key: 0x0000000000000000000000000000000000000000000000000000000000000008
Copy link
Contributor

Choose a reason for hiding this comment

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

We should definitely make a single source of truth for all of these pre-deploy addresses. If we are already hardcoding the addresses then I don't think we need to change it for this PR, but we should definitely at least add an issue for cleaning this up

Copy link
Contributor

@karlfloersch karlfloersch left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@karlfloersch karlfloersch left a comment

Choose a reason for hiding this comment

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

Double LGTM

@ben-chain ben-chain merged commit 1b26510 into master Feb 23, 2021
@karlfloersch karlfloersch deleted the feat/567/L2Gateway branch February 23, 2021 00:20
K-Ho pushed a commit that referenced this pull request Mar 31, 2021
* initial

* get .calls test working

* add assertions to withdrawal tests

* add missing finalizeDeposit tests

* clean up tests

* clean up crosschain library

* further clean up tests

* clean up L1 Gateway, fix bug

* further clean up contracts

* quick save

* quick save

* Add unsupported to fix compiler bug, need to remove this

* fix constructor inputs

* build fixes

* improve test case names

* l1 gateway testing WIP

* add comment on init

* Add withdraw tests

* temp only

* All tests implemented, 2 still failing, needs polish

* All tests implemented, 2 still failing, needs polish

* add failing test for finalizeWithdrawAndCall

* Add univ2erc20, broken build tho

* get contracts building

* clean up tests and interface

* updates

* move to uniswap ERC20

* more updates, fix gateway tests with uniswap

* finish deploy config?

* Add ETH deposit gateway (OVM_L1ETHGateway) (#225)

* OVM_L1ETHGateway almost working

* OVM_L1ETHGateway tests all passing

* clean up unused stuff

* lower gaslimit

* lower gas further

* typo

* break out helper

* resolve messenger

* update deploy config

* renaming

* lint

* update tests to use AM

* restructure fs layout

* clean unused envar

* remove interface version bound

* remove todo

* various minor cleanups

* add safemath to contract account

* update naming conventions

* fix test config and test name

* cleanup for consistency

* fix eth send test

* remove .only

* clean up, add deposit gas limit

* lint

* add gas config and tests

* fix indent

Co-authored-by: ben <ben@bens-MacBook-Pro.local>
Co-authored-by: Maurelian <maurelian@protonmail.ch>
Co-authored-by: Matt Masurka <m.masurka@gmail.com>
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.

None yet

7 participants