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": {
    "TESTBASE2.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
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0xce0df67a24be3ae7a1d322fc5ca5f8c362188060|verified:true|block:23683226|tx:0x24d61b8166f80393a3769d8ce0360ec2773d4e82c152ae954d648d9a8225c7ee|first_check:1761743264

Submitted on: 2025-10-29 14:07:45

Comments

Log in to comment.

No comments yet.