From c88e741b8761b9a63dea705938038ad1970754bb Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Wed, 9 Oct 2024 20:30:52 +1100 Subject: [PATCH 1/2] Generated latest LidoARM contract diagram --- docs/LidoARMSquashed.svg | 107 +++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/docs/LidoARMSquashed.svg b/docs/LidoARMSquashed.svg index cac20f2..86977a5 100644 --- a/docs/LidoARMSquashed.svg +++ b/docs/LidoARMSquashed.svg @@ -4,63 +4,62 @@ - - + + UmlClassDiagram - + 15 - -LidoARM -../src/contracts/LidoARM.sol - -Private: -   _gap: uint256[49] <<OwnableOperable>> -   _gap: uint256[43] <<AbstractARM>> -Internal: -   OWNER_SLOT: bytes32 <<Ownable>> -   MIN_TOTAL_SUPPLY: uint256 <<AbstractARM>> -   DEAD_ACCOUNT: address <<AbstractARM>> -Public: -   operator: address <<OwnableOperable>> -   MAX_PRICE_DEVIATION: uint256 <<AbstractARM>> -   PRICE_SCALE: uint256 <<AbstractARM>> -   FEE_SCALE: uint256 <<AbstractARM>> -   liquidityAsset: address <<AbstractARM>> -   token0: IERC20 <<AbstractARM>> -   token1: IERC20 <<AbstractARM>> -   claimDelay: uint256 <<AbstractARM>> -   traderate0: uint256 <<AbstractARM>> -   traderate1: uint256 <<AbstractARM>> -   crossPrice: uint256 <<AbstractARM>> -   withdrawsQueued: uint120 <<AbstractARM>> -   withdrawsClaimed: uint120 <<AbstractARM>> -   nextWithdrawalIndex: uint16 <<AbstractARM>> -   withdrawalRequests: mapping(uint256=>WithdrawalRequest) <<AbstractARM>> -   fee: uint16 <<AbstractARM>> -   lastAvailableAssets: int128 <<AbstractARM>> -   feeCollector: address <<AbstractARM>> -   capManager: address <<AbstractARM>> -   steth: IERC20 <<LidoARM>> -   weth: IWETH <<LidoARM>> -   withdrawalQueue: IStETHWithdrawal <<LidoARM>> -   lidoWithdrawalQueueAmount: uint256 <<LidoARM>> - -Internal: -    _owner(): (ownerOut: address) <<Ownable>> -    _setOwner(newOwner: address) <<Ownable>> -    _onlyOwner() <<Ownable>> -    _initOwnableOperable(_operator: address) <<OwnableOperable>> -    _setOperator(newOperator: address) <<OwnableOperable>> -    _initARM(_operator: address, _name: string, _symbol: string, _fee: uint256, _feeCollector: address, _capManager: address) <<AbstractARM>> -    _inDeadline(deadline: uint256) <<AbstractARM>> -    _transferAsset(asset: address, to: address, amount: uint256) <<LidoARM>> -    _transferAssetFrom(asset: address, from: address, to: address, amount: uint256) <<AbstractARM>> -    _swapExactTokensForTokens(inToken: IERC20, outToken: IERC20, amountIn: uint256, to: address): (amountOut: uint256) <<AbstractARM>> -    _swapTokensForExactTokens(inToken: IERC20, outToken: IERC20, amountOut: uint256, to: address): (amountIn: uint256) <<AbstractARM>> -    _setTraderates(_baseToTokenRate: uint256, _tokenToBaseRate: uint256) <<AbstractARM>> + +LidoARM +../src/contracts/LidoARM.sol + +Private: +   _gap: uint256[49] <<OwnableOperable>> +   _gap: uint256[43] <<AbstractARM>> +Internal: +   OWNER_SLOT: bytes32 <<Ownable>> +   MIN_TOTAL_SUPPLY: uint256 <<AbstractARM>> +   DEAD_ACCOUNT: address <<AbstractARM>> +Public: +   operator: address <<OwnableOperable>> +   MAX_CROSS_PRICE_DEVIATION: uint256 <<AbstractARM>> +   PRICE_SCALE: uint256 <<AbstractARM>> +   FEE_SCALE: uint256 <<AbstractARM>> +   liquidityAsset: address <<AbstractARM>> +   token0: IERC20 <<AbstractARM>> +   token1: IERC20 <<AbstractARM>> +   claimDelay: uint256 <<AbstractARM>> +   traderate0: uint256 <<AbstractARM>> +   traderate1: uint256 <<AbstractARM>> +   crossPrice: uint256 <<AbstractARM>> +   withdrawsQueued: uint120 <<AbstractARM>> +   withdrawsClaimed: uint120 <<AbstractARM>> +   nextWithdrawalIndex: uint16 <<AbstractARM>> +   withdrawalRequests: mapping(uint256=>WithdrawalRequest) <<AbstractARM>> +   fee: uint16 <<AbstractARM>> +   lastAvailableAssets: int128 <<AbstractARM>> +   feeCollector: address <<AbstractARM>> +   capManager: address <<AbstractARM>> +   steth: IERC20 <<LidoARM>> +   weth: IWETH <<LidoARM>> +   withdrawalQueue: IStETHWithdrawal <<LidoARM>> +   lidoWithdrawalQueueAmount: uint256 <<LidoARM>> + +Internal: +    _owner(): (ownerOut: address) <<Ownable>> +    _setOwner(newOwner: address) <<Ownable>> +    _onlyOwner() <<Ownable>> +    _initOwnableOperable(_operator: address) <<OwnableOperable>> +    _setOperator(newOperator: address) <<OwnableOperable>> +    _initARM(_operator: address, _name: string, _symbol: string, _fee: uint256, _feeCollector: address, _capManager: address) <<AbstractARM>> +    _inDeadline(deadline: uint256) <<AbstractARM>> +    _transferAsset(asset: address, to: address, amount: uint256) <<LidoARM>> +    _transferAssetFrom(asset: address, from: address, to: address, amount: uint256) <<AbstractARM>> +    _swapExactTokensForTokens(inToken: IERC20, outToken: IERC20, amountIn: uint256, to: address): (amountOut: uint256) <<AbstractARM>> +    _swapTokensForExactTokens(inToken: IERC20, outToken: IERC20, amountOut: uint256, to: address): (amountIn: uint256) <<AbstractARM>>    _requireLiquidityAvailable(amount: uint256) <<AbstractARM>>    _availableAssets(): uint256 <<AbstractARM>>    _externalWithdrawQueue(): uint256 <<LidoARM>> @@ -77,7 +76,7 @@    swapTokensForExactTokens(inToken: IERC20, outToken: IERC20, amountOut: uint256, amountInMax: uint256, to: address) <<AbstractARM>>    swapTokensForExactTokens(amountOut: uint256, amountInMax: uint256, path: address[], to: address, deadline: uint256): (amounts: uint256[]) <<AbstractARM>>    setPrices(buyT1: uint256, sellT1: uint256) <<onlyOperatorOrOwner>> <<AbstractARM>> -    setCrossPrice(_crossPrice: uint256) <<onlyOwner>> <<AbstractARM>> +    setCrossPrice(newCrossPrice: uint256) <<onlyOwner>> <<AbstractARM>>    previewDeposit(assets: uint256): (shares: uint256) <<AbstractARM>>    deposit(assets: uint256): (shares: uint256) <<AbstractARM>>    previewRedeem(shares: uint256): (assets: uint256) <<AbstractARM>> From 711ba467dc9a8cfc1d3941ba655d3992a056065c Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Wed, 9 Oct 2024 20:41:43 +1100 Subject: [PATCH 2/2] Updated Natspec --- src/contracts/AbstractARM.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contracts/AbstractARM.sol b/src/contracts/AbstractARM.sol index 245613a..899509a 100644 --- a/src/contracts/AbstractARM.sol +++ b/src/contracts/AbstractARM.sol @@ -65,7 +65,7 @@ abstract contract AbstractARM is OwnableOperable, ERC20Upgradeable { * Rate is to 36 decimals (1e36). */ uint256 public traderate1; - + /// @notice The price that buy and sell prices can not cross scaled to 36 decimals. uint256 public crossPrice; /// @notice cumulative total of all withdrawal requests included the ones that have already been claimed @@ -101,7 +101,7 @@ abstract contract AbstractARM is OwnableOperable, ERC20Upgradeable { int128 public lastAvailableAssets; /// @notice The account that can collect the performance fee address public feeCollector; - + /// @notice The address of the CapManager contract used to manage the ARM's liquidity provider and total assets caps address public capManager; uint256[43] private _gap;