SafeMathContract

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "1.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\r
pragma solidity ^0.8.23;\r
\r
interface IBasicContractTest {\r
    function adder(\r
        uint _a,\r
        uint _b\r
    ) external returns (uint result, bool success);\r
\r
    function subtractor(\r
        uint _a,\r
        uint _b\r
    ) external returns (uint result, bool success);\r
}\r
\r
contract SafeMathContract is IBasicContractTest {\r
    function adder(\r
        uint _a,\r
        uint _b\r
    ) external pure override returns (uint result, bool success) {\r
        if (type(uint).max - _a < _b) {\r
            return (0, true);\r
        } else {\r
            result = _a + _b;\r
            return (result, false);\r
        }\r
    }\r
\r
    function subtractor(\r
        uint _a,\r
        uint _b\r
    ) external pure override returns (uint result, bool success) {\r
        if (_b > _a) {\r
            return (0, true);\r
        } else {\r
            result = _a - _b;\r
            return (result, false);\r
        }\r
    }\r
}\r
"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0x4954417aecb6844f2a9a471b118a8e2e7aa660cc|verified:true|block:23705660|tx:0xdaa052e850e950c8bca1ef158038cc327c1a1f08bb2de70a94c200b1d6c7f0b8|first_check:1762014306

Submitted on: 2025-11-01 17:25:06

Comments

Log in to comment.

No comments yet.