Merge pull request #10 from logos-co:3esmit/issue5

Remove SafeMath
This commit is contained in:
Ricardo Guilherme Schmidt 2023-09-26 12:09:17 -03:00 committed by GitHub
commit c2257eb892
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 50 deletions

0
.gas-snapshot Normal file
View File

View File

@ -3,7 +3,6 @@ pragma solidity ^0.8.18;
import { TokenController } from "@vacp2p/minime/contracts/TokenController.sol";
import { MiniMeToken } from "@vacp2p/minime/contracts/MiniMeToken.sol";
import "./SafeMath.sol";
import "./Owned.sol";
/*
@ -31,8 +30,6 @@ import "./Owned.sol";
/// logic for transferring control of the token to the network when the offering
/// asks it to do so.
contract SNTPlaceHolder is TokenController, Owned {
using SafeMath for uint256;
MiniMeToken public snt;
constructor(address _owner, address payable _snt) {

View File

@ -1,47 +0,0 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.18;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}