{ "language": "Solidity", "sources": { "contracts/contract/vault/LSDLIDOVault.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.9;\n\nimport \"../LSDBase.sol\";\nimport \"../../interface/vault/ILSDLIDOVault.sol\";\nimport \"../../interface/utils/lido/ILido.sol\";\nimport \"../../interface/ILSDVaultWithdrawer.sol\";\n\nimport \"../../interface/utils/uniswap/IUniswapV2Router02.sol\";\n\ncontract LSDLIDOVault is LSDBase, ILSDLIDOVault {\n // Events\n event EtherDeposited(string indexed by, uint256 amount, uint256 time);\n event EtherWithdrawn(string indexed by, uint256 amount, uint256 time);\n\n // Construct\n constructor(ILSDStorage _lsdStorageAddress) LSDBase(_lsdStorageAddress) {\n // Version\n version = 1;\n }\n\n // Accept an ETH deposit from a LSD contract\n // Only accepts calls from LSD contracts.\n function depositEther()\n public\n payable\n override\n onlyLSDContract(\"lsdDepositPool\", msg.sender)\n {\n // Valid amount?\n require(msg.value > 0, \"No valid amount of ETH given to deposit\");\n // Emit ether deposited event\n emit EtherDeposited(\"LSDDepositPool\", msg.value, block.timestamp);\n processDeposit();\n }\n\n function processDeposit() private {\n ILido lido = ILido(getContractAddress(\"lido\"));\n lido.submit{value: msg.value}(address(this));\n }\n\n function getStETHBalance() public view override returns (uint256) {\n ILido lido = ILido(getContractAddress(\"lido\"));\n return lido.balanceOf(address(this));\n }\n\n function getSharesOfStETH(\n uint256 _ethAmount\n ) public view override returns (uint256) {\n ILido lido = ILido(getContractAddress(\"lido\"));\n return lido.getSharesByPooledEth(_ethAmount);\n }\n\n function withdrawEther(\n uint256 _ethAmount\n ) public override onlyLSDContract(\"lsdDepositPool\", msg.sender) {\n // Calls Uniswap Functions\n IUniswapV2Router02 uniswapRouter = IUniswapV2Router02(\n getContractAddress(\"uniswapRouter\")\n );\n\n address[] memory path;\n path = new address[](2);\n path[0] = getContractAddress(\"lido\");\n path[1] = getContractAddress(\"weth\");\n\n uint256[] memory amounts = uniswapRouter.getAmountsIn(_ethAmount, path);\n\n ILido lido = ILido(getContractAddress(\"lido\"));\n lido.approve(getContractAddress(\"uniswapRouter\"), getStETHBalance());\n\n require(amounts[0] <= getStETHBalance(), \"Invalid Exchange\");\n\n uniswapRouter.swapExactTokensForETH(\n amounts[0],\n 0,\n path,\n address(this),\n block.timestamp + 40\n );\n\n // Withdraw\n ILSDVaultWithdrawer withdrawer = ILSDVaultWithdrawer(msg.sender);\n withdrawer.receiveVaultWithdrawalETH{value: address(this).balance}();\n // Emit ether withdrawn event\n emit EtherWithdrawn(\"LSDDepositPool\", _ethAmount, block.timestamp);\n }\n receive() external payable {}\n}\n" }, "contracts/interface/utils/uniswap/IUniswapV2Router02.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >=0.6.2;\n\nimport './IUniswapV2Router01.sol';\n\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\n function removeLiquidityETHSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountETH);\n function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountETH);\n\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external payable;\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n}" }, "contracts/interface/ILSDVaultWithdrawer.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.9;\n\ninterface ILSDVaultWithdrawer {\n function receiveVaultWithdrawalETH() external payable;\n}\n\n" }, "contracts/interface/utils/lido/ILido.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.9;\n\n/**\n * @title Liquid staking pool\n *\n * For the high-level description of the pool operation please refer to the paper.\n * Pool manages withdrawal keys and fees. It receives ether submitted by users on the ETH 1 side\n * and stakes it via the deposit_contract.sol contract. It doesn't hold ether on it's balance,\n * only a small portion (buffer) of it.\n * It also mints new tokens for rewards generated at the ETH 2.0 side.\n *\n * At the moment withdrawals are not possible in the beacon chain and there's no workaround.\n * Pool will be upgraded to an actual implementation when withdrawals are enabled\n * (Phase 1.5 or 2 of Eth2 launch, likely late 2022 or 2023).\n */\ninterface ILido {\n function name() external pure returns (string memory);\n\n function symbol() external pure returns (string memory);\n\n function decimals() external pure returns (string memory);\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address _account) external view returns (uint256);\n\n function transfer(address _recipient, uint256 _amount)\n external\n returns (bool);\n\n function allowance(address _owner, address _spender)\n external\n view\n returns (uint256);\n\n function approve(address _spender, uint256 _amount) external returns (bool);\n\n function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) external returns (bool);\n\n function increaseAllowance(address _spender, uint256 _addedValue)\n external\n returns (bool);\n\n function decreaseAllowance(address _spender, uint256 _subtractedValue)\n external\n returns (bool);\n\n function getTotalShares() external view returns (uint256);\n\n function sharesOf(address _account) external view returns (uint256);\n\n function getSharesByPooledEth(uint256 _ethAmount)\n external\n view\n returns (uint256);\n\n function getPooledEthByShares(uint256 _sharesAmount)\n external\n view\n returns (uint256);\n\n function transferShares(address _recipient, uint256 _sharesAmount)\n external\n returns (uint256);\n\n /**\n * @notice Stop pool routine operations\n */\n function stop() external;\n\n /**\n * @notice Resume pool routine operations\n */\n function resume() external;\n\n /**\n * @notice Stops accepting new Ether to the protocol\n *\n * @dev While accepting new Ether is stopped, calls to the `submit` function,\n * as well as to the default payable function, will revert.\n *\n * Emits `StakingPaused` event.\n */\n function pauseStaking() external;\n\n /**\n * @notice Resumes accepting new Ether to the protocol (if `pauseStaking` was called previously)\n * NB: Staking could be rate-limited by imposing a limit on the stake amount\n * at each moment in time, see `setStakingLimit()` and `removeStakingLimit()`\n *\n * @dev Preserves staking limit if it was set previously\n *\n * Emits `StakingResumed` event\n */\n function resumeStaking() external;\n\n /**\n * @notice Sets the staking rate limit\n *\n * @dev Reverts if:\n * - `_maxStakeLimit` == 0\n * - `_maxStakeLimit` >= 2^96\n * - `_maxStakeLimit` < `_stakeLimitIncreasePerBlock`\n * - `_maxStakeLimit` / `_stakeLimitIncreasePerBlock` >= 2^32 (only if `_stakeLimitIncreasePerBlock` != 0)\n *\n * Emits `StakingLimitSet` event\n *\n * @param _maxStakeLimit max stake limit value\n * @param _stakeLimitIncreasePerBlock stake limit increase per single block\n */\n function setStakingLimit(\n uint256 _maxStakeLimit,\n uint256 _stakeLimitIncreasePerBlock\n ) external;\n\n /**\n * @notice Removes the staking rate limit\n *\n * Emits `StakingLimitRemoved` event\n */\n function removeStakingLimit() external;\n\n /**\n * @notice Check staking state: whether it's paused or not\n */\n function isStakingPaused() external view returns (bool);\n\n /**\n * @notice Returns how much Ether can be staked in the current block\n * @dev Special return values:\n * - 2^256 - 1 if staking is unlimited;\n * - 0 if staking is paused or if limit is exhausted.\n */\n function getCurrentStakeLimit() external view returns (uint256);\n\n /**\n * @notice Returns full info about current stake limit params and state\n * @dev Might be used for the advanced integration requests.\n * @return isStakingPaused staking pause state (equivalent to return of isStakingPaused())\n * @return isStakingLimitSet whether the stake limit is set\n * @return currentStakeLimit current stake limit (equivalent to return of getCurrentStakeLimit())\n * @return maxStakeLimit max stake limit\n * @return maxStakeLimitGrowthBlocks blocks needed to restore max stake limit from the fully exhausted state\n * @return prevStakeLimit previously reached stake limit\n * @return prevStakeBlockNumber previously seen block number\n */\n function getStakeLimitFullInfo()\n external\n view\n returns (\n bool isStakingPaused,\n bool isStakingLimitSet,\n uint256 currentStakeLimit,\n uint256 maxStakeLimit,\n uint256 maxStakeLimitGrowthBlocks,\n uint256 prevStakeLimit,\n uint256 prevStakeBlockNumber\n );\n\n event Stopped();\n event Resumed();\n\n event StakingPaused();\n event StakingResumed();\n event StakingLimitSet(\n uint256 maxStakeLimit,\n uint256 stakeLimitIncreasePerBlock\n );\n event StakingLimitRemoved();\n\n /**\n * @notice Set Lido protocol contracts (oracle, treasury, insurance fund).\n * @param _oracle oracle contract\n * @param _treasury treasury contract\n * @param _insuranceFund insurance fund contract\n */\n function setProtocolContracts(\n address _oracle,\n address _treasury,\n address _insuranceFund\n ) external;\n\n event ProtocolContactsSet(\n address oracle,\n address treasury,\n address insuranceFund\n );\n\n /**\n * @notice Set fee rate to `_feeBasisPoints` basis points.\n * The fees are accrued when:\n * - oracles report staking results (beacon chain balance increase)\n * - validators gain execution layer rewards (priority fees and MEV)\n * @param _feeBasisPoints Fee rate, in basis points\n */\n function setFee(uint16 _feeBasisPoints) external;\n\n /**\n * @notice Set fee distribution\n * @param _treasuryFeeBasisPoints basis points go to the treasury,\n * @param _insuranceFeeBasisPoints basis points go to the insurance fund,\n * @param _operatorsFeeBasisPoints basis points go to node operators.\n * @dev The sum has to be 10 000.\n */\n function setFeeDistribution(\n uint16 _treasuryFeeBasisPoints,\n uint16 _insuranceFeeBasisPoints,\n uint16 _operatorsFeeBasisPoints\n ) external;\n\n /**\n * @notice Returns staking rewards fee rate\n */\n function getFee() external view returns (uint16 feeBasisPoints);\n\n /**\n * @notice Returns fee distribution proportion\n */\n function getFeeDistribution()\n external\n view\n returns (\n uint16 treasuryFeeBasisPoints,\n uint16 insuranceFeeBasisPoints,\n uint16 operatorsFeeBasisPoints\n );\n\n /**\n * @dev burn shares\n */\n function burnShares(address _account, uint256 _sharesAmount) external;\n\n event FeeSet(uint16 feeBasisPoints);\n\n event FeeDistributionSet(\n uint16 treasuryFeeBasisPoints,\n uint16 insuranceFeeBasisPoints,\n uint16 operatorsFeeBasisPoints\n );\n\n /**\n * @notice A payable function supposed to be called only by LidoExecutionLayerRewardsVault contract\n * @dev We need a dedicated function because funds received by the default payable function\n * are treated as a user deposit\n */\n function receiveELRewards() external payable;\n\n // The amount of ETH withdrawn from LidoExecutionLayerRewardsVault contract to Lido contract\n event ELRewardsReceived(uint256 amount);\n\n /**\n * @dev Sets limit on amount of ETH to withdraw from execution layer rewards vault per LidoOracle report\n * @param _limitPoints limit in basis points to amount of ETH to withdraw per LidoOracle report\n */\n function setELRewardsWithdrawalLimit(uint16 _limitPoints) external;\n\n // Percent in basis points of total pooled ether allowed to withdraw from LidoExecutionLayerRewardsVault per LidoOracle report\n event ELRewardsWithdrawalLimitSet(uint256 limitPoints);\n\n /**\n * @notice Set credentials to withdraw ETH on ETH 2.0 side after the phase 2 is launched to `_withdrawalCredentials`\n * @dev Note that setWithdrawalCredentials discards all unused signing keys as the signatures are invalidated.\n * @param _withdrawalCredentials withdrawal credentials field as defined in the Ethereum PoS consensus specs\n */\n function setWithdrawalCredentials(bytes32 _withdrawalCredentials) external;\n\n /**\n * @notice Returns current credentials to withdraw ETH on ETH 2.0 side after the phase 2 is launched\n */\n function getWithdrawalCredentials() external view returns (bytes32);\n\n event WithdrawalCredentialsSet(bytes32 withdrawalCredentials);\n\n /**\n * @dev Sets the address of LidoExecutionLayerRewardsVault contract\n * @param _executionLayerRewardsVault Execution layer rewards vault contract address\n */\n function setELRewardsVault(address _executionLayerRewardsVault) external;\n\n // The `executionLayerRewardsVault` was set as the execution layer rewards vault for Lido\n event ELRewardsVaultSet(address executionLayerRewardsVault);\n\n /**\n * @notice Ether on the ETH 2.0 side reported by the oracle\n * @param _epoch Epoch id\n * @param _eth2balance Balance in wei on the ETH 2.0 side\n */\n function handleOracleReport(uint256 _epoch, uint256 _eth2balance) external;\n\n // User functions\n\n /**\n * @notice Adds eth to the pool\n * @return StETH Amount of StETH generated\n */\n function submit(address _referral) external payable returns (uint256 StETH);\n\n // Records a deposit made by a user\n event Submitted(address indexed sender, uint256 amount, address referral);\n\n // The `amount` of ether was sent to the deposit_contract.deposit function\n event Unbuffered(uint256 amount);\n\n // Requested withdrawal of `etherAmount` to `pubkeyHash` on the ETH 2.0 side, `tokenAmount` burned by `sender`,\n // `sentFromBuffer` was sent on the current Ethereum side.\n event Withdrawal(\n address indexed sender,\n uint256 tokenAmount,\n uint256 sentFromBuffer,\n bytes32 indexed pubkeyHash,\n uint256 etherAmount\n );\n\n // Info functions\n\n /**\n * @notice Gets the amount of Ether controlled by the system\n */\n function getTotalPooledEther() external view returns (uint256);\n\n /**\n * @notice Gets the amount of Ether temporary buffered on this contract balance\n */\n function getBufferedEther() external view returns (uint256);\n\n /**\n * @notice Returns the key values related to Beacon-side\n * @return depositedValidators - number of deposited validators\n * @return beaconValidators - number of Lido's validators visible in the Beacon state, reported by oracles\n * @return beaconBalance - total amount of Beacon-side Ether (sum of all the balances of Lido validators)\n */\n function getBeaconStat()\n external\n view\n returns (\n uint256 depositedValidators,\n uint256 beaconValidators,\n uint256 beaconBalance\n );\n}\n" }, "contracts/interface/vault/ILSDLIDOVault.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.9;\n\ninterface ILSDLIDOVault {\n function depositEther() external payable;\n\n function withdrawEther(uint256 _ethAmount) external;\n\n function getStETHBalance() external view returns (uint256);\n\n function getSharesOfStETH(uint256 _ethAmount) external returns (uint256);\n}\n" }, "contracts/contract/LSDBase.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.9;\n\nimport \"../interface/ILSDStorage.sol\";\n\n/// @title Base settings / modifiers for each contract in LSD\n\nabstract contract LSDBase {\n // Calculate using this as the base\n uint256 constant calcBase = 1 ether;\n\n // Version of the contract\n uint8 public version;\n\n // The main storage contact where primary persistant storage is maintained\n ILSDStorage lsdStorage;\n\n /*** Modifiers ***********************************************************/\n\n /**\n * @dev Throws if called by any sender that doesn't match a LSD network contract\n */\n modifier onlyLSDNetworkContract() {\n require(\n getBool(\n keccak256(abi.encodePacked(\"contract.exists\", msg.sender))\n ),\n \"Invalid contract\"\n );\n _;\n }\n\n /**\n * @dev Throws if called by any sender that doesn't match one of the supplied contract\n */\n modifier onlyLSDContract(\n string memory _contractName,\n address _contractAddress\n ) {\n require(\n _contractAddress ==\n getAddress(\n keccak256(\n abi.encodePacked(\"contract.address\", _contractName)\n )\n ),\n \"Invalid contract\"\n );\n _;\n }\n\n /*** Methods **********************************************************************/\n\n /// @dev Set the main LSD storage address\n constructor(ILSDStorage _lsdStorageAddress) {\n // Update the contract address\n lsdStorage = ILSDStorage(_lsdStorageAddress);\n }\n\n /// @dev Get the address of a network contract by name\n function getContractAddress(string memory _contractName)\n internal\n view\n returns (address)\n {\n // Get the current contract address\n address contractAddress = getAddress(\n keccak256(abi.encodePacked(\"contract.address\", _contractName))\n );\n // Check it\n require(contractAddress != address(0x0), \"Contract not found\");\n return contractAddress;\n }\n\n /// @dev Get the name of a network contract by address\n function getContractName(address _contractAddress)\n internal\n view\n returns (string memory)\n {\n // Get the contract name\n string memory contractName = getString(\n keccak256(abi.encodePacked(\"contract.name\", _contractAddress))\n );\n // Check it\n require(bytes(contractName).length > 0, \"Contract not found\");\n // Return\n return contractName;\n }\n\n /// @dev Get revert error message from a .call method\n function getRevertMsg(bytes memory _returnData)\n internal\n pure\n returns (string memory)\n {\n // If the _res length is less than 68, then the transaction failed silently (without a revert message)\n if (_returnData.length < 68) return \"Transaction reverted silently\";\n assembly {\n // Slice the sighash\n _returnData := add(_returnData, 0x04)\n }\n return abi.decode(_returnData, (string)); // All that remains is the revert string\n }\n\n /*** LSD Storage Methods ********************************************************/\n\n // Note: Uused helpers have been removed to keep contract sizes down\n\n /// @dev Storage get methods\n function getAddress(bytes32 _key) internal view returns (address) {\n return lsdStorage.getAddress(_key);\n }\n\n function getUint(bytes32 _key) internal view returns (uint256) {\n return lsdStorage.getUint(_key);\n }\n\n function getString(bytes32 _key) internal view returns (string memory) {\n return lsdStorage.getString(_key);\n }\n\n function getBytes(bytes32 _key) internal view returns (bytes memory) {\n return lsdStorage.getBytes(_key);\n }\n\n function getBool(bytes32 _key) internal view returns (bool) {\n return lsdStorage.getBool(_key);\n }\n\n function getInt(bytes32 _key) internal view returns (int256) {\n return lsdStorage.getInt(_key);\n }\n\n function getBytes32(bytes32 _key) internal view returns (bytes32) {\n return lsdStorage.getBytes32(_key);\n }\n\n /// @dev Storage set methods\n function setAddress(bytes32 _key, address _value) internal {\n lsdStorage.setAddress(_key, _value);\n }\n\n function setUint(bytes32 _key, uint256 _value) internal {\n lsdStorage.setUint(_key, _value);\n }\n\n function setString(bytes32 _key, string memory _value) internal {\n lsdStorage.setString(_key, _value);\n }\n\n function setBytes(bytes32 _key, bytes memory _value) internal {\n lsdStorage.setBytes(_key, _value);\n }\n\n function setBool(bytes32 _key, bool _value) internal {\n lsdStorage.setBool(_key, _value);\n }\n\n function setInt(bytes32 _key, int256 _value) internal {\n lsdStorage.setInt(_key, _value);\n }\n\n function setBytes32(bytes32 _key, bytes32 _value) internal {\n lsdStorage.setBytes32(_key, _value);\n }\n\n /// @dev Storage delete methods\n function deleteAddress(bytes32 _key) internal {\n lsdStorage.deleteAddress(_key);\n }\n\n function deleteUint(bytes32 _key) internal {\n lsdStorage.deleteUint(_key);\n }\n\n function deleteString(bytes32 _key) internal {\n lsdStorage.deleteString(_key);\n }\n\n function deleteBytes(bytes32 _key) internal {\n lsdStorage.deleteBytes(_key);\n }\n\n function deleteBool(bytes32 _key) internal {\n lsdStorage.deleteBool(_key);\n }\n\n function deleteInt(bytes32 _key) internal {\n lsdStorage.deleteInt(_key);\n }\n\n function deleteBytes32(bytes32 _key) internal {\n lsdStorage.deleteBytes32(_key);\n }\n\n /// @dev Storage arithmetic methods\n function addUint(bytes32 _key, uint256 _amount) internal {\n lsdStorage.addUint(_key, _amount);\n }\n\n function subUint(bytes32 _key, uint256 _amount) internal {\n lsdStorage.subUint(_key, _amount);\n }\n}\n" }, "contracts/interface/utils/uniswap/IUniswapV2Router01.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >=0.6.2;\n\ninterface IUniswapV2Router01 {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint amountADesired,\n uint amountBDesired,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB, uint liquidity);\n function addLiquidityETH(\n address token,\n uint amountTokenDesired,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\n function removeLiquidity(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB);\n function removeLiquidityETH(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountToken, uint amountETH);\n function removeLiquidityWithPermit(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountA, uint amountB);\n function removeLiquidityETHWithPermit(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountToken, uint amountETH);\n function swapExactTokensForTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapTokensForExactTokens(\n uint amountOut,\n uint amountInMax,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n\n function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\n function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\n function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\n function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\n function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\n}" }, "contracts/interface/ILSDStorage.sol": { "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.9;\n\ninterface ILSDStorage {\n // Depoly status\n function getDeployedStatus() external view returns (bool);\n\n // Guardian\n function getGuardian() external view returns (address);\n\n function setGuardian(address _newAddress) external;\n\n function confirmGuardian() external;\n\n // Getters\n function getAddress(bytes32 _key) external view returns (address);\n\n function getUint(bytes32 _key) external view returns (uint256);\n\n function getString(bytes32 _key) external view returns (string memory);\n\n function getBytes(bytes32 _key) external view returns (bytes memory);\n\n function getBool(bytes32 _key) external view returns (bool);\n\n function getInt(bytes32 _key) external view returns (int256);\n\n function getBytes32(bytes32 _key) external view returns (bytes32);\n\n // Setters\n function setAddress(bytes32 _key, address _value) external;\n\n function setUint(bytes32 _key, uint256 _value) external;\n\n function setString(bytes32 _key, string calldata _value) external;\n\n function setBytes(bytes32 _key, bytes calldata _value) external;\n\n function setBool(bytes32 _key, bool _value) external;\n\n function setInt(bytes32 _key, int256 _value) external;\n\n function setBytes32(bytes32 _key, bytes32 _value) external;\n\n // Deleters\n function deleteAddress(bytes32 _key) external;\n\n function deleteUint(bytes32 _key) external;\n\n function deleteString(bytes32 _key) external;\n\n function deleteBytes(bytes32 _key) external;\n\n function deleteBool(bytes32 _key) external;\n\n function deleteInt(bytes32 _key) external;\n\n function deleteBytes32(bytes32 _key) external;\n\n // Arithmetic\n function addUint(bytes32 _key, uint256 _amount) external;\n\n function subUint(bytes32 _key, uint256 _amount) external;\n}\n" } }, "settings": { "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } } }