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": {
    "101.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:0xea42451aada68d1a521222eb344b8881a130f59c|verified:true|block:23691475|tx:0xd3f4286208333e228cff8caa07123328c718feaa662be4f0fc1951eb8e653239|first_check:1761846334

Submitted on: 2025-10-30 18:45:37

Comments

Log in to comment.

No comments yet.