Commit 865c5167 authored by dapperscene6's avatar dapperscene6

contracts-bedrock: add withdrawal network and make withdrawal minimum configurable

parent 75c00a50
......@@ -29,10 +29,25 @@ New OP Stack blockchains are currently configured with a JSON file inside the Op
| 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. |
| `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. |
| `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. |
| `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 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 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.
......
......@@ -26,12 +26,13 @@ var (
_ = common.Big1
_ = types.BloomLookup
_ = event.NewSubscription
_ = abi.ConvertType
)
// BaseFeeVaultMetaData contains all meta data concerning the BaseFeeVault contract.
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\"}]",
Bin: "0x61012060405234801561001157600080fd5b506040516108e53803806108e58339810160408190526100309161005d565b678ac7230489e800006080526001600160a01b031660a052600160c081905260e05260006101005261008d565b60006020828403121561006f57600080fd5b81516001600160a01b038116811461008657600080fd5b9392505050565b60805160a05160c05160e051610100516108006100e560003960006103d3015260006103aa01526000610381015260008181607c015281816102570152610319015260008181610137015261015b01526108006000f3fe60806040526004361061005e5760003560e01c806354fd4d501161004357806354fd4d50146100df57806384411d6514610101578063d3e5792b1461012557600080fd5b80630d9019e11461006a5780633ccfd60b146100c857600080fd5b3661006557005b600080fd5b34801561007657600080fd5b5061009e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100d457600080fd5b506100dd610159565b005b3480156100eb57600080fd5b506100f461037a565b6040516100bf91906105d4565b34801561010d57600080fd5b5061011760005481565b6040519081526020016100bf565b34801561013157600080fd5b506101177f000000000000000000000000000000000000000000000000000000000000000081565b7f0000000000000000000000000000000000000000000000000000000000000000471015610233576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b600047905080600080828254610249919061061d565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a1604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610345917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610635565b6000604051808303818588803b15801561035e57600080fd5b505af1158015610372573d6000803e3d6000fd5b505050505050565b60606103a57f000000000000000000000000000000000000000000000000000000000000000061041d565b6103ce7f000000000000000000000000000000000000000000000000000000000000000061041d565b6103f77f000000000000000000000000000000000000000000000000000000000000000061041d565b60405160200161040993929190610679565b604051602081830303815290604052905090565b60608160000361046057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561048a5780610474816106ef565b91506104839050600a83610756565b9150610464565b60008167ffffffffffffffff8111156104a5576104a561076a565b6040519080825280601f01601f1916602001820160405280156104cf576020820181803683370190505b5090505b8415610552576104e4600183610799565b91506104f1600a866107b0565b6104fc90603061061d565b60f81b818381518110610511576105116107c4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061054b600a86610756565b94506104d3565b949350505050565b60005b8381101561057557818101518382015260200161055d565b83811115610584576000848401525b50505050565b600081518084526105a281602086016020860161055a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006105e7602083018461058a565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610630576106306105ee565b500190565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff83166020820152606060408201526000610670606083018461058a565b95945050505050565b6000845161068b81846020890161055a565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516106c7816001850160208a0161055a565b600192019182015283516106e281600284016020880161055a565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610720576107206105ee565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261076557610765610727565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156107ab576107ab6105ee565b500390565b6000826107bf576107bf610727565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
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\"},{\"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: "0x61014060405234801561001157600080fd5b50604051610b0f380380610b0f83398101604081905261003091610090565b6001600160a01b03831660a0526080829052600160026000858585808681111561005c5761005c6100e3565b60c0816001811115610070576100706100e3565b905250505060e0939093526101009190915261012052506100f992505050565b6000806000606084860312156100a557600080fd5b83516001600160a01b03811681146100bc57600080fd5b602085015160408601519194509250600281106100d857600080fd5b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60805160a05160c05160e051610100516101205161099e61017160003960006104a1015260006104780152600061044f015260008181610142015281816102eb015261031c0152600081816087015281816102c70152818161035601526103e701526000818161018301526101a7015261099e6000f3fe6080604052600436106100695760003560e01c806384411d651161004357806384411d651461010c578063d0e12f9014610130578063d3e5792b1461017157600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e86101a5565b005b3480156100f657600080fd5b506100ff610448565b6040516100ca91906106bc565b34801561011857600080fd5b5061012260005481565b6040519081526020016100ca565b34801561013c57600080fd5b506101647f000000000000000000000000000000000000000000000000000000000000000081565b6040516100ca9190610740565b34801561017d57600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000047101561027f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b6000479050806000808282546102959190610783565b90915550506040517f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee906103109083907f00000000000000000000000000000000000000000000000000000000000000009033907f00000000000000000000000000000000000000000000000000000000000000009061079b565b60405180910390a160017f0000000000000000000000000000000000000000000000000000000000000000600181111561034c5761034c6106d6565b036103905761038c7f00000000000000000000000000000000000000000000000000000000000000005a83604051806020016040528060008152506104eb565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610413917f0000000000000000000000000000000000000000000000000000000000000000916188b8916004016107dc565b6000604051808303818588803b15801561042c57600080fd5b505af1158015610440573d6000803e3d6000fd5b505050505050565b60606104737f0000000000000000000000000000000000000000000000000000000000000000610505565b61049c7f0000000000000000000000000000000000000000000000000000000000000000610505565b6104c57f0000000000000000000000000000000000000000000000000000000000000000610505565b6040516020016104d793929190610817565b604051602081830303815290604052905090565b600080600080845160208601878a8af19695505050505050565b60608160000361054857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610572578061055c8161088d565b915061056b9050600a836108f4565b915061054c565b60008167ffffffffffffffff81111561058d5761058d610908565b6040519080825280601f01601f1916602001820160405280156105b7576020820181803683370190505b5090505b841561063a576105cc600183610937565b91506105d9600a8661094e565b6105e4906030610783565b60f81b8183815181106105f9576105f9610962565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610633600a866108f4565b94506105bb565b949350505050565b60005b8381101561065d578181015183820152602001610645565b8381111561066c576000848401525b50505050565b6000815180845261068a816020860160208601610642565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006106cf6020830184610672565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061073c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b6020810161074e8284610705565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561079657610796610754565b500190565b84815273ffffffffffffffffffffffffffffffffffffffff848116602083015283166040820152608081016107d36060830184610705565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff831660208201526060604082015260006107d36060830184610672565b60008451610829818460208901610642565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610865816001850160208a01610642565b60019201918201528351610880816002840160208801610642565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036108be576108be610754565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610903576109036108c5565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008282101561094957610949610754565b500390565b60008261095d5761095d6108c5565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
}
// BaseFeeVaultABI is the input ABI used to generate the binding from.
......@@ -43,7 +44,7 @@ var BaseFeeVaultABI = BaseFeeVaultMetaData.ABI
var BaseFeeVaultBin = BaseFeeVaultMetaData.Bin
// 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()
if err != nil {
return common.Address{}, nil, nil, err
......@@ -52,7 +53,7 @@ func DeployBaseFeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _
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 {
return common.Address{}, nil, nil, err
}
......@@ -156,11 +157,11 @@ func NewBaseFeeVaultFilterer(address common.Address, filterer bind.ContractFilte
// bindBaseFeeVault binds a generic wrapper to an already deployed contract.
func bindBaseFeeVault(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(BaseFeeVaultABI))
parsed, err := BaseFeeVaultMetaData.GetAbi()
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
}
// Call invokes the (constant) contract method with params as input values and
......@@ -263,6 +264,37 @@ func (_BaseFeeVault *BaseFeeVaultCallerSession) RECIPIENT() (common.Address, err
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.
//
// Solidity: function totalProcessed() view returns(uint256)
......@@ -439,12 +471,13 @@ type BaseFeeVaultWithdrawal struct {
Value *big.Int
To common.Address
From common.Address
WithdrawalNetwork uint8
Raw types.Log // Blockchain specific contextual infos
}
// FilterWithdrawal is a free log retrieval operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba.
// FilterWithdrawal is a free log retrieval operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from)
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_BaseFeeVault *BaseFeeVaultFilterer) FilterWithdrawal(opts *bind.FilterOpts) (*BaseFeeVaultWithdrawalIterator, error) {
logs, sub, err := _BaseFeeVault.contract.FilterLogs(opts, "Withdrawal")
......@@ -454,9 +487,9 @@ func (_BaseFeeVault *BaseFeeVaultFilterer) FilterWithdrawal(opts *bind.FilterOpt
return &BaseFeeVaultWithdrawalIterator{contract: _BaseFeeVault.contract, event: "Withdrawal", logs: logs, sub: sub}, nil
}
// WatchWithdrawal is a free log subscription operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba.
// WatchWithdrawal is a free log subscription operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from)
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_BaseFeeVault *BaseFeeVaultFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *BaseFeeVaultWithdrawal) (event.Subscription, error) {
logs, sub, err := _BaseFeeVault.contract.WatchLogs(opts, "Withdrawal")
......@@ -491,9 +524,9 @@ func (_BaseFeeVault *BaseFeeVaultFilterer) WatchWithdrawal(opts *bind.WatchOpts,
}), nil
}
// ParseWithdrawal is a log parse operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba.
// ParseWithdrawal is a log parse operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from)
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_BaseFeeVault *BaseFeeVaultFilterer) ParseWithdrawal(log types.Log) (*BaseFeeVaultWithdrawal, error) {
event := new(BaseFeeVaultWithdrawal)
if err := _BaseFeeVault.contract.UnpackLog(event, "Withdrawal", log); err != nil {
......
......@@ -26,12 +26,13 @@ var (
_ = common.Big1
_ = types.BloomLookup
_ = event.NewSubscription
_ = abi.ConvertType
)
// L1FeeVaultMetaData contains all meta data concerning the L1FeeVault contract.
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\"}]",
Bin: "0x61012060405234801561001157600080fd5b506040516108e53803806108e58339810160408190526100309161005d565b678ac7230489e800006080526001600160a01b031660a052600160c081905260e05260006101005261008d565b60006020828403121561006f57600080fd5b81516001600160a01b038116811461008657600080fd5b9392505050565b60805160a05160c05160e051610100516108006100e560003960006103d3015260006103aa01526000610381015260008181607c015281816102570152610319015260008181610137015261015b01526108006000f3fe60806040526004361061005e5760003560e01c806354fd4d501161004357806354fd4d50146100df57806384411d6514610101578063d3e5792b1461012557600080fd5b80630d9019e11461006a5780633ccfd60b146100c857600080fd5b3661006557005b600080fd5b34801561007657600080fd5b5061009e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100d457600080fd5b506100dd610159565b005b3480156100eb57600080fd5b506100f461037a565b6040516100bf91906105d4565b34801561010d57600080fd5b5061011760005481565b6040519081526020016100bf565b34801561013157600080fd5b506101177f000000000000000000000000000000000000000000000000000000000000000081565b7f0000000000000000000000000000000000000000000000000000000000000000471015610233576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b600047905080600080828254610249919061061d565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a1604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610345917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610635565b6000604051808303818588803b15801561035e57600080fd5b505af1158015610372573d6000803e3d6000fd5b505050505050565b60606103a57f000000000000000000000000000000000000000000000000000000000000000061041d565b6103ce7f000000000000000000000000000000000000000000000000000000000000000061041d565b6103f77f000000000000000000000000000000000000000000000000000000000000000061041d565b60405160200161040993929190610679565b604051602081830303815290604052905090565b60608160000361046057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561048a5780610474816106ef565b91506104839050600a83610756565b9150610464565b60008167ffffffffffffffff8111156104a5576104a561076a565b6040519080825280601f01601f1916602001820160405280156104cf576020820181803683370190505b5090505b8415610552576104e4600183610799565b91506104f1600a866107b0565b6104fc90603061061d565b60f81b818381518110610511576105116107c4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061054b600a86610756565b94506104d3565b949350505050565b60005b8381101561057557818101518382015260200161055d565b83811115610584576000848401525b50505050565b600081518084526105a281602086016020860161055a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006105e7602083018461058a565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610630576106306105ee565b500190565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff83166020820152606060408201526000610670606083018461058a565b95945050505050565b6000845161068b81846020890161055a565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516106c7816001850160208a0161055a565b600192019182015283516106e281600284016020880161055a565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610720576107206105ee565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261076557610765610727565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156107ab576107ab6105ee565b500390565b6000826107bf576107bf610727565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
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\"},{\"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: "0x61014060405234801561001157600080fd5b50604051610b0f380380610b0f83398101604081905261003091610090565b6001600160a01b03831660a0526080829052600160026000858585808681111561005c5761005c6100e3565b60c0816001811115610070576100706100e3565b905250505060e0939093526101009190915261012052506100f992505050565b6000806000606084860312156100a557600080fd5b83516001600160a01b03811681146100bc57600080fd5b602085015160408601519194509250600281106100d857600080fd5b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60805160a05160c05160e051610100516101205161099e61017160003960006104a1015260006104780152600061044f015260008181610142015281816102eb015261031c0152600081816087015281816102c70152818161035601526103e701526000818161018301526101a7015261099e6000f3fe6080604052600436106100695760003560e01c806384411d651161004357806384411d651461010c578063d0e12f9014610130578063d3e5792b1461017157600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e86101a5565b005b3480156100f657600080fd5b506100ff610448565b6040516100ca91906106bc565b34801561011857600080fd5b5061012260005481565b6040519081526020016100ca565b34801561013c57600080fd5b506101647f000000000000000000000000000000000000000000000000000000000000000081565b6040516100ca9190610740565b34801561017d57600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000047101561027f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b6000479050806000808282546102959190610783565b90915550506040517f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee906103109083907f00000000000000000000000000000000000000000000000000000000000000009033907f00000000000000000000000000000000000000000000000000000000000000009061079b565b60405180910390a160017f0000000000000000000000000000000000000000000000000000000000000000600181111561034c5761034c6106d6565b036103905761038c7f00000000000000000000000000000000000000000000000000000000000000005a83604051806020016040528060008152506104eb565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610413917f0000000000000000000000000000000000000000000000000000000000000000916188b8916004016107dc565b6000604051808303818588803b15801561042c57600080fd5b505af1158015610440573d6000803e3d6000fd5b505050505050565b60606104737f0000000000000000000000000000000000000000000000000000000000000000610505565b61049c7f0000000000000000000000000000000000000000000000000000000000000000610505565b6104c57f0000000000000000000000000000000000000000000000000000000000000000610505565b6040516020016104d793929190610817565b604051602081830303815290604052905090565b600080600080845160208601878a8af19695505050505050565b60608160000361054857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610572578061055c8161088d565b915061056b9050600a836108f4565b915061054c565b60008167ffffffffffffffff81111561058d5761058d610908565b6040519080825280601f01601f1916602001820160405280156105b7576020820181803683370190505b5090505b841561063a576105cc600183610937565b91506105d9600a8661094e565b6105e4906030610783565b60f81b8183815181106105f9576105f9610962565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610633600a866108f4565b94506105bb565b949350505050565b60005b8381101561065d578181015183820152602001610645565b8381111561066c576000848401525b50505050565b6000815180845261068a816020860160208601610642565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006106cf6020830184610672565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061073c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b6020810161074e8284610705565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561079657610796610754565b500190565b84815273ffffffffffffffffffffffffffffffffffffffff848116602083015283166040820152608081016107d36060830184610705565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff831660208201526060604082015260006107d36060830184610672565b60008451610829818460208901610642565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610865816001850160208a01610642565b60019201918201528351610880816002840160208801610642565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036108be576108be610754565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610903576109036108c5565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008282101561094957610949610754565b500390565b60008261095d5761095d6108c5565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
}
// L1FeeVaultABI is the input ABI used to generate the binding from.
......@@ -43,7 +44,7 @@ var L1FeeVaultABI = L1FeeVaultMetaData.ABI
var L1FeeVaultBin = L1FeeVaultMetaData.Bin
// 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()
if err != nil {
return common.Address{}, nil, nil, err
......@@ -52,7 +53,7 @@ func DeployL1FeeVault(auth *bind.TransactOpts, backend bind.ContractBackend, _re
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 {
return common.Address{}, nil, nil, err
}
......@@ -156,11 +157,11 @@ func NewL1FeeVaultFilterer(address common.Address, filterer bind.ContractFiltere
// bindL1FeeVault binds a generic wrapper to an already deployed contract.
func bindL1FeeVault(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(L1FeeVaultABI))
parsed, err := L1FeeVaultMetaData.GetAbi()
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
}
// Call invokes the (constant) contract method with params as input values and
......@@ -263,6 +264,37 @@ func (_L1FeeVault *L1FeeVaultCallerSession) RECIPIENT() (common.Address, error)
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.
//
// Solidity: function totalProcessed() view returns(uint256)
......@@ -439,12 +471,13 @@ type L1FeeVaultWithdrawal struct {
Value *big.Int
To common.Address
From common.Address
WithdrawalNetwork uint8
Raw types.Log // Blockchain specific contextual infos
}
// FilterWithdrawal is a free log retrieval operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba.
// FilterWithdrawal is a free log retrieval operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from)
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_L1FeeVault *L1FeeVaultFilterer) FilterWithdrawal(opts *bind.FilterOpts) (*L1FeeVaultWithdrawalIterator, error) {
logs, sub, err := _L1FeeVault.contract.FilterLogs(opts, "Withdrawal")
......@@ -454,9 +487,9 @@ func (_L1FeeVault *L1FeeVaultFilterer) FilterWithdrawal(opts *bind.FilterOpts) (
return &L1FeeVaultWithdrawalIterator{contract: _L1FeeVault.contract, event: "Withdrawal", logs: logs, sub: sub}, nil
}
// WatchWithdrawal is a free log subscription operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba.
// WatchWithdrawal is a free log subscription operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from)
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_L1FeeVault *L1FeeVaultFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *L1FeeVaultWithdrawal) (event.Subscription, error) {
logs, sub, err := _L1FeeVault.contract.WatchLogs(opts, "Withdrawal")
......@@ -491,9 +524,9 @@ func (_L1FeeVault *L1FeeVaultFilterer) WatchWithdrawal(opts *bind.WatchOpts, sin
}), nil
}
// ParseWithdrawal is a log parse operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba.
// ParseWithdrawal is a log parse operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from)
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_L1FeeVault *L1FeeVaultFilterer) ParseWithdrawal(log types.Log) (*L1FeeVaultWithdrawal, error) {
event := new(L1FeeVaultWithdrawal)
if err := _L1FeeVault.contract.UnpackLog(event, "Withdrawal", log); err != nil {
......
......@@ -26,12 +26,13 @@ var (
_ = common.Big1
_ = types.BloomLookup
_ = event.NewSubscription
_ = abi.ConvertType
)
// SequencerFeeVaultMetaData contains all meta data concerning the SequencerFeeVault contract.
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\"}]",
Bin: "0x61012060405234801561001157600080fd5b5060405161092a38038061092a8339810160408190526100309161005d565b678ac7230489e800006080526001600160a01b031660a052600160c081905260e05260006101005261008d565b60006020828403121561006f57600080fd5b81516001600160a01b038116811461008657600080fd5b9392505050565b60805160a05160c05160e0516101005161083e6100ec6000396000610411015260006103e8015260006103bf0152600081816087015281816101730152818161029501526103570152600081816101420152610199015261083e6000f3fe6080604052600436106100695760003560e01c806384411d651161004357806384411d651461010c578063d3e5792b14610130578063d4ff92181461016457600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e8610197565b005b3480156100f657600080fd5b506100ff6103b8565b6040516100ca9190610612565b34801561011857600080fd5b5061012260005481565b6040519081526020016100ca565b34801561013c57600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b34801561017057600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100a9565b7f0000000000000000000000000000000000000000000000000000000000000000471015610271576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b600047905080600080828254610287919061065b565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a1604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610383917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610673565b6000604051808303818588803b15801561039c57600080fd5b505af11580156103b0573d6000803e3d6000fd5b505050505050565b60606103e37f000000000000000000000000000000000000000000000000000000000000000061045b565b61040c7f000000000000000000000000000000000000000000000000000000000000000061045b565b6104357f000000000000000000000000000000000000000000000000000000000000000061045b565b604051602001610447939291906106b7565b604051602081830303815290604052905090565b60608160000361049e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156104c857806104b28161072d565b91506104c19050600a83610794565b91506104a2565b60008167ffffffffffffffff8111156104e3576104e36107a8565b6040519080825280601f01601f19166020018201604052801561050d576020820181803683370190505b5090505b8415610590576105226001836107d7565b915061052f600a866107ee565b61053a90603061065b565b60f81b81838151811061054f5761054f610802565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610589600a86610794565b9450610511565b949350505050565b60005b838110156105b357818101518382015260200161059b565b838111156105c2576000848401525b50505050565b600081518084526105e0816020860160208601610598565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061062560208301846105c8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561066e5761066e61062c565b500190565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff831660208201526060604082015260006106ae60608301846105c8565b95945050505050565b600084516106c9818460208901610598565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610705816001850160208a01610598565b60019201918201528351610720816002840160208801610598565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361075e5761075e61062c565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826107a3576107a3610765565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156107e9576107e961062c565b500390565b6000826107fd576107fd610765565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
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\"},{\"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: "0x61014060405234801561001157600080fd5b50604051610b54380380610b5483398101604081905261003091610090565b6001600160a01b03831660a0526080829052600160026000858585808681111561005c5761005c6100e3565b60c0816001811115610070576100706100e3565b905250505060e0939093526101009190915261012052506100f992505050565b6000806000606084860312156100a557600080fd5b83516001600160a01b03811681146100bc57600080fd5b602085015160408601519194509250600281106100d857600080fd5b809150509250925092565b634e487b7160e01b600052602160045260246000fd5b60805160a05160c05160e05161010051610120516109dc61017860003960006104df015260006104b60152600061048d01526000818161014d01528181610329015261035a0152600081816092015281816101bf0152818161030501528181610394015261042501526000818161018e01526101e501526109dc6000f3fe6080604052600436106100745760003560e01c806384411d651161004e57806384411d6514610117578063d0e12f901461013b578063d3e5792b1461017c578063d4ff9218146101b057600080fd5b80630d9019e1146100805780633ccfd60b146100de57806354fd4d50146100f557600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100ea57600080fd5b506100f36101e3565b005b34801561010157600080fd5b5061010a610486565b6040516100d591906106fa565b34801561012357600080fd5b5061012d60005481565b6040519081526020016100d5565b34801561014757600080fd5b5061016f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516100d5919061077e565b34801561018857600080fd5b5061012d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101bc57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100b4565b7f00000000000000000000000000000000000000000000000000000000000000004710156102bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b6000479050806000808282546102d391906107c1565b90915550506040517f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee9061034e9083907f00000000000000000000000000000000000000000000000000000000000000009033907f0000000000000000000000000000000000000000000000000000000000000000906107d9565b60405180910390a160017f0000000000000000000000000000000000000000000000000000000000000000600181111561038a5761038a610714565b036103ce576103ca7f00000000000000000000000000000000000000000000000000000000000000005a8360405180602001604052806000815250610529565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610451917f0000000000000000000000000000000000000000000000000000000000000000916188b89160040161081a565b6000604051808303818588803b15801561046a57600080fd5b505af115801561047e573d6000803e3d6000fd5b505050505050565b60606104b17f0000000000000000000000000000000000000000000000000000000000000000610543565b6104da7f0000000000000000000000000000000000000000000000000000000000000000610543565b6105037f0000000000000000000000000000000000000000000000000000000000000000610543565b60405160200161051593929190610855565b604051602081830303815290604052905090565b600080600080845160208601878a8af19695505050505050565b60608160000361058657505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156105b0578061059a816108cb565b91506105a99050600a83610932565b915061058a565b60008167ffffffffffffffff8111156105cb576105cb610946565b6040519080825280601f01601f1916602001820160405280156105f5576020820181803683370190505b5090505b84156106785761060a600183610975565b9150610617600a8661098c565b6106229060306107c1565b60f81b818381518110610637576106376109a0565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610671600a86610932565b94506105f9565b949350505050565b60005b8381101561069b578181015183820152602001610683565b838111156106aa576000848401525b50505050565b600081518084526106c8816020860160208601610680565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061070d60208301846106b0565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061077a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b6020810161078c8284610743565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156107d4576107d4610792565b500190565b84815273ffffffffffffffffffffffffffffffffffffffff848116602083015283166040820152608081016108116060830184610743565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600061081160608301846106b0565b60008451610867818460208901610680565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516108a3816001850160208a01610680565b600192019182015283516108be816002840160208801610680565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036108fc576108fc610792565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261094157610941610903565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008282101561098757610987610792565b500390565b60008261099b5761099b610903565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
}
// SequencerFeeVaultABI is the input ABI used to generate the binding from.
......@@ -43,7 +44,7 @@ var SequencerFeeVaultABI = SequencerFeeVaultMetaData.ABI
var SequencerFeeVaultBin = SequencerFeeVaultMetaData.Bin
// 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()
if err != nil {
return common.Address{}, nil, nil, err
......@@ -52,7 +53,7 @@ func DeploySequencerFeeVault(auth *bind.TransactOpts, backend bind.ContractBacke
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 {
return common.Address{}, nil, nil, err
}
......@@ -156,11 +157,11 @@ func NewSequencerFeeVaultFilterer(address common.Address, filterer bind.Contract
// bindSequencerFeeVault binds a generic wrapper to an already deployed contract.
func bindSequencerFeeVault(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(SequencerFeeVaultABI))
parsed, err := SequencerFeeVaultMetaData.GetAbi()
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
}
// Call invokes the (constant) contract method with params as input values and
......@@ -263,6 +264,37 @@ func (_SequencerFeeVault *SequencerFeeVaultCallerSession) RECIPIENT() (common.Ad
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.
//
// Solidity: function l1FeeWallet() view returns(address)
......@@ -470,12 +502,13 @@ type SequencerFeeVaultWithdrawal struct {
Value *big.Int
To common.Address
From common.Address
WithdrawalNetwork uint8
Raw types.Log // Blockchain specific contextual infos
}
// FilterWithdrawal is a free log retrieval operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba.
// FilterWithdrawal is a free log retrieval operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from)
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_SequencerFeeVault *SequencerFeeVaultFilterer) FilterWithdrawal(opts *bind.FilterOpts) (*SequencerFeeVaultWithdrawalIterator, error) {
logs, sub, err := _SequencerFeeVault.contract.FilterLogs(opts, "Withdrawal")
......@@ -485,9 +518,9 @@ func (_SequencerFeeVault *SequencerFeeVaultFilterer) FilterWithdrawal(opts *bind
return &SequencerFeeVaultWithdrawalIterator{contract: _SequencerFeeVault.contract, event: "Withdrawal", logs: logs, sub: sub}, nil
}
// WatchWithdrawal is a free log subscription operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba.
// WatchWithdrawal is a free log subscription operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from)
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_SequencerFeeVault *SequencerFeeVaultFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *SequencerFeeVaultWithdrawal) (event.Subscription, error) {
logs, sub, err := _SequencerFeeVault.contract.WatchLogs(opts, "Withdrawal")
......@@ -522,9 +555,9 @@ func (_SequencerFeeVault *SequencerFeeVaultFilterer) WatchWithdrawal(opts *bind.
}), nil
}
// ParseWithdrawal is a log parse operation binding the contract event 0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba.
// ParseWithdrawal is a log parse operation binding the contract event 0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee.
//
// Solidity: event Withdrawal(uint256 value, address to, address from)
// Solidity: event Withdrawal(uint256 value, address to, address from, uint8 withdrawalNetwork)
func (_SequencerFeeVault *SequencerFeeVaultFilterer) ParseWithdrawal(log types.Log) (*SequencerFeeVaultWithdrawal, error) {
event := new(SequencerFeeVaultWithdrawal)
if err := _SequencerFeeVault.contract.UnpackLog(event, "Withdrawal", log); err != nil {
......
......@@ -13,7 +13,7 @@ const SequencerFeeVaultStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"cont
var SequencerFeeVaultStorageLayout = new(solc.StorageLayout)
var SequencerFeeVaultDeployedBin = "0x6080604052600436106100695760003560e01c806384411d651161004357806384411d651461010c578063d3e5792b14610130578063d4ff92181461016457600080fd5b80630d9019e1146100755780633ccfd60b146100d357806354fd4d50146100ea57600080fd5b3661007057005b600080fd5b34801561008157600080fd5b506100a97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100df57600080fd5b506100e8610197565b005b3480156100f657600080fd5b506100ff6103b8565b6040516100ca9190610612565b34801561011857600080fd5b5061012260005481565b6040519081526020016100ca565b34801561013c57600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b34801561017057600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100a9565b7f0000000000000000000000000000000000000000000000000000000000000000471015610271576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b600047905080600080828254610287919061065b565b9091555050604080518281527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152338183015290517fc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba9181900360600190a1604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610383917f0000000000000000000000000000000000000000000000000000000000000000916188b891600401610673565b6000604051808303818588803b15801561039c57600080fd5b505af11580156103b0573d6000803e3d6000fd5b505050505050565b60606103e37f000000000000000000000000000000000000000000000000000000000000000061045b565b61040c7f000000000000000000000000000000000000000000000000000000000000000061045b565b6104357f000000000000000000000000000000000000000000000000000000000000000061045b565b604051602001610447939291906106b7565b604051602081830303815290604052905090565b60608160000361049e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156104c857806104b28161072d565b91506104c19050600a83610794565b91506104a2565b60008167ffffffffffffffff8111156104e3576104e36107a8565b6040519080825280601f01601f19166020018201604052801561050d576020820181803683370190505b5090505b8415610590576105226001836107d7565b915061052f600a866107ee565b61053a90603061065b565b60f81b81838151811061054f5761054f610802565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610589600a86610794565b9450610511565b949350505050565b60005b838110156105b357818101518382015260200161059b565b838111156105c2576000848401525b50505050565b600081518084526105e0816020860160208601610598565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061062560208301846105c8565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561066e5761066e61062c565b500190565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff831660208201526060604082015260006106ae60608301846105c8565b95945050505050565b600084516106c9818460208901610598565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610705816001850160208a01610598565b60019201918201528351610720816002840160208801610598565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361075e5761075e61062c565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826107a3576107a3610765565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156107e9576107e961062c565b500390565b6000826107fd576107fd610765565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a"
var SequencerFeeVaultDeployedBin = "0x6080604052600436106100745760003560e01c806384411d651161004e57806384411d6514610117578063d0e12f901461013b578063d3e5792b1461017c578063d4ff9218146101b057600080fd5b80630d9019e1146100805780633ccfd60b146100de57806354fd4d50146100f557600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100ea57600080fd5b506100f36101e3565b005b34801561010157600080fd5b5061010a610486565b6040516100d591906106fa565b34801561012357600080fd5b5061012d60005481565b6040519081526020016100d5565b34801561014757600080fd5b5061016f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516100d5919061077e565b34801561018857600080fd5b5061012d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101bc57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006100b4565b7f00000000000000000000000000000000000000000000000000000000000000004710156102bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f4665655661756c743a207769746864726177616c20616d6f756e74206d75737460448201527f2062652067726561746572207468616e206d696e696d756d207769746864726160648201527f77616c20616d6f756e7400000000000000000000000000000000000000000000608482015260a40160405180910390fd5b6000479050806000808282546102d391906107c1565b90915550506040517f38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee9061034e9083907f00000000000000000000000000000000000000000000000000000000000000009033907f0000000000000000000000000000000000000000000000000000000000000000906107d9565b60405180910390a160017f0000000000000000000000000000000000000000000000000000000000000000600181111561038a5761038a610714565b036103ce576103ca7f00000000000000000000000000000000000000000000000000000000000000005a8360405180602001604052806000815250610529565b5050565b604080516020810182526000815290517fe11013dd0000000000000000000000000000000000000000000000000000000081527342000000000000000000000000000000000000109163e11013dd918491610451917f0000000000000000000000000000000000000000000000000000000000000000916188b89160040161081a565b6000604051808303818588803b15801561046a57600080fd5b505af115801561047e573d6000803e3d6000fd5b505050505050565b60606104b17f0000000000000000000000000000000000000000000000000000000000000000610543565b6104da7f0000000000000000000000000000000000000000000000000000000000000000610543565b6105037f0000000000000000000000000000000000000000000000000000000000000000610543565b60405160200161051593929190610855565b604051602081830303815290604052905090565b600080600080845160208601878a8af19695505050505050565b60608160000361058657505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156105b0578061059a816108cb565b91506105a99050600a83610932565b915061058a565b60008167ffffffffffffffff8111156105cb576105cb610946565b6040519080825280601f01601f1916602001820160405280156105f5576020820181803683370190505b5090505b84156106785761060a600183610975565b9150610617600a8661098c565b6106229060306107c1565b60f81b818381518110610637576106376109a0565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610671600a86610932565b94506105f9565b949350505050565b60005b8381101561069b578181015183820152602001610683565b838111156106aa576000848401525b50505050565b600081518084526106c8816020860160208601610680565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061070d60208301846106b0565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061077a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b6020810161078c8284610743565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156107d4576107d4610792565b500190565b84815273ffffffffffffffffffffffffffffffffffffffff848116602083015283166040820152608081016108116060830184610743565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600061081160608301846106b0565b60008451610867818460208901610680565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516108a3816001850160208a01610680565b600192019182015283516108be816002840160208801610680565b0160020195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036108fc576108fc610792565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261094157610941610903565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008282101561098757610987610792565b500390565b60008261099b5761099b610903565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a"
func init() {
if err := json.Unmarshal([]byte(SequencerFeeVaultStorageLayoutJSON), SequencerFeeVaultStorageLayout); err != nil {
......
......@@ -84,6 +84,18 @@ type DeployConfig struct {
L1FeeVaultRecipient common.Address `json:"l1FeeVaultRecipient"`
// L1 recipient of fees accumulated in the SequencerFeeVault
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
L1StandardBridgeProxy common.Address `json:"l1StandardBridgeProxy"`
// L1CrossDomainMessenger proxy address on L1
......@@ -178,6 +190,15 @@ func (d *DeployConfig) Check() error {
if d.SequencerFeeVaultRecipient == (common.Address{}) {
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 {
log.Warn("GasPriceOracleOverhead is 0")
}
......@@ -411,12 +432,18 @@ func NewL2ImmutableConfig(config *DeployConfig, block *types.Block) (immutables.
}
immutable["SequencerFeeVault"] = immutables.ImmutableValues{
"recipient": config.SequencerFeeVaultRecipient,
"minimumWithdrawalAmount": config.SequencerFeeVaultMinimumWithdrawalAmount,
"withdrawalNetwork": config.SequencerFeeVaultWithdrawalNetwork,
}
immutable["L1FeeVault"] = immutables.ImmutableValues{
"recipient": config.L1FeeVaultRecipient,
"minimumWithdrawalAmount": config.L1FeeVaultMinimumWithdrawalAmount,
"withdrawalNetwork": config.L1FeeVaultWithdrawalNetwork,
}
immutable["BaseFeeVault"] = immutables.ImmutableValues{
"recipient": config.BaseFeeVaultRecipient,
"minimumWithdrawalAmount": config.BaseFeeVaultMinimumWithdrawalAmount,
"withdrawalNetwork": config.BaseFeeVaultWithdrawalNetwork,
}
return immutable, nil
......
......@@ -22,6 +22,14 @@
"baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"l1ERC721BridgeProxy": "0xff000000000000000000000000000000000000ff",
"l1StandardBridgeProxy": "0xff000000000000000000000000000000000000fd",
"l1CrossDomainMessengerProxy": "0xff000000000000000000000000000000000000dd",
......
......@@ -39,6 +39,12 @@
"baseFeeVaultRecipient": "0x42000000000000000000000000000000000000f5",
"l1FeeVaultRecipient": "0x42000000000000000000000000000000000000f6",
"sequencerFeeVaultRecipient": "0x42000000000000000000000000000000000000f7",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"l1StandardBridgeProxy": "0x42000000000000000000000000000000000000f8",
"l1CrossDomainMessengerProxy": "0x42000000000000000000000000000000000000f9",
"l1ERC721BridgeProxy": "0x4200000000000000000000000000000000000060",
......
......@@ -95,18 +95,24 @@ func BuildOptimism(immutable ImmutableConfig) (DeploymentResults, error) {
Name: "SequencerFeeVault",
Args: []interface{}{
immutable["SequencerFeeVault"]["recipient"],
immutable["SequencerFeeVault"]["minimumWithdrawalAmount"],
immutable["SequencerFeeVault"]["withdrawalNetwork"],
},
},
{
Name: "BaseFeeVault",
Args: []interface{}{
immutable["BaseFeeVault"]["recipient"],
immutable["BaseFeeVault"]["minimumWithdrawalAmount"],
immutable["BaseFeeVault"]["withdrawalNetwork"],
},
},
{
Name: "L1FeeVault",
Args: []interface{}{
immutable["L1FeeVault"]["recipient"],
immutable["L1FeeVault"]["minimumWithdrawalAmount"],
immutable["L1FeeVault"]["withdrawalNetwork"],
},
},
{
......@@ -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) {
var tx *types.Transaction
var recipient common.Address
var minimumWithdrawalAmount *big.Int
var withdrawalNetwork uint8
var err error
switch deployment.Name {
case "GasPriceOracle":
......@@ -182,23 +191,23 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
// No arguments required for L2ToL1MessagePasser
_, tx, _, err = bindings.DeployL2ToL1MessagePasser(opts, backend)
case "SequencerFeeVault":
recipient, ok := deployment.Args[0].(common.Address)
if !ok {
return nil, fmt.Errorf("invalid type for recipient")
recipient, minimumWithdrawalAmount, withdrawalNetwork, err = prepareFeeVaultArguments(deployment)
if err != nil {
return nil, err
}
_, tx, _, err = bindings.DeploySequencerFeeVault(opts, backend, recipient)
_, tx, _, err = bindings.DeploySequencerFeeVault(opts, backend, recipient, minimumWithdrawalAmount, withdrawalNetwork)
case "BaseFeeVault":
recipient, ok := deployment.Args[0].(common.Address)
if !ok {
return nil, fmt.Errorf("invalid type for recipient")
recipient, minimumWithdrawalAmount, withdrawalNetwork, err = prepareFeeVaultArguments(deployment)
if err != nil {
return nil, err
}
_, tx, _, err = bindings.DeployBaseFeeVault(opts, backend, recipient)
_, tx, _, err = bindings.DeployBaseFeeVault(opts, backend, recipient, minimumWithdrawalAmount, withdrawalNetwork)
case "L1FeeVault":
recipient, ok := deployment.Args[0].(common.Address)
if !ok {
return nil, fmt.Errorf("invalid type for recipient")
recipient, minimumWithdrawalAmount, withdrawalNetwork, err = prepareFeeVaultArguments(deployment)
if err != nil {
return nil, err
}
_, tx, _, err = bindings.DeployL1FeeVault(opts, backend, recipient)
_, tx, _, err = bindings.DeployL1FeeVault(opts, backend, recipient, minimumWithdrawalAmount, withdrawalNetwork)
case "OptimismMintableERC20Factory":
_, tx, _, err = bindings.DeployOptimismMintableERC20Factory(opts, backend, predeploys.L2StandardBridgeAddr)
case "DeployerWhitelist":
......@@ -236,3 +245,19 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
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 (
"github.com/ethereum-optimism/optimism/op-chain-ops/immutables"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/stretchr/testify/require"
)
func TestBuildOptimism(t *testing.T) {
minimumWithdrawalAmountBig, _ := big.NewInt(0).SetString("8ac7230489e80000", 16)
minimumWithdrawalAmount := (*hexutil.Big)(minimumWithdrawalAmountBig)
results, err := immutables.BuildOptimism(immutables.ImmutableConfig{
"L2StandardBridge": {
"otherBridge": common.HexToAddress("0x1234567890123456789012345678901234567890"),
......@@ -27,12 +30,18 @@ func TestBuildOptimism(t *testing.T) {
},
"SequencerFeeVault": {
"recipient": common.HexToAddress("0x1234567890123456789012345678901234567890"),
"minimumWithdrawalAmount": minimumWithdrawalAmount,
"withdrawalNetwork": uint8(0),
},
"L1FeeVault": {
"recipient": common.HexToAddress("0x1234567890123456789012345678901234567890"),
"minimumWithdrawalAmount": minimumWithdrawalAmount,
"withdrawalNetwork": uint8(0),
},
"BaseFeeVault": {
"recipient": common.HexToAddress("0x1234567890123456789012345678901234567890"),
"minimumWithdrawalAmount": minimumWithdrawalAmount,
"withdrawalNetwork": uint8(0),
},
})
require.Nil(t, err)
......
......@@ -105,6 +105,12 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams {
SequencerFeeVaultRecipient: common.Address{19: 1},
BaseFeeVaultRecipient: common.Address{19: 2},
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,
EIP1559Denominator: 50,
......
......@@ -128,6 +128,12 @@ func DefaultSystemConfig(t *testing.T) SystemConfig {
SequencerFeeVaultRecipient: common.Address{19: 1},
BaseFeeVaultRecipient: common.Address{19: 2},
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,
......
......@@ -12,9 +12,15 @@ import { FeeVault } from "../universal/FeeVault.sol";
*/
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";
*/
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";
*/
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
......
......@@ -3,6 +3,7 @@ pragma solidity 0.8.15;
import { Bridge_Initializer } from "./CommonTest.t.sol";
import { FeeVault } from "../universal/FeeVault.sol";
import { L1FeeVault } from "../L2/L1FeeVault.sol";
import { BaseFeeVault } from "../L2/BaseFeeVault.sol";
import { StandardBridge } from "../universal/StandardBridge.sol";
......@@ -13,24 +14,31 @@ contract FeeVault_Test is Bridge_Initializer {
BaseFeeVault baseFeeVault = BaseFeeVault(payable(Predeploys.BASE_FEE_VAULT));
L1FeeVault l1FeeVault = L1FeeVault(payable(Predeploys.L1_FEE_VAULT));
address constant recipient = address(0x10000);
uint256 constant otherMinimumWithdrawalAmount = 10 ether;
function setUp() public override {
super.setUp();
vm.etch(Predeploys.BASE_FEE_VAULT, address(new BaseFeeVault(recipient)).code);
vm.etch(Predeploys.L1_FEE_VAULT, address(new L1FeeVault(recipient)).code);
vm.etch(
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.L1_FEE_VAULT, "L1FeeVault");
}
function test_constructor_succeeds() external {
assertEq(baseFeeVault.RECIPIENT(), recipient);
assertEq(l1FeeVault.RECIPIENT(), recipient);
}
function test_minWithdrawalAmount_succeeds() external {
assertEq(baseFeeVault.MIN_WITHDRAWAL_AMOUNT(), 10 ether);
assertEq(l1FeeVault.MIN_WITHDRAWAL_AMOUNT(), 10 ether);
assertEq(baseFeeVault.RECIPIENT(), alice);
assertEq(l1FeeVault.RECIPIENT(), bob);
assertEq(baseFeeVault.MIN_WITHDRAWAL_AMOUNT(), NON_ZERO_VALUE);
assertEq(l1FeeVault.MIN_WITHDRAWAL_AMOUNT(), otherMinimumWithdrawalAmount);
assertEq(uint8(baseFeeVault.WITHDRAWAL_NETWORK()), uint8(FeeVault.WithdrawalNetwork.L1));
assertEq(uint8(l1FeeVault.WITHDRAWAL_NETWORK()), uint8(FeeVault.WithdrawalNetwork.L2));
}
}
......@@ -3,6 +3,7 @@ pragma solidity 0.8.15;
import { Bridge_Initializer } from "./CommonTest.t.sol";
import { FeeVault } from "../universal/FeeVault.sol";
import { SequencerFeeVault } from "../L2/SequencerFeeVault.sol";
import { StandardBridge } from "../universal/StandardBridge.sol";
import { Predeploys } from "../libraries/Predeploys.sol";
......@@ -11,16 +12,25 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
SequencerFeeVault vault = SequencerFeeVault(payable(Predeploys.SEQUENCER_FEE_WALLET));
address constant recipient = address(256);
event Withdrawal(uint256 value, address to, address from);
event Withdrawal(
uint256 value,
address to,
address from,
FeeVault.WithdrawalNetwork withdrawalNetwork
);
function setUp() public override {
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");
}
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 {
......@@ -46,7 +56,7 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
vault.withdraw();
}
function test_withdraw_succeeds() external {
function test_withdraw_toL1_succeeds() external {
uint256 amount = vault.MIN_WITHDRAWAL_AMOUNT() + 1;
vm.deal(address(vault), amount);
......@@ -54,7 +64,12 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
assertEq(vault.totalProcessed(), 0);
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),
FeeVault.WithdrawalNetwork.L1
);
// The entire vault's balance is withdrawn
vm.expectCall(
......@@ -73,4 +88,33 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
// The withdrawal was successful
assertEq(vault.totalProcessed(), amount);
}
function test_withdraw_toL2_succeeds() external {
vm.etch(
Predeploys.SEQUENCER_FEE_WALLET,
address(new SequencerFeeVault(recipient, NON_ZERO_VALUE, FeeVault.WithdrawalNetwork.L2))
.code
);
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),
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);
}
}
......@@ -3,6 +3,7 @@ pragma solidity 0.8.15;
import { L2StandardBridge } from "../L2/L2StandardBridge.sol";
import { Predeploys } from "../libraries/Predeploys.sol";
import { SafeCall } from "../libraries/SafeCall.sol";
/**
* @title FeeVault
......@@ -11,13 +12,14 @@ import { Predeploys } from "../libraries/Predeploys.sol";
*/
abstract contract FeeVault {
/**
* @notice Emits each time that 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.
* @notice Enum representing where the FeeVault withdraws funds to.
* @custom:value L1 FeeVault withdraws funds to L1.
* @custom:value L2 FeeVault withdraws funds to L2.
*/
event Withdrawal(uint256 value, address to, address from);
enum WithdrawalNetwork {
L1,
L2
}
/**
* @notice Minimum balance before a withdrawal can be triggered.
......@@ -25,10 +27,15 @@ abstract contract FeeVault {
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;
/**
* @notice Network which the RECIPIENT will receive fees on.
*/
WithdrawalNetwork public immutable WITHDRAWAL_NETWORK;
/**
* @notice The minimum gas limit for the FeeVault withdrawal transaction.
*/
......@@ -40,12 +47,28 @@ abstract contract FeeVault {
uint256 public totalProcessed;
/**
* @param _recipient Wallet that will receive the fees on L1.
* @param _minWithdrawalAmount Minimum balance before a withdrawal can be triggered.
* @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) {
MIN_WITHDRAWAL_AMOUNT = _minWithdrawalAmount;
constructor(
address _recipient,
uint256 _minWithdrawalAmount,
WithdrawalNetwork _withdrawalNetwork
) {
RECIPIENT = _recipient;
MIN_WITHDRAWAL_AMOUNT = _minWithdrawalAmount;
WITHDRAWAL_NETWORK = _withdrawalNetwork;
}
/**
......@@ -54,7 +77,7 @@ abstract contract FeeVault {
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 {
require(
......@@ -65,12 +88,16 @@ abstract contract FeeVault {
uint256 value = address(this).balance;
totalProcessed += value;
emit Withdrawal(value, RECIPIENT, msg.sender);
emit Withdrawal(value, RECIPIENT, msg.sender, WITHDRAWAL_NETWORK);
if (WITHDRAWAL_NETWORK == WithdrawalNetwork.L2) {
SafeCall.call(RECIPIENT, gasleft(), value, bytes(""));
} else {
L2StandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE)).bridgeETHTo{ value: value }(
RECIPIENT,
WITHDRAWAL_MIN_GAS,
bytes("")
);
}
}
}
......@@ -18,6 +18,12 @@
"baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"proxyAdminOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"finalSystemOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"portalGuardian": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
......
......@@ -29,9 +29,16 @@
"finalizationPeriodSeconds": 12,
"proxyAdminOwner": "ADMIN",
"baseFeeVaultRecipient": "ADMIN",
"l1FeeVaultRecipient": "ADMIN",
"sequencerFeeVaultRecipient": "ADMIN",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000,
......
......@@ -32,6 +32,12 @@
"baseFeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"l1FeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"sequencerFeeVaultRecipient": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000,
......
......@@ -23,6 +23,12 @@
"baseFeeVaultRecipient": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"governanceTokenName": "Optimism",
"governanceTokenSymbol": "OP",
"governanceTokenOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
......
......@@ -29,6 +29,12 @@ const config: DeployConfig = {
baseFeeVaultRecipient: '0x90F79bf6EB2c4f870365E785982E1f101E93b906',
l1FeeVaultRecipient: '0x90F79bf6EB2c4f870365E785982E1f101E93b906',
sequencerFeeVaultRecipient: '0x90F79bf6EB2c4f870365E785982E1f101E93b906',
baseFeeVaultMinimumWithdrawalAmount: '0x8ac7230489e80000',
l1FeeVaultMinimumWithdrawalAmount: '0x8ac7230489e80000',
sequencerFeeVaultMinimumWithdrawalAmount: '0x8ac7230489e80000',
baseFeeVaultWithdrawalNetwork: 0,
l1FeeVaultWithdrawalNetwork: 0,
sequencerFeeVaultWithdrawalNetwork: 0,
governanceTokenName: 'Optimism',
governanceTokenSymbol: 'OP',
......
......@@ -22,6 +22,12 @@
"baseFeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa",
"l1FeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa",
"sequencerFeeVaultRecipient": "0xa3d596EAfaB6B13Ab18D40FaE1A962700C84ADEa",
"baseFeeVaultMinimumWithdrawalAmount": '0x8ac7230489e80000',
"l1FeeVaultMinimumWithdrawalAmount": '0x8ac7230489e80000',
"sequencerFeeVaultMinimumWithdrawalAmount": '0x8ac7230489e80000',
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"governanceTokenName": "Optimism",
"governanceTokenSymbol": "OP",
"governanceTokenOwner": "0x5C4e7Ba1E219E47948e6e3F55019A647bA501005",
......
......@@ -13,17 +13,38 @@ const deployFn: DeployFunction = async (hre) => {
if (sequencerFeeVaultRecipient === ethers.constants.AddressZero) {
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({
hre,
name: 'SequencerFeeVault',
args: [sequencerFeeVaultRecipient],
args: [
sequencerFeeVaultRecipient,
sequencerFeeVaultMinimumWithdrawalAmount,
sequencerFeeVaultWithdrawalNetwork,
],
postDeployAction: async (contract) => {
await assertContractVariable(
contract,
'RECIPIENT',
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) => {
if (baseFeeVaultRecipient === ethers.constants.AddressZero) {
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({
hre,
name: 'BaseFeeVault',
args: [baseFeeVaultRecipient],
args: [
baseFeeVaultRecipient,
baseFeeVaultMinimumWithdrawalAmount,
baseFeeVaultWithdrawalNetwork,
],
postDeployAction: async (contract) => {
await assertContractVariable(
contract,
'RECIPIENT',
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) => {
if (l1FeeVaultRecipient === ethers.constants.AddressZero) {
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({
hre,
name: 'L1FeeVault',
args: [l1FeeVaultRecipient],
args: [
l1FeeVaultRecipient,
l1FeeVaultMinimumWithdrawalAmount,
l1FeeVaultWithdrawalNetwork,
],
postDeployAction: async (contract) => {
await assertContractVariable(
contract,
'RECIPIENT',
ethers.utils.getAddress(l1FeeVaultRecipient)
)
await assertContractVariable(
contract,
'MIN_WITHDRAWAL_AMOUNT',
l1FeeVaultMinimumWithdrawalAmount
)
await assertContractVariable(
contract,
'WITHDRAWAL_NETWORK',
l1FeeVaultWithdrawalNetwork
)
},
})
}
......
......@@ -136,19 +136,49 @@ interface RequiredDeployConfig {
proxyAdminOwner: string
/**
* L1 address which receives the base fee for the L2 network.
* L1 or L2 address which receives the base fee for the L2 network.
*/
baseFeeVaultRecipient: string
/**
* L1 address which receives data fees for the L2 network.
* L1 or L2 address which receives data fees for the L2 network.
*/
l1FeeVaultRecipient: string
/**
* L1 address which receives tip fees for the L2 network.
* L1 or L2 address which receives tip fees for the L2 network.
*/
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: {
sequencerFeeVaultRecipient: {
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: {
type: 'address',
default: ethers.constants.AddressZero,
......
......@@ -392,7 +392,7 @@ const check = {
signer
)
await assertSemver(SequencerFeeVault, 'SequencerFeeVault', '1.1.0')
await assertSemver(SequencerFeeVault, 'SequencerFeeVault', '1.2.0')
const RECIPIENT = await SequencerFeeVault.RECIPIENT()
assert(RECIPIENT !== hre.ethers.constants.AddressZero)
......@@ -406,6 +406,10 @@ const check = {
await SequencerFeeVault.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 assertProxy(hre, 'SequencerFeeVault', signer.provider)
},
......@@ -635,7 +639,7 @@ const check = {
signer
)
await assertSemver(BaseFeeVault, 'BaseFeeVault', '1.1.0')
await assertSemver(BaseFeeVault, 'BaseFeeVault', '1.2.0')
const MIN_WITHDRAWAL_AMOUNT = await BaseFeeVault.MIN_WITHDRAWAL_AMOUNT()
console.log(` - MIN_WITHDRAWAL_AMOUNT: ${MIN_WITHDRAWAL_AMOUNT}`)
......@@ -644,6 +648,10 @@ const check = {
assert(RECIPIENT !== hre.ethers.constants.AddressZero)
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 assertProxy(hre, 'BaseFeeVault', signer.provider)
},
......@@ -658,7 +666,7 @@ const check = {
signer
)
await assertSemver(L1FeeVault, 'L1FeeVault', '1.1.0')
await assertSemver(L1FeeVault, 'L1FeeVault', '1.2.0')
const MIN_WITHDRAWAL_AMOUNT = await L1FeeVault.MIN_WITHDRAWAL_AMOUNT()
console.log(` - MIN_WITHDRAWAL_AMOUNT: ${MIN_WITHDRAWAL_AMOUNT}`)
......@@ -667,6 +675,10 @@ const check = {
assert(RECIPIENT !== hre.ethers.constants.AddressZero)
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 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