From 438eea18d1177718e20f1e6d63c73e204e3128c6 Mon Sep 17 00:00:00 2001 From: Shriya Tyagi Date: Tue, 16 Jan 2024 04:13:43 +0400 Subject: [PATCH] feat: update contracts --- .../mainnet/connectors/morpho-blue/events.sol | 1 + .../connectors/morpho-blue/helpers.sol | 89 ++---- .../mainnet/connectors/morpho-blue/main.sol | 275 +++++++++++------- package-lock.json | 134 +++++++++ package.json | 12 +- 5 files changed, 327 insertions(+), 184 deletions(-) diff --git a/contracts/mainnet/connectors/morpho-blue/events.sol b/contracts/mainnet/connectors/morpho-blue/events.sol index 6ae9fd1..590f202 100644 --- a/contracts/mainnet/connectors/morpho-blue/events.sol +++ b/contracts/mainnet/connectors/morpho-blue/events.sol @@ -66,6 +66,7 @@ contract Events { uint256 amounts, uint256 shares, address indexed onBehalf, + address indexed receiver, uint256 getId, uint256 setId ); diff --git a/contracts/mainnet/connectors/morpho-blue/helpers.sol b/contracts/mainnet/connectors/morpho-blue/helpers.sol index e110d08..beeb2bf 100644 --- a/contracts/mainnet/connectors/morpho-blue/helpers.sol +++ b/contracts/mainnet/connectors/morpho-blue/helpers.sol @@ -21,34 +21,15 @@ abstract contract Helpers is Stores, Basic { IMorpho public constant MORPHO_BLUE = IMorpho(0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb); - uint256 internal constant MARKET_PARAMS_BYTES_LENGTH = 5 * 32; - - /// @dev The number of virtual assets of 1 enforces a conversion rate between shares and assets when a market is - /// empty. - uint256 internal constant VIRTUAL_ASSETS = 1; - - /// @dev The number of virtual shares has been chosen low enough to prevent overflows, and high enough to ensure - /// high precision computations. - uint256 internal constant VIRTUAL_SHARES = 1e6; - - enum Mode { - Collateral, - Repay, - Supply - } - /// @notice Handles Eth to Weth conversion if assets are provided. function _performEthToWethConversion( MarketParams memory _marketParams, uint256 _assets, - address _onBehalf, uint256 _getId, - Mode _mode + bool _isModeCollateral ) internal returns (Id _id, MarketParams memory, uint256 _amt) { _amt = getUint(_getId, _assets); - bool _isModeCollateral = _mode == Mode.Collateral; - bool _isEth = _isModeCollateral ? _marketParams.collateralToken == ethAddr : _marketParams.loanToken == ethAddr; @@ -59,27 +40,15 @@ abstract contract Helpers is Stores, Basic { // Check for max value if (_assets == type(uint256).max) { - uint256 _maxBalance = _isEth + _amt = _isEth ? address(this).balance : _isModeCollateral - ? TokenInterface(_marketParams.collateralToken).balanceOf( - address(this) - ) - : TokenInterface(_marketParams.loanToken).balanceOf( - address(this) - ); - - if (_mode == Mode.Repay) { - uint256 _amtDebt = getPaybackBalance( - _id, - _marketParams, - _onBehalf - ); - - _amt = UtilsLib.min(_maxBalance, _amtDebt); - } else { - _amt = _maxBalance; - } + ? TokenInterface(_marketParams.collateralToken).balanceOf( + address(this) + ) + : TokenInterface(_marketParams.loanToken).balanceOf( + address(this) + ); } // Perform eth to weth conversion if necessary @@ -98,9 +67,7 @@ abstract contract Helpers is Stores, Basic { function _performEthToWethSharesConversion( MarketParams memory _marketParams, uint256 _shares, - address _onBehalf, - uint256 _getId, - bool _isRepay + uint256 _getId ) internal returns (Id _id, MarketParams memory, uint256 _assets) { uint256 _shareAmt = getUint(_getId, _shares); bool _isEth = _marketParams.loanToken == ethAddr; @@ -111,40 +78,23 @@ abstract contract Helpers is Stores, Basic { // Handle the max share case if (_shares == type(uint256).max) { - uint256 _maxBalance = _isEth + _assets = _isEth ? address(this).balance : TokenInterface(_marketParams.loanToken).balanceOf( address(this) ); - - // If it's repay calculate the min of balance available and debt to repay - if (_isRepay) { - _assets = UtilsLib.min( - _maxBalance, - getPaybackBalance(_id, _marketParams, _onBehalf) - ); - } else { - _assets = _maxBalance; - } } else { ( uint256 totalSupplyAssets, uint256 totalSupplyShares, - uint256 totalBorrowAssets, - uint256 totalBorrowShares + , + ) = MORPHO_BLUE.expectedMarketBalances(_marketParams); - if (_isRepay) { - _assets = _shareAmt.toAssetsUp( - totalBorrowAssets, - totalBorrowShares - ); - } else { - _assets = _shareAmt.toAssetsUp( - totalSupplyAssets, - totalSupplyShares - ); - } + _assets = _shareAmt.toAssetsUp( + totalSupplyAssets, + totalSupplyShares + ); } // Perform ETH to WETH conversion if necessary @@ -157,13 +107,14 @@ abstract contract Helpers is Stores, Basic { return (_id, _marketParams, _assets); } - /// @notice Returns the payback balance in assets. + /// @notice Returns the borrowed assets and shares of onBehalf. function getPaybackBalance( Id _id, MarketParams memory _marketParams, address _onBehalf - ) internal view returns (uint256 _assets) { - uint256 _borrowedShareAmt = MORPHO_BLUE.borrowShares(_id, _onBehalf); + ) internal view returns (uint256 _assets, uint256 _borrowedShareAmt) { + Position memory _pos = MORPHO_BLUE.position(_id, _onBehalf); + _borrowedShareAmt = _pos.borrowShares; (, , uint256 totalBorrowAssets, uint256 totalBorrowShares) = MORPHO_BLUE .expectedMarketBalances(_marketParams); diff --git a/contracts/mainnet/connectors/morpho-blue/main.sol b/contracts/mainnet/connectors/morpho-blue/main.sol index 3862944..cb6894f 100644 --- a/contracts/mainnet/connectors/morpho-blue/main.sol +++ b/contracts/mainnet/connectors/morpho-blue/main.sol @@ -4,9 +4,13 @@ pragma solidity 0.8.19; import "./helpers.sol"; import "./events.sol"; import {MarketParamsLib} from "./libraries/MarketParamsLib.sol"; +import {MorphoBalancesLib} from "./libraries/periphery/MorphoBalancesLib.sol"; +import {SharesMathLib} from "./libraries/SharesMathLib.sol"; abstract contract MorphoBlue is Helpers, Events { using MarketParamsLib for MarketParams; + using MorphoBalancesLib for IMorpho; + using SharesMathLib for uint256; /** * @dev Supply ETH/ERC20 Token for lending. @@ -35,9 +39,8 @@ abstract contract MorphoBlue is Helpers, Events { ) = _performEthToWethConversion( _marketParams, _assets, - address(this), _getId, - Mode.Supply + false ); approve( @@ -58,13 +61,7 @@ abstract contract MorphoBlue is Helpers, Events { setUint(_setId, _assets); _eventName = "LogSupplyAssets(bytes32,unit256,unit256,unit256,unit256)"; - _eventParam = abi.encode( - _id, - _assets, - _shares, - _getId, - _setId - ); + _eventParam = abi.encode(_id, _assets, _shares, _getId, _setId); } /** @@ -96,9 +93,8 @@ abstract contract MorphoBlue is Helpers, Events { ) = _performEthToWethConversion( _marketParams, _assets, - _onBehalf, _getId, - Mode.Supply + false ); approve( @@ -154,14 +150,8 @@ abstract contract MorphoBlue is Helpers, Events { ( _id, _marketParams, // Updated token contracts in case of Eth - _amt // Shares amount converted to assets - ) = _performEthToWethSharesConversion( - _marketParams, - _shares, - _onBehalf, - _getId, - false - ); + _amt // Share amount converted to assets + ) = _performEthToWethSharesConversion(_marketParams, _shares, _getId); approve( TokenInterface(_marketParams.loanToken), @@ -217,12 +207,10 @@ abstract contract MorphoBlue is Helpers, Events { ) = _performEthToWethConversion( _marketParams, _assets, - address(this), _getId, - Mode.Collateral + true ); - // Approving collateral token approve( TokenInterface(_marketParams.collateralToken), address(MORPHO_BLUE), @@ -270,12 +258,10 @@ abstract contract MorphoBlue is Helpers, Events { ) = _performEthToWethConversion( _marketParams, _assets, - _onBehalf, _getId, - Mode.Collateral + true ); - // Approving collateral token approve( TokenInterface(_marketParams.collateralToken), address(MORPHO_BLUE), @@ -292,13 +278,7 @@ abstract contract MorphoBlue is Helpers, Events { setUint(_setId, _amt); _eventName = "LogSupplyCollateralOnBehalf(bytes32,uint256,address,uint256,uint256)"; - _eventParam = abi.encode( - _id, - _assets, - _onBehalf, - _getId, - _setId - ); + _eventParam = abi.encode(_id, _assets, _onBehalf, _getId, _setId); } /** @@ -431,7 +411,7 @@ abstract contract MorphoBlue is Helpers, Events { uint256 _amt = getUint(_getId, _assets); _marketParams = updateTokenAddresses(_marketParams); - + Id _id = _marketParams.id(); uint256 _shares = 0; @@ -461,13 +441,7 @@ abstract contract MorphoBlue is Helpers, Events { setUint(_setId, _assets); _eventName = "LogWithdraw(bytes32,uint256,uint256,uint256,uint256)"; - _eventParam = abi.encode( - _id, - _assets, - _shares, - _getId, - _setId - ); + _eventParam = abi.encode(_id, _assets, _shares, _getId, _setId); } /** @@ -523,12 +497,13 @@ abstract contract MorphoBlue is Helpers, Events { setUint(_setId, _assets); - _eventName = "LogWithdrawOnBehalf(bytes32,uint256,uint256,address,uint256,uint256)"; + _eventName = "LogWithdrawOnBehalf(bytes32,uint256,uint256,address,address,uint256,uint256)"; _eventParam = abi.encode( _id, _assets, _shares, _onBehalf, + address(this), _getId, _setId ); @@ -583,12 +558,13 @@ abstract contract MorphoBlue is Helpers, Events { setUint(_setId, _assets); - _eventName = "LogWithdrawOnBehalf(bytes32,uint256,uint256,address,uint256,uint256)"; + _eventName = "LogWithdrawOnBehalf(bytes32,uint256,uint256,address,address,uint256,uint256)"; _eventParam = abi.encode( _id, _assets, _shareAmt, _onBehalf, + _receiver, _getId, _setId ); @@ -613,6 +589,7 @@ abstract contract MorphoBlue is Helpers, Events { returns (string memory _eventName, bytes memory _eventParam) { uint256 _amt = getUint(_getId, _assets); + bool _isLoanEth = _marketParams.loanToken == ethAddr; _marketParams = updateTokenAddresses(_marketParams); @@ -627,7 +604,7 @@ abstract contract MorphoBlue is Helpers, Events { ); convertWethToEth( - _marketParams.loanToken == ethAddr, + _isLoanEth, TokenInterface(wethAddr), _amt ); @@ -661,6 +638,7 @@ abstract contract MorphoBlue is Helpers, Events { returns (string memory _eventName, bytes memory _eventParam) { uint256 _amt = getUint(_getId, _assets); + bool _isLoanEth = _marketParams.loanToken == ethAddr; _marketParams = updateTokenAddresses(_marketParams); @@ -675,11 +653,7 @@ abstract contract MorphoBlue is Helpers, Events { ); if (_receiver == address(this)) - convertWethToEth( - _marketParams.loanToken == ethAddr, - TokenInterface(wethAddr), - _amt - ); + convertWethToEth(_isLoanEth, TokenInterface(wethAddr), _amt); setUint(_setId, _amt); @@ -718,6 +692,7 @@ abstract contract MorphoBlue is Helpers, Events { returns (string memory _eventName, bytes memory _eventParam) { uint256 _shareAmt = getUint(_getId, _shares); + bool _isLoanEth = _marketParams.loanToken == ethAddr; _marketParams = updateTokenAddresses(_marketParams); @@ -732,11 +707,7 @@ abstract contract MorphoBlue is Helpers, Events { ); if (_receiver == address(this)) - convertWethToEth( - _marketParams.loanToken == ethAddr, - TokenInterface(wethAddr), - _assets - ); + convertWethToEth(_isLoanEth, TokenInterface(wethAddr), _assets); setUint(_setId, _assets); @@ -770,32 +741,59 @@ abstract contract MorphoBlue is Helpers, Events { payable returns (string memory _eventName, bytes memory _eventParam) { - uint256 _amt; - Id _id; - ( - _id, - _marketParams, // Updated token contracts in case of Eth - _amt // Assets final amount to repay - ) = _performEthToWethConversion( - _marketParams, - _assets, - address(this), - _getId, - Mode.Repay + uint256 _amt = getUint(_getId, _assets); + uint256 _shares = 0; + + bool _isMax = _amt == type(uint256).max; + bool _isEth = _marketParams.loanToken == ethAddr; + + _marketParams = updateTokenAddresses(_marketParams); + + Id _id = _marketParams.id(); + + uint256 _maxDsaBalance; + uint256 _borrowedShareAmt; + + if (_amt == type(uint256).max) { + _maxDsaBalance = _isEth + ? address(this).balance + : TokenInterface(_marketParams.loanToken).balanceOf( + address(this) + ); + + uint256 _amtDebt; + (_amtDebt, _borrowedShareAmt) = getPaybackBalance( + _id, + _marketParams, + address(this) + ); + + // Amount is minimum of dsa balance or debt + _amt = UtilsLib.min(_maxDsaBalance, _amtDebt); + } + + convertEthToWeth( + _isEth, + TokenInterface(_marketParams.loanToken), + _amt + 1 // Adding 1 wei as a buffer ); - // Approving loan token for repaying approve( TokenInterface(_marketParams.loanToken), address(MORPHO_BLUE), - _amt + _amt + 1 ); - uint256 _shares; + if (_isMax && _amt < _maxDsaBalance) { + // case of max shares burn + _shares = _borrowedShareAmt; + _amt = 0; + } + (_assets, _shares) = MORPHO_BLUE.repay( _marketParams, _amt, - 0, + _shares, address(this), new bytes(0) ); @@ -803,13 +801,7 @@ abstract contract MorphoBlue is Helpers, Events { setUint(_setId, _assets); _eventName = "LogRepay(bytes32,uint256,uint256,uint256,uint256)"; - _eventParam = abi.encode( - _id, - _assets, - _shares, - _getId, - _setId - ); + _eventParam = abi.encode(_id, _assets, _shares, _getId, _setId); } /** @@ -832,32 +824,58 @@ abstract contract MorphoBlue is Helpers, Events { payable returns (string memory _eventName, bytes memory _eventParam) { - uint256 _amt; - Id _id; - ( - _id, - _marketParams, // Updated token contracts in case of Eth - _amt // Assets final amount to repay - ) = _performEthToWethConversion( - _marketParams, - _assets, - _onBehalf, - _getId, - Mode.Repay + uint256 _amt = getUint(_getId, _assets); + uint256 _shares = 0; + + bool _isEth = _marketParams.loanToken == ethAddr; + + _marketParams = updateTokenAddresses(_marketParams); + + Id _id = _marketParams.id(); + + uint256 _maxDsaBalance; + uint256 _borrowedShareAmt; + + if (_amt == type(uint256).max) { + _maxDsaBalance = _isEth + ? address(this).balance + : TokenInterface(_marketParams.loanToken).balanceOf( + address(this) + ); + + uint256 _amtDebt; + (_amtDebt, _borrowedShareAmt) = getPaybackBalance( + _id, + _marketParams, + _onBehalf + ); + + // Amount is minimum of dsa balance or debt + _amt = UtilsLib.min(_maxDsaBalance, _amtDebt); + } + + convertEthToWeth( + _isEth, + TokenInterface(_marketParams.loanToken), + _amt + 1 // Adding 1 wei as buffer ); - // Approving loan token for repaying approve( TokenInterface(_marketParams.loanToken), address(MORPHO_BLUE), - _amt + _amt + 1 ); - uint256 _shares; + if (_amt == type(uint256).max && _amt < _maxDsaBalance) { + // Case for max shares burn + _shares = _borrowedShareAmt; + _amt = 0; + } + (_assets, _shares) = MORPHO_BLUE.repay( _marketParams, _amt, - 0, + _shares, _onBehalf, new bytes(0) ); @@ -895,40 +913,77 @@ abstract contract MorphoBlue is Helpers, Events { payable returns (string memory _eventName, bytes memory _eventParam) { - uint256 _assetsAmt; - Id _id; - ( - _id, - _marketParams, // Updated token contracts in case of Eth - _assetsAmt // Shares amount converted to assets - ) = _performEthToWethSharesConversion( - _marketParams, - _shares, - _onBehalf, - _getId, - true + uint256 _amt; + uint256 _shareAmt = getUint(_getId, _shares); + + bool _isEth = _marketParams.loanToken == ethAddr; + + _marketParams = updateTokenAddresses(_marketParams); + + Id _id = _marketParams.id(); + + uint256 _borrowedShareAmt; + uint256 _maxDsaBalance; + + if (_shareAmt == type(uint256).max) { + _maxDsaBalance = _isEth + ? address(this).balance + : TokenInterface(_marketParams.loanToken).balanceOf( + address(this) + ); + + uint256 _assetsAmt; + (_assetsAmt, _borrowedShareAmt) = getPaybackBalance( + _id, + _marketParams, + _onBehalf + ); + + _amt = UtilsLib.min(_maxDsaBalance, _assetsAmt); + } else { + ( + , + , + uint256 totalBorrowAssets, + uint256 totalBorrowShares + ) = MORPHO_BLUE.expectedMarketBalances(_marketParams); + + _amt = _shareAmt.toAssetsUp(totalBorrowAssets, totalBorrowShares); + } + + convertEthToWeth( + _isEth, + TokenInterface(_marketParams.loanToken), + _amt + 1 ); approve( TokenInterface(_marketParams.loanToken), address(MORPHO_BLUE), - _assetsAmt + _amt + 1 ); - (uint256 _assets, ) = MORPHO_BLUE.repay( + if (_shareAmt == type(uint256).max && _amt < _maxDsaBalance) { + _shareAmt = _borrowedShareAmt; + _amt = 0; + } else { + _shareAmt = 0; + } + + (_amt, ) = MORPHO_BLUE.repay( _marketParams, - _assetsAmt, - 0, + _amt, + _shareAmt, _onBehalf, new bytes(0) ); - setUint(_setId, _assets); + setUint(_setId, _amt); _eventName = "LogRepayOnBehalf(bytes32,uint256,uint256,address,uint256,uint256)"; _eventParam = abi.encode( _id, - _assets, + _amt, _shares, _onBehalf, _getId, diff --git a/package-lock.json b/package-lock.json index 6dfdc68..1e4c476 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,8 @@ }, "devDependencies": { "hardhat": "^2.19.2", + "prettier": "^3.2.2", + "prettier-plugin-solidity": "^1.3.1", "typechain": "^8.3.2" } }, @@ -8436,6 +8438,77 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.2.tgz", + "integrity": "sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-solidity": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.3.1.tgz", + "integrity": "sha512-MN4OP5I2gHAzHZG1wcuJl0FsLS3c4Cc5494bbg+6oQWBPuEamjwDvmGfFMZ6NFzsh3Efd9UUxeT7ImgjNH4ozA==", + "dev": true, + "dependencies": { + "@solidity-parser/parser": "^0.17.0", + "semver": "^7.5.4", + "solidity-comments-extractor": "^0.0.8" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "prettier": ">=2.3.0" + } + }, + "node_modules/prettier-plugin-solidity/node_modules/@solidity-parser/parser": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.17.0.tgz", + "integrity": "sha512-Nko8R0/kUo391jsEHHxrGM07QFdnPGvlmox4rmH0kNiNAashItAilhy4Mv4pK5gQmW5f4sXAF58fwJbmlkGcVw==", + "dev": true + }, + "node_modules/prettier-plugin-solidity/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prettier-plugin-solidity/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prettier-plugin-solidity/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -9441,6 +9514,12 @@ "semver": "bin/semver" } }, + "node_modules/solidity-comments-extractor": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.8.tgz", + "integrity": "sha512-htM7Vn6LhHreR+EglVMd2s+sZhcXAirB1Zlyrv5zBuTxieCvjfnRpd7iZk75m/u6NOlEyQ94C6TWbBn2cY7w8g==", + "dev": true + }, "node_modules/solidity-coverage": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.5.tgz", @@ -17725,6 +17804,55 @@ "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "peer": true }, + "prettier": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.2.tgz", + "integrity": "sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==", + "dev": true + }, + "prettier-plugin-solidity": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.3.1.tgz", + "integrity": "sha512-MN4OP5I2gHAzHZG1wcuJl0FsLS3c4Cc5494bbg+6oQWBPuEamjwDvmGfFMZ6NFzsh3Efd9UUxeT7ImgjNH4ozA==", + "dev": true, + "requires": { + "@solidity-parser/parser": "^0.17.0", + "semver": "^7.5.4", + "solidity-comments-extractor": "^0.0.8" + }, + "dependencies": { + "@solidity-parser/parser": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.17.0.tgz", + "integrity": "sha512-Nko8R0/kUo391jsEHHxrGM07QFdnPGvlmox4rmH0kNiNAashItAilhy4Mv4pK5gQmW5f4sXAF58fwJbmlkGcVw==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -18493,6 +18621,12 @@ } } }, + "solidity-comments-extractor": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.8.tgz", + "integrity": "sha512-htM7Vn6LhHreR+EglVMd2s+sZhcXAirB1Zlyrv5zBuTxieCvjfnRpd7iZk75m/u6NOlEyQ94C6TWbBn2cY7w8g==", + "dev": true + }, "solidity-coverage": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.5.tgz", diff --git a/package.json b/package.json index 5889e12..09ce6db 100644 --- a/package.json +++ b/package.json @@ -5,18 +5,20 @@ "directories": {}, "devDependencies": { "hardhat": "^2.19.2", + "prettier": "^3.2.2", + "prettier-plugin-solidity": "^1.3.1", "typechain": "^8.3.2" }, "dependencies": { "@nomicfoundation/hardhat-toolbox": "^2.0.0", + "@nomiclabs/hardhat-ethers": "^2.0.3", + "@nomiclabs/hardhat-waffle": "^2.0.6", "@nomiclabs/hardhat-web3": "^2.0.0", "@openzeppelin/contracts": "^4.9.5", "dotenv": "^16.3.1", - "ts-node": "^10.9.2", - "web3": "^1.10.3", - "ethers": "^5.4.7", - "@nomiclabs/hardhat-ethers": "^2.0.3", "ethereum-waffle": "^4.0.10", - "@nomiclabs/hardhat-waffle": "^2.0.6" + "ethers": "^5.4.7", + "ts-node": "^10.9.2", + "web3": "^1.10.3" } }