Address Contract Partially Verified
Address
0xF0f3d70a207CCE14F531A2F89Ac173ab9fDC2366
Balance
0 ETH
Nonce
1
Code Size
2961 bytes
Creator
0xCceF9D17...DdD5 at tx 0xf5749cc2...94ae54
Indexed Transactions
0
Contract Bytecode
2961 bytes
0x608060405260043610610105575f3560e01c80638da5cb5b11610092578063ea2db2ce11610062578063ea2db2ce14610278578063ecde215a146102be578063f2fde38b146102dd578063f5194ae2146102fc578063f536e23a1461031b575f80fd5b80638da5cb5b146102005780639012c4a814610230578063ca628c781461024f578063ddca3f4314610263575f80fd5b80635fd8c710116100d85780635fd8c710146101855780636ee010ae1461019957806370450d2d146101ae578063715018a6146101cd57806382afee15146101e1575f80fd5b80630ad29ec3146101095780631b15929e14610131578063402914f5146101525780634e71d92d1461017d575b5f80fd5b348015610114575f80fd5b5061011e60045481565b6040519081526020015b60405180910390f35b34801561013c575f80fd5b5061015061014b366004610996565b610330565b005b34801561015d575f80fd5b5061011e61016c3660046109ad565b60066020525f908152604090205481565b61015061033d565b348015610190575f80fd5b506101506106dc565b3480156101a4575f80fd5b5061011e60035481565b3480156101b9575f80fd5b506101506101c83660046109ad565b61071e565b3480156101d8575f80fd5b5061015061079e565b3480156101ec575f80fd5b506101506101fb366004610996565b6107b1565b34801561020b575f80fd5b505f546001600160a01b03165b6040516001600160a01b039091168152602001610128565b34801561023b575f80fd5b5061015061024a366004610996565b6107be565b34801561025a575f80fd5b506101506107cb565b34801561026e575f80fd5b5061011e60025481565b348015610283575f80fd5b506102ae6102923660046109ad565b6001600160a01b03165f90815260066020526040902054421190565b6040519015158152602001610128565b3480156102c9575f80fd5b506101506102d8366004610996565b6108d4565b3480156102e8575f80fd5b506101506102f73660046109ad565b6108e1565b348015610307575f80fd5b50600154610218906001600160a01b031681565b348015610326575f80fd5b5061011e60055481565b61033861091b565b600555565b6001546040516370a0823160e01b81523360048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015610383573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103a791906109da565b90505f60015f9054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103fa573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061041e91906109f1565b60ff16905060025434101561046d5760405162461bcd60e51b815260206004820152601060248201526f696e73756666696369656e742066656560801b60448201526064015b60405180910390fd5b335f9081526006602052604090205442116104c05760405162461bcd60e51b8152602060048201526013602482015272636c61696d206973206c6f636b6564206e6f7760681b6044820152606401610464565b6104cb81600a610b07565b6005546104d89190610b12565b82101561051e5760405162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742062616c616e636560601b6044820152606401610464565b5f61052a82600a610b07565b6004546105379190610b12565b6001546040516370a0823160e01b81523060048201529192505f916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610582573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105a691906109da565b9050818110156106045760405162461bcd60e51b8152602060048201526024808201527f636c61696d206973206e6f7420617661696c61626c6520617420746865206d6f6044820152631b595b9d60e21b6064820152608401610464565b60015460405163a9059cbb60e01b8152336004820152602481018490526001600160a01b039091169063a9059cbb906044016020604051808303815f875af1158015610652573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106769190610b29565b506003546106849042610b48565b335f81815260066020908152604091829020939093558051918252918101849052428183015290517f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a9181900360600190a150505050565b6106e461091b565b5f80546040516001600160a01b03909116914780156108fc02929091818181858888f1935050505015801561071b573d5f803e3d5ffd5b50565b61072661091b565b6001546001600160a01b0380831691160361077c5760405162461bcd60e51b815260206004820152601660248201527530b63932b0b23c9032bc34b9ba34b733903a37b5b2b760511b6044820152606401610464565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6107a661091b565b6107af5f610947565b565b6107b961091b565b600355565b6107c661091b565b600255565b6107d361091b565b6001546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015610819573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061083d91906109da565b6001549091506001600160a01b031663a9059cbb6108625f546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303815f875af11580156108ac573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108d09190610b29565b5050565b6108dc61091b565b600455565b6108e961091b565b6001600160a01b03811661091257604051631e4fbdf760e01b81525f6004820152602401610464565b61071b81610947565b5f546001600160a01b031633146107af5760405163118cdaa760e01b8152336004820152602401610464565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156109a6575f80fd5b5035919050565b5f602082840312156109bd575f80fd5b81356001600160a01b03811681146109d3575f80fd5b9392505050565b5f602082840312156109ea575f80fd5b5051919050565b5f60208284031215610a01575f80fd5b815160ff811681146109d3575f80fd5b634e487b7160e01b5f52601160045260245ffd5b600181815b80851115610a5f57815f1904821115610a4557610a45610a11565b80851615610a5257918102915b93841c9390800290610a2a565b509250929050565b5f82610a7557506001610b01565b81610a8157505f610b01565b8160018114610a975760028114610aa157610abd565b6001915050610b01565b60ff841115610ab257610ab2610a11565b50506001821b610b01565b5060208310610133831016604e8410600b8410161715610ae0575081810a610b01565b610aea8383610a25565b805f1904821115610afd57610afd610a11565b0290505b92915050565b5f6109d38383610a67565b8082028115828204841417610b0157610b01610a11565b5f60208284031215610b39575f80fd5b815180151581146109d3575f80fd5b80820180821115610b0157610b01610a1156fea26469706673582212205b98477bd882c065bcb5a1160f9e76c98eec6e7e9e7166b78eebdcb56b43732e64736f6c63430008140033
Verified Source Code Partial Match
Compiler: v0.8.20+commit.a1b79de6
EVM: shanghai
Optimization: Yes (200 runs)
Claim.sol 320 lines
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// 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);
}
// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File: @openzeppelin/contracts/utils/Context.sol
// 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;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
/**
* @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);
}
}
// File: claim-ella.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
contract Claim is Ownable {
IERC20Metadata public MainToken;
uint256 public fee = 0.0038 ether;
uint256 public rewardCycle = 3 days + 12 hours;
uint256 public claimSupply = 100;
uint256 public balanceAtLeast = 0;
mapping(address => uint256) public claimable;
event Claimed(address to, uint256 amount, uint256 time);
constructor(address token) Ownable(msg.sender) {
MainToken = IERC20Metadata(token);
}
function updateMainToken(address token) external onlyOwner {
require(address(MainToken) != token, "already existing token");
MainToken = IERC20Metadata(token);
}
function updateFee(uint256 _fee) external onlyOwner {
fee = _fee;
}
function claim() external payable {
uint256 balance = MainToken.balanceOf(msg.sender);
uint256 decimals = MainToken.decimals();
require(msg.value >= fee, "insufficient fee");
require(getClaimAvailable(msg.sender), "claim is locked now");
require(balance >= balanceAtLeast * (10 ** decimals), "insufficient balance");
uint256 reward = claimSupply * (10 ** decimals);
uint256 contractBalance = MainToken.balanceOf(address(this));
require(contractBalance >= reward, "claim is not available at the moment");
MainToken.transfer(msg.sender, reward);
claimable[msg.sender] = block.timestamp + rewardCycle;
emit Claimed(msg.sender, reward, block.timestamp);
}
function withdrawBalance() external onlyOwner {
payable(owner()).transfer(address(this).balance);
}
function withdrawToken() external onlyOwner {
uint256 balance = MainToken.balanceOf(address(this));
MainToken.transfer(owner(), balance);
}
function getClaimAvailable(address account) public view returns(bool) {
return block.timestamp > claimable[account];
}
function updateRewardCycle(uint256 newCycle) external onlyOwner {
rewardCycle = newCycle;
}
function updateClaimSupply(uint256 newSupply) external onlyOwner {
claimSupply = newSupply;
}
function updatebalanceAtLeast(uint256 newBalance) external onlyOwner {
balanceAtLeast = newBalance;
}
}
Read Contract
MainToken 0xf5194ae2 → address
balanceAtLeast 0xf536e23a → uint256
claimSupply 0x0ad29ec3 → uint256
claimable 0x402914f5 → uint256
fee 0xddca3f43 → uint256
getClaimAvailable 0xea2db2ce → bool
owner 0x8da5cb5b → address
rewardCycle 0x6ee010ae → uint256
Write Contract 10 functions
These functions modify contract state and require a wallet transaction to execute.
claim 0x4e71d92d
No parameters
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
updateClaimSupply 0xecde215a
uint256 newSupply
updateFee 0x9012c4a8
uint256 _fee
updateMainToken 0x70450d2d
address token
updateRewardCycle 0x82afee15
uint256 newCycle
updatebalanceAtLeast 0x1b15929e
uint256 newBalance
withdrawBalance 0x5fd8c710
No parameters
withdrawToken 0xca628c78
No parameters
Recent Transactions
No transactions found for this address