Skip to content

Commit

Permalink
fix: Remove unneded use of SafeMath
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Oct 1, 2021
1 parent c351627 commit a9584f8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions contracts/dependencies/openzeppelin/contracts/SafeERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pragma solidity 0.8.7;

import {IERC20} from './IERC20.sol';
import {SafeMath} from './SafeMath.sol';
import {Address} from './Address.sol';

/**
Expand All @@ -16,7 +15,6 @@ import {Address} from './Address.sol';
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;

function safeTransfer(
Expand Down
5 changes: 1 addition & 4 deletions contracts/mocks/flashloan/MockFlashLoanReceiver.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.7;

import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol';
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol';
import {FlashLoanReceiverBase} from '../../flashloan/base/FlashLoanReceiverBase.sol';
import {MintableERC20} from '../tokens/MintableERC20.sol';

contract MockFlashLoanReceiver is FlashLoanReceiverBase {
using SafeERC20 for IERC20;
using SafeMath for uint256;

IPoolAddressesProvider internal _provider;

Expand Down Expand Up @@ -71,7 +68,7 @@ contract MockFlashLoanReceiver is FlashLoanReceiverBase {

uint256 amountToReturn = (_amountToApprove != 0)
? _amountToApprove
: amounts[i].add(premiums[i]);
: amounts[i] + premiums[i];
//execution does not fail - mint tokens and return them to the _destination

token.mint(premiums[i]);
Expand Down
1 change: 0 additions & 1 deletion contracts/protocol/libraries/math/MathUtils.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.7;

import {SafeMath} from '../../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {WadRayMath} from './WadRayMath.sol';

/**
Expand Down
1 change: 0 additions & 1 deletion contracts/protocol/tokenization/StableDebtToken.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.7;

import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
import {MathUtils} from '../libraries/math/MathUtils.sol';
Expand Down

0 comments on commit a9584f8

Please sign in to comment.