Address Contract Verified
Address
0xf1cdCB6A7f97AFfc0C5CFe4b7D5Ba6d5376201ca
Balance
0 ETH
Nonce
1
Code Size
3095 bytes
Creator
0xb01fEFC2...3E60 at tx 0x28415ab8...b85be6
Indexed Transactions
0
Contract Bytecode
3095 bytes
0x6080806040526004361015610012575f80fd5b5f3560e01c908162cf1413146105785750806306574c031461052757806327c8f835146104ff5780633b97e856146104da57806342966c68146104b557806353cc973b1461047d578063555f323a146103c85780635d6c83b51461020c5780636e0b8f7c1461034f57806374c5dee4146103115780638da5cb5b146102ea5780638ea78153146102c0578063c8f1166214610250578063c8f74bb81461020c578063d1e0cd4d146101ef578063dd1f98a7146101d2578063f2fde38b146101295763fc0c546a146100e1575f80fd5b34610125575f366003190112610125576040517f0000000000000000000000008ada9bf2d08b484cb9dee67caccd04b991d881456001600160a01b03168152602090f35b5f80fd5b346101255760203660031901126101255761014261059b565b5f546001600160a01b0381169161015a3384146106cd565b6001600160a01b031691821561019f5782907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a36001600160a01b031916175f55005b60405162461bcd60e51b815260206004820152600b60248201526a06e6577206f776e65723d360ac1b6044820152606490fd5b34610125575f366003190112610125576020600354604051908152f35b34610125575f366003190112610125576020600454604051908152f35b34610125576020366003190112610125576001600160a01b0361022d61059b565b165f52600660205261024c60ff60405f205416604051918291826105b1565b0390f35b34610125577fa33e14683b9048366004a94e87d3476143392ac6839380665b32c9fddbbf6f1f6040610281366105d8565b61029560018060a01b035f541633146106cd565b61029f6001610705565b6102ab8282101561077c565b816003558060045582519182526020820152a1005b34610125575f36600319011261012557602060ff60025460a01c166102e860405180926105ee565bf35b34610125575f366003190112610125575f546040516001600160a01b039091168152602090f35b34610125576040366003190112610125576024356001600160a01b03811681036101255761034990610341610849565b600435610869565b60018055005b34610125577fa33e14683b9048366004a94e87d3476143392ac6839380665b32c9fddbbf6f1f604061029f610383366105d8565b61039a60018060a09594951b035f541633146106cd565b6103a46001610705565b6103bc6103c26103b26107b6565b946103bc86610744565b90610769565b93610744565b34610125575f366003190112610125576002546040516370a0823160e01b81526001600160a01b03918216600482015290602090829060249082907f0000000000000000000000008ada9bf2d08b484cb9dee67caccd04b991d88145165afa8015610472575f9061043f575b602090604051908152f35b506020813d60201161046a575b81610459602093836105fb565b810103126101255760209051610434565b3d915061044c565b6040513d5f823e3d90fd5b34610125576020366003190112610125576001600160a01b0361049e61059b565b165f526005602052602060405f2054604051908152f35b34610125576020366003190112610125576104ce610849565b61034933600435610869565b34610125575f3660031901126101255760206104f46107b6565b60ff60405191168152f35b34610125575f366003190112610125576002546040516001600160a01b039091168152602090f35b34610125576020366003190112610125576020604061054c61054761059b565b610631565b815192839181835280519182918282860152018484015e5f828201840152601f01601f19168101030190f35b34610125575f366003190112610125576040906003546004549082526020820152f35b600435906001600160a01b038216820361012557565b9190602083019260038210156105c45752565b634e487b7160e01b5f52602160045260245ffd5b6040906003190112610125576004359060243590565b9060018210156105c45752565b90601f8019910116810190811067ffffffffffffffff82111761061d57604052565b634e487b7160e01b5f52604160045260245ffd5b6001600160a01b03165f9081526006602052604090205460ff1660038110156105c457600281146106aa57600114610688576040516106716040826105fb565b600781526621b7b6b6b7b73960c91b602082015290565b6040516106966040826105fb565b600481526329bab83960e11b602082015290565b506040516106b96040826105fb565b6004815263243cb83960e11b602082015290565b156106d457565b60405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606490fd5b1561070c57565b60405162461bcd60e51b815260206004820152601060248201526f073757072206f722068797072203c20360841b6044820152606490fd5b60ff16604d811161075557600a0a90565b634e487b7160e01b5f52601160045260245ffd5b8181029291811591840414171561075557565b1561078357565b60405162461bcd60e51b815260206004820152600b60248201526a343cb839101e1039bab83960a91b6044820152606490fd5b60405163313ce56760e01b81526020816004817f0000000000000000000000008ada9bf2d08b484cb9dee67caccd04b991d881456001600160a01b03165afa5f918161080b575b506108085750601290565b90565b9091506020813d602011610841575b81610827602093836105fb565b81010312610125575160ff8116810361012557905f6107fd565b3d915061081a565b60026001541461085a576002600155565b633ee5aeb560e01b5f5260045ffd5b908115610bb157604051636eb1769f60e11b81523360048201523060248201527f0000000000000000000000008ada9bf2d08b484cb9dee67caccd04b991d881456001600160a01b031690602081604481855afa80156104725784915f91610b7c575b5010610b3e5760205f91606460018060a01b036002541660405194859384926323b872dd60e01b845233600485015260248401528860448401525af1908115610472575f91610b03575b5015610ac8576001600160a01b03165f8181526005602052604090205482810190811061075557815f5260056020528060405f2055815f52600660205260ff60405f205416906004548110155f14610a8b5750815f52600660205260405f20600260ff198254161790555b815f52600660205260ff60405f2054169060038210156105c45760038110156105c45703610a42575b3381036109f657506109ce60ff60025460a01c1660405192835260208301906105ee565b7fede8d7ee61ffbb3791a8c93a629fdbcb966aa492b2566297a1ffceafb17faada60403392a2565b90610a1a9060ff60025460a01c1690604051938452602084015260408301906105ee565b7fe1643db83d47d108809a5f1f12fc990b4f5f65d5b08e6e9fca39b17e0646eab960603392a2565b805f526006602052807ff0880b9fd3445ca37e9b5cf896eb23e5292331792ae8b6e4c45bc527c713adad610a8360ff60405f205416604051918291826105b1565b0390a26109aa565b60035411610aaf57815f52600660205260405f20600160ff19825416179055610981565b815f52600660205260405f2060ff198154169055610981565b60405162461bcd60e51b81526020600482015260136024820152721d1c985b9cd9995c919c9bdb4819985a5b1959606a1b6044820152606490fd5b90506020813d602011610b36575b81610b1e602093836105fb565b8101031261012557518015158103610125575f610916565b3d9150610b11565b60405162461bcd60e51b8152602060048201526016602482015275696e73756666696369656e7420616c6c6f77616e636560501b6044820152606490fd5b9150506020813d602011610ba9575b81610b98602093836105fb565b81010312610125578390515f6108cc565b3d9150610b8b565b60405162461bcd60e51b81526020600482015260086024820152670616d6f756e743d360c41b6044820152606490fdfea264697066735822122039c4bb578291c9c888f78f2e271c15ef37645640552b4bab4d4701638296bc7d64736f6c634300081c0033
Verified Source Code Full Match
Compiler: v0.8.28+commit.7893614a
EVM: cancun
Optimization: Yes (200 runs)
ReentrancyGuard.sol 87 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
HyprBurnTier.sol 204 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
interface IERC20 {
function transferFrom(address from, address to, uint256 value) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
}
interface IERC20Metadata {
function decimals() external view returns (uint8);
}
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v, bytes32 r, bytes32 s
) external;
}
interface IERC20Burnable is IERC20 {
function burnFrom(address account, uint256 amount) external;
}
abstract contract Ownable {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
address public owner;
modifier onlyOwner() {
require(msg.sender == owner, "not owner");
_;
}
constructor(address initialOwner) {
require(initialOwner != address(0), "owner=0");
owner = initialOwner;
emit OwnershipTransferred(address(0), initialOwner);
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "new owner=0");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract HyprBurnTier is Ownable, ReentrancyGuard {
enum BurnMode { TransferToDead } // default: TransferToDead
enum Tier { Commonr, Supr, Hypr } // 0,1,2
event Burned(address indexed account, uint256 amount, BurnMode mode);
event BurnedFor(address indexed account, address destinationAccount, uint256 amount, BurnMode mode);
event TierThresholdsUpdated(uint256 suprThreshold, uint256 hyprThreshold);
event TierUpdated(address indexed account, Tier newTier);
IERC20 public immutable token;
address public deadAddress = 0x000000000000000000000000000000000000dEaD;
BurnMode public burnMode = BurnMode.TransferToDead;
// Thresholds are stored in the token's smallest unit (raw).
// Commoner threshold is implicitly 0.
uint256 public suprThresholdRaw;
uint256 public hyprThresholdRaw;
// Per-wallet cumulative burned amount (raw)
mapping(address => uint256) public totalBurned;
// Per-wallet tier status
mapping(address => Tier) public currentTier;
constructor(address _token, address _owner) Ownable(_owner) {
require(_token != address(0), "token=0");
token = IERC20(_token);
// Set sensible defaults based on decimals() if available (fallback 18)
uint8 dec = _tokenDecimals();
suprThresholdRaw = 20_000 * (10 ** dec);
hyprThresholdRaw = 50_000 * (10 ** dec);
emit TierThresholdsUpdated(suprThresholdRaw, hyprThresholdRaw);
}
// -------------------- User actions --------------------
/**
* @notice Burn tokens by amount. User must have approved this contract first (unless using permit).
* In TransferToDead mode: transfers tokens to the dead address.
* In BurnFrom mode: calls token.burnFrom(msg.sender, amount) (token must support it).
*/
function burn(uint256 amount) external nonReentrant {
_burnInternal(amount, msg.sender);
}
function burnFor(uint256 amount, address destinationAccount) external nonReentrant{
_burnInternal(amount, destinationAccount);
}
function _burnInternal(uint256 amount, address creditTo) internal {
require(amount > 0, "amount=0");
_requireAllowance(msg.sender, amount);
_safeTransferFrom(msg.sender, deadAddress, amount);
_updateTier(amount, creditTo);
if (creditTo == msg.sender) {
emit Burned(msg.sender, amount, burnMode);
} else {
emit BurnedFor(msg.sender, creditTo, amount, burnMode);
}
}
function _updateTier(uint256 amount, address account) internal {
uint256 burned = totalBurned[account] + amount;
totalBurned[account] = burned;
Tier oldTier = currentTier[account];
if (burned >= hyprThresholdRaw) currentTier[account] = Tier.Hypr;
else if (burned >= suprThresholdRaw) currentTier[account] = Tier.Supr;
else currentTier[account] = Tier.Commonr;
if (oldTier != currentTier[account]) emit TierUpdated(account, currentTier[account]);
}
function totalBurnedTokens() external view returns (uint256) {
return token.balanceOf(deadAddress);
}
// -------------------- Owner controls --------------------
/**
* @notice Set raw thresholds (smallest units). Must satisfy: hypr >= supr >= 0.
* Commoner remains 0 by definition.
*/
function setTierThresholdsRaw(uint256 newSuprRaw, uint256 newHyprRaw) external onlyOwner {
require(newSuprRaw >= 0 && newHyprRaw >= 0, "supr or hypr < 0" );
require(newHyprRaw >= newSuprRaw, "hypr < supr");
suprThresholdRaw = newSuprRaw;
hyprThresholdRaw = newHyprRaw;
emit TierThresholdsUpdated(newSuprRaw, newHyprRaw);
}
/**
* @notice Convenience setter using whole-token amounts (e.g., 100_000 means 100k tokens).
* This scales by token decimals() if available; fallback is 18 decimals.
*/
function setTierThresholdsTokens(uint256 newSuprTokens, uint256 newHyprTokens) external onlyOwner {
require(newSuprTokens >= 0 && newHyprTokens >= 0, "supr or hypr < 0" );
uint8 dec = _tokenDecimals();
uint256 suprRaw = newSuprTokens * (10 ** dec);
uint256 hyprRaw = newHyprTokens * (10 ** dec);
require(hyprRaw >= suprRaw, "hypr < supr");
suprThresholdRaw = suprRaw;
hyprThresholdRaw = hyprRaw;
emit TierThresholdsUpdated(suprRaw, hyprRaw);
}
// -------------------- Views --------------------
function tierOf(address account) public view returns (Tier) {
return currentTier[account];
}
function tierNameOf(address account) external view returns (string memory) {
Tier t = tierOf(account);
if (t == Tier.Hypr) return "Hypr";
if (t == Tier.Supr) return "Supr";
return "Commonr";
}
function thresholdsRaw() external view returns (uint256 suprRaw, uint256 hyprRaw) {
return (suprThresholdRaw, hyprThresholdRaw);
}
function tokenDecimals() external view returns (uint8) {
return _tokenDecimals();
}
// -------------------- Internal utils --------------------
function _tokenDecimals() internal view returns (uint8) {
// Try/catch to avoid revert if token lacks decimals()
try IERC20Metadata(address(token)).decimals() returns (uint8 dec) {
return dec;
} catch {
return 18; // sensible default
}
}
function _requireAllowance(address from, uint256 amount) internal view {
require(token.allowance(from, address(this)) >= amount, "insufficient allowance");
}
// Minimal safe transferFrom (revert on false)
function _safeTransferFrom(address from, address to, uint256 amount) internal {
bool ok = token.transferFrom(from, to, amount);
require(ok, "transferFrom failed");
}
}
Read Contract
burnMode 0x8ea78153 → uint8
currentTier 0x5d6c83b5 → uint8
deadAddress 0x27c8f835 → address
hyprThresholdRaw 0xd1e0cd4d → uint256
owner 0x8da5cb5b → address
suprThresholdRaw 0xdd1f98a7 → uint256
thresholdsRaw 0x00cf1413 → uint256, uint256
tierNameOf 0x06574c03 → string
tierOf 0xc8f74bb8 → uint8
token 0xfc0c546a → address
tokenDecimals 0x3b97e856 → uint8
totalBurned 0x53cc973b → uint256
totalBurnedTokens 0x555f323a → uint256
Write Contract 5 functions
These functions modify contract state and require a wallet transaction to execute.
burn 0x42966c68
uint256 amount
burnFor 0x74c5dee4
uint256 amount
address destinationAccount
setTierThresholdsRaw 0xc8f11662
uint256 newSuprRaw
uint256 newHyprRaw
setTierThresholdsTokens 0x6e0b8f7c
uint256 newSuprTokens
uint256 newHyprTokens
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address