BasicMath

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/BasicMath.sol": {
      "content": "// SPDX-License-Identifier: MIT\r
pragma solidity ^0.8.0;\r
\r
contract BasicMath {\r
    uint256 constant MAX_INT = type(uint256).max;\r
\r
    function adder(uint256 _a, uint256 _b) external pure returns (uint256 sum, bool error) {\r
        if (_b > MAX_INT - _a) {\r
            return (0, true); // Overflow occurred\r
        }\r
        return (_a + _b, false);\r
    }\r
\r
    function subtractor(uint256 _a, uint256 _b) external pure returns (uint256 difference, bool error) {\r
        if (_b > _a) {\r
            return (0, true); // Underflow occurred\r
        }\r
        return (_a - _b, false);\r
    }\r
}"
    }
  },
  "settings": {
    "evmVersion": "prague",
    "metadata": {
      "bytecodeHash": "ipfs"
    },
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "remappings": [],
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    }
  }
}}

Tags:
Factory|addr:0x0fc36e23aa86a83a27ac752e504e854197de0214|verified:true|block:23729705|tx:0xd9d48fa08425f6067d0bd5b49c5b7568ec3f712a3e52d1f3ab37413efe567c04|first_check:1762340031

Submitted on: 2025-11-05 11:53:52

Comments

Log in to comment.

No comments yet.