HYPE Price: $37.45 (-2.95%)

Contract

0x69317CEcf77Fb5dc68aBE5C7aAfB283De46956d9

Overview

HYPE Balance

HyperEVM LogoHyperEVM LogoHyperEVM Logo0 HYPE

HYPE Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...19381782025-04-02 13:51:0096 days ago1743601860IN
0x69317CEc...De46956d9
0 HYPE0.000002890.10140123
Set Pool19379612025-04-02 13:44:0096 days ago1743601440IN
0x69317CEc...De46956d9
0 HYPE0.000004720.1
Set Swap Fee Par...19375562025-04-02 13:30:5896 days ago1743600658IN
0x69317CEc...De46956d9
0 HYPE0.000004890.1

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
STEXRatioSwapFeeModule

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 10000 runs

Other Settings:
cancun EvmVersion
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {SwapFeeModuleData} from "@valantis-core/swap-fee-modules/interfaces/ISwapFeeModule.sol";
import {ISovereignPool} from "@valantis-core/pools/interfaces/ISovereignPool.sol";

import {FeeParams} from "./structs/STEXRatioSwapFeeModuleStructs.sol";
import {ISTEXAMM} from "./interfaces/ISTEXAMM.sol";
import {ISTEXRatioSwapFeeModule} from "./interfaces/ISTEXRatioSwapFeeModule.sol";
import {IWithdrawalModule} from "./interfaces/IWithdrawalModule.sol";

/**
 * @title Stake Exchange: Reserves Ratio based Swap Fee Module.
 */
contract STEXRatioSwapFeeModule is ISTEXRatioSwapFeeModule, Ownable {
    /**
     *
     *  CUSTOM ERRORS
     *
     */
    error STEXRatioSwapFeeModule__ZeroAddress();
    error STEXRatioSwapFeeModule__getSwapFeeInBips_ZeroReserveToken1();
    error STEXRatioSwapFeeModule__setSwapFeeParams_inconsistentFeeParams();
    error STEXRatioSwapFeeModule__setSwapFeeParams_invalidFeeMin();
    error STEXRatioSwapFeeModule__setSwapFeeParams_invalidFeeMax();
    error STEXRatioSwapFeeModule__setSwapFeeParams_invalidMinThresholdRatio();
    error STEXRatioSwapFeeModule__setSwapFeeParams_invalidMaxThresholdRatio();
    error STEXRatioSwapFeeModule__setSwapFeeParams_inconsistentThresholdRatioParams();
    error STEXRatioSwapFeeModule__setPool_alreadySet();

    /**
     *
     *  CONSTANTS
     *
     */
    uint256 private constant BIPS = 10_000;

    /**
     *
     *  STORAGE
     *
     */

    /**
     * @notice Address of Valantis Sovereign Pool.
     */
    address public pool;

    /**
     *
     *  CONSTRUCTOR
     *
     */
    constructor(address _owner) Ownable(_owner) {}

    /**
     *
     *  STORAGE
     *
     */

    /**
     * @notice Dynamic swap fee parameters.
     */
    FeeParams public feeParams;

    /**
     *
     *  VIEW FUNCTIONS
     *
     */
    function getSwapFeeInBips(
        address _tokenIn,
        address, /*_tokenOut*/
        uint256 _amountIn,
        address, /*_user*/
        bytes memory /*_swapFeeModuleContext*/
    ) external view override returns (SwapFeeModuleData memory swapFeeModuleData) {
        ISovereignPool poolInterface = ISovereignPool(pool);
        ISTEXAMM stexInterface = ISTEXAMM(poolInterface.alm());
        // Fee is only applied on token0 -> token1 swaps
        if (_tokenIn == poolInterface.token0()) {
            (uint256 reserve0, uint256 reserve1) = poolInterface.getReserves();
            IWithdrawalModule withdrawalModuleInterface = IWithdrawalModule(stexInterface.withdrawalModule());

            uint256 amount0PendingUnstaking = withdrawalModuleInterface.amountToken0PendingUnstaking();
            uint256 amountToken0PendingLPWithdrawal =
                withdrawalModuleInterface.convertToToken0(withdrawalModuleInterface.amountToken1PendingLPWithdrawal());

            uint256 amount0Total = reserve0 + amount0PendingUnstaking + _amountIn - amountToken0PendingLPWithdrawal;

            FeeParams memory feeParamsCache = feeParams;
            uint256 feeInBips;

            uint256 reserve1Total = reserve1 + withdrawalModuleInterface.amountToken1LendingPool();

            if (reserve1Total == 0) {
                revert STEXRatioSwapFeeModule__getSwapFeeInBips_ZeroReserveToken1();
            }

            uint256 ratioBips = (amount0Total * BIPS) / reserve1Total;

            if (ratioBips > feeParamsCache.maxThresholdRatioBips) {
                feeInBips = feeParamsCache.feeMaxBips;
            } else if (ratioBips < feeParamsCache.minThresholdRatioBips) {
                feeInBips = feeParamsCache.feeMinBips;
            } else {
                uint256 numerator = ratioBips - feeParamsCache.minThresholdRatioBips;
                uint256 denominator = feeParamsCache.maxThresholdRatioBips - feeParamsCache.minThresholdRatioBips;

                feeInBips = feeParamsCache.feeMinBips
                    + ((feeParamsCache.feeMaxBips - feeParamsCache.feeMinBips) * numerator) / denominator;
            }

            // Swap fee in `SovereignPool::swap` is applied as:
            // amountIn * BIPS / (BIPS + swapFeeModuleData.feeInBips),
            // but our parametrization assumes the form: amountIn * (BIPS - feeInBips) / BIPS
            // Hence we need to equate both and solve for `swapFeeModuleData.feeInBips`,
            // with the constraint that feeInBips <= 5_000
            swapFeeModuleData.feeInBips = (BIPS * BIPS) / (BIPS - feeInBips) - BIPS;
        }
    }

    /**
     *
     *  EXTERNAL FUNCTIONS
     *
     */

    /**
     * @notice Sets address of Valantis Sovereign Pool.
     * @param _pool Address of Valantis Sovereign Pool to set.
     * @dev Callable by `owner` only once.
     */
    function setPool(address _pool) external onlyOwner {
        if (_pool == address(0)) revert STEXRatioSwapFeeModule__ZeroAddress();
        // Pool can only be set once
        if (pool != address(0)) {
            revert STEXRatioSwapFeeModule__setPool_alreadySet();
        }
        pool = _pool;

        emit PoolSet(_pool);
    }

    /**
     * @notice Update AMM's dynamic swap fee parameters.
     * @dev Only callable by `owner`.
     * @param _minThresholdRatioBips Threshold value below which `_feeMinBips` will be applied.
     * @param _maxThresholdRatioBips Threshold value above which `_feeMaxBips` will be applied.
     * @param _feeMinBips Lower-bound for the dynamic swap fee.
     * @param _feeMaxBips Upper-bound for the dynamic swap fee.
     */
    function setSwapFeeParams(
        uint32 _minThresholdRatioBips,
        uint32 _maxThresholdRatioBips,
        uint32 _feeMinBips,
        uint32 _feeMaxBips
    ) external override onlyOwner {
        // Reserve ratio threshold params must be in BIPS
        if (_minThresholdRatioBips >= BIPS) {
            revert STEXRatioSwapFeeModule__setSwapFeeParams_invalidMinThresholdRatio();
        }
        if (_maxThresholdRatioBips > BIPS) {
            revert STEXRatioSwapFeeModule__setSwapFeeParams_invalidMaxThresholdRatio();
        }
        if (_minThresholdRatioBips >= _maxThresholdRatioBips) {
            revert STEXRatioSwapFeeModule__setSwapFeeParams_inconsistentThresholdRatioParams();
        }

        // Fees must be lower than 50% (5_000 bips)
        if (_feeMinBips >= BIPS / 2) {
            revert STEXRatioSwapFeeModule__setSwapFeeParams_invalidFeeMin();
        }
        if (_feeMaxBips >= BIPS / 2) {
            revert STEXRatioSwapFeeModule__setSwapFeeParams_invalidFeeMax();
        }

        if (_feeMinBips > _feeMaxBips) {
            revert STEXRatioSwapFeeModule__setSwapFeeParams_inconsistentFeeParams();
        }

        feeParams = FeeParams({
            minThresholdRatioBips: _minThresholdRatioBips,
            maxThresholdRatioBips: _maxThresholdRatioBips,
            feeMinBips: _feeMinBips,
            feeMaxBips: _feeMaxBips
        });

        emit SwapFeeParamsSet(_minThresholdRatioBips, _maxThresholdRatioBips, _feeMinBips, _feeMaxBips);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// 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);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { ALMLiquidityQuoteInput, ALMLiquidityQuote } from '../structs/SovereignALMStructs.sol';

/**
    @title Sovereign ALM interface
    @notice All ALMs bound to a Sovereign Pool must implement it.
 */
interface ISovereignALM {
    /** 
        @notice Called by the Sovereign pool to request a liquidity quote from the ALM.
        @param _almLiquidityQuoteInput Contains fundamental data about the swap.
        @param _externalContext Data received by the pool from the user.
        @param _verifierData Verification data received by the pool from the verifier module
        @return almLiquidityQuote Liquidity quote containing tokenIn and tokenOut amounts filled.
    */
    function getLiquidityQuote(
        ALMLiquidityQuoteInput memory _almLiquidityQuoteInput,
        bytes calldata _externalContext,
        bytes calldata _verifierData
    ) external returns (ALMLiquidityQuote memory);

    /**
        @notice Callback function for `depositLiquidity` .
        @param _amount0 Amount of token0 being deposited.
        @param _amount1 Amount of token1 being deposited.
        @param _data Context data passed by the ALM, while calling `depositLiquidity`.
    */
    function onDepositLiquidityCallback(uint256 _amount0, uint256 _amount1, bytes memory _data) external;

    /**
        @notice Callback to ALM after swap into liquidity pool.
        @dev Only callable by pool.
        @param _isZeroToOne Direction of swap.
        @param _amountIn Amount of tokenIn in swap.
        @param _amountOut Amount of tokenOut in swap. 
     */
    function onSwapCallback(bool _isZeroToOne, uint256 _amountIn, uint256 _amountOut) external;
}

File 6 of 18 : SovereignALMStructs.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

struct ALMLiquidityQuoteInput {
    bool isZeroToOne;
    uint256 amountInMinusFee;
    uint256 feeInBips;
    address sender;
    address recipient;
    address tokenOutSwap;
}

struct ALMLiquidityQuote {
    bool isCallbackOnSwap;
    uint256 amountOut;
    uint256 amountInFilled;
}

File 7 of 18 : IFlashBorrower.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.19;

interface IFlashBorrower {
    /**
        @dev Receive a flash loan.
        @param initiator The initiator of the loan.
        @param token The loan currency.
        @param amount The amount of tokens lent.
        @param data Arbitrary data structure, intended to contain user-defined parameters.
        @return The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan"
     */
    function onFlashLoan(
        address initiator,
        address token,
        uint256 amount,
        bytes calldata data
    ) external returns (bytes32);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { IValantisPool } from '../interfaces/IValantisPool.sol';
import { PoolLocks } from '../structs/ReentrancyGuardStructs.sol';
import { SovereignPoolSwapContextData, SovereignPoolSwapParams } from '../structs/SovereignPoolStructs.sol';

interface ISovereignPool is IValantisPool {
    event SwapFeeModuleSet(address swapFeeModule);
    event ALMSet(address alm);
    event GaugeSet(address gauge);
    event PoolManagerSet(address poolManager);
    event PoolManagerFeeSet(uint256 poolManagerFeeBips);
    event SovereignOracleSet(address sovereignOracle);
    event PoolManagerFeesClaimed(uint256 amount0, uint256 amount1);
    event DepositLiquidity(uint256 amount0, uint256 amount1);
    event WithdrawLiquidity(address indexed recipient, uint256 amount0, uint256 amount1);
    event Swap(address indexed sender, bool isZeroToOne, uint256 amountIn, uint256 fee, uint256 amountOut);

    function getTokens() external view returns (address[] memory tokens);

    function sovereignVault() external view returns (address);

    function protocolFactory() external view returns (address);

    function gauge() external view returns (address);

    function poolManager() external view returns (address);

    function sovereignOracleModule() external view returns (address);

    function swapFeeModule() external view returns (address);

    function verifierModule() external view returns (address);

    function isLocked() external view returns (bool);

    function isRebaseTokenPool() external view returns (bool);

    function poolManagerFeeBips() external view returns (uint256);

    function defaultSwapFeeBips() external view returns (uint256);

    function swapFeeModuleUpdateTimestamp() external view returns (uint256);

    function alm() external view returns (address);

    function getPoolManagerFees() external view returns (uint256 poolManagerFee0, uint256 poolManagerFee1);

    function getReserves() external view returns (uint256 reserve0, uint256 reserve1);

    function setPoolManager(address _manager) external;

    function setGauge(address _gauge) external;

    function setPoolManagerFeeBips(uint256 _poolManagerFeeBips) external;

    function setSovereignOracle(address sovereignOracle) external;

    function setSwapFeeModule(address _swapFeeModule) external;

    function setALM(address _alm) external;

    function swap(SovereignPoolSwapParams calldata _swapParams) external returns (uint256, uint256);

    function depositLiquidity(
        uint256 _amount0,
        uint256 _amount1,
        address _sender,
        bytes calldata _verificationContext,
        bytes calldata _depositData
    ) external returns (uint256 amount0Deposited, uint256 amount1Deposited);

    function withdrawLiquidity(
        uint256 _amount0,
        uint256 _amount1,
        address _sender,
        address _recipient,
        bytes calldata _verificationContext
    ) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { IFlashBorrower } from './IFlashBorrower.sol';

interface IValantisPool {
    /************************************************
     *  EVENTS
     ***********************************************/

    event Flashloan(address indexed initiator, address indexed receiver, uint256 amount, address token);

    /************************************************
     *  ERRORS
     ***********************************************/

    error ValantisPool__flashloan_callbackFailed();
    error ValantisPool__flashLoan_flashLoanDisabled();
    error ValantisPool__flashLoan_flashLoanNotRepaid();
    error ValantisPool__flashLoan_rebaseTokenNotAllowed();

    /************************************************
     *  VIEW FUNCTIONS
     ***********************************************/

    /**
        @notice Address of ERC20 token0 of the pool.
     */
    function token0() external view returns (address);

    /**
        @notice Address of ERC20 token1 of the pool.
     */
    function token1() external view returns (address);

    /************************************************
     *  EXTERNAL FUNCTIONS
     ***********************************************/

    /**
        @notice Claim share of protocol fees accrued by this pool.
        @dev Can only be claimed by `gauge` of the pool. 
     */
    function claimProtocolFees() external returns (uint256, uint256);

    /**
        @notice Claim share of fees accrued by this pool
                And optionally share some with the protocol.
        @dev Only callable by `poolManager`.
        @param _feeProtocol0Bips Percent of `token0` fees to be shared with protocol.
        @param _feeProtocol1Bips Percent of `token1` fees to be shared with protocol.
     */
    function claimPoolManagerFees(
        uint256 _feeProtocol0Bips,
        uint256 _feeProtocol1Bips
    ) external returns (uint256 feePoolManager0Received, uint256 feePoolManager1Received);

    /**
        @notice Sets the gauge contract address for the pool.
        @dev Only callable by `protocolFactory`.
        @dev Once a gauge is set it cannot be changed again.
        @param _gauge address of the gauge.
     */
    function setGauge(address _gauge) external;

    /**
        @notice Allows anyone to flash loan any amount of tokens from the pool.
        @param _isTokenZero True if token0 is being flash loaned, False otherwise.
        @param _receiver Address of the flash loan receiver.
        @param _amount Amount of tokens to be flash loaned.
        @param _data Bytes encoded data for flash loan callback.
     */
    function flashLoan(bool _isTokenZero, IFlashBorrower _receiver, uint256 _amount, bytes calldata _data) external;
}

File 10 of 18 : ReentrancyGuardStructs.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

enum Lock {
    WITHDRAWAL,
    DEPOSIT,
    SWAP,
    SPOT_PRICE_TICK
}

struct PoolLocks {
    /**
        @notice Locks all functions that require any withdrawal of funds from the pool
                This involves the following functions -
                * withdrawLiquidity
                * claimProtocolFees
                * claimPoolManagerFees
     */
    uint8 withdrawals;
    /**
        @notice Only locks the deposit function
    */
    uint8 deposit;
    /**
        @notice Only locks the swap function
    */
    uint8 swap;
    /**
        @notice Only locks the spotPriceTick function
    */
    uint8 spotPriceTick;
}

File 11 of 18 : SovereignPoolStructs.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { IERC20 } from '../../../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol';

import { ISwapFeeModule } from '../../swap-fee-modules/interfaces/ISwapFeeModule.sol';

struct SovereignPoolConstructorArgs {
    address token0;
    address token1;
    address protocolFactory;
    address poolManager;
    address sovereignVault;
    address verifierModule;
    bool isToken0Rebase;
    bool isToken1Rebase;
    uint256 token0AbsErrorTolerance;
    uint256 token1AbsErrorTolerance;
    uint256 defaultSwapFeeBips;
}

struct SovereignPoolSwapContextData {
    bytes externalContext;
    bytes verifierContext;
    bytes swapCallbackContext;
    bytes swapFeeModuleContext;
}

struct SwapCache {
    ISwapFeeModule swapFeeModule;
    IERC20 tokenInPool;
    IERC20 tokenOutPool;
    uint256 amountInWithoutFee;
}

struct SovereignPoolSwapParams {
    bool isSwapCallback;
    bool isZeroToOne;
    uint256 amountIn;
    uint256 amountOutMin;
    uint256 deadline;
    address recipient;
    address swapTokenOut;
    SovereignPoolSwapContextData swapContext;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/**
    @notice Struct returned by the swapFeeModule during the getSwapFeeInBips call.
    * feeInBips: The swap fee in bips.
    * internalContext: Arbitrary bytes context data.
 */
struct SwapFeeModuleData {
    uint256 feeInBips;
    bytes internalContext;
}

interface ISwapFeeModuleMinimal {
    /**
        @notice Returns the swap fee in bips for both Universal & Sovereign Pools.
        @param _tokenIn The address of the token that the user wants to swap.
        @param _tokenOut The address of the token that the user wants to receive.
        @param _amountIn The amount of tokenIn being swapped.
        @param _user The address of the user.
        @param _swapFeeModuleContext Arbitrary bytes data which can be sent to the swap fee module.
        @return swapFeeModuleData A struct containing the swap fee in bips, and internal context data.
     */
    function getSwapFeeInBips(
        address _tokenIn,
        address _tokenOut,
        uint256 _amountIn,
        address _user,
        bytes memory _swapFeeModuleContext
    ) external returns (SwapFeeModuleData memory swapFeeModuleData);
}

interface ISwapFeeModule is ISwapFeeModuleMinimal {
    /**
        @notice Callback function called by the pool after the swap has finished. ( Universal Pools )
        @param _effectiveFee The effective fee charged for the swap.
        @param _spotPriceTick The spot price tick after the swap.
        @param _amountInUsed The amount of tokenIn used for the swap.
        @param _amountOut The amount of the tokenOut transferred to the user.
        @param _swapFeeModuleData The context data returned by getSwapFeeInBips.
     */
    function callbackOnSwapEnd(
        uint256 _effectiveFee,
        int24 _spotPriceTick,
        uint256 _amountInUsed,
        uint256 _amountOut,
        SwapFeeModuleData memory _swapFeeModuleData
    ) external;

    /**
        @notice Callback function called by the pool after the swap has finished. ( Sovereign Pools )
        @param _effectiveFee The effective fee charged for the swap.
        @param _amountInUsed The amount of tokenIn used for the swap.
        @param _amountOut The amount of the tokenOut transferred to the user.
        @param _swapFeeModuleData The context data returned by getSwapFeeInBips.
     */
    function callbackOnSwapEnd(
        uint256 _effectiveFee,
        uint256 _amountInUsed,
        uint256 _amountOut,
        SwapFeeModuleData memory _swapFeeModuleData
    ) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

interface ILendingModule {
    function assetBalance() external view returns (uint256);

    function deposit(uint256 amount) external;

    function withdraw(uint256 amount, address recipient) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import {ISovereignALM} from "@valantis-core/ALM/interfaces/ISovereignALM.sol";
import {ISwapFeeModuleMinimal} from "@valantis-core/swap-fee-modules/interfaces/ISwapFeeModule.sol";

interface ISTEXAMM is ISovereignALM {
    event SwapFeeModuleProposed(address swapFeeModule, uint256 startTimestamp);

    event SwapFeeModuleProposalCancelled();

    event SwapFeeModuleSet(address swapFeeModule);

    event WithdrawalModuleProposed(address withdrawalModule, uint256 startTimestamp);

    event WithdrawalModuleProposalCancelled();

    event WithdrawalModuleSet(address withdrawalModule);

    event PoolManagerFeeSet(uint256 poolManagerFeeBips);

    event PoolManagerFeesClaimed(uint256 fee0, uint256 fee1);

    event Token0ReservesUnstaked(uint256 reserve0);

    event Deposit(address indexed sender, address indexed recipient, uint256 amountToken1, uint256 shares);

    event Withdraw(
        address indexed sender, address indexed recipient, uint256 amountToken0, uint256 amountToken1, uint256 shares
    );

    function isLocked() external view returns (bool);

    function pool() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function poolFeeRecipient1() external view returns (address);

    function poolFeeRecipient2() external view returns (address);

    function withdrawalModule() external view returns (address);

    function pause() external;

    function unpause() external;

    function proposeSwapFeeModule(address _swapFeeModule, uint256 _timelockDelay) external;

    function cancelSwapFeeModuleProposal() external;

    function setProposedSwapFeeModule() external;

    function proposeWithdrawalModule(address withdrawalModule_) external;

    function cancelWithdrawalModuleProposal() external;

    function setProposedWithdrawalModule() external;

    function setPoolManagerFeeBips(uint256 _poolManagerFeeBips) external;

    function claimPoolManagerFees() external;

    function unstakeToken0Reserves(uint256 _unstakeAmountToken0) external;

    function supplyToken1Reserves(uint256 _amount1) external;

    function getAmountOut(address _tokenIn, uint256 _amountIn, bool _isInstantWithdraw)
        external
        view
        returns (uint256 amountOut);

    function deposit(uint256 _amount, uint256 _minShares, uint256 _deadline, address _recipient)
        external
        returns (uint256 shares);

    function withdraw(
        uint256 _shares,
        uint256 _amount0Min,
        uint256 _amount1Min,
        uint256 _deadline,
        address _recipient,
        bool _unwrapToNativeToken,
        bool _isInstantWithdrawal
    ) external returns (uint256 amount0, uint256 amount1);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import {ISwapFeeModuleMinimal} from "@valantis-core/swap-fee-modules/interfaces/ISwapFeeModule.sol";

interface ISTEXRatioSwapFeeModule is ISwapFeeModuleMinimal {
    event PoolSet(address pool);

    event SwapFeeParamsSet(
        uint32 minThresholdRatioBips, uint32 maxThresholdRatioBips, uint32 feeMinBips, uint32 feeMaxBips
    );

    function setSwapFeeParams(
        uint32 _minThresholdRatioBips,
        uint32 _maxThresholdRatioBips,
        uint32 _feeMinBips,
        uint32 _feeMaxBips
    ) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import {LPWithdrawalRequest} from "../structs/WithdrawalModuleStructs.sol";
import {ILendingModule} from "./ILendingModule.sol";

interface IWithdrawalModule {
    function overseer() external view returns (address);

    function lendingModule() external view returns (ILendingModule);

    function stex() external view returns (address);

    function pool() external view returns (address);

    function amountToken0PendingUnstaking() external view returns (uint256);

    function amountToken1LendingPool() external view returns (uint256);

    function amountToken1PendingLPWithdrawal() external view returns (uint256);

    function amountToken1ClaimableLPWithdrawal() external view returns (uint256);

    function cumulativeAmountToken1LPWithdrawal() external view returns (uint256);

    function cumulativeAmountToken1ClaimableLPWithdrawal() external view returns (uint256);

    function isLocked() external view returns (bool);

    function convertToToken0(uint256 _amountToken1) external view returns (uint256);

    function convertToToken1(uint256 _amountToken0) external view returns (uint256);

    function token0SharesToBalance(uint256 _shares) external view returns (uint256);

    function token0BalanceToShares(uint256 _balance) external view returns (uint256);

    function token0SharesOf(address _account) external view returns (uint256);

    function getLPWithdrawals(uint256 _idLPWithdrawal) external view returns (LPWithdrawalRequest memory);

    function unstakeToken0Reserves(uint256 _unstakeAmountToken0) external;

    function burnToken0AfterWithdraw(uint256 _amountToken0, address _recipient) external;

    function supplyToken1ToLendingPool(uint256 _amountToken1) external;

    function withdrawToken1FromLendingPool(uint256 _amountToken1, address _recipient) external;

    function update() external;

    function claim(uint256 _idLPQueue) external;
}

File 17 of 18 : STEXRatioSwapFeeModuleStructs.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;

struct FeeParams {
    uint32 minThresholdRatioBips;
    uint32 maxThresholdRatioBips;
    uint32 feeMinBips;
    uint32 feeMaxBips;
}

File 18 of 18 : WithdrawalModuleStructs.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.25;

struct LPWithdrawalRequest {
    address recipient;
    uint96 amountToken1;
    uint256 cumulativeAmountToken1LPWithdrawalCheckpoint;
}

struct LendingModuleProposal {
    address lendingModule;
    uint256 startTimestamp;
}

Settings
{
  "evmVersion": "cancun",
  "libraries": {},
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "@valantis-core/=lib/valantis-core/src/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@solmate/=lib/solmate/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/valantis-core/lib/openzeppelin-contracts/contracts/",
    "solmate/=lib/solmate/src/",
    "valantis-core/=lib/valantis-core/src/"
  ],
  "viaIR": false
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"STEXRatioSwapFeeModule__ZeroAddress","type":"error"},{"inputs":[],"name":"STEXRatioSwapFeeModule__getSwapFeeInBips_ZeroReserveToken1","type":"error"},{"inputs":[],"name":"STEXRatioSwapFeeModule__setPool_alreadySet","type":"error"},{"inputs":[],"name":"STEXRatioSwapFeeModule__setSwapFeeParams_inconsistentFeeParams","type":"error"},{"inputs":[],"name":"STEXRatioSwapFeeModule__setSwapFeeParams_inconsistentThresholdRatioParams","type":"error"},{"inputs":[],"name":"STEXRatioSwapFeeModule__setSwapFeeParams_invalidFeeMax","type":"error"},{"inputs":[],"name":"STEXRatioSwapFeeModule__setSwapFeeParams_invalidFeeMin","type":"error"},{"inputs":[],"name":"STEXRatioSwapFeeModule__setSwapFeeParams_invalidMaxThresholdRatio","type":"error"},{"inputs":[],"name":"STEXRatioSwapFeeModule__setSwapFeeParams_invalidMinThresholdRatio","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"PoolSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"minThresholdRatioBips","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"maxThresholdRatioBips","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"feeMinBips","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"feeMaxBips","type":"uint32"}],"name":"SwapFeeParamsSet","type":"event"},{"inputs":[],"name":"feeParams","outputs":[{"internalType":"uint32","name":"minThresholdRatioBips","type":"uint32"},{"internalType":"uint32","name":"maxThresholdRatioBips","type":"uint32"},{"internalType":"uint32","name":"feeMinBips","type":"uint32"},{"internalType":"uint32","name":"feeMaxBips","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"getSwapFeeInBips","outputs":[{"components":[{"internalType":"uint256","name":"feeInBips","type":"uint256"},{"internalType":"bytes","name":"internalContext","type":"bytes"}],"internalType":"struct SwapFeeModuleData","name":"swapFeeModuleData","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_minThresholdRatioBips","type":"uint32"},{"internalType":"uint32","name":"_maxThresholdRatioBips","type":"uint32"},{"internalType":"uint32","name":"_feeMinBips","type":"uint32"},{"internalType":"uint32","name":"_feeMaxBips","type":"uint32"}],"name":"setSwapFeeParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561000f575f80fd5b5060405161116138038061116183398101604081905261002e916100bb565b806001600160a01b03811661005c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100658161006c565b50506100e8565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156100cb575f80fd5b81516001600160a01b03811681146100e1575f80fd5b9392505050565b61106c806100f55f395ff3fe608060405234801561000f575f80fd5b5060043610610085575f3560e01c8063715018a611610058578063715018a61461011b5780638da5cb5b146101235780639242164f14610140578063f2fde38b146101ae575f80fd5b806316f0115b146100895780633a19db24146100d35780634437152a146100e85780634c7b5106146100fb575b5f80fd5b6001546100a99073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100e66100e1366004610ce6565b6101c1565b005b6100e66100f6366004610d58565b610482565b61010e610109366004610da7565b6105a0565b6040516100ca9190610eb0565b6100e6610b8d565b5f5473ffffffffffffffffffffffffffffffffffffffff166100a9565b60025461017e9063ffffffff8082169164010000000081048216916801000000000000000082048116916c0100000000000000000000000090041684565b6040805163ffffffff958616815293851660208501529184169183019190915290911660608201526080016100ca565b6100e66101bc366004610d58565b610ba0565b6101c9610c08565b6127108463ffffffff161061020a576040517ff4ba034b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108363ffffffff16111561024c576040517f27c46ca300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8263ffffffff168463ffffffff1610610291576040517fa6cd962c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61029e6002612710610f43565b8263ffffffff16106102dc576040517f4b444a5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102e96002612710610f43565b8163ffffffff1610610327576040517fa0743b6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8063ffffffff168263ffffffff16111561036d576040517f83c1b85b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516080808201835263ffffffff87811680845287821660208086018290528884168688018190529388166060968701819052600280547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001685176401000000008502177fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff166801000000000000000087027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff16176c01000000000000000000000000830217905587519384529083019190915294810191909152918201929092527fde009035ce9bf03c8f59c64dca704ee738ebc761db15bf9bc3a2f6f82ad6fe3e910160405180910390a150505050565b61048a610c08565b73ffffffffffffffffffffffffffffffffffffffff81166104d7576040517fdafe220200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015473ffffffffffffffffffffffffffffffffffffffff1615610527576040517fe01f765500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f025f89b99c8ce32af8da7624f4575b920a86ebf07870d85a9fb545fee349ddce9060200160405180910390a150565b6040805180820182525f808252606060208084019190915260015484517fb8f6eb8a0000000000000000000000000000000000000000000000000000000081529451939473ffffffffffffffffffffffffffffffffffffffff90911693849263b8f6eb8a92600480820193918290030181865afa158015610623573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106479190610f7b565b90508173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610692573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106b69190610f7b565b73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1603610b82575f808373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b81526004016040805180830381865afa158015610732573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107569190610f96565b915091505f8373ffffffffffffffffffffffffffffffffffffffff1663ef2238166040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107c89190610f7b565b90505f8173ffffffffffffffffffffffffffffffffffffffff1663fc02abec6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610814573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108389190610fb8565b90505f8273ffffffffffffffffffffffffffffffffffffffff166364697b998473ffffffffffffffffffffffffffffffffffffffff1663a2fd92366040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108c49190610fb8565b6040518263ffffffff1660e01b81526004016108e291815260200190565b602060405180830381865afa1580156108fd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109219190610fb8565b90505f818c6109308589610fcf565b61093a9190610fcf565b6109449190610fe8565b6040805160808101825260025463ffffffff8082168352640100000000820481166020808501919091526801000000000000000083048216848601526c0100000000000000000000000090920416606083015282517f4083902e000000000000000000000000000000000000000000000000000000008152925193945090925f92839273ffffffffffffffffffffffffffffffffffffffff8a1692634083902e9260048181019392918290030181865afa158015610a04573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a289190610fb8565b610a329089610fcf565b9050805f03610a6d576040517fd0a80b7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f81610a7b61271087610ffb565b610a859190610f43565b9050836020015163ffffffff16811115610aab57836060015163ffffffff169250610b48565b835163ffffffff16811015610acc57836040015163ffffffff169250610b48565b83515f90610ae09063ffffffff1683610fe8565b90505f855f01518660200151610af69190611012565b63ffffffff169050808287604001518860600151610b149190611012565b63ffffffff16610b249190610ffb565b610b2e9190610f43565b866040015163ffffffff16610b439190610fcf565b945050505b612710610b558482610fe8565b610b6161271080610ffb565b610b6b9190610f43565b610b759190610fe8565b8d52505050505050505050505b505095945050505050565b610b95610c08565b610b9e5f610c5a565b565b610ba8610c08565b73ffffffffffffffffffffffffffffffffffffffff8116610bfc576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f60048201526024015b60405180910390fd5b610c0581610c5a565b50565b5f5473ffffffffffffffffffffffffffffffffffffffff163314610b9e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610bf3565b5f805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b803563ffffffff81168114610ce1575f80fd5b919050565b5f805f8060808587031215610cf9575f80fd5b610d0285610cce565b9350610d1060208601610cce565b9250610d1e60408601610cce565b9150610d2c60608601610cce565b905092959194509250565b73ffffffffffffffffffffffffffffffffffffffff81168114610c05575f80fd5b5f60208284031215610d68575f80fd5b8135610d7381610d37565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f805f805f60a08688031215610dbb575f80fd5b8535610dc681610d37565b94506020860135610dd681610d37565b9350604086013592506060860135610ded81610d37565b9150608086013567ffffffffffffffff80821115610e09575f80fd5b818801915088601f830112610e1c575f80fd5b813581811115610e2e57610e2e610d7a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610e7457610e74610d7a565b816040528281528b6020848701011115610e8c575f80fd5b826020860160208301375f6020848301015280955050505050509295509295909350565b60208152815160208201525f602083015160408084015280518060608501528060208301608086015e5f6080828601015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f82610f76577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f60208284031215610f8b575f80fd5b8151610d7381610d37565b5f8060408385031215610fa7575f80fd5b505080516020909101519092909150565b5f60208284031215610fc8575f80fd5b5051919050565b80820180821115610fe257610fe2610f16565b92915050565b81810381811115610fe257610fe2610f16565b8082028115828204841417610fe257610fe2610f16565b63ffffffff82811682821603908082111561102f5761102f610f16565b509291505056fea26469706673582212201b037fcd7bb5f9a10833ca3f13cbe0cae0fc9d558d6b27a29b3a0470dae655fe64736f6c63430008190033000000000000000000000000388e360edaac94372df1a2663ffe52671bbd8b58

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610085575f3560e01c8063715018a611610058578063715018a61461011b5780638da5cb5b146101235780639242164f14610140578063f2fde38b146101ae575f80fd5b806316f0115b146100895780633a19db24146100d35780634437152a146100e85780634c7b5106146100fb575b5f80fd5b6001546100a99073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100e66100e1366004610ce6565b6101c1565b005b6100e66100f6366004610d58565b610482565b61010e610109366004610da7565b6105a0565b6040516100ca9190610eb0565b6100e6610b8d565b5f5473ffffffffffffffffffffffffffffffffffffffff166100a9565b60025461017e9063ffffffff8082169164010000000081048216916801000000000000000082048116916c0100000000000000000000000090041684565b6040805163ffffffff958616815293851660208501529184169183019190915290911660608201526080016100ca565b6100e66101bc366004610d58565b610ba0565b6101c9610c08565b6127108463ffffffff161061020a576040517ff4ba034b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108363ffffffff16111561024c576040517f27c46ca300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8263ffffffff168463ffffffff1610610291576040517fa6cd962c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61029e6002612710610f43565b8263ffffffff16106102dc576040517f4b444a5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102e96002612710610f43565b8163ffffffff1610610327576040517fa0743b6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8063ffffffff168263ffffffff16111561036d576040517f83c1b85b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516080808201835263ffffffff87811680845287821660208086018290528884168688018190529388166060968701819052600280547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001685176401000000008502177fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff166801000000000000000087027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff16176c01000000000000000000000000830217905587519384529083019190915294810191909152918201929092527fde009035ce9bf03c8f59c64dca704ee738ebc761db15bf9bc3a2f6f82ad6fe3e910160405180910390a150505050565b61048a610c08565b73ffffffffffffffffffffffffffffffffffffffff81166104d7576040517fdafe220200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015473ffffffffffffffffffffffffffffffffffffffff1615610527576040517fe01f765500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527f025f89b99c8ce32af8da7624f4575b920a86ebf07870d85a9fb545fee349ddce9060200160405180910390a150565b6040805180820182525f808252606060208084019190915260015484517fb8f6eb8a0000000000000000000000000000000000000000000000000000000081529451939473ffffffffffffffffffffffffffffffffffffffff90911693849263b8f6eb8a92600480820193918290030181865afa158015610623573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106479190610f7b565b90508173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610692573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106b69190610f7b565b73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1603610b82575f808373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b81526004016040805180830381865afa158015610732573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107569190610f96565b915091505f8373ffffffffffffffffffffffffffffffffffffffff1663ef2238166040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107c89190610f7b565b90505f8173ffffffffffffffffffffffffffffffffffffffff1663fc02abec6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610814573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108389190610fb8565b90505f8273ffffffffffffffffffffffffffffffffffffffff166364697b998473ffffffffffffffffffffffffffffffffffffffff1663a2fd92366040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108c49190610fb8565b6040518263ffffffff1660e01b81526004016108e291815260200190565b602060405180830381865afa1580156108fd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109219190610fb8565b90505f818c6109308589610fcf565b61093a9190610fcf565b6109449190610fe8565b6040805160808101825260025463ffffffff8082168352640100000000820481166020808501919091526801000000000000000083048216848601526c0100000000000000000000000090920416606083015282517f4083902e000000000000000000000000000000000000000000000000000000008152925193945090925f92839273ffffffffffffffffffffffffffffffffffffffff8a1692634083902e9260048181019392918290030181865afa158015610a04573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a289190610fb8565b610a329089610fcf565b9050805f03610a6d576040517fd0a80b7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f81610a7b61271087610ffb565b610a859190610f43565b9050836020015163ffffffff16811115610aab57836060015163ffffffff169250610b48565b835163ffffffff16811015610acc57836040015163ffffffff169250610b48565b83515f90610ae09063ffffffff1683610fe8565b90505f855f01518660200151610af69190611012565b63ffffffff169050808287604001518860600151610b149190611012565b63ffffffff16610b249190610ffb565b610b2e9190610f43565b866040015163ffffffff16610b439190610fcf565b945050505b612710610b558482610fe8565b610b6161271080610ffb565b610b6b9190610f43565b610b759190610fe8565b8d52505050505050505050505b505095945050505050565b610b95610c08565b610b9e5f610c5a565b565b610ba8610c08565b73ffffffffffffffffffffffffffffffffffffffff8116610bfc576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f60048201526024015b60405180910390fd5b610c0581610c5a565b50565b5f5473ffffffffffffffffffffffffffffffffffffffff163314610b9e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610bf3565b5f805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b803563ffffffff81168114610ce1575f80fd5b919050565b5f805f8060808587031215610cf9575f80fd5b610d0285610cce565b9350610d1060208601610cce565b9250610d1e60408601610cce565b9150610d2c60608601610cce565b905092959194509250565b73ffffffffffffffffffffffffffffffffffffffff81168114610c05575f80fd5b5f60208284031215610d68575f80fd5b8135610d7381610d37565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f805f805f60a08688031215610dbb575f80fd5b8535610dc681610d37565b94506020860135610dd681610d37565b9350604086013592506060860135610ded81610d37565b9150608086013567ffffffffffffffff80821115610e09575f80fd5b818801915088601f830112610e1c575f80fd5b813581811115610e2e57610e2e610d7a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610e7457610e74610d7a565b816040528281528b6020848701011115610e8c575f80fd5b826020860160208301375f6020848301015280955050505050509295509295909350565b60208152815160208201525f602083015160408084015280518060608501528060208301608086015e5f6080828601015260807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f82610f76577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f60208284031215610f8b575f80fd5b8151610d7381610d37565b5f8060408385031215610fa7575f80fd5b505080516020909101519092909150565b5f60208284031215610fc8575f80fd5b5051919050565b80820180821115610fe257610fe2610f16565b92915050565b81810381811115610fe257610fe2610f16565b8082028115828204841417610fe257610fe2610f16565b63ffffffff82811682821603908082111561102f5761102f610f16565b509291505056fea26469706673582212201b037fcd7bb5f9a10833ca3f13cbe0cae0fc9d558d6b27a29b3a0470dae655fe64736f6c63430008190033

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

000000000000000000000000388e360edaac94372df1a2663ffe52671bbd8b58

-----Decoded View---------------
Arg [0] : _owner (address): 0x388E360eDaaC94372df1a2663FFe52671bbd8B58

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000388e360edaac94372df1a2663ffe52671bbd8b58


Block Transaction 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
[ 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.