ETH Price: $4,366.46 (-1.93%)

Contract

0x83B2C1a259152d138FA9112c99C18d00C4ee23f0

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

N/A
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
42133592025-06-26 16:42:50105 days ago1750956170  Contract Creation0 ETH

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MathHelpers

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

/**
 * @dev MathHelpers contract is recommended to use only in Shortcuts passed to EnsoWallet
 *
 * Based on OpenZepplin Contracts v4.7.3:
 * - utils/math/Math.sol
 * (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/Math.sol)
 * - utils/math/SafeMath.sol
 * (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol)
 */
contract MathHelpers {
    uint256 public constant VERSION = 2;

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) external pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) external pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) external pure returns (uint256) {
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) external pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) external pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) external pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) external pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the sum of an array of unsigned integers.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function sum(uint256[] memory values) external pure returns (uint256 total) {
        uint256 length = values.length;
        for (uint256 i = 0; i < length; ++i) {
            total += values[i];
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) external pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the results a math operation if a condition is met. Otherwise returns the 'a' value without any
     * modification.
     */
    function conditional(bool condition, bytes4 method, uint256 a, uint256 b) external view returns (uint256) {
        if (condition) {
            (bool success, bytes memory n) = address(this).staticcall(abi.encodeWithSelector(method, a, b));
            if (success) return abi.decode(n, (uint256));
        }
        return a;
    }
}

Settings
{
  "evmVersion": "cancun",
  "libraries": {},
  "metadata": {
    "appendCBOR": false,
    "bytecodeHash": "none",
    "useLiteralContent": false
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [
    "@layerzerolabs/oapp-evm/=lib/devtools/packages/oapp-evm/",
    "@layerzerolabs/lz-evm-protocol-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/protocol/",
    "@layerzerolabs/lz-evm-oapp-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/oapp/",
    "@uniswap/v4-core/=lib/v4-core/",
    "@uniswap/v4-periphery/=lib/v4-periphery/",
    "devtools/=lib/devtools/packages/toolbox-foundry/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "enso-weiroll/=lib/enso-weiroll/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "layerzero-v2/=lib/layerzero-v2/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "safe-contracts/=lib/safe-tools/lib/safe-contracts/contracts/",
    "safe-tools/=lib/safe-tools/src/",
    "solady/=lib/solady/src/",
    "solmate/=lib/solady/lib/solmate/src/",
    "@ensdomains/=lib/v4-core/node_modules/@ensdomains/",
    "@openzeppelin/=lib/v4-core/lib/openzeppelin-contracts/",
    "forge-gas-snapshot/=lib/v4-periphery/lib/permit2/lib/forge-gas-snapshot/src/",
    "hardhat/=lib/v4-core/node_modules/hardhat/",
    "permit2/=lib/v4-periphery/lib/permit2/",
    "v4-core/=lib/v4-core/src/",
    "v4-periphery/=lib/v4-periphery/"
  ],
  "viaIR": true
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"add","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"average","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bool","name":"condition","type":"bool"},{"internalType":"bytes4","name":"method","type":"bytes4"},{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"conditional","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"div","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"max","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"min","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"mod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"mul","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"sub","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"sum","outputs":[{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"pure","type":"function"}]

60808060405234601557610407908161001a8239f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c9081630194db8e14610238575080632b7423ab146102185780636d5433e6146101f8578063771602f7146101df5780637ae2b5c7146101b7578063a391c15b14610197578063b67d77c514610175578063c8a4ac9c14610137578063cf698e3d146100e9578063f43f523a146100b45763ffa1ad7414610095575f80fd5b346100b0575f3660031901126100b057602060405160028152f35b5f80fd5b346100b0576100c23661034a565b9081156100d55760209160405191068152f35b634e487b7160e01b5f52601260045260245ffd5b346100b05760803660031901126100b05760043580151581036100b057602435906001600160e01b0319821682036100b05760209161012f91606435916044359161036d565b604051908152f35b346100b0576101453661034a565b9081810291818304149015171561016157602090604051908152f35b634e487b7160e01b5f52601160045260245ffd5b346100b0576101833661034a565b810390811161016157602090604051908152f35b346100b0576101a53661034a565b80156100d55760209104604051908152f35b346100b05760206101c73661034a565b808210156101d85750604051908152f35b905061012f565b346100b057602061012f6101f23661034a565b90610360565b346100b05760206102083661034a565b8082106101d85750604051908152f35b346100b057602061012f61022b3661034a565b80821860011c9116610360565b346100b05760203660031901126100b05760043567ffffffffffffffff81116100b057366023820112156100b057806004013567ffffffffffffffff8111610314578060051b9061028c6020830185610328565b835260246020840191830101913683116100b057602401905b82821061030457835f81515f925b8184106102c557602083604051908152f35b909181518410156102f0576102e660019160208660051b8501015190610360565b93019291906102b3565b634e487b7160e01b5f52603260045260245ffd5b81358152602091820191016102a5565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff82111761031457604052565b60409060031901126100b0576004359060243590565b9190820180921161016157565b9290919261037a57505090565b5f91829160405190602082019283528560248301526044820152604481526103a3606482610328565b5190305afa3d156103ff573d9067ffffffffffffffff821161031457604051916103d7601f8201601f191660200184610328565b82523d5f602084013e5b6103e9575090565b90506020818051810103126100b0576020015190565b6060906103e156

Deployed Bytecode

0x6080806040526004361015610012575f80fd5b5f3560e01c9081630194db8e14610238575080632b7423ab146102185780636d5433e6146101f8578063771602f7146101df5780637ae2b5c7146101b7578063a391c15b14610197578063b67d77c514610175578063c8a4ac9c14610137578063cf698e3d146100e9578063f43f523a146100b45763ffa1ad7414610095575f80fd5b346100b0575f3660031901126100b057602060405160028152f35b5f80fd5b346100b0576100c23661034a565b9081156100d55760209160405191068152f35b634e487b7160e01b5f52601260045260245ffd5b346100b05760803660031901126100b05760043580151581036100b057602435906001600160e01b0319821682036100b05760209161012f91606435916044359161036d565b604051908152f35b346100b0576101453661034a565b9081810291818304149015171561016157602090604051908152f35b634e487b7160e01b5f52601160045260245ffd5b346100b0576101833661034a565b810390811161016157602090604051908152f35b346100b0576101a53661034a565b80156100d55760209104604051908152f35b346100b05760206101c73661034a565b808210156101d85750604051908152f35b905061012f565b346100b057602061012f6101f23661034a565b90610360565b346100b05760206102083661034a565b8082106101d85750604051908152f35b346100b057602061012f61022b3661034a565b80821860011c9116610360565b346100b05760203660031901126100b05760043567ffffffffffffffff81116100b057366023820112156100b057806004013567ffffffffffffffff8111610314578060051b9061028c6020830185610328565b835260246020840191830101913683116100b057602401905b82821061030457835f81515f925b8184106102c557602083604051908152f35b909181518410156102f0576102e660019160208660051b8501015190610360565b93019291906102b3565b634e487b7160e01b5f52603260045260245ffd5b81358152602091820191016102a5565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff82111761031457604052565b60409060031901126100b0576004359060243590565b9190820180921161016157565b9290919261037a57505090565b5f91829160405190602082019283528560248301526044820152604481526103a3606482610328565b5190305afa3d156103ff573d9067ffffffffffffffff821161031457604051916103d7601f8201601f191660200184610328565b82523d5f602084013e5b6103e9575090565b90506020818051810103126100b0576020015190565b6060906103e156

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0x83B2C1a259152d138FA9112c99C18d00C4ee23f0
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.