ETH Price: $3,483.35 (+2.01%)

Contract

0x18612558Fbb20530C6FBF26E4c8908CB9C22D9dd
 

Overview

ETH Balance

184.086401432560355889 ETH

Eth Value

$641,236.90 (@ $3,483.35/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Permit Redeem214372582024-12-19 14:47:235 days ago1734619643IN
0x18612558...B9C22D9dd
0 ETH0.0018818718.46400735
Permit Redeem214031242024-12-14 20:25:2310 days ago1734207923IN
0x18612558...B9C22D9dd
0 ETH0.000751217.36691686
Permit Redeem213916942024-12-13 6:06:5911 days ago1734070019IN
0x18612558...B9C22D9dd
0 ETH0.0012425812.1851613
Permit Redeem213664462024-12-09 17:29:5915 days ago1733765399IN
0x18612558...B9C22D9dd
0 ETH0.0029030529.77975923
Permit Redeem212537402024-11-23 23:31:5931 days ago1732404719IN
0x18612558...B9C22D9dd
0 ETH0.000882238.65521149
Permit Redeem212389862024-11-21 22:06:3533 days ago1732226795IN
0x18612558...B9C22D9dd
0 ETH0.0014549414.26682588
Permit Redeem211872452024-11-14 16:51:5940 days ago1731603119IN
0x18612558...B9C22D9dd
0 ETH0.0029787929.20877182
Permit Redeem211650632024-11-11 14:33:2343 days ago1731335603IN
0x18612558...B9C22D9dd
0 ETH0.0020367219.97280437
Permit Redeem211562702024-11-10 9:08:2344 days ago1731229703IN
0x18612558...B9C22D9dd
0 ETH0.0011332111.11729108
Permit Redeem211412632024-11-08 6:54:5946 days ago1731048899IN
0x18612558...B9C22D9dd
0 ETH0.00066217.90058225
Permit Redeem211383902024-11-07 21:14:5947 days ago1731014099IN
0x18612558...B9C22D9dd
0 ETH0.0024658224.18307057
Permit Redeem208935582024-10-04 17:08:3581 days ago1728061715IN
0x18612558...B9C22D9dd
0 ETH0.000953699.78593873
Permit Redeem207634312024-09-16 13:19:2399 days ago1726492763IN
0x18612558...B9C22D9dd
0 ETH0.0010219410.0222906
Permit Redeem207621862024-09-16 9:07:1199 days ago1726477631IN
0x18612558...B9C22D9dd
0 ETH0.0013147612.90140124
Permit Redeem207416422024-09-13 12:17:35102 days ago1726229855IN
0x18612558...B9C22D9dd
0 ETH0.000183382.04785516
Permit Redeem206795012024-09-04 20:07:11111 days ago1725480431IN
0x18612558...B9C22D9dd
0 ETH0.0010011310.26952487
Permit Redeem206473242024-08-31 8:21:11115 days ago1725092471IN
0x18612558...B9C22D9dd
0 ETH0.000069240.67938642
Permit Redeem206414022024-08-30 12:29:59116 days ago1725020999IN
0x18612558...B9C22D9dd
0 ETH0.000115491.29060872
Permit Redeem206127052024-08-26 12:16:11120 days ago1724674571IN
0x18612558...B9C22D9dd
0 ETH0.000378283.88027662
Permit Redeem204877612024-08-09 1:29:35137 days ago1723166975IN
0x18612558...B9C22D9dd
0 ETH0.000251252.57737142
Permit Redeem204093782024-07-29 2:56:47148 days ago1722221807IN
0x18612558...B9C22D9dd
0 ETH0.000110951.13822118
Permit Redeem204069092024-07-28 18:41:47149 days ago1722192107IN
0x18612558...B9C22D9dd
0 ETH0.000313673.07679806
Permit Redeem204049552024-07-28 12:10:11149 days ago1722168611IN
0x18612558...B9C22D9dd
0 ETH0.000240552.35894113
Permit Redeem203168082024-07-16 4:53:47161 days ago1721105627IN
0x18612558...B9C22D9dd
0 ETH0.00039234.02385975
Permit Redeem202799282024-07-11 1:17:59166 days ago1720660679IN
0x18612558...B9C22D9dd
0 ETH0.000271262.66143578
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
214372582024-12-19 14:47:235 days ago1734619643
0x18612558...B9C22D9dd
0.22390096 ETH
214031242024-12-14 20:25:2310 days ago1734207923
0x18612558...B9C22D9dd
0.37774122 ETH
213916942024-12-13 6:06:5911 days ago1734070019
0x18612558...B9C22D9dd
0.10387624 ETH
213664462024-12-09 17:29:5915 days ago1733765399
0x18612558...B9C22D9dd
0.28638663 ETH
212537402024-11-23 23:31:5931 days ago1732404719
0x18612558...B9C22D9dd
0.02725047 ETH
212389862024-11-21 22:06:3533 days ago1732226795
0x18612558...B9C22D9dd
0.02040422 ETH
211872452024-11-14 16:51:5940 days ago1731603119
0x18612558...B9C22D9dd
6.93924929 ETH
211650632024-11-11 14:33:2343 days ago1731335603
0x18612558...B9C22D9dd
1.57440094 ETH
211562702024-11-10 9:08:2344 days ago1731229703
0x18612558...B9C22D9dd
0.00282521 ETH
211412632024-11-08 6:54:5946 days ago1731048899
0x18612558...B9C22D9dd
0.7007552 ETH
211383902024-11-07 21:14:5947 days ago1731014099
0x18612558...B9C22D9dd
0.4047383 ETH
208935582024-10-04 17:08:3581 days ago1728061715
0x18612558...B9C22D9dd
2.62892551 ETH
207634312024-09-16 13:19:2399 days ago1726492763
0x18612558...B9C22D9dd
0.0731306 ETH
207621862024-09-16 9:07:1199 days ago1726477631
0x18612558...B9C22D9dd
0.30834778 ETH
206795012024-09-04 20:07:11111 days ago1725480431
0x18612558...B9C22D9dd
0.05842056 ETH
206473242024-08-31 8:21:11115 days ago1725092471
0x18612558...B9C22D9dd
0.06111288 ETH
206127052024-08-26 12:16:11120 days ago1724674571
0x18612558...B9C22D9dd
0.00424686 ETH
204877612024-08-09 1:29:35137 days ago1723166975
0x18612558...B9C22D9dd
0.60069094 ETH
204093782024-07-29 2:56:47148 days ago1722221807
0x18612558...B9C22D9dd
3.24035191 ETH
204069092024-07-28 18:41:47149 days ago1722192107
0x18612558...B9C22D9dd
0.24588298 ETH
204049552024-07-28 12:10:11149 days ago1722168611
0x18612558...B9C22D9dd
0.16730474 ETH
203168082024-07-16 4:53:47161 days ago1721105627
0x18612558...B9C22D9dd
0.23220198 ETH
202799282024-07-11 1:17:59166 days ago1720660679
0x18612558...B9C22D9dd
0.01918939 ETH
202726242024-07-10 0:50:35167 days ago1720572635
0x18612558...B9C22D9dd
0.03358144 ETH
202679722024-07-09 9:13:47168 days ago1720516427
0x18612558...B9C22D9dd
0.01650514 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x9CF40Ae1...e9d425e9E
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
MerkleDistributor

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 11 : MerkleDistributor.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
import {ERC20Burnable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

import {IMerkleDistributor} from "./interfaces/IMerkleDistributor.sol";
import {Types} from "./types/Types.sol";

contract MerkleDistributor is IMerkleDistributor {
  address public immutable override token;
  bytes32 public immutable override merkleRoot;
  // This is a packed array of booleans.
  mapping(uint256 => uint256) private redeemedBitMap;

  uint256 public immutable endingTimestamp;
  address public immutable recipient;

  uint256 public constant MAX_PERCENTAGE_BPS = 1e18;

  constructor(
    address token_,
    bytes32 merkleRoot_,
    uint256 _endingTimestamp,
    address _recipient
  ) {
    token = token_;
    merkleRoot = merkleRoot_;
    endingTimestamp = _endingTimestamp;
    recipient = _recipient;
  }

  function isRedeemed(uint256 index) public view override returns (bool) {
    uint256 redeemedWordIndex = index / 256;
    uint256 redemeedBitIndex = index % 256;
    uint256 redeemedWord = redeemedBitMap[redeemedWordIndex];
    uint256 mask = (1 << redemeedBitIndex);
    return redeemedWord & mask == mask;
  }

  function _setRedeemed(uint256 index) private {
    uint256 redeemedWordIndex = index / 256;
    uint256 redemeedBitIndex = index % 256;
    redeemedBitMap[redeemedWordIndex] =
      redeemedBitMap[redeemedWordIndex] |
      (1 << redemeedBitIndex);
  }

  function calcRedeemableAmount(
    uint256 allocatedTokens,
    uint256 actual,
    uint256 allocatedEth
  ) public pure returns (uint256) {
    if (actual > allocatedTokens) {
      revert IllegibleTokenAmount();
    }

    uint256 percentage = (actual * MAX_PERCENTAGE_BPS) / allocatedTokens;
    return (allocatedEth * percentage) / MAX_PERCENTAGE_BPS;
  }

  function permitRedeem(
    Types.Redeem memory _redeem,
    Types.Permit memory _permit
  ) external override {
    IERC20Permit(token).permit(
      msg.sender,
      address(this),
      _permit.actualBalance,
      _permit.deadline,
      _permit.v,
      _permit.r,
      _permit.s
    );

    redeem(_redeem, _permit.actualBalance);
  }

  function redeem(
    Types.Redeem memory _redeem,
    uint256 _actualBalance
  ) public override {
    if (isRedeemed(_redeem.index)) {
      revert RedemptionAlreadyFulfilled();
    }

    if (msg.sender != _redeem.account) {
      revert OnlyOwnerCanRedeem();
    }

    // Verify the merkle proof.
    bytes32 node = keccak256(
      abi.encodePacked(
        _redeem.index,
        _redeem.account,
        _redeem.tokens,
        _redeem.eth
      )
    );
    if (!MerkleProof.verify(_redeem.merkleProof, merkleRoot, node)) {
      revert InvalidProof();
    }
    // Mark it redeemed
    _setRedeemed(_redeem.index);

    uint256 redeemableEth = calcRedeemableAmount(
      _redeem.tokens,
      _actualBalance,
      _redeem.eth
    );

    if (redeemableEth > _redeem.eth) {
      revert NotEnoughAllocatedEth();
    }

    if (
      !IERC20(token).transferFrom(
        _redeem.account,
        address(this),
        _actualBalance
      )
    ) {
      revert TokenTransferFailed();
    }

    (bool success, ) = _redeem.account.call{value: redeemableEth}("");
    if (!success) {
      revert EthTransferFailed();
    }

    emit Redeemed(
      _redeem.index,
      _redeem.account,
      _redeem.tokens,
      _actualBalance,
      _redeem.eth,
      redeemableEth
    );
  }

  function withdrawRemainder() external {
    if (block.timestamp <= endingTimestamp) {
      revert RedemptionPeriodNotFinished();
    }

    ERC20Burnable(token).burn(IERC20(token).balanceOf(address(this)));

    uint256 ethRemainder = address(this).balance;
    if (ethRemainder == 0) {
      revert NoEthToWithdraw();
    }

    recipient.call{value: ethRemainder}("");

    emit EthWithdrawnAfterEndingPeriod(recipient, ethRemainder);
  }

  receive() external payable {
    emit EthReceived(msg.sender, msg.value);
  }
}

File 2 of 11 : draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

File 3 of 11 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 */
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    mapping(address account => uint256) private _balances;

    mapping(address account => mapping(address spender => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `value`.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `value`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `value`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     * ```
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Does not emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}

File 4 of 11 : ERC20Burnable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.20;

import {ERC20} from "../ERC20.sol";
import {Context} from "../../../utils/Context.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys a `value` amount of tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 value) public virtual {
        _burn(_msgSender(), value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, deducting from
     * the caller's allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `value`.
     */
    function burnFrom(address account, uint256 value) public virtual {
        _spendAllowance(account, _msgSender(), value);
        _burn(account, value);
    }
}

File 5 of 11 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 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 6 of 11 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 7 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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 8 of 11 : Context.sol
// 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;
    }
}

File 9 of 11 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.20;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the Merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates Merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     *@dev The multiproof provided is not valid.
     */
    error MerkleProofInvalidMultiproof();

    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     */
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the Merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        if (leavesLen + proofLen != totalHashes + 1) {
            revert MerkleProofInvalidMultiproof();
        }

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            if (proofPos != proofLen) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the Merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        if (leavesLen + proofLen != totalHashes + 1) {
            revert MerkleProofInvalidMultiproof();
        }

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            if (proofPos != proofLen) {
                revert MerkleProofInvalidMultiproof();
            }
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Sorts the pair (a, b) and hashes the result.
     */
    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    /**
     * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
     */
    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 10 of 11 : IMerkleDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import {Types} from "../types/Types.sol";

// Allows anyone to redeem a token if they exist in a merkle root.
interface IMerkleDistributor {
  // Returns the address of the token distributed by this contract.
  function token() external view returns (address);

  // Returns the merkle root of the merkle tree containing account balances available to redeem.
  function merkleRoot() external view returns (bytes32);

  // Returns true if the index has been marked redeemed.
  function isRedeemed(uint256 index) external view returns (bool);

  // Redeem the given amount of the token to the given address. Reverts if the inputs are invalid.
  function redeem(Types.Redeem memory redeem, uint256 actualBalance) external;

  // Redeem the given amount of the token to the given address. Reverts if the inputs are invalid.
  function permitRedeem(
    Types.Redeem memory _redeem,
    Types.Permit memory _permit
  ) external;

  // This event is triggered whenever a call to #redeem succeeds.
  event Redeemed(
    uint256 index,
    address account,
    uint256 amount,
    uint256 actualBalance,
    uint256 allocatedEth,
    uint256 redeemedEth
  );
  event EthReceived(address sender, uint256 ethSent);
  event EthWithdrawnAfterEndingPeriod(address recipient, uint256 ethWithdrawn);

  error RedemptionPeriodNotFinished();
  error TokenTransferFailed();
  error EthTransferFailed();
  error InvalidProof();
  error NoEthToWithdraw();
  error IllegibleTokenAmount();
  error RedemptionAlreadyFulfilled();
  error OnlyOwnerCanRedeem();
  error NotEnoughAllocatedEth();
}

File 11 of 11 : Types.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

library Types {
    struct Permit {
    uint256 actualBalance;
    uint256 deadline;
    uint8 v;
    bytes32 r;
    bytes32 s;
  }

  struct Redeem {
    uint256 index;
    address account;
    uint256 tokens;
    uint256 eth;
    bytes32[] merkleProof;
  }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"},{"internalType":"uint256","name":"_endingTimestamp","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EthTransferFailed","type":"error"},{"inputs":[],"name":"IllegibleTokenAmount","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"NoEthToWithdraw","type":"error"},{"inputs":[],"name":"NotEnoughAllocatedEth","type":"error"},{"inputs":[],"name":"OnlyOwnerCanRedeem","type":"error"},{"inputs":[],"name":"RedemptionAlreadyFulfilled","type":"error"},{"inputs":[],"name":"RedemptionPeriodNotFinished","type":"error"},{"inputs":[],"name":"TokenTransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethSent","type":"uint256"}],"name":"EthReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethWithdrawn","type":"uint256"}],"name":"EthWithdrawnAfterEndingPeriod","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actualBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocatedEth","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemedEth","type":"uint256"}],"name":"Redeemed","type":"event"},{"inputs":[],"name":"MAX_PERCENTAGE_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"allocatedTokens","type":"uint256"},{"internalType":"uint256","name":"actual","type":"uint256"},{"internalType":"uint256","name":"allocatedEth","type":"uint256"}],"name":"calcRedeemableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"endingTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"isRedeemed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"},{"internalType":"uint256","name":"eth","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct Types.Redeem","name":"_redeem","type":"tuple"},{"components":[{"internalType":"uint256","name":"actualBalance","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Types.Permit","name":"_permit","type":"tuple"}],"name":"permitRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"recipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"},{"internalType":"uint256","name":"eth","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct Types.Redeem","name":"_redeem","type":"tuple"},{"internalType":"uint256","name":"_actualBalance","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawRemainder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

Deployed Bytecode

0x6080604052600436106100955760003560e01c806366d003ac1161005957806366d003ac146101c25780638b9b1cbd1461020e578063d003948f14610223578063fc0c546a14610243578063fc2dc4c11461027757600080fd5b806314a0fc68146100d95780632eb4a7ab1461010857806332d33cd01461013c5780634b47583d1461016c5780635e5294b71461018e57600080fd5b366100d457604080513381523460208201527f85177f287940f2f05425a4029951af0e047a7f9c4eaa9a6e6917bcd869f86695910160405180910390a1005b600080fd5b3480156100e557600080fd5b506100f5670de0b6b3a764000081565b6040519081526020015b60405180910390f35b34801561011457600080fd5b506100f57fafc2d03d8c6a28fde61b164ee6683b20c43b3b973b7769f8922b0f120ad3a6ec81565b34801561014857600080fd5b5061015c610157366004610a00565b610297565b60405190151581526020016100ff565b34801561017857600080fd5b5061018c610187366004610b79565b6102d8565b005b34801561019a57600080fd5b506100f57f0000000000000000000000000000000000000000000000000000000067b9138081565b3480156101ce57600080fd5b506101f67f000000000000000000000000f29ff96aaea6c9a1fba851f74737f3c069d4f1a981565b6040516001600160a01b0390911681526020016100ff565b34801561021a57600080fd5b5061018c6103a4565b34801561022f57600080fd5b5061018c61023e366004610c17565b6105be565b34801561024f57600080fd5b506101f67f000000000000000000000000d779eea9936b4e323cddff2529eb6f13d0a4d66e81565b34801561028357600080fd5b506100f5610292366004610c5c565b6108c1565b6000806102a661010084610cb4565b905060006102b661010085610cc8565b60009283526020839052604090922054600190921b9182169091149392505050565b8051602082015160408084015160608501516080860151925163d505accf60e01b81523360048201523060248201526044810195909552606485019390935260ff16608484015260a483019190915260c48201526001600160a01b037f000000000000000000000000d779eea9936b4e323cddff2529eb6f13d0a4d66e169063d505accf9060e401600060405180830381600087803b15801561037a57600080fd5b505af115801561038e573d6000803e3d6000fd5b505050506103a08282600001516105be565b5050565b7f0000000000000000000000000000000000000000000000000000000067b9138042116103e45760405163108d550960e11b815260040160405180910390fd5b6040516370a0823160e01b81523060048201527f000000000000000000000000d779eea9936b4e323cddff2529eb6f13d0a4d66e6001600160a01b0316906342966c689082906370a0823190602401602060405180830381865afa158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190610cdc565b6040518263ffffffff1660e01b815260040161049291815260200190565b600060405180830381600087803b1580156104ac57600080fd5b505af11580156104c0573d6000803e3d6000fd5b50479250505060008190036104e8576040516361cc654560e01b815260040160405180910390fd5b6040516001600160a01b037f000000000000000000000000f29ff96aaea6c9a1fba851f74737f3c069d4f1a916908290600081818185875af1925050503d8060008114610551576040519150601f19603f3d011682016040523d82523d6000602084013e610556565b606091505b5050604080516001600160a01b037f000000000000000000000000f29ff96aaea6c9a1fba851f74737f3c069d4f1a9168152602081018490527fa5f9568e9e055da92509aef4173fd2c3035f887b99405eb97a0a07d8e0e14ba492500160405180910390a150565b81516105c990610297565b156105e757604051637ba2bded60e01b815260040160405180910390fd5b81602001516001600160a01b0316336001600160a01b03161461061d57604051631b122f0360e11b815260040160405180910390fd5b6000826000015183602001518460400151856060015160405160200161066e949392919093845260609290921b6bffffffffffffffffffffffff191660208401526034830152605482015260740190565b6040516020818303038152906040528051906020012090506106b583608001517fafc2d03d8c6a28fde61b164ee6683b20c43b3b973b7769f8922b0f120ad3a6ec8361092b565b6106d2576040516309bde33960e01b815260040160405180910390fd5b82516106dd90610941565b60006106f284604001518486606001516108c1565b9050836060015181111561071957604051631521620f60e01b815260040160405180910390fd5b60208401516040516323b872dd60e01b81526001600160a01b039182166004820152306024820152604481018590527f000000000000000000000000d779eea9936b4e323cddff2529eb6f13d0a4d66e909116906323b872dd906064016020604051808303816000875af1158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b99190610cf5565b6107d65760405163022e258160e11b815260040160405180910390fd5b600084602001516001600160a01b03168260405160006040518083038185875af1925050503d8060008114610827576040519150601f19603f3d011682016040523d82523d6000602084013e61082c565b606091505b505090508061084e57604051630db2c7f160e31b815260040160405180910390fd5b84516020808701516040808901516060808b015183519687526001600160a01b039094169486019490945284820152918301879052608083015260a08201849052517f750a00eeda64439abc96172cc789ed1f75f266377874e5c5a80ab1abb35582b29181900360c00190a15050505050565b6000838311156108e457604051635f74de2f60e11b815260040160405180910390fd5b6000846108f9670de0b6b3a764000086610d17565b6109039190610cb4565b9050670de0b6b3a76400006109188285610d17565b6109229190610cb4565b95945050505050565b600082610938858461097f565b14949350505050565b600061094f61010083610cb4565b9050600061095f61010084610cc8565b6000928352602083905260409092208054600190931b9092179091555050565b600081815b84518110156109c4576109b0828683815181106109a3576109a3610d2e565b60200260200101516109ce565b9150806109bc81610d44565b915050610984565b5090505b92915050565b60008183106109ea5760008281526020849052604090206109f9565b60008381526020839052604090205b9392505050565b600060208284031215610a1257600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff81118282101715610a5257610a52610a19565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610a8157610a81610a19565b604052919050565b600060a08284031215610a9b57600080fd5b610aa3610a2f565b8235815290506020808301356001600160a01b0381168114610ac457600080fd5b8082840152506040830135604083015260608301356060830152608083013567ffffffffffffffff80821115610af957600080fd5b818501915085601f830112610b0d57600080fd5b813581811115610b1f57610b1f610a19565b8060051b9150610b30848301610a58565b8181529183018401918481019088841115610b4a57600080fd5b938501935b83851015610b6857843582529385019390850190610b4f565b608087015250939695505050505050565b60008082840360c0811215610b8d57600080fd5b833567ffffffffffffffff811115610ba457600080fd5b610bb086828701610a89565b93505060a0601f1982011215610bc557600080fd5b50610bce610a2f565b6020840135815260408401356020820152606084013560ff81168114610bf357600080fd5b6040820152608084810135606083015260a090940135938101939093525092909150565b60008060408385031215610c2a57600080fd5b823567ffffffffffffffff811115610c4157600080fd5b610c4d85828601610a89565b95602094909401359450505050565b600080600060608486031215610c7157600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082610cc357610cc3610c88565b500490565b600082610cd757610cd7610c88565b500690565b600060208284031215610cee57600080fd5b5051919050565b600060208284031215610d0757600080fd5b815180151581146109f957600080fd5b80820281158282048414176109c8576109c8610c9e565b634e487b7160e01b600052603260045260246000fd5b600060018201610d5657610d56610c9e565b506001019056fea26469706673582212202846d8102c1304485ca9827157affe544d00dbf567c1025f233f97f1825ea80b64736f6c63430008140033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.