Assessment reports>DfynRFQ>Discussion>Unnecessary safeMath calls

Unnecessary safeMath functions call

The safeMath library starting from the 0.8.0 version of solidity does not implement additional checks for mathematical operations.

function add(uint256 a, uint256 b) internal pure returns (uint256) {
    return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
    return a / b;
}

You can avoid importing unnecessary library code as well as unnecessary calls to these functions to optimize the amount of gas used.

Zellic © 2024Back to top ↑