ETH Price: $3,119.41 (+0.73%)

Contract

0x3Cd275B60644caDF7C5D428c4A0d2771a2be7ebD
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Unstake203538922024-07-21 9:03:23118 days ago1721552603IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000097322.44027965
Unstake203538842024-07-21 9:01:47118 days ago1721552507IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000097342.43931897
Unstake203538202024-07-21 8:48:59118 days ago1721551739IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000084522.11803604
Unstake203538012024-07-21 8:45:11118 days ago1721551511IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000096882.16705617
Unstake203537872024-07-21 8:42:23118 days ago1721551343IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000089892.48241205
Unstake203537852024-07-21 8:41:59118 days ago1721551319IN
0x3Cd275B6...1a2be7ebD
0 ETH0.00009692.42821731
Stake203536992024-07-21 8:24:47118 days ago1721550287IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000194512.80899521
Stake203535952024-07-21 8:03:47118 days ago1721549027IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000194772.81273656
Stake203535622024-07-21 7:57:11118 days ago1721548631IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000157332.44128315
Stake203535272024-07-21 7:50:11118 days ago1721548211IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000148572.30542122
Stake203458742024-07-20 6:12:35119 days ago1721455955IN
0x3Cd275B6...1a2be7ebD
0 ETH0.000247923.04070986
0x60806040203417622024-07-19 16:26:11119 days ago1721406371IN
 Create: MarsStake
0 ETH0.0046710614.42818777

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MarsStake

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 2 : MarsStake.sol
pragma solidity ^0.8.22;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract MarsStake {
    address public lmc;

    struct User {
        uint256 stake;
        uint256 last;
        uint256 point;
    }

    mapping(address => User) public users;

    address[] public userAddresses;

    constructor() {
        //test
        // lmc = 0x5195b2709770180903b7aCB3841B081Ec7b6DfFf;
        //main
        lmc = 0x8983CF891867942d06AD6CEb9B9002de860E202d;
    }

    function getUserAddressesLength() external view returns (uint256) {
        return userAddresses.length;
    }

    function stake(uint256 amount) external {
        User storage user = users[msg.sender];
        IERC20(lmc).transferFrom(msg.sender, address(this), amount);
        user.stake += amount;
    }

    function unstake(uint256 amount) external {
        User storage user = users[msg.sender];
        require(user.stake >= amount, "Insufficient balance");
        IERC20(lmc).transfer(msg.sender, amount);
        user.stake -= amount;
    }

    function getPendingPoint(address addr) external view returns (uint256) {
        User memory user = users[addr];
        uint256 stakeUint = user.stake / 360 ether;
        return stakeUint * 1000;
    }
}

File 2 of 2 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"getPendingPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUserAddressesLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lmc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"userAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"users","outputs":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"last","type":"uint256"},{"internalType":"uint256","name":"point","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561000f575f80fd5b505f80546001600160a01b031916738983cf891867942d06ad6ceb9b9002de860e202d17905561047a806100425f395ff3fe608060405234801561000f575f80fd5b506004361061007a575f3560e01c8063a694fc3a11610058578063a694fc3a146100d5578063a87430ba146100e8578063b149e56814610130578063d67fd58214610151575f80fd5b80632e17de781461007e578063502c9bd51461009357806353cdcd2a146100c3575b5f80fd5b61009161008c36600461036b565b610159565b005b6100a66100a136600461036b565b610240565b6040516001600160a01b0390911681526020015b60405180910390f35b5f546100a6906001600160a01b031681565b6100916100e336600461036b565b610268565b6101156100f6366004610382565b600160208190525f918252604090912080549181015460029091015483565b604080519384526020840192909252908201526060016100ba565b61014361013e366004610382565b610304565b6040519081526020016100ba565b600254610143565b335f90815260016020526040902080548211156101b35760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640160405180910390fd5b5f5460405163a9059cbb60e01b8152336004820152602481018490526001600160a01b039091169063a9059cbb906044016020604051808303815f875af1158015610200573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061022491906103af565b5081815f015f82825461023791906103e2565b90915550505050565b6002818154811061024f575f80fd5b5f918252602090912001546001600160a01b0316905081565b335f81815260016020526040808220915490516323b872dd60e01b815260048101939093523060248401526044830184905290916001600160a01b03909116906323b872dd906064016020604051808303815f875af11580156102cd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102f191906103af565b5081815f015f82825461023791906103fb565b6001600160a01b0381165f90815260016020818152604080842081516060810183528154808252948201549381019390935260020154908201529082906103559068138400eca364a000009061040e565b9050610363816103e861042d565b949350505050565b5f6020828403121561037b575f80fd5b5035919050565b5f60208284031215610392575f80fd5b81356001600160a01b03811681146103a8575f80fd5b9392505050565b5f602082840312156103bf575f80fd5b815180151581146103a8575f80fd5b634e487b7160e01b5f52601160045260245ffd5b818103818111156103f5576103f56103ce565b92915050565b808201808211156103f5576103f56103ce565b5f8261042857634e487b7160e01b5f52601260045260245ffd5b500490565b80820281158282048414176103f5576103f56103ce56fea26469706673582212200d36fc16df9b259d7e24ed0bbe9d65d01ba5229fd9a4d5c35032dd3d812ebeb164736f6c63430008170033

Deployed Bytecode

0x608060405234801561000f575f80fd5b506004361061007a575f3560e01c8063a694fc3a11610058578063a694fc3a146100d5578063a87430ba146100e8578063b149e56814610130578063d67fd58214610151575f80fd5b80632e17de781461007e578063502c9bd51461009357806353cdcd2a146100c3575b5f80fd5b61009161008c36600461036b565b610159565b005b6100a66100a136600461036b565b610240565b6040516001600160a01b0390911681526020015b60405180910390f35b5f546100a6906001600160a01b031681565b6100916100e336600461036b565b610268565b6101156100f6366004610382565b600160208190525f918252604090912080549181015460029091015483565b604080519384526020840192909252908201526060016100ba565b61014361013e366004610382565b610304565b6040519081526020016100ba565b600254610143565b335f90815260016020526040902080548211156101b35760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640160405180910390fd5b5f5460405163a9059cbb60e01b8152336004820152602481018490526001600160a01b039091169063a9059cbb906044016020604051808303815f875af1158015610200573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061022491906103af565b5081815f015f82825461023791906103e2565b90915550505050565b6002818154811061024f575f80fd5b5f918252602090912001546001600160a01b0316905081565b335f81815260016020526040808220915490516323b872dd60e01b815260048101939093523060248401526044830184905290916001600160a01b03909116906323b872dd906064016020604051808303815f875af11580156102cd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102f191906103af565b5081815f015f82825461023791906103fb565b6001600160a01b0381165f90815260016020818152604080842081516060810183528154808252948201549381019390935260020154908201529082906103559068138400eca364a000009061040e565b9050610363816103e861042d565b949350505050565b5f6020828403121561037b575f80fd5b5035919050565b5f60208284031215610392575f80fd5b81356001600160a01b03811681146103a8575f80fd5b9392505050565b5f602082840312156103bf575f80fd5b815180151581146103a8575f80fd5b634e487b7160e01b5f52601160045260245ffd5b818103818111156103f5576103f56103ce565b92915050565b808201808211156103f5576103f56103ce565b5f8261042857634e487b7160e01b5f52601260045260245ffd5b500490565b80820281158282048414176103f5576103f56103ce56fea26469706673582212200d36fc16df9b259d7e24ed0bbe9d65d01ba5229fd9a4d5c35032dd3d812ebeb164736f6c63430008170033

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
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.