S Price: $0.557552 (-1.31%)

Contract

0x47A8cFdf9957B10cb77723cC840f396E5ACe553A

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Remove Liquidity58579172025-01-30 4:37:5247 hrs ago1738211872IN
0x47A8cFdf...E5ACe553A
0 S0.0314183155
Remove Liquidity55030782025-01-26 22:04:495 days ago1737929089IN
0x47A8cFdf...E5ACe553A
0 S0.0312967255.01
Remove Liquidity52382562025-01-24 9:04:167 days ago1737709456IN
0x47A8cFdf...E5ACe553A
0 S0.0352271155
Remove Liquidity49778972025-01-22 12:27:249 days ago1737548844IN
0x47A8cFdf...E5ACe553A
0 S0.0306289260
Remove Liquidity48395552025-01-21 15:20:1810 days ago1737472818IN
0x47A8cFdf...E5ACe553A
0 S0.0409284765.29
Remove Liquidity47693602025-01-21 5:00:4710 days ago1737435647IN
0x47A8cFdf...E5ACe553A
0 S0.0328011255
Remove Liquidity45079612025-01-19 9:18:3912 days ago1737278319IN
0x47A8cFdf...E5ACe553A
0 S0.0356609960.5
Remove Liquidity44362582025-01-18 19:05:5113 days ago1737227151IN
0x47A8cFdf...E5ACe553A
0 S0.0261433155
Remove Liquidity44039292025-01-18 13:45:4213 days ago1737207942IN
0x47A8cFdf...E5ACe553A
0 S0.0308536855
Remove Liquidity43373442025-01-18 3:02:4414 days ago1737169364IN
0x47A8cFdf...E5ACe553A
0 S0.07426009105
Remove Liquidity43147032025-01-17 22:20:5414 days ago1737152454IN
0x47A8cFdf...E5ACe553A
0 S0.0262938451.5
Remove Liquidity41865712025-01-16 19:26:1015 days ago1737055570IN
0x47A8cFdf...E5ACe553A
0 S0.05899968110.01
Remove Liquidity41585932025-01-16 14:43:2115 days ago1737038601IN
0x47A8cFdf...E5ACe553A
0 S0.07092272110
Remove Liquidity41511772025-01-16 13:25:2715 days ago1737033927IN
0x47A8cFdf...E5ACe553A
0 S0.07605868115.73
Remove Liquidity41021072025-01-16 5:07:3915 days ago1737004059IN
0x47A8cFdf...E5ACe553A
0 S0.0159979233.02
Remove Liquidity40818182025-01-16 1:22:2216 days ago1736990542IN
0x47A8cFdf...E5ACe553A
0 S0.0189675433
Remove Liquidity40813672025-01-16 1:18:1916 days ago1736990299IN
0x47A8cFdf...E5ACe553A
0 S0.1164479533
Remove Liquidity40813232025-01-16 1:17:4616 days ago1736990266IN
0x47A8cFdf...E5ACe553A
0 S0.1164479533
Remove Liquidity40797522025-01-16 1:04:3516 days ago1736989475IN
0x47A8cFdf...E5ACe553A
0 S0.1164479533
Remove Liquidity40739852025-01-16 0:23:5716 days ago1736987037IN
0x47A8cFdf...E5ACe553A
0 S0.0215923233
Remove Liquidity40523462025-01-15 21:27:3816 days ago1736976458IN
0x47A8cFdf...E5ACe553A
0 S0.0200376933.01
Remove Liquidity39330952025-01-15 0:10:1317 days ago1736899813IN
0x47A8cFdf...E5ACe553A
0 S0.0174589830
Remove Liquidity39294322025-01-14 23:27:5417 days ago1736897274IN
0x47A8cFdf...E5ACe553A
0 S0.0175068333
Remove Liquidity38767392025-01-14 13:46:2317 days ago1736862383IN
0x47A8cFdf...E5ACe553A
0 S0.003741087
Remove Liquidity37565242025-01-13 15:35:3018 days ago1736782530IN
0x47A8cFdf...E5ACe553A
0 S0.00322525.5
View all transactions

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

Contract Source Code Verified (Exact Match)

Contract Name:
Blacksail_SwapX_QoL

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

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

import '../interfacing/ichi/IICHIVault.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';

// Helper contract for normal liquidity withdrawal
contract Blacksail_SwapX_QoL {

    event WithdrawLiquidity(address indexed token0, uint256 amount0, address indexed token1, uint256 amount1, address indexed to);

    constructor() {}

    /**
     * @notice Allows users to withdraw their liquidity from an ICHI vault without relying on the native platform's UI.
     * @dev This function is designed to provide a streamlined withdrawal process, especially for users who are 
     *      not staked in the platform's gauge and therefore cannot withdraw liquidity directly via the native UI.
     *      It transfers the user's full LP token balance to the vault, withdrawing the corresponding amounts 
     *      of Token0 and Token1 back to the user.
     * @param ichiVault The address of the ICHI vault from which liquidity will be withdrawn.
     * 
     * Emits a {WithdrawLiquidity} event with the withdrawn token amounts and recipient details.
    */
    function removeLiquidity(address ichiVault) external {
        uint256 amount0;
        uint256 amount1;

        address token0 = IICHIVault(ichiVault).token0();
        address token1 = IICHIVault(ichiVault).token1();

        uint256 liquidity = IERC20(ichiVault).balanceOf(msg.sender);

        IERC20(ichiVault).transferFrom(msg.sender, address(this), liquidity);

        (amount0, amount1) = IICHIVault(ichiVault).withdraw(liquidity, msg.sender);

        emit WithdrawLiquidity(token0, amount0, token1, amount1, msg.sender);
    }
}

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

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 3 of 3 : IICHIVault.sol
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.5.0;

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

interface IICHIVault is IERC20 {
    function ichiVaultFactory() external view returns (address);

    function pool() external view returns (address);

    function token0() external view returns (address);

    function allowToken0() external view returns (bool);

    function token1() external view returns (address);

    function allowToken1() external view returns (bool);

    function fee() external view returns (uint24);

    function tickSpacing() external view returns (int24);

    function affiliate() external view returns (address);

    function baseLower() external view returns (int24);

    function baseUpper() external view returns (int24);

    function limitLower() external view returns (int24);

    function limitUpper() external view returns (int24);

    function deposit0Max() external view returns (uint256);

    function deposit1Max() external view returns (uint256);

    function maxTotalSupply() external view returns (uint256);

    function hysteresis() external view returns (uint256);

    function getTotalAmounts() external view returns (uint256, uint256);

    function deposit(uint256, uint256, address) external returns (uint256);

    function withdraw(uint256, address) external returns (uint256, uint256);

    function rebalance(
        int24 _baseLower,
        int24 _baseUpper,
        int24 _limitLower,
        int24 _limitUpper,
        int256 swapQuantity
    ) external;

    function setDepositMax(uint256 _deposit0Max, uint256 _deposit1Max) external;

    function setAffiliate(address _affiliate) external;

    event DeployICHIVault(
        address indexed sender,
        address indexed pool,
        bool allowToken0,
        bool allowToken1,
        address owner,
        uint256 twapPeriod
    );

    event SetTwapPeriod(address sender, uint32 newTwapPeriod);

    event Deposit(address indexed sender, address indexed to, uint256 shares, uint256 amount0, uint256 amount1);

    event Withdraw(address indexed sender, address indexed to, uint256 shares, uint256 amount0, uint256 amount1);

    event Rebalance(
        int24 tick,
        uint256 totalAmount0,
        uint256 totalAmount1,
        uint256 feeAmount0,
        uint256 feeAmount1,
        uint256 totalSupply
    );

    event MaxTotalSupply(address indexed sender, uint256 maxTotalSupply);

    event Hysteresis(address indexed sender, uint256 hysteresis);

    event DepositMax(address indexed sender, uint256 deposit0Max, uint256 deposit1Max);

    event Affiliate(address indexed sender, address affiliate);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"WithdrawLiquidity","type":"event"},{"inputs":[{"internalType":"address","name":"ichiVault","type":"address"}],"name":"removeLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080806040523461001657610315908161001c8239f35b600080fdfe60806040908082526004908136101561001757600080fd5b600092833560e01c63d798f86e1461002e57600080fd5b3461027f5760208060031936011261027b5783356001600160a01b03818116939184900361018b57630dfe168160e01b855282858781875afa94851561019657879561025c575b50815163d21220a760e01b81529583878281885afa968715610252578897610223575b5082516370a0823160e01b81523382820152908482602481895afa9182156102195789926101ea575b5083516323b872dd60e01b815233828201523060248201526044810183905285816064818d8b5af180156101e05790859392916101a0575b506044908a84519889948593627b8a6760e11b85528401523360248401525af18015610196578793889161015e575b835194855284015233958116941692507f5d6102171d38f5a0418b7f4b7affa937788ec4c74960ea0f04c6c4d5c8f85ba891a480f35b9350508184813d831161018f575b6101768183610283565b8101031261018b578351938301518493610128565b8680fd5b503d61016c565b82513d89823e3d90fd5b9092508581813d83116101d9575b6101b88183610283565b810103126101d55751801515036101d1578391386100f9565b8880fd5b8980fd5b503d6101ae565b85513d8c823e3d90fd5b9091508481813d8311610212575b6102028183610283565b810103126101d1575190386100c1565b503d6101f8565b84513d8b823e3d90fd5b610244919750843d861161024b575b61023c8183610283565b8101906102bb565b9538610098565b503d610232565b83513d8a823e3d90fd5b610274919550833d851161024b5761023c8183610283565b9338610075565b8480fd5b8380fd5b90601f8019910116810190811067ffffffffffffffff8211176102a557604052565b634e487b7160e01b600052604160045260246000fd5b908160209103126102da57516001600160a01b03811681036102da5790565b600080fdfea2646970667358221220ba4f1beca4b0178cec58b158622768a79a7fad822376cdb624bffb370cc7acb464736f6c63430008140033

Deployed Bytecode

0x60806040908082526004908136101561001757600080fd5b600092833560e01c63d798f86e1461002e57600080fd5b3461027f5760208060031936011261027b5783356001600160a01b03818116939184900361018b57630dfe168160e01b855282858781875afa94851561019657879561025c575b50815163d21220a760e01b81529583878281885afa968715610252578897610223575b5082516370a0823160e01b81523382820152908482602481895afa9182156102195789926101ea575b5083516323b872dd60e01b815233828201523060248201526044810183905285816064818d8b5af180156101e05790859392916101a0575b506044908a84519889948593627b8a6760e11b85528401523360248401525af18015610196578793889161015e575b835194855284015233958116941692507f5d6102171d38f5a0418b7f4b7affa937788ec4c74960ea0f04c6c4d5c8f85ba891a480f35b9350508184813d831161018f575b6101768183610283565b8101031261018b578351938301518493610128565b8680fd5b503d61016c565b82513d89823e3d90fd5b9092508581813d83116101d9575b6101b88183610283565b810103126101d55751801515036101d1578391386100f9565b8880fd5b8980fd5b503d6101ae565b85513d8c823e3d90fd5b9091508481813d8311610212575b6102028183610283565b810103126101d1575190386100c1565b503d6101f8565b84513d8b823e3d90fd5b610244919750843d861161024b575b61023c8183610283565b8101906102bb565b9538610098565b503d610232565b83513d8a823e3d90fd5b610274919550833d851161024b5761023c8183610283565b9338610075565b8480fd5b8380fd5b90601f8019910116810190811067ffffffffffffffff8211176102a557604052565b634e487b7160e01b600052604160045260246000fd5b908160209103126102da57516001600160a01b03811681036102da5790565b600080fdfea2646970667358221220ba4f1beca4b0178cec58b158622768a79a7fad822376cdb624bffb370cc7acb464736f6c63430008140033

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.