Skip to content

Commit

Permalink
Ensure swaps don't use withdrawal queue liquidity (#23)
Browse files Browse the repository at this point in the history
* Ensure swaps don't use WETH reserved for the withdrawal queue

* Fund the withdrawal queue when WETH is swapped into the ARM

* More refactoring of MultiLP
deposit and swap not longer add to the withdrawal queue. Its only need on claim

* Refactor withdrawal queue storage to optimize swap gas usage

* Generated latest contract diagrams

* Removed _postClaimHook as it's no longer needed

* Added more Natspec

* Add more Natspec

* Changed the _postWithdrawHook to _postRequestRedeemHook

* Generated latest contract diagrams

* Minor change to constructor param
  • Loading branch information
naddison36 authored Sep 25, 2024
1 parent 4c58acd commit ad1445d
Show file tree
Hide file tree
Showing 13 changed files with 272 additions and 244 deletions.
32 changes: 16 additions & 16 deletions docs/LidoFixedPriceMultiLpARMHierarchy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
142 changes: 73 additions & 69 deletions docs/LidoFixedPriceMultiLpARMSquashed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 28 additions & 28 deletions docs/OEthARMHierarchy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 34 additions & 32 deletions docs/OEthARMSquashed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/contracts/AbstractARM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,14 @@ abstract contract AbstractARM is OwnableOperable {
function _inDeadline(uint256 deadline) internal view {
require(deadline >= block.timestamp, "ARM: Deadline expired");
}

/// @dev Hook to transfer assets out of the ARM contract
function _transferAsset(address asset, address to, uint256 amount) internal virtual {
IERC20(asset).transfer(to, amount);
}

/// @dev Hook to transfer assets into the ARM contract
function _transferAssetFrom(address asset, address from, address to, uint256 amount) internal virtual {
IERC20(asset).transferFrom(from, to, amount);
}
}
Loading

0 comments on commit ad1445d

Please sign in to comment.