false
false
0
The new Blockscout UI is now open source! Learn how to deploy it here
- We're indexing this chain right now. Some of the counts may be inaccurate.

Contract Address Details

0xff5Cbc4075117DF64F2923F002143c1Dc34e32a3

Contract Name
MathContract
Creator
0xb56259–d2f808 at 0x616a9d–5a7779
Balance
0 ETH
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
2494978
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
MathContract




Optimization enabled
false
Compiler version
v0.8.25+commit.b61c2a91




EVM Version
default




Verified at
2024-05-15T08:46:05.707196Z

Contract source code

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.25;

contract MathContract {
    function calculateFactorial(uint n) public pure returns (uint) {
    uint result = 1;
    for (uint i = 1; i <= n; i++) {
        result *= i;
    }
    return result;
}

function calculatePower(uint base, uint exponent) public pure returns (uint) {
    return base ** exponent;
}

function calculateSquareRoot(uint x) public pure returns (uint) {
    uint guess = x / 2;
    uint previousGuess;

    while (guess != previousGuess) {
        previousGuess = guess;
        guess = (guess + x / guess) / 2;
    }

    return guess;
}
}
        

Contract ABI

[{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateFactorial","inputs":[{"type":"uint256","name":"n","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculatePower","inputs":[{"type":"uint256","name":"base","internalType":"uint256"},{"type":"uint256","name":"exponent","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateSquareRoot","inputs":[{"type":"uint256","name":"x","internalType":"uint256"}]}]
              

Contract Creation Code

Verify & Publish
0x6080604052348015600e575f80fd5b506105338061001c5f395ff3fe608060405234801561000f575f80fd5b506004361061003f575f3560e01c80633d41c22214610043578063c50d9bdd14610073578063f979f269146100a3575b5f80fd5b61005d600480360381019061005891906101ae565b6100d3565b60405161006a91906101e8565b60405180910390f35b61008d600480360381019061008891906101ae565b610111565b60405161009a91906101e8565b60405180910390f35b6100bd60048036038101906100b89190610201565b610162565b6040516100ca91906101e8565b60405180910390f35b5f80600190505f600190505b8381116101075780826100f2919061026c565b915080806100ff906102ad565b9150506100df565b5080915050919050565b5f806002836101209190610321565b90505f5b808214610158578190506002828561013c9190610321565b836101479190610351565b6101519190610321565b9150610124565b8192505050919050565b5f818361016f91906104b3565b905092915050565b5f80fd5b5f819050919050565b61018d8161017b565b8114610197575f80fd5b50565b5f813590506101a881610184565b92915050565b5f602082840312156101c3576101c2610177565b5b5f6101d08482850161019a565b91505092915050565b6101e28161017b565b82525050565b5f6020820190506101fb5f8301846101d9565b92915050565b5f806040838503121561021757610216610177565b5b5f6102248582860161019a565b92505060206102358582860161019a565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6102768261017b565b91506102818361017b565b925082820261028f8161017b565b915082820484148315176102a6576102a561023f565b5b5092915050565b5f6102b78261017b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036102e9576102e861023f565b5b600182019050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61032b8261017b565b91506103368361017b565b925082610346576103456102f4565b5b828204905092915050565b5f61035b8261017b565b91506103668361017b565b925082820190508082111561037e5761037d61023f565b5b92915050565b5f8160011c9050919050565b5f808291508390505b60018511156103d9578086048111156103b5576103b461023f565b5b60018516156103c45780820291505b80810290506103d285610384565b9450610399565b94509492505050565b5f826103f157600190506104ac565b816103fe575f90506104ac565b8160018114610414576002811461041e5761044d565b60019150506104ac565b60ff8411156104305761042f61023f565b5b8360020a9150848211156104475761044661023f565b5b506104ac565b5060208310610133831016604e8410600b84101617156104825782820a90508381111561047d5761047c61023f565b5b6104ac565b61048f8484846001610390565b925090508184048111156104a6576104a561023f565b5b81810290505b9392505050565b5f6104bd8261017b565b91506104c88361017b565b92506104f57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846103e2565b90509291505056fea2646970667358221220bdf45836967ba08621f5ed5fa0dcd015988b99cf27d1a27eb4e16fb150917b7a64736f6c63430008190033

Deployed ByteCode

0x608060405234801561000f575f80fd5b506004361061003f575f3560e01c80633d41c22214610043578063c50d9bdd14610073578063f979f269146100a3575b5f80fd5b61005d600480360381019061005891906101ae565b6100d3565b60405161006a91906101e8565b60405180910390f35b61008d600480360381019061008891906101ae565b610111565b60405161009a91906101e8565b60405180910390f35b6100bd60048036038101906100b89190610201565b610162565b6040516100ca91906101e8565b60405180910390f35b5f80600190505f600190505b8381116101075780826100f2919061026c565b915080806100ff906102ad565b9150506100df565b5080915050919050565b5f806002836101209190610321565b90505f5b808214610158578190506002828561013c9190610321565b836101479190610351565b6101519190610321565b9150610124565b8192505050919050565b5f818361016f91906104b3565b905092915050565b5f80fd5b5f819050919050565b61018d8161017b565b8114610197575f80fd5b50565b5f813590506101a881610184565b92915050565b5f602082840312156101c3576101c2610177565b5b5f6101d08482850161019a565b91505092915050565b6101e28161017b565b82525050565b5f6020820190506101fb5f8301846101d9565b92915050565b5f806040838503121561021757610216610177565b5b5f6102248582860161019a565b92505060206102358582860161019a565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6102768261017b565b91506102818361017b565b925082820261028f8161017b565b915082820484148315176102a6576102a561023f565b5b5092915050565b5f6102b78261017b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036102e9576102e861023f565b5b600182019050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61032b8261017b565b91506103368361017b565b925082610346576103456102f4565b5b828204905092915050565b5f61035b8261017b565b91506103668361017b565b925082820190508082111561037e5761037d61023f565b5b92915050565b5f8160011c9050919050565b5f808291508390505b60018511156103d9578086048111156103b5576103b461023f565b5b60018516156103c45780820291505b80810290506103d285610384565b9450610399565b94509492505050565b5f826103f157600190506104ac565b816103fe575f90506104ac565b8160018114610414576002811461041e5761044d565b60019150506104ac565b60ff8411156104305761042f61023f565b5b8360020a9150848211156104475761044661023f565b5b506104ac565b5060208310610133831016604e8410600b84101617156104825782820a90508381111561047d5761047c61023f565b5b6104ac565b61048f8484846001610390565b925090508184048111156104a6576104a561023f565b5b81810290505b9392505050565b5f6104bd8261017b565b91506104c88361017b565b92506104f57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846103e2565b90509291505056fea2646970667358221220bdf45836967ba08621f5ed5fa0dcd015988b99cf27d1a27eb4e16fb150917b7a64736f6c63430008190033