Commit 5342e77d authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into refcell/service/refactor

parents b25169ea 8fe07a27
...@@ -29,10 +29,25 @@ New OP Stack blockchains are currently configured with a JSON file inside the Op ...@@ -29,10 +29,25 @@ New OP Stack blockchains are currently configured with a JSON file inside the Op
| Key | Type | Description | Default value | | Key | Type | Description | Default value |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `baseFeeVaultRecipient` | L1 Address | L1 address that the base fees from all transactions on the L2 can be withdrawn to. | It is recommended to have a single admin account to retain a common security model. | | `baseFeeVaultRecipient` | L1 or L2 Address | Address that the base fees from all transactions on the L2 can be withdrawn to. | It is recommended to have a single admin account to retain a common security model. |
| `l1FeeVaultRecipient` | L1 Address | L1 address that the L1 data fees from all transactions on the L2 can be withdrawn to. | It is recommended to have a single admin account to retain a common security model. | | `l1FeeVaultRecipient` | L1 or L2 Address | Address that the L1 data fees from all transactions on the L2 can be withdrawn to. | It is recommended to have a single admin account to retain a common security model. |
| `sequencerFeeVaultRecipient` | L1 Address | L1 address that the tip fees from all transactions on the L2 can be withdrawn to. | It is recommended to have a single admin account to retain a common security model. | | `sequencerFeeVaultRecipient` | L1 or L2 Address | Address that the tip fees from all transactions on the L2 can be withdrawn to. | It is recommended to have a single admin account to retain a common security model. |
### Minimum Fee Withdrawal Amounts
| Key | Type | Description | Default value |
| --- | --- | --- | --- |
| `baseFeeVaultMinimumWithdrawalAmount` | Number in wei | The minimum amount of funds the `BaseFeeVault` contract must have for a fee withdrawal. | 10 ether |
| `l1FeeVaultMinimumWithdrawalAmount` | Number in wei | The minimum amount of funds the `L1FeeVault` contract must have for a fee withdrawal. | 10 ether |
| `sequencerFeeVaultWithdrawalAmount` | Number in wei | The minimum amount of funds the `SequencerFeeVault` contract must have for a fee withdrawal. | 10 ether |
### Withdrawal Network
| Key | Type | Description | Default value |
| --- | --- | --- | --- |
| `baseFeeVaultWithdrawalNetwork` | Number representing network enum | A value of `0` will withdraw funds to the recient address on L1 and a value of `1` will withdraw funds to the recient address on L2. |
| `l1FeeVaultWithdrawalNetwork` | Number representing network enum | A value of `0` will withdraw funds to the recient address on L1 and a value of `1` will withdraw funds to the recient address on L2. |
| `sequencerFeeVaultWithdrawalNetwork` | Number representing network enum | A value of `0` will withdraw funds to the recient address on L1 and a value of `1` will withdraw funds to the recient address on L2. |
### Misc. ### Misc.
......
...@@ -3,9 +3,12 @@ package database ...@@ -3,9 +3,12 @@ package database
import ( import (
"errors" "errors"
"gorm.io/gorm"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"gorm.io/gorm"
"github.com/google/uuid"
) )
/** /**
...@@ -26,7 +29,7 @@ type TokenPair struct { ...@@ -26,7 +29,7 @@ type TokenPair struct {
} }
type Deposit struct { type Deposit struct {
GUID string `gorm:"primaryKey"` GUID uuid.UUID `gorm:"primaryKey"`
InitiatedL1EventGUID string InitiatedL1EventGUID string
Tx Transaction `gorm:"embedded"` Tx Transaction `gorm:"embedded"`
...@@ -39,7 +42,7 @@ type DepositWithTransactionHash struct { ...@@ -39,7 +42,7 @@ type DepositWithTransactionHash struct {
} }
type Withdrawal struct { type Withdrawal struct {
GUID string `gorm:"primaryKey"` GUID uuid.UUID `gorm:"primaryKey"`
InitiatedL2EventGUID string InitiatedL2EventGUID string
WithdrawalHash common.Hash `gorm:"serializer:json"` WithdrawalHash common.Hash `gorm:"serializer:json"`
......
package database package database
import ( import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"gorm.io/gorm" "gorm.io/gorm"
"github.com/ethereum/go-ethereum/common"
"github.com/google/uuid"
) )
/** /**
...@@ -11,11 +13,11 @@ import ( ...@@ -11,11 +13,11 @@ import (
*/ */
type ContractEvent struct { type ContractEvent struct {
GUID string `gorm:"primaryKey"` GUID uuid.UUID `gorm:"primaryKey"`
BlockHash common.Hash `gorm:"serializer:json"` BlockHash common.Hash `gorm:"serializer:json"`
TransactionHash common.Hash `gorm:"serializer:json"` TransactionHash common.Hash `gorm:"serializer:json"`
EventSignature hexutil.Bytes `gorm:"serializer:json"` EventSignature common.Hash `gorm:"serializer:json"`
LogIndex uint64 LogIndex uint64
Timestamp uint64 Timestamp uint64
} }
......
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/indexer/node" "github.com/ethereum-optimism/optimism/indexer/node"
"github.com/ethereum-optimism/optimism/indexer/processor" "github.com/ethereum-optimism/optimism/indexer/processor"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli" "github.com/urfave/cli"
...@@ -72,22 +73,30 @@ func NewIndexer(ctx *cli.Context) (*Indexer, error) { ...@@ -72,22 +73,30 @@ func NewIndexer(ctx *cli.Context) (*Indexer, error) {
return nil, err return nil, err
} }
// L1 Processor // L1 Processor (hardhat devnet contracts). Make this configurable
l1Contracts := processor.L1Contracts{
OptimismPortal: common.HexToAddress("0x6900000000000000000000000000000000000000"),
L2OutputOracle: common.HexToAddress("0x6900000000000000000000000000000000000001"),
L1CrossDomainMessenger: common.HexToAddress("0x6900000000000000000000000000000000000002"),
L1StandardBridge: common.HexToAddress("0x6900000000000000000000000000000000000003"),
L1ERC721Bridge: common.HexToAddress("0x6900000000000000000000000000000000000004"),
}
l1EthClient, err := node.NewEthClient(ctx.GlobalString(flags.L1EthRPCFlag.Name)) l1EthClient, err := node.NewEthClient(ctx.GlobalString(flags.L1EthRPCFlag.Name))
if err != nil { if err != nil {
return nil, err return nil, err
} }
l1Processor, err := processor.NewL1Processor(l1EthClient, db) l1Processor, err := processor.NewL1Processor(l1EthClient, db, l1Contracts)
if err != nil { if err != nil {
return nil, err return nil, err
} }
// L2Processor // L2Processor
l2Contracts := processor.L2ContractPredeploys() // Make this configurable
l2EthClient, err := node.NewEthClient(ctx.GlobalString(flags.L2EthRPCFlag.Name)) l2EthClient, err := node.NewEthClient(ctx.GlobalString(flags.L2EthRPCFlag.Name))
if err != nil { if err != nil {
return nil, err return nil, err
} }
l2Processor, err := processor.NewL2Processor(l2EthClient, db) l2Processor, err := processor.NewL2Processor(l2EthClient, db, l2Contracts)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
package processor package processor
import ( import (
"context"
"errors"
"reflect"
"github.com/ethereum-optimism/optimism/indexer/database" "github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum-optimism/optimism/indexer/node" "github.com/ethereum-optimism/optimism/indexer/node"
"github.com/google/uuid"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
type L1Contracts struct {
OptimismPortal common.Address
L2OutputOracle common.Address
L1CrossDomainMessenger common.Address
L1StandardBridge common.Address
L1ERC721Bridge common.Address
// Some more contracts -- ProxyAdmin, SystemConfig, etcc
// Ignore the auxiliary contracts?
// Legacy contracts? We'll add this in to index the legacy chain.
// Remove afterwards?
}
func (c L1Contracts) toSlice() []common.Address {
fields := reflect.VisibleFields(reflect.TypeOf(c))
v := reflect.ValueOf(c)
contracts := make([]common.Address, len(fields))
for i, field := range fields {
contracts[i] = (v.FieldByName(field.Name).Interface()).(common.Address)
}
return contracts
}
type L1Processor struct { type L1Processor struct {
processor processor
} }
func NewL1Processor(ethClient node.EthClient, db *database.DB) (*L1Processor, error) { func NewL1Processor(ethClient node.EthClient, db *database.DB, l1Contracts L1Contracts) (*L1Processor, error) {
l1ProcessLog := log.New("processor", "l1") l1ProcessLog := log.New("processor", "l1")
l1ProcessLog.Info("initializing processor") l1ProcessLog.Info("initializing processor")
...@@ -41,7 +75,7 @@ func NewL1Processor(ethClient node.EthClient, db *database.DB) (*L1Processor, er ...@@ -41,7 +75,7 @@ func NewL1Processor(ethClient node.EthClient, db *database.DB) (*L1Processor, er
processor: processor{ processor: processor{
fetcher: node.NewFetcher(ethClient, fromL1Header), fetcher: node.NewFetcher(ethClient, fromL1Header),
db: db, db: db,
processFn: l1ProcessFn(ethClient), processFn: l1ProcessFn(l1ProcessLog, ethClient, l1Contracts),
processLog: l1ProcessLog, processLog: l1ProcessLog,
}, },
} }
...@@ -49,22 +83,93 @@ func NewL1Processor(ethClient node.EthClient, db *database.DB) (*L1Processor, er ...@@ -49,22 +83,93 @@ func NewL1Processor(ethClient node.EthClient, db *database.DB) (*L1Processor, er
return l1Processor, nil return l1Processor, nil
} }
func l1ProcessFn(ethClient node.EthClient) func(db *database.DB, headers []*types.Header) error { func l1ProcessFn(processLog log.Logger, ethClient node.EthClient, l1Contracts L1Contracts) func(db *database.DB, headers []*types.Header) error {
rawEthClient := ethclient.NewClient(ethClient.RawRpcClient())
contractAddrs := l1Contracts.toSlice()
processLog.Info("processor configured with contracts", "contracts", l1Contracts)
return func(db *database.DB, headers []*types.Header) error { return func(db *database.DB, headers []*types.Header) error {
numHeaders := len(headers)
l1HeaderMap := make(map[common.Hash]*types.Header)
for _, header := range headers {
l1HeaderMap[header.Hash()] = header
}
/** Watch for Contract Events **/
// index all l2 blocks for now logFilter := ethereum.FilterQuery{FromBlock: headers[0].Number, ToBlock: headers[numHeaders-1].Number, Addresses: contractAddrs}
l1Headers := make([]*database.L1BlockHeader, len(headers)) logs, err := rawEthClient.FilterLogs(context.Background(), logFilter)
for i, header := range headers { if err != nil {
l1Headers[i] = &database.L1BlockHeader{ return err
}
numLogs := len(logs)
l1ContractEvents := make([]*database.L1ContractEvent, numLogs)
l1HeadersOfInterest := make(map[common.Hash]bool)
for i, log := range logs {
header, ok := l1HeaderMap[log.BlockHash]
if !ok {
processLog.Crit("contract event found with associated header not in the batch", "header", log.BlockHash, "log_index", log.Index)
return errors.New("parsed log with a block hash not in this batch")
}
l1HeadersOfInterest[log.BlockHash] = true
l1ContractEvents[i] = &database.L1ContractEvent{
ContractEvent: database.ContractEvent{
GUID: uuid.New(),
BlockHash: log.BlockHash,
TransactionHash: log.TxHash,
EventSignature: log.Topics[0],
LogIndex: uint64(log.Index),
Timestamp: header.Time,
},
}
}
/** Index L1 Blocks that have an optimism event **/
// we iterate on the original array to maintain ordering. probably can find a more efficient
// way to iterate over the `l1HeadersOfInterest` map while maintaining ordering
indexedL1Header := []*database.L1BlockHeader{}
for _, header := range headers {
blockHash := header.Hash()
_, hasLogs := l1HeadersOfInterest[blockHash]
if !hasLogs {
continue
}
indexedL1Header = append(indexedL1Header, &database.L1BlockHeader{
BlockHeader: database.BlockHeader{ BlockHeader: database.BlockHeader{
Hash: header.Hash(), Hash: blockHash,
ParentHash: header.ParentHash, ParentHash: header.ParentHash,
Number: database.U256{Int: header.Number}, Number: database.U256{Int: header.Number},
Timestamp: header.Time, Timestamp: header.Time,
}, },
})
} }
/** Update Database **/
numIndexedL1Headers := len(indexedL1Header)
if numIndexedL1Headers > 0 {
processLog.Info("saved l1 blocks of interest within batch", "num", numIndexedL1Headers, "batchSize", numHeaders)
err = db.Blocks.StoreL1BlockHeaders(indexedL1Header)
if err != nil {
return err
}
// Since the headers to index are derived from the existence of logs, we know in this branch `numLogs > 0`
processLog.Info("saving contract logs", "size", numLogs)
err = db.ContractEvents.StoreL1ContractEvents(l1ContractEvents)
if err != nil {
return err
}
} else {
processLog.Info("no l1 blocks of interest within batch")
} }
return db.Blocks.StoreL1BlockHeaders(l1Headers) // a-ok!
return nil
} }
} }
package processor package processor
import ( import (
"context"
"errors"
"reflect"
"github.com/ethereum-optimism/optimism/indexer/database" "github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum-optimism/optimism/indexer/node" "github.com/ethereum-optimism/optimism/indexer/node"
"github.com/google/uuid"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
type L2Contracts struct {
L2CrossDomainMessenger common.Address
L2StandardBridge common.Address
L2ERC721Bridge common.Address
L2ToL1MessagePasser common.Address
// Some more contracts -- ProxyAdmin, SystemConfig, etcc
// Ignore the auxiliary contracts?
// Legacy Contracts? We'll add this in to index the legacy chain.
// Remove afterwards?
}
func L2ContractPredeploys() L2Contracts {
return L2Contracts{
L2CrossDomainMessenger: common.HexToAddress("0x4200000000000000000000000000000000000007"),
L2StandardBridge: common.HexToAddress("0x4200000000000000000000000000000000000010"),
L2ERC721Bridge: common.HexToAddress("0x4200000000000000000000000000000000000014"),
L2ToL1MessagePasser: common.HexToAddress("0x4200000000000000000000000000000000000016"),
}
}
func (c L2Contracts) toSlice() []common.Address {
fields := reflect.VisibleFields(reflect.TypeOf(c))
v := reflect.ValueOf(c)
contracts := make([]common.Address, len(fields))
for i, field := range fields {
contracts[i] = (v.FieldByName(field.Name).Interface()).(common.Address)
}
return contracts
}
type L2Processor struct { type L2Processor struct {
processor processor
} }
func NewL2Processor(ethClient node.EthClient, db *database.DB) (*L2Processor, error) { func NewL2Processor(ethClient node.EthClient, db *database.DB, l2Contracts L2Contracts) (*L2Processor, error) {
l2ProcessLog := log.New("processor", "l2") l2ProcessLog := log.New("processor", "l2")
l2ProcessLog.Info("initializing processor") l2ProcessLog.Info("initializing processor")
...@@ -40,7 +82,7 @@ func NewL2Processor(ethClient node.EthClient, db *database.DB) (*L2Processor, er ...@@ -40,7 +82,7 @@ func NewL2Processor(ethClient node.EthClient, db *database.DB) (*L2Processor, er
processor: processor{ processor: processor{
fetcher: node.NewFetcher(ethClient, fromL2Header), fetcher: node.NewFetcher(ethClient, fromL2Header),
db: db, db: db,
processFn: l2ProcessFn(ethClient), processFn: l2ProcessFn(l2ProcessLog, ethClient, l2Contracts),
processLog: l2ProcessLog, processLog: l2ProcessLog,
}, },
} }
...@@ -48,22 +90,78 @@ func NewL2Processor(ethClient node.EthClient, db *database.DB) (*L2Processor, er ...@@ -48,22 +90,78 @@ func NewL2Processor(ethClient node.EthClient, db *database.DB) (*L2Processor, er
return l2Processor, nil return l2Processor, nil
} }
func l2ProcessFn(ethClient node.EthClient) func(db *database.DB, headers []*types.Header) error { func l2ProcessFn(processLog log.Logger, ethClient node.EthClient, l2Contracts L2Contracts) func(db *database.DB, headers []*types.Header) error {
rawEthClient := ethclient.NewClient(ethClient.RawRpcClient())
contractAddrs := l2Contracts.toSlice()
processLog.Info("processor configured with contracts", "contracts", l2Contracts)
return func(db *database.DB, headers []*types.Header) error { return func(db *database.DB, headers []*types.Header) error {
numHeaders := len(headers)
/** Index All L2 Blocks **/
// index all l2 blocks for now
l2Headers := make([]*database.L2BlockHeader, len(headers)) l2Headers := make([]*database.L2BlockHeader, len(headers))
l2HeaderMap := make(map[common.Hash]*types.Header)
for i, header := range headers { for i, header := range headers {
blockHash := header.Hash()
l2Headers[i] = &database.L2BlockHeader{ l2Headers[i] = &database.L2BlockHeader{
BlockHeader: database.BlockHeader{ BlockHeader: database.BlockHeader{
Hash: header.Hash(), Hash: blockHash,
ParentHash: header.ParentHash, ParentHash: header.ParentHash,
Number: database.U256{Int: header.Number}, Number: database.U256{Int: header.Number},
Timestamp: header.Time, Timestamp: header.Time,
}, },
} }
l2HeaderMap[blockHash] = header
}
/** Watch for Contract Events **/
logFilter := ethereum.FilterQuery{FromBlock: headers[0].Number, ToBlock: headers[numHeaders-1].Number, Addresses: contractAddrs}
logs, err := rawEthClient.FilterLogs(context.Background(), logFilter)
if err != nil {
return err
}
numLogs := len(logs)
l2ContractEvents := make([]*database.L2ContractEvent, numLogs)
for i, log := range logs {
header, ok := l2HeaderMap[log.BlockHash]
if !ok {
// Log the individual headers in the batch?
processLog.Crit("contract event found with associated header not in the batch", "header", header, "log_index", log.Index)
return errors.New("parsed log with a block hash not in this batch")
}
l2ContractEvents[i] = &database.L2ContractEvent{
ContractEvent: database.ContractEvent{
GUID: uuid.New(),
BlockHash: log.BlockHash,
TransactionHash: log.TxHash,
EventSignature: log.Topics[0],
LogIndex: uint64(log.Index),
Timestamp: header.Time,
},
}
}
/** Update Database **/
err = db.Blocks.StoreL2BlockHeaders(l2Headers)
if err != nil {
return err
}
if numLogs > 0 {
processLog.Info("detected new contract logs", "size", numLogs)
err = db.ContractEvents.StoreL2ContractEvents(l2ContractEvents)
if err != nil {
return err
}
} }
return db.Blocks.StoreL2BlockHeaders(l2Headers) // a-ok!
return nil
} }
} }
...@@ -30,8 +30,8 @@ var ( ...@@ -30,8 +30,8 @@ var (
// BaseFeeVaultMetaData contains all meta data concerning the BaseFeeVault contract. // BaseFeeVaultMetaData contains all meta data concerning the BaseFeeVault contract.
var BaseFeeVaultMetaData = &bind.MetaData{ var BaseFeeVaultMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_WITHDRAWAL_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RECIPIENT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalProcessed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minWithdrawalAmount\",\"type\":\"uint256\"},{\"internalType\":\"enumFeeVault.WithdrawalNetwork\",\"name\":\"_withdrawalNetwork\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enumFeeVault.WithdrawalNetwork\",\"name\":\"withdrawalNetwork\",\"type\":\"uint8\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_WITHDRAWAL_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RECIPIENT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_NETWORK\",\"outputs\":[{\"internalType\":\"enumFeeVault.WithdrawalNetwork\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalProcessed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
Bin: "0x61012060405234801561001157600080fd5b506040516108e53803806108e58339810160408190526100309161005d565b678ac7230489e800006080526001600160a01b031660a052600160c081905260e05260006101005261008d565b60006020828403121561006f57600080fd5b81516001600160a01b038116811461008657600080fd5b9392505050565b60805160a05160c05160e051610100516108006100e560003960006103d3015260006103aa01526000610381015260008181607c015281816102570152610319015260008181610137015261015b01526108006000f3fe60806040526004361061005e5760003560e01c806354fd4d501161004357806354fd4d50146100df57806384411d6514610101578063d3e5792b1461012557600080fd5b80630d9019e11461006a5780633ccfd60b146100c857600080fd5b3661006557005b600080fd5b34801561007657600080fd5b5061009e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100d457600080fd5b506100dd610159565b005b3480156100eb57600080fd5b506100f461037a565b6040516100bf91906105d4565b34801561010d57600080fd5b5061011760005481565b6040519081526020016100bf565b34801561013157600080fd5b506101177f000000000000000000000000000000000000000000000000000000000000000081565b7f0000000000000000000000000000000000000000000000000000000000000000471015610233576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b600047905080600080828254610249919061061d565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a1604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610345917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610635565b6000604051808303818588803b15801561035e57600080fd5b505af1158015610372573d6000803e3d6000fd5b505050505050565b60606103a57f000000000000000000000000000000000000000000000000000000000000000061041d565b6103ce7f000000000000000000000000000000000000000000000000000000000000000061041d565b6103f77f000000000000000000000000000000000000000000000000000000000000000061041d565b60405160200161040993929190610679565b604051602081830303815290604052905090565b60608160000361046057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561048a5780610474816106ef565b91506104839050600a83610756565b9150610464565b60008167ffffffffffffffff8111156104a5576104a561076a565b6040519080825280601f01601f1916602001820160405280156104cf576020820181803683370190505b5090505b8415610552576104e4600183610799565b91506104f1600a866107b0565b6104fc90603061061d565b60f81b818381518110610511576105116107c4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061054b600a86610756565b94506104d3565b949350505050565b60005b8381101561057557818101518382015260200161055d565b83811115610584576000848401525b50505050565b600081518084526105a281602086016020860161055a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006105e7602083018461058a565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610630576106306105ee565b500190565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff83166020820152606060408201526000610670606083018461058a565b95945050505050565b6000845161068b81846020890161055a565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516106c7816001850160208a0161055a565b600192019182015283516106e281600284016020880161055a565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610720576107206105ee565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261076557610765610727565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156107ab576107ab6105ee565b500390565b6000826107bf576107bf610727565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a", Bin: "0x61014060405234801561001157600080fd5b50604051610b75380380610b7583398101604081905261003091610090565b6001600160a01b03831660a0526080829052600160026000858585808681111561005c5761005c6100e3565b60c0816001811115610070576100706100e3565b905250505060e0939093526101009190915261012052506100f992505050565b6000806000606084860312156100a557600080fd5b83516001600160a01b03811681146100bc57600080fd5b602085015160408601519194509250600281106100d857600080fd5b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60805160a05160c05160e05161010051610120516109fd6101786000396000610504015260006104db015260006104b201526000818161014201528181610354015261038f0152600081816087015281816102a301528181610332015281816103c9015261044a01526000818161018301526101a701526109fd6000f3fe6080604052600436106100695760003560e01c806384411d651161004357806384411d651461010c578063d0e12f9014610130578063d3e5792b1461017157600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e86101a5565b005b3480156100f657600080fd5b506100ff6104ab565b6040516100ca919061071b565b34801561011857600080fd5b5061012260005481565b6040519081526020016100ca565b34801561013c57600080fd5b506101647f000000000000000000000000000000000000000000000000000000000000000081565b6040516100ca919061079f565b34801561017d57600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000047101561027f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b60004790508060008082825461029591906107e2565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a17f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee817f0000000000000000000000000000000000000000000000000000000000000000337f000000000000000000000000000000000000000000000000000000000000000060405161038394939291906107fa565b60405180910390a160017f000000000000000000000000000000000000000000000000000000000000000060018111156103bf576103bf610735565b036103f3576103ef7f00000000000000000000000000000000000000000000000000000000000000005a8361054e565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610476917f0000000000000000000000000000000000000000000000000000000000000000916188b89160040161083b565b6000604051808303818588803b15801561048f57600080fd5b505af11580156104a3573d6000803e3d6000fd5b505050505050565b60606104d67f0000000000000000000000000000000000000000000000000000000000000000610564565b6104ff7f0000000000000000000000000000000000000000000000000000000000000000610564565b6105287f0000000000000000000000000000000000000000000000000000000000000000610564565b60405160200161053a93929190610876565b604051602081830303815290604052905090565b600080600080600080868989f195945050505050565b6060816000036105a757505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156105d157806105bb816108ec565b91506105ca9050600a83610953565b91506105ab565b60008167ffffffffffffffff8111156105ec576105ec610967565b6040519080825280601f01601f191660200182016040528015610616576020820181803683370190505b5090505b84156106995761062b600183610996565b9150610638600a866109ad565b6106439060306107e2565b60f81b818381518110610658576106586109c1565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610692600a86610953565b945061061a565b949350505050565b60005b838110156106bc5781810151838201526020016106a4565b838111156106cb576000848401525b50505050565b600081518084526106e98160208601602086016106a1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061072e60208301846106d1565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061079b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b602081016107ad8284610764565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156107f5576107f56107b3565b500190565b84815273ffffffffffffffffffffffffffffffffffffffff848116602083015283166040820152608081016108326060830184610764565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600061083260608301846106d1565b600084516108888184602089016106a1565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516108c4816001850160208a016106a1565b600192019182015283516108df8160028401602088016106a1565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361091d5761091d6107b3565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261096257610962610924565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156109a8576109a86107b3565b500390565b6000826109bc576109bc610924565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
} }
// BaseFeeVaultABI is the input ABI used to generate the binding from. // BaseFeeVaultABI is the input ABI used to generate the binding from.
...@@ -43,7 +43,7 @@ var BaseFeeVaultABI = BaseFeeVaultMetaData.ABI ...@@ -43,7 +43,7 @@ var BaseFeeVaultABI = BaseFeeVaultMetaData.ABI
var BaseFeeVaultBin = BaseFeeVaultMetaData.Bin var BaseFeeVaultBin = BaseFeeVaultMetaData.Bin
// DeployBaseFeeVault deploys a new Ethereum contract, binding an instance of BaseFeeVault to it. // DeployBaseFeeVault deploys a new Ethereum contract, binding an instance of BaseFeeVault to it.
func DeployBaseFeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _recipient common.Address) (common.Address, *types.Transaction, *BaseFeeVault, error) { func DeployBaseFeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _recipient common.Address, _minWithdrawalAmount *big.Int, _withdrawalNetwork uint8) (common.Address, *types.Transaction, *BaseFeeVault, error) {
parsed, err := BaseFeeVaultMetaData.GetAbi() parsed, err := BaseFeeVaultMetaData.GetAbi()
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
...@@ -52,7 +52,7 @@ func DeployBaseFeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _ ...@@ -52,7 +52,7 @@ func DeployBaseFeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _
return common.Address{}, nil, nil, errors.New("GetABI returned nil") return common.Address{}, nil, nil, errors.New("GetABI returned nil")
} }
address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BaseFeeVaultBin), backend, _recipient) address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BaseFeeVaultBin), backend, _recipient, _minWithdrawalAmount, _withdrawalNetwork)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
} }
...@@ -263,6 +263,37 @@ func (_BaseFeeVault *BaseFeeVaultCallerSession) RECIPIENT() (common.Address, err ...@@ -263,6 +263,37 @@ func (_BaseFeeVault *BaseFeeVaultCallerSession) RECIPIENT() (common.Address, err
return _BaseFeeVault.Contract.RECIPIENT(&_BaseFeeVault.CallOpts) return _BaseFeeVault.Contract.RECIPIENT(&_BaseFeeVault.CallOpts)
} }
// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90.
//
// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8)
func (_BaseFeeVault *BaseFeeVaultCaller) WITHDRAWALNETWORK(opts *bind.CallOpts) (uint8, error) {
var out []interface{}
err := _BaseFeeVault.contract.Call(opts, &out, "WITHDRAWAL_NETWORK")
if err != nil {
return *new(uint8), err
}
out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)
return out0, err
}
// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90.
//
// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8)
func (_BaseFeeVault *BaseFeeVaultSession) WITHDRAWALNETWORK() (uint8, error) {
return _BaseFeeVault.Contract.WITHDRAWALNETWORK(&_BaseFeeVault.CallOpts)
}
// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90.
//
// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8)
func (_BaseFeeVault *BaseFeeVaultCallerSession) WITHDRAWALNETWORK() (uint8, error) {
return _BaseFeeVault.Contract.WITHDRAWALNETWORK(&_BaseFeeVault.CallOpts)
}
// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. // TotalProcessed is a free data retrieval call binding the contract method 0x84411d65.
// //
// Solidity: function totalProcessed() view returns(uint256) // Solidity: function totalProcessed() view returns(uint256)
...@@ -502,3 +533,140 @@ func (_BaseFeeVault *BaseFeeVaultFilterer) ParseWithdrawal(log types.Log) (*Base ...@@ -502,3 +533,140 @@ func (_BaseFeeVault *BaseFeeVaultFilterer) ParseWithdrawal(log types.Log) (*Base
event.Raw = log event.Raw = log
return event, nil return event, nil
} }
// BaseFeeVaultWithdrawal0Iterator is returned from FilterWithdrawal0 and is used to iterate over the raw logs and unpacked data for Withdrawal0 events raised by the BaseFeeVault contract.
type BaseFeeVaultWithdrawal0Iterator struct {
Event *BaseFeeVaultWithdrawal0 // Event containing the contract specifics and raw log
contract *bind.BoundContract // Generic contract to use for unpacking event data
event string // Event name to use for unpacking event data
logs chan types.Log // Log channel receiving the found contract events
sub ethereum.Subscription // Subscription for errors, completion and termination
done bool // Whether the subscription completed delivering logs
fail error // Occurred error to stop iteration
}
// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
func (it *BaseFeeVaultWithdrawal0Iterator) Next() bool {
// If the iterator failed, stop iterating
if it.fail != nil {
return false
}
// If the iterator completed, deliver directly whatever's available
if it.done {
select {
case log := <-it.logs:
it.Event = new(BaseFeeVaultWithdrawal0)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err
return false
}
it.Event.Raw = log
return true
default:
return false
}
}
// Iterator still in progress, wait for either a data or an error event
select {
case log := <-it.logs:
it.Event = new(BaseFeeVaultWithdrawal0)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err
return false
}
it.Event.Raw = log
return true
case err := <-it.sub.Err():
it.done = true
it.fail = err
return it.Next()
}
}
// Error returns any retrieval or parsing error occurred during filtering.
func (it *BaseFeeVaultWithdrawal0Iterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *BaseFeeVaultWithdrawal0Iterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// BaseFeeVaultWithdrawal0 represents a Withdrawal0 event raised by the BaseFeeVault contract.
type BaseFeeVaultWithdrawal0 struct {
Value *big.Int
To common.Address
From common.Address
WithdrawalNetwork uint8
Raw types.Log // Blockchain specific contextual infos
}
// FilterWithdrawal0 is a free log retrieval operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_BaseFeeVault *BaseFeeVaultFilterer) FilterWithdrawal0(opts *bind.FilterOpts) (*BaseFeeVaultWithdrawal0Iterator, error) {
logs, sub, err := _BaseFeeVault.contract.FilterLogs(opts, "Withdrawal0")
if err != nil {
return nil, err
}
return &BaseFeeVaultWithdrawal0Iterator{contract: _BaseFeeVault.contract, event: "Withdrawal0", logs: logs, sub: sub}, nil
}
// WatchWithdrawal0 is a free log subscription operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_BaseFeeVault *BaseFeeVaultFilterer) WatchWithdrawal0(opts *bind.WatchOpts, sink chan<- *BaseFeeVaultWithdrawal0) (event.Subscription, error) {
logs, sub, err := _BaseFeeVault.contract.WatchLogs(opts, "Withdrawal0")
if err != nil {
return nil, err
}
return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe()
for {
select {
case log := <-logs:
// New log arrived, parse the event and forward to the user
event := new(BaseFeeVaultWithdrawal0)
if err := _BaseFeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil {
return err
}
event.Raw = log
select {
case sink <- event:
case err := <-sub.Err():
return err
case <-quit:
return nil
}
case err := <-sub.Err():
return err
case <-quit:
return nil
}
}
}), nil
}
// ParseWithdrawal0 is a log parse operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_BaseFeeVault *BaseFeeVaultFilterer) ParseWithdrawal0(log types.Log) (*BaseFeeVaultWithdrawal0, error) {
event := new(BaseFeeVaultWithdrawal0)
if err := _BaseFeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
...@@ -30,8 +30,8 @@ var ( ...@@ -30,8 +30,8 @@ var (
// L1FeeVaultMetaData contains all meta data concerning the L1FeeVault contract. // L1FeeVaultMetaData contains all meta data concerning the L1FeeVault contract.
var L1FeeVaultMetaData = &bind.MetaData{ var L1FeeVaultMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_WITHDRAWAL_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RECIPIENT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalProcessed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minWithdrawalAmount\",\"type\":\"uint256\"},{\"internalType\":\"enumFeeVault.WithdrawalNetwork\",\"name\":\"_withdrawalNetwork\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enumFeeVault.WithdrawalNetwork\",\"name\":\"withdrawalNetwork\",\"type\":\"uint8\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_WITHDRAWAL_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RECIPIENT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_NETWORK\",\"outputs\":[{\"internalType\":\"enumFeeVault.WithdrawalNetwork\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalProcessed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
Bin: "0x61012060405234801561001157600080fd5b506040516108e53803806108e58339810160408190526100309161005d565b678ac7230489e800006080526001600160a01b031660a052600160c081905260e05260006101005261008d565b60006020828403121561006f57600080fd5b81516001600160a01b038116811461008657600080fd5b9392505050565b60805160a05160c05160e051610100516108006100e560003960006103d3015260006103aa01526000610381015260008181607c015281816102570152610319015260008181610137015261015b01526108006000f3fe60806040526004361061005e5760003560e01c806354fd4d501161004357806354fd4d50146100df57806384411d6514610101578063d3e5792b1461012557600080fd5b80630d9019e11461006a5780633ccfd60b146100c857600080fd5b3661006557005b600080fd5b34801561007657600080fd5b5061009e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100d457600080fd5b506100dd610159565b005b3480156100eb57600080fd5b506100f461037a565b6040516100bf91906105d4565b34801561010d57600080fd5b5061011760005481565b6040519081526020016100bf565b34801561013157600080fd5b506101177f000000000000000000000000000000000000000000000000000000000000000081565b7f0000000000000000000000000000000000000000000000000000000000000000471015610233576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b600047905080600080828254610249919061061d565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a1604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610345917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610635565b6000604051808303818588803b15801561035e57600080fd5b505af1158015610372573d6000803e3d6000fd5b505050505050565b60606103a57f000000000000000000000000000000000000000000000000000000000000000061041d565b6103ce7f000000000000000000000000000000000000000000000000000000000000000061041d565b6103f77f000000000000000000000000000000000000000000000000000000000000000061041d565b60405160200161040993929190610679565b604051602081830303815290604052905090565b60608160000361046057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561048a5780610474816106ef565b91506104839050600a83610756565b9150610464565b60008167ffffffffffffffff8111156104a5576104a561076a565b6040519080825280601f01601f1916602001820160405280156104cf576020820181803683370190505b5090505b8415610552576104e4600183610799565b91506104f1600a866107b0565b6104fc90603061061d565b60f81b818381518110610511576105116107c4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061054b600a86610756565b94506104d3565b949350505050565b60005b8381101561057557818101518382015260200161055d565b83811115610584576000848401525b50505050565b600081518084526105a281602086016020860161055a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006105e7602083018461058a565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610630576106306105ee565b500190565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff83166020820152606060408201526000610670606083018461058a565b95945050505050565b6000845161068b81846020890161055a565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516106c7816001850160208a0161055a565b600192019182015283516106e281600284016020880161055a565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610720576107206105ee565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261076557610765610727565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156107ab576107ab6105ee565b500390565b6000826107bf576107bf610727565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a", Bin: "0x61014060405234801561001157600080fd5b50604051610b75380380610b7583398101604081905261003091610090565b6001600160a01b03831660a0526080829052600160026000858585808681111561005c5761005c6100e3565b60c0816001811115610070576100706100e3565b905250505060e0939093526101009190915261012052506100f992505050565b6000806000606084860312156100a557600080fd5b83516001600160a01b03811681146100bc57600080fd5b602085015160408601519194509250600281106100d857600080fd5b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60805160a05160c05160e05161010051610120516109fd6101786000396000610504015260006104db015260006104b201526000818161014201528181610354015261038f0152600081816087015281816102a301528181610332015281816103c9015261044a01526000818161018301526101a701526109fd6000f3fe6080604052600436106100695760003560e01c806384411d651161004357806384411d651461010c578063d0e12f9014610130578063d3e5792b1461017157600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e86101a5565b005b3480156100f657600080fd5b506100ff6104ab565b6040516100ca919061071b565b34801561011857600080fd5b5061012260005481565b6040519081526020016100ca565b34801561013c57600080fd5b506101647f000000000000000000000000000000000000000000000000000000000000000081565b6040516100ca919061079f565b34801561017d57600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000047101561027f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b60004790508060008082825461029591906107e2565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a17f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee817f0000000000000000000000000000000000000000000000000000000000000000337f000000000000000000000000000000000000000000000000000000000000000060405161038394939291906107fa565b60405180910390a160017f000000000000000000000000000000000000000000000000000000000000000060018111156103bf576103bf610735565b036103f3576103ef7f00000000000000000000000000000000000000000000000000000000000000005a8361054e565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610476917f0000000000000000000000000000000000000000000000000000000000000000916188b89160040161083b565b6000604051808303818588803b15801561048f57600080fd5b505af11580156104a3573d6000803e3d6000fd5b505050505050565b60606104d67f0000000000000000000000000000000000000000000000000000000000000000610564565b6104ff7f0000000000000000000000000000000000000000000000000000000000000000610564565b6105287f0000000000000000000000000000000000000000000000000000000000000000610564565b60405160200161053a93929190610876565b604051602081830303815290604052905090565b600080600080600080868989f195945050505050565b6060816000036105a757505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156105d157806105bb816108ec565b91506105ca9050600a83610953565b91506105ab565b60008167ffffffffffffffff8111156105ec576105ec610967565b6040519080825280601f01601f191660200182016040528015610616576020820181803683370190505b5090505b84156106995761062b600183610996565b9150610638600a866109ad565b6106439060306107e2565b60f81b818381518110610658576106586109c1565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610692600a86610953565b945061061a565b949350505050565b60005b838110156106bc5781810151838201526020016106a4565b838111156106cb576000848401525b50505050565b600081518084526106e98160208601602086016106a1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061072e60208301846106d1565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061079b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b602081016107ad8284610764565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156107f5576107f56107b3565b500190565b84815273ffffffffffffffffffffffffffffffffffffffff848116602083015283166040820152608081016108326060830184610764565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600061083260608301846106d1565b600084516108888184602089016106a1565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516108c4816001850160208a016106a1565b600192019182015283516108df8160028401602088016106a1565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361091d5761091d6107b3565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261096257610962610924565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156109a8576109a86107b3565b500390565b6000826109bc576109bc610924565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
} }
// L1FeeVaultABI is the input ABI used to generate the binding from. // L1FeeVaultABI is the input ABI used to generate the binding from.
...@@ -43,7 +43,7 @@ var L1FeeVaultABI = L1FeeVaultMetaData.ABI ...@@ -43,7 +43,7 @@ var L1FeeVaultABI = L1FeeVaultMetaData.ABI
var L1FeeVaultBin = L1FeeVaultMetaData.Bin var L1FeeVaultBin = L1FeeVaultMetaData.Bin
// DeployL1FeeVault deploys a new Ethereum contract, binding an instance of L1FeeVault to it. // DeployL1FeeVault deploys a new Ethereum contract, binding an instance of L1FeeVault to it.
func DeployL1FeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _recipient common.Address) (common.Address, *types.Transaction, *L1FeeVault, error) { func DeployL1FeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _recipient common.Address, _minWithdrawalAmount *big.Int, _withdrawalNetwork uint8) (common.Address, *types.Transaction, *L1FeeVault, error) {
parsed, err := L1FeeVaultMetaData.GetAbi() parsed, err := L1FeeVaultMetaData.GetAbi()
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
...@@ -52,7 +52,7 @@ func DeployL1FeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _re ...@@ -52,7 +52,7 @@ func DeployL1FeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _re
return common.Address{}, nil, nil, errors.New("GetABI returned nil") return common.Address{}, nil, nil, errors.New("GetABI returned nil")
} }
address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L1FeeVaultBin), backend, _recipient) address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L1FeeVaultBin), backend, _recipient, _minWithdrawalAmount, _withdrawalNetwork)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
} }
...@@ -263,6 +263,37 @@ func (_L1FeeVault *L1FeeVaultCallerSession) RECIPIENT() (common.Address, error) ...@@ -263,6 +263,37 @@ func (_L1FeeVault *L1FeeVaultCallerSession) RECIPIENT() (common.Address, error)
return _L1FeeVault.Contract.RECIPIENT(&_L1FeeVault.CallOpts) return _L1FeeVault.Contract.RECIPIENT(&_L1FeeVault.CallOpts)
} }
// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90.
//
// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8)
func (_L1FeeVault *L1FeeVaultCaller) WITHDRAWALNETWORK(opts *bind.CallOpts) (uint8, error) {
var out []interface{}
err := _L1FeeVault.contract.Call(opts, &out, "WITHDRAWAL_NETWORK")
if err != nil {
return *new(uint8), err
}
out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)
return out0, err
}
// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90.
//
// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8)
func (_L1FeeVault *L1FeeVaultSession) WITHDRAWALNETWORK() (uint8, error) {
return _L1FeeVault.Contract.WITHDRAWALNETWORK(&_L1FeeVault.CallOpts)
}
// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90.
//
// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8)
func (_L1FeeVault *L1FeeVaultCallerSession) WITHDRAWALNETWORK() (uint8, error) {
return _L1FeeVault.Contract.WITHDRAWALNETWORK(&_L1FeeVault.CallOpts)
}
// TotalProcessed is a free data retrieval call binding the contract method 0x84411d65. // TotalProcessed is a free data retrieval call binding the contract method 0x84411d65.
// //
// Solidity: function totalProcessed() view returns(uint256) // Solidity: function totalProcessed() view returns(uint256)
...@@ -502,3 +533,140 @@ func (_L1FeeVault *L1FeeVaultFilterer) ParseWithdrawal(log types.Log) (*L1FeeVau ...@@ -502,3 +533,140 @@ func (_L1FeeVault *L1FeeVaultFilterer) ParseWithdrawal(log types.Log) (*L1FeeVau
event.Raw = log event.Raw = log
return event, nil return event, nil
} }
// L1FeeVaultWithdrawal0Iterator is returned from FilterWithdrawal0 and is used to iterate over the raw logs and unpacked data for Withdrawal0 events raised by the L1FeeVault contract.
type L1FeeVaultWithdrawal0Iterator struct {
Event *L1FeeVaultWithdrawal0 // Event containing the contract specifics and raw log
contract *bind.BoundContract // Generic contract to use for unpacking event data
event string // Event name to use for unpacking event data
logs chan types.Log // Log channel receiving the found contract events
sub ethereum.Subscription // Subscription for errors, completion and termination
done bool // Whether the subscription completed delivering logs
fail error // Occurred error to stop iteration
}
// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
func (it *L1FeeVaultWithdrawal0Iterator) Next() bool {
// If the iterator failed, stop iterating
if it.fail != nil {
return false
}
// If the iterator completed, deliver directly whatever's available
if it.done {
select {
case log := <-it.logs:
it.Event = new(L1FeeVaultWithdrawal0)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err
return false
}
it.Event.Raw = log
return true
default:
return false
}
}
// Iterator still in progress, wait for either a data or an error event
select {
case log := <-it.logs:
it.Event = new(L1FeeVaultWithdrawal0)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err
return false
}
it.Event.Raw = log
return true
case err := <-it.sub.Err():
it.done = true
it.fail = err
return it.Next()
}
}
// Error returns any retrieval or parsing error occurred during filtering.
func (it *L1FeeVaultWithdrawal0Iterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *L1FeeVaultWithdrawal0Iterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// L1FeeVaultWithdrawal0 represents a Withdrawal0 event raised by the L1FeeVault contract.
type L1FeeVaultWithdrawal0 struct {
Value *big.Int
To common.Address
From common.Address
WithdrawalNetwork uint8
Raw types.Log // Blockchain specific contextual infos
}
// FilterWithdrawal0 is a free log retrieval operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_L1FeeVault *L1FeeVaultFilterer) FilterWithdrawal0(opts *bind.FilterOpts) (*L1FeeVaultWithdrawal0Iterator, error) {
logs, sub, err := _L1FeeVault.contract.FilterLogs(opts, "Withdrawal0")
if err != nil {
return nil, err
}
return &L1FeeVaultWithdrawal0Iterator{contract: _L1FeeVault.contract, event: "Withdrawal0", logs: logs, sub: sub}, nil
}
// WatchWithdrawal0 is a free log subscription operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_L1FeeVault *L1FeeVaultFilterer) WatchWithdrawal0(opts *bind.WatchOpts, sink chan<- *L1FeeVaultWithdrawal0) (event.Subscription, error) {
logs, sub, err := _L1FeeVault.contract.WatchLogs(opts, "Withdrawal0")
if err != nil {
return nil, err
}
return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe()
for {
select {
case log := <-logs:
// New log arrived, parse the event and forward to the user
event := new(L1FeeVaultWithdrawal0)
if err := _L1FeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil {
return err
}
event.Raw = log
select {
case sink <- event:
case err := <-sub.Err():
return err
case <-quit:
return nil
}
case err := <-sub.Err():
return err
case <-quit:
return nil
}
}
}), nil
}
// ParseWithdrawal0 is a log parse operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_L1FeeVault *L1FeeVaultFilterer) ParseWithdrawal0(log types.Log) (*L1FeeVaultWithdrawal0, error) {
event := new(L1FeeVaultWithdrawal0)
if err := _L1FeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
...@@ -30,8 +30,8 @@ var ( ...@@ -30,8 +30,8 @@ var (
// SequencerFeeVaultMetaData contains all meta data concerning the SequencerFeeVault contract. // SequencerFeeVaultMetaData contains all meta data concerning the SequencerFeeVault contract.
var SequencerFeeVaultMetaData = &bind.MetaData{ var SequencerFeeVaultMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_WITHDRAWAL_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RECIPIENT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1FeeWallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalProcessed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minWithdrawalAmount\",\"type\":\"uint256\"},{\"internalType\":\"enumFeeVault.WithdrawalNetwork\",\"name\":\"_withdrawalNetwork\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enumFeeVault.WithdrawalNetwork\",\"name\":\"withdrawalNetwork\",\"type\":\"uint8\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MIN_WITHDRAWAL_AMOUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RECIPIENT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_NETWORK\",\"outputs\":[{\"internalType\":\"enumFeeVault.WithdrawalNetwork\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1FeeWallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalProcessed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
Bin: "0x61012060405234801561001157600080fd5b5060405161092a38038061092a8339810160408190526100309161005d565b678ac7230489e800006080526001600160a01b031660a052600160c081905260e05260006101005261008d565b60006020828403121561006f57600080fd5b81516001600160a01b038116811461008657600080fd5b9392505050565b60805160a05160c05160e0516101005161083e6100ec6000396000610411015260006103e8015260006103bf0152600081816087015281816101730152818161029501526103570152600081816101420152610199015261083e6000f3fe6080604052600436106100695760003560e01c806384411d651161004357806384411d651461010c578063d3e5792b14610130578063d4ff92181461016457600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e8610197565b005b3480156100f657600080fd5b506100ff6103b8565b6040516100ca9190610612565b34801561011857600080fd5b5061012260005481565b6040519081526020016100ca565b34801561013c57600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b34801561017057600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100a9565b7f0000000000000000000000000000000000000000000000000000000000000000471015610271576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b600047905080600080828254610287919061065b565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a1604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610383917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610673565b6000604051808303818588803b15801561039c57600080fd5b505af11580156103b0573d6000803e3d6000fd5b505050505050565b60606103e37f000000000000000000000000000000000000000000000000000000000000000061045b565b61040c7f000000000000000000000000000000000000000000000000000000000000000061045b565b6104357f000000000000000000000000000000000000000000000000000000000000000061045b565b604051602001610447939291906106b7565b604051602081830303815290604052905090565b60608160000361049e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156104c857806104b28161072d565b91506104c19050600a83610794565b91506104a2565b60008167ffffffffffffffff8111156104e3576104e36107a8565b6040519080825280601f01601f19166020018201604052801561050d576020820181803683370190505b5090505b8415610590576105226001836107d7565b915061052f600a866107ee565b61053a90603061065b565b60f81b81838151811061054f5761054f610802565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610589600a86610794565b9450610511565b949350505050565b60005b838110156105b357818101518382015260200161059b565b838111156105c2576000848401525b50505050565b600081518084526105e0816020860160208601610598565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061062560208301846105c8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561066e5761066e61062c565b500190565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff831660208201526060604082015260006106ae60608301846105c8565b95945050505050565b600084516106c9818460208901610598565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610705816001850160208a01610598565b60019201918201528351610720816002840160208801610598565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361075e5761075e61062c565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826107a3576107a3610765565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156107e9576107e961062c565b500390565b6000826107fd576107fd610765565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a", Bin: "0x61014060405234801561001157600080fd5b50604051610bba380380610bba83398101604081905261003091610090565b6001600160a01b03831660a0526080829052600160026000858585808681111561005c5761005c6100e3565b60c0816001811115610070576100706100e3565b905250505060e0939093526101009190915261012052506100f992505050565b6000806000606084860312156100a557600080fd5b83516001600160a01b03811681146100bc57600080fd5b602085015160408601519194509250600281106100d857600080fd5b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60805160a05160c05160e0516101005161012051610a3b61017f600039600061054201526000610519015260006104f001526000818161014d0152818161039201526103cd0152600081816092015281816101bf015281816102e10152818161037001528181610407015261048801526000818161018e01526101e50152610a3b6000f3fe6080604052600436106100745760003560e01c806384411d651161004e57806384411d6514610117578063d0e12f901461013b578063d3e5792b1461017c578063d4ff9218146101b057600080fd5b80630d9019e1146100805780633ccfd60b146100de57806354fd4d50146100f557600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100ea57600080fd5b506100f36101e3565b005b34801561010157600080fd5b5061010a6104e9565b6040516100d59190610759565b34801561012357600080fd5b5061012d60005481565b6040519081526020016100d5565b34801561014757600080fd5b5061016f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516100d591906107dd565b34801561018857600080fd5b5061012d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101bc57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100b4565b7f00000000000000000000000000000000000000000000000000000000000000004710156102bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b6000479050806000808282546102d39190610820565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a17f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee817f0000000000000000000000000000000000000000000000000000000000000000337f00000000000000000000000000000000000000000000000000000000000000006040516103c19493929190610838565b60405180910390a160017f000000000000000000000000000000000000000000000000000000000000000060018111156103fd576103fd610773565b036104315761042d7f00000000000000000000000000000000000000000000000000000000000000005a8361058c565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd9184916104b4917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610879565b6000604051808303818588803b1580156104cd57600080fd5b505af11580156104e1573d6000803e3d6000fd5b505050505050565b60606105147f00000000000000000000000000000000000000000000000000000000000000006105a2565b61053d7f00000000000000000000000000000000000000000000000000000000000000006105a2565b6105667f00000000000000000000000000000000000000000000000000000000000000006105a2565b604051602001610578939291906108b4565b604051602081830303815290604052905090565b600080600080600080868989f195945050505050565b6060816000036105e557505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561060f57806105f98161092a565b91506106089050600a83610991565b91506105e9565b60008167ffffffffffffffff81111561062a5761062a6109a5565b6040519080825280601f01601f191660200182016040528015610654576020820181803683370190505b5090505b84156106d7576106696001836109d4565b9150610676600a866109eb565b610681906030610820565b60f81b818381518110610696576106966109ff565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506106d0600a86610991565b9450610658565b949350505050565b60005b838110156106fa5781810151838201526020016106e2565b83811115610709576000848401525b50505050565b600081518084526107278160208601602086016106df565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061076c602083018461070f565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600281106107d9577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b602081016107eb82846107a2565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610833576108336107f1565b500190565b84815273ffffffffffffffffffffffffffffffffffffffff8481166020830152831660408201526080810161087060608301846107a2565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff83166020820152606060408201526000610870606083018461070f565b600084516108c68184602089016106df565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610902816001850160208a016106df565b6001920191820152835161091d8160028401602088016106df565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361095b5761095b6107f1565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826109a0576109a0610962565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156109e6576109e66107f1565b500390565b6000826109fa576109fa610962565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
} }
// SequencerFeeVaultABI is the input ABI used to generate the binding from. // SequencerFeeVaultABI is the input ABI used to generate the binding from.
...@@ -43,7 +43,7 @@ var SequencerFeeVaultABI = SequencerFeeVaultMetaData.ABI ...@@ -43,7 +43,7 @@ var SequencerFeeVaultABI = SequencerFeeVaultMetaData.ABI
var SequencerFeeVaultBin = SequencerFeeVaultMetaData.Bin var SequencerFeeVaultBin = SequencerFeeVaultMetaData.Bin
// DeploySequencerFeeVault deploys a new Ethereum contract, binding an instance of SequencerFeeVault to it. // DeploySequencerFeeVault deploys a new Ethereum contract, binding an instance of SequencerFeeVault to it.
func DeploySequencerFeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _recipient common.Address) (common.Address, *types.Transaction, *SequencerFeeVault, error) { func DeploySequencerFeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _recipient common.Address, _minWithdrawalAmount *big.Int, _withdrawalNetwork uint8) (common.Address, *types.Transaction, *SequencerFeeVault, error) {
parsed, err := SequencerFeeVaultMetaData.GetAbi() parsed, err := SequencerFeeVaultMetaData.GetAbi()
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
...@@ -52,7 +52,7 @@ func DeploySequencerFeeVault(auth *bind.TransactOpts, backend bind.ContractBacke ...@@ -52,7 +52,7 @@ func DeploySequencerFeeVault(auth *bind.TransactOpts, backend bind.ContractBacke
return common.Address{}, nil, nil, errors.New("GetABI returned nil") return common.Address{}, nil, nil, errors.New("GetABI returned nil")
} }
address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SequencerFeeVaultBin), backend, _recipient) address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SequencerFeeVaultBin), backend, _recipient, _minWithdrawalAmount, _withdrawalNetwork)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
} }
...@@ -263,6 +263,37 @@ func (_SequencerFeeVault *SequencerFeeVaultCallerSession) RECIPIENT() (common.Ad ...@@ -263,6 +263,37 @@ func (_SequencerFeeVault *SequencerFeeVaultCallerSession) RECIPIENT() (common.Ad
return _SequencerFeeVault.Contract.RECIPIENT(&_SequencerFeeVault.CallOpts) return _SequencerFeeVault.Contract.RECIPIENT(&_SequencerFeeVault.CallOpts)
} }
// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90.
//
// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8)
func (_SequencerFeeVault *SequencerFeeVaultCaller) WITHDRAWALNETWORK(opts *bind.CallOpts) (uint8, error) {
var out []interface{}
err := _SequencerFeeVault.contract.Call(opts, &out, "WITHDRAWAL_NETWORK")
if err != nil {
return *new(uint8), err
}
out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)
return out0, err
}
// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90.
//
// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8)
func (_SequencerFeeVault *SequencerFeeVaultSession) WITHDRAWALNETWORK() (uint8, error) {
return _SequencerFeeVault.Contract.WITHDRAWALNETWORK(&_SequencerFeeVault.CallOpts)
}
// WITHDRAWALNETWORK is a free data retrieval call binding the contract method 0xd0e12f90.
//
// Solidity: function WITHDRAWAL_NETWORK() view returns(uint8)
func (_SequencerFeeVault *SequencerFeeVaultCallerSession) WITHDRAWALNETWORK() (uint8, error) {
return _SequencerFeeVault.Contract.WITHDRAWALNETWORK(&_SequencerFeeVault.CallOpts)
}
// L1FeeWallet is a free data retrieval call binding the contract method 0xd4ff9218. // L1FeeWallet is a free data retrieval call binding the contract method 0xd4ff9218.
// //
// Solidity: function l1FeeWallet() view returns(address) // Solidity: function l1FeeWallet() view returns(address)
...@@ -533,3 +564,140 @@ func (_SequencerFeeVault *SequencerFeeVaultFilterer) ParseWithdrawal(log types.L ...@@ -533,3 +564,140 @@ func (_SequencerFeeVault *SequencerFeeVaultFilterer) ParseWithdrawal(log types.L
event.Raw = log event.Raw = log
return event, nil return event, nil
} }
// SequencerFeeVaultWithdrawal0Iterator is returned from FilterWithdrawal0 and is used to iterate over the raw logs and unpacked data for Withdrawal0 events raised by the SequencerFeeVault contract.
type SequencerFeeVaultWithdrawal0Iterator struct {
Event *SequencerFeeVaultWithdrawal0 // Event containing the contract specifics and raw log
contract *bind.BoundContract // Generic contract to use for unpacking event data
event string // Event name to use for unpacking event data
logs chan types.Log // Log channel receiving the found contract events
sub ethereum.Subscription // Subscription for errors, completion and termination
done bool // Whether the subscription completed delivering logs
fail error // Occurred error to stop iteration
}
// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
func (it *SequencerFeeVaultWithdrawal0Iterator) Next() bool {
// If the iterator failed, stop iterating
if it.fail != nil {
return false
}
// If the iterator completed, deliver directly whatever's available
if it.done {
select {
case log := <-it.logs:
it.Event = new(SequencerFeeVaultWithdrawal0)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err
return false
}
it.Event.Raw = log
return true
default:
return false
}
}
// Iterator still in progress, wait for either a data or an error event
select {
case log := <-it.logs:
it.Event = new(SequencerFeeVaultWithdrawal0)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err
return false
}
it.Event.Raw = log
return true
case err := <-it.sub.Err():
it.done = true
it.fail = err
return it.Next()
}
}
// Error returns any retrieval or parsing error occurred during filtering.
func (it *SequencerFeeVaultWithdrawal0Iterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *SequencerFeeVaultWithdrawal0Iterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// SequencerFeeVaultWithdrawal0 represents a Withdrawal0 event raised by the SequencerFeeVault contract.
type SequencerFeeVaultWithdrawal0 struct {
Value *big.Int
To common.Address
From common.Address
WithdrawalNetwork uint8
Raw types.Log // Blockchain specific contextual infos
}
// FilterWithdrawal0 is a free log retrieval operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_SequencerFeeVault *SequencerFeeVaultFilterer) FilterWithdrawal0(opts *bind.FilterOpts) (*SequencerFeeVaultWithdrawal0Iterator, error) {
logs, sub, err := _SequencerFeeVault.contract.FilterLogs(opts, "Withdrawal0")
if err != nil {
return nil, err
}
return &SequencerFeeVaultWithdrawal0Iterator{contract: _SequencerFeeVault.contract, event: "Withdrawal0", logs: logs, sub: sub}, nil
}
// WatchWithdrawal0 is a free log subscription operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_SequencerFeeVault *SequencerFeeVaultFilterer) WatchWithdrawal0(opts *bind.WatchOpts, sink chan<- *SequencerFeeVaultWithdrawal0) (event.Subscription, error) {
logs, sub, err := _SequencerFeeVault.contract.WatchLogs(opts, "Withdrawal0")
if err != nil {
return nil, err
}
return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe()
for {
select {
case log := <-logs:
// New log arrived, parse the event and forward to the user
event := new(SequencerFeeVaultWithdrawal0)
if err := _SequencerFeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil {
return err
}
event.Raw = log
select {
case sink <- event:
case err := <-sub.Err():
return err
case <-quit:
return nil
}
case err := <-sub.Err():
return err
case <-quit:
return nil
}
}
}), nil
}
// ParseWithdrawal0 is a log parse operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_SequencerFeeVault *SequencerFeeVaultFilterer) ParseWithdrawal0(log types.Log) (*SequencerFeeVaultWithdrawal0, error) {
event := new(SequencerFeeVaultWithdrawal0)
if err := _SequencerFeeVault.contract.UnpackLog(event, "Withdrawal0", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
...@@ -13,7 +13,7 @@ const SequencerFeeVaultStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"cont ...@@ -13,7 +13,7 @@ const SequencerFeeVaultStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"cont
var SequencerFeeVaultStorageLayout = new(solc.StorageLayout) var SequencerFeeVaultStorageLayout = new(solc.StorageLayout)
var SequencerFeeVaultDeployedBin = "0x6080604052600436106100695760003560e01c806384411d651161004357806384411d651461010c578063d3e5792b14610130578063d4ff92181461016457600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e8610197565b005b3480156100f657600080fd5b506100ff6103b8565b6040516100ca9190610612565b34801561011857600080fd5b5061012260005481565b6040519081526020016100ca565b34801561013c57600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b34801561017057600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100a9565b7f0000000000000000000000000000000000000000000000000000000000000000471015610271576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b600047905080600080828254610287919061065b565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a1604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610383917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610673565b6000604051808303818588803b15801561039c57600080fd5b505af11580156103b0573d6000803e3d6000fd5b505050505050565b60606103e37f000000000000000000000000000000000000000000000000000000000000000061045b565b61040c7f000000000000000000000000000000000000000000000000000000000000000061045b565b6104357f000000000000000000000000000000000000000000000000000000000000000061045b565b604051602001610447939291906106b7565b604051602081830303815290604052905090565b60608160000361049e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156104c857806104b28161072d565b91506104c19050600a83610794565b91506104a2565b60008167ffffffffffffffff8111156104e3576104e36107a8565b6040519080825280601f01601f19166020018201604052801561050d576020820181803683370190505b5090505b8415610590576105226001836107d7565b915061052f600a866107ee565b61053a90603061065b565b60f81b81838151811061054f5761054f610802565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610589600a86610794565b9450610511565b949350505050565b60005b838110156105b357818101518382015260200161059b565b838111156105c2576000848401525b50505050565b600081518084526105e0816020860160208601610598565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061062560208301846105c8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561066e5761066e61062c565b500190565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff831660208201526060604082015260006106ae60608301846105c8565b95945050505050565b600084516106c9818460208901610598565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610705816001850160208a01610598565b60019201918201528351610720816002840160208801610598565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361075e5761075e61062c565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826107a3576107a3610765565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156107e9576107e961062c565b500390565b6000826107fd576107fd610765565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a" var SequencerFeeVaultDeployedBin = "0x6080604052600436106100745760003560e01c806384411d651161004e57806384411d6514610117578063d0e12f901461013b578063d3e5792b1461017c578063d4ff9218146101b057600080fd5b80630d9019e1146100805780633ccfd60b146100de57806354fd4d50146100f557600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100ea57600080fd5b506100f36101e3565b005b34801561010157600080fd5b5061010a6104e9565b6040516100d59190610759565b34801561012357600080fd5b5061012d60005481565b6040519081526020016100d5565b34801561014757600080fd5b5061016f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516100d591906107dd565b34801561018857600080fd5b5061012d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101bc57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100b4565b7f00000000000000000000000000000000000000000000000000000000000000004710156102bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b6000479050806000808282546102d39190610820565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a17f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee817f0000000000000000000000000000000000000000000000000000000000000000337f00000000000000000000000000000000000000000000000000000000000000006040516103c19493929190610838565b60405180910390a160017f000000000000000000000000000000000000000000000000000000000000000060018111156103fd576103fd610773565b036104315761042d7f00000000000000000000000000000000000000000000000000000000000000005a8361058c565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd9184916104b4917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610879565b6000604051808303818588803b1580156104cd57600080fd5b505af11580156104e1573d6000803e3d6000fd5b505050505050565b60606105147f00000000000000000000000000000000000000000000000000000000000000006105a2565b61053d7f00000000000000000000000000000000000000000000000000000000000000006105a2565b6105667f00000000000000000000000000000000000000000000000000000000000000006105a2565b604051602001610578939291906108b4565b604051602081830303815290604052905090565b600080600080600080868989f195945050505050565b6060816000036105e557505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561060f57806105f98161092a565b91506106089050600a83610991565b91506105e9565b60008167ffffffffffffffff81111561062a5761062a6109a5565b6040519080825280601f01601f191660200182016040528015610654576020820181803683370190505b5090505b84156106d7576106696001836109d4565b9150610676600a866109eb565b610681906030610820565b60f81b818381518110610696576106966109ff565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506106d0600a86610991565b9450610658565b949350505050565b60005b838110156106fa5781810151838201526020016106e2565b83811115610709576000848401525b50505050565b600081518084526107278160208601602086016106df565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061076c602083018461070f565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600281106107d9577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b602081016107eb82846107a2565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610833576108336107f1565b500190565b84815273ffffffffffffffffffffffffffffffffffffffff8481166020830152831660408201526080810161087060608301846107a2565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff83166020820152606060408201526000610870606083018461070f565b600084516108c68184602089016106df565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610902816001850160208a016106df565b6001920191820152835161091d8160028401602088016106df565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361095b5761095b6107f1565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826109a0576109a0610962565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156109e6576109e66107f1565b500390565b6000826109fa576109fa610962565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a"
func init() { func init() {
if err := json.Unmarshal([]byte(SequencerFeeVaultStorageLayoutJSON), SequencerFeeVaultStorageLayout); err != nil { if err := json.Unmarshal([]byte(SequencerFeeVaultStorageLayoutJSON), SequencerFeeVaultStorageLayout); err != nil {
......
...@@ -84,6 +84,18 @@ type DeployConfig struct { ...@@ -84,6 +84,18 @@ type DeployConfig struct {
L1FeeVaultRecipient common.Address `json:"l1FeeVaultRecipient"` L1FeeVaultRecipient common.Address `json:"l1FeeVaultRecipient"`
// L1 recipient of fees accumulated in the SequencerFeeVault // L1 recipient of fees accumulated in the SequencerFeeVault
SequencerFeeVaultRecipient common.Address `json:"sequencerFeeVaultRecipient"` SequencerFeeVaultRecipient common.Address `json:"sequencerFeeVaultRecipient"`
// Minimum withdrawal amount for the BaseFeeVault
BaseFeeVaultMinimumWithdrawalAmount *hexutil.Big `json:"baseFeeVaultMinimumWithdrawalAmount"`
// Minimum withdrawal amount for the L1FeeVault
L1FeeVaultMinimumWithdrawalAmount *hexutil.Big `json:"l1FeeVaultMinimumWithdrawalAmount"`
// Minimum withdrawal amount for the SequencerFeeVault
SequencerFeeVaultMinimumWithdrawalAmount *hexutil.Big `json:"sequencerFeeVaultMinimumWithdrawalAmount"`
// Withdrawal network for the BaseFeeVault
BaseFeeVaultWithdrawalNetwork uint8 `json:"baseFeeVaultWithdrawalNetwork"`
// Withdrawal network for the L1FeeVault
L1FeeVaultWithdrawalNetwork uint8 `json:"l1FeeVaultWithdrawalNetwork"`
// Withdrawal network for the SequencerFeeVault
SequencerFeeVaultWithdrawalNetwork uint8 `json:"sequencerFeeVaultWithdrawalNetwork"`
// L1StandardBridge proxy address on L1 // L1StandardBridge proxy address on L1
L1StandardBridgeProxy common.Address `json:"l1StandardBridgeProxy"` L1StandardBridgeProxy common.Address `json:"l1StandardBridgeProxy"`
// L1CrossDomainMessenger proxy address on L1 // L1CrossDomainMessenger proxy address on L1
...@@ -178,6 +190,15 @@ func (d *DeployConfig) Check() error { ...@@ -178,6 +190,15 @@ func (d *DeployConfig) Check() error {
if d.SequencerFeeVaultRecipient == (common.Address{}) { if d.SequencerFeeVaultRecipient == (common.Address{}) {
return fmt.Errorf("%w: SequencerFeeVaultRecipient cannot be address(0)", ErrInvalidDeployConfig) return fmt.Errorf("%w: SequencerFeeVaultRecipient cannot be address(0)", ErrInvalidDeployConfig)
} }
if d.BaseFeeVaultWithdrawalNetwork >= 2 {
return fmt.Errorf("%w: BaseFeeVaultWithdrawalNetwork can only be 0 (L1) or 1 (L2)", ErrInvalidDeployConfig)
}
if d.L1FeeVaultWithdrawalNetwork >= 2 {
return fmt.Errorf("%w: L1FeeVaultWithdrawalNetwork can only be 0 (L1) or 1 (L2)", ErrInvalidDeployConfig)
}
if d.SequencerFeeVaultWithdrawalNetwork >= 2 {
return fmt.Errorf("%w: SequencerFeeVaultWithdrawalNetwork can only be 0 (L1) or 1 (L2)", ErrInvalidDeployConfig)
}
if d.GasPriceOracleOverhead == 0 { if d.GasPriceOracleOverhead == 0 {
log.Warn("GasPriceOracleOverhead is 0") log.Warn("GasPriceOracleOverhead is 0")
} }
...@@ -411,12 +432,18 @@ func NewL2ImmutableConfig(config *DeployConfig, block *types.Block) (immutables. ...@@ -411,12 +432,18 @@ func NewL2ImmutableConfig(config *DeployConfig, block *types.Block) (immutables.
} }
immutable["SequencerFeeVault"] = immutables.ImmutableValues{ immutable["SequencerFeeVault"] = immutables.ImmutableValues{
"recipient": config.SequencerFeeVaultRecipient, "recipient": config.SequencerFeeVaultRecipient,
"minimumWithdrawalAmount": config.SequencerFeeVaultMinimumWithdrawalAmount,
"withdrawalNetwork": config.SequencerFeeVaultWithdrawalNetwork,
} }
immutable["L1FeeVault"] = immutables.ImmutableValues{ immutable["L1FeeVault"] = immutables.ImmutableValues{
"recipient": config.L1FeeVaultRecipient, "recipient": config.L1FeeVaultRecipient,
"minimumWithdrawalAmount": config.L1FeeVaultMinimumWithdrawalAmount,
"withdrawalNetwork": config.L1FeeVaultWithdrawalNetwork,
} }
immutable["BaseFeeVault"] = immutables.ImmutableValues{ immutable["BaseFeeVault"] = immutables.ImmutableValues{
"recipient": config.BaseFeeVaultRecipient, "recipient": config.BaseFeeVaultRecipient,
"minimumWithdrawalAmount": config.BaseFeeVaultMinimumWithdrawalAmount,
"withdrawalNetwork": config.BaseFeeVaultWithdrawalNetwork,
} }
return immutable, nil return immutable, nil
......
...@@ -22,6 +22,14 @@ ...@@ -22,6 +22,14 @@
"baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", "l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", "sequencerFeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"l1ERC721BridgeProxy": "0xff000000000000000000000000000000000000ff", "l1ERC721BridgeProxy": "0xff000000000000000000000000000000000000ff",
"l1StandardBridgeProxy": "0xff000000000000000000000000000000000000fd", "l1StandardBridgeProxy": "0xff000000000000000000000000000000000000fd",
"l1CrossDomainMessengerProxy": "0xff000000000000000000000000000000000000dd", "l1CrossDomainMessengerProxy": "0xff000000000000000000000000000000000000dd",
......
...@@ -39,6 +39,12 @@ ...@@ -39,6 +39,12 @@
"baseFeeVaultRecipient": "0x42000000000000000000000000000000000000f5", "baseFeeVaultRecipient": "0x42000000000000000000000000000000000000f5",
"l1FeeVaultRecipient": "0x42000000000000000000000000000000000000f6", "l1FeeVaultRecipient": "0x42000000000000000000000000000000000000f6",
"sequencerFeeVaultRecipient": "0x42000000000000000000000000000000000000f7", "sequencerFeeVaultRecipient": "0x42000000000000000000000000000000000000f7",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"l1StandardBridgeProxy": "0x42000000000000000000000000000000000000f8", "l1StandardBridgeProxy": "0x42000000000000000000000000000000000000f8",
"l1CrossDomainMessengerProxy": "0x42000000000000000000000000000000000000f9", "l1CrossDomainMessengerProxy": "0x42000000000000000000000000000000000000f9",
"l1ERC721BridgeProxy": "0x4200000000000000000000000000000000000060", "l1ERC721BridgeProxy": "0x4200000000000000000000000000000000000060",
......
...@@ -95,18 +95,24 @@ func BuildOptimism(immutable ImmutableConfig) (DeploymentResults, error) { ...@@ -95,18 +95,24 @@ func BuildOptimism(immutable ImmutableConfig) (DeploymentResults, error) {
Name: "SequencerFeeVault", Name: "SequencerFeeVault",
Args: []interface{}{ Args: []interface{}{
immutable["SequencerFeeVault"]["recipient"], immutable["SequencerFeeVault"]["recipient"],
immutable["SequencerFeeVault"]["minimumWithdrawalAmount"],
immutable["SequencerFeeVault"]["withdrawalNetwork"],
}, },
}, },
{ {
Name: "BaseFeeVault", Name: "BaseFeeVault",
Args: []interface{}{ Args: []interface{}{
immutable["BaseFeeVault"]["recipient"], immutable["BaseFeeVault"]["recipient"],
immutable["BaseFeeVault"]["minimumWithdrawalAmount"],
immutable["BaseFeeVault"]["withdrawalNetwork"],
}, },
}, },
{ {
Name: "L1FeeVault", Name: "L1FeeVault",
Args: []interface{}{ Args: []interface{}{
immutable["L1FeeVault"]["recipient"], immutable["L1FeeVault"]["recipient"],
immutable["L1FeeVault"]["minimumWithdrawalAmount"],
immutable["L1FeeVault"]["withdrawalNetwork"],
}, },
}, },
{ {
...@@ -159,6 +165,9 @@ func BuildL2(constructors []deployer.Constructor) (DeploymentResults, error) { ...@@ -159,6 +165,9 @@ func BuildL2(constructors []deployer.Constructor) (DeploymentResults, error) {
func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, deployment deployer.Constructor) (*types.Transaction, error) { func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, deployment deployer.Constructor) (*types.Transaction, error) {
var tx *types.Transaction var tx *types.Transaction
var recipient common.Address
var minimumWithdrawalAmount *big.Int
var withdrawalNetwork uint8
var err error var err error
switch deployment.Name { switch deployment.Name {
case "GasPriceOracle": case "GasPriceOracle":
...@@ -182,23 +191,23 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep ...@@ -182,23 +191,23 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
// No arguments required for L2ToL1MessagePasser // No arguments required for L2ToL1MessagePasser
_, tx, _, err = bindings.DeployL2ToL1MessagePasser(opts, backend) _, tx, _, err = bindings.DeployL2ToL1MessagePasser(opts, backend)
case "SequencerFeeVault": case "SequencerFeeVault":
recipient, ok := deployment.Args[0].(common.Address) recipient, minimumWithdrawalAmount, withdrawalNetwork, err = prepareFeeVaultArguments(deployment)
if !ok { if err != nil {
return nil, fmt.Errorf("invalid type for recipient") return nil, err
} }
_, tx, _, err = bindings.DeploySequencerFeeVault(opts, backend, recipient) _, tx, _, err = bindings.DeploySequencerFeeVault(opts, backend, recipient, minimumWithdrawalAmount, withdrawalNetwork)
case "BaseFeeVault": case "BaseFeeVault":
recipient, ok := deployment.Args[0].(common.Address) recipient, minimumWithdrawalAmount, withdrawalNetwork, err = prepareFeeVaultArguments(deployment)
if !ok { if err != nil {
return nil, fmt.Errorf("invalid type for recipient") return nil, err
} }
_, tx, _, err = bindings.DeployBaseFeeVault(opts, backend, recipient) _, tx, _, err = bindings.DeployBaseFeeVault(opts, backend, recipient, minimumWithdrawalAmount, withdrawalNetwork)
case "L1FeeVault": case "L1FeeVault":
recipient, ok := deployment.Args[0].(common.Address) recipient, minimumWithdrawalAmount, withdrawalNetwork, err = prepareFeeVaultArguments(deployment)
if !ok { if err != nil {
return nil, fmt.Errorf("invalid type for recipient") return nil, err
} }
_, tx, _, err = bindings.DeployL1FeeVault(opts, backend, recipient) _, tx, _, err = bindings.DeployL1FeeVault(opts, backend, recipient, minimumWithdrawalAmount, withdrawalNetwork)
case "OptimismMintableERC20Factory": case "OptimismMintableERC20Factory":
_, tx, _, err = bindings.DeployOptimismMintableERC20Factory(opts, backend, predeploys.L2StandardBridgeAddr) _, tx, _, err = bindings.DeployOptimismMintableERC20Factory(opts, backend, predeploys.L2StandardBridgeAddr)
case "DeployerWhitelist": case "DeployerWhitelist":
...@@ -236,3 +245,19 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep ...@@ -236,3 +245,19 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
return tx, err return tx, err
} }
func prepareFeeVaultArguments(deployment deployer.Constructor) (common.Address, *big.Int, uint8, error) {
recipient, ok := deployment.Args[0].(common.Address)
if !ok {
return common.Address{}, nil, 0, fmt.Errorf("invalid type for recipient")
}
minimumWithdrawalAmountHex, ok := deployment.Args[1].(*hexutil.Big)
if !ok {
return common.Address{}, nil, 0, fmt.Errorf("invalid type for minimumWithdrawalAmount")
}
withdrawalNetwork, ok := deployment.Args[2].(uint8)
if !ok {
return common.Address{}, nil, 0, fmt.Errorf("invalid type for withdrawalNetwork")
}
return recipient, minimumWithdrawalAmountHex.ToInt(), withdrawalNetwork, nil
}
...@@ -6,10 +6,13 @@ import ( ...@@ -6,10 +6,13 @@ import (
"github.com/ethereum-optimism/optimism/op-chain-ops/immutables" "github.com/ethereum-optimism/optimism/op-chain-ops/immutables"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
func TestBuildOptimism(t *testing.T) { func TestBuildOptimism(t *testing.T) {
minimumWithdrawalAmountBig, _ := big.NewInt(0).SetString("8ac7230489e80000", 16)
minimumWithdrawalAmount := (*hexutil.Big)(minimumWithdrawalAmountBig)
results, err := immutables.BuildOptimism(immutables.ImmutableConfig{ results, err := immutables.BuildOptimism(immutables.ImmutableConfig{
"L2StandardBridge": { "L2StandardBridge": {
"otherBridge": common.HexToAddress("0x1234567890123456789012345678901234567890"), "otherBridge": common.HexToAddress("0x1234567890123456789012345678901234567890"),
...@@ -27,12 +30,18 @@ func TestBuildOptimism(t *testing.T) { ...@@ -27,12 +30,18 @@ func TestBuildOptimism(t *testing.T) {
}, },
"SequencerFeeVault": { "SequencerFeeVault": {
"recipient": common.HexToAddress("0x1234567890123456789012345678901234567890"), "recipient": common.HexToAddress("0x1234567890123456789012345678901234567890"),
"minimumWithdrawalAmount": minimumWithdrawalAmount,
"withdrawalNetwork": uint8(0),
}, },
"L1FeeVault": { "L1FeeVault": {
"recipient": common.HexToAddress("0x1234567890123456789012345678901234567890"), "recipient": common.HexToAddress("0x1234567890123456789012345678901234567890"),
"minimumWithdrawalAmount": minimumWithdrawalAmount,
"withdrawalNetwork": uint8(0),
}, },
"BaseFeeVault": { "BaseFeeVault": {
"recipient": common.HexToAddress("0x1234567890123456789012345678901234567890"), "recipient": common.HexToAddress("0x1234567890123456789012345678901234567890"),
"minimumWithdrawalAmount": minimumWithdrawalAmount,
"withdrawalNetwork": uint8(0),
}, },
}) })
require.Nil(t, err) require.Nil(t, err)
......
...@@ -105,6 +105,12 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams { ...@@ -105,6 +105,12 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams {
SequencerFeeVaultRecipient: common.Address{19: 1}, SequencerFeeVaultRecipient: common.Address{19: 1},
BaseFeeVaultRecipient: common.Address{19: 2}, BaseFeeVaultRecipient: common.Address{19: 2},
L1FeeVaultRecipient: common.Address{19: 3}, L1FeeVaultRecipient: common.Address{19: 3},
BaseFeeVaultMinimumWithdrawalAmount: uint64ToBig(1000_000_000), // 1 gwei
L1FeeVaultMinimumWithdrawalAmount: uint64ToBig(1000_000_000), // 1 gwei
SequencerFeeVaultMinimumWithdrawalAmount: uint64ToBig(1000_000_000), // 1 gwei
BaseFeeVaultWithdrawalNetwork: uint8(1), // L2 withdrawal network
L1FeeVaultWithdrawalNetwork: uint8(1), // L2 withdrawal network
SequencerFeeVaultWithdrawalNetwork: uint8(1), // L2 withdrawal network
EIP1559Elasticity: 10, EIP1559Elasticity: 10,
EIP1559Denominator: 50, EIP1559Denominator: 50,
......
...@@ -128,6 +128,12 @@ func DefaultSystemConfig(t *testing.T) SystemConfig { ...@@ -128,6 +128,12 @@ func DefaultSystemConfig(t *testing.T) SystemConfig {
SequencerFeeVaultRecipient: common.Address{19: 1}, SequencerFeeVaultRecipient: common.Address{19: 1},
BaseFeeVaultRecipient: common.Address{19: 2}, BaseFeeVaultRecipient: common.Address{19: 2},
L1FeeVaultRecipient: common.Address{19: 3}, L1FeeVaultRecipient: common.Address{19: 3},
BaseFeeVaultMinimumWithdrawalAmount: uint642big(1000_000_000), // 1 gwei
L1FeeVaultMinimumWithdrawalAmount: uint642big(1000_000_000), // 1 gwei
SequencerFeeVaultMinimumWithdrawalAmount: uint642big(1000_000_000), // 1 gwei
BaseFeeVaultWithdrawalNetwork: uint8(1), // L2 withdrawal network
L1FeeVaultWithdrawalNetwork: uint8(1), // L2 withdrawal network
SequencerFeeVaultWithdrawalNetwork: uint8(1), // L2 withdrawal network
DeploymentWaitConfirmations: 1, DeploymentWaitConfirmations: 1,
......
...@@ -32,8 +32,7 @@ DisputeGameFactory_Test:test_setImplementation_notOwner_reverts() (gas: 11191) ...@@ -32,8 +32,7 @@ DisputeGameFactory_Test:test_setImplementation_notOwner_reverts() (gas: 11191)
DisputeGameFactory_Test:test_setImplementation_succeeds() (gas: 38765) DisputeGameFactory_Test:test_setImplementation_succeeds() (gas: 38765)
DisputeGameFactory_Test:test_transferOwnership_notOwner_reverts() (gas: 10979) DisputeGameFactory_Test:test_transferOwnership_notOwner_reverts() (gas: 10979)
DisputeGameFactory_Test:test_transferOwnership_succeeds() (gas: 13180) DisputeGameFactory_Test:test_transferOwnership_succeeds() (gas: 13180)
FeeVault_Test:test_constructor_succeeds() (gas: 10736) FeeVault_Test:test_constructor_succeeds() (gas: 18185)
FeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 10713)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352135) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352135)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950342) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950342)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 537914) GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 537914)
...@@ -416,11 +415,12 @@ SafeCall_Test:test_callWithMinGas_noLeakageHigh_succeeds() (gas: 1021670598) ...@@ -416,11 +415,12 @@ SafeCall_Test:test_callWithMinGas_noLeakageHigh_succeeds() (gas: 1021670598)
SafeCall_Test:test_callWithMinGas_noLeakageLow_succeeds() (gas: 1095190710) SafeCall_Test:test_callWithMinGas_noLeakageLow_succeeds() (gas: 1095190710)
Semver_Test:test_behindProxy_succeeds() (gas: 506748) Semver_Test:test_behindProxy_succeeds() (gas: 506748)
Semver_Test:test_version_succeeds() (gas: 9418) Semver_Test:test_version_succeeds() (gas: 9418)
SequencerFeeVault_Test:test_constructor_succeeds() (gas: 5526) SequencerFeeVault_L2Withdrawal_Test:test_withdraw_toL2_succeeds() (gas: 78286)
SequencerFeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 5442) SequencerFeeVault_Test:test_constructor_succeeds() (gas: 5548)
SequencerFeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 5464)
SequencerFeeVault_Test:test_receive_succeeds() (gas: 17373) SequencerFeeVault_Test:test_receive_succeeds() (gas: 17373)
SequencerFeeVault_Test:test_withdraw_notEnough_reverts() (gas: 9331) SequencerFeeVault_Test:test_withdraw_notEnough_reverts() (gas: 9353)
SequencerFeeVault_Test:test_withdraw_succeeds() (gas: 163543) SequencerFeeVault_Test:test_withdraw_toL1_succeeds() (gas: 169242)
SetPrevBaseFee_Test:test_setPrevBaseFee_succeeds() (gas: 11515) SetPrevBaseFee_Test:test_setPrevBaseFee_succeeds() (gas: 11515)
StandardBridge_Stateless_Test:test_isCorrectTokenPair_succeeds() (gas: 49936) StandardBridge_Stateless_Test:test_isCorrectTokenPair_succeeds() (gas: 49936)
StandardBridge_Stateless_Test:test_isOptimismMintableERC20_succeeds() (gas: 33072) StandardBridge_Stateless_Test:test_isOptimismMintableERC20_succeeds() (gas: 33072)
......
...@@ -12,9 +12,15 @@ import { FeeVault } from "../universal/FeeVault.sol"; ...@@ -12,9 +12,15 @@ import { FeeVault } from "../universal/FeeVault.sol";
*/ */
contract BaseFeeVault is FeeVault, Semver { contract BaseFeeVault is FeeVault, Semver {
/** /**
* @custom:semver 1.1.0 * @custom:semver 1.2.0
* *
* @param _recipient Address that will receive the accumulated fees. * @param _recipient Wallet that will receive the fees.
* @param _minWithdrawalAmount Minimum balance for withdrawals.
* @param _withdrawalNetwork Network which the recipient will receive fees on.
*/ */
constructor(address _recipient) FeeVault(_recipient, 10 ether) Semver(1, 1, 0) {} constructor(
address _recipient,
uint256 _minWithdrawalAmount,
WithdrawalNetwork _withdrawalNetwork
) FeeVault(_recipient, _minWithdrawalAmount, _withdrawalNetwork) Semver(1, 2, 0) {}
} }
...@@ -12,9 +12,15 @@ import { FeeVault } from "../universal/FeeVault.sol"; ...@@ -12,9 +12,15 @@ import { FeeVault } from "../universal/FeeVault.sol";
*/ */
contract L1FeeVault is FeeVault, Semver { contract L1FeeVault is FeeVault, Semver {
/** /**
* @custom:semver 1.1.0 * @custom:semver 1.2.0
* *
* @param _recipient Address that will receive the accumulated fees. * @param _recipient Wallet that will receive the fees.
* @param _minWithdrawalAmount Minimum balance for withdrawals.
* @param _withdrawalNetwork Network which the recipient will receive fees on.
*/ */
constructor(address _recipient) FeeVault(_recipient, 10 ether) Semver(1, 1, 0) {} constructor(
address _recipient,
uint256 _minWithdrawalAmount,
WithdrawalNetwork _withdrawalNetwork
) FeeVault(_recipient, _minWithdrawalAmount, _withdrawalNetwork) Semver(1, 2, 0) {}
} }
...@@ -13,11 +13,17 @@ import { FeeVault } from "../universal/FeeVault.sol"; ...@@ -13,11 +13,17 @@ import { FeeVault } from "../universal/FeeVault.sol";
*/ */
contract SequencerFeeVault is FeeVault, Semver { contract SequencerFeeVault is FeeVault, Semver {
/** /**
* @custom:semver 1.1.0 * @custom:semver 1.2.0
* *
* @param _recipient Address that will receive the accumulated fees. * @param _recipient Wallet that will receive the fees.
* @param _minWithdrawalAmount Minimum balance for withdrawals.
* @param _withdrawalNetwork Network which the recipient will receive fees on.
*/ */
constructor(address _recipient) FeeVault(_recipient, 10 ether) Semver(1, 1, 0) {} constructor(
address _recipient,
uint256 _minWithdrawalAmount,
WithdrawalNetwork _withdrawalNetwork
) FeeVault(_recipient, _minWithdrawalAmount, _withdrawalNetwork) Semver(1, 2, 0) {}
/** /**
* @custom:legacy * @custom:legacy
......
...@@ -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
......
...@@ -3,6 +3,7 @@ pragma solidity 0.8.15; ...@@ -3,6 +3,7 @@ pragma solidity 0.8.15;
import { Bridge_Initializer } from "./CommonTest.t.sol"; import { Bridge_Initializer } from "./CommonTest.t.sol";
import { FeeVault } from "../universal/FeeVault.sol";
import { L1FeeVault } from "../L2/L1FeeVault.sol"; import { L1FeeVault } from "../L2/L1FeeVault.sol";
import { BaseFeeVault } from "../L2/BaseFeeVault.sol"; import { BaseFeeVault } from "../L2/BaseFeeVault.sol";
import { StandardBridge } from "../universal/StandardBridge.sol"; import { StandardBridge } from "../universal/StandardBridge.sol";
...@@ -13,24 +14,31 @@ contract FeeVault_Test is Bridge_Initializer { ...@@ -13,24 +14,31 @@ contract FeeVault_Test is Bridge_Initializer {
BaseFeeVault baseFeeVault = BaseFeeVault(payable(Predeploys.BASE_FEE_VAULT)); BaseFeeVault baseFeeVault = BaseFeeVault(payable(Predeploys.BASE_FEE_VAULT));
L1FeeVault l1FeeVault = L1FeeVault(payable(Predeploys.L1_FEE_VAULT)); L1FeeVault l1FeeVault = L1FeeVault(payable(Predeploys.L1_FEE_VAULT));
address constant recipient = address(0x10000); uint256 constant otherMinimumWithdrawalAmount = 10 ether;
function setUp() public override { function setUp() public override {
super.setUp(); super.setUp();
vm.etch(Predeploys.BASE_FEE_VAULT, address(new BaseFeeVault(recipient)).code); vm.etch(
vm.etch(Predeploys.L1_FEE_VAULT, address(new L1FeeVault(recipient)).code); Predeploys.BASE_FEE_VAULT,
address(new BaseFeeVault(alice, NON_ZERO_VALUE, FeeVault.WithdrawalNetwork.L1)).code
);
vm.etch(
Predeploys.L1_FEE_VAULT,
address(
new L1FeeVault(bob, otherMinimumWithdrawalAmount, FeeVault.WithdrawalNetwork.L2)
).code
);
vm.label(Predeploys.BASE_FEE_VAULT, "BaseFeeVault"); vm.label(Predeploys.BASE_FEE_VAULT, "BaseFeeVault");
vm.label(Predeploys.L1_FEE_VAULT, "L1FeeVault"); vm.label(Predeploys.L1_FEE_VAULT, "L1FeeVault");
} }
function test_constructor_succeeds() external { function test_constructor_succeeds() external {
assertEq(baseFeeVault.RECIPIENT(), recipient); assertEq(baseFeeVault.RECIPIENT(), alice);
assertEq(l1FeeVault.RECIPIENT(), recipient); assertEq(l1FeeVault.RECIPIENT(), bob);
} assertEq(baseFeeVault.MIN_WITHDRAWAL_AMOUNT(), NON_ZERO_VALUE);
assertEq(l1FeeVault.MIN_WITHDRAWAL_AMOUNT(), otherMinimumWithdrawalAmount);
function test_minWithdrawalAmount_succeeds() external { assertEq(uint8(baseFeeVault.WITHDRAWAL_NETWORK()), uint8(FeeVault.WithdrawalNetwork.L1));
assertEq(baseFeeVault.MIN_WITHDRAWAL_AMOUNT(), 10 ether); assertEq(uint8(l1FeeVault.WITHDRAWAL_NETWORK()), uint8(FeeVault.WithdrawalNetwork.L2));
assertEq(l1FeeVault.MIN_WITHDRAWAL_AMOUNT(), 10 ether);
} }
} }
// 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 { 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);
function setUp() public override { function setUp() public override {
super.setUp(); super.setUp();
vm.etch(Predeploys.SEQUENCER_FEE_WALLET, address(new SequencerFeeVault(recipient)).code); vm.etch(
Predeploys.SEQUENCER_FEE_WALLET,
address(new SequencerFeeVault(recipient, NON_ZERO_VALUE, FeeVault.WithdrawalNetwork.L1))
.code
);
vm.label(Predeploys.SEQUENCER_FEE_WALLET, "SequencerFeeVault"); vm.label(Predeploys.SEQUENCER_FEE_WALLET, "SequencerFeeVault");
} }
function test_minWithdrawalAmount_succeeds() external { function test_minWithdrawalAmount_succeeds() external {
assertEq(vault.MIN_WITHDRAWAL_AMOUNT(), 10 ether); assertEq(vault.MIN_WITHDRAWAL_AMOUNT(), NON_ZERO_VALUE);
} }
function test_constructor_succeeds() external { function test_constructor_succeeds() external {
...@@ -46,7 +46,7 @@ contract SequencerFeeVault_Test is Bridge_Initializer { ...@@ -46,7 +46,7 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
vault.withdraw(); vault.withdraw();
} }
function test_withdraw_succeeds() external { function test_withdraw_toL1_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);
...@@ -55,6 +55,13 @@ contract SequencerFeeVault_Test is Bridge_Initializer { ...@@ -55,6 +55,13 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
vm.expectEmit(true, true, true, true, address(Predeploys.SEQUENCER_FEE_WALLET)); vm.expectEmit(true, true, true, true, address(Predeploys.SEQUENCER_FEE_WALLET));
emit Withdrawal(address(vault).balance, vault.RECIPIENT(), address(this)); emit Withdrawal(address(vault).balance, vault.RECIPIENT(), address(this));
vm.expectEmit(true, true, true, true, address(Predeploys.SEQUENCER_FEE_WALLET));
emit Withdrawal(
address(vault).balance,
vault.RECIPIENT(),
address(this),
FeeVault.WithdrawalNetwork.L1
);
// The entire vault's balance is withdrawn // The entire vault's balance is withdrawn
vm.expectCall( vm.expectCall(
...@@ -72,5 +79,47 @@ contract SequencerFeeVault_Test is Bridge_Initializer { ...@@ -72,5 +79,47 @@ 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);
}
}
contract SequencerFeeVault_L2Withdrawal_Test is FeeVault_Initializer {
function setUp() public override {
super.setUp();
vm.etch(
Predeploys.SEQUENCER_FEE_WALLET,
address(new SequencerFeeVault(recipient, NON_ZERO_VALUE, FeeVault.WithdrawalNetwork.L2))
.code
);
vm.label(Predeploys.SEQUENCER_FEE_WALLET, "SequencerFeeVault");
}
function test_withdraw_toL2_succeeds() external {
uint256 amount = vault.MIN_WITHDRAWAL_AMOUNT() + 1;
vm.deal(address(vault), amount);
// No ether has been withdrawn yet
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));
emit Withdrawal(
address(vault).balance,
vault.RECIPIENT(),
address(this),
FeeVault.WithdrawalNetwork.L2
);
// The entire vault's balance is withdrawn
vm.expectCall(recipient, address(vault).balance, bytes(""));
vault.withdraw();
// The withdrawal was successful
assertEq(vault.totalProcessed(), amount);
assertEq(address(vault).balance, ZERO_VALUE);
assertEq(recipient.balance, amount);
} }
} }
...@@ -3,6 +3,7 @@ pragma solidity 0.8.15; ...@@ -3,6 +3,7 @@ pragma solidity 0.8.15;
import { L2StandardBridge } from "../L2/L2StandardBridge.sol"; import { L2StandardBridge } from "../L2/L2StandardBridge.sol";
import { Predeploys } from "../libraries/Predeploys.sol"; import { Predeploys } from "../libraries/Predeploys.sol";
import { SafeCall } from "../libraries/SafeCall.sol";
/** /**
* @title FeeVault * @title FeeVault
...@@ -11,13 +12,14 @@ import { Predeploys } from "../libraries/Predeploys.sol"; ...@@ -11,13 +12,14 @@ import { Predeploys } from "../libraries/Predeploys.sol";
*/ */
abstract contract FeeVault { abstract contract FeeVault {
/** /**
* @notice Emits each time that a withdrawal occurs. * @notice Enum representing where the FeeVault withdraws funds to.
* * @custom:value L1 FeeVault withdraws funds to L1.
* @param value Amount that was withdrawn (in wei). * @custom:value L2 FeeVault withdraws funds to L2.
* @param to Address that the funds were sent to.
* @param from Address that triggered the withdrawal.
*/ */
event Withdrawal(uint256 value, address to, address from); enum WithdrawalNetwork {
L1,
L2
}
/** /**
* @notice Minimum balance before a withdrawal can be triggered. * @notice Minimum balance before a withdrawal can be triggered.
...@@ -25,10 +27,15 @@ abstract contract FeeVault { ...@@ -25,10 +27,15 @@ abstract contract FeeVault {
uint256 public immutable MIN_WITHDRAWAL_AMOUNT; uint256 public immutable MIN_WITHDRAWAL_AMOUNT;
/** /**
* @notice Wallet that will receive the fees on L1. * @notice Wallet that will receive the fees.
*/ */
address public immutable RECIPIENT; address public immutable RECIPIENT;
/**
* @notice Network which the RECIPIENT will receive fees on.
*/
WithdrawalNetwork public immutable WITHDRAWAL_NETWORK;
/** /**
* @notice The minimum gas limit for the FeeVault withdrawal transaction. * @notice The minimum gas limit for the FeeVault withdrawal transaction.
*/ */
...@@ -40,12 +47,39 @@ abstract contract FeeVault { ...@@ -40,12 +47,39 @@ abstract contract FeeVault {
uint256 public totalProcessed; uint256 public totalProcessed;
/** /**
* @param _recipient Wallet that will receive the fees on L1. * @notice Emitted each time a withdrawal occurs. This event will be deprecated
* @param _minWithdrawalAmount Minimum balance before a withdrawal can be triggered. * 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.
*
* @param value Amount that was withdrawn (in wei).
* @param to Address that the funds were sent to.
* @param from Address that triggered the withdrawal.
* @param withdrawalNetwork Network which the to address will receive funds on.
*/
event Withdrawal(uint256 value, address to, address from, WithdrawalNetwork withdrawalNetwork);
/**
* @param _recipient Wallet that will receive the fees.
* @param _minWithdrawalAmount Minimum balance for withdrawals.
* @param _withdrawalNetwork Network which the recipient will receive fees on.
*/ */
constructor(address _recipient, uint256 _minWithdrawalAmount) { constructor(
MIN_WITHDRAWAL_AMOUNT = _minWithdrawalAmount; address _recipient,
uint256 _minWithdrawalAmount,
WithdrawalNetwork _withdrawalNetwork
) {
RECIPIENT = _recipient; RECIPIENT = _recipient;
MIN_WITHDRAWAL_AMOUNT = _minWithdrawalAmount;
WITHDRAWAL_NETWORK = _withdrawalNetwork;
} }
/** /**
...@@ -54,7 +88,7 @@ abstract contract FeeVault { ...@@ -54,7 +88,7 @@ abstract contract FeeVault {
receive() external payable {} receive() external payable {}
/** /**
* @notice Triggers a withdrawal of funds to the L1 fee wallet. * @notice Triggers a withdrawal of funds to the fee wallet on L1 or L2.
*/ */
function withdraw() external { function withdraw() external {
require( require(
...@@ -66,11 +100,16 @@ abstract contract FeeVault { ...@@ -66,11 +100,16 @@ abstract contract FeeVault {
totalProcessed += value; totalProcessed += value;
emit Withdrawal(value, RECIPIENT, msg.sender); emit Withdrawal(value, RECIPIENT, msg.sender);
emit Withdrawal(value, RECIPIENT, msg.sender, WITHDRAWAL_NETWORK);
if (WITHDRAWAL_NETWORK == WithdrawalNetwork.L2) {
SafeCall.send(RECIPIENT, gasleft(), value);
} else {
L2StandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE)).bridgeETHTo{ value: value }( L2StandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE)).bridgeETHTo{ value: value }(
RECIPIENT, RECIPIENT,
WITHDRAWAL_MIN_GAS, WITHDRAWAL_MIN_GAS,
bytes("") bytes("")
); );
} }
}
} }
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
"baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", "l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a", "sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"proxyAdminOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "proxyAdminOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"finalSystemOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "finalSystemOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"portalGuardian": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "portalGuardian": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
......
...@@ -33,6 +33,13 @@ ...@@ -33,6 +33,13 @@
"l1FeeVaultRecipient": "ADMIN", "l1FeeVaultRecipient": "ADMIN",
"sequencerFeeVaultRecipient": "ADMIN", "sequencerFeeVaultRecipient": "ADMIN",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"gasPriceOracleOverhead": 2100, "gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000, "gasPriceOracleScalar": 1000000,
......
...@@ -33,6 +33,13 @@ ...@@ -33,6 +33,13 @@
"l1FeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "l1FeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"sequencerFeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "sequencerFeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"gasPriceOracleOverhead": 2100, "gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000, "gasPriceOracleScalar": 1000000,
......
...@@ -23,6 +23,12 @@ ...@@ -23,6 +23,12 @@
"baseFeeVaultRecipient": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "baseFeeVaultRecipient": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", "l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a", "sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"governanceTokenName": "Optimism", "governanceTokenName": "Optimism",
"governanceTokenSymbol": "OP", "governanceTokenSymbol": "OP",
"governanceTokenOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "governanceTokenOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
......
...@@ -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",
......
...@@ -30,6 +30,13 @@ const config: DeployConfig = { ...@@ -30,6 +30,13 @@ const config: DeployConfig = {
l1FeeVaultRecipient: '0x90F79bf6EB2c4f870365E785982E1f101E93b906', l1FeeVaultRecipient: '0x90F79bf6EB2c4f870365E785982E1f101E93b906',
sequencerFeeVaultRecipient: '0x90F79bf6EB2c4f870365E785982E1f101E93b906', sequencerFeeVaultRecipient: '0x90F79bf6EB2c4f870365E785982E1f101E93b906',
baseFeeVaultMinimumWithdrawalAmount: '0x8ac7230489e80000',
l1FeeVaultMinimumWithdrawalAmount: '0x8ac7230489e80000',
sequencerFeeVaultMinimumWithdrawalAmount: '0x8ac7230489e80000',
baseFeeVaultWithdrawalNetwork: 0,
l1FeeVaultWithdrawalNetwork: 0,
sequencerFeeVaultWithdrawalNetwork: 0,
governanceTokenName: 'Optimism', governanceTokenName: 'Optimism',
governanceTokenSymbol: 'OP', governanceTokenSymbol: 'OP',
governanceTokenOwner: '0x90F79bf6EB2c4f870365E785982E1f101E93b906', governanceTokenOwner: '0x90F79bf6EB2c4f870365E785982E1f101E93b906',
......
...@@ -22,6 +22,12 @@ ...@@ -22,6 +22,12 @@
"baseFeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa", "baseFeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa",
"l1FeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa", "l1FeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa",
"sequencerFeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa", "sequencerFeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"governanceTokenName": "Optimism", "governanceTokenName": "Optimism",
"governanceTokenSymbol": "OP", "governanceTokenSymbol": "OP",
"governanceTokenOwner": "0x5C4e7Ba1E219E47948e6e3F55019A647bA501005", "governanceTokenOwner": "0x5C4e7Ba1E219E47948e6e3F55019A647bA501005",
......
...@@ -13,17 +13,38 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -13,17 +13,38 @@ const deployFn: DeployFunction = async (hre) => {
if (sequencerFeeVaultRecipient === ethers.constants.AddressZero) { if (sequencerFeeVaultRecipient === ethers.constants.AddressZero) {
throw new Error(`SequencerFeeVault RECIPIENT undefined`) throw new Error(`SequencerFeeVault RECIPIENT undefined`)
} }
const sequencerFeeVaultMinimumWithdrawalAmount =
deployConfig.sequencerFeeVaultMinimumWithdrawalAmount
const sequencerFeeVaultWithdrawalNetwork =
deployConfig.sequencerFeeVaultWithdrawalNetwork
if (sequencerFeeVaultWithdrawalNetwork >= 2) {
throw new Error('SequencerFeeVault WITHDRAWAL_NETWORK must be 0 or 1')
}
await deploy({ await deploy({
hre, hre,
name: 'SequencerFeeVault', name: 'SequencerFeeVault',
args: [sequencerFeeVaultRecipient], args: [
sequencerFeeVaultRecipient,
sequencerFeeVaultMinimumWithdrawalAmount,
sequencerFeeVaultWithdrawalNetwork,
],
postDeployAction: async (contract) => { postDeployAction: async (contract) => {
await assertContractVariable( await assertContractVariable(
contract, contract,
'RECIPIENT', 'RECIPIENT',
ethers.utils.getAddress(sequencerFeeVaultRecipient) ethers.utils.getAddress(sequencerFeeVaultRecipient)
) )
await assertContractVariable(
contract,
'MIN_WITHDRAWAL_AMOUNT',
sequencerFeeVaultMinimumWithdrawalAmount
)
await assertContractVariable(
contract,
'WITHDRAWAL_NETWORK',
sequencerFeeVaultWithdrawalNetwork
)
}, },
}) })
} }
......
...@@ -13,17 +13,38 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -13,17 +13,38 @@ const deployFn: DeployFunction = async (hre) => {
if (baseFeeVaultRecipient === ethers.constants.AddressZero) { if (baseFeeVaultRecipient === ethers.constants.AddressZero) {
throw new Error('BaseFeeVault RECIPIENT undefined') throw new Error('BaseFeeVault RECIPIENT undefined')
} }
const baseFeeVaultMinimumWithdrawalAmount =
deployConfig.baseFeeVaultMinimumWithdrawalAmount
const baseFeeVaultWithdrawalNetwork =
deployConfig.baseFeeVaultWithdrawalNetwork
if (baseFeeVaultWithdrawalNetwork >= 2) {
throw new Error('BaseFeeVault WITHDRAWAL_NETWORK must be 0 or 1')
}
await deploy({ await deploy({
hre, hre,
name: 'BaseFeeVault', name: 'BaseFeeVault',
args: [baseFeeVaultRecipient], args: [
baseFeeVaultRecipient,
baseFeeVaultMinimumWithdrawalAmount,
baseFeeVaultWithdrawalNetwork,
],
postDeployAction: async (contract) => { postDeployAction: async (contract) => {
await assertContractVariable( await assertContractVariable(
contract, contract,
'RECIPIENT', 'RECIPIENT',
ethers.utils.getAddress(baseFeeVaultRecipient) ethers.utils.getAddress(baseFeeVaultRecipient)
) )
await assertContractVariable(
contract,
'MIN_WITHDRAWAL_AMOUNT',
baseFeeVaultMinimumWithdrawalAmount
)
await assertContractVariable(
contract,
'WITHDRAWAL_NETWORK',
baseFeeVaultWithdrawalNetwork
)
}, },
}) })
} }
......
...@@ -13,17 +13,37 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -13,17 +13,37 @@ const deployFn: DeployFunction = async (hre) => {
if (l1FeeVaultRecipient === ethers.constants.AddressZero) { if (l1FeeVaultRecipient === ethers.constants.AddressZero) {
throw new Error('L1FeeVault RECIPIENT undefined') throw new Error('L1FeeVault RECIPIENT undefined')
} }
const l1FeeVaultMinimumWithdrawalAmount =
deployConfig.l1FeeVaultMinimumWithdrawalAmount
const l1FeeVaultWithdrawalNetwork = deployConfig.l1FeeVaultWithdrawalNetwork
if (l1FeeVaultWithdrawalNetwork >= 2) {
throw new Error('L1FeeVault WITHDRAWAL_NETWORK must be 0 or 1')
}
await deploy({ await deploy({
hre, hre,
name: 'L1FeeVault', name: 'L1FeeVault',
args: [l1FeeVaultRecipient], args: [
l1FeeVaultRecipient,
l1FeeVaultMinimumWithdrawalAmount,
l1FeeVaultWithdrawalNetwork,
],
postDeployAction: async (contract) => { postDeployAction: async (contract) => {
await assertContractVariable( await assertContractVariable(
contract, contract,
'RECIPIENT', 'RECIPIENT',
ethers.utils.getAddress(l1FeeVaultRecipient) ethers.utils.getAddress(l1FeeVaultRecipient)
) )
await assertContractVariable(
contract,
'MIN_WITHDRAWAL_AMOUNT',
l1FeeVaultMinimumWithdrawalAmount
)
await assertContractVariable(
contract,
'WITHDRAWAL_NETWORK',
l1FeeVaultWithdrawalNetwork
)
}, },
}) })
} }
......
...@@ -136,19 +136,49 @@ interface RequiredDeployConfig { ...@@ -136,19 +136,49 @@ interface RequiredDeployConfig {
proxyAdminOwner: string proxyAdminOwner: string
/** /**
* L1 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 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 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
/**
* Minimum withdrawal amount for the BaseFeeVault contract.
*/
baseFeeVaultMinimumWithdrawalAmount: string
/**
* Minimum withdrawal amount for the L1FeeVault contract.
*/
l1FeeVaultMinimumWithdrawalAmount: string
/**
* Minimum withdrawal amount for the SequencerFeeVault contract.
*/
sequencerFeeVaultMinimumWithdrawalAmount: string
/**
* The network that BaseFeeVault contract withdrawals are sent to.
*/
baseFeeVaultWithdrawalNetwork: number
/**
* The network that L1FeeVault contract withdrawals are sent to.
*/
l1FeeVaultWithdrawalNetwork: number
/**
* The network that SequencerFeeVault contract withdrawals are sent to.
*/
sequencerFeeVaultWithdrawalNetwork: number
} }
/** /**
...@@ -279,6 +309,27 @@ export const deployConfigSpec: { ...@@ -279,6 +309,27 @@ export const deployConfigSpec: {
sequencerFeeVaultRecipient: { sequencerFeeVaultRecipient: {
type: 'address', type: 'address',
}, },
baseFeeVaultMinimumWithdrawalAmount: {
type: 'string',
default: '0x8ac7230489e80000', // 10 ether
},
l1FeeVaultMinimumWithdrawalAmount: {
type: 'string',
default: '0x8ac7230489e80000', // 10 ether
},
sequencerFeeVaultMinimumWithdrawalAmount: {
type: 'string',
default: '0x8ac7230489e80000', // 10 ether
},
baseFeeVaultWithdrawalNetwork: {
type: 'number',
},
l1FeeVaultWithdrawalNetwork: {
type: 'number',
},
sequencerFeeVaultWithdrawalNetwork: {
type: 'number',
},
cliqueSignerAddress: { cliqueSignerAddress: {
type: 'address', type: 'address',
default: ethers.constants.AddressZero, default: ethers.constants.AddressZero,
......
...@@ -392,7 +392,7 @@ const check = { ...@@ -392,7 +392,7 @@ const check = {
signer signer
) )
await assertSemver(SequencerFeeVault, 'SequencerFeeVault', '1.1.0') await assertSemver(SequencerFeeVault, 'SequencerFeeVault', '1.2.0')
const RECIPIENT = await SequencerFeeVault.RECIPIENT() const RECIPIENT = await SequencerFeeVault.RECIPIENT()
assert(RECIPIENT !== hre.ethers.constants.AddressZero) assert(RECIPIENT !== hre.ethers.constants.AddressZero)
...@@ -406,6 +406,10 @@ const check = { ...@@ -406,6 +406,10 @@ const check = {
await SequencerFeeVault.MIN_WITHDRAWAL_AMOUNT() await SequencerFeeVault.MIN_WITHDRAWAL_AMOUNT()
console.log(` - MIN_WITHDRAWAL_AMOUNT: ${MIN_WITHDRAWAL_AMOUNT}`) console.log(` - MIN_WITHDRAWAL_AMOUNT: ${MIN_WITHDRAWAL_AMOUNT}`)
const WITHDRAWAL_NETWORK = await SequencerFeeVault.WITHDRAWAL_NETWORK()
assert(WITHDRAWAL_NETWORK < 2)
console.log(` - WITHDRAWAL_NETWORK: ${WITHDRAWAL_NETWORK}`)
await checkProxy(hre, 'SequencerFeeVault', signer.provider) await checkProxy(hre, 'SequencerFeeVault', signer.provider)
await assertProxy(hre, 'SequencerFeeVault', signer.provider) await assertProxy(hre, 'SequencerFeeVault', signer.provider)
}, },
...@@ -635,7 +639,7 @@ const check = { ...@@ -635,7 +639,7 @@ const check = {
signer signer
) )
await assertSemver(BaseFeeVault, 'BaseFeeVault', '1.1.0') await assertSemver(BaseFeeVault, 'BaseFeeVault', '1.2.0')
const MIN_WITHDRAWAL_AMOUNT = await BaseFeeVault.MIN_WITHDRAWAL_AMOUNT() const MIN_WITHDRAWAL_AMOUNT = await BaseFeeVault.MIN_WITHDRAWAL_AMOUNT()
console.log(` - MIN_WITHDRAWAL_AMOUNT: ${MIN_WITHDRAWAL_AMOUNT}`) console.log(` - MIN_WITHDRAWAL_AMOUNT: ${MIN_WITHDRAWAL_AMOUNT}`)
...@@ -644,6 +648,10 @@ const check = { ...@@ -644,6 +648,10 @@ const check = {
assert(RECIPIENT !== hre.ethers.constants.AddressZero) assert(RECIPIENT !== hre.ethers.constants.AddressZero)
yell(` - RECIPIENT: ${RECIPIENT}`) yell(` - RECIPIENT: ${RECIPIENT}`)
const WITHDRAWAL_NETWORK = await BaseFeeVault.WITHDRAWAL_NETWORK()
assert(WITHDRAWAL_NETWORK < 2)
console.log(` - WITHDRAWAL_NETWORK: ${WITHDRAWAL_NETWORK}`)
await checkProxy(hre, 'BaseFeeVault', signer.provider) await checkProxy(hre, 'BaseFeeVault', signer.provider)
await assertProxy(hre, 'BaseFeeVault', signer.provider) await assertProxy(hre, 'BaseFeeVault', signer.provider)
}, },
...@@ -658,7 +666,7 @@ const check = { ...@@ -658,7 +666,7 @@ const check = {
signer signer
) )
await assertSemver(L1FeeVault, 'L1FeeVault', '1.1.0') await assertSemver(L1FeeVault, 'L1FeeVault', '1.2.0')
const MIN_WITHDRAWAL_AMOUNT = await L1FeeVault.MIN_WITHDRAWAL_AMOUNT() const MIN_WITHDRAWAL_AMOUNT = await L1FeeVault.MIN_WITHDRAWAL_AMOUNT()
console.log(` - MIN_WITHDRAWAL_AMOUNT: ${MIN_WITHDRAWAL_AMOUNT}`) console.log(` - MIN_WITHDRAWAL_AMOUNT: ${MIN_WITHDRAWAL_AMOUNT}`)
...@@ -667,6 +675,10 @@ const check = { ...@@ -667,6 +675,10 @@ const check = {
assert(RECIPIENT !== hre.ethers.constants.AddressZero) assert(RECIPIENT !== hre.ethers.constants.AddressZero)
yell(` - RECIPIENT: ${RECIPIENT}`) yell(` - RECIPIENT: ${RECIPIENT}`)
const WITHDRAWAL_NETWORK = await L1FeeVault.WITHDRAWAL_NETWORK()
assert(WITHDRAWAL_NETWORK < 2)
console.log(` - WITHDRAWAL_NETWORK: ${WITHDRAWAL_NETWORK}`)
await checkProxy(hre, 'L1FeeVault', signer.provider) await checkProxy(hre, 'L1FeeVault', signer.provider)
await assertProxy(hre, 'L1FeeVault', signer.provider) await assertProxy(hre, 'L1FeeVault', signer.provider)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment