ETH Price: $3,558.53 (+1.29%)
Gas: 27 Gwei

Contract

0x21b7637f29E2476C3D540219D8aB8B85B114C2B1
 

Overview

ETH Balance

0.1 ETH

Eth Value

$355.85 (@ $3,558.53/ETH)

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Claim53998882018-04-07 23:15:432182 days ago1523142943IN
0x21b7637f...5B114C2B1
0 ETH0.005040.9
Claim53997322018-04-07 22:41:402182 days ago1523140900IN
0x21b7637f...5B114C2B1
0 ETH0.000075921
Claim50472392018-02-07 13:22:432241 days ago1518009763IN
0x21b7637f...5B114C2B1
0 ETH0.0007170525
Claim50467402018-02-07 11:20:512241 days ago1518002451IN
0x21b7637f...5B114C2B1
0 ETH0.000057362
Claim50439922018-02-07 0:10:222242 days ago1517962222IN
0x21b7637f...5B114C2B1
0 ETH0.0010288541
Claim50439702018-02-07 0:04:402242 days ago1517961880IN
0x21b7637f...5B114C2B1
0 ETH0.0010131141
Claim50421172018-02-06 16:41:432242 days ago1517935303IN
0x21b7637f...5B114C2B1
0 ETH0.007200052
Add Balance50417732018-02-06 15:20:232242 days ago1517930423IN
0x21b7637f...5B114C2B1
0.1 ETH0.000085964
0x6060604050416892018-02-06 15:01:252242 days ago1517929285IN
 Create: Fermat
0 ETH0.001922544

Advanced mode:
Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Fermat

Compiler Version
v0.4.18+commit.9cf6e910

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-02-06
*/

pragma solidity ^0.4.18;

/**
* A contract that pays off, if a user is able to produce a valid solution
* for the Fermat's last theorem
*/

contract Fermat {

    /**
    *  The owner is the creator of the contract.

    *  The owner will be able to withdraw the
    *  bounty after the releaseTime has passed.

    *  The release time is set to 17280000 seconds (= 200 days)
    *  in the future from the timestamp of the contract creation
    */
    address public owner = msg.sender;
    uint releaseTime = now + 17280000;

    /**
    * This function is used to increase the bounty
    */
    function addBalance() public payable {

    }

    function getOwner() view public returns (address)  {
        return owner;
    }

    /*
    * Returns the time when it is possible for the owner
    * to withdraw the deposited funds from the contract.
    */
    function getReleaseTime() view public returns (uint)  {
        return releaseTime;
    }

    /**
     * Allow the owner of the contract to
     * withdraw the bounty after the release time has passed
     */
    function withdraw() public {
        require(msg.sender == owner);
        require(now >= releaseTime);

        msg.sender.transfer(this.balance);
    }

    function getBalance() view public returns (uint256) {
        return this.balance;
    }

    /**
     * The function that is used to claim the bounty.
     * If the caller is able to provide satisfying values for a,b,c and n
     * the balance of the contract (the bounty) is transferred to the caller
    */
    function claim(uint256 a, uint256 b, uint256 c, uint256 n) public {
        uint256 value = solve(a, b, c, n);
        if (value == 0) {
            msg.sender.transfer(this.balance);
        }
    }



    /*
     * The "core" logic of the smart contract.
     * Calculates the equation with provided values for Fermat's last theorem.
     * Returns the value of a^n + b^n - c^n, n > 2
     */
    function solve(uint256 a, uint256 b, uint256 c, uint256 n) pure public returns (uint256) {
        assert(n > 2);
        assert(a > 0);
        assert(b > 0);
        assert(c > 0);
        uint256 aExp = power(a, n);
        uint256 bExp = power(b, n);
        uint256 cExp = power(c, n);

        uint256 sum = add(aExp, bExp);
        uint256 difference = sub(sum, cExp);
        return difference;
    }

    /*
     A safe way to handle exponentiation. Throws error on overflow.
    */
    function power(uint256 a, uint256 pow) pure public returns (uint256) {
        assert(a > 0);
        assert(pow > 0);
        uint256 result = 1;
        if (a == 0) {
            return 1;
        }
        uint256 temp;
        for (uint256 i = 0; i < pow; i++) {
            temp = result * a;
            assert((temp / a) == result);
            result = temp;
        }
        return uint256(result);
    }

    /*
     A safe way to handle addition. Throws error on overflow.
    */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }

    /*
     A safe way to handle subtraction. Throws error on underflow.
    */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }


}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"getBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getReleaseTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"addBalance","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"},{"name":"c","type":"uint256"},{"name":"n","type":"uint256"}],"name":"claim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"},{"name":"c","type":"uint256"},{"name":"n","type":"uint256"}],"name":"solve","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"pow","type":"uint256"}],"name":"power","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"}]

6060604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550630107ac004201600155341561005957600080fd5b6105a0806100686000396000f300606060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806312065fe01461009e5780633ccfd60b146100c757806353462d6b146100dc578063893d20e8146101055780638da5cb5b1461015a578063b163cc38146101af578063b5add717146101b9578063b8c8fb73146101f7578063c04f01fc14610249575b600080fd5b34156100a957600080fd5b6100b1610289565b6040518082815260200191505060405180910390f35b34156100d257600080fd5b6100da6102a8565b005b34156100e757600080fd5b6100ef61036d565b6040518082815260200191505060405180910390f35b341561011057600080fd5b610118610377565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561016557600080fd5b61016d6103a0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b76103c5565b005b34156101c457600080fd5b6101f560048080359060200190919080359060200190919080359060200190919080359060200190919050506103c7565b005b341561020257600080fd5b610233600480803590602001909190803590602001909190803590602001909190803590602001909190505061043f565b6040518082815260200191505060405180910390f35b341561025457600080fd5b61027360048080359060200190919080359060200190919050506104c4565b6040518082815260200191505060405180910390f35b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561030357600080fd5b600154421015151561031457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561036b57600080fd5b565b6000600154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b565b60006103d58585858561043f565b90506000811415610438573373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561043757600080fd5b5b5050505050565b60008060008060008060028711151561045457fe5b60008a11151561046057fe5b60008911151561046c57fe5b60008811151561047857fe5b6104828a886104c4565b945061048e89886104c4565b935061049a88886104c4565b92506104a6858561053d565b91506104b2828461055b565b90508095505050505050949350505050565b6000806000806000861115156104d657fe5b6000851115156104e257fe5b6001925060008614156104f85760019350610534565b600090505b8481101561053057858302915082868381151561051657fe5b0414151561052057fe5b81925080806001019150506104fd565b8293505b50505092915050565b600080828401905083811015151561055157fe5b8091505092915050565b600082821115151561056957fe5b8183039050929150505600a165627a7a7230582039fa60bfb461546cf57ce7598cd2657fe63a1140d254516f3bb663b179eec1b90029

Deployed Bytecode

0x606060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806312065fe01461009e5780633ccfd60b146100c757806353462d6b146100dc578063893d20e8146101055780638da5cb5b1461015a578063b163cc38146101af578063b5add717146101b9578063b8c8fb73146101f7578063c04f01fc14610249575b600080fd5b34156100a957600080fd5b6100b1610289565b6040518082815260200191505060405180910390f35b34156100d257600080fd5b6100da6102a8565b005b34156100e757600080fd5b6100ef61036d565b6040518082815260200191505060405180910390f35b341561011057600080fd5b610118610377565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561016557600080fd5b61016d6103a0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b76103c5565b005b34156101c457600080fd5b6101f560048080359060200190919080359060200190919080359060200190919080359060200190919050506103c7565b005b341561020257600080fd5b610233600480803590602001909190803590602001909190803590602001909190803590602001909190505061043f565b6040518082815260200191505060405180910390f35b341561025457600080fd5b61027360048080359060200190919080359060200190919050506104c4565b6040518082815260200191505060405180910390f35b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561030357600080fd5b600154421015151561031457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561036b57600080fd5b565b6000600154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b565b60006103d58585858561043f565b90506000811415610438573373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561043757600080fd5b5b5050505050565b60008060008060008060028711151561045457fe5b60008a11151561046057fe5b60008911151561046c57fe5b60008811151561047857fe5b6104828a886104c4565b945061048e89886104c4565b935061049a88886104c4565b92506104a6858561053d565b91506104b2828461055b565b90508095505050505050949350505050565b6000806000806000861115156104d657fe5b6000851115156104e257fe5b6001925060008614156104f85760019350610534565b600090505b8481101561053057858302915082868381151561051657fe5b0414151561052057fe5b81925080806001019150506104fd565b8293505b50505092915050565b600080828401905083811015151561055157fe5b8091505092915050565b600082821115151561056957fe5b8183039050929150505600a165627a7a7230582039fa60bfb461546cf57ce7598cd2657fe63a1140d254516f3bb663b179eec1b90029

Swarm Source

bzzr://39fa60bfb461546cf57ce7598cd2657fe63a1140d254516f3bb663b179eec1b9

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

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.