Address
0x77e034c8a1392d99a2c776a6c1593866fee36a33Current Holdings
$741.63
TXs sent
not counted
First Active
not recorded
Last Active
not recorded
Net worth historyi
16 snapshots · to block 27,530,852coverage change 26 Augcoverage change 27 Augcoverage change 27 Augcoverage change 27 Augcoverage change 27 Aug
exact matchActivePoolsolc 0.8.14+commit.80d49f37runtime exact · creation exact
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./ERC20Decimals.sol";
library SafetyTransfer {
using SafeMath for uint256;
//_amount is in ether (1e18) and we want to convert it to the token decimal
function decimalsCorrection(address _token, uint256 _amount)
internal
view
returns (uint256)
{
if (_token == address(0)) return _amount;
if (_amount == 0) return 0;
uint8 decimals = ERC20Decimals(_token).decimals();
if (decimals < 18) {
return _amount.div(10**(18 - decimals));
} else {
return _amount.mul(10**(decimals - 18));
}
}
}