Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kyriediculous committed Mar 29, 2024
1 parent ea56228 commit 7e22e77
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"scripts": {
"clean": "rm -rf cache out",
"lint": "yarn lint:sol && yarn prettier:check",
"lint:sol": "forge fmt --check && yarn solhint {script,src,test}/**/*.sol",
"lint:sol": "yarn solhint {src,test}/**/*.sol",
"prettier:check": "prettier --check **/*.{json,md,yml} --ignore-path=.prettierignore",
"prettier:write": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore"
}
}
}
5 changes: 0 additions & 5 deletions src/Swap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import { ERC721Receiver } from "@tenderize/swap/util/ERC721Receiver.sol";
import { LPToken } from "@tenderize/swap/LPToken.sol";
import { UnlockQueue } from "@tenderize/swap/UnlockQueue.sol";

import { console } from "forge-std/Test.sol";

pragma solidity 0.8.19;

error ErrorNotMature(uint256 maturity, uint256 timestamp);
Expand Down Expand Up @@ -248,20 +246,17 @@ contract TenderSwap is Initializable, UUPSUpgradeable, OwnableUpgradeable, SwapS
uint256 availableLpShares = lpToken.balanceOf(msg.sender);
LastDeposit storage ld = $.lastDeposit[msg.sender];
if (ld.timestamp > 0) {
console.log("time passed", block.timestamp - ld.timestamp);
uint256 timePassed = block.timestamp - ld.timestamp;
if (timePassed < COOLDOWN) {
uint256 remaining = COOLDOWN - timePassed;
uint256 cdAmount = FixedPointMathLib.mulDivUp(ld.amount, remaining, COOLDOWN);
console.log("cdAmount", cdAmount);
uint256 cdLpShares = _calculateLpShares(cdAmount);
availableLpShares -= cdLpShares;
}
}

// Calculate LP tokens to burn
uint256 lpShares = _calculateLpShares(amount);
console.log("wanted-avail", lpShares, availableLpShares);
if (lpShares > availableLpShares) revert ErrorWithdrawCooldown(lpShares, availableLpShares);
if (lpShares > maxLpSharesBurnt) revert ErrorSlippage(lpShares, maxLpSharesBurnt);

Expand Down
6 changes: 0 additions & 6 deletions test/Swap.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ import { UnlockQueue } from "@tenderize/swap/UnlockQueue.sol";

import { acceptableDelta } from "./helpers/Utils.sol";

import { console } from "forge-std/console.sol";

contract TenderSwapTest is Test {
MockERC20 underlying;
MockERC20 tToken0;
Expand Down Expand Up @@ -84,7 +82,6 @@ contract TenderSwapTest is Test {
}

function testFuzz_deposits(uint256 x, uint256 y, uint256 l) public {
console.log(block.timestamp);
uint256 deposit1 = bound(x, 100, type(uint128).max);
l = bound(l, deposit1, deposit1 * 1e18);
uint256 deposit2 = bound(y, 100, type(uint128).max);
Expand All @@ -107,8 +104,6 @@ contract TenderSwapTest is Test {

uint256 expBal2 = deposit2 * (deposit1 * 1e18 / l);

console.log("u b of", underlying.balanceOf(address(swap)));

assertEq(swap.lpToken().totalSupply(), (deposit1 * 1e18 + expBal2), "lpToken totalSupply");
assertEq(swap.lpToken().balanceOf(addr1), deposit1 * 1e18, "addr1 lpToken balance");
assertEq(swap.lpToken().balanceOf(addr2), expBal2, "addr2 lpToken balance");
Expand Down Expand Up @@ -142,7 +137,6 @@ contract TenderSwapTest is Test {

// deposit again, the new cooldown amount will be half of the previous plus our new deposit
uint256 deposit2 = bound(deposit, 100, deposit);
console.log("deposit2", deposit2);
underlying.mint(address(this), deposit2);
underlying.approve(address(swap), deposit2);
swap.deposit(deposit2, 0);
Expand Down

0 comments on commit 7e22e77

Please sign in to comment.