ETH Price: $2,394.50 (-0.36%)

Contract

0x980C680a90631c8Ea49fA37B47AbC3154219EC1a
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Redeem186421582023-11-24 14:27:59285 days ago1700836079IN
0x980C680a...54219EC1a
0 ETH0.0058283735.72401319
Redeem186421552023-11-24 14:27:23285 days ago1700836043IN
0x980C680a...54219EC1a
0 ETH0.0016759138.68233013
Mint186287882023-11-22 17:32:59287 days ago1700674379IN
0x980C680a...54219EC1a
0 ETH0.0031903468.39930014
Mint185932982023-11-17 18:10:35292 days ago1700244635IN
0x980C680a...54219EC1a
0 ETH0.0058410332.94027542
Redeem185881582023-11-17 0:55:35293 days ago1700182535IN
0x980C680a...54219EC1a
0 ETH0.0039358124.10971235
Mint185870132023-11-16 21:03:47293 days ago1700168627IN
0x980C680a...54219EC1a
0 ETH0.0071962940.58320518
Redeem185792962023-11-15 19:13:23294 days ago1700075603IN
0x980C680a...54219EC1a
0 ETH0.0084521851.82779266
Mint185792162023-11-15 18:57:11294 days ago1700074631IN
0x980C680a...54219EC1a
0 ETH0.0077290143.61601311
Redeem185598572023-11-13 1:58:35297 days ago1699840715IN
0x980C680a...54219EC1a
0 ETH0.0058701735.98995713
Mint185421282023-11-10 14:25:47299 days ago1699626347IN
0x980C680a...54219EC1a
0 ETH0.0064446634.07332401
Redeem185358892023-11-09 17:29:59300 days ago1699550999IN
0x980C680a...54219EC1a
0 ETH0.0116651871.46294976
Mint185356332023-11-09 16:38:23300 days ago1699547903IN
0x980C680a...54219EC1a
0 ETH0.00594624154.51216144
Disable Mint Red...185356202023-11-09 16:35:47300 days ago1699547747IN
0x980C680a...54219EC1a
0 ETH0.0058856200
Mint185338552023-11-09 10:41:23301 days ago1699526483IN
0x980C680a...54219EC1a
0 ETH0.0060247731.83583065
Redeem185291942023-11-08 19:01:59301 days ago1699470119IN
0x980C680a...54219EC1a
0 ETH0.010820366.29192674
Mint185291702023-11-08 18:57:11301 days ago1699469831IN
0x980C680a...54219EC1a
0 ETH0.0090283652.44262957
Redeem185279502023-11-08 14:51:47301 days ago1699455107IN
0x980C680a...54219EC1a
0 ETH0.007149842.49943724
Mint185276692023-11-08 13:55:23301 days ago1699451723IN
0x980C680a...54219EC1a
0 ETH0.0069065838.94675787
Redeem185276662023-11-08 13:54:47301 days ago1699451687IN
0x980C680a...54219EC1a
0 ETH0.0064837138.53732403
Mint185261002023-11-08 8:39:11302 days ago1699432751IN
0x980C680a...54219EC1a
0 ETH0.0040157723.32622206
Mint185223372023-11-07 20:02:23302 days ago1699387343IN
0x980C680a...54219EC1a
0 ETH0.0064850936.56501002
Redeem185176692023-11-07 4:22:23303 days ago1699330943IN
0x980C680a...54219EC1a
0 ETH0.0036223921.53202437
Mint185016362023-11-04 22:26:23305 days ago1699136783IN
0x980C680a...54219EC1a
0 ETH0.0024309813.70757365
Redeem185010012023-11-04 20:18:11305 days ago1699129091IN
0x980C680a...54219EC1a
0 ETH0.0021980513.46468167
Mint184960902023-11-04 3:46:11306 days ago1699069571IN
0x980C680a...54219EC1a
0 ETH0.002411313.59752439
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EthenaMinting

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 20000 runs

Other Settings:
paris EvmVersion
File 1 of 21 : EthenaMinting.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.19;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol';

import './interfaces/IUSDe.sol';
import './interfaces/IEthenaMinting.sol';

/**
 * @title Ethena Minting
 * @notice This contract mints and redeems USDe in a single, atomic, trustless transaction
 */
contract EthenaMinting is IEthenaMinting, Ownable, AccessControl, ReentrancyGuard {
  using SafeERC20 for IERC20;
  using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;

  /* --------------- CONSTANTS --------------- */

  /// @notice EIP712 domain
  bytes32 public constant EIP712_DOMAIN =
    keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)');

  /// @notice route type
  bytes32 public constant ROUTE_TYPE = keccak256('Route(address[] addresses,uint256[] ratios)');

  /// @notice order type
  bytes32 public constant ORDER_TYPE =
    keccak256(
      'Order(uint8 order_type,uint256 expiry,uint256 nonce,address benefactor,address beneficiary,address collateral_asset,uint256 collateral_amount,uint256 usde_amount)'
    );

  // keccak256('MINTER_ROLE');
  bytes32 public constant MINTER_ROLE = 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6;

  // keccak256('REDEEMER_ROLE');
  bytes32 public constant REDEEMER_ROLE = 0x44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc;

  // keccak256('GATEKEEPER_ROLE');
  bytes32 public constant GATEKEEPER_ROLE = 0x3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c;

  /// @notice EIP712 domain hash
  bytes32 public constant EIP712_DOMAIN_TYPEHASH = keccak256(abi.encodePacked(EIP712_DOMAIN));

  /// @notice address denoting native ether
  address public constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

  /// @notice holds EIP712 revision
  bytes32 private constant _EIP712_REVISION = keccak256('1');

  /* --------------- STATE VARIABLES --------------- */

  /// @notice usde stablecoin
  IUSDe public usde;

  /// @notice Supported assets
  EnumerableSetUpgradeable.AddressSet internal _supportedAssets;

  // @notice custodian addresses
  EnumerableSetUpgradeable.AddressSet internal _custodianAddresses;

  /// @notice holds computable chain id
  uint256 private immutable _chainId;

  /// @notice holds computable domain separator
  bytes32 private immutable _domainSeparator;

  /// @notice user deduplication
  mapping(address => mapping(uint256 => uint256)) private _orderBitmaps;

  /// @notice USDe minted per block
  mapping(uint256 => uint256) public mintedPerBlock;
  /// @notice USDe redeemed per block
  mapping(uint256 => uint256) public redeemedPerBlock;

  /// @notice For smart contracts to delegate signing to EOA address
  mapping(address => address) public delegatedSigner;

  /// @notice max minted USDe allowed per block
  uint256 public maxMintPerBlock;
  /// @notice max redeemed USDe allowed per block
  uint256 public maxRedeemPerBlock;

  /* --------------- MODIFIERS --------------- */

  /// @notice ensure that the already minted USDe in the actual block plus the amount to be minted is below the maxMintPerBlock var
  /// @param mintAmount The USDe amount to be minted
  modifier belowMaxMintPerBlock(uint256 mintAmount) {
    if (mintedPerBlock[block.number] + mintAmount > maxMintPerBlock) revert MaxMintPerBlockExceeded();
    _;
  }

  /// @notice ensure that the already redeemed USDe in the actual block plus the amount to be redeemed is below the maxRedeemPerBlock var
  /// @param redeemAmount The USDe amount to be redeemed
  modifier belowMaxRedeemPerBlock(uint256 redeemAmount) {
    if (redeemedPerBlock[block.number] + redeemAmount > maxRedeemPerBlock) revert MaxRedeemPerBlockExceeded();
    _;
  }

  /* --------------- CONSTRUCTOR --------------- */

  constructor(
    IUSDe _usde,
    address[] memory _assets,
    address[] memory _custodians,
    address _owner,
    uint256 _maxMintPerBlock,
    uint256 _maxRedeemPerBlock
  ) {
    if (address(_usde) == address(0)) revert InvalidUSDeAddress();
    if (_assets.length == 0) revert NoAssetsProvided();
    if (_owner == address(0)) revert InvalidZeroAddress();
    usde = _usde;

    for (uint256 i = 0; i < _assets.length; i++) {
      addSupportedAsset(_assets[i]);
    }

    for (uint256 j = 0; j < _custodians.length; j++) {
      addCustodianAddress(_custodians[j]);
    }

    // Set the max mint/redeem limits per block
    _setMaxMintPerBlock(_maxMintPerBlock);
    _setMaxRedeemPerBlock(_maxRedeemPerBlock);

    _grantRole(DEFAULT_ADMIN_ROLE, _owner);
    _transferOwnership(_owner);

    _chainId = _getChainID();
    _domainSeparator = _computeDomainSeparator();

    emit USDeSet(address(_usde));
  }

  /* --------------- EXTERNAL --------------- */

  /**
   * @notice Mint stablecoins from assets
   * @param order struct containing order details and confirmation from server
   * @param signature signature of the taker
   */
  function mint(
    Order calldata order,
    Route calldata route,
    Signature calldata signature
  ) public override nonReentrant onlyRole(MINTER_ROLE) belowMaxMintPerBlock(order.usde_amount) {
    verifyOrder(order, signature);
    if (!verifyRoute(route, order.order_type)) revert InvalidRoute();
    if (!_deduplicateOrder(order.benefactor, order.nonce)) revert Duplicate();
    // Add to the minted amount in this block
    mintedPerBlock[block.number] += order.usde_amount;
    _transferCollateral(order.collateral_amount, order.collateral_asset, order.benefactor, route.addresses, route.ratios);
    usde.mint(order.beneficiary, order.usde_amount);
    emit Mint(msg.sender, order.benefactor, order.beneficiary, order.collateral_asset, order.collateral_amount, order.usde_amount);
  }

  /**
   * @notice Redeem stablecoins for assets
   * @param order struct containing order details and confirmation from server
   * @param signature signature of the taker
   */
  function redeem(
    Order calldata order,
    Signature calldata signature
  ) public override nonReentrant onlyRole(REDEEMER_ROLE) belowMaxRedeemPerBlock(order.usde_amount) {
    require(order.order_type == OrderType.REDEEM);
    verifyOrder(order, signature);
    if (!_deduplicateOrder(order.benefactor, order.nonce)) revert Duplicate();
    // Add to the redeemed amount in this block
    redeemedPerBlock[block.number] += order.usde_amount;
    usde.burnFrom(order.benefactor, order.usde_amount);
    _transferToBeneficiary(order.beneficiary, order.collateral_asset, order.collateral_amount);
    emit Redeem(msg.sender, order.benefactor, order.beneficiary, order.collateral_asset, order.collateral_amount, order.usde_amount);
  }

  /// @notice Sets the usde contract address.
  function setUSDe(IUSDe _usde) external onlyOwner {
    if (address(_usde) == address(0)) revert InvalidAddress();
    address oldUSDe = address(usde);
    usde = _usde;
    emit USDeChanged(oldUSDe, address(usde));
  }

  /// @notice Sets the max mintPerBlock limit
  function setMaxMintPerBlock(uint256 _maxMintPerBlock) external onlyRole(DEFAULT_ADMIN_ROLE) {
    _setMaxMintPerBlock(_maxMintPerBlock);
  }

  /// @notice Sets the max redeemPerBlock limit
  function setMaxRedeemPerBlock(uint256 _maxRedeemPerBlock) external onlyRole(DEFAULT_ADMIN_ROLE) {
    _setMaxRedeemPerBlock(_maxRedeemPerBlock);
  }

  /// @notice Disables the mint and redeem
  function disableMintRedeem() external onlyRole(GATEKEEPER_ROLE) {
    _setMaxMintPerBlock(0);
    _setMaxRedeemPerBlock(0);
  }

  /// @notice Enables smart contracts to delegate an address for signing
  function setDelegatedSigner(address _delegateTo) external {
    delegatedSigner[_delegateTo] = msg.sender;
  }

  /// @notice transfers an asset to a custody wallet
  function transferToCustody(
    address wallet,
    address asset,
    uint256 amount
  ) external nonReentrant onlyRole(MINTER_ROLE) {
    if (wallet == address(0) || !_custodianAddresses.contains(wallet)) revert InvalidAddress();
    if (asset == NATIVE_TOKEN) {
      (bool success, ) = wallet.call{value: amount}('');
      if (!success) revert TransferFailed();
    } else {
      IERC20(asset).safeTransfer(wallet, amount);
    }
    emit CustodyTransfer(wallet, asset, amount);
  }

  /// @notice Removes an asset from the supported assets list
  function removeSupportedAsset(address asset) external onlyOwner {
    if (!_supportedAssets.contains(asset)) revert InvalidAssetAddress();
    _supportedAssets.remove(asset);
    emit AssetRemoved(asset);
  }

  /// @notice Checks if an asset is supported.
  function isSupportedAsset(address asset) external view returns (bool) {
    return _supportedAssets.contains(asset);
  }

  /// @notice Removes an custodian from the custodian address list
  function removeCustodianAddress(address custodian) external onlyOwner {
    if (!_custodianAddresses.contains(custodian)) revert InvalidCustodianAddress();
    _custodianAddresses.remove(custodian);
    emit CustodianAddressRemoved(custodian);
  }

  /// @notice Removes the minter role from an account, this can ONLY be executed by the gatekeeper role
  /// @param minter The address to remove the minter role from
  function removeMinterRole(address minter) external onlyRole(GATEKEEPER_ROLE) {
    _revokeRole(MINTER_ROLE, minter);
  }

  /// @notice Removes the redeemer role from an account, this can ONLY be executed by the gatekeeper role
  /// @param redeemer The address to remove the redeemer role from
  function removeRedeemerRole(address redeemer) external onlyRole(GATEKEEPER_ROLE) {
    _revokeRole(REDEEMER_ROLE, redeemer);
  }

  /* --------------- PUBLIC --------------- */

  /// @notice Adds an asset to the supported assets list.
  function addSupportedAsset(address asset) public onlyOwner {
    if (asset == address(0) || asset == address(usde) || _supportedAssets.contains(asset)) revert InvalidAssetAddress();
    _supportedAssets.add(asset);
    emit AssetAdded(asset);
  }

  /// @notice Adds an custodian to the supported custodians list.
  function addCustodianAddress(address custodian) public onlyOwner {
    if (custodian == address(0) || custodian == address(usde) || _custodianAddresses.contains(custodian)) revert InvalidCustodianAddress();
    _custodianAddresses.add(custodian);
    emit CustodianAddressAdded(custodian);
  }

  /// @notice Get the domain separator for the token
  /// @dev Return cached value if chainId matches cache, otherwise recomputes separator, to prevent replay attack across forks
  /// @return The domain separator of the token at current chain
  function getDomainSeparator() public view returns (bytes32)   {
    if (_getChainID() == _chainId) {
      return _domainSeparator;
    }
    return _computeDomainSeparator();
  }

  /// @notice hash an Order struct
  function hashOrder(Order memory order) public view override returns (bytes32) {
    return keccak256(abi.encodePacked('\x19\x01', getDomainSeparator(), keccak256(encodeOrder(order))));
  }

  function encodeOrder(Order memory order) public pure returns (bytes memory) {
    return
      abi.encode(
        ORDER_TYPE,
        order.order_type,
        order.expiry,
        order.nonce,
        order.benefactor,
        order.beneficiary,
        order.collateral_asset,
        order.collateral_amount,
        order.usde_amount
      );
  }

  function encodeRoute(Route memory route) public pure returns (bytes memory) {
    return abi.encode(ROUTE_TYPE, route.addresses, route.ratios);
  }

  /// @notice assert validity of signed order
  function verifyOrder(
    Order calldata order,
    Signature calldata signature
  ) public view override returns (bool, bytes32) {
    bytes32 taker_order_hash = hashOrder(order);
    if (signature.signature_bytes.length != 65) revert InvalidSignatureLength();
    (bytes32 r, bytes32 s, uint8 v) = getRsv(signature.signature_bytes);
    address signer = ecrecover(taker_order_hash, v, r, s);
    if (!(signer == order.benefactor || delegatedSigner[signer] == order.benefactor)) revert InvalidSignature();
    if (order.beneficiary == address(0)) revert InvalidAmount();
    if (order.collateral_amount == 0) revert InvalidAmount();
    if (order.usde_amount == 0) revert InvalidAmount();
    if (block.timestamp > order.expiry) revert SignatureExpired();
    return (true, taker_order_hash);
  }

  /// @notice assert validity of route object per type
  function verifyRoute(Route calldata route, OrderType orderType) public view override returns (bool) {
    // routes only used to mint
    if (orderType == OrderType.REDEEM) {
      return true;
    }
    uint256 totalRatio = 0;
    if (route.addresses.length != route.ratios.length) {
      return false;
    }
    if (route.addresses.length == 0) {
      return false;
    }
    for (uint i = 0; i < route.addresses.length; ++i) {
      if (!_custodianAddresses.contains(route.addresses[i]) || route.addresses[i] == address(0) || route.ratios[i] == 0) {
        return false;
      }
      totalRatio += route.ratios[i];
    }
    if (totalRatio != 10_000) {
      return false;
    }
    return true;
  }

  /// @notice verify validity of nonce by checking its presence
  function verifyNonce(address sender, uint256 nonce) public view override returns (bool, uint256, uint256, uint256) {
    require(nonce > 0, 'Invalid nonce');
    uint256 invalidatorSlot = uint64(nonce) >> 8;
    uint256 invalidatorBit = 1 << uint8(nonce);
    mapping(uint256 => uint256) storage invalidatorStorage = _orderBitmaps[sender];
    uint256 invalidator = invalidatorStorage[invalidatorSlot];
    require(invalidator & invalidatorBit == 0, 'Invalid nonce');
    return (true, invalidatorSlot, invalidator, invalidatorBit);
  }

  /// @notice unpacks r, s, v from signature bytes
  function getRsv(bytes memory sig) public pure returns (bytes32, bytes32, uint8) {
    bytes32 r;
    bytes32 s;
    uint8 v;
    assembly {
      r := mload(add(sig, 32))
      s := mload(add(sig, 64))
      v := and(mload(add(sig, 65)), 255)
    }
    if (v < 27) v += 27;
    return (r, s, v);
  }

  /// @notice packs r, s, v into signature bytes
  function packRsv(bytes32 r, bytes32 s, uint8 v) public pure returns (bytes memory) {
    bytes memory sig = new bytes(65);
    assembly {
      mstore(add(sig, 32), r)
      mstore(add(sig, 64), s)
      mstore8(add(sig, 96), v)
    }
    return sig;
  }

  /* --------------- PRIVATE --------------- */

  /// @notice deduplication of taker order
  function _deduplicateOrder(address sender, uint256 nonce) private returns (bool) {
    (bool valid, uint256 invalidatorSlot, uint256 invalidator, uint256 invalidatorBit) = verifyNonce(sender, nonce);
    mapping(uint256 => uint256) storage invalidatorStorage = _orderBitmaps[sender];
    invalidatorStorage[invalidatorSlot] = invalidator | invalidatorBit;
    return valid;
  }

  /* --------------- INTERNAL --------------- */

  /// @notice transfer supported asset to beneficiary address
  function _transferToBeneficiary(address beneficiary, address asset, uint256 amount) internal {
    if (asset == NATIVE_TOKEN) {
      if (address(this).balance < amount) revert InvalidAmount();
      (bool success, ) = (beneficiary).call{value: amount}('');
      if (!success) revert TransferFailed();
    } else {
      if (!_supportedAssets.contains(asset)) revert UnsupportedAsset();
      IERC20(asset).safeTransfer(beneficiary, amount);
    }
  }

  /// @notice transfer supported asset to array of custody addresses per defined ratio
  function _transferCollateral(
    uint256 amount,
    address asset,
    address benefactor,
    address[] calldata addresses,
    uint256[] calldata ratios
  ) internal {
    // cannot mint using unsupported asset or native ETH even if it is supported for redemptions
    if (!_supportedAssets.contains(asset) || asset == NATIVE_TOKEN) revert UnsupportedAsset();
    IERC20 token = IERC20(asset);
    uint256 totalTransferred = 0;
    for (uint i = 0; i < addresses.length; ++i) {
      uint256 amountToTransfer = (amount * ratios[i]) / 10_000;
      token.safeTransferFrom(benefactor, addresses[i], amountToTransfer);
      totalTransferred += amountToTransfer;
    }
    uint256 remainingBalance = amount - totalTransferred;
    if (remainingBalance > 0) {
      token.safeTransferFrom(benefactor, addresses[addresses.length - 1], remainingBalance);
    }
  }

  /// @notice Sets the max mintPerBlock limit
  function _setMaxMintPerBlock(uint256 _maxMintPerBlock) internal {
    uint256 oldMaxMintPerBlock = maxMintPerBlock;
    maxMintPerBlock = _maxMintPerBlock;
    emit MaxMintPerBlockChanged(oldMaxMintPerBlock, maxMintPerBlock);
  }

  /// @notice Sets the max redeemPerBlock limit
  function _setMaxRedeemPerBlock(uint256 _maxRedeemPerBlock) internal {
    uint256 oldMaxRedeemPerBlock = maxRedeemPerBlock;
    maxRedeemPerBlock = _maxRedeemPerBlock;
    emit MaxRedeemPerBlockChanged(oldMaxRedeemPerBlock, maxRedeemPerBlock);
  }

  function ecr(bytes32 message, uint8 v, bytes32 r, bytes32 s) public pure returns (address sender) {
    return ecrecover(message, v, r, s);
  }

  /// @notice Compute the current domain separator
  /// @return The domain separator for the token
  function _computeDomainSeparator() internal view returns (bytes32) {
    return keccak256(abi.encode(EIP712_DOMAIN, _getEIP712BaseId(), _EIP712_REVISION, _getChainID(), address(this)));
  }

  /// @notice returns the EIP712 base id
  function _getEIP712BaseId() internal pure returns (bytes32) {
    return keccak256('EthenaMinting');
  }

  /// @notice returns the chain id
  function _getChainID() internal view returns (uint256) {
    uint256 id;
    assembly {
      id := chainid()
    }
    return id;
  }
}

File 2 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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 3 of 21 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 4 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 5 of 21 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 6 of 21 : EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSetUpgradeable {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 7 of 21 : IUSDe.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol';
import '@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol';

interface IUSDe is IERC20, IERC20Permit, IERC20Metadata {
  function mint(address _to, uint256 _amount) external;

  function burn(uint256 _amount) external;

  function burnFrom(address account, uint256 amount) external;

  function grantRole(bytes32 role, address account) external;
}

File 8 of 21 : IEthenaMinting.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import './IEthenaMintingEvents.sol';

interface IEthenaMinting is IEthenaMintingEvents {
  enum Role {
    Minter,
    Redeemer
  }

  enum OrderType {
    MINT,
    REDEEM
  }

  enum SignatureType {
    EIP712
  }

  struct Signature {
    SignatureType signature_type;
    bytes signature_bytes;
  }

  struct Route {
    address[] addresses;
    uint256[] ratios;
  }

  struct Order {
    OrderType order_type;
    uint256 expiry;
    uint256 nonce;
    address benefactor;
    address beneficiary;
    address collateral_asset;
    uint256 collateral_amount;
    uint256 usde_amount;
  }

  error Duplicate();
  error InvalidAddress();
  error InvalidUSDeAddress();
  error InvalidZeroAddress();
  error InvalidAssetAddress();
  error InvalidCustodianAddress();
  error InvalidOrder();
  error InvalidAffirmedAmount();
  error InvalidAmount();
  error InvalidRoute();
  error UnsupportedAsset();
  error NoAssetsProvided();
  error InvalidSignature();
  error InvalidSignatureLength();
  error SignatureExpired();
  error TransferFailed();
  error MaxMintPerBlockExceeded();
  error MaxRedeemPerBlockExceeded();

  function hashOrder(Order memory order) external view returns (bytes32);

  function verifyOrder(Order memory order, Signature memory signature) external view returns (bool, bytes32);

  function verifyRoute(Route memory route, OrderType order_type) external view returns (bool);

  function verifyNonce(address sender, uint256 nonce) external view returns (bool, uint256, uint256, uint256);

  function mint(Order memory order, Route memory route, Signature memory signature) external;

  function redeem(Order memory order, Signature memory signature) external;

}

File 9 of 21 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

File 10 of 21 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 11 of 21 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 12 of 21 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 13 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount) external returns (bool);
}

File 14 of 21 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @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.
 */
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].
     */
    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 15 of 21 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 16 of 21 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
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 17 of 21 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

// EIP-2612 is Final as of 2022-11-01. This file is deprecated.

import "./IERC20Permit.sol";

File 18 of 21 : IEthenaMintingEvents.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

interface IEthenaMintingEvents {
  /// @notice Event emitted when USDe is minted
  event Mint(
    address minter,
    address benefactor,
    address beneficiary,
    address indexed collateral_asset,
    uint256 indexed collateral_amount,
    uint256 indexed usde_amount
  );

  /// @notice Event emitted when funds are redeemed
  event Redeem(
    address redeemer,
    address benefactor,
    address beneficiary,
    address indexed collateral_asset,
    uint256 indexed collateral_amount,
    uint256 indexed usde_amount
  );

  /// @notice Event emitted when custody wallet is added
  event CustodyWalletAdded(address wallet);

  /// @notice Event emitted when a custody wallet is removed
  event CustodyWalletRemoved(address wallet);

  /// @notice Event emitted when a supported asset is added
  event AssetAdded(address indexed asset);

  /// @notice Event emitted when a supported asset is removed
  event AssetRemoved(address indexed asset);

  // @notice Event emitted when a custodian address is added
  event CustodianAddressAdded(address indexed custodian);

  // @notice Event emitted when a custodian address is removed
  event CustodianAddressRemoved(address indexed custodian);

  /// @notice Event emitted when assets are moved to custody provider wallet
  event CustodyTransfer(address indexed wallet, address indexed asset, uint256 amount);

  /// @notice Event emitted when USDe is set
  event USDeSet(address indexed USDe);

  /// @notice Event emitted when USDe is changed
  event USDeChanged(address indexed oldUSDe, address indexed newUSDe);

  /// @notice Event emitted when the max mint per block is changed
  event MaxMintPerBlockChanged(uint256 indexed oldMaxMintPerBlock, uint256 indexed newMaxMintPerBlock);

  /// @notice Event emitted when the max redeem per block is changed
  event MaxRedeemPerBlockChanged(uint256 indexed oldMaxRedeemPerBlock, uint256 indexed newMaxRedeemPerBlock);
}

File 19 of 21 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 20 of 21 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 21 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [
    "@aave/core-v3/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-core/",
    "@aave/core-v3/=lib/aave-v3-core/",
    "@aave/periphery-v3/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-periphery/",
    "@bgd-helpers/=lib/aave-helpers/src/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "aave-address-book/=lib/aave-helpers/lib/aave-address-book/src/",
    "aave-helpers/=lib/aave-helpers/",
    "aave-v3-core/=lib/aave-v3-core/",
    "aave-v3-periphery/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-periphery/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "governance-crosschain-bridges/=lib/aave-helpers/lib/governance-crosschain-bridges/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "solidity-utils/=lib/aave-helpers/lib/solidity-utils/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 20000
  },
  "metadata": {
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IUSDe","name":"_usde","type":"address"},{"internalType":"address[]","name":"_assets","type":"address[]"},{"internalType":"address[]","name":"_custodians","type":"address[]"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_maxMintPerBlock","type":"uint256"},{"internalType":"uint256","name":"_maxRedeemPerBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Duplicate","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAffirmedAmount","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidAssetAddress","type":"error"},{"inputs":[],"name":"InvalidCustodianAddress","type":"error"},{"inputs":[],"name":"InvalidOrder","type":"error"},{"inputs":[],"name":"InvalidRoute","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidSignatureLength","type":"error"},{"inputs":[],"name":"InvalidUSDeAddress","type":"error"},{"inputs":[],"name":"InvalidZeroAddress","type":"error"},{"inputs":[],"name":"MaxMintPerBlockExceeded","type":"error"},{"inputs":[],"name":"MaxRedeemPerBlockExceeded","type":"error"},{"inputs":[],"name":"NoAssetsProvided","type":"error"},{"inputs":[],"name":"SignatureExpired","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"UnsupportedAsset","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"}],"name":"AssetAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"}],"name":"AssetRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"custodian","type":"address"}],"name":"CustodianAddressAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"custodian","type":"address"}],"name":"CustodianAddressRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CustodyTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"}],"name":"CustodyWalletAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"}],"name":"CustodyWalletRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"oldMaxMintPerBlock","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newMaxMintPerBlock","type":"uint256"}],"name":"MaxMintPerBlockChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"oldMaxRedeemPerBlock","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newMaxRedeemPerBlock","type":"uint256"}],"name":"MaxRedeemPerBlockChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"address","name":"benefactor","type":"address"},{"indexed":false,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"collateral_asset","type":"address"},{"indexed":true,"internalType":"uint256","name":"collateral_amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"usde_amount","type":"uint256"}],"name":"Mint","type":"event"},{"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":"redeemer","type":"address"},{"indexed":false,"internalType":"address","name":"benefactor","type":"address"},{"indexed":false,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"collateral_asset","type":"address"},{"indexed":true,"internalType":"uint256","name":"collateral_amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"usde_amount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldUSDe","type":"address"},{"indexed":true,"internalType":"address","name":"newUSDe","type":"address"}],"name":"USDeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"USDe","type":"address"}],"name":"USDeSet","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EIP712_DOMAIN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EIP712_DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GATEKEEPER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ORDER_TYPE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REDEEMER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROUTE_TYPE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"custodian","type":"address"}],"name":"addCustodianAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"addSupportedAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegatedSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableMintRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"message","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ecr","outputs":[{"internalType":"address","name":"sender","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"enum IEthenaMinting.OrderType","name":"order_type","type":"uint8"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"address","name":"benefactor","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"address","name":"collateral_asset","type":"address"},{"internalType":"uint256","name":"collateral_amount","type":"uint256"},{"internalType":"uint256","name":"usde_amount","type":"uint256"}],"internalType":"struct IEthenaMinting.Order","name":"order","type":"tuple"}],"name":"encodeOrder","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"ratios","type":"uint256[]"}],"internalType":"struct IEthenaMinting.Route","name":"route","type":"tuple"}],"name":"encodeRoute","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getDomainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"getRsv","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum IEthenaMinting.OrderType","name":"order_type","type":"uint8"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"address","name":"benefactor","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"address","name":"collateral_asset","type":"address"},{"internalType":"uint256","name":"collateral_amount","type":"uint256"},{"internalType":"uint256","name":"usde_amount","type":"uint256"}],"internalType":"struct IEthenaMinting.Order","name":"order","type":"tuple"}],"name":"hashOrder","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"isSupportedAsset","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxRedeemPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum IEthenaMinting.OrderType","name":"order_type","type":"uint8"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"address","name":"benefactor","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"address","name":"collateral_asset","type":"address"},{"internalType":"uint256","name":"collateral_amount","type":"uint256"},{"internalType":"uint256","name":"usde_amount","type":"uint256"}],"internalType":"struct IEthenaMinting.Order","name":"order","type":"tuple"},{"components":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"ratios","type":"uint256[]"}],"internalType":"struct IEthenaMinting.Route","name":"route","type":"tuple"},{"components":[{"internalType":"enum IEthenaMinting.SignatureType","name":"signature_type","type":"uint8"},{"internalType":"bytes","name":"signature_bytes","type":"bytes"}],"internalType":"struct IEthenaMinting.Signature","name":"signature","type":"tuple"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintedPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"name":"packRsv","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"enum IEthenaMinting.OrderType","name":"order_type","type":"uint8"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"address","name":"benefactor","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"address","name":"collateral_asset","type":"address"},{"internalType":"uint256","name":"collateral_amount","type":"uint256"},{"internalType":"uint256","name":"usde_amount","type":"uint256"}],"internalType":"struct IEthenaMinting.Order","name":"order","type":"tuple"},{"components":[{"internalType":"enum IEthenaMinting.SignatureType","name":"signature_type","type":"uint8"},{"internalType":"bytes","name":"signature_bytes","type":"bytes"}],"internalType":"struct IEthenaMinting.Signature","name":"signature","type":"tuple"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"redeemedPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"custodian","type":"address"}],"name":"removeCustodianAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"removeMinterRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"redeemer","type":"address"}],"name":"removeRedeemerRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"removeSupportedAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegateTo","type":"address"}],"name":"setDelegatedSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxMintPerBlock","type":"uint256"}],"name":"setMaxMintPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxRedeemPerBlock","type":"uint256"}],"name":"setMaxRedeemPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IUSDe","name":"_usde","type":"address"}],"name":"setUSDe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferToCustody","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usde","outputs":[{"internalType":"contract IUSDe","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"verifyNonce","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum IEthenaMinting.OrderType","name":"order_type","type":"uint8"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"address","name":"benefactor","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"address","name":"collateral_asset","type":"address"},{"internalType":"uint256","name":"collateral_amount","type":"uint256"},{"internalType":"uint256","name":"usde_amount","type":"uint256"}],"internalType":"struct IEthenaMinting.Order","name":"order","type":"tuple"},{"components":[{"internalType":"enum IEthenaMinting.SignatureType","name":"signature_type","type":"uint8"},{"internalType":"bytes","name":"signature_bytes","type":"bytes"}],"internalType":"struct IEthenaMinting.Signature","name":"signature","type":"tuple"}],"name":"verifyOrder","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"ratios","type":"uint256[]"}],"internalType":"struct IEthenaMinting.Route","name":"route","type":"tuple"},{"internalType":"enum IEthenaMinting.OrderType","name":"orderType","type":"uint8"}],"name":"verifyRoute","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b506040516200444838038062004448833981016040819052620000349162000701565b6200003f3362000291565b60016002556001600160a01b0386166200006c57604051632cacf23760e21b815260040160405180910390fd5b84516000036200008f576040516337791ce560e21b815260040160405180910390fd5b6001600160a01b038316620000b75760405163f6b2911f60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b03881617905560005b855181101562000121576200010c868281518110620000f857620000f8620007a9565b6020026020010151620002e160201b60201c565b806200011881620007bf565b915050620000d5565b5060005b845181101562000171576200015c858281518110620001485762000148620007a9565b60200260200101516200038760201b60201c565b806200016881620007bf565b91505062000125565b506200017d826200042d565b620001888162000466565b620001956000846200049f565b620001a08362000291565b466080526200024e60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7fdfc7060bb2e53279833759ad83d246a6016adac9d59a3fc1c0c23c3d495e137e7fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc646604080516020810195909552840192909252606083015260808201523060a082015260c00160405160208183030381529060405280519060200120905090565b60a0526040516001600160a01b038716907f72fb0d31878f6e7247733418a2aeabf201fddda56677167f041e9bb10ffd5c9e90600090a2505050505050620007e7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620002eb62000528565b6001600160a01b03811615806200030f57506003546001600160a01b038281169116145b806200032357506200032360048262000589565b156200034257604051630ccd248560e21b815260040160405180910390fd5b6200034f600482620005b0565b506040516001600160a01b038216907f0e3c58ebfb2e7465fbb1c32e6b4f40c3c4f5ca77e8218a386aff8617831260d790600090a250565b6200039162000528565b6001600160a01b0381161580620003b557506003546001600160a01b038281169116145b80620003c95750620003c960068262000589565b15620003e85760405163565c062f60e11b815260040160405180910390fd5b620003f5600682620005b0565b506040516001600160a01b038216907ffbd30b5bdd51f5de989170dc23d65aac2de0a6099f5d9d200bc5779d883abcd490600090a250565b600c805490829055604051829082907fb4a832eb73ba0066dc45acd0d1f4454cdee155b17bdb1ccbabb428cc39750ad190600090a35050565b600d805490829055604051829082907f6fd3eacad9328fdc902c323518cfef3a2f6a9da89c40a7b82428adc2370114c390600090a35050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16620005245760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45b5050565b6000546001600160a01b03163314620005875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b565b6001600160a01b038116600090815260018301602052604081205415155b90505b92915050565b6000620005a7836001600160a01b03841660008181526001830160205260408120546200060a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620005aa565b506000620005aa565b6001600160a01b03811681146200062957600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b80516200064f8162000613565b919050565b600082601f8301126200066657600080fd5b815160206001600160401b03808311156200068557620006856200062c565b8260051b604051601f19603f83011681018181108482111715620006ad57620006ad6200062c565b604052938452858101830193838101925087851115620006cc57600080fd5b83870191505b84821015620006f657620006e68262000642565b83529183019190830190620006d2565b979650505050505050565b60008060008060008060c087890312156200071b57600080fd5b8651620007288162000613565b60208801519096506001600160401b03808211156200074657600080fd5b620007548a838b0162000654565b965060408901519150808211156200076b57600080fd5b506200077a89828a0162000654565b94505060608701516200078d8162000613565b809350506080870151915060a087015190509295509295509295565b634e487b7160e01b600052603260045260246000fd5b600060018201620007e057634e487b7160e01b600052601160045260246000fd5b5060010190565b60805160a051613c3b6200080d6000396000611d3801526000611d100152613c3b6000f3fe608060405234801561001057600080fd5b506004361061032b5760003560e01c806395165e8b116101b2578063d547741f116100f9578063e1b11da4116100a2578063f2fde38b1161007c578063f2fde38b14610869578063f4ee2a8b1461087c578063fac09e87146108b1578063ffc92f6b146108c457600080fd5b8063e1b11da414610813578063ea00f3331461083a578063ed24911d1461086157600080fd5b8063d8f065bd116100d3578063d8f065bd146107bc578063dd12f065146107cf578063e0f3fc9f1461080057600080fd5b8063d547741f1461076f578063d6fd317514610782578063d8369d75146107a957600080fd5b8063b6c780631161015b578063d48c03e511610135578063d48c03e5146106ff578063d4bf961314610712578063d53913931461074857600080fd5b8063b6c7806314610690578063c5ff38bd146106b0578063c7977be7146106b857600080fd5b80639cd291361161018c5780639cd2913614610662578063a217fddf14610675578063a6e433941461067d57600080fd5b806395165e8b1461061557806395ca6b31146106285780639be918e61461064f57600080fd5b8063402a8d3711610276578063715018a61161021f5780638da5cb5b116101f95780638da5cb5b146105a857806391d14854146105c6578063928907dd1461060c57600080fd5b8063715018a6146105705780637fa46ab414610578578063844452fa1461059f57600080fd5b8063532c3f8211610250578063532c3f82146104ee578063538636131461050157806354f1e1261461055d57600080fd5b8063402a8d371461049e5780634ba87af9146104c85780634be7a64b146104db57600080fd5b80631c46bc6f116102d85780632f2ff15d116102b25780632f2ff15d1461045d57806331f7d9641461047057806336568abe1461048b57600080fd5b80631c46bc6f14610404578063248a9ca3146104195780632ba329911461043d57600080fd5b806318a2d54f1161030957806318a2d54f146103b057806319add5e3146103d057806319bfcdec146103e357600080fd5b806301ffc9a714610330578063068f3877146103585780630fd761e01461036b575b600080fd5b61034361033e366004613051565b6108d7565b60405190151581526020015b60405180910390f35b6103436103663660046130bf565b610970565b60035461038b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161034f565b6103c36103be36600461311e565b610b19565b60405161034f91906131c1565b61038b6103de3660046131d4565b610b59565b6103f66103f13660046132e3565b610bc2565b60405190815260200161034f565b610417610412366004613394565b610c39565b005b6103f66104273660046133b1565b6000908152600160208190526040909120015490565b6103f661044b3660046133b1565b60096020526000908152604090205481565b61041761046b3660046133ca565b610cd2565b61038b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b6104176104993660046133ca565b610cfd565b6104b16104ac36600461340d565b610db5565b60408051921515835260208301919091520161034f565b6104176104d6366004613394565b6110d8565b6104176104e9366004613394565b611171565b6104176104fc366004613394565b61124e565b61041761050f366004613394565b73ffffffffffffffffffffffffffffffffffffffff166000908152600b6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055565b61041761056b366004613394565b6112a2565b6104176112f6565b6103f67f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc81565b6103f6600d5481565b60005473ffffffffffffffffffffffffffffffffffffffff1661038b565b6103436105d43660046133ca565b600091825260016020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6103f6600c5481565b61041761062336600461340d565b61130a565b6103f67f39a103cb1f6bbcbbc2861a37eea5beb4ee817caf9963b8481d6ad1d956e953ee81565b61034361065d366004613394565b6115e4565b6104176106703660046133b1565b6115f1565b6103f6600081565b61041761068b366004613394565b611605565b6103f661069e3660046133b1565b600a6020526000908152604090205481565b6104176116d1565b6103f6604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020820152016040516020818303038152906040528051906020012081565b61041761070d36600461345e565b611712565b61038b610720366004613394565b600b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6103f67f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61041761077d3660046133ca565b611a1e565b6103f67f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c81565b6104176107b73660046133b1565b611a44565b6103c36107ca3660046132e3565b611a58565b6107e26107dd3660046134d6565b611acb565b60408051938452602084019290925260ff169082015260600161034f565b61041761080e366004613589565b611b08565b6103f67f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6103f67fadd81430b566ae2d49ebbbd6d0bbf5717dd8781caa842362ba2b8bf25c0288b581565b6103f6611d0c565b610417610877366004613394565b611e08565b61088f61088a3660046135ca565b611ebc565b604080519415158552602085019390935291830152606082015260800161034f565b6104176108bf366004613394565b611ff2565b6103c36108d2366004613685565b6120cf565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061096a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000600182600181111561098657610986613773565b036109935750600161096a565b60006109a260208501856137a2565b90506109ae85806137a2565b9050146109bf57600091505061096a565b6109c984806137a2565b90506000036109dc57600091505061096a565b60005b6109e985806137a2565b9050811015610afb57610a2c6109ff86806137a2565b83818110610a0f57610a0f61380a565b9050602002016020810190610a249190613394565b60069061210b565b1580610a7c57506000610a3f86806137a2565b83818110610a4f57610a4f61380a565b9050602002016020810190610a649190613394565b73ffffffffffffffffffffffffffffffffffffffff16145b80610aaa5750610a8f60208601866137a2565b82818110610a9f57610a9f61380a565b905060200201356000145b15610aba5760009250505061096a565b610ac760208601866137a2565b82818110610ad757610ad761380a565b9050602002013582610ae99190613868565b9150610af48161387b565b90506109df565b508061271014610b0f57600091505061096a565b5060019392505050565b6040805160418082526080820190925260609160009190602082018180368337019050509050846020820152836040820152826060820153949350505050565b6040805160008082526020820180845287905260ff861692820192909252606081018490526080810183905260019060a0016020604051602081039080840390855afa158015610bad573d6000803e3d6000fd5b5050506020604051035190505b949350505050565b6000610bcc611d0c565b610bd583611a58565b8051602091820120604051610c1c9392017f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050919050565b610c4161213d565b610c4c60048261210b565b610c82576040517f3334921400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c8d6004826121be565b5060405173ffffffffffffffffffffffffffffffffffffffff8216907f37803e2125c48ee96c38ddf04e826daf335b0e1603579040fd275aba6d06b6fc90600090a250565b60008281526001602081905260409091200154610cee816121e0565b610cf883836121ea565b505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610da7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610db182826122a9565b5050565b60008080610dcb6103f1368790038701876132e3565b9050610dda60208501856138b3565b9050604114610e15576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008080610e63610e2960208901896138b3565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611acb92505050565b925092509250600060018583868660405160008152602001604052604051610ea7949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015610ec9573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150610f05905060808a0160608b01613394565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480610f765750610f4960808a0160608b01613394565b73ffffffffffffffffffffffffffffffffffffffff8281166000908152600b602052604090205481169116145b610fac576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610fbe60a08b0160808c01613394565b73ffffffffffffffffffffffffffffffffffffffff160361100b576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8860c00135600003611049576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8860e00135600003611087576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b88602001354211156110c5576040517f0819bdcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600195509293505050505b9250929050565b6110e061213d565b6110eb60068261210b565b611121576040517facb80c5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61112c6006826121be565b5060405173ffffffffffffffffffffffffffffffffffffffff8216907f75567811df62a6b68bd5ee394d5808ad7282e19541858be466bc789cad9d4dfb90600090a250565b61117961213d565b73ffffffffffffffffffffffffffffffffffffffff811615806111b6575060035473ffffffffffffffffffffffffffffffffffffffff8281169116145b806111c757506111c760068261210b565b156111fe576040517facb80c5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611209600682612364565b5060405173ffffffffffffffffffffffffffffffffffffffff8216907ffbd30b5bdd51f5de989170dc23d65aac2de0a6099f5d9d200bc5779d883abcd490600090a250565b7f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c611278816121e0565b610db17f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc836122a9565b7f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c6112cc816121e0565b610db17f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6836122a9565b6112fe61213d565b6113086000612386565b565b6113126123fb565b7f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc61133c816121e0565b600d54436000908152600a602052604090205460e08501359190611361908390613868565b1115611399576040517f4d4ea7ce00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016113a86020860186613918565b60018111156113b9576113b9613773565b146113c357600080fd5b6113cd8484610db5565b506113ed90506113e36080860160608701613394565b856040013561246c565b611423576040517f1b29ea7400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b436000908152600a60205260408120805460e08701359290611446908490613868565b909155505060035473ffffffffffffffffffffffffffffffffffffffff166379cc67906114796080870160608801613394565b60405160e083811b7fffffffff0000000000000000000000000000000000000000000000000000000016825273ffffffffffffffffffffffffffffffffffffffff929092166004820152908701356024820152604401600060405180830381600087803b1580156114e957600080fd5b505af11580156114fd573d6000803e3d6000fd5b50611530925061151691505060a0860160808701613394565b61152660c0870160a08801613394565b8660c001356124c0565b60e084013560c085018035906115499060a08801613394565b73ffffffffffffffffffffffffffffffffffffffff167f18fd144d7dbcbaa6f00fd47a84adc7dc3cc64a326ffa2dc7691a25e3837dba033361159160808a0160608b01613394565b6115a160a08b0160808c01613394565b6040805173ffffffffffffffffffffffffffffffffffffffff9485168152928416602084015292168183015290519081900360600190a45050610db16001600255565b600061096a60048361210b565b60006115fc816121e0565b610db182612639565b61160d61213d565b73ffffffffffffffffffffffffffffffffffffffff811661165a576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f96ed0b646403afa911cd812658e497847f800c49803f48812e575dcccc3b45e090600090a35050565b7f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c6116fb816121e0565b6117056000612639565b61170f6000612672565b50565b61171a6123fb565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611744816121e0565b600c544360009081526009602052604090205460e08601359190611769908390613868565b11156117a1576040517f0fbf0bc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117ab8584610db5565b506117bf9050846103666020880188613918565b6117f5576040517f84e505d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118126118086080870160608801613394565b866040013561246c565b611848576040517f1b29ea7400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b436000908152600960205260408120805460e0880135929061186b908490613868565b909155506118b4905060c086018035906118889060a08901613394565b6118986080890160608a01613394565b6118a288806137a2565b6118af60208b018b6137a2565b6126ab565b60035473ffffffffffffffffffffffffffffffffffffffff166340c10f196118e260a0880160808901613394565b60405160e083811b7fffffffff0000000000000000000000000000000000000000000000000000000016825273ffffffffffffffffffffffffffffffffffffffff929092166004820152908801356024820152604401600060405180830381600087803b15801561195257600080fd5b505af1158015611966573d6000803e3d6000fd5b5050505060e085013560c086018035906119839060a08901613394565b73ffffffffffffffffffffffffffffffffffffffff167ff114ca9eb82947af39f957fa726280fd3d5d81c3d7635a4aeb5c302962856eba336119cb60808b0160608c01613394565b6119db60a08c0160808d01613394565b6040805173ffffffffffffffffffffffffffffffffffffffff9485168152928416602084015292168183015290519081900360600190a45050610cf86001600255565b60008281526001602081905260409091200154611a3a816121e0565b610cf883836122a9565b6000611a4f816121e0565b610db182612672565b8051602080830151604080850151606086810151608088015160a089015160c08a015160e08b015196519499611ab5997fadd81430b566ae2d49ebbbd6d0bbf5717dd8781caa842362ba2b8bf25c0288b599919891979601613933565b6040516020818303038152906040529050919050565b6020810151604082015160418301516000928392839260ff16601b811015611afb57611af8601b826139c8565b90505b9196909550909350915050565b611b106123fb565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611b3a816121e0565b73ffffffffffffffffffffffffffffffffffffffff84161580611b655750611b6360068561210b565b155b15611b9c576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff841601611c795760008473ffffffffffffffffffffffffffffffffffffffff168360405160006040518083038185875af1925050503d8060008114611c33576040519150601f19603f3d011682016040523d82523d6000602084013e611c38565b606091505b5050905080611c73576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50611c9a565b611c9a73ffffffffffffffffffffffffffffffffffffffff84168584612841565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f90c5d8794dcf7c60ab2d20912d5228389b28f74d32af01e40894a784a90b9ac284604051611cf991815260200190565b60405180910390a350610cf86001600255565b60007f00000000000000000000000000000000000000000000000000000000000000004603611d5a57507f000000000000000000000000000000000000000000000000000000000000000090565b611e0360007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7fdfc7060bb2e53279833759ad83d246a6016adac9d59a3fc1c0c23c3d495e137e7fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc646604080516020810195909552840192909252606083015260808201523060a082015260c00160405160208183030381529060405280519060200120905090565b905090565b611e1061213d565b73ffffffffffffffffffffffffffffffffffffffff8116611eb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d9e565b61170f81612386565b60008060008060008511611f2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610d9e565b73ffffffffffffffffffffffffffffffffffffffff861660009081526008602081815260408084209289901c66ffffffffffffff168085529183905290922054600160ff89161b919082811615611fdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610d9e565b60019a9399509750909550909350505050565b611ffa61213d565b73ffffffffffffffffffffffffffffffffffffffff81161580612037575060035473ffffffffffffffffffffffffffffffffffffffff8281169116145b80612048575061204860048261210b565b1561207f576040517f3334921400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61208a600482612364565b5060405173ffffffffffffffffffffffffffffffffffffffff8216907f0e3c58ebfb2e7465fbb1c32e6b4f40c3c4f5ca77e8218a386aff8617831260d790600090a250565b8051602080830151604051606093611ab5937f39a103cb1f6bbcbbc2861a37eea5beb4ee817caf9963b8481d6ad1d956e953ee939192016139e1565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611308576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d9e565b60006121368373ffffffffffffffffffffffffffffffffffffffff8416612915565b61170f8133612a08565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610db157600082815260016020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610db157600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006121368373ffffffffffffffffffffffffffffffffffffffff8416612ac2565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002805403612466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d9e565b60028055565b600080600080600061247e8787611ebc565b73ffffffffffffffffffffffffffffffffffffffff8b166000908152600860209081526040808320958352949052929092209117905594505050505092915050565b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff8316016125d75780471015612537576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114612591576040519150601f19603f3d011682016040523d82523d6000602084013e612596565b606091505b50509050806125d1576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6125e260048361210b565b612618576040517f24a0114400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cf873ffffffffffffffffffffffffffffffffffffffff83168483612841565b600c805490829055604051829082907fb4a832eb73ba0066dc45acd0d1f4454cdee155b17bdb1ccbabb428cc39750ad190600090a35050565b600d805490829055604051829082907f6fd3eacad9328fdc902c323518cfef3a2f6a9da89c40a7b82428adc2370114c390600090a35050565b6126b660048761210b565b15806126eb575073ffffffffffffffffffffffffffffffffffffffff861673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee145b15612722576040517f24a0114400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b856000805b858110156127cc5760006127108686848181106127465761274661380a565b905060200201358c6127589190613a7d565b6127629190613a94565b90506127ae8989898581811061277a5761277a61380a565b905060200201602081019061278f9190613394565b73ffffffffffffffffffffffffffffffffffffffff8716919084612b11565b6127b88184613868565b925050806127c59061387b565b9050612727565b5060006127d9828b613acf565b90508015612835576128358888886127f2600182613acf565b8181106128015761280161380a565b90506020020160208101906128169190613394565b73ffffffffffffffffffffffffffffffffffffffff8616919084612b11565b50505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610cf89084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612b6f565b600081815260018301602052604081205480156129fe576000612939600183613acf565b855490915060009061294d90600190613acf565b90508181146129b257600086600001828154811061296d5761296d61380a565b90600052602060002001549050808760000184815481106129905761299061380a565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806129c3576129c3613ae2565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061096a565b600091505061096a565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610db157612a4881612c7e565b612a53836020612c9d565b604051602001612a64929190613b11565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610d9e916004016131c1565b6000818152600183016020526040812054612b095750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561096a565b50600061096a565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526125d19085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612893565b6000612bd1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612ee09092919063ffffffff16565b9050805160001480612bf2575080806020019051810190612bf29190613b92565b610cf8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d9e565b606061096a73ffffffffffffffffffffffffffffffffffffffff831660145b60606000612cac836002613a7d565b612cb7906002613868565b67ffffffffffffffff811115612ccf57612ccf61320f565b6040519080825280601f01601f191660200182016040528015612cf9576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612d3057612d3061380a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612d9357612d9361380a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612dcf846002613a7d565b612dda906001613868565b90505b6001811115612e77577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612e1b57612e1b61380a565b1a60f81b828281518110612e3157612e3161380a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612e7081613bb4565b9050612ddd565b508315612136576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610d9e565b6060610bba8484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051612f149190613be9565b60006040518083038185875af1925050503d8060008114612f51576040519150601f19603f3d011682016040523d82523d6000602084013e612f56565b606091505b5091509150612f6787838387612f72565b979650505050505050565b606083156130085782516000036130015773ffffffffffffffffffffffffffffffffffffffff85163b613001576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d9e565b5081610bba565b610bba838381511561301d5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9e91906131c1565b60006020828403121561306357600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461213657600080fd5b6000604082840312156130a557600080fd5b50919050565b8035600281106130ba57600080fd5b919050565b600080604083850312156130d257600080fd5b823567ffffffffffffffff8111156130e957600080fd5b6130f585828601613093565b925050613104602084016130ab565b90509250929050565b803560ff811681146130ba57600080fd5b60008060006060848603121561313357600080fd5b833592506020840135915061314a6040850161310d565b90509250925092565b60005b8381101561316e578181015183820152602001613156565b50506000910152565b6000815180845261318f816020860160208601613153565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006121366020830184613177565b600080600080608085870312156131ea57600080fd5b843593506131fa6020860161310d565b93969395505050506040820135916060013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156132615761326161320f565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156132ae576132ae61320f565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461170f57600080fd5b80356130ba816132b6565b60006101008083850312156132f757600080fd5b6040519081019067ffffffffffffffff8211818310171561331a5761331a61320f565b81604052613327846130ab565b815260208401356020820152604084013560408201526060840135915061334d826132b6565b81606082015261335f608085016132d8565b608082015261337060a085016132d8565b60a082015260c084013560c082015260e084013560e0820152809250505092915050565b6000602082840312156133a657600080fd5b8135612136816132b6565b6000602082840312156133c357600080fd5b5035919050565b600080604083850312156133dd57600080fd5b8235915060208301356133ef816132b6565b809150509250929050565b600061010082840312156130a557600080fd5b600080610120838503121561342157600080fd5b61342b84846133fa565b915061010083013567ffffffffffffffff81111561344857600080fd5b61345485828601613093565b9150509250929050565b6000806000610140848603121561347457600080fd5b61347e85856133fa565b925061010084013567ffffffffffffffff8082111561349c57600080fd5b6134a887838801613093565b93506101208601359150808211156134bf57600080fd5b506134cc86828701613093565b9150509250925092565b600060208083850312156134e957600080fd5b823567ffffffffffffffff8082111561350157600080fd5b818501915085601f83011261351557600080fd5b8135818111156135275761352761320f565b613557847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613267565b9150808252868482850101111561356d57600080fd5b8084840185840137600090820190930192909252509392505050565b60008060006060848603121561359e57600080fd5b83356135a9816132b6565b925060208401356135b9816132b6565b929592945050506040919091013590565b600080604083850312156135dd57600080fd5b82356135e8816132b6565b946020939093013593505050565b600067ffffffffffffffff8211156136105761361061320f565b5060051b60200190565b600082601f83011261362b57600080fd5b8135602061364061363b836135f6565b613267565b82815260059290921b8401810191818101908684111561365f57600080fd5b8286015b8481101561367a5780358352918301918301613663565b509695505050505050565b6000602080838503121561369857600080fd5b823567ffffffffffffffff808211156136b057600080fd5b90840190604082870312156136c457600080fd5b6136cc61323e565b8235828111156136db57600080fd5b8301601f810188136136ec57600080fd5b80356136fa61363b826135f6565b81815260059190911b8201860190868101908a83111561371957600080fd5b928701925b82841015613740578335613731816132b6565b8252928701929087019061371e565b8452505050828401358281111561375657600080fd5b6137628882860161361a565b948201949094529695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126137d757600080fd5b83018035915067ffffffffffffffff8211156137f257600080fd5b6020019150600581901b36038213156110d157600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561096a5761096a613839565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036138ac576138ac613839565b5060010190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126138e857600080fd5b83018035915067ffffffffffffffff82111561390357600080fd5b6020019150368190038213156110d157600080fd5b60006020828403121561392a57600080fd5b612136826130ab565b898152610120810160028a10613972577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208201999099526040810197909752606087019590955273ffffffffffffffffffffffffffffffffffffffff938416608087015291831660a086015290911660c084015260e083015261010090910152919050565b60ff818116838216019081111561096a5761096a613839565b6000606082018583526020606081850152818651808452608086019150828801935060005b81811015613a3857845173ffffffffffffffffffffffffffffffffffffffff1683529383019391830191600101613a06565b50508481036040860152855180825290820192508186019060005b81811015613a6f57825185529383019391830191600101613a53565b509298975050505050505050565b808202811582820484141761096a5761096a613839565b600082613aca577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561096a5761096a613839565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613b49816017850160208801613153565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613b86816028840160208801613153565b01602801949350505050565b600060208284031215613ba457600080fd5b8151801515811461213657600080fd5b600081613bc357613bc3613839565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60008251613bfb818460208701613153565b919091019291505056fea2646970667358221220ed2841239cfe36c0ab29902e97182d52e0f54d12451f819d9185c63908ef626864736f6c634300081300330000000000000000000000008191dc3053fe4564c17694cb203663d3c07b896000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000009a073d235a8d2c37854da6f6a8f075c916debe0600000000000000000000000000000000000000000000174b1ca8ab05a8c0000000000000000000000000000000000000000000000000174b1ca8ab05a8c000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000000030000000000000000000000006b95f243959329bb88f5d3df9a7127efba703fda000000000000000000000000796ee28ce42bf7bd43a09acd43fad0aacd7c3b290000000000000000000000009a073d235a8d2c37854da6f6a8f075c916debe06

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061032b5760003560e01c806395165e8b116101b2578063d547741f116100f9578063e1b11da4116100a2578063f2fde38b1161007c578063f2fde38b14610869578063f4ee2a8b1461087c578063fac09e87146108b1578063ffc92f6b146108c457600080fd5b8063e1b11da414610813578063ea00f3331461083a578063ed24911d1461086157600080fd5b8063d8f065bd116100d3578063d8f065bd146107bc578063dd12f065146107cf578063e0f3fc9f1461080057600080fd5b8063d547741f1461076f578063d6fd317514610782578063d8369d75146107a957600080fd5b8063b6c780631161015b578063d48c03e511610135578063d48c03e5146106ff578063d4bf961314610712578063d53913931461074857600080fd5b8063b6c7806314610690578063c5ff38bd146106b0578063c7977be7146106b857600080fd5b80639cd291361161018c5780639cd2913614610662578063a217fddf14610675578063a6e433941461067d57600080fd5b806395165e8b1461061557806395ca6b31146106285780639be918e61461064f57600080fd5b8063402a8d3711610276578063715018a61161021f5780638da5cb5b116101f95780638da5cb5b146105a857806391d14854146105c6578063928907dd1461060c57600080fd5b8063715018a6146105705780637fa46ab414610578578063844452fa1461059f57600080fd5b8063532c3f8211610250578063532c3f82146104ee578063538636131461050157806354f1e1261461055d57600080fd5b8063402a8d371461049e5780634ba87af9146104c85780634be7a64b146104db57600080fd5b80631c46bc6f116102d85780632f2ff15d116102b25780632f2ff15d1461045d57806331f7d9641461047057806336568abe1461048b57600080fd5b80631c46bc6f14610404578063248a9ca3146104195780632ba329911461043d57600080fd5b806318a2d54f1161030957806318a2d54f146103b057806319add5e3146103d057806319bfcdec146103e357600080fd5b806301ffc9a714610330578063068f3877146103585780630fd761e01461036b575b600080fd5b61034361033e366004613051565b6108d7565b60405190151581526020015b60405180910390f35b6103436103663660046130bf565b610970565b60035461038b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161034f565b6103c36103be36600461311e565b610b19565b60405161034f91906131c1565b61038b6103de3660046131d4565b610b59565b6103f66103f13660046132e3565b610bc2565b60405190815260200161034f565b610417610412366004613394565b610c39565b005b6103f66104273660046133b1565b6000908152600160208190526040909120015490565b6103f661044b3660046133b1565b60096020526000908152604090205481565b61041761046b3660046133ca565b610cd2565b61038b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b6104176104993660046133ca565b610cfd565b6104b16104ac36600461340d565b610db5565b60408051921515835260208301919091520161034f565b6104176104d6366004613394565b6110d8565b6104176104e9366004613394565b611171565b6104176104fc366004613394565b61124e565b61041761050f366004613394565b73ffffffffffffffffffffffffffffffffffffffff166000908152600b6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055565b61041761056b366004613394565b6112a2565b6104176112f6565b6103f67f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc81565b6103f6600d5481565b60005473ffffffffffffffffffffffffffffffffffffffff1661038b565b6103436105d43660046133ca565b600091825260016020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6103f6600c5481565b61041761062336600461340d565b61130a565b6103f67f39a103cb1f6bbcbbc2861a37eea5beb4ee817caf9963b8481d6ad1d956e953ee81565b61034361065d366004613394565b6115e4565b6104176106703660046133b1565b6115f1565b6103f6600081565b61041761068b366004613394565b611605565b6103f661069e3660046133b1565b600a6020526000908152604090205481565b6104176116d1565b6103f6604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020820152016040516020818303038152906040528051906020012081565b61041761070d36600461345e565b611712565b61038b610720366004613394565b600b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6103f67f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61041761077d3660046133ca565b611a1e565b6103f67f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c81565b6104176107b73660046133b1565b611a44565b6103c36107ca3660046132e3565b611a58565b6107e26107dd3660046134d6565b611acb565b60408051938452602084019290925260ff169082015260600161034f565b61041761080e366004613589565b611b08565b6103f67f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6103f67fadd81430b566ae2d49ebbbd6d0bbf5717dd8781caa842362ba2b8bf25c0288b581565b6103f6611d0c565b610417610877366004613394565b611e08565b61088f61088a3660046135ca565b611ebc565b604080519415158552602085019390935291830152606082015260800161034f565b6104176108bf366004613394565b611ff2565b6103c36108d2366004613685565b6120cf565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061096a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000600182600181111561098657610986613773565b036109935750600161096a565b60006109a260208501856137a2565b90506109ae85806137a2565b9050146109bf57600091505061096a565b6109c984806137a2565b90506000036109dc57600091505061096a565b60005b6109e985806137a2565b9050811015610afb57610a2c6109ff86806137a2565b83818110610a0f57610a0f61380a565b9050602002016020810190610a249190613394565b60069061210b565b1580610a7c57506000610a3f86806137a2565b83818110610a4f57610a4f61380a565b9050602002016020810190610a649190613394565b73ffffffffffffffffffffffffffffffffffffffff16145b80610aaa5750610a8f60208601866137a2565b82818110610a9f57610a9f61380a565b905060200201356000145b15610aba5760009250505061096a565b610ac760208601866137a2565b82818110610ad757610ad761380a565b9050602002013582610ae99190613868565b9150610af48161387b565b90506109df565b508061271014610b0f57600091505061096a565b5060019392505050565b6040805160418082526080820190925260609160009190602082018180368337019050509050846020820152836040820152826060820153949350505050565b6040805160008082526020820180845287905260ff861692820192909252606081018490526080810183905260019060a0016020604051602081039080840390855afa158015610bad573d6000803e3d6000fd5b5050506020604051035190505b949350505050565b6000610bcc611d0c565b610bd583611a58565b8051602091820120604051610c1c9392017f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050919050565b610c4161213d565b610c4c60048261210b565b610c82576040517f3334921400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c8d6004826121be565b5060405173ffffffffffffffffffffffffffffffffffffffff8216907f37803e2125c48ee96c38ddf04e826daf335b0e1603579040fd275aba6d06b6fc90600090a250565b60008281526001602081905260409091200154610cee816121e0565b610cf883836121ea565b505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610da7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610db182826122a9565b5050565b60008080610dcb6103f1368790038701876132e3565b9050610dda60208501856138b3565b9050604114610e15576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008080610e63610e2960208901896138b3565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611acb92505050565b925092509250600060018583868660405160008152602001604052604051610ea7949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015610ec9573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150610f05905060808a0160608b01613394565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480610f765750610f4960808a0160608b01613394565b73ffffffffffffffffffffffffffffffffffffffff8281166000908152600b602052604090205481169116145b610fac576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610fbe60a08b0160808c01613394565b73ffffffffffffffffffffffffffffffffffffffff160361100b576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8860c00135600003611049576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8860e00135600003611087576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b88602001354211156110c5576040517f0819bdcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600195509293505050505b9250929050565b6110e061213d565b6110eb60068261210b565b611121576040517facb80c5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61112c6006826121be565b5060405173ffffffffffffffffffffffffffffffffffffffff8216907f75567811df62a6b68bd5ee394d5808ad7282e19541858be466bc789cad9d4dfb90600090a250565b61117961213d565b73ffffffffffffffffffffffffffffffffffffffff811615806111b6575060035473ffffffffffffffffffffffffffffffffffffffff8281169116145b806111c757506111c760068261210b565b156111fe576040517facb80c5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611209600682612364565b5060405173ffffffffffffffffffffffffffffffffffffffff8216907ffbd30b5bdd51f5de989170dc23d65aac2de0a6099f5d9d200bc5779d883abcd490600090a250565b7f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c611278816121e0565b610db17f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc836122a9565b7f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c6112cc816121e0565b610db17f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6836122a9565b6112fe61213d565b6113086000612386565b565b6113126123fb565b7f44ac9762eec3a11893fefb11d028bb3102560094137c3ed4518712475b2577cc61133c816121e0565b600d54436000908152600a602052604090205460e08501359190611361908390613868565b1115611399576040517f4d4ea7ce00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016113a86020860186613918565b60018111156113b9576113b9613773565b146113c357600080fd5b6113cd8484610db5565b506113ed90506113e36080860160608701613394565b856040013561246c565b611423576040517f1b29ea7400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b436000908152600a60205260408120805460e08701359290611446908490613868565b909155505060035473ffffffffffffffffffffffffffffffffffffffff166379cc67906114796080870160608801613394565b60405160e083811b7fffffffff0000000000000000000000000000000000000000000000000000000016825273ffffffffffffffffffffffffffffffffffffffff929092166004820152908701356024820152604401600060405180830381600087803b1580156114e957600080fd5b505af11580156114fd573d6000803e3d6000fd5b50611530925061151691505060a0860160808701613394565b61152660c0870160a08801613394565b8660c001356124c0565b60e084013560c085018035906115499060a08801613394565b73ffffffffffffffffffffffffffffffffffffffff167f18fd144d7dbcbaa6f00fd47a84adc7dc3cc64a326ffa2dc7691a25e3837dba033361159160808a0160608b01613394565b6115a160a08b0160808c01613394565b6040805173ffffffffffffffffffffffffffffffffffffffff9485168152928416602084015292168183015290519081900360600190a45050610db16001600255565b600061096a60048361210b565b60006115fc816121e0565b610db182612639565b61160d61213d565b73ffffffffffffffffffffffffffffffffffffffff811661165a576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f96ed0b646403afa911cd812658e497847f800c49803f48812e575dcccc3b45e090600090a35050565b7f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c6116fb816121e0565b6117056000612639565b61170f6000612672565b50565b61171a6123fb565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611744816121e0565b600c544360009081526009602052604090205460e08601359190611769908390613868565b11156117a1576040517f0fbf0bc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117ab8584610db5565b506117bf9050846103666020880188613918565b6117f5576040517f84e505d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118126118086080870160608801613394565b866040013561246c565b611848576040517f1b29ea7400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b436000908152600960205260408120805460e0880135929061186b908490613868565b909155506118b4905060c086018035906118889060a08901613394565b6118986080890160608a01613394565b6118a288806137a2565b6118af60208b018b6137a2565b6126ab565b60035473ffffffffffffffffffffffffffffffffffffffff166340c10f196118e260a0880160808901613394565b60405160e083811b7fffffffff0000000000000000000000000000000000000000000000000000000016825273ffffffffffffffffffffffffffffffffffffffff929092166004820152908801356024820152604401600060405180830381600087803b15801561195257600080fd5b505af1158015611966573d6000803e3d6000fd5b5050505060e085013560c086018035906119839060a08901613394565b73ffffffffffffffffffffffffffffffffffffffff167ff114ca9eb82947af39f957fa726280fd3d5d81c3d7635a4aeb5c302962856eba336119cb60808b0160608c01613394565b6119db60a08c0160808d01613394565b6040805173ffffffffffffffffffffffffffffffffffffffff9485168152928416602084015292168183015290519081900360600190a45050610cf86001600255565b60008281526001602081905260409091200154611a3a816121e0565b610cf883836122a9565b6000611a4f816121e0565b610db182612672565b8051602080830151604080850151606086810151608088015160a089015160c08a015160e08b015196519499611ab5997fadd81430b566ae2d49ebbbd6d0bbf5717dd8781caa842362ba2b8bf25c0288b599919891979601613933565b6040516020818303038152906040529050919050565b6020810151604082015160418301516000928392839260ff16601b811015611afb57611af8601b826139c8565b90505b9196909550909350915050565b611b106123fb565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611b3a816121e0565b73ffffffffffffffffffffffffffffffffffffffff84161580611b655750611b6360068561210b565b155b15611b9c576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff841601611c795760008473ffffffffffffffffffffffffffffffffffffffff168360405160006040518083038185875af1925050503d8060008114611c33576040519150601f19603f3d011682016040523d82523d6000602084013e611c38565b606091505b5050905080611c73576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50611c9a565b611c9a73ffffffffffffffffffffffffffffffffffffffff84168584612841565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f90c5d8794dcf7c60ab2d20912d5228389b28f74d32af01e40894a784a90b9ac284604051611cf991815260200190565b60405180910390a350610cf86001600255565b60007f00000000000000000000000000000000000000000000000000000000000000014603611d5a57507f50c033a6552d4bb9a720081d7f23bb403cce1265ac6caf2c910a9251badcfd8990565b611e0360007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7fdfc7060bb2e53279833759ad83d246a6016adac9d59a3fc1c0c23c3d495e137e7fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc646604080516020810195909552840192909252606083015260808201523060a082015260c00160405160208183030381529060405280519060200120905090565b905090565b611e1061213d565b73ffffffffffffffffffffffffffffffffffffffff8116611eb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d9e565b61170f81612386565b60008060008060008511611f2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610d9e565b73ffffffffffffffffffffffffffffffffffffffff861660009081526008602081815260408084209289901c66ffffffffffffff168085529183905290922054600160ff89161b919082811615611fdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610d9e565b60019a9399509750909550909350505050565b611ffa61213d565b73ffffffffffffffffffffffffffffffffffffffff81161580612037575060035473ffffffffffffffffffffffffffffffffffffffff8281169116145b80612048575061204860048261210b565b1561207f576040517f3334921400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61208a600482612364565b5060405173ffffffffffffffffffffffffffffffffffffffff8216907f0e3c58ebfb2e7465fbb1c32e6b4f40c3c4f5ca77e8218a386aff8617831260d790600090a250565b8051602080830151604051606093611ab5937f39a103cb1f6bbcbbc2861a37eea5beb4ee817caf9963b8481d6ad1d956e953ee939192016139e1565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611308576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d9e565b60006121368373ffffffffffffffffffffffffffffffffffffffff8416612915565b61170f8133612a08565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610db157600082815260016020818152604080842073ffffffffffffffffffffffffffffffffffffffff8616808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610db157600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006121368373ffffffffffffffffffffffffffffffffffffffff8416612ac2565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002805403612466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d9e565b60028055565b600080600080600061247e8787611ebc565b73ffffffffffffffffffffffffffffffffffffffff8b166000908152600860209081526040808320958352949052929092209117905594505050505092915050565b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff8316016125d75780471015612537576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114612591576040519150601f19603f3d011682016040523d82523d6000602084013e612596565b606091505b50509050806125d1576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6125e260048361210b565b612618576040517f24a0114400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610cf873ffffffffffffffffffffffffffffffffffffffff83168483612841565b600c805490829055604051829082907fb4a832eb73ba0066dc45acd0d1f4454cdee155b17bdb1ccbabb428cc39750ad190600090a35050565b600d805490829055604051829082907f6fd3eacad9328fdc902c323518cfef3a2f6a9da89c40a7b82428adc2370114c390600090a35050565b6126b660048761210b565b15806126eb575073ffffffffffffffffffffffffffffffffffffffff861673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee145b15612722576040517f24a0114400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b856000805b858110156127cc5760006127108686848181106127465761274661380a565b905060200201358c6127589190613a7d565b6127629190613a94565b90506127ae8989898581811061277a5761277a61380a565b905060200201602081019061278f9190613394565b73ffffffffffffffffffffffffffffffffffffffff8716919084612b11565b6127b88184613868565b925050806127c59061387b565b9050612727565b5060006127d9828b613acf565b90508015612835576128358888886127f2600182613acf565b8181106128015761280161380a565b90506020020160208101906128169190613394565b73ffffffffffffffffffffffffffffffffffffffff8616919084612b11565b50505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610cf89084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612b6f565b600081815260018301602052604081205480156129fe576000612939600183613acf565b855490915060009061294d90600190613acf565b90508181146129b257600086600001828154811061296d5761296d61380a565b90600052602060002001549050808760000184815481106129905761299061380a565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806129c3576129c3613ae2565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061096a565b600091505061096a565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610db157612a4881612c7e565b612a53836020612c9d565b604051602001612a64929190613b11565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610d9e916004016131c1565b6000818152600183016020526040812054612b095750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561096a565b50600061096a565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526125d19085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612893565b6000612bd1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612ee09092919063ffffffff16565b9050805160001480612bf2575080806020019051810190612bf29190613b92565b610cf8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d9e565b606061096a73ffffffffffffffffffffffffffffffffffffffff831660145b60606000612cac836002613a7d565b612cb7906002613868565b67ffffffffffffffff811115612ccf57612ccf61320f565b6040519080825280601f01601f191660200182016040528015612cf9576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612d3057612d3061380a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612d9357612d9361380a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612dcf846002613a7d565b612dda906001613868565b90505b6001811115612e77577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612e1b57612e1b61380a565b1a60f81b828281518110612e3157612e3161380a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612e7081613bb4565b9050612ddd565b508315612136576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610d9e565b6060610bba8484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051612f149190613be9565b60006040518083038185875af1925050503d8060008114612f51576040519150601f19603f3d011682016040523d82523d6000602084013e612f56565b606091505b5091509150612f6787838387612f72565b979650505050505050565b606083156130085782516000036130015773ffffffffffffffffffffffffffffffffffffffff85163b613001576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d9e565b5081610bba565b610bba838381511561301d5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9e91906131c1565b60006020828403121561306357600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461213657600080fd5b6000604082840312156130a557600080fd5b50919050565b8035600281106130ba57600080fd5b919050565b600080604083850312156130d257600080fd5b823567ffffffffffffffff8111156130e957600080fd5b6130f585828601613093565b925050613104602084016130ab565b90509250929050565b803560ff811681146130ba57600080fd5b60008060006060848603121561313357600080fd5b833592506020840135915061314a6040850161310d565b90509250925092565b60005b8381101561316e578181015183820152602001613156565b50506000910152565b6000815180845261318f816020860160208601613153565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006121366020830184613177565b600080600080608085870312156131ea57600080fd5b843593506131fa6020860161310d565b93969395505050506040820135916060013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156132615761326161320f565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156132ae576132ae61320f565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461170f57600080fd5b80356130ba816132b6565b60006101008083850312156132f757600080fd5b6040519081019067ffffffffffffffff8211818310171561331a5761331a61320f565b81604052613327846130ab565b815260208401356020820152604084013560408201526060840135915061334d826132b6565b81606082015261335f608085016132d8565b608082015261337060a085016132d8565b60a082015260c084013560c082015260e084013560e0820152809250505092915050565b6000602082840312156133a657600080fd5b8135612136816132b6565b6000602082840312156133c357600080fd5b5035919050565b600080604083850312156133dd57600080fd5b8235915060208301356133ef816132b6565b809150509250929050565b600061010082840312156130a557600080fd5b600080610120838503121561342157600080fd5b61342b84846133fa565b915061010083013567ffffffffffffffff81111561344857600080fd5b61345485828601613093565b9150509250929050565b6000806000610140848603121561347457600080fd5b61347e85856133fa565b925061010084013567ffffffffffffffff8082111561349c57600080fd5b6134a887838801613093565b93506101208601359150808211156134bf57600080fd5b506134cc86828701613093565b9150509250925092565b600060208083850312156134e957600080fd5b823567ffffffffffffffff8082111561350157600080fd5b818501915085601f83011261351557600080fd5b8135818111156135275761352761320f565b613557847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613267565b9150808252868482850101111561356d57600080fd5b8084840185840137600090820190930192909252509392505050565b60008060006060848603121561359e57600080fd5b83356135a9816132b6565b925060208401356135b9816132b6565b929592945050506040919091013590565b600080604083850312156135dd57600080fd5b82356135e8816132b6565b946020939093013593505050565b600067ffffffffffffffff8211156136105761361061320f565b5060051b60200190565b600082601f83011261362b57600080fd5b8135602061364061363b836135f6565b613267565b82815260059290921b8401810191818101908684111561365f57600080fd5b8286015b8481101561367a5780358352918301918301613663565b509695505050505050565b6000602080838503121561369857600080fd5b823567ffffffffffffffff808211156136b057600080fd5b90840190604082870312156136c457600080fd5b6136cc61323e565b8235828111156136db57600080fd5b8301601f810188136136ec57600080fd5b80356136fa61363b826135f6565b81815260059190911b8201860190868101908a83111561371957600080fd5b928701925b82841015613740578335613731816132b6565b8252928701929087019061371e565b8452505050828401358281111561375657600080fd5b6137628882860161361a565b948201949094529695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126137d757600080fd5b83018035915067ffffffffffffffff8211156137f257600080fd5b6020019150600581901b36038213156110d157600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561096a5761096a613839565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036138ac576138ac613839565b5060010190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126138e857600080fd5b83018035915067ffffffffffffffff82111561390357600080fd5b6020019150368190038213156110d157600080fd5b60006020828403121561392a57600080fd5b612136826130ab565b898152610120810160028a10613972577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208201999099526040810197909752606087019590955273ffffffffffffffffffffffffffffffffffffffff938416608087015291831660a086015290911660c084015260e083015261010090910152919050565b60ff818116838216019081111561096a5761096a613839565b6000606082018583526020606081850152818651808452608086019150828801935060005b81811015613a3857845173ffffffffffffffffffffffffffffffffffffffff1683529383019391830191600101613a06565b50508481036040860152855180825290820192508186019060005b81811015613a6f57825185529383019391830191600101613a53565b509298975050505050505050565b808202811582820484141761096a5761096a613839565b600082613aca577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561096a5761096a613839565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613b49816017850160208801613153565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613b86816028840160208801613153565b01602801949350505050565b600060208284031215613ba457600080fd5b8151801515811461213657600080fd5b600081613bc357613bc3613839565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60008251613bfb818460208701613153565b919091019291505056fea2646970667358221220ed2841239cfe36c0ab29902e97182d52e0f54d12451f819d9185c63908ef626864736f6c63430008130033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000008191dc3053fe4564c17694cb203663d3c07b896000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000009a073d235a8d2c37854da6f6a8f075c916debe0600000000000000000000000000000000000000000000174b1ca8ab05a8c0000000000000000000000000000000000000000000000000174b1ca8ab05a8c000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000000030000000000000000000000006b95f243959329bb88f5d3df9a7127efba703fda000000000000000000000000796ee28ce42bf7bd43a09acd43fad0aacd7c3b290000000000000000000000009a073d235a8d2c37854da6f6a8f075c916debe06

-----Decoded View---------------
Arg [0] : _usde (address): 0x8191DC3053Fe4564c17694cB203663d3C07B8960
Arg [1] : _assets (address[]): 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84,0xae78736Cd615f374D3085123A210448E74Fc6393,0xdAC17F958D2ee523a2206206994597C13D831ec7,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2,0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
Arg [2] : _custodians (address[]): 0x6b95F243959329bb88F5D3Df9A7127Efba703fDA,0x796Ee28CE42BF7bd43A09aCd43FAd0aACD7C3b29,0x9a073D235A8D2C37854Da6f6A8F075C916debe06
Arg [3] : _owner (address): 0x9a073D235A8D2C37854Da6f6A8F075C916debe06
Arg [4] : _maxMintPerBlock (uint256): 110000000000000000000000
Arg [5] : _maxRedeemPerBlock (uint256): 110000000000000000000000

-----Encoded View---------------
17 Constructor Arguments found :
Arg [0] : 0000000000000000000000008191dc3053fe4564c17694cb203663d3c07b8960
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [3] : 0000000000000000000000009a073d235a8d2c37854da6f6a8f075c916debe06
Arg [4] : 00000000000000000000000000000000000000000000174b1ca8ab05a8c00000
Arg [5] : 00000000000000000000000000000000000000000000174b1ca8ab05a8c00000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [7] : 000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84
Arg [8] : 000000000000000000000000ae78736cd615f374d3085123a210448e74fc6393
Arg [9] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7
Arg [10] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [11] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [12] : 000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [14] : 0000000000000000000000006b95f243959329bb88f5d3df9a7127efba703fda
Arg [15] : 000000000000000000000000796ee28ce42bf7bd43a09acd43fad0aacd7c3b29
Arg [16] : 0000000000000000000000009a073d235a8d2c37854da6f6a8f075c916debe06


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  ]

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.