Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: per audit suggestions #132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/WooPPV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ contract WooPPV2 is Ownable, ReentrancyGuard, Pausable, IWooPPV2 {
// case 2: fromToken --> quoteToken
realToAmount = _sellBase(fromToken, fromAmount, minToAmount, to, rebateTo);
} else {
// case 3: fromToken --> toToken (base to base)
// case 3: fromToken --> quoteToken --> toToken (base to base)
realToAmount = _swapBaseToBase(fromToken, toToken, fromAmount, minToAmount, to, rebateTo);
}
}
Expand Down
3 changes: 2 additions & 1 deletion contracts/earn/WooSuperChargerVaultV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ contract WooSuperChargerVaultV2 is ERC20, Ownable, Pausable, ReentrancyGuard {

lendingManager.accureInterest();
uint256 shares = _shares(amount, getPricePerFullShare());
require(shares > 0, "!shares");
require(shares > 0, "WooSuperChargerVault: !shares");

uint256 sharesBefore = balanceOf(receiver) + stakedShares(receiver);
uint256 costBefore = costSharePrice[receiver];
Expand All @@ -203,6 +203,7 @@ contract WooSuperChargerVaultV2 is ERC20, Ownable, Pausable, ReentrancyGuard {
}
_mint(receiver, shares);

require(amount > 10, "WooSuperChargerVault: !amount");
instantWithdrawCap = instantWithdrawCap + amount / 10;

emit Deposit(msg.sender, receiver, amount, shares);
Expand Down
Loading