diff --git a/packages/contracts/test/src/LiquidStoneTest.t.sol b/packages/contracts/test/src/LiquidStoneNinetyDayTest.t.sol similarity index 78% rename from packages/contracts/test/src/LiquidStoneTest.t.sol rename to packages/contracts/test/src/LiquidStoneNinetyDayTest.t.sol index dcc52ce1..f03e9fd5 100644 --- a/packages/contracts/test/src/LiquidStoneTest.t.sol +++ b/packages/contracts/test/src/LiquidStoneNinetyDayTest.t.sol @@ -14,7 +14,7 @@ import { DeployLiquidMultiTokenVault } from "@script/DeployLiquidMultiTokenVault import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -contract DeployLiquidStone is DeployLiquidMultiTokenVault { +contract DeployLiquidStoneNinetyDay is DeployLiquidMultiTokenVault { function _createVaultParams( LiquidContinuousMultiTokenVault.VaultAuth memory vaultAuth, IERC20Metadata asset, @@ -24,21 +24,21 @@ contract DeployLiquidStone is DeployLiquidMultiTokenVault { LiquidContinuousMultiTokenVault.VaultParams memory vaultParams = super._createVaultParams(vaultAuth, asset, yieldStrategy, redeemOptimizer); + uint256 scale = 10 ** asset.decimals(); vaultParams.contextParams.tenor = 90; vaultParams.redeemNoticePeriod = 0; - - // reduced rate as 0 - vaultParams.contextParams.initialReducedRate.interestRate = 0; + vaultParams.contextParams.fullRateScaled = 10 * scale; + vaultParams.contextParams.initialReducedRate.interestRate = 0; // zero for less than tenor return vaultParams; } } -contract LiquidStoneTest is LiquidContinuousMultiTokenVaultTestBase { +contract LiquidStoneNinetyDayTest is LiquidContinuousMultiTokenVaultTestBase { using TestParamSet for TestParamSet.TestParam[]; function setUp() public virtual override { - DeployLiquidMultiTokenVault _deployVault = new DeployLiquidStone(); + DeployLiquidMultiTokenVault _deployVault = new DeployLiquidStoneNinetyDay(); _liquidVault = _deployVault.run(_vaultAuth); // warp to a "real time" time rather than block.timestamp=1 @@ -51,29 +51,13 @@ contract LiquidStoneTest is LiquidContinuousMultiTokenVaultTestBase { _transferAndAssert(_asset, _vaultAuth.owner, bob, 100_000 * _scale); } - function test__LiquidStoneTest__VerifyDeployTenor() public view { + function test__LiquidStoneNinetyDay__VerifyDeployTenor() public view { assertEq(90, _liquidVault.TENOR(), "tenor incorrect"); } - function test__LiquidStoneTest__SimpleDepositAndRedeem() public { - (TestParamSet.TestUsers memory depositUsers, TestParamSet.TestUsers memory redeemUsers) = - _createTestUsers(alice); - TestParamSet.TestParam[] memory testParams = new TestParamSet.TestParam[](1); - testParams[0] = TestParamSet.TestParam({ principal: 100 * _scale, depositPeriod: 0, redeemPeriod: 5 }); - - uint256[] memory sharesAtPeriods = _testDepositOnly(depositUsers, _liquidVault, testParams); - _testRedeemOnly(redeemUsers, _liquidVault, testParams, sharesAtPeriods); - } - - function test__LiquidStoneTest__RedeemAtTenor() public { - testVaultAtOffsets( - alice, - _liquidVault, - TestParamSet.TestParam({ principal: 25 * _scale, depositPeriod: 0, redeemPeriod: _liquidVault.TENOR() }) - ); - } + // TODO - need to implement and test for RetainedAssetsReceive1APY - function test__LiquidStoneTest__RedeemFullTenor() public { + function test__LiquidStoneNinetyDay__RedeemFullTenor() public { uint256 depositPeriod = 5; uint256 redeemPeriod = depositPeriod + _liquidVault.TENOR(); uint256 principal = 105 * _scale; @@ -104,7 +88,7 @@ contract LiquidStoneTest is LiquidContinuousMultiTokenVaultTestBase { assertEq(principal + expectedReturns, assets, "wrong assets returned"); } - function test__LiquidStoneTest__EarlyRedemptionGivesZeroYield() public { + function test__LiquidStoneNinetyDay__EarlyRedemptionGivesZeroYield() public { uint256 depositPeriod = 25; uint256 earlyRedeemPeriod = depositPeriod + _liquidVault.TENOR() - 1; // less than full tenor period uint256 principal = 125 * _scale;