Skip to content
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

Standard token bridge #988

Merged
merged 97 commits into from
Jun 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
358b351
Remove abstract token gateway and deposited token implementations
elenadimitrova May 28, 2021
ff2ee60
Further simplification of bridge contracts
elenadimitrova May 28, 2021
2a2031e
Standart token bridge and L2 token implementation
elenadimitrova May 31, 2021
11d71b0
Fix spacing
elenadimitrova May 31, 2021
2dfdf00
Implement case when a bad deposit happens to a nonexistent L1<>L2 tok…
elenadimitrova May 31, 2021
b979dee
Use SafeMath in common token bridge accounting
elenadimitrova May 31, 2021
da670bc
test(contracts): fix finalizeWithdrawal test
maurelian Jun 1, 2021
ce8071b
fix(contracts): use SafeERC20 on token deposits
maurelian Jun 1, 2021
55da41e
Rename OVM_L1ERC20Gateway to OVM_L1ERC20Bridge contract
elenadimitrova Jun 1, 2021
c51a13f
Rename iOVM_L1ERC20Gateway to iOVM_L1ERC20Bridge contract
elenadimitrova Jun 1, 2021
57fe141
Cleanup gateway to bridge rename
elenadimitrova Jun 1, 2021
bd663b0
Better name for the mapping holding l1->l2 deposit amounts
elenadimitrova Jun 1, 2021
0c54793
Use OZ SafeMath
elenadimitrova Jun 1, 2021
24798d4
Rename local variables in OVM_L2DepositedERC20 from gateway to bridge
elenadimitrova Jun 1, 2021
7e4a404
Merge ETH and ERC20 bridge contracts
elenadimitrova Jun 2, 2021
b4c99c4
Rename OVM_L1ERC20Bridge to OVM_L1StandardBridge and fix tests from m…
elenadimitrova Jun 2, 2021
959f638
Better name for iAbs_BaseCrossDomainMessenger -> iOVM_CrossDomainMess…
elenadimitrova Jun 2, 2021
37bc32a
Correct the bounce back of deposit sender and recipient properties
elenadimitrova Jun 2, 2021
d6e9d8b
Remove obsoleted event from OVM_L2DepositedERC20
elenadimitrova Jun 2, 2021
bcc3d5e
chore(contracts): change references from ETHGateway to Bridge
maurelian Jun 2, 2021
2ad7ba0
Fix a linting error
elenadimitrova Jun 2, 2021
a1bc46e
fix(contracts): add bridge to deployer
maurelian Jun 2, 2021
11d5b95
Split off ERC20Bridge interface for the purposes
elenadimitrova Jun 3, 2021
68277c9
Split off interface natspec definitions
elenadimitrova Jun 3, 2021
e0bdbf0
Draft version of OVM_L2DepositedERC20 splitted into a standard L2 erc…
elenadimitrova Jun 3, 2021
cf8efa3
style(contracts): define L1_ETH_ADDRESS as constant
maurelian Jun 3, 2021
8199da4
test(integration): update interface to use depositETH
maurelian Jun 3, 2021
c7d5618
test(contracts): fix OVM_L1StandardBridge tests
maurelian Jun 4, 2021
44f2171
test(contracts): fix L2 Standard Bridge tests
maurelian Jun 4, 2021
563f1f2
test(contracts): lint and remove an obsolete test case
maurelian Jun 4, 2021
43bd46c
Fix modifier check to comply with the L2 bridge distinction from L2 t…
elenadimitrova Jun 4, 2021
6494a0b
Simplify address <> interface casting in bridges
elenadimitrova Jun 4, 2021
1d082ec
Ensure natspec comments are correct
elenadimitrova Jun 4, 2021
579fdd4
Fix issues in L1 and L2 bridges to ensure
elenadimitrova Jun 4, 2021
e8c37d2
Remove AddressManager from the L1 standard bridge
elenadimitrova Jun 4, 2021
b748d0a
REVERT ME: instruments cross domain enabled
maurelian Jun 4, 2021
415a8a9
fix(contracts): remove Address Manager from L1 Bridge
maurelian Jun 4, 2021
99bfc07
feat(contracts): make L2 Standard Bridge a predeploy
maurelian Jun 4, 2021
842453c
WIP: update deployments for standard bridges
maurelian Jun 4, 2021
0b572f3
WIP: update deployments for standard bridges
maurelian Jun 4, 2021
25862b8
l2geth: TEMP log contract calls
tynes May 26, 2021
d41ec59
chore(l2geth): replace eth gateway with standard bridge
maurelian Jun 3, 2021
0cc04da
fix(contracts): make contract-deployment/config work
maurelian Jun 5, 2021
06228d0
WIP fix(integration): update integration tests for bridge
maurelian Jun 5, 2021
2b4d79a
Remove ovmEth from L1 Standard bridge as obsoleted
elenadimitrova Jun 7, 2021
1643aba
Separate ERC20 standard implementation from L2 bridge
elenadimitrova Jun 8, 2021
19b6863
Formatting fixes
elenadimitrova Jun 8, 2021
1ca991a
chore(l2geth): replace eth gateway with standard bridge
maurelian Jun 3, 2021
931fd0f
Revert "REVERT ME: instruments cross domain enabled"
maurelian Jun 7, 2021
cbe81b3
fix: lint ts
maurelian Jun 8, 2021
236ee76
Implement EIP-165 in the Standard L2 ERC20 token
elenadimitrova Jun 8, 2021
2893827
fix(contracts): add deployment check on bridge proxy
maurelian Jun 8, 2021
6955c1b
Remove dependency on Ownable contract for the StandardERC20 token on L2
elenadimitrova Jun 8, 2021
946b990
fix(contracts): update deployment scripts
maurelian Jun 8, 2021
c906ade
fix: lint
maurelian Jun 8, 2021
55f8132
remove debugging code
maurelian Jun 8, 2021
1657211
fix: correct rpc get balance slot
maurelian Jun 9, 2021
56c3856
restore l2 cross domain messenger
maurelian Jun 9, 2021
5dce352
fix: lint
maurelian Jun 9, 2021
f8a54da
Add a test for a non compliant token deposit
elenadimitrova Jun 8, 2021
b2b96f1
Only allow EOAs to deposit ETH and ERC20
elenadimitrova Jun 9, 2021
41e17a8
Add comments and tests for ERC165 implementation
elenadimitrova Jun 9, 2021
41d9869
Decide against using explicit ETH MOCK address as we're not using it …
elenadimitrova Jun 9, 2021
e6a3e79
Fix linting issues
elenadimitrova Jun 9, 2021
834b968
Add onlyEOAContract restriction to standard bridge withdrawals
elenadimitrova Jun 9, 2021
163780e
Update codehashes in L2 Standard bridge
elenadimitrova Jun 9, 2021
b9f1c36
fix(ops): remove unintentionally added file
maurelian Jun 9, 2021
083c9f4
feat(contracts): add expectApproxGasCost function
maurelian Jun 9, 2021
41d658f
fix(integration): proper arrayify input on fundUser
maurelian Jun 9, 2021
5ec47be
fix(integration): proper gas value checks
maurelian Jun 9, 2021
0e20447
Revert "Add onlyEOAContract restriction to standard bridge withdrawals"
maurelian Jun 9, 2021
2c1619a
fix(contracts): removed unused expectApproxGasCost for now
maurelian Jun 9, 2021
f7e364e
fix(contracts): update OVM_SequencerFeeVault for bridge changes
maurelian Jun 10, 2021
604cc03
lint
maurelian Jun 10, 2021
3993263
Update deployment for L1 Bridge w/ ChugSplash
maurelian Jun 10, 2021
eeee932
Revert "l2geth: TEMP log contract calls"
maurelian Jun 10, 2021
7deec7c
Apply suggestions from code review
maurelian Jun 10, 2021
cef69d6
Apply suggestions from code review
maurelian Jun 10, 2021
f50068c
fix(contracts): deploy with chugsplash proxy
maurelian Jun 10, 2021
189d712
fix(contracts): add working bridge and chugsplash proxy deployment
maurelian Jun 10, 2021
8aeb842
fix(contracts,integration): 500k gas for depositETH
maurelian Jun 10, 2021
3e40476
comment(contracts): describe failed deposit handling on l2
maurelian Jun 10, 2021
23956e5
Apply suggestions from code review
maurelian Jun 10, 2021
0854e04
docs: add changeset
maurelian Jun 10, 2021
44e361a
fix(integration): set working l2 gas amount on funduser
maurelian Jun 10, 2021
e27a3a9
test(integration): add receive() test
maurelian Jun 10, 2021
97c3135
fix(contracts): reset receive to 1.2MM l2 gas
maurelian Jun 10, 2021
c39bf33
test(examples): skip l1-l2 example test for now
maurelian Jun 11, 2021
1dd2a40
fix(contracts): drop hardcoded gas to 500k in receive()
maurelian Jun 11, 2021
098cbe0
fix(contracts): use abi.encodeWithSignature
maurelian Jun 11, 2021
a73c949
fix(contracts): resolve merge conflicts
maurelian Jun 11, 2021
41decf8
feat(integration): add expectApprox for flexible gas testing
maurelian Jun 11, 2021
454c219
fix(integration): fix failing gas tests
maurelian Jun 11, 2021
fafece9
fix: incorrect l2 gas for deposit
smartcontracts Jun 11, 2021
7b33da3
Update utils.ts
smartcontracts Jun 11, 2021
c67f903
fix(workflow): disable l1-l2 example until npm imports are fixed
ben-chain Jun 11, 2021
bae3976
chore: final round of PR review nits and tests
ben-chain Jun 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(contracts): update OVM_SequencerFeeVault for bridge changes
  • Loading branch information
maurelian committed Jun 11, 2021
commit f7e364e6acb954ffeca90909f66922e97df50406
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Lib_PredeployAddresses } from "../../libraries/constants/Lib_PredeployA

/* Contract Imports */
import { OVM_ETH } from "../predeploys/OVM_ETH.sol";
import { OVM_L2StandardBridge } from "../bridge/tokens/OVM_L2StandardBridge.sol";

/**
* @title OVM_SequencerFeeVault
Expand Down Expand Up @@ -36,7 +37,7 @@ contract OVM_SequencerFeeVault {
/***************
* Constructor *
***************/

/**
* @param _l1FeeWallet Initial address for the L1 wallet that will hold fees once withdrawn.
* Currently HAS NO EFFECT in production because l2geth will mutate this storage slot during
Expand All @@ -63,7 +64,8 @@ contract OVM_SequencerFeeVault {
"OVM_SequencerFeeVault: withdrawal amount must be greater than minimum withdrawal amount"
);

OVM_ETH(Lib_PredeployAddresses.OVM_ETH).withdrawTo(
OVM_L2StandardBridge(Lib_PredeployAddresses.L2_STANDARD_BRIDGE).withdrawTo(
Lib_PredeployAddresses.OVM_ETH,
l1FeeWallet,
balance,
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { expect } from '../../../setup'
/* Imports: External */
import hre from 'hardhat'
import { MockContract, smockit } from '@eth-optimism/smock'
import { Contract, Signer } from 'ethers'
import { Contract, Signer, constants } from 'ethers'

/* Imports: Internal */
import { predeploys } from '../../../../src'
import { getContractFactory } from '@nomiclabs/hardhat-ethers/types'

describe('OVM_SequencerFeeVault', () => {
let signer1: Signer
Expand All @@ -15,10 +16,15 @@ describe('OVM_SequencerFeeVault', () => {
})

let Mock__OVM_ETH: MockContract
let Mock__OVM_L2StandardBridge: MockContract
before(async () => {
Mock__OVM_ETH = await smockit('OVM_ETH', {
address: predeploys.OVM_ETH,
})
Mock__OVM_L2StandardBridge = await smockit('OVM_L2StandardBridge', {
address: predeploys.OVM_L2StandardBridge,
})
console.log(await Mock__OVM_L2StandardBridge.getAddress)
})

let OVM_SequencerFeeVault: Contract
Expand All @@ -40,7 +46,10 @@ describe('OVM_SequencerFeeVault', () => {

await expect(OVM_SequencerFeeVault.withdraw()).to.not.be.reverted

expect(Mock__OVM_ETH.smocked.withdrawTo.calls[0]).to.deep.equal([
expect(
Mock__OVM_L2StandardBridge.smocked.withdrawTo.calls[0]
).to.deep.equal([
predeploys.OVM_ETH,
await signer1.getAddress(),
amount,
0,
Expand All @@ -54,7 +63,10 @@ describe('OVM_SequencerFeeVault', () => {

await expect(OVM_SequencerFeeVault.withdraw()).to.not.be.reverted

expect(Mock__OVM_ETH.smocked.withdrawTo.calls[0]).to.deep.equal([
expect(
Mock__OVM_L2StandardBridge.smocked.withdrawTo.calls[0]
).to.deep.equal([
predeploys.OVM_ETH,
await signer1.getAddress(),
amount,
0,
Expand Down