Skip to content

Commit f39beff

Browse files
committed
Merge remote-tracking branch 'origin/nicka/oz-audit-fixes-oeth-withdrawal-queue' into nicka/oz-audit-oeth-withdrawal-queue-N-08
2 parents 84fdd11 + afb03d8 commit f39beff

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

contracts/contracts/vault/OETHVaultCore.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ contract OETHVaultCore is VaultCore {
1818
using SafeERC20 for IERC20;
1919
using StableMath for uint256;
2020

21-
uint256 constant CLAIM_DELAY = 10 minutes;
21+
uint256 public constant CLAIM_DELAY = 10 minutes;
2222
address public immutable weth;
2323
uint256 public wethAssetIndex;
2424

@@ -158,12 +158,12 @@ contract OETHVaultCore is VaultCore {
158158
* The OETH is burned on request and the WETH is transferred to the withdrawer on claim.
159159
* This request can be claimed once the withdrawal queue's `claimable` amount
160160
* is greater than or equal this request's `queued` amount.
161-
* There is no minimum time or block number before a request can be claimed. It just needs
161+
* There is a minimum of 10 minutes before a request can be claimed. After that, the request just needs
162162
* enough WETH liquidity in the Vault to satisfy all the outstanding requests to that point in the queue.
163163
* OETH is converted to WETH at 1:1.
164164
* @param _amount Amount of OETH to burn.
165-
* @param requestId Unique ID for the withdrawal request
166-
* @param queued Cumulative total of all WETH queued including already claimed requests.
165+
* @return requestId Unique ID for the withdrawal request
166+
* @return queued Cumulative total of all WETH queued including already claimed requests.
167167
*/
168168
function requestWithdrawal(uint256 _amount)
169169
external
@@ -252,7 +252,7 @@ contract OETHVaultCore is VaultCore {
252252
* @return amounts Amount of WETH received for each request
253253
* @return totalAmount Total amount of WETH transferred to the withdrawer
254254
*/
255-
function claimWithdrawals(uint256[] memory _requestIds)
255+
function claimWithdrawals(uint256[] calldata _requestIds)
256256
external
257257
whenNotCapitalPaused
258258
nonReentrant
@@ -383,7 +383,7 @@ contract OETHVaultCore is VaultCore {
383383

384384
/// @dev Get the balance of an asset held in Vault and all strategies
385385
/// less any WETH that is reserved for the withdrawal queue.
386-
/// This will only return a non-zero balance for WETH.
386+
/// WETH is the only asset that can return a non-zero balance.
387387
/// All other assets will return 0 even if there is some dust amounts left in the Vault.
388388
/// For example, there is 1 wei left of stETH in the OETH Vault but will return 0 in this function.
389389
///

contracts/contracts/vault/VaultAdmin.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ contract VaultAdmin is VaultStorage {
205205
bytes calldata _data
206206
) internal virtual returns (uint256 toAssetAmount) {
207207
// Check fromAsset and toAsset are valid
208-
Asset memory fromAssetConfig = assets[address(_fromAsset)];
208+
Asset memory fromAssetConfig = assets[_fromAsset];
209209
Asset memory toAssetConfig = assets[_toAsset];
210210
require(fromAssetConfig.isSupported, "From asset is not supported");
211211
require(toAssetConfig.isSupported, "To asset is not supported");

0 commit comments

Comments
 (0)