BasicMath

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "contracts/BasicMath.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract BasicMath {
    uint256 constant MAX_INT = type(uint256).max;

    function adder(uint256 _a, uint256 _b) external pure returns (uint256 sum, bool error) {
        if (_b > MAX_INT - _a) {
            return (0, true); // Overflow occurred
        }
        return (_a + _b, false);
    }

    function subtractor(uint256 _a, uint256 _b) external pure returns (uint256 difference, bool error) {
        if (_b > _a) {
            return (0, true); // Underflow occurred
        }
        return (_a - _b, false);
    }
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0xff2549a3dadcee40249317c72cb213b7d81cd09e|verified:true|block:23685056|tx:0x5635837c846399417c4e837620f1e6e654843267472625fe943273c00d7893fc|first_check:1761766133

Submitted on: 2025-10-29 20:28:53

Comments

Log in to comment.

No comments yet.