Forkchoice Ethereum Mainnet

Address Contract Verified

Address 0x1670d4Ade46d4243F417B9ADD8DB27Fbd7c43d73
Balance 0 ETH
Nonce 1
Code Size 1791 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

1791 bytes
0x608060408181526004908136101561001657600080fd5b600092833560e01c9081634fc0a34914610621575080636d1b229d146103ba578063715018a6146103605780638a02b63c146103415780638da5cb5b14610319578063a7509b83146102df578063a9fc7ad71461029b578063d6d6f0dd14610260578063d8d7f96f146101245763f2fde38b1461009257600080fd5b34610120576020366003190112610120576001600160a01b0382358181169391929084900361011c576100c3610651565b83156101065750506000548260018060a01b0319821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b51631e4fbdf760e01b8152908101849052602490fd5b8480fd5b8280fd5b5082903461025c578160031936011261025c5780516370a0823160e01b81523084820152927f000000000000000000000000eca82185adce47f39c684352b0439f030f8603186001600160a01b0316919060208086602481875afa958615610252578596610223575b5085156101e457508394833b1561011c57602485928385519687948593630852cd8d60e31b85528401525af19081156101db57506101c85750f35b6101d19061067d565b6101d85780f35b80fd5b513d84823e3d90fd5b80606493519262461bcd60e51b845283015260248201527f656d657267656e63794275726e3a204e6f20746f6b656e7320746f206275726e6044820152fd5b9080965081813d831161024b575b61023b81836106a7565b8101031261011c5751948661018d565b503d610231565b83513d87823e3d90fd5b5080fd5b83823461025c578160031936011261025c57602090517f00000000000000000000000000000000000000000000000000000000677d063b8152f35b83823461025c578160031936011261025c57517f000000000000000000000000eca82185adce47f39c684352b0439f030f8603186001600160a01b03168152602090f35b50903461012057602036600319011261012057356001600160a01b0381169081900361012057828291602094526003845220549051908152f35b83823461025c578160031936011261025c57905490516001600160a01b039091168152602090f35b83823461025c578160031936011261025c57602090516367eb77808152f35b83346101d857806003193601126101d857610379610651565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101205760208060031936011261061d5782359260026001541461060f57600260015583156105bc57338552600382528285208054908582018092116105a9575582516323b872dd60e01b815233828201526001600160a01b037f0000000000000000000000001670d4ade46d4243f417b9add8db27fbd7c43d7381166024830152604482018690527f000000000000000000000000eca82185adce47f39c684352b0439f030f86031816919083816064818a875af190811561059f578791610565575b5015610522578590823b1561025c57602486918387519586948593630852cd8d60e31b85528401525af18015610252576104ed575b50907fcce8682f13403296307ecbb65e0f6d9356bba2d21e5ca632d7a3f489638f87d991815193845243908401523392a26001805580f35b9361051a7fcce8682f13403296307ecbb65e0f6d9356bba2d21e5ca632d7a3f489638f87d993929561067d565b9390916104b5565b835162461bcd60e51b8152908101839052601b60248201527f6275726e546f6b656e733a205472616e73666572206661696c656400000000006044820152606490fd5b90508381813d8311610598575b61057c81836106a7565b81010312610594575180151581036105945738610480565b8680fd5b503d610572565b85513d89823e3d90fd5b634e487b7160e01b875260118352602487fd5b915162461bcd60e51b815291820152602960248201527f6275726e546f6b656e733a20416d6f756e74206d75737420626520677265617460448201526806572207468616e20360bc1b6064820152608490fd5b8251633ee5aeb560e01b8152fd5b8380fd5b9290503461061d57602036600319011261061d573560ff811680910361061d579260209381526002845220548152f35b6000546001600160a01b0316330361066557565b60405163118cdaa760e01b8152336004820152602490fd5b67ffffffffffffffff811161069157604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff8211176106915760405256fea2646970667358221220bf2aef9619fd4704c506b57d77aa97910ccb0e8cb363289340705060681c5f4564736f6c63430008140033

Verified Source Code Full Match

Compiler: v0.8.20+commit.a1b79de6 EVM: paris Optimization: Yes (100 runs)
Ownable.sol 100 lines
// 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);
    }
}
IERC20.sol 79 lines
// 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);
}
Context.sol 28 lines
// 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;
    }
}
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;
    }
}
IBurnable.sol 7 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IBurnable {
    function burn(uint256 amount) external;
    function burnFrom(address account, uint256 amount) external;
}
PERLBurnReward.sol 58 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./IBurnable.sol";

/**
 * @title PERLBurnReward
 * @dev Contract for burning PERL tokens and distributing rewards based on snapshots
 */
contract PERLBurnReward is Ownable, ReentrancyGuard {
    // State variables
    address public immutable PERL_TOKEN;
    mapping (uint8 => bytes32) public snapshotMerkleRoots;
    mapping(address => uint256) public burned;
    
    // Constants
    uint256 public constant SWAP_END_TIME = 1743484800; // March 31, 2025
    uint256 public immutable SWAP_START_TIME;
    address private immutable _self;

    constructor(address perl) Ownable(msg.sender) {
        PERL_TOKEN = perl;
        SWAP_START_TIME = block.timestamp;
        _self = address(this);

        // Approve the contract to spend PERL tokens
        IERC20(PERL_TOKEN).approve(_self, type(uint256).max);
    }

    function burnTokens(uint256 amount) external nonReentrant {
        require(amount > 0, "burnTokens: Amount must be greater than 0");

        // Transfer tokens from user to this contract
        burned[msg.sender] += amount;
        require(IERC20(PERL_TOKEN).transferFrom(msg.sender, _self, amount), "burnTokens: Transfer failed");

        // Burn the tokens
        IBurnable(PERL_TOKEN).burn(amount);
        
        // Log the burn event
        emit BurnLogged(msg.sender, amount, block.number);
    }

    /**
     * @dev Emergency burn function for stuck tokens
     */
    function emergencyBurn() external {
        uint256 balance = IERC20(PERL_TOKEN).balanceOf(address(this));
        require(balance > 0, "emergencyBurn: No tokens to burn");
        IBurnable(PERL_TOKEN).burn(balance);
    }

    // Events
    event BurnLogged(address indexed user, uint256 amount, uint256 blockNumber);
}

Read Contract

PERL_TOKEN 0xa9fc7ad7 → address
SWAP_END_TIME 0x8a02b63c → uint256
SWAP_START_TIME 0xd6d6f0dd → uint256
burned 0xa7509b83 → uint256
owner 0x8da5cb5b → address
snapshotMerkleRoots 0x4fc0a349 → bytes32

Write Contract 4 functions

These functions modify contract state and require a wallet transaction to execute.

burnTokens 0x6d1b229d
uint256 amount
emergencyBurn 0xd8d7f96f
No parameters
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

No transactions found for this address