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:0x52f5fc53a3ccaaaad5a5794d5d347327f1bc532d|verified:true|block:23683196|tx:0x559d2495449e2d9c57af3af34e6e09841268d1d0599a35e43f8d8e7c99a70ef9|first_check:1761746327

Submitted on: 2025-10-29 14:58:47

Comments

Log in to comment.

No comments yet.