More Info
Private Name Tags
ContractCreator
Latest 12 from a total of 12 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Unstake | 20353892 | 118 days ago | IN | 0 ETH | 0.00009732 | ||||
Unstake | 20353884 | 118 days ago | IN | 0 ETH | 0.00009734 | ||||
Unstake | 20353820 | 118 days ago | IN | 0 ETH | 0.00008452 | ||||
Unstake | 20353801 | 118 days ago | IN | 0 ETH | 0.00009688 | ||||
Unstake | 20353787 | 118 days ago | IN | 0 ETH | 0.00008989 | ||||
Unstake | 20353785 | 118 days ago | IN | 0 ETH | 0.0000969 | ||||
Stake | 20353699 | 118 days ago | IN | 0 ETH | 0.00019451 | ||||
Stake | 20353595 | 118 days ago | IN | 0 ETH | 0.00019477 | ||||
Stake | 20353562 | 118 days ago | IN | 0 ETH | 0.00015733 | ||||
Stake | 20353527 | 118 days ago | IN | 0 ETH | 0.00014857 | ||||
Stake | 20345874 | 119 days ago | IN | 0 ETH | 0.00024792 | ||||
0x60806040 | 20341762 | 119 days ago | IN | 0 ETH | 0.00467106 |
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
Contract Source Code (Solidity Standard Json-Input format)
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; } }
// 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); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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"}]
Contract Creation Code
608060405234801561000f575f80fd5b505f80546001600160a01b031916738983cf891867942d06ad6ceb9b9002de860e202d17905561047a806100425f395ff3fe608060405234801561000f575f80fd5b506004361061007a575f3560e01c8063a694fc3a11610058578063a694fc3a146100d5578063a87430ba146100e8578063b149e56814610130578063d67fd58214610151575f80fd5b80632e17de781461007e578063502c9bd51461009357806353cdcd2a146100c3575b5f80fd5b61009161008c36600461036b565b610159565b005b6100a66100a136600461036b565b610240565b6040516001600160a01b0390911681526020015b60405180910390f35b5f546100a6906001600160a01b031681565b6100916100e336600461036b565b610268565b6101156100f6366004610382565b600160208190525f918252604090912080549181015460029091015483565b604080519384526020840192909252908201526060016100ba565b61014361013e366004610382565b610304565b6040519081526020016100ba565b600254610143565b335f90815260016020526040902080548211156101b35760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640160405180910390fd5b5f5460405163a9059cbb60e01b8152336004820152602481018490526001600160a01b039091169063a9059cbb906044016020604051808303815f875af1158015610200573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061022491906103af565b5081815f015f82825461023791906103e2565b90915550505050565b6002818154811061024f575f80fd5b5f918252602090912001546001600160a01b0316905081565b335f81815260016020526040808220915490516323b872dd60e01b815260048101939093523060248401526044830184905290916001600160a01b03909116906323b872dd906064016020604051808303815f875af11580156102cd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102f191906103af565b5081815f015f82825461023791906103fb565b6001600160a01b0381165f90815260016020818152604080842081516060810183528154808252948201549381019390935260020154908201529082906103559068138400eca364a000009061040e565b9050610363816103e861042d565b949350505050565b5f6020828403121561037b575f80fd5b5035919050565b5f60208284031215610392575f80fd5b81356001600160a01b03811681146103a8575f80fd5b9392505050565b5f602082840312156103bf575f80fd5b815180151581146103a8575f80fd5b634e487b7160e01b5f52601160045260245ffd5b818103818111156103f5576103f56103ce565b92915050565b808201808211156103f5576103f56103ce565b5f8261042857634e487b7160e01b5f52601260045260245ffd5b500490565b80820281158282048414176103f5576103f56103ce56fea26469706673582212200d36fc16df9b259d7e24ed0bbe9d65d01ba5229fd9a4d5c35032dd3d812ebeb164736f6c63430008170033
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061007a575f3560e01c8063a694fc3a11610058578063a694fc3a146100d5578063a87430ba146100e8578063b149e56814610130578063d67fd58214610151575f80fd5b80632e17de781461007e578063502c9bd51461009357806353cdcd2a146100c3575b5f80fd5b61009161008c36600461036b565b610159565b005b6100a66100a136600461036b565b610240565b6040516001600160a01b0390911681526020015b60405180910390f35b5f546100a6906001600160a01b031681565b6100916100e336600461036b565b610268565b6101156100f6366004610382565b600160208190525f918252604090912080549181015460029091015483565b604080519384526020840192909252908201526060016100ba565b61014361013e366004610382565b610304565b6040519081526020016100ba565b600254610143565b335f90815260016020526040902080548211156101b35760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640160405180910390fd5b5f5460405163a9059cbb60e01b8152336004820152602481018490526001600160a01b039091169063a9059cbb906044016020604051808303815f875af1158015610200573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061022491906103af565b5081815f015f82825461023791906103e2565b90915550505050565b6002818154811061024f575f80fd5b5f918252602090912001546001600160a01b0316905081565b335f81815260016020526040808220915490516323b872dd60e01b815260048101939093523060248401526044830184905290916001600160a01b03909116906323b872dd906064016020604051808303815f875af11580156102cd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102f191906103af565b5081815f015f82825461023791906103fb565b6001600160a01b0381165f90815260016020818152604080842081516060810183528154808252948201549381019390935260020154908201529082906103559068138400eca364a000009061040e565b9050610363816103e861042d565b949350505050565b5f6020828403121561037b575f80fd5b5035919050565b5f60208284031215610392575f80fd5b81356001600160a01b03811681146103a8575f80fd5b9392505050565b5f602082840312156103bf575f80fd5b815180151581146103a8575f80fd5b634e487b7160e01b5f52601160045260245ffd5b818103818111156103f5576103f56103ce565b92915050565b808201808211156103f5576103f56103ce565b5f8261042857634e487b7160e01b5f52601260045260245ffd5b500490565b80820281158282048414176103f5576103f56103ce56fea26469706673582212200d36fc16df9b259d7e24ed0bbe9d65d01ba5229fd9a4d5c35032dd3d812ebeb164736f6c63430008170033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.00195 | 500 | $0.9752 |
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.