Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
87b2819d
Unverified
Commit
87b2819d
authored
Jun 09, 2023
by
dapperscene6
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update PR based off review comments
parent
549f5837
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
511 additions
and
61 deletions
+511
-61
basefeevault.go
op-bindings/bindings/basefeevault.go
+149
-13
l1feevault.go
op-bindings/bindings/l1feevault.go
+149
-13
sequencerfeevault.go
op-bindings/bindings/sequencerfeevault.go
+149
-13
test-deploy-config-devnet-l1.json
...in-ops/genesis/testdata/test-deploy-config-devnet-l1.json
+1
-1
CommonTest.t.sol
packages/contracts-bedrock/contracts/test/CommonTest.t.sol
+16
-0
SequencerFeeVault.t.sol
.../contracts-bedrock/contracts/test/SequencerFeeVault.t.sol
+18
-13
FeeVault.sol
packages/contracts-bedrock/contracts/universal/FeeVault.sol
+13
-1
getting-started.json
...ages/contracts-bedrock/deploy-config/getting-started.json
+1
-1
goerli.json
packages/contracts-bedrock/deploy-config/goerli.json
+1
-0
internal-devnet.json
...ages/contracts-bedrock/deploy-config/internal-devnet.json
+7
-0
local.ts
packages/contracts-bedrock/deploy-config/local.ts
+1
-0
mainnet.json
packages/contracts-bedrock/deploy-config/mainnet.json
+3
-3
deploy-config.ts
packages/contracts-bedrock/src/deploy-config.ts
+3
-3
No files found.
op-bindings/bindings/basefeevault.go
View file @
87b2819d
This diff is collapsed.
Click to expand it.
op-bindings/bindings/l1feevault.go
View file @
87b2819d
This diff is collapsed.
Click to expand it.
op-bindings/bindings/sequencerfeevault.go
View file @
87b2819d
This diff is collapsed.
Click to expand it.
op-chain-ops/genesis/testdata/test-deploy-config-devnet-l1.json
View file @
87b2819d
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
"baseFeeVaultRecipient"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"baseFeeVaultRecipient"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"l1FeeVaultRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"l1FeeVaultRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"sequencerFeeVaultRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"sequencerFeeVaultRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"baseFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"baseFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"l1FeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"l1FeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"sequencerFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"sequencerFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
...
@@ -29,7 +30,6 @@
...
@@ -29,7 +30,6 @@
"l1FeeVaultWithdrawalNetwork"
:
0
,
"l1FeeVaultWithdrawalNetwork"
:
0
,
"sequencerFeeVaultWithdrawalNetwork"
:
0
,
"sequencerFeeVaultWithdrawalNetwork"
:
0
,
"l1ERC721BridgeProxy"
:
"0xff000000000000000000000000000000000000ff"
,
"l1ERC721BridgeProxy"
:
"0xff000000000000000000000000000000000000ff"
,
"l1StandardBridgeProxy"
:
"0xff000000000000000000000000000000000000fd"
,
"l1StandardBridgeProxy"
:
"0xff000000000000000000000000000000000000fd"
,
"l1CrossDomainMessengerProxy"
:
"0xff000000000000000000000000000000000000dd"
,
"l1CrossDomainMessengerProxy"
:
"0xff000000000000000000000000000000000000dd"
,
...
...
packages/contracts-bedrock/contracts/test/CommonTest.t.sol
View file @
87b2819d
...
@@ -15,6 +15,8 @@ import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol";
...
@@ -15,6 +15,8 @@ import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol";
import { OptimismPortal } from "../L1/OptimismPortal.sol";
import { OptimismPortal } from "../L1/OptimismPortal.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { L2CrossDomainMessenger } from "../L2/L2CrossDomainMessenger.sol";
import { L2CrossDomainMessenger } from "../L2/L2CrossDomainMessenger.sol";
import { SequencerFeeVault } from "../L2/SequencerFeeVault.sol";
import { FeeVault } from "../universal/FeeVault.sol";
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { LegacyERC20ETH } from "../legacy/LegacyERC20ETH.sol";
import { LegacyERC20ETH } from "../legacy/LegacyERC20ETH.sol";
import { Predeploys } from "../libraries/Predeploys.sol";
import { Predeploys } from "../libraries/Predeploys.sol";
...
@@ -488,6 +490,20 @@ contract ERC721Bridge_Initializer is Messenger_Initializer {
...
@@ -488,6 +490,20 @@ contract ERC721Bridge_Initializer is Messenger_Initializer {
}
}
}
}
contract FeeVault_Initializer is Bridge_Initializer {
SequencerFeeVault vault = SequencerFeeVault(payable(Predeploys.SEQUENCER_FEE_WALLET));
address constant recipient = address(1024);
event Withdrawal(uint256 value, address to, address from);
event Withdrawal(
uint256 value,
address to,
address from,
FeeVault.WithdrawalNetwork withdrawalNetwork
);
}
contract FFIInterface is Test {
contract FFIInterface is Test {
function getProveWithdrawalTransactionInputs(Types.WithdrawalTransaction memory _tx)
function getProveWithdrawalTransactionInputs(Types.WithdrawalTransaction memory _tx)
external
external
...
...
packages/contracts-bedrock/contracts/test/SequencerFeeVault.t.sol
View file @
87b2819d
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
pragma solidity 0.8.15;
import {
Bridge
_Initializer } from "./CommonTest.t.sol";
import {
FeeVault
_Initializer } from "./CommonTest.t.sol";
import { FeeVault } from "../universal/FeeVault.sol";
import { FeeVault } from "../universal/FeeVault.sol";
import { SequencerFeeVault } from "../L2/SequencerFeeVault.sol";
import { SequencerFeeVault } from "../L2/SequencerFeeVault.sol";
import { StandardBridge } from "../universal/StandardBridge.sol";
import { StandardBridge } from "../universal/StandardBridge.sol";
import { Predeploys } from "../libraries/Predeploys.sol";
import { Predeploys } from "../libraries/Predeploys.sol";
contract SequencerFeeVault_Test is Bridge_Initializer {
contract SequencerFeeVault_Test is FeeVault_Initializer {
SequencerFeeVault vault = SequencerFeeVault(payable(Predeploys.SEQUENCER_FEE_WALLET));
address constant recipient = address(256);
event Withdrawal(
uint256 value,
address to,
address from,
FeeVault.WithdrawalNetwork withdrawalNetwork
);
function setUp() public override {
function setUp() public override {
super.setUp();
super.setUp();
vm.etch(
vm.etch(
...
@@ -63,6 +53,8 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
...
@@ -63,6 +53,8 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
// No ether has been withdrawn yet
// No ether has been withdrawn yet
assertEq(vault.totalProcessed(), 0);
assertEq(vault.totalProcessed(), 0);
vm.expectEmit(true, true, true, true, address(Predeploys.SEQUENCER_FEE_WALLET));
emit Withdrawal(address(vault).balance, vault.RECIPIENT(), address(this));
vm.expectEmit(true, true, true, true, address(Predeploys.SEQUENCER_FEE_WALLET));
vm.expectEmit(true, true, true, true, address(Predeploys.SEQUENCER_FEE_WALLET));
emit Withdrawal(
emit Withdrawal(
address(vault).balance,
address(vault).balance,
...
@@ -87,20 +79,31 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
...
@@ -87,20 +79,31 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
// The withdrawal was successful
// The withdrawal was successful
assertEq(vault.totalProcessed(), amount);
assertEq(vault.totalProcessed(), amount);
assertEq(address(vault).balance, ZERO_VALUE);
assertEq(Predeploys.L2_TO_L1_MESSAGE_PASSER.balance, amount);
}
}
}
function test_withdraw_toL2_succeeds() external {
contract SequencerFeeVault_L2Withdrawal_Test is FeeVault_Initializer {
function setUp() public override {
super.setUp();
vm.etch(
vm.etch(
Predeploys.SEQUENCER_FEE_WALLET,
Predeploys.SEQUENCER_FEE_WALLET,
address(new SequencerFeeVault(recipient, NON_ZERO_VALUE, FeeVault.WithdrawalNetwork.L2))
address(new SequencerFeeVault(recipient, NON_ZERO_VALUE, FeeVault.WithdrawalNetwork.L2))
.code
.code
);
);
vm.label(Predeploys.SEQUENCER_FEE_WALLET, "SequencerFeeVault");
}
function test_withdraw_toL2_succeeds() external {
uint256 amount = vault.MIN_WITHDRAWAL_AMOUNT() + 1;
uint256 amount = vault.MIN_WITHDRAWAL_AMOUNT() + 1;
vm.deal(address(vault), amount);
vm.deal(address(vault), amount);
// No ether has been withdrawn yet
// No ether has been withdrawn yet
assertEq(vault.totalProcessed(), 0);
assertEq(vault.totalProcessed(), 0);
vm.expectEmit(true, true, true, true, address(Predeploys.SEQUENCER_FEE_WALLET));
emit Withdrawal(address(vault).balance, vault.RECIPIENT(), address(this));
vm.expectEmit(true, true, true, true, address(Predeploys.SEQUENCER_FEE_WALLET));
vm.expectEmit(true, true, true, true, address(Predeploys.SEQUENCER_FEE_WALLET));
emit Withdrawal(
emit Withdrawal(
address(vault).balance,
address(vault).balance,
...
@@ -116,5 +119,7 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
...
@@ -116,5 +119,7 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
// The withdrawal was successful
// The withdrawal was successful
assertEq(vault.totalProcessed(), amount);
assertEq(vault.totalProcessed(), amount);
assertEq(address(vault).balance, ZERO_VALUE);
assertEq(recipient.balance, amount);
}
}
}
}
packages/contracts-bedrock/contracts/universal/FeeVault.sol
View file @
87b2819d
...
@@ -46,6 +46,17 @@ abstract contract FeeVault {
...
@@ -46,6 +46,17 @@ abstract contract FeeVault {
*/
*/
uint256 public totalProcessed;
uint256 public totalProcessed;
/**
* @notice Emitted each time a withdrawal occurs. This event will be deprecated
* in favor of the Withdrawal event containing the WithdrawalNetwork parameter.
*
* @param value Amount that was withdrawn (in wei).
* @param to Address that the funds were sent to.
* @param from Address that triggered the withdrawal.
*
*/
event Withdrawal(uint256 value, address to, address from);
/**
/**
* @notice Emitted each time a withdrawal occurs.
* @notice Emitted each time a withdrawal occurs.
*
*
...
@@ -88,10 +99,11 @@ abstract contract FeeVault {
...
@@ -88,10 +99,11 @@ abstract contract FeeVault {
uint256 value = address(this).balance;
uint256 value = address(this).balance;
totalProcessed += value;
totalProcessed += value;
emit Withdrawal(value, RECIPIENT, msg.sender);
emit Withdrawal(value, RECIPIENT, msg.sender, WITHDRAWAL_NETWORK);
emit Withdrawal(value, RECIPIENT, msg.sender, WITHDRAWAL_NETWORK);
if (WITHDRAWAL_NETWORK == WithdrawalNetwork.L2) {
if (WITHDRAWAL_NETWORK == WithdrawalNetwork.L2) {
SafeCall.
call(RECIPIENT, gasleft(), value, bytes("")
);
SafeCall.
send(RECIPIENT, gasleft(), value
);
} else {
} else {
L2StandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE)).bridgeETHTo{ value: value }(
L2StandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE)).bridgeETHTo{ value: value }(
RECIPIENT,
RECIPIENT,
...
...
packages/contracts-bedrock/deploy-config/getting-started.json
View file @
87b2819d
...
@@ -29,10 +29,10 @@
...
@@ -29,10 +29,10 @@
"finalizationPeriodSeconds"
:
12
,
"finalizationPeriodSeconds"
:
12
,
"proxyAdminOwner"
:
"ADMIN"
,
"proxyAdminOwner"
:
"ADMIN"
,
"baseFeeVaultRecipient"
:
"ADMIN"
,
"baseFeeVaultRecipient"
:
"ADMIN"
,
"l1FeeVaultRecipient"
:
"ADMIN"
,
"l1FeeVaultRecipient"
:
"ADMIN"
,
"sequencerFeeVaultRecipient"
:
"ADMIN"
,
"sequencerFeeVaultRecipient"
:
"ADMIN"
,
"baseFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"baseFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"l1FeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"l1FeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"sequencerFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"sequencerFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
...
...
packages/contracts-bedrock/deploy-config/goerli.json
View file @
87b2819d
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
"baseFeeVaultRecipient"
:
"0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f"
,
"baseFeeVaultRecipient"
:
"0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f"
,
"l1FeeVaultRecipient"
:
"0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f"
,
"l1FeeVaultRecipient"
:
"0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f"
,
"sequencerFeeVaultRecipient"
:
"0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f"
,
"sequencerFeeVaultRecipient"
:
"0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f"
,
"baseFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"baseFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"l1FeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"l1FeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"sequencerFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"sequencerFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
...
...
packages/contracts-bedrock/deploy-config/internal-devnet.json
View file @
87b2819d
...
@@ -27,6 +27,13 @@
...
@@ -27,6 +27,13 @@
"l1FeeVaultRecipient"
:
"0x858F0751ef8B4067f0d2668C076BDB50a8549fbF"
,
"l1FeeVaultRecipient"
:
"0x858F0751ef8B4067f0d2668C076BDB50a8549fbF"
,
"sequencerFeeVaultRecipient"
:
"0x858F0751ef8B4067f0d2668C076BDB50a8549fbF"
,
"sequencerFeeVaultRecipient"
:
"0x858F0751ef8B4067f0d2668C076BDB50a8549fbF"
,
"baseFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"l1FeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"sequencerFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"baseFeeVaultWithdrawalNetwork"
:
0
,
"l1FeeVaultWithdrawalNetwork"
:
0
,
"sequencerFeeVaultWithdrawalNetwork"
:
0
,
"governanceTokenName"
:
"Optimism"
,
"governanceTokenName"
:
"Optimism"
,
"governanceTokenSymbol"
:
"OP"
,
"governanceTokenSymbol"
:
"OP"
,
"governanceTokenOwner"
:
"0x858F0751ef8B4067f0d2668C076BDB50a8549fbF"
,
"governanceTokenOwner"
:
"0x858F0751ef8B4067f0d2668C076BDB50a8549fbF"
,
...
...
packages/contracts-bedrock/deploy-config/local.ts
View file @
87b2819d
...
@@ -29,6 +29,7 @@ const config: DeployConfig = {
...
@@ -29,6 +29,7 @@ const config: DeployConfig = {
baseFeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
baseFeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
l1FeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
l1FeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
sequencerFeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
sequencerFeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
baseFeeVaultMinimumWithdrawalAmount
:
'
0x8ac7230489e80000
'
,
baseFeeVaultMinimumWithdrawalAmount
:
'
0x8ac7230489e80000
'
,
l1FeeVaultMinimumWithdrawalAmount
:
'
0x8ac7230489e80000
'
,
l1FeeVaultMinimumWithdrawalAmount
:
'
0x8ac7230489e80000
'
,
sequencerFeeVaultMinimumWithdrawalAmount
:
'
0x8ac7230489e80000
'
,
sequencerFeeVaultMinimumWithdrawalAmount
:
'
0x8ac7230489e80000
'
,
...
...
packages/contracts-bedrock/deploy-config/mainnet.json
View file @
87b2819d
...
@@ -22,9 +22,9 @@
...
@@ -22,9 +22,9 @@
"baseFeeVaultRecipient"
:
"0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa"
,
"baseFeeVaultRecipient"
:
"0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa"
,
"l1FeeVaultRecipient"
:
"0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa"
,
"l1FeeVaultRecipient"
:
"0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa"
,
"sequencerFeeVaultRecipient"
:
"0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa"
,
"sequencerFeeVaultRecipient"
:
"0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa"
,
"baseFeeVaultMinimumWithdrawalAmount"
:
'
0
x
8
ac
7230489e80000
'
,
"baseFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"l1FeeVaultMinimumWithdrawalAmount"
:
'
0
x
8
ac
7230489e80000
'
,
"l1FeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"sequencerFeeVaultMinimumWithdrawalAmount"
:
'
0
x
8
ac
7230489e80000
'
,
"sequencerFeeVaultMinimumWithdrawalAmount"
:
"0x8ac7230489e80000"
,
"baseFeeVaultWithdrawalNetwork"
:
0
,
"baseFeeVaultWithdrawalNetwork"
:
0
,
"l1FeeVaultWithdrawalNetwork"
:
0
,
"l1FeeVaultWithdrawalNetwork"
:
0
,
"sequencerFeeVaultWithdrawalNetwork"
:
0
,
"sequencerFeeVaultWithdrawalNetwork"
:
0
,
...
...
packages/contracts-bedrock/src/deploy-config.ts
View file @
87b2819d
...
@@ -136,17 +136,17 @@ interface RequiredDeployConfig {
...
@@ -136,17 +136,17 @@ interface RequiredDeployConfig {
proxyAdminOwner
:
string
proxyAdminOwner
:
string
/**
/**
* L1 or
L2
address which receives the base fee for the L2 network.
* L1 or
higher (e.g. L2)
address which receives the base fee for the L2 network.
*/
*/
baseFeeVaultRecipient
:
string
baseFeeVaultRecipient
:
string
/**
/**
* L1 or
L2
address which receives data fees for the L2 network.
* L1 or
higher (e.g. L2)
address which receives data fees for the L2 network.
*/
*/
l1FeeVaultRecipient
:
string
l1FeeVaultRecipient
:
string
/**
/**
* L1 or
L2
address which receives tip fees for the L2 network.
* L1 or
higher (e.g. L2)
address which receives tip fees for the L2 network.
*/
*/
sequencerFeeVaultRecipient
:
string
sequencerFeeVaultRecipient
:
string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment