Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 6 from a total of 6 transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Mining
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.28; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { INolazPoint } from "./interfaces/INolazPoint.sol"; contract Mining is Ownable { INolazPoint private point; uint256 public constant feeMine = 0.0025 ether; event Mine(address indexed addr, uint256 indexed amount); constructor(address _point) Ownable(_msgSender()) { point = INolazPoint(_point); } function mine() external payable returns (uint256) { require(msg.value >= feeMine); // Generate random number using keccak256 and block properties uint256 randomHash = uint256(keccak256(abi.encodePacked(block.prevrandao, block.timestamp, msg.sender))); uint256 randomNumber = randomHash % 10000; // Random number between 0 and 9999 uint256 amount = 0; // Map the random number to the desired range if (randomNumber < 9000) { amount = (randomNumber % 10) + 1; // 1-10 (90%) } else if (randomNumber < 9900) { amount = ((randomNumber - 9000) % 10) + 11; // 11-20 (9%) } else if (randomNumber < 9990) { amount = ((randomNumber - 9900) % 10) + 21; // 21-30 (0.9%) } else if (randomNumber < 9999) { amount = ((randomNumber - 9990) % 10) + 31; // 31-40 (0.09%) } else { amount = (randomNumber % 60) + 41; // 41-100 (0.01%) } Address.sendValue(payable(owner()), msg.value); point.mint(msg.sender, amount); emit Mine(msg.sender, amount); return amount; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol) pragma solidity ^0.8.20; import {Errors} from "./Errors.sol"; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, bytes memory returndata) = recipient.call{value: amount}(""); if (!success) { _revert(returndata); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly ("memory-safe") { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert Errors.FailedCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol) pragma solidity ^0.8.20; /** * @dev Collection of common custom errors used in multiple contracts * * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. * It is recommended to avoid relying on the error API for critical functionality. * * _Available since v5.1._ */ library Errors { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error InsufficientBalance(uint256 balance, uint256 needed); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedCall(); /** * @dev The deployment failed. */ error FailedDeployment(); /** * @dev A necessary precompile is missing. */ error MissingPrecompile(address); }
pragma solidity ^0.8.28; interface INolazPoint { function mint(address, uint256) external; function burn(address, uint256) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_point","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Mine","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"feeMine","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mine","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161064a38038061064a83398101604081905261002f916100d4565b338061005557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005e81610084565b50600180546001600160a01b0319166001600160a01b0392909216919091179055610104565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100e657600080fd5b81516001600160a01b03811681146100fd57600080fd5b9392505050565b610537806101136000396000f3fe60806040526004361061004a5760003560e01c80634e54e22e1461004f578063715018a61461007d5780638da5cb5b1461009457806399f4b251146100bc578063f2fde38b146100c4575b600080fd5b34801561005b57600080fd5b5061006a6608e1bc9bf0400081565b6040519081526020015b60405180910390f35b34801561008957600080fd5b506100926100e4565b005b3480156100a057600080fd5b506000546040516001600160a01b039091168152602001610074565b61006a6100f8565b3480156100d057600080fd5b506100926100df36600461046d565b6102ee565b6100ec610331565b6100f6600061035e565b565b60006608e1bc9bf0400034101561010e57600080fd5b600044423360405160200161014893929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b60408051601f198184030181529190528051602090910120905060006101706127108361049d565b9050600061232882101561019b57610189600a8361049d565b6101949060016104d5565b905061023b565b6126ac8210156101c857600a6101b3612328846104ee565b6101bd919061049d565b61019490600b6104d5565b6127068210156101f557600a6101e06126ac846104ee565b6101ea919061049d565b6101949060156104d5565b61270f82101561022257600a61020d612706846104ee565b610217919061049d565b61019490601f6104d5565b61022d603c8361049d565b6102389060296104d5565b90505b6102566102506000546001600160a01b031690565b346103ae565b6001546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b1580156102a257600080fd5b505af11580156102b6573d6000803e3d6000fd5b50506040518392503391507ff23a961744a760027f8811c59a0eaef0d29cf965578b17412bcc375b52fa39d190600090a39392505050565b6102f6610331565b6001600160a01b03811661032557604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61032e8161035e565b50565b6000546001600160a01b031633146100f65760405163118cdaa760e01b815233600482015260240161031c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b804710156103d85760405163cf47918160e01b81524760048201526024810182905260440161031c565b600080836001600160a01b03168360405160006040518083038185875af1925050503d8060008114610426576040519150601f19603f3d011682016040523d82523d6000602084013e61042b565b606091505b50915091508161043e5761043e81610444565b50505050565b8051156104545780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b60006020828403121561047f57600080fd5b81356001600160a01b038116811461049657600080fd5b9392505050565b6000826104ba57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fd5b808201808211156104e8576104e86104bf565b92915050565b818103818111156104e8576104e86104bf56fea2646970667358221220ffba2008be050fdc1c7d36177bf78d4b4c95919e7991414488cb848b45823ab564736f6c634300081c00330000000000000000000000005aeb1047ff6c482a6859e20dff5418317f53bc7f
Deployed Bytecode
0x60806040526004361061004a5760003560e01c80634e54e22e1461004f578063715018a61461007d5780638da5cb5b1461009457806399f4b251146100bc578063f2fde38b146100c4575b600080fd5b34801561005b57600080fd5b5061006a6608e1bc9bf0400081565b6040519081526020015b60405180910390f35b34801561008957600080fd5b506100926100e4565b005b3480156100a057600080fd5b506000546040516001600160a01b039091168152602001610074565b61006a6100f8565b3480156100d057600080fd5b506100926100df36600461046d565b6102ee565b6100ec610331565b6100f6600061035e565b565b60006608e1bc9bf0400034101561010e57600080fd5b600044423360405160200161014893929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b60408051601f198184030181529190528051602090910120905060006101706127108361049d565b9050600061232882101561019b57610189600a8361049d565b6101949060016104d5565b905061023b565b6126ac8210156101c857600a6101b3612328846104ee565b6101bd919061049d565b61019490600b6104d5565b6127068210156101f557600a6101e06126ac846104ee565b6101ea919061049d565b6101949060156104d5565b61270f82101561022257600a61020d612706846104ee565b610217919061049d565b61019490601f6104d5565b61022d603c8361049d565b6102389060296104d5565b90505b6102566102506000546001600160a01b031690565b346103ae565b6001546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b1580156102a257600080fd5b505af11580156102b6573d6000803e3d6000fd5b50506040518392503391507ff23a961744a760027f8811c59a0eaef0d29cf965578b17412bcc375b52fa39d190600090a39392505050565b6102f6610331565b6001600160a01b03811661032557604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61032e8161035e565b50565b6000546001600160a01b031633146100f65760405163118cdaa760e01b815233600482015260240161031c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b804710156103d85760405163cf47918160e01b81524760048201526024810182905260440161031c565b600080836001600160a01b03168360405160006040518083038185875af1925050503d8060008114610426576040519150601f19603f3d011682016040523d82523d6000602084013e61042b565b606091505b50915091508161043e5761043e81610444565b50505050565b8051156104545780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b60006020828403121561047f57600080fd5b81356001600160a01b038116811461049657600080fd5b9392505050565b6000826104ba57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fd5b808201808211156104e8576104e86104bf565b92915050565b818103818111156104e8576104e86104bf56fea2646970667358221220ffba2008be050fdc1c7d36177bf78d4b4c95919e7991414488cb848b45823ab564736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005aeb1047ff6c482a6859e20dff5418317f53bc7f
-----Decoded View---------------
Arg [0] : _point (address): 0x5AEb1047Ff6C482a6859e20dfF5418317F53Bc7f
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000005aeb1047ff6c482a6859e20dff5418317f53bc7f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
[ 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.