ETH Price: $3,299.94 (-2.94%)

Contract

0x22Cb8F41F38FA15C3587607Bf25b788dd45b336a
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Fees102312282024-10-18 17:24:3198 days ago1729272271IN
0x22Cb8F41...dd45b336a
0 ETH0.000000830.00468839

Latest 1 internal transaction

Parent Transaction Hash Block From To
38020252024-05-22 21:37:45247 days ago1716413865  Contract Creation0 ETH

Loading...
Loading

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

Contract Name:
FeesVaultProxy

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 2000 runs

Other Settings:
paris EvmVersion
File 1 of 6 : FeesVaultProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.19;

import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol";

import {IFeesVaultFactory} from "./interfaces/IFeesVaultFactory.sol";

contract FeesVaultProxy {
    address private immutable feesVaultFactory;
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    constructor() {
        feesVaultFactory = msg.sender;
    }

    function _getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    function _setImplementation(address newImplementation) private {
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    fallback() external payable {
        address impl = IFeesVaultFactory(feesVaultFactory).feesVaultImplementation();
        require(impl != address(0));

        //Just for etherscan compatibility
        if (impl != _getImplementation() && msg.sender != (address(0))) {
            _setImplementation(impl);
        }

        assembly {
            let ptr := mload(0x40)
            calldatacopy(ptr, 0, calldatasize())
            let result := delegatecall(gas(), impl, ptr, calldatasize(), 0, 0)
            let size := returndatasize()
            returndatacopy(ptr, 0, size)

            switch result
            case 0 {
                revert(ptr, size)
            }
            default {
                return(ptr, size)
            }
        }
    }
}

File 2 of 6 : IAlgebraVaultFactory.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title The interface for the Algebra Vault Factory
/// @notice This contract can be used for automatic vaults creation
/// @dev Version: Algebra Integral
interface IAlgebraVaultFactory {
  /// @notice returns address of the community fee vault for the pool
  /// @param pool the address of Algebra Integral pool
  /// @return communityFeeVault the address of community fee vault
  function getVaultForPool(address pool) external view returns (address communityFeeVault);

  /// @notice creates the community fee vault for the pool if needed
  /// @param pool the address of Algebra Integral pool
  /// @return communityFeeVault the address of community fee vault
  function createVaultForPool(address pool) external returns (address communityFeeVault);

  /// @notice Hook for calling after pool deployment
  /// @param pool the address of Algebra Integral pool
  function afterPoolInitialize(address pool) external;
}

File 3 of 6 : IAccessControlUpgradeable.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 IAccessControlUpgradeable {
    /**
     * @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 4 of 6 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

File 5 of 6 : IFeesVault.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/**
 * @title Fees Vault Interface
 * @dev Interface for the FeesVault contract responsible for managing fee distribution.
 * Defines the essential functions and events for fee claiming and configuration.
 */
interface IFeesVault {
    /**
     * @dev Emitted when fees are claimed from the gauge and distributed.
     * @param pool Address of the liquidity pool.
     * @param token0 Address of the first token in the pool.
     * @param token1 Address of the second token in the pool.
     * @param totalAmount0 Total amount of token0 distributed.
     * @param totalAmount1 Total amount of token1 distributed.
     */
    event Fees(address indexed pool, address indexed token0, address indexed token1, uint256 totalAmount0, uint256 totalAmount1);

    /**
     * @notice Emitted when fees are distributed to the gauge.
     * @param token Address of the token distributed.
     * @param recipient Address of the gauge receiving the fees.
     * @param amount Amount of fees distributed.
     */
    event FeesToGauge(address indexed token, address indexed recipient, uint256 amount);

    /**
     * @notice Emitted when fees are distributed to a recipient other than the gauge.
     * @param token Address of the token distributed.
     * @param recipient Address of the entity receiving the fees.
     * @param amount Amount of fees distributed.
     */
    event FeesToOtherRecipient(address indexed token, address indexed recipient, uint256 amount);

    /**
     * @dev Reverts if the caller is not authorized to perform the operation.
     */
    error AccessDenied();

    /**
     * @dev Reverts if the pool address provided does not match the pool address stored for a gauge.
     */
    error PoolMismatch();

    /**
     * @notice Gets the factory address associated with this fees vault.
     * @return The address of the factory contract.
     */
    function factory() external view returns (address);

    /**
     * @notice Gets the pool address associated with this fees vault.
     * @return The address of the liquidity pool.
     */
    function pool() external view returns (address);

    /**
     * @notice Claims accumulated fees for the calling gauge and distributes them according to configured rates.
     * @dev Can only be called by an authorized gauge. Distributes fees in both tokens of the associated pool.
     * @return gauge0 Amount of token0 distributed to the calling gauge.
     * @return gauge1 Amount of token1 distributed to the calling gauge.
     */
    function claimFees() external returns (uint256 gauge0, uint256 gauge1);

    /**
     * @notice Allows the contract owner to recover ERC20 tokens accidentally sent to this contract.
     * @param token_ The ERC20 token address to recover.
     * @param amount_ The amount of tokens to recover.
     */
    function emergencyRecoverERC20(address token_, uint256 amount_) external;

    /**
     * @dev Initializes the contract with necessary configuration parameters.
     * Can only be called once by the contract factory during the deployment process.
     * @param blastGovernor_ Address of the governor contract for authorization checks.
     * @param factory_ Address of the contract factory for this vault.
     * @param pool_ Address of the liquidity pool associated with this vault.
     */
    function initialize(address blastGovernor_, address blastPoints, address blastPointsOperator, address factory_, address pool_) external;
}

File 6 of 6 : IFeesVaultFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import {IAccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol";

import {IAlgebraVaultFactory} from "@cryptoalgebra/integral-core/contracts/interfaces/vault/IAlgebraVaultFactory.sol";
import {IFeesVault} from "./IFeesVault.sol";

/**
 * @title IFeesVaultFactory Interface
 * @dev Interface for the `FeesVaultFactory` contract. It defines the events, errors,
 * and functions related to the creation and management of fee vaults for pools.
 *
 * This interface extends `IAlgebraVaultFactory`, inheriting its functionalities
 * and integrating them with specific requirements for fee vault management.
 */
interface IFeesVaultFactory is IAlgebraVaultFactory, IAccessControlUpgradeable {
    /**
     * @dev Structure for holding distribution configuration details.
     * Used to set how fees are distributed to various recipients including gauges.
     */
    struct DistributionConfig {
        uint256 toGaugeRate; // The rate at which fees are distributed to the gauge.
        address[] recipients; // The addresses of the recipients who will receive the fees.
        uint256[] rates; // The rates at which fees are distributed to each recipient.
    }

    /**
     * @dev Emitted when a default distribution configuration is change.
     * @param config The distribution configuration applied to all fees vault.
     */
    event DefaultDistributionConfig(DistributionConfig config);

    /**
     * @dev Emitted when a custom distribution configuration is set for a fees vault.
     * @param feesVault The address of the fees vault for which the configuration is set.
     * @param config The custom distribution configuration applied to the fees vault.
     */
    event CustomDistributionConfig(address indexed feesVault, DistributionConfig config);

    /**
     * @dev Emitted when the implementation of the fees vault is changed.
     * This allows the system to upgrade the fees vault logic.
     * @param oldImplementation The address of the previous fees vault implementation.
     * @param newImplementation The address of the new fees vault implementation.
     */
    event FeesVaultImplementationChanged(address indexed oldImplementation, address indexed newImplementation);

    /**
     * @dev Emitted when a new FeesVault is created for a pool.
     *
     * @param pool Address of the pool for which the FeesVault was created.
     * @param feesVault Address of the newly created FeesVault.
     */
    event FeesVaultCreated(address indexed pool, address indexed feesVault);

    /**
     * @dev Emitted when the voter address is updated. This address is used for voting in fee vaults.
     *
     * @param oldVoter The address of the previous voter.
     * @param newVoter The address of the new voter that has been set.
     */
    event SetVoter(address indexed oldVoter, address indexed newVoter);

    /**
     * @dev Emitted when the rebasing tokens governor address is set.
     *
     * @param oldRebasingTokensGovernor The previous address of the rebasing tokens governor.
     * @param newRebasingTokensGovernor The new address of the rebasing tokens governor.
     */
    event SetRebasingTokensGovernor(address indexed oldRebasingTokensGovernor, address indexed newRebasingTokensGovernor);

    /**
     * @dev Emitted when a custom distribution configuration is set for a creator.
     * @param creator The address of the creator for which the configuration is set.
     * @param config The custom distribution configuration applied to the fees vault created by creator.
     */
    event CreatorDistributionConfig(address indexed creator, DistributionConfig config);

    /**
     * @dev Emitted when the creator for multiple fees vaults is changed.
     * @param creator_ The new creator address associated with the fees vaults.
     * @param feesVaults The array of fees vault addresses that had their creator changed.
     */
    event ChangeCreatorForFeesVaults(address indexed creator_, address[] feesVaults);

    /**
     * @dev Error indicating that a fee vault creation attempt was made for a pool that already has an associated vault.
     */
    error AlreadyCreated();

    /**
     * @dev Error indicating that an action (such as creating a fee vault) was attempted by an address that is not whitelisted.
     */
    error AccessDenied();

    /**
     * @dev Error indicating that the lengths of two related arrays (e.g., recipients and rates) do not match.
     */
    error ArraysLengthMismatch();

    /**
     * @dev Error indicating that the sum of rates does not meet the expected total (e.g., 10000 for 100% in basis points).
     */
    error IncorrectRates();

    /**
     * @notice Gets the unique identifier for the role allowed to call fee claiming functions.
     * @return The identifier for the claim fees caller role.
     */
    function CLAIM_FEES_CALLER_ROLE() external view returns (bytes32);

    /**
     * @notice Gets the unique identifier for the role that can create new fee vaults.
     * @return The identifier for the whitelisted creator role.
     */
    function WHITELISTED_CREATOR_ROLE() external view returns (bytes32);

    /**
     * @notice Gets the unique identifier for the role responsible for fee vault administration.
     * @return The identifier for the fees vault administrator role.
     */
    function FEES_VAULT_ADMINISTRATOR_ROLE() external view returns (bytes32);

    /**
     * @notice Retrieves the distribution configuration for a specific fees vault.
     * @param feesVault_ The address of the fees vault.
     * @return toGaugeRate The rate at which fees are distributed to the gauge.
     * @return recipients The addresses of the recipients.
     * @return rates The rates at which fees are distributed to the recipients.
     */
    function getDistributionConfig(
        address feesVault_
    ) external view returns (uint256 toGaugeRate, address[] memory recipients, uint256[] memory rates);

    /**
     * @notice Retrieves the distribution configuration for a specific creator.
     * @param creator_ The address of the creator.
     * @return toGaugeRate The rate at which fees are distributed to the gauge.
     * @return recipients The addresses of the recipients.
     * @return rates The rates at which fees are distributed to the recipients.
     */
    function creatorDistributionConfig(
        address creator_
    ) external view returns (uint256 toGaugeRate, address[] memory recipients, uint256[] memory rates);

    /**
     * @notice Returns the default distribution configuration used by the factory.
     * @return toGaugeRate The default rate at which fees are distributed to the gauge.
     * @return recipients The default addresses of the recipients.
     * @return rates The default rates at which fees are distributed to the recipients.
     */
    function defaultDistributionConfig() external view returns (uint256 toGaugeRate, address[] memory recipients, uint256[] memory rates);

    /**
     * @notice Returns the custom distribution configuration for a specified fees vault.
     * @param feesVault_ The address of the fees vault.
     * @return toGaugeRate The rate at which fees are distributed to the gauge.
     * @return recipients The addresses of the recipients.
     * @return rates The rates at which fees are distributed to the recipients.
     */
    function customDistributionConfig(
        address feesVault_
    ) external view returns (uint256 toGaugeRate, address[] memory recipients, uint256[] memory rates);

    /**
     * @notice Checks if a fees vault has a custom configuration.
     * @param feesVault_ The address of the fees vault to check.
     * @return True if the fees vault has a custom configuration, false otherwise.
     */
    function isCustomConfig(address feesVault_) external view returns (bool);

    /**
     * @notice Returns the current voter address used in fee vaults.
     * @return The address of the current voter.
     */
    function voter() external view returns (address);

    /**
     * @notice Returns the current fees vault implementation address.
     * @return The address of the current fees vault implementation.
     */
    function feesVaultImplementation() external view returns (address);

    /**
     * @notice Changes the implementation of the fees vault used by all vaults.
     * @param implementation_ The new fees vault implementation address.
     */
    function changeImplementation(address implementation_) external;

    /**
     * @notice Retrieves the creator address for a specific fees vault.
     * @param feesVault_ The address of the fees vault.
     * @return The address of the creator associated with the specified fees vault.
     */
    function getFeesVaultCreator(address feesVault_) external view returns (address);

    /**
     * @dev Sets the address used for voting in the fee vaults. Only callable by the contract owner.
     *
     * @param voter_ The new voter address to be set.
     */
    function setVoter(address voter_) external;

    /**
     * @notice Sets a custom distribution configuration for a specific fees vault.
     * @param feesVault_ The address of the fees vault to configure.
     * @param config_ The custom distribution configuration to apply.
     */
    function setCustomDistributionConfig(address feesVault_, DistributionConfig memory config_) external;

    /**
     * @notice Sets a default distribution configuration for a fees vaults.
     * @param config_ The distribution configuration to apply.
     */
    function setDefaultDistributionConfig(DistributionConfig memory config_) external;

    /**
     * @notice Sets a custom distribution configuration for a specific creator.
     * @param creator_ The address of the creator of fees vaults.
     * @param config_ The custom distribution configuration to apply.
     */
    function setDistributionConfigForCreator(address creator_, DistributionConfig memory config_) external;

    /**
     * @notice Changes the creator for multiple fees vaults.
     * @param creator_ The new creator address.
     * @param feesVaults_ The array of fees vault addresses.
     */
    function changeCreatorForFeesVaults(address creator_, address[] calldata feesVaults_) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"}]

Deployed Bytecode

0x60806040527fd5343e860000000000000000000000000000000000000000000000000000000060805273ffffffffffffffffffffffffffffffffffffffff60206080600481847f00000000000000000000000025d84140b5a611fc8b13b0a73b7ac86d30c81edb165afa90811561018f57600091610161575b6100c68183169161008a831515610263565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541673ffffffffffffffffffffffffffffffffffffffff1690565b141580610158575b6100f4575b60008060405192368285378336915af4903d91826000833e156100f257f35bfd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790556100d3565b503315156100ce565b905060203d8111610188575b8061017a61018292610194565b608001610205565b90610078565b503d61016d565b610257565b601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09101166080016080811067ffffffffffffffff8211176101d657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8060209101126102525760805173ffffffffffffffffffffffffffffffffffffffff811681036102525790565b600080fd5b6040513d6000823e3d90fd5b156102525756fea164736f6c6343000813000a

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
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.