Skip to content

Commit

Permalink
fixed slither complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
David405 committed Apr 15, 2024
1 parent 14918f6 commit 502ff95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 37 deletions.
17 changes: 0 additions & 17 deletions contracts/USDC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,6 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
* @dev Interface of the zTokens to be used by Baki
*/
interface USDCInterface {
/**
* @dev Amount of zTokens to be minted for a user
* requires onlyVault modifier
*/
function mint(address _address, uint256 _amount) external returns (bool);

/**
* @dev Amount of zTokens to be burned after swap/repay functions
* requires onlyVault modifier
*/
function burn(address _address, uint256 _amount) external returns (bool);
}

contract USDC is ERC20, AccessControl, Ownable {

constructor() ERC20("USDC", "USDC") Ownable(msg.sender) {
Expand Down
16 changes: 10 additions & 6 deletions contracts/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ contract Vault is

mapping(address => uint256) public userAccruedFeeBalance;

mapping(address => uint256) private mintersRewardPerTransaction;

uint256 public globalMintersFee;

address public treasuryWallet;
Expand Down Expand Up @@ -223,12 +221,14 @@ contract Vault is

_testImpact();

collateral.transferFrom(
bool success = collateral.transferFrom(
msg.sender,
address(this),
depositAmountInUSDC
);

if (!success) revert();

emit Deposit(msg.sender, _depositAmount, _mintAmount);
}

Expand Down Expand Up @@ -365,11 +365,13 @@ contract Vault is

uint256 amountToWithdrawInUSDC = _amountToWithdraw / USDC_DIVISOR;

collateral.transfer(
bool success = collateral.transfer(
msg.sender,
amountToWithdrawInUSDC
);

if (!success) revert();

emit Withdraw(msg.sender, _zToken, _amountToWithdraw);
}

Expand Down Expand Up @@ -410,20 +412,22 @@ contract Vault is

totalCollateral -= totalRewards;

collateral.transfer(
bool success = collateral.transfer(
msg.sender,
totalRewardsInUSDC
);
if (!success) revert();

} else {
userCollateralBalance[_user] -= totalRewards;

totalCollateral -= totalRewards;

collateral.transfer(
bool success = collateral.transfer(
msg.sender,
totalRewardsInUSDC
);
if (!success) revert();
}

emit Liquidate(_user, userDebt, totalRewards, msg.sender);
Expand Down
15 changes: 1 addition & 14 deletions contracts/usdc_faucet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,7 @@
pragma solidity 0.8.20;

import "@openzeppelin/contracts/access/Ownable.sol";

interface USDCInterface {
/**
* @dev Amount of zTokens to be minted for a user
* requires onlyVault modifier
*/
function mint(address _address, uint256 _amount) external returns (bool);

/**
* @dev Amount of zTokens to be burned after swap/repay functions
* requires onlyVault modifier
*/
function burn(address _address, uint256 _amount) external returns (bool);
}
import "./interfaces/USDCInterface.sol";

contract USDCFaucet is Ownable {
address public USDC;
Expand Down

0 comments on commit 502ff95

Please sign in to comment.