diff --git a/script/Deploy.Unreal.s.sol b/script/Deploy.Unreal.s.sol index 9c6c30b..00ed90e 100644 --- a/script/Deploy.Unreal.s.sol +++ b/script/Deploy.Unreal.s.sol @@ -20,12 +20,20 @@ contract DeployUnreal is Script { Factory factory = Factory(controller.factory()); // deploy IFO harvester - factory.deployIfoHarvester(UnrealLib.LIQUID_BOX_DAI_USDC, UnrealLib.ALM_GAUGE_DAI_USDC, "IFO Harvester DAI-USDC", "ifoTDT-DAI-USDC"); + factory.deployIfoHarvester( + UnrealLib.LIQUID_BOX_DAI_USDC, UnrealLib.ALM_GAUGE_DAI_USDC, "IFO Harvester DAI-USDC", "ifoTDT-DAI-USDC" + ); // deploy compounder + harvester CompounderVault compounderVault = CompounderVault(factory.deployCompounder(UnrealLib.TOKEN_CVR, "Compounder CVR", "cCVR")); - factory.deployHarvester(UnrealLib.LIQUID_BOX_DAI_USDC, UnrealLib.ALM_GAUGE_DAI_USDC, "Harvester DAI-USDC", "xTDT-DAI-USDC", address(compounderVault)); + factory.deployHarvester( + UnrealLib.LIQUID_BOX_DAI_USDC, + UnrealLib.ALM_GAUGE_DAI_USDC, + "Harvester DAI-USDC", + "xTDT-DAI-USDC", + address(compounderVault) + ); vm.stopBroadcast(); } diff --git a/src/DepositHelper.sol b/src/DepositHelper.sol index 8e0a360..11e863c 100644 --- a/src/DepositHelper.sol +++ b/src/DepositHelper.sol @@ -8,12 +8,12 @@ import "./interfaces/IVe.sol"; contract DepositHelper is ReentrancyGuard { using SafeERC20 for IERC20; - function createLock(IVe ve, address token, uint value, uint lockDuration) external nonReentrant returns ( - uint tokenId, - uint lockedAmount, - uint power, - uint unlockDate - ) { + function createLock( + IVe ve, + address token, + uint value, + uint lockDuration + ) external nonReentrant returns (uint tokenId, uint lockedAmount, uint power, uint unlockDate) { IERC20(token).safeTransferFrom(msg.sender, address(this), value); _approveIfNeeds(token, value, address(ve)); tokenId = ve.createLockFor(token, value, lockDuration, msg.sender); @@ -25,11 +25,12 @@ contract DepositHelper is ReentrancyGuard { _sendRemainingToken(token); } - function increaseAmount(IVe ve, address token, uint tokenId, uint value) external nonReentrant returns ( - uint lockedAmount, - uint power, - uint unlockDate - ) { + function increaseAmount( + IVe ve, + address token, + uint tokenId, + uint value + ) external nonReentrant returns (uint lockedAmount, uint power, uint unlockDate) { IERC20(token).safeTransferFrom(msg.sender, address(this), value); _approveIfNeeds(token, value, address(ve)); ve.increaseAmount(token, tokenId, value); diff --git a/src/Frontend.sol b/src/Frontend.sol index d06c8e0..2053121 100644 --- a/src/Frontend.sol +++ b/src/Frontend.sol @@ -25,7 +25,7 @@ contract Frontend { controller = IController(controller_); } - function getLiquidBoxSharePrice(address alm, address priceToken) public view returns(uint price) { + function getLiquidBoxSharePrice(address alm, address priceToken) public view returns (uint price) { ITetuLiquidator liquidator = ITetuLiquidator(controller.liquidator()); ILiquidBox lb = ILiquidBox(alm); address token0 = lb.token0(); @@ -51,7 +51,10 @@ contract Frontend { } } - function allVaults(address user, address priceToken) + function allVaults( + address user, + address priceToken + ) external view returns ( diff --git a/src/interfaces/ILiquidBox.sol b/src/interfaces/ILiquidBox.sol index 5f88856..7c6a2f7 100644 --- a/src/interfaces/ILiquidBox.sol +++ b/src/interfaces/ILiquidBox.sol @@ -3,26 +3,26 @@ pragma solidity ^0.8.21; interface ILiquidBox { /** - * @notice Deposits tokens into the vault, distributing them - * in proportion to the current holdings. - * @dev Tokens deposited remain in the vault until the next - * rebalance and are not utilized for liquidity on Pearl. - * @param amount0Desired Maximum amount of token0 to deposit - * @param amount1Desired Maximum amount of token1 to deposit - * @param to Recipient of shares - * @param amount0Min Reverts if the resulting amount0 is less than this - * @param amount1Min Reverts if the resulting amount1 is less than this - * @return shares Number of shares minted - * @return amount0 Amount of token0 deposited - * @return amount1 Amount of token1 deposited - */ + * @notice Deposits tokens into the vault, distributing them + * in proportion to the current holdings. + * @dev Tokens deposited remain in the vault until the next + * rebalance and are not utilized for liquidity on Pearl. + * @param amount0Desired Maximum amount of token0 to deposit + * @param amount1Desired Maximum amount of token1 to deposit + * @param to Recipient of shares + * @param amount0Min Reverts if the resulting amount0 is less than this + * @param amount1Min Reverts if the resulting amount1 is less than this + * @return shares Number of shares minted + * @return amount0 Amount of token0 deposited + * @return amount1 Amount of token1 deposited + */ function deposit( - uint256 amount0Desired, - uint256 amount1Desired, + uint amount0Desired, + uint amount1Desired, address to, - uint256 amount0Min, - uint256 amount1Min - ) external returns (uint256 shares, uint256 amount0, uint256 amount1); + uint amount0Min, + uint amount1Min + ) external returns (uint shares, uint amount0, uint amount1); /** * @notice Withdraws tokens in proportion to the vault's holdings. @@ -34,26 +34,23 @@ interface ILiquidBox { * @return amount1 Amount of token1 sent to recipient */ function withdraw( - uint256 shares, + uint shares, address to, - uint256 amount0Min, - uint256 amount1Min - ) external returns (uint256 amount0, uint256 amount1); + uint amount0Min, + uint amount1Min + ) external returns (uint amount0, uint amount1); /** * @notice Calculates the vault's total holdings of token0 and token1 - in - * other words, how much of each token the vault would hold if it withdrew - * all its liquidity from Uniswap. - */ - function getTotalAmounts() - external - view - returns (uint256 total0, uint256 total1, uint128 liquidity); + * other words, how much of each token the vault would hold if it withdrew + * all its liquidity from Uniswap. + */ + function getTotalAmounts() external view returns (uint total0, uint total1, uint128 liquidity); /** * @dev Returns the amount of tokens in existence. */ - function totalSupply() external view returns (uint256); + function totalSupply() external view returns (uint); function token0() external view returns (address); diff --git a/src/lib/VeSTGNLib.sol b/src/lib/VeSTGNLib.sol index 42850a4..48e5042 100644 --- a/src/lib/VeSTGNLib.sol +++ b/src/lib/VeSTGNLib.sol @@ -374,7 +374,8 @@ library VeSTGNLib { uint untilEnd, uint _value ) public pure returns (string memory output) { - output = ''; + output = + ''; output = string( abi.encodePacked( diff --git a/test/mock/MockTetuLiquidator.sol b/test/mock/MockTetuLiquidator.sol index 38163b8..bd2df72 100644 --- a/test/mock/MockTetuLiquidator.sol +++ b/test/mock/MockTetuLiquidator.sol @@ -30,8 +30,8 @@ contract MockTetuLiquidator is ITetuLiquidator { ) external view returns (PoolData[] memory route, string memory errorMessage) {} function liquidate(address tokenIn, address tokenOut, uint amount, uint /*priceImpactTolerance*/ ) external { -// console.log('liquidate tokenIn', IERC20Metadata(tokenIn).symbol()); -// console.log('liquidate tokenOut', IERC20Metadata(tokenOut).symbol()); + // console.log('liquidate tokenIn', IERC20Metadata(tokenIn).symbol()); + // console.log('liquidate tokenOut', IERC20Metadata(tokenOut).symbol()); if (amount == 0) { amount = 10 ** IERC20Metadata(tokenIn).decimals(); }