ETH Price: $2,659.85 (+1.62%)

Contract

0x765eE5652281D2a17D4e43AeA97a5D47280079a7
 

Overview

ETH Balance

0.081264708354536041 ETH

Eth Value

$216.15 (@ $2,659.85/ETH)

Token Holdings

Transaction Hash
Method
Block
From
To
Deposit Coin207940262024-09-20 19:55:47141 days ago1726862147IN
0x765eE565...7280079a7
0.01 ETH0.0003776315.66735582
Deposit Coin204536742024-08-04 7:24:11189 days ago1722756251IN
0x765eE565...7280079a7
0.01 ETH0.000024020.99676973
Deposit Coin204536712024-08-04 7:23:35189 days ago1722756215IN
0x765eE565...7280079a7
0.009 ETH0.00002561.06248027
Deposit Coin204536682024-08-04 7:22:59189 days ago1722756179IN
0x765eE565...7280079a7
0.01 ETH0.000023450.97330423
Deposit Coin204534832024-08-04 6:45:59189 days ago1722753959IN
0x765eE565...7280079a7
0.005 ETH0.00002411
Transfer202084082024-07-01 1:32:35223 days ago1719797555IN
0x765eE565...7280079a7
0.00023055 ETH0.000096854.59989402
Pause199932832024-06-01 0:06:47253 days ago1717200407IN
0x765eE565...7280079a7
0 ETH0.000192276.88216379
Deposit Coin199932422024-05-31 23:58:35253 days ago1717199915IN
0x765eE565...7280079a7
0.08 ETH0.000519055.81441507
Deposit Coin199932422024-05-31 23:58:35253 days ago1717199915IN
0x765eE565...7280079a7
0.0518318 ETH0.000519055.81441507
Deposit Coin199932362024-05-31 23:57:23253 days ago1717199843IN
0x765eE565...7280079a7
0.011 ETH0.000500575.62259141
Deposit Coin199932362024-05-31 23:57:23253 days ago1717199843IN
0x765eE565...7280079a7
0.005 ETH0.000598075.62259141
Deposit Coin199932322024-05-31 23:56:35253 days ago1717199795IN
0x765eE565...7280079a7
0.02 ETH0.000663116.248133
Deposit Coin199932022024-05-31 23:50:35253 days ago1717199435IN
0x765eE565...7280079a7
0.05684 ETH0.000497165.58422813
Deposit Coin199931992024-05-31 23:49:59253 days ago1717199399IN
0x765eE565...7280079a7
0.098 ETH0.000588925.54906212
Deposit USDT199931902024-05-31 23:48:11253 days ago1717199291IN
0x765eE565...7280079a7
0 ETH0.000528975.92010226
Deposit Coin199931792024-05-31 23:45:59253 days ago1717199159IN
0x765eE565...7280079a7
0.0315 ETH0.000789497.43892775
Deposit Coin199931582024-05-31 23:41:47253 days ago1717198907IN
0x765eE565...7280079a7
0.0114 ETH0.000616775.81153459
Deposit Coin199931562024-05-31 23:41:23253 days ago1717198883IN
0x765eE565...7280079a7
0.352 ETH0.000523095.87548784
Deposit Coin199931532024-05-31 23:40:47253 days ago1717198847IN
0x765eE565...7280079a7
0.0648 ETH0.000673557.56552101
Deposit Coin199931522024-05-31 23:40:35253 days ago1717198835IN
0x765eE565...7280079a7
0.0013873 ETH0.000522175.84942763
Deposit Coin199930952024-05-31 23:29:11253 days ago1717198151IN
0x765eE565...7280079a7
0.0027 ETH0.000626485.88963275
Deposit USDT199930882024-05-31 23:27:47253 days ago1717198067IN
0x765eE565...7280079a7
0 ETH0.000612476.39605231
Deposit Coin199930872024-05-31 23:27:35253 days ago1717198055IN
0x765eE565...7280079a7
0.0086706 ETH0.000559276.28185661
Deposit USDT199930842024-05-31 23:26:59253 days ago1717198019IN
0x765eE565...7280079a7
0 ETH0.000716786.63332159
Deposit Coin199930562024-05-31 23:21:11253 days ago1717197671IN
0x765eE565...7280079a7
0.0137953 ETH0.000532645.98272234
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
199932422024-05-31 23:58:35253 days ago1717199915
0x765eE565...7280079a7
0.07999371 ETH
199932422024-05-31 23:58:35253 days ago1717199915
0x765eE565...7280079a7
0.05183178 ETH
199932362024-05-31 23:57:23253 days ago1717199843
0x765eE565...7280079a7
0.01098833 ETH
199932362024-05-31 23:57:23253 days ago1717199843
0x765eE565...7280079a7
0.00499312 ETH
199932322024-05-31 23:56:35253 days ago1717199795
0x765eE565...7280079a7
0.01998978 ETH
199932022024-05-31 23:50:35253 days ago1717199435
0x765eE565...7280079a7
0.05682666 ETH
199931992024-05-31 23:49:59253 days ago1717199399
0x765eE565...7280079a7
0.09799435 ETH
199931792024-05-31 23:45:59253 days ago1717199159
0x765eE565...7280079a7
0.03149137 ETH
199931582024-05-31 23:41:47253 days ago1717198907
0x765eE565...7280079a7
0.01139307 ETH
199931562024-05-31 23:41:23253 days ago1717198883
0x765eE565...7280079a7
0.35198891 ETH
199931532024-05-31 23:40:47253 days ago1717198847
0x765eE565...7280079a7
0.06478621 ETH
199931522024-05-31 23:40:35253 days ago1717198835
0x765eE565...7280079a7
0.00138728 ETH
199930952024-05-31 23:29:11253 days ago1717198151
0x765eE565...7280079a7
0.00268786 ETH
199930872024-05-31 23:27:35253 days ago1717198055
0x765eE565...7280079a7
0.00867053 ETH
199930562024-05-31 23:21:11253 days ago1717197671
0x765eE565...7280079a7
0.01378614 ETH
199930262024-05-31 23:15:11253 days ago1717197311
0x765eE565...7280079a7
0.15162728 ETH
199930212024-05-31 23:14:11253 days ago1717197251
0x765eE565...7280079a7
0.25998915 ETH
199930132024-05-31 23:12:35253 days ago1717197155
0x765eE565...7280079a7
0.12998595 ETH
199929922024-05-31 23:08:23253 days ago1717196903
0x765eE565...7280079a7
0.0339881 ETH
199929632024-05-31 23:02:35253 days ago1717196555
0x765eE565...7280079a7
0.03448818 ETH
199929492024-05-31 22:59:47253 days ago1717196387
0x765eE565...7280079a7
0.30199575 ETH
199929482024-05-31 22:59:35253 days ago1717196375
0x765eE565...7280079a7
0.38999235 ETH
199929412024-05-31 22:58:11253 days ago1717196291
0x765eE565...7280079a7
0.00598369 ETH
199928972024-05-31 22:49:11253 days ago1717195751
0x765eE565...7280079a7
0.04998375 ETH
199928942024-05-31 22:48:35253 days ago1717195715
0x765eE565...7280079a7
0.01371463 ETH
View All Internal Transactions
Loading...
Loading

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

Contract Name:
Presale

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
paris EvmVersion
File 1 of 13 : Presale.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import { IERC20, SafeERC20 } from "@1inch/solidity-utils/contracts/libraries/SafeERC20.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "./interfaces/IPresale.sol";

contract Presale is IPresale, Ownable, Pausable {
  using SafeERC20 for IERC20;

  int32 public constant STABLETOKEN_PRICE = 1e8;
  uint8 public constant STABLE_TOKEN_DECIMALS = 6;
  uint8 public constant PRICEFEED_DECIMALS = 8;
  uint8 public constant COIN_DECIMALS = 18;

  AggregatorV3Interface public immutable COIN_PRICE_FEED;

  IERC20 public immutable usdcToken;
  IERC20 public immutable usdtToken;

  address public protocolWallet;

  uint256 public totalTokensSold;
  uint256 public totalSoldInUSD; //NOTE Precision is 8 decimals

  uint256 public stageIterator;
  StageData[] public stages;

  mapping(address user => uint256 balance) public balances;

  constructor(
    AggregatorV3Interface COIN_PRICE_FEED_,
    IERC20 usdcToken_,
    IERC20 usdtToken_,
    address protocolWallet_,
    address admin
  ) Ownable(admin) {
    COIN_PRICE_FEED = COIN_PRICE_FEED_;

    usdcToken = usdcToken_;
    usdtToken = usdtToken_;

    protocolWallet = protocolWallet_;

    stages.push(StageData(2e6, 25e5)); // 0.02
    stages.push(StageData(3e6, 25e5)); // 0.03
    stages.push(StageData(4e6, 625e4)); // 0.04
    stages.push(StageData(5e6, 275e5)); // 0.05
    stages.push(StageData(55e5, 375e5)); // 0.055
    stages.push(StageData(6e6, 4125e4)); // 0.06
    stages.push(StageData(65e5, 375e5)); // 0.065
    stages.push(StageData(7e6, 35e6)); // 0.07
    stages.push(StageData(8e6, 75e5)); // 0.08
    stages.push(StageData(9e6, 25e5)); // 0.09
    stages.push(StageData(0, 0));
  }

  function updateProtocolWallet(address wallet) external onlyOwner {
      protocolWallet = wallet;
  }

  function setStage(uint256 stageIterator_) external onlyOwner {
    require(stages.length >= stageIterator_, "Presale: Wrong iterator");

    stageIterator = stageIterator_;
  }

  function updateTotalSold(uint256 amount) external onlyOwner {
    totalTokensSold = amount;
  }

  function pause() external onlyOwner {
    _pause();
  }

  function unpause() external onlyOwner {
    _unpause();
  }

  function rescueFunds(IERC20 token, uint256 amount) external onlyOwner {
      if (address(token) == address(0)) {
          require(amount <= address(this).balance, "Presale: Wrong amount");
          (bool success, ) = payable(msg.sender).call{value: amount}("");

          require(success, "Payout: Transfer coin failed");
      } else {
          require(amount <= token.balanceOf(address(this)), "Presale: Wrong amount");

          token.safeTransfer(protocolWallet, amount);
      }
  }

  function depositUSDCTo(address to, uint256 amount, address referrer) external whenNotPaused {
    (uint256 chargeBack, uint256 spendedValue) = _depositChecksAndEffects(usdcToken, to, amount, true);

    _depositInteractions(usdcToken, amount, chargeBack, spendedValue);

    emit TokensBought(address(usdcToken), to, referrer, spendedValue);
  }

  function depositUSDC(uint256 amount, address referrer) external whenNotPaused {
    (uint256 chargeBack, uint256 spendedValue) = _depositChecksAndEffects(usdcToken, msg.sender, amount, true);

    _depositInteractions(usdcToken, amount, chargeBack, spendedValue);

    emit TokensBought(address(usdcToken), msg.sender, referrer, spendedValue);
  }

  function depositUSDTTo(address to, uint256 amount, address referrer) external whenNotPaused {
    (uint256 chargeBack, uint256 spendedValue) = _depositChecksAndEffects(usdtToken, to, amount, true);

    _depositInteractions(usdtToken, amount, chargeBack, spendedValue);

    emit TokensBought(address(usdtToken), to, referrer, spendedValue);
  }

  function depositUSDT(uint256 amount, address referrer) external whenNotPaused {
    (uint256 chargeBack, uint256 spendedValue) = _depositChecksAndEffects(usdtToken, msg.sender, amount, true);

    _depositInteractions(usdtToken, amount, chargeBack, spendedValue);

    emit TokensBought(address(usdtToken), msg.sender, referrer, spendedValue);
  }

  function depositCoinTo(address to, address referrer) public payable whenNotPaused {
    (uint256 chargeBack, uint256 spendedValue) = _depositChecksAndEffects(IERC20(address(0)), to, msg.value, false);

    (bool success, ) = payable(protocolWallet).call{value: spendedValue}("");
    require(success, "Presale: Coin transfer failed");

    if(chargeBack > 0) {
      (success, ) = payable(msg.sender).call{value: chargeBack}("");
      require(success, "Presale: Coin transfer failed");
    }

    emit TokensBought(address(0), to, referrer, spendedValue);
  }

  function depositCoin(address referrer) public payable whenNotPaused {
    (uint256 chargeBack, uint256 spendedValue) = _depositChecksAndEffects(IERC20(address(0)), msg.sender, msg.value, false);

    (bool success, ) = payable(protocolWallet).call{value: spendedValue}("");
    require(success, "Presale: Coin transfer failed");

    if(chargeBack > 0) {
      (success, ) = payable(msg.sender).call{value: chargeBack}("");
      require(success, "Presale: Coin transfer failed");
    }

    emit TokensBought(address(0), msg.sender, referrer, spendedValue);
  }

  function _depositChecksAndEffects(
    IERC20 token,
    address to,
    uint256 value,
    bool isStableToken
  ) internal returns (uint256 chargeBack, uint256 spendedValue) {
    require(stages[stageIterator].amount != 0, "PreSale: is ended");

    (uint256 tokensToTransfer, uint256 coinPrice) = _calculateAmount(isStableToken, value);
    (chargeBack, spendedValue) = _purchase(token, to, coinPrice, tokensToTransfer, value);
  }

  function _depositInteractions(
    IERC20 token,
    uint256 amount,
    uint256 chargeBack,
    uint256 spendedValue
  ) private {
    token.safeTransferFrom(msg.sender, address(this), amount);
    token.safeTransfer(protocolWallet, spendedValue);
    if(chargeBack > 0) token.safeTransfer(msg.sender, chargeBack);
  }

  function _calculateAmount(bool isStableToken, uint256 value) private view returns (uint256 amount, uint256 price) {
    int256 coinPrice;
    uint256 PRECISION;

    if (isStableToken) {
      coinPrice = STABLETOKEN_PRICE;
      PRECISION = STABLE_TOKEN_DECIMALS;
    } else {
      (, coinPrice, , , ) = COIN_PRICE_FEED.latestRoundData();
      PRECISION = COIN_DECIMALS;
    }

    uint256 expectedAmount = uint(coinPrice) * value / uint(stages[stageIterator].cost);

    return (expectedAmount / 10 ** (PRECISION), uint(coinPrice));
  }

  function _purchase(
    IERC20 token,
    address to,
    uint256 coinPrice,
    uint256 amount,
    uint256 value
  ) private returns (uint256 tokensToChargeBack, uint256 spendedValue) {
    StageData storage crtStage =  stages[stageIterator];

    if (uint(crtStage.amount) < amount) {
      spendedValue = crtStage.amount * crtStage.cost;
    } else {
      spendedValue = amount * crtStage.cost;
    }

    totalSoldInUSD += spendedValue;

    if(address(token) == address(0)) {
      uint256 usdInEth = 1 ether / coinPrice;
      spendedValue *= usdInEth;
    } else {
      spendedValue /= 10 ** (PRICEFEED_DECIMALS - STABLE_TOKEN_DECIMALS);
    }

    if (uint(crtStage.amount) < amount) {
      balances[to] += crtStage.amount;
      totalTokensSold += crtStage.amount;

      tokensToChargeBack = value - spendedValue;

      crtStage.amount = 0;
      stageIterator++;

      emit StageUpdated(stageIterator);
    } else {
      balances[to] += amount;

      totalTokensSold += amount;
      crtStage.amount -= uint160(amount);
    }
  }
}

File 2 of 13 : IDaiLikePermit.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IDaiLikePermit {
    function permit(
        address holder,
        address spender,
        uint256 nonce,
        uint256 expiry,
        bool allowed,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

File 3 of 13 : IPermit2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IPermit2 {
    struct PermitDetails {
        // ERC20 token address
        address token;
        // the maximum amount allowed to spend
        uint160 amount;
        // timestamp at which a spender's token allowances become invalid
        uint48 expiration;
        // an incrementing value indexed per owner,token,and spender for each signature
        uint48 nonce;
    }
    /// @notice The permit message signed for a single token allownce
    struct PermitSingle {
        // the permit data for a single token alownce
        PermitDetails details;
        // address permissioned on the allowed tokens
        address spender;
        // deadline on the permit signature
        uint256 sigDeadline;
    }
    /// @notice Packed allowance
    struct PackedAllowance {
        // amount allowed
        uint160 amount;
        // permission expiry
        uint48 expiration;
        // an incrementing value indexed per owner,token,and spender for each signature
        uint48 nonce;
    }

    function transferFrom(address user, address spender, uint160 amount, address token) external;

    function permit(address owner, PermitSingle memory permitSingle, bytes calldata signature) external;

    function allowance(address user, address token, address spender) external view returns (PackedAllowance memory);
}

File 4 of 13 : IWETH.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IWETH is IERC20 {
    event Deposit(address indexed dst, uint256 wad);

    event Withdrawal(address indexed src, uint256 wad);

    function deposit() external payable;

    function withdraw(uint256 amount) external;
}

File 5 of 13 : RevertReasonForwarder.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @title Revert reason forwarder.
library RevertReasonForwarder {
    /// @dev Forwards latest externall call revert.
    function reRevert() internal pure {
        // bubble up revert reason from latest external call
        assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
            let ptr := mload(0x40)
            returndatacopy(ptr, 0, returndatasize())
            revert(ptr, returndatasize())
        }
    }

    /// @dev Returns latest external call revert reason.
    function reReason() internal pure returns (bytes memory reason) {
        assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
            reason := mload(0x40)
            let length := returndatasize()
            mstore(reason, length)
            returndatacopy(add(reason, 0x20), 0, length)
            mstore(0x40, add(reason, add(0x20, length)))
        }
    }
}

File 6 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
import "../interfaces/IDaiLikePermit.sol";
import "../interfaces/IPermit2.sol";
import "../interfaces/IWETH.sol";
import "../libraries/RevertReasonForwarder.sol";

/**
 * @title Implements efficient safe methods for ERC20 interface.
 * @notice Compared to the standard ERC20, this implementation offers several enhancements:
 * 1. more gas-efficient, providing significant savings in transaction costs.
 * 2. support for different permit implementations
 * 3. forceApprove functionality
 * 4. support for WETH deposit and withdraw
 */
library SafeERC20 {
    error SafeTransferFailed();
    error SafeTransferFromFailed();
    error ForceApproveFailed();
    error SafeIncreaseAllowanceFailed();
    error SafeDecreaseAllowanceFailed();
    error SafePermitBadLength();
    error Permit2TransferAmountTooHigh();

    // Uniswap Permit2 address
    address private constant _PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;
    bytes4 private constant _PERMIT_LENGTH_ERROR = 0x68275857;  // SafePermitBadLength.selector
    uint256 private constant _RAW_CALL_GAS_LIMIT = 5000;

    /**
     * @notice Fetches the balance of a specific ERC20 token held by an account.
     * Consumes less gas then regular `ERC20.balanceOf`.
     * @dev Note that the implementation does not perform dirty bits cleaning, so it is the
     * responsibility of the caller to make sure that the higher 96 bits of the `account` parameter are clean.
     * @param token The IERC20 token contract for which the balance will be fetched.
     * @param account The address of the account whose token balance will be fetched.
     * @return tokenBalance The balance of the specified ERC20 token held by the account.
     */
    function safeBalanceOf(
        IERC20 token,
        address account
    ) internal view returns(uint256 tokenBalance) {
        bytes4 selector = IERC20.balanceOf.selector;
        assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
            mstore(0x00, selector)
            mstore(0x04, account)
            let success := staticcall(gas(), token, 0x00, 0x24, 0x00, 0x20)
            tokenBalance := mload(0)

            if or(iszero(success), lt(returndatasize(), 0x20)) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
        }
    }

    /**
     * @notice Attempts to safely transfer tokens from one address to another.
     * @dev If permit2 is true, uses the Permit2 standard; otherwise uses the standard ERC20 transferFrom.
     * Either requires `true` in return data, or requires target to be smart-contract and empty return data.
     * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of
     * the caller to make sure that the higher 96 bits of the `from` and `to` parameters are clean.
     * @param token The IERC20 token contract from which the tokens will be transferred.
     * @param from The address from which the tokens will be transferred.
     * @param to The address to which the tokens will be transferred.
     * @param amount The amount of tokens to transfer.
     * @param permit2 If true, uses the Permit2 standard for the transfer; otherwise uses the standard ERC20 transferFrom.
     */
    function safeTransferFromUniversal(
        IERC20 token,
        address from,
        address to,
        uint256 amount,
        bool permit2
    ) internal {
        if (permit2) {
            safeTransferFromPermit2(token, from, to, amount);
        } else {
            safeTransferFrom(token, from, to, amount);
        }
    }

    /**
     * @notice Attempts to safely transfer tokens from one address to another using the ERC20 standard.
     * @dev Either requires `true` in return data, or requires target to be smart-contract and empty return data.
     * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of
     * the caller to make sure that the higher 96 bits of the `from` and `to` parameters are clean.
     * @param token The IERC20 token contract from which the tokens will be transferred.
     * @param from The address from which the tokens will be transferred.
     * @param to The address to which the tokens will be transferred.
     * @param amount The amount of tokens to transfer.
     */
    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bytes4 selector = token.transferFrom.selector;
        bool success;
        assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
            let data := mload(0x40)

            mstore(data, selector)
            mstore(add(data, 0x04), from)
            mstore(add(data, 0x24), to)
            mstore(add(data, 0x44), amount)
            success := call(gas(), token, 0, data, 100, 0x0, 0x20)
            if success {
                switch returndatasize()
                case 0 {
                    success := gt(extcodesize(token), 0)
                }
                default {
                    success := and(gt(returndatasize(), 31), eq(mload(0), 1))
                }
            }
        }
        if (!success) revert SafeTransferFromFailed();
    }

    /**
     * @notice Attempts to safely transfer tokens from one address to another using the Permit2 standard.
     * @dev Either requires `true` in return data, or requires target to be smart-contract and empty return data.
     * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of
     * the caller to make sure that the higher 96 bits of the `from` and `to` parameters are clean.
     * @param token The IERC20 token contract from which the tokens will be transferred.
     * @param from The address from which the tokens will be transferred.
     * @param to The address to which the tokens will be transferred.
     * @param amount The amount of tokens to transfer.
     */
    function safeTransferFromPermit2(
        IERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        if (amount > type(uint160).max) revert Permit2TransferAmountTooHigh();
        bytes4 selector = IPermit2.transferFrom.selector;
        bool success;
        assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
            let data := mload(0x40)

            mstore(data, selector)
            mstore(add(data, 0x04), from)
            mstore(add(data, 0x24), to)
            mstore(add(data, 0x44), amount)
            mstore(add(data, 0x64), token)
            success := call(gas(), _PERMIT2, 0, data, 0x84, 0x0, 0x0)
            if success {
                success := gt(extcodesize(_PERMIT2), 0)
            }
        }
        if (!success) revert SafeTransferFromFailed();
    }

    /**
     * @notice Attempts to safely transfer tokens to another address.
     * @dev Either requires `true` in return data, or requires target to be smart-contract and empty return data.
     * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of
     * the caller to make sure that the higher 96 bits of the `to` parameter are clean.
     * @param token The IERC20 token contract from which the tokens will be transferred.
     * @param to The address to which the tokens will be transferred.
     * @param value The amount of tokens to transfer.
     */
    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        if (!_makeCall(token, token.transfer.selector, to, value)) {
            revert SafeTransferFailed();
        }
    }

    /**
     * @notice Attempts to approve a spender to spend a certain amount of tokens.
     * @dev If `approve(from, to, amount)` fails, it tries to set the allowance to zero, and retries the `approve` call.
     * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of
     * the caller to make sure that the higher 96 bits of the `spender` parameter are clean.
     * @param token The IERC20 token contract on which the call will be made.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     */
    function forceApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        if (!_makeCall(token, token.approve.selector, spender, value)) {
            if (
                !_makeCall(token, token.approve.selector, spender, 0) ||
                !_makeCall(token, token.approve.selector, spender, value)
            ) {
                revert ForceApproveFailed();
            }
        }
    }

    /**
     * @notice Safely increases the allowance of a spender.
     * @dev Increases with safe math check. Checks if the increased allowance will overflow, if yes, then it reverts the transaction.
     * Then uses `forceApprove` to increase the allowance.
     * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of
     * the caller to make sure that the higher 96 bits of the `spender` parameter are clean.
     * @param token The IERC20 token contract on which the call will be made.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to increase the allowance by.
     */
    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 allowance = token.allowance(address(this), spender);
        if (value > type(uint256).max - allowance) revert SafeIncreaseAllowanceFailed();
        forceApprove(token, spender, allowance + value);
    }

    /**
     * @notice Safely decreases the allowance of a spender.
     * @dev Decreases with safe math check. Checks if the decreased allowance will underflow, if yes, then it reverts the transaction.
     * Then uses `forceApprove` to increase the allowance.
     * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of
     * the caller to make sure that the higher 96 bits of the `spender` parameter are clean.
     * @param token The IERC20 token contract on which the call will be made.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to decrease the allowance by.
     */
    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 allowance = token.allowance(address(this), spender);
        if (value > allowance) revert SafeDecreaseAllowanceFailed();
        forceApprove(token, spender, allowance - value);
    }

    /**
     * @notice Attempts to execute the `permit` function on the provided token with the sender and contract as parameters.
     * Permit type is determined automatically based on permit calldata (IERC20Permit, IDaiLikePermit, and IPermit2).
     * @dev Wraps `tryPermit` function and forwards revert reason if permit fails.
     * @param token The IERC20 token to execute the permit function on.
     * @param permit The permit data to be used in the function call.
     */
    function safePermit(IERC20 token, bytes calldata permit) internal {
        if (!tryPermit(token, msg.sender, address(this), permit)) RevertReasonForwarder.reRevert();
    }

    /**
     * @notice Attempts to execute the `permit` function on the provided token with custom owner and spender parameters.
     * Permit type is determined automatically based on permit calldata (IERC20Permit, IDaiLikePermit, and IPermit2).
     * @dev Wraps `tryPermit` function and forwards revert reason if permit fails.
     * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of
     * the caller to make sure that the higher 96 bits of the `owner` and `spender` parameters are clean.
     * @param token The IERC20 token to execute the permit function on.
     * @param owner The owner of the tokens for which the permit is made.
     * @param spender The spender allowed to spend the tokens by the permit.
     * @param permit The permit data to be used in the function call.
     */
    function safePermit(IERC20 token, address owner, address spender, bytes calldata permit) internal {
        if (!tryPermit(token, owner, spender, permit)) RevertReasonForwarder.reRevert();
    }

    /**
     * @notice Attempts to execute the `permit` function on the provided token with the sender and contract as parameters.
     * @dev Invokes `tryPermit` with sender as owner and contract as spender.
     * @param token The IERC20 token to execute the permit function on.
     * @param permit The permit data to be used in the function call.
     * @return success Returns true if the permit function was successfully executed, false otherwise.
     */
    function tryPermit(IERC20 token, bytes calldata permit) internal returns(bool success) {
        return tryPermit(token, msg.sender, address(this), permit);
    }

    /**
     * @notice The function attempts to call the permit function on a given ERC20 token.
     * @dev The function is designed to support a variety of permit functions, namely: IERC20Permit, IDaiLikePermit, and IPermit2.
     * It accommodates both Compact and Full formats of these permit types.
     * Please note, it is expected that the `expiration` parameter for the compact Permit2 and the `deadline` parameter
     * for the compact Permit are to be incremented by one before invoking this function. This approach is motivated by
     * gas efficiency considerations; as the unlimited expiration period is likely to be the most common scenario, and
     * zeros are cheaper to pass in terms of gas cost. Thus, callers should increment the expiration or deadline by one
     * before invocation for optimized performance.
     * Note that the implementation does not perform dirty bits cleaning, so it is the responsibility of
     * the caller to make sure that the higher 96 bits of the `owner` and `spender` parameters are clean.
     * @param token The address of the ERC20 token on which to call the permit function.
     * @param owner The owner of the tokens. This address should have signed the off-chain permit.
     * @param spender The address which will be approved for transfer of tokens.
     * @param permit The off-chain permit data, containing different fields depending on the type of permit function.
     * @return success A boolean indicating whether the permit call was successful.
     */
    function tryPermit(IERC20 token, address owner, address spender, bytes calldata permit) internal returns(bool success) {
        // load function selectors for different permit standards
        bytes4 permitSelector = IERC20Permit.permit.selector;
        bytes4 daiPermitSelector = IDaiLikePermit.permit.selector;
        bytes4 permit2Selector = IPermit2.permit.selector;
        assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
            let ptr := mload(0x40)

            // Switch case for different permit lengths, indicating different permit standards
            switch permit.length
            // Compact IERC20Permit
            case 100 {
                mstore(ptr, permitSelector)     // store selector
                mstore(add(ptr, 0x04), owner)   // store owner
                mstore(add(ptr, 0x24), spender) // store spender

                // Compact IERC20Permit.permit(uint256 value, uint32 deadline, uint256 r, uint256 vs)
                {  // stack too deep
                    let deadline := shr(224, calldataload(add(permit.offset, 0x20))) // loads permit.offset 0x20..0x23
                    let vs := calldataload(add(permit.offset, 0x44))                 // loads permit.offset 0x44..0x63

                    calldatacopy(add(ptr, 0x44), permit.offset, 0x20)            // store value     = copy permit.offset 0x00..0x19
                    mstore(add(ptr, 0x64), sub(deadline, 1))                     // store deadline  = deadline - 1
                    mstore(add(ptr, 0x84), add(27, shr(255, vs)))                // store v         = most significant bit of vs + 27 (27 or 28)
                    calldatacopy(add(ptr, 0xa4), add(permit.offset, 0x24), 0x20) // store r         = copy permit.offset 0x24..0x43
                    mstore(add(ptr, 0xc4), shr(1, shl(1, vs)))                   // store s         = vs without most significant bit
                }
                // IERC20Permit.permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
                success := call(gas(), token, 0, ptr, 0xe4, 0, 0)
            }
            // Compact IDaiLikePermit
            case 72 {
                mstore(ptr, daiPermitSelector)  // store selector
                mstore(add(ptr, 0x04), owner)   // store owner
                mstore(add(ptr, 0x24), spender) // store spender

                // Compact IDaiLikePermit.permit(uint32 nonce, uint32 expiry, uint256 r, uint256 vs)
                {  // stack too deep
                    let expiry := shr(224, calldataload(add(permit.offset, 0x04))) // loads permit.offset 0x04..0x07
                    let vs := calldataload(add(permit.offset, 0x28))               // loads permit.offset 0x28..0x47

                    mstore(add(ptr, 0x44), shr(224, calldataload(permit.offset))) // store nonce   = copy permit.offset 0x00..0x03
                    mstore(add(ptr, 0x64), sub(expiry, 1))                        // store expiry  = expiry - 1
                    mstore(add(ptr, 0x84), true)                                  // store allowed = true
                    mstore(add(ptr, 0xa4), add(27, shr(255, vs)))                 // store v       = most significant bit of vs + 27 (27 or 28)
                    calldatacopy(add(ptr, 0xc4), add(permit.offset, 0x08), 0x20)  // store r       = copy permit.offset 0x08..0x27
                    mstore(add(ptr, 0xe4), shr(1, shl(1, vs)))                    // store s       = vs without most significant bit
                }
                // IDaiLikePermit.permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s)
                success := call(gas(), token, 0, ptr, 0x104, 0, 0)
            }
            // IERC20Permit
            case 224 {
                mstore(ptr, permitSelector)
                calldatacopy(add(ptr, 0x04), permit.offset, permit.length) // copy permit calldata
                // IERC20Permit.permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
                success := call(gas(), token, 0, ptr, 0xe4, 0, 0)
            }
            // IDaiLikePermit
            case 256 {
                mstore(ptr, daiPermitSelector)
                calldatacopy(add(ptr, 0x04), permit.offset, permit.length) // copy permit calldata
                // IDaiLikePermit.permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s)
                success := call(gas(), token, 0, ptr, 0x104, 0, 0)
            }
            // Compact IPermit2
            case 96 {
                // Compact IPermit2.permit(uint160 amount, uint32 expiration, uint32 nonce, uint32 sigDeadline, uint256 r, uint256 vs)
                mstore(ptr, permit2Selector)  // store selector
                mstore(add(ptr, 0x04), owner) // store owner
                mstore(add(ptr, 0x24), token) // store token

                calldatacopy(add(ptr, 0x50), permit.offset, 0x14)             // store amount = copy permit.offset 0x00..0x13
                // and(0xffffffffffff, ...) - conversion to uint48
                mstore(add(ptr, 0x64), and(0xffffffffffff, sub(shr(224, calldataload(add(permit.offset, 0x14))), 1))) // store expiration = ((permit.offset 0x14..0x17 - 1) & 0xffffffffffff)
                mstore(add(ptr, 0x84), shr(224, calldataload(add(permit.offset, 0x18)))) // store nonce = copy permit.offset 0x18..0x1b
                mstore(add(ptr, 0xa4), spender)                               // store spender
                // and(0xffffffffffff, ...) - conversion to uint48
                mstore(add(ptr, 0xc4), and(0xffffffffffff, sub(shr(224, calldataload(add(permit.offset, 0x1c))), 1))) // store sigDeadline = ((permit.offset 0x1c..0x1f - 1) & 0xffffffffffff)
                mstore(add(ptr, 0xe4), 0x100)                                 // store offset = 256
                mstore(add(ptr, 0x104), 0x40)                                 // store length = 64
                calldatacopy(add(ptr, 0x124), add(permit.offset, 0x20), 0x20) // store r      = copy permit.offset 0x20..0x3f
                calldatacopy(add(ptr, 0x144), add(permit.offset, 0x40), 0x20) // store vs     = copy permit.offset 0x40..0x5f
                // IPermit2.permit(address owner, PermitSingle calldata permitSingle, bytes calldata signature)
                success := call(gas(), _PERMIT2, 0, ptr, 0x164, 0, 0)
            }
            // IPermit2
            case 352 {
                mstore(ptr, permit2Selector)
                calldatacopy(add(ptr, 0x04), permit.offset, permit.length) // copy permit calldata
                // IPermit2.permit(address owner, PermitSingle calldata permitSingle, bytes calldata signature)
                success := call(gas(), _PERMIT2, 0, ptr, 0x164, 0, 0)
            }
            // Unknown
            default {
                mstore(ptr, _PERMIT_LENGTH_ERROR)
                revert(ptr, 4)
            }
        }
    }

    /**
     * @dev Executes a low level call to a token contract, making it resistant to reversion and erroneous boolean returns.
     * @param token The IERC20 token contract on which the call will be made.
     * @param selector The function signature that is to be called on the token contract.
     * @param to The address to which the token amount will be transferred.
     * @param amount The token amount to be transferred.
     * @return success A boolean indicating if the call was successful. Returns 'true' on success and 'false' on failure.
     * In case of success but no returned data, validates that the contract code exists.
     * In case of returned data, ensures that it's a boolean `true`.
     */
    function _makeCall(
        IERC20 token,
        bytes4 selector,
        address to,
        uint256 amount
    ) private returns (bool success) {
        assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
            let data := mload(0x40)

            mstore(data, selector)
            mstore(add(data, 0x04), to)
            mstore(add(data, 0x24), amount)
            success := call(gas(), token, 0, data, 0x44, 0x0, 0x20)
            if success {
                switch returndatasize()
                case 0 {
                    success := gt(extcodesize(token), 0)
                }
                default {
                    success := and(gt(returndatasize(), 31), eq(mload(0), 1))
                }
            }
        }
    }

    /**
     * @notice Safely deposits a specified amount of Ether into the IWETH contract. Consumes less gas then regular `IWETH.deposit`.
     * @param weth The IWETH token contract.
     * @param amount The amount of Ether to deposit into the IWETH contract.
     */
    function safeDeposit(IWETH weth, uint256 amount) internal {
        if (amount > 0) {
            bytes4 selector = IWETH.deposit.selector;
            assembly ("memory-safe") { // solhint-disable-line no-inline-assembly
                mstore(0, selector)
                if iszero(call(gas(), weth, amount, 0, 4, 0, 0)) {
                    let ptr := mload(0x40)
                    returndatacopy(ptr, 0, returndatasize())
                    revert(ptr, returndatasize())
                }
            }
        }
    }

    /**
     * @notice Safely withdraws a specified amount of wrapped Ether from the IWETH contract. Consumes less gas then regular `IWETH.withdraw`.
     * @dev Uses inline assembly to interact with the IWETH contract.
     * @param weth The IWETH token contract.
     * @param amount The amount of wrapped Ether to withdraw from the IWETH contract.
     */
    function safeWithdraw(IWETH weth, uint256 amount) internal {
        bytes4 selector = IWETH.withdraw.selector;
        assembly ("memory-safe") {  // solhint-disable-line no-inline-assembly
            mstore(0, selector)
            mstore(4, amount)
            if iszero(call(gas(), weth, 0, 0, 0x24, 0, 0)) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
        }
    }

    /**
     * @notice Safely withdraws a specified amount of wrapped Ether from the IWETH contract to a specified recipient.
     * Consumes less gas then regular `IWETH.withdraw`.
     * @param weth The IWETH token contract.
     * @param amount The amount of wrapped Ether to withdraw from the IWETH contract.
     * @param to The recipient of the withdrawn Ether.
     */
    function safeWithdrawTo(IWETH weth, uint256 amount, address to) internal {
        safeWithdraw(weth, amount);
        if (to != address(this)) {
            assembly ("memory-safe") {  // solhint-disable-line no-inline-assembly
                if iszero(call(_RAW_CALL_GAS_LIMIT, to, amount, 0, 0, 0, 0)) {
                    let ptr := mload(0x40)
                    returndatacopy(ptr, 0, returndatasize())
                    revert(ptr, returndatasize())
                }
            }
        }
    }
}

File 7 of 13 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  function getRoundData(
    uint80 _roundId
  ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

  function latestRoundData()
    external
    view
    returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}

File 8 of 13 : Ownable.sol
// 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);
    }
}

File 9 of 13 : 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 10 of 13 : 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 11 of 13 : 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 12 of 13 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 13 of 13 : IPresale.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

interface IPresale {
    struct StageData {
        uint96 cost;
        uint160 amount;
    }

    event TokensBought(address indexed token, address indexed user, address indexed referrer, uint256 amount);
    event StageUpdated(uint256 currentStage);

    function updateProtocolWallet(address wallet) external;
    function setStage(uint256 stageIterator_) external;
    function updateTotalSold(uint256 amount) external;
    function pause() external;
    function unpause() external;

    function depositUSDCTo(address to, uint256 amount, address referrer) external;
    function depositUSDTTo(address to, uint256 amount, address referrer) external;

    function depositUSDC(uint256 amount, address referrer) external;
    function depositUSDT(uint256 amount, address referrer) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract AggregatorV3Interface","name":"COIN_PRICE_FEED_","type":"address"},{"internalType":"contract IERC20","name":"usdcToken_","type":"address"},{"internalType":"contract IERC20","name":"usdtToken_","type":"address"},{"internalType":"address","name":"protocolWallet_","type":"address"},{"internalType":"address","name":"admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"SafeTransferFailed","type":"error"},{"inputs":[],"name":"SafeTransferFromFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"currentStage","type":"uint256"}],"name":"StageUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"COIN_DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COIN_PRICE_FEED","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICEFEED_DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STABLETOKEN_PRICE","outputs":[{"internalType":"int32","name":"","type":"int32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STABLE_TOKEN_DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"referrer","type":"address"}],"name":"depositCoin","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"referrer","type":"address"}],"name":"depositCoinTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"referrer","type":"address"}],"name":"depositUSDC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"referrer","type":"address"}],"name":"depositUSDCTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"referrer","type":"address"}],"name":"depositUSDT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"referrer","type":"address"}],"name":"depositUSDTTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageIterator_","type":"uint256"}],"name":"setStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stageIterator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stages","outputs":[{"internalType":"uint96","name":"cost","type":"uint96"},{"internalType":"uint160","name":"amount","type":"uint160"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSoldInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTokensSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"updateProtocolWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"updateTotalSold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdcToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdtToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x6080604081815260048036101561001557600080fd5b600092833560e01c90816306d6e63f14610faa5750806311eac85514610f3b5780631c7e11af14610e6a57806327e235e314610e0857806338aff6ae14610dce5780633be00ab314610d945780633eb1d77714610cee5780633f4ba83a14610c2f5780633f63cf9714610b9a57806345f5c0dc14610ad65780635c975abb14610a9357806363b2011714610a565780636f6c2bd3146109e4578063715018a61461094857806376aa28fc1461090857806378e3214f146107705780637f9aee99146107335780638456cb591461068a578063845ddcb214610622578063860956b6146105e55780638da5cb5b146105945780639a6c595214610525578063a98ad46c146104b6578063ad50d14214610414578063ba680e56146103d9578063cbd6e8f41461030a578063d434df71146102cc578063e308a099146102475763f2fde38b1461016257600080fd5b346102435760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261024357610199610ffa565b906101a26118ed565b73ffffffffffffffffffffffffffffffffffffffff8092169283156102145750508254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b908460249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b8280fd5b83346102c95760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102c95773ffffffffffffffffffffffffffffffffffffffff610294610ffa565b61029c6118ed565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600154161760015580f35b80fd5b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306576020905160088152f35b5080fd5b505060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103065761033e610ffa565b906103476112a2565b61035134336112db565b92909173ffffffffffffffffffffffffffffffffffffffff92610387868080808989600154165af161038161117a565b506111d8565b85816103c0575b5050519283521690827f3bf78ceb2bec33367593d193d62ee0bab304fd3356e414656d746684d8c8d9ce60203393a480f35b8080806103d294335af161038161117a565b388561038e565b503461024357827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102435760209250549051908152f35b505034610306577f3bf78ceb2bec33367593d193d62ee0bab304fd3356e414656d746684d8c8d9ce90602061044836611045565b6104569592959391936112a2565b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4894610490610486868989611700565b969087918961193e565b5193845273ffffffffffffffffffffffffffffffffffffffff908116958116941692a480f35b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306576020905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7168152f35b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419168152f35b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103065773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261030657602090516305f5e1008152f35b508290346103065760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103065735906005548210156102c9575061066a906110a4565b50548151906bffffffffffffffffffffffff8116825260601c6020820152f35b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103065760207f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258916106e66118ed565b6106ee6112a2565b740100000000000000000000000000000000000000007fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff85541617845551338152a180f35b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306576020906003549051908152f35b50903461024357807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610243578273ffffffffffffffffffffffffffffffffffffffff83358181169182820361090457602435926107cf6118ed565b8061085a57505050818080926107e74782111561123d565b335af16107f261117a565b50156107fd57505080f35b90602060649251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601c60248201527f5061796f75743a205472616e7366657220636f696e206661696c6564000000006044820152fd5b91935091939460209060248751809481937f70a0823100000000000000000000000000000000000000000000000000000000835230908301525afa9485156108fb575085946108c1575b506108b46108be9484111561123d565b6001541690611a12565b80f35b93506020843d6020116108f3575b816108dc6020938361110a565b810103126108ef579251926108b46108a4565b8480fd5b3d91506108cf565b513d87823e3d90fd5b8380fd5b8382346103065760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306576109416118ed565b3560025580f35b83346102c957807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102c95761097f6118ed565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b505034610306577f3bf78ceb2bec33367593d193d62ee0bab304fd3356e414656d746684d8c8d9ce906020610a1836611045565b610a269592959391936112a2565b7f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec794610490610486868989611700565b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306576020906002549051908152f35b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103065760ff6020925460a01c1690519015158152f35b503461024357817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610243573590610b0f611022565b91610b186112a2565b7f3bf78ceb2bec33367593d193d62ee0bab304fd3356e414656d746684d8c8d9ce60207f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec793610b75610b6b853388611700565b959086918861193e565b5192835273ffffffffffffffffffffffffffffffffffffffff9485169433941692a480f35b503461024357817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610243573590610bd3611022565b91610bdc6112a2565b7f3bf78ceb2bec33367593d193d62ee0bab304fd3356e414656d746684d8c8d9ce60207f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4893610b75610b6b853388611700565b503461024357827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261024357610c666118ed565b82549060ff8260a01c1615610cc757507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa917fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff60209216845551338152a180f35b82517f8dfc202b000000000000000000000000000000000000000000000000000000008152fd5b50346102435760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261024357803591610d296118ed565b8260055410610d3757505580f35b90602060649251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601760248201527f50726573616c653a2057726f6e67206974657261746f720000000000000000006044820152fd5b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306576020905160068152f35b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306576020905160128152f35b5050346103065760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306578060209273ffffffffffffffffffffffffffffffffffffffff610e5a610ffa565b1681526006845220549051908152f35b5050807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261030657610e9d610ffa565b90827f3bf78ceb2bec33367593d193d62ee0bab304fd3356e414656d746684d8c8d9ce6020610eca611022565b93610ed36112a2565b610edd34876112db565b9573ffffffffffffffffffffffffffffffffffffffff928392610f0d888080808d89600154165af161038161117a565b8781610f22575b50505196875216951693a480f35b808080610f3494335af161038161117a565b3887610f14565b50503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610306576020905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48168152f35b84903461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103065760209073ffffffffffffffffffffffffffffffffffffffff600154168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361101d57565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361101d57565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc606091011261101d5773ffffffffffffffffffffffffffffffffffffffff600435818116810361101d579160243591604435908116810361101d5790565b6005548110156110db5760056000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00190600090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761114b57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b3d156111d3573d9067ffffffffffffffff821161114b57604051916111c760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116018461110a565b82523d6000602084013e565b606090565b156111df57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f50726573616c653a20436f696e207472616e73666572206661696c65640000006044820152fd5b1561124457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f50726573616c653a2057726f6e6720616d6f756e7400000000000000000000006044820152fd5b60ff60005460a01c166112b157565b60046040517fd93c0665000000000000000000000000000000000000000000000000000000008152fd5b919060048054916112eb836110a4565b505490606091821c156116a25773ffffffffffffffffffffffffffffffffffffffff91604051967ffeaf968c00000000000000000000000000000000000000000000000000000000885260a0888681877f0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419165afa9384156116965760009461163a575b6113ae9697985061137f8486611ac3565b97611389816110a4565b5098670de0b6b3a76400009889916bffffffffffffffffffffffff809c541690611b05565b04976113bb6000926110a4565b509687548b81881c918c831060001461162857169085828202169181830414901517156115fa57915b6113f083600354611b3e565b60035581156115cc579061140692910490611ac3565b97808754861c106000146115165750509061144892918554831c9116600052600660205261143a6040600020918254611b3e565b90558354901c600254611b3e565b6002558381039081116114e85793815416905580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146114ba577f34cf54504fd39ab670a54acbb37f686c5bd25e6eedfa39889cba899d360bc7d991600160209201809155604051908152a19091565b6011827f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b6011837f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b9196945097508580921660005260066020526040600020611538828254611b3e565b905561154681600254611b3e565b60025516908354901c0392831161159e57509061159a91906bffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000083549260601b169116179055565b9091565b6011907f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b60128a7f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b60118a7f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b6116349250168b611ac3565b916113e4565b939760a0813d60a01161168e575b8161165560a0938361110a565b8101031261168a576113ae9697985061166d81611aac565b5061167f608060208301519201611aac565b50938897965061136e565b8880fd5b3d9150611648565b6040513d6000823e3d90fd5b6064836020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601160248201527f50726553616c653a20697320656e6465640000000000000000000000000000006044820152fd5b9091600490815490611711826110a4565b5054606090811c1561188f576305f5e10095828702968704830361186157620f424061175861173f866110a4565b50986bffffffffffffffffffffffff809a541690611b05565b04956117656000956110a4565b509485548981861c918a831060001461185057169073ffffffffffffffffffffffffffffffffffffffff82820216918183041490151715611818575b6117ad81600354611b3e565b60035573ffffffffffffffffffffffffffffffffffffffff928316611846576402540be4009081810291818304149015171561181857975b808754861c106000146115165750509061144892918554831c9116600052600660205261143a6040600020918254611b3e565b6011887f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b60649004976117e5565b61185c92501689611ac3565b6117a1565b6011857f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b6064846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601160248201527f50726553616c653a20697320656e6465640000000000000000000000000000006044820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361190e57565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fd5b92906020906064600091604051907f23b872dd000000000000000000000000000000000000000000000000000000008252336004830152306024830152604482015282875af1806119f2575b156119c8576119b29073ffffffffffffffffffffffffffffffffffffffff6001541684611a12565b806119bb575050565b6119c6913390611a12565b565b60046040517ff4059071000000000000000000000000000000000000000000000000000000008152fd5b503d15611a0957600160005114601f3d111661198a565b823b151561198a565b916044602092600092604051917fa9059cbb0000000000000000000000000000000000000000000000000000000083526004830152602482015282855af19081611a89575b5015611a5f57565b60046040517ffb7f5079000000000000000000000000000000000000000000000000000000008152fd5b90503d15611aa45750600160005114601f3d11165b38611a57565b3b1515611a9e565b519069ffffffffffffffffffff8216820361101d57565b81810292918115918404141715611ad657565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8115611b0f570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b91908201809211611ad65756fea264697066735822122034173096e0cf533e89eac36949a92a758375f2de515c1853173f965f72a9158664736f6c63430008180033

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.