Source Code
Overview
S Balance
0 S
More Info
ContractCreator
Latest 11 from a total of 11 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Mine | 15631243 | 3 days ago | IN | 0.0025 S | 0.00005333 | ||||
Mine | 15631165 | 3 days ago | IN | 0.0025 S | 0.00005333 | ||||
Mine | 15631132 | 3 days ago | IN | 0.0025 S | 0.00005333 | ||||
Mine | 15622136 | 3 days ago | IN | 0.0025 S | 0.00005333 | ||||
Mine | 15622114 | 3 days ago | IN | 0.0025 S | 0.00007046 | ||||
Mine | 15592513 | 3 days ago | IN | 0.0025 S | 0.00005333 | ||||
Mine | 15591589 | 3 days ago | IN | 0.025 S | 0.00005333 | ||||
Mine | 15590690 | 3 days ago | IN | 0.025 S | 0.00005333 | ||||
Mine | 15590667 | 3 days ago | IN | 0.025 S | 0.00005333 | ||||
Mine | 15588914 | 3 days ago | IN | 0.025 S | 0.00007046 | ||||
Mine | 15583093 | 3 days ago | IN | 0.0025 S | 0.0000936 |
Latest 22 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
15631243 | 3 days ago | 0 S | ||||
15631243 | 3 days ago | 0.0025 S | ||||
15631165 | 3 days ago | 0 S | ||||
15631165 | 3 days ago | 0.0025 S | ||||
15631132 | 3 days ago | 0 S | ||||
15631132 | 3 days ago | 0.0025 S | ||||
15622136 | 3 days ago | 0 S | ||||
15622136 | 3 days ago | 0.0025 S | ||||
15622114 | 3 days ago | 0 S | ||||
15622114 | 3 days ago | 0.0025 S | ||||
15592513 | 3 days ago | 0 S | ||||
15592513 | 3 days ago | 0.0025 S | ||||
15591589 | 3 days ago | 0 S | ||||
15591589 | 3 days ago | 0.025 S | ||||
15590690 | 3 days ago | 0 S | ||||
15590690 | 3 days ago | 0.025 S | ||||
15590667 | 3 days ago | 0 S | ||||
15590667 | 3 days ago | 0.025 S | ||||
15588914 | 3 days ago | 0 S | ||||
15588914 | 3 days ago | 0.025 S | ||||
15583093 | 3 days ago | 0 S | ||||
15583093 | 3 days ago | 0.0025 S |
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 { IBanyumasanPoint } from "./interfaces/IBanyumasanPoint.sol"; contract Mining is Ownable { IBanyumasanPoint private point; uint256 public constant feeMine = 0.0025 ether; constructor(address _point) Ownable(_msgSender()) { point = IBanyumasanPoint(_point); } function mine() external payable { 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); } }
// 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.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ 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); }
// 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; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IBanyumasanPoint is IERC20 { 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" ] } } }
[{"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":"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":[],"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
608060405234801561001057600080fd5b5060405161061938038061061983398101604081905261002f916100d4565b338061005557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005e81610084565b50600180546001600160a01b0319166001600160a01b0392909216919091179055610104565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100e657600080fd5b81516001600160a01b03811681146100fd57600080fd5b9392505050565b610506806101136000396000f3fe60806040526004361061004a5760003560e01c80634e54e22e1461004f578063715018a61461007d5780638da5cb5b1461009457806399f4b251146100bc578063f2fde38b146100c4575b600080fd5b34801561005b57600080fd5b5061006a6608e1bc9bf0400081565b6040519081526020015b60405180910390f35b34801561008957600080fd5b506100926100e4565b005b3480156100a057600080fd5b506000546040516001600160a01b039091168152602001610074565b6100926100f8565b3480156100d057600080fd5b506100926100df36600461043c565b6102bd565b6100ec610300565b6100f6600061032d565b565b6608e1bc9bf0400034101561010c57600080fd5b600044423360405160200161014693929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b60408051601f1981840301815291905280516020909101209050600061016e6127108361046c565b9050600061232882101561019957610187600a8361046c565b6101929060016104a4565b9050610239565b6126ac8210156101c657600a6101b1612328846104bd565b6101bb919061046c565b61019290600b6104a4565b6127068210156101f357600a6101de6126ac846104bd565b6101e8919061046c565b6101929060156104a4565b61270f82101561022057600a61020b612706846104bd565b610215919061046c565b61019290601f6104a4565b61022b603c8361046c565b6102369060296104a4565b90505b61025461024e6000546001600160a01b031690565b3461037d565b6001546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50505050505050565b6102c5610300565b6001600160a01b0381166102f457604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6102fd8161032d565b50565b6000546001600160a01b031633146100f65760405163118cdaa760e01b81523360048201526024016102eb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b804710156103a75760405163cf47918160e01b8152476004820152602481018290526044016102eb565b600080836001600160a01b03168360405160006040518083038185875af1925050503d80600081146103f5576040519150601f19603f3d011682016040523d82523d6000602084013e6103fa565b606091505b50915091508161040d5761040d81610413565b50505050565b8051156104235780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b60006020828403121561044e57600080fd5b81356001600160a01b038116811461046557600080fd5b9392505050565b60008261048957634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fd5b808201808211156104b7576104b761048e565b92915050565b818103818111156104b7576104b761048e56fea26469706673582212208ebd78d2c50065f6d226df9f004f4ed0b34775911c156443b597820fec30d32d64736f6c634300081c00330000000000000000000000003ea5539ba6a34341a222a47f19704567da60a58c
Deployed Bytecode
0x60806040526004361061004a5760003560e01c80634e54e22e1461004f578063715018a61461007d5780638da5cb5b1461009457806399f4b251146100bc578063f2fde38b146100c4575b600080fd5b34801561005b57600080fd5b5061006a6608e1bc9bf0400081565b6040519081526020015b60405180910390f35b34801561008957600080fd5b506100926100e4565b005b3480156100a057600080fd5b506000546040516001600160a01b039091168152602001610074565b6100926100f8565b3480156100d057600080fd5b506100926100df36600461043c565b6102bd565b6100ec610300565b6100f6600061032d565b565b6608e1bc9bf0400034101561010c57600080fd5b600044423360405160200161014693929190928352602083019190915260601b6bffffffffffffffffffffffff1916604082015260540190565b60408051601f1981840301815291905280516020909101209050600061016e6127108361046c565b9050600061232882101561019957610187600a8361046c565b6101929060016104a4565b9050610239565b6126ac8210156101c657600a6101b1612328846104bd565b6101bb919061046c565b61019290600b6104a4565b6127068210156101f357600a6101de6126ac846104bd565b6101e8919061046c565b6101929060156104a4565b61270f82101561022057600a61020b612706846104bd565b610215919061046c565b61019290601f6104a4565b61022b603c8361046c565b6102369060296104a4565b90505b61025461024e6000546001600160a01b031690565b3461037d565b6001546040516340c10f1960e01b8152336004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50505050505050565b6102c5610300565b6001600160a01b0381166102f457604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6102fd8161032d565b50565b6000546001600160a01b031633146100f65760405163118cdaa760e01b81523360048201526024016102eb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b804710156103a75760405163cf47918160e01b8152476004820152602481018290526044016102eb565b600080836001600160a01b03168360405160006040518083038185875af1925050503d80600081146103f5576040519150601f19603f3d011682016040523d82523d6000602084013e6103fa565b606091505b50915091508161040d5761040d81610413565b50505050565b8051156104235780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b60006020828403121561044e57600080fd5b81356001600160a01b038116811461046557600080fd5b9392505050565b60008261048957634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fd5b808201808211156104b7576104b761048e565b92915050565b818103818111156104b7576104b761048e56fea26469706673582212208ebd78d2c50065f6d226df9f004f4ed0b34775911c156443b597820fec30d32d64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003ea5539ba6a34341a222a47f19704567da60a58c
-----Decoded View---------------
Arg [0] : _point (address): 0x3Ea5539ba6A34341A222a47F19704567da60a58C
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000003ea5539ba6a34341a222a47f19704567da60a58c
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.