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": {
    "john.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.23;

interface IBasicContractTest {
    function adder(
        uint _a,
        uint _b
    ) external returns (uint result, bool success);

    function subtractor(
        uint _a,
        uint _b
    ) external returns (uint result, bool success);
}

contract SafeMathContract is IBasicContractTest {
    function adder(
        uint _a,
        uint _b
    ) external pure override returns (uint result, bool success) {
        if (type(uint).max - _a < _b) {
            return (0, true);
        } else {
            result = _a + _b;
            return (result, false);
        }
    }

    function subtractor(
        uint _a,
        uint _b
    ) external pure override returns (uint result, bool success) {
        if (_b > _a) {
            return (0, true);
        } else {
            result = _a - _b;
            return (result, false);
        }
    }
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0x147d905206afa151585f8d47a4ea120664aeb9b0|verified:true|block:23691341|tx:0x536c0571787e96f3471962438602ef97c6bc97fdf185a21aa49afb9aec57e7a4|first_check:1761844691

Submitted on: 2025-10-30 18:18:14

Comments

Log in to comment.

No comments yet.