From 81d73445a3e17d88ecbb659c61006c9fef5c168c Mon Sep 17 00:00:00 2001 From: Flux <175354924+0xiamflux@users.noreply.github.com> Date: Mon, 15 Sep 2025 12:49:08 -0400 Subject: [PATCH 1/3] feat: add initial iteration of fees depositor --- specs/protocol/jovian/fees-depositor.md | 93 +++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 specs/protocol/jovian/fees-depositor.md diff --git a/specs/protocol/jovian/fees-depositor.md b/specs/protocol/jovian/fees-depositor.md new file mode 100644 index 000000000..7d58a5932 --- /dev/null +++ b/specs/protocol/jovian/fees-depositor.md @@ -0,0 +1,93 @@ +# FeesDepositor + + + + +- [Summary](#summary) +- [Functions](#functions) + - [`receive`](#receive) + - [`setMinDepositAmount`](#setmindepositamount) + - [`setRecipient`](#setrecipient) +- [Events](#events) + - [`DepositInitiated`](#depositinitiated) + - [`MinDepositAmountUpdated`](#mindepositamountupdated) + - [`RecipientUpdated`](#recipientupdated) + - [`FundsReceived`](#fundsreceived) + + + +## Summary + +An optional periphery contract on L1 that acts as a recipient of the fees sent by the `L1Withdrawer` contract on L2. Its purpose is to perform a deposit transaction to OP Mainnet with those fees via the `OptimismPortal` once it has received enough funds. + +## Functions + +### `receive` + +Initiates the deposit transaction process to OP Mainnet if and only if the contract holds funds equal to or above the `minDepositAmount` threshold. + +```solidity +receive() external payable +``` + +- MUST initiate a deposit transaction to the recipient on OP Mainnet if the `minDepositAmount` threshold is reached. +- MUST emit the `FundsReceived` event with the sender, amount received, and the current balance of the contract. +- MUST emit the `DepositInitiated` event only if the threshold is reached. + +### `setMinDepositAmount` + +Updates the minimum deposit amount the contract must hold before the deposit process can be initiated. + +```solidity +function setMinDepositAmount(uint256 _newMinDepositAmount) external +``` + +- MUST only be callable by `ProxyAdmin.owner()`. +- MUST emit the `MinDepositAmountUpdated` event. +- MUST update the `minDepositAmount` storage variable. + +### `setRecipient` + +Updates the address that will receive the funds on OP Mainnet during the deposit process. + +```solidity +function setRecipient(address _newRecipient) external +``` + +- MUST only be callable by `ProxyAdmin.owner()`. +- MUST emit the `RecipientUpdated` event. +- MUST update the `recipient` storage variable. + +## Events + +### `DepositInitiated` + +Emitted when a deposit to OP Mainnet is initiated. + +```solidity +event DepositInitiated(address indexed recipient, uint256 amount) +``` + +### `MinDepositAmountUpdated` + +Emitted when the minimum deposit amount before the deposit process can be initiated is updated. + +```solidity +event MinDepositAmountUpdated(uint256 oldMinDepositAmount, uint256 newMinDepositAmount) +``` + +### `RecipientUpdated` + +Emitted when the recipient of the funds on OP Mainnet is updated. + +```solidity +event RecipientUpdated(address oldRecipient, address newRecipient) +``` + +### `FundsReceived` + +Emitted whenever funds are received. + +```solidity +event FundsReceived(address indexed sender, uint256 amount, uint256 newBalance) +``` From b9c85f92021daa8b975bc765172984425dd8d38b Mon Sep 17 00:00:00 2001 From: Flux <175354924+0xiamflux@users.noreply.github.com> Date: Mon, 15 Sep 2025 14:19:02 -0400 Subject: [PATCH 2/3] chore: add missing setGasLimit --- specs/protocol/jovian/fees-depositor.md | 44 ++++++++++++++++++------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/specs/protocol/jovian/fees-depositor.md b/specs/protocol/jovian/fees-depositor.md index 7d58a5932..0252a748b 100644 --- a/specs/protocol/jovian/fees-depositor.md +++ b/specs/protocol/jovian/fees-depositor.md @@ -7,12 +7,14 @@ - [Functions](#functions) - [`receive`](#receive) - [`setMinDepositAmount`](#setmindepositamount) - - [`setRecipient`](#setrecipient) + - [`setL2Recipient`](#setl2recipient) + - [`setGasLimit`](#setgaslimit) - [Events](#events) - - [`DepositInitiated`](#depositinitiated) + - [`FeesDeposited`](#feesdeposited) - [`MinDepositAmountUpdated`](#mindepositamountupdated) - - [`RecipientUpdated`](#recipientupdated) + - [`L2RecipientUpdated`](#l2recipientupdated) - [`FundsReceived`](#fundsreceived) + - [`GasLimitUpdated`](#gaslimitupdated) @@ -32,7 +34,7 @@ receive() external payable - MUST initiate a deposit transaction to the recipient on OP Mainnet if the `minDepositAmount` threshold is reached. - MUST emit the `FundsReceived` event with the sender, amount received, and the current balance of the contract. -- MUST emit the `DepositInitiated` event only if the threshold is reached. +- MUST emit the `FeesDeposited` event only if the threshold is reached. ### `setMinDepositAmount` @@ -46,26 +48,38 @@ function setMinDepositAmount(uint256 _newMinDepositAmount) external - MUST emit the `MinDepositAmountUpdated` event. - MUST update the `minDepositAmount` storage variable. -### `setRecipient` +### `setL2Recipient` Updates the address that will receive the funds on OP Mainnet during the deposit process. ```solidity -function setRecipient(address _newRecipient) external +function setL2Recipient(address _newRecipient) external ``` - MUST only be callable by `ProxyAdmin.owner()`. - MUST emit the `RecipientUpdated` event. -- MUST update the `recipient` storage variable. +- MUST update the `l2Recipient` storage variable. + +### `setGasLimit` + +Updates the gas limit used for the deposit transaction during the fees deposit process. + +```solidity +function setGasLimit(uint64 _gasLimit) external +``` + +- MUST only be callable by `ProxyAdmin.owner()`. +- MUST emit the `GasLimitUpdated` event. +- MUST update the `gasLimit` storage variable. ## Events -### `DepositInitiated` +### `FeesDeposited` Emitted when a deposit to OP Mainnet is initiated. ```solidity -event DepositInitiated(address indexed recipient, uint256 amount) +event FeesDeposited(address indexed recipient, uint256 amount) ``` ### `MinDepositAmountUpdated` @@ -76,12 +90,12 @@ Emitted when the minimum deposit amount before the deposit process can be initia event MinDepositAmountUpdated(uint256 oldMinDepositAmount, uint256 newMinDepositAmount) ``` -### `RecipientUpdated` +### `L2RecipientUpdated` Emitted when the recipient of the funds on OP Mainnet is updated. ```solidity -event RecipientUpdated(address oldRecipient, address newRecipient) +event L2RecipientUpdated(address oldL2Recipient, address newL2Recipient) ``` ### `FundsReceived` @@ -91,3 +105,11 @@ Emitted whenever funds are received. ```solidity event FundsReceived(address indexed sender, uint256 amount, uint256 newBalance) ``` + +### `GasLimitUpdated` + +Emitted when the gas limit for the deposit transaction is updated. + +```solidity +event GasLimitUpdated(uint64 oldGasLimit, uint64 newGasLimit) +``` From 5b91e8d2f8d8161b1312586618db378a41b897f3 Mon Sep 17 00:00:00 2001 From: Flux <175354924+0xiamflux@users.noreply.github.com> Date: Wed, 17 Sep 2025 10:53:28 -0400 Subject: [PATCH 3/3] feat: add clarification on owner and proxy --- specs/protocol/jovian/fees-depositor.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/specs/protocol/jovian/fees-depositor.md b/specs/protocol/jovian/fees-depositor.md index 0252a748b..68da68cb5 100644 --- a/specs/protocol/jovian/fees-depositor.md +++ b/specs/protocol/jovian/fees-depositor.md @@ -20,7 +20,9 @@ ## Summary -An optional periphery contract on L1 that acts as a recipient of the fees sent by the `L1Withdrawer` contract on L2. Its purpose is to perform a deposit transaction to OP Mainnet with those fees via the `OptimismPortal` once it has received enough funds. +A periphery contract on L1 that acts as a recipient of fees sent by the `L1Withdrawer` contract on L2. Its purpose is to perform a deposit transaction to OP Mainnet with those fees via the `OptimismPortal` once it has received sufficient funds. + +It's a proxied contract with the owner of the `ProxyAdmin` as the address allowed to call the setter functions. ## Functions