Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"contracts/Hks.sol": {
"content": " // SPDX-License-Identifier: MIT\r
pragma solidity ^0.8.17;\r
\r
contract BasicMath {\r
uint256 public constant MAX_INT = type(uint256).max;\r
\r
function adder(uint256 a, uint256 b) public pure returns (uint256 result, bool error) {\r
unchecked {\r
if (a > MAX_INT - b) {\r
// Overflow -> return 0 + error = true\r
return (0, true);\r
} else {\r
return (a + b, false);\r
}\r
}\r
}\r
\r
function subtractor(uint256 a, uint256 b) public pure returns (uint256 result, bool error) {\r
unchecked {\r
if (b > a) {\r
// Underflow -> return 0 + error = true\r
return (0, true);\r
} else {\r
return (a - b, false);\r
}\r
}\r
}\r
}\r
"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-11-04 11:33:12
Comments
Log in to comment.
No comments yet.