Skip to content

Commit

Permalink
Fixes OZ Audit 2 N03 and N04 (#208)
Browse files Browse the repository at this point in the history
* Fixed underflow in captureAwardBalance

* Fixes OZ Audit 2 issues M01 and L02

* Update yVaultInterface#token() to return IERC20 interface

* Fixed oz-audit-2 issue N02: Made internal variable naming more consistent.

* Fixes OZ Audit 2 N03 and N04
  • Loading branch information
asselstine committed Nov 30, 2020
1 parent 7cb1756 commit 281bcf7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions contracts/external/yearn/yVaultInterface.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.so
interface yVaultInterface is IERC20 {
function token() external view returns (IERC20);

function balance() external view returns (uint);
function balance() external view returns (uint256);

function deposit(uint _amount) external;
function deposit(uint256 _amount) external;

function withdraw(uint _shares) external;
function withdraw(uint256 _shares) external;

function getPricePerFullShare() external view returns (uint);
function getPricePerFullShare() external view returns (uint256);
}
2 changes: 1 addition & 1 deletion contracts/prize-pool/PrizePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ abstract contract PrizePool is YieldSource, OwnableUpgradeSafe, RelayRecipient,
return (earlyExitFee, creditBurned);
}

/// @notice Allows the Governor to set a cap on the amount of liquidity that he pool can hold
/// @notice Allows the Governor to set a cap on the amount of liquidity that the pool can hold
/// @param _liquidityCap The new liquidity cap for the prize pool
function setLiquidityCap(uint256 _liquidityCap) external onlyOwner {
_setLiquidityCap(_liquidityCap);
Expand Down
2 changes: 1 addition & 1 deletion contracts/prize-pool/yearn/yVaultPrizePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ contract yVaultPrizePool is PrizePool {
uint256 amountWithdrawn = postBalance.sub(preBalance);
uint256 amountRedeemable = (amountWithdrawn < amount) ? amountWithdrawn : amount;

// Redeposit any asset funds that were removed premptively for fees
// Redeposit any asset funds that were removed preemptively for fees
if (postBalance > amountRedeemable) {
_supplySpecific(postBalance.sub(amountRedeemable));
}
Expand Down

0 comments on commit 281bcf7

Please sign in to comment.