Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 13812209 | 52 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
VaultDepositooor
Compiler Version
v0.8.27+commit.40a35a09
Optimization Enabled:
Yes with 100 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import { IERC20Metadata as IERC20 } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import { VaultDepositManager } from "@fun-contracts/Utils/VaultDepositManager.sol";
import { VaultConfigLib } from "@fun-contracts/Utils/VaultConfigLib.sol";
import { Replacer } from "@fun-contracts/Utils/Replacer.sol";
/**
* @title VaultDepositooor
* @author dextracker
* @notice A wrapper contract that enables users to deposit their entire token balance into registered vaults
* using dynamically constructed calldata with runtime amount injection.
* Supports both ERC20 tokens and native ETH deposits.
*
* @dev INTENDED USAGE WITH RELAY:
* This contract is designed to work with Relay's transferAndMulticall function. The typical flow is:
*
* 1. User calls Relay.transferAndMulticall(tokens, amounts, calls, refundTo, nftRecipient)
* 2. Relay transfers tokens from user to itself using transferFrom
* 3. Relay executes the Call3Value[] array, which includes a call to this contract's deposit() function
* 4. This contract deposits tokens into the registered vault on behalf of the user
*
*/
contract VaultDepositooor is VaultDepositManager, ReentrancyGuard {
using SafeERC20 for IERC20;
using VaultConfigLib for uint40;
using Replacer for bytes;
uint256 constant EIGHTEEN = 18;
// ============ Constants ============
/// @notice Special placeholder value used in calldata that gets replaced with the actual deposit amount at runtime
/// @dev This specific value (ending in 0xdeadbeef) is unlikely to appear naturally in valid calldata,
/// reducing the risk of accidental replacement. Only the first occurrence is replaced.
/// Value: 115792089237316195423570985008687907853269984665640564039457584007913129639663
uint256 public constant AMOUNT_PLACEHOLDER = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffdeadbeef;
bytes32 public constant AMOUNT_PLACEHOLDER_BYTES32 = bytes32(AMOUNT_PLACEHOLDER);
/// @notice Address used to represent native ETH (follows common convention)
/// @dev When token parameter equals this address, the contract handles native ETH instead of ERC20
address public constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
// ============ Constructor ============
/// @notice Initializes the contract and optionally transfers ownership
/// @dev Pass address(0) to keep deployer as owner (for testing/direct multisig deployment)
/// Pass Safe multisig address for production deployment (ownership transferred atomically)
/// @param initialOwner Address to transfer ownership to, or address(0) to keep deployer as owner
constructor(address initialOwner) VaultDepositManager(initialOwner) { }
/// @notice Allow contract to receive native ETH
/// @dev Required to accept ETH sent via Call3Value when deposit() is payable
receive() external payable { }
// ============ Core Deposit Function ============
/**
* @notice Deposit the caller's entire token balance (or contract's ETH balance) into a registered vault
* @dev This is the core function designed to be called from Relay's transferAndMulticall.
*
* FLOW FOR ERC20:
* 1. Validates vault is registered
* 2. Checks caller's token balance
* 3. Validates balance meets minAmountOut (slippage protection)
* 4. Transfers tokens from caller to this contract
* 5. Approves vault to spend tokens
* 6. Optionally converts amount to 18 decimals (based on vault config)
* 7. Replaces AMOUNT_PLACEHOLDER in callData with actual amount
* 8. Calls vault with modified calldata
* 9. Emits Deposit event with results
*
* FLOW FOR NATIVE ETH (token == NATIVE_TOKEN):
* 1. Validates vault is registered
* 2. Checks contract's ETH balance (includes ETH sent via Call3Value.value before this call)
* 3. Validates balance > 0 and meets minAmountOut (slippage protection)
* 4. No conversion needed (ETH is always 18 decimals)
* 5. Replaces AMOUNT_PLACEHOLDER in callData with balance
* 6. Calls vault with modified calldata, forwarding balance as msg.value
* 7. Emits Deposit event with results
*
* @param token The token to deposit - either ERC20 address or NATIVE_TOKEN (0xEeee...EEeE) for ETH
* @param vault The registered vault contract to deposit into
* @param callData The vault function calldata containing AMOUNT_PLACEHOLDER at the amount parameter position
* @param minAmountOut Minimum token/ETH balance required for deposit (slippage/frontrunning protection)
* If balance < minAmountOut, transaction reverts
*
* @return returnData The raw bytes returned from the vault's deposit function call
*/
function deposit(address token, address vault, bytes calldata callData, uint256 minAmountOut)
external
nonReentrant
returns (bytes memory returnData)
{
// Load vault configuration from storage (single SLOAD for 5 bytes)
uint40 packedConfig = vaultConfigs[vault];
if (!packedConfig.isRegistered()) revert VaultNotRegisteredForDeposit();
bool isNative = token == NATIVE_TOKEN;
uint256 balance;
uint256 amountForCalldata;
if (isNative) {
// Check vault supports native ETH
if (!packedConfig.allowsNative()) revert VaultDoesNotSupportNative();
// For native ETH, check this contract's ETH balance
// Relay sends ETH before this call
balance = address(this).balance;
if (balance == 0) revert NoETHInContract();
// Slippage protection for native ETH
if (balance < minAmountOut) revert InsufficientETHAmount();
// Native ETH is always 18 decimals, no conversion needed
amountForCalldata = balance;
} else {
// For ERC20 tokens
// Get caller's current balance - this is the amount we'll deposit
balance = IERC20(token).balanceOf(msg.sender);
// Slippage protection: Ensure user has at least the minimum expected amount
if (balance < minAmountOut) revert InsufficientTokenAmount();
// Pull tokens from caller to this contract
// Requires prior approval from msg.sender
IERC20(token).safeTransferFrom(msg.sender, address(this), balance);
// Approve vault to spend the tokens we just received
IERC20(token).safeIncreaseAllowance(vault, balance);
// Prepare the amount for calldata injection
// If vault requires 18 decimals, scale up the amount accordingly
amountForCalldata = balance;
if (packedConfig.requiresConversion()) {
uint8 decimals = IERC20(token).decimals();
if (decimals < EIGHTEEN) {
// Example: USDC (6 decimals) 1,000,000 becomes 1,000,000,000,000,000,000 (18 decimals)
amountForCalldata = balance * 10 ** (EIGHTEEN - decimals);
}
// If decimals >= 18, no conversion needed (keeps native decimals)
}
}
// Validate that the function selector in callData is allowed for this vault
_validateSelector(vault, callData);
// Replace AMOUNT_PLACEHOLDER in calldata with the actual/scaled amount
bytes memory modifiedCallData = callData.replace(AMOUNT_PLACEHOLDER_BYTES32, amountForCalldata);
// Execute the vault deposit call with modified calldata
// For native ETH, forward the balance as msg.value
(bool success, bytes memory data) =
isNative ? vault.call{ value: balance }(modifiedCallData) : vault.call(modifiedCallData);
if (!success) revert DepositFailed(data);
// Emit event with the actual deposited amount (in native token decimals)
emit FunMediatedDeposit(vault, token, balance, data);
return data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity >=0.6.2;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { VaultWrapperErrors } from "@fun-contracts/Utils/VaultWrapperErrors.sol";
import { VaultWrapperEvents } from "@fun-contracts/Utils/VaultWrapperEvents.sol";
import { VaultConfigLib } from "@fun-contracts/Utils/VaultConfigLib.sol";
/**
* @title VaultDepositManager
* @notice Admin functions for managing vault registrations
* @dev Inherited by VaultDepositWrapper to separate admin logic from core deposit functionality
* All storage and constants must be defined here or in parent contracts for inheritance
*/
abstract contract VaultDepositManager is Ownable, VaultWrapperErrors, VaultWrapperEvents {
using VaultConfigLib for uint40;
using VaultConfigLib for VaultConfigLib.VaultConfig;
// ============ Storage Layout ============
// Must be defined in inheritance order to match VaultDepositWrapper
/// @notice Mapping from vault address to packed configuration
/// @dev Each vault uses 5 bytes of storage (uint40) containing:
/// - Configuration flags (isRegistered, convertTo18Decimals, allowsNative)
/// - Allowed function selector (bytes4)
///
/// Gas savings vs separate mappings:
/// - registerVault(): Single SSTORE for both config and selector
/// - deposit(): Single SLOAD + library calls for validation
///
/// Security: Function selector whitelist prevents arbitrary function calls
mapping(address => uint40) public vaultConfigs;
// ============ Constructor ============
/// @notice Initialize with the specified owner
/// @param initialOwner The address to set as owner. If zero address, deployer becomes owner
constructor(address initialOwner) Ownable(initialOwner == address(0) ? msg.sender : initialOwner) {
// Owner is set directly in Ownable constructor - no additional transfer needed
}
// ============ Admin Functions ============
/**
* @notice Register a vault to enable deposits through this contract
* @dev Only callable by owner (Safe multisig). Once registered, users can deposit into this vault via deposit().
* The vault cannot be re-registered without first removing it.
*
* Security: Only the specified function selector can be called on this vault
* Gas optimization: Configuration and selector packed into single uint40 (5 bytes)
*
* @param vault The address of the vault contract to register
* @param vaultABI The deposit method signature (e.g., "deposit(uint256,address)")
* Emitted in VaultRegistered event for off-chain reference only
* @param allowedFunctionSelector The single function selector that can be called on this vault
* Only this function can be invoked through the VaultWrapper for security
* @param convertTo18Decimals Whether to scale token amounts to 18 decimals before injecting into calldata
* - true: Amount is multiplied by 10^(18-tokenDecimals) before replacement (for USDC: 6 decimals → 18)
* - false: Amount is used as-is in token's native decimals
* @param allowsNative Whether this vault accepts native ETH deposits
* - true: Vault can receive ETH via NATIVE_TOKEN parameter
* - false: Vault only accepts ERC20 tokens
*/
function registerVault(
address vault,
string memory vaultABI,
bytes4 allowedFunctionSelector,
bool convertTo18Decimals,
bool allowsNative
) external onlyOwner {
if (vault == address(0)) revert InvalidVault();
if (bytes(vaultABI).length == 0) revert EmptyMethodSignature();
if (allowedFunctionSelector == bytes4(0)) revert InvalidFunctionSelector();
if (vaultConfigs[vault].isRegistered()) revert VaultAlreadyRegistered();
// Create configuration struct and pack it
VaultConfigLib.VaultConfig memory config = VaultConfigLib.VaultConfig({
isRegistered: true,
convertTo18Decimals: convertTo18Decimals,
allowsNative: allowsNative,
allowedSelector: allowedFunctionSelector
});
vaultConfigs[vault] = config.pack();
emit VaultRegistered(vault, vaultABI, convertTo18Decimals);
}
/**
* @notice Remove a vault from the registry, preventing future deposits
* @dev Only callable by owner (Safe multisig). This does not affect any existing deposits in the vault,
* it only prevents new deposits through this contract.
*
* @param vault The address of the vault to remove from the registry
*/
function removeVault(address vault) external onlyOwner {
if (!vaultConfigs[vault].isRegistered()) revert VaultNotRegistered();
delete vaultConfigs[vault];
emit VaultRemoved(vault);
}
/**
* @notice Update the allowed function selector for a registered vault
* @dev Only callable by owner. Changes the function that can be called on this vault.
* @param vault The registered vault address
* @param newSelector The new function selector to allow
*/
function updateAllowedSelector(address vault, bytes4 newSelector) external onlyOwner {
if (!vaultConfigs[vault].isRegistered()) revert VaultNotRegistered();
if (newSelector == bytes4(0)) revert InvalidFunctionSelector();
vaultConfigs[vault] = vaultConfigs[vault].updateSelector(newSelector);
emit SelectorUpdated(vault, newSelector);
}
// ============ View Helpers ============
/**
* @notice Check if a vault is registered
* @param vault The vault address to check
* @return True if the vault is registered, false otherwise
*/
function isVaultRegistered(address vault) external view returns (bool) {
return vaultConfigs[vault].isRegistered();
}
/**
* @notice Check if a vault requires 18-decimal conversion
* @param vault The vault address to check
* @return True if the vault requires amount scaling to 18 decimals, false otherwise
*/
function vaultRequires18Decimals(address vault) external view returns (bool) {
return vaultConfigs[vault].requiresConversion();
}
/**
* @notice Check if a vault allows native ETH deposits
* @param vault The vault address to check
* @return True if the vault accepts native ETH, false if it only accepts ERC20 tokens
*/
function vaultAllowsNative(address vault) external view returns (bool) {
return vaultConfigs[vault].allowsNative();
}
/**
* @notice Get the allowed function selector for a vault
* @param vault The vault address to check
* @return The function selector that can be called on this vault
*/
function getAllowedSelector(address vault) external view returns (bytes4) {
return vaultConfigs[vault].extractSelector();
}
/**
* @notice Get the full vault configuration
* @param vault The vault address to check
* @return config The unpacked vault configuration
*/
function getVaultConfig(address vault) external view returns (VaultConfigLib.VaultConfig memory config) {
return vaultConfigs[vault].unpack();
}
/**
* @notice Internal function to validate function selector before vault call
* @dev Extracts the function selector from calldata and checks if it matches the allowed selector
* @param vault The vault address being called
* @param callData The calldata being sent to the vault
*/
function _validateSelector(address vault, bytes memory callData) internal view {
if (callData.length < 4) revert InvalidCalldata("Calldata too short for function selector");
bytes4 calledSelector;
assembly {
calledSelector := mload(add(callData, 0x20))
}
bytes4 allowedSelector = vaultConfigs[vault].extractSelector();
if (calledSelector != allowedSelector) {
revert SelectorNotAllowed(vault, calledSelector);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
/**
* @title VaultConfigLib
* @notice Library for packing vault configuration and function selectors into efficient storage
* @dev Packs vault config flags and function selector into a single uint40 (5 bytes) for gas efficiency
*/
library VaultConfigLib {
// ============ Constants ============
/// @notice Bit flags for vault configuration
uint40 constant FLAG_IS_REGISTERED = 1 << 0; // bit 0: 0x01
uint40 constant FLAG_CONVERT_TO_18_DECIMALS = 1 << 1; // bit 1: 0x02
uint40 constant FLAG_ALLOWS_NATIVE = 1 << 2; // bit 2: 0x04
/// @notice Bitmasks for extracting packed data
uint40 constant SELECTOR_MASK = 0xFFFFFFFF00; // bits 8-39 for full bytes4 selector
uint40 constant FLAGS_MASK = 0x00000000FF; // bits 0-7 for flags
// ============ Structs ============
/**
* @notice Unpacked vault configuration struct
* @param isRegistered Whether the vault is registered for deposits
* @param convertTo18Decimals Whether to scale amounts to 18 decimals in calldata
* @param allowsNative Whether the vault accepts native ETH deposits
* @param allowedSelector The function selector that can be called on this vault
*/
struct VaultConfig {
bool isRegistered;
bool convertTo18Decimals;
bool allowsNative;
bytes4 allowedSelector;
}
// ============ Packing Functions ============
/**
* @notice Pack a VaultConfig struct into a uint40
* @dev Bit layout:
* - bits 0-7: flags (isRegistered, convertTo18Decimals, allowsNative)
* - bits 8-39: function selector (32 bits)
* @param config The vault configuration to pack
* @return packed The packed configuration as uint40
*/
function pack(VaultConfig memory config) internal pure returns (uint40 packed) {
// Pack flags into lower 8 bits
if (config.isRegistered) packed |= FLAG_IS_REGISTERED;
if (config.convertTo18Decimals) packed |= FLAG_CONVERT_TO_18_DECIMALS;
if (config.allowsNative) packed |= FLAG_ALLOWS_NATIVE;
// Pack function selector into upper 32 bits (shift left by 8 bits)
packed |= (uint40(uint32(config.allowedSelector)) << 8);
}
/**
* @notice Unpack a uint40 into a VaultConfig struct
* @param packed The packed configuration as uint40
* @return config The unpacked vault configuration
*/
function unpack(uint40 packed) internal pure returns (VaultConfig memory config) {
config.isRegistered = (packed & FLAG_IS_REGISTERED) != 0;
config.convertTo18Decimals = (packed & FLAG_CONVERT_TO_18_DECIMALS) != 0;
config.allowsNative = (packed & FLAG_ALLOWS_NATIVE) != 0;
config.allowedSelector = bytes4(uint32((packed & SELECTOR_MASK) >> 8));
}
// ============ Utility Functions ============
/**
* @notice Extract just the function selector from packed config
* @param packed The packed configuration
* @return selector The function selector
*/
function extractSelector(uint40 packed) internal pure returns (bytes4 selector) {
selector = bytes4(uint32((packed & SELECTOR_MASK) >> 8));
}
/**
* @notice Extract just the flags from packed config
* @param packed The packed configuration
* @return flags The configuration flags as uint8
*/
function extractFlags(uint40 packed) internal pure returns (uint8 flags) {
flags = uint8(packed & FLAGS_MASK);
}
/**
* @notice Check if vault is registered
* @param packed The packed configuration
* @return True if vault is registered
*/
function isRegistered(uint40 packed) internal pure returns (bool) {
return (packed & FLAG_IS_REGISTERED) != 0;
}
/**
* @notice Check if vault requires 18 decimal conversion
* @param packed The packed configuration
* @return True if conversion to 18 decimals is required
*/
function requiresConversion(uint40 packed) internal pure returns (bool) {
return (packed & FLAG_CONVERT_TO_18_DECIMALS) != 0;
}
/**
* @notice Check if vault allows native ETH
* @param packed The packed configuration
* @return True if native ETH is allowed
*/
function allowsNative(uint40 packed) internal pure returns (bool) {
return (packed & FLAG_ALLOWS_NATIVE) != 0;
}
/**
* @notice Update just the function selector in packed config
* @param packed The current packed configuration
* @param newSelector The new function selector
* @return updated The updated packed configuration
*/
function updateSelector(uint40 packed, bytes4 newSelector) internal pure returns (uint40 updated) {
// Keep existing flags, replace selector
uint40 flags = packed & FLAGS_MASK;
uint40 packedSelector = (uint40(uint32(newSelector)) << 8);
updated = flags | packedSelector;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import { VaultWrapperErrors } from "@fun-contracts/Utils/VaultWrapperErrors.sol";
/**
* @title Replacer
* @notice Library for replacing placeholder values in calldata
* @dev Gas-optimized calldata manipulation using assembly
*/
library Replacer {
uint256 constant THIRTY_TWO = 32;
/**
* @notice Replace the first occurrence of a placeholder with the actual amount
* @dev This function performs a search through calldata looking for the placeholder value.
*
* Gas Optimization & Safety:
* - Skips the first 4 bytes (function selector) to prevent accidental selector replacement
* - Iterates in 32-byte chunks (not byte-by-byte) since calldata is padded to 32-byte words
* - Only replaces the FIRST occurrence; additional placeholders are ignored
*
* Example of why we skip the selector:
* If selector is 0xAAAAAAFF and placeholder starts with 0xFF, we could accidentally
* replace part of the selector, corrupting the function call.
*
* Gas Cost: ~4,700 + (placeholder_position × 250) gas, O(params) complexity
*
* @param callData The original calldata containing the placeholder
* @param placeholder The placeholder value to search for (as bytes32)
* @param amount The actual amount to inject (may be scaled to 18 decimals by caller)
* @return result The modified calldata with placeholder replaced by amount
*/
function replace(bytes calldata callData, bytes32 placeholder, uint256 amount)
internal
pure
returns (bytes memory result)
{
result = bytes(callData);
bytes32 amountBytes = bytes32(amount);
// Ensure callData is long enough: 4 bytes selector + at least 32 bytes for one parameter
if (result.length < 36) {
revert VaultWrapperErrors
.InvalidCalldata("Call data is too short to include selector and at least one parameter");
}
// Search for placeholder starting after the 4-byte function selector
// Iterate in 32-byte chunks since calldata parameters are padded to full words
// Start at byte 4 (after selector), increment by 32 bytes each iteration
for (uint256 i = 4; i <= result.length - THIRTY_TWO; i += THIRTY_TWO) {
bytes32 chunk;
assembly {
// Load 32 bytes at position (i + 32)
// The +32 accounts for the length prefix in memory layout
chunk := mload(add(result, add(i, THIRTY_TWO)))
}
if (chunk == placeholder) {
assembly {
// Replace the placeholder with the actual amount
mstore(add(result, add(i, THIRTY_TWO)), amountBytes)
}
break; // Only replace first occurrence
}
}
return result;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)
pragma solidity >=0.6.2;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// 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
pragma solidity ^0.8.27;
/**
* @title VaultWrapperErrors
* @notice Custom errors for VaultDepositWrapper contract
* @dev Centralized error definitions for gas-efficient reverts
*/
interface VaultWrapperErrors {
/// @notice Thrown when calldata is too short to contain a valid placeholder
/// @dev Calldata must be at least 36 bytes (4-byte selector + 32-byte parameter)
/// @param reason Descriptive message explaining why the calldata is invalid
error InvalidCalldata(string reason);
/// @notice Thrown when trying to register the zero address as a vault
error InvalidVault();
/// @notice Thrown when vault ABI/method signature is empty
error EmptyMethodSignature();
/// @notice Thrown when trying to register a vault that is already registered
error VaultAlreadyRegistered();
/// @notice Thrown when trying to remove a vault that is not registered
error VaultNotRegistered();
/// @notice Thrown when deposit is called for an unregistered vault
error VaultNotRegisteredForDeposit();
/// @notice Thrown when no ETH is present in contract for native token deposit
error NoETHInContract();
/// @notice Thrown when ETH balance is below minimum amount out (slippage protection)
error InsufficientETHAmount();
/// @notice Thrown when token balance is below minimum amount out (slippage protection)
error InsufficientTokenAmount();
/// @notice Thrown when the vault deposit call fails
/// @param returnData The raw revert data returned by the failed vault call
error DepositFailed(bytes returnData);
/// @notice Thrown when attempting native ETH deposit to a vault that doesn't support it
error VaultDoesNotSupportNative();
/// @notice Thrown when trying to register a vault with an invalid (zero) function selector
error InvalidFunctionSelector();
/// @notice Thrown when trying to call a function selector that is not allowed for the vault
/// @param vault The vault address that was called
/// @param selector The function selector that was attempted
error SelectorNotAllowed(address vault, bytes4 selector);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
/**
* @title VaultWrapperEvents
* @notice Events emitted by VaultDepositWrapper contract
* @dev Centralized event definitions for tracking contract state changes
*/
interface VaultWrapperEvents {
/// @notice Emitted when a new vault is registered by the owner
/// @param vault The address of the registered vault contract
/// @param methodSignature The deposit method signature for this vault (documentation only, not used for
/// replacement) @param convertTo18Decimals Whether amounts should be converted to 18 decimals for this vault (used
/// in deposit logic)
event VaultRegistered(address indexed vault, string methodSignature, bool convertTo18Decimals);
/// @notice Emitted when a vault is removed from the registry by the owner
/// @param vault The address of the vault that was removed
event VaultRemoved(address indexed vault);
/// @notice Emitted when this contract successfully deposits tokens into a vault
/// @param vault The vault contract that received the deposit
/// @param token The ERC20 token that was deposited
/// @param amount The actual amount of tokens deposited (in token's native decimals)
/// @param returnData The raw return data from the vault's deposit function call
event FunMediatedDeposit(address indexed vault, address indexed token, uint256 amount, bytes returnData);
/// @notice Emitted when a vault's allowed function selector is updated
/// @param vault The vault whose selector was updated
/// @param newSelector The new function selector
event SelectorUpdated(address indexed vault, bytes4 indexed newSelector);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)
pragma solidity >=0.4.16;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)
pragma solidity >=0.4.16;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"@CREATE3/=src/CREATE3/",
"@forge-std/=dependencies/forge-std-1.11.0/src/",
"@fun-contracts/=src/",
"@fun-test-contracts/=test/",
"@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.4.0/",
"@solmate/=dependencies/solmate-89365b880c4f3c786bdd453d4b8e8fe410344a69/src/",
"CREATE3-1.0.0/=dependencies/CREATE3-1.0.0/",
"forge-std/=dependencies/forge-std-1.11.0/src/",
"@openzeppelin-contracts-5.4.0/=dependencies/@openzeppelin-contracts-5.4.0/",
"forge-std-1.11.0/=dependencies/forge-std-1.11.0/src/",
"solmate-89365b880c4f3c786bdd453d4b8e8fe410344a69/=dependencies/solmate-89365b880c4f3c786bdd453d4b8e8fe410344a69/src/"
],
"optimizer": {
"enabled": true,
"runs": 100
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": true,
"debug": {
"revertStrings": "debug"
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes","name":"returnData","type":"bytes"}],"name":"DepositFailed","type":"error"},{"inputs":[],"name":"EmptyMethodSignature","type":"error"},{"inputs":[],"name":"InsufficientETHAmount","type":"error"},{"inputs":[],"name":"InsufficientTokenAmount","type":"error"},{"inputs":[{"internalType":"string","name":"reason","type":"string"}],"name":"InvalidCalldata","type":"error"},{"inputs":[],"name":"InvalidFunctionSelector","type":"error"},{"inputs":[],"name":"InvalidVault","type":"error"},{"inputs":[],"name":"NoETHInContract","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"SelectorNotAllowed","type":"error"},{"inputs":[],"name":"VaultAlreadyRegistered","type":"error"},{"inputs":[],"name":"VaultDoesNotSupportNative","type":"error"},{"inputs":[],"name":"VaultNotRegistered","type":"error"},{"inputs":[],"name":"VaultNotRegisteredForDeposit","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"returnData","type":"bytes"}],"name":"FunMediatedDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"bytes4","name":"newSelector","type":"bytes4"}],"name":"SelectorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"string","name":"methodSignature","type":"string"},{"indexed":false,"internalType":"bool","name":"convertTo18Decimals","type":"bool"}],"name":"VaultRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"}],"name":"VaultRemoved","type":"event"},{"inputs":[],"name":"AMOUNT_PLACEHOLDER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AMOUNT_PLACEHOLDER_BYTES32","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"vault","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"bytes","name":"returnData","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"getAllowedSelector","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"getVaultConfig","outputs":[{"components":[{"internalType":"bool","name":"isRegistered","type":"bool"},{"internalType":"bool","name":"convertTo18Decimals","type":"bool"},{"internalType":"bool","name":"allowsNative","type":"bool"},{"internalType":"bytes4","name":"allowedSelector","type":"bytes4"}],"internalType":"struct VaultConfigLib.VaultConfig","name":"config","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"isVaultRegistered","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"string","name":"vaultABI","type":"string"},{"internalType":"bytes4","name":"allowedFunctionSelector","type":"bytes4"},{"internalType":"bool","name":"convertTo18Decimals","type":"bool"},{"internalType":"bool","name":"allowsNative","type":"bool"}],"name":"registerVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"removeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"bytes4","name":"newSelector","type":"bytes4"}],"name":"updateAllowedSelector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"vaultAllowsNative","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultConfigs","outputs":[{"internalType":"uint40","name":"","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"vaultRequires18Decimals","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
6080806040523461014557604051601f61167e38819003918201601f19168301916001600160401b03831184841017610131578084926020946040528339810103126100e157516001600160a01b0381168082036100dd576100d85750335b6001600160a01b031680156100c5575f80546001600160a01b031981168317825560405192916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360016002556114eb90816101938239f35b631e4fbdf760e01b5f525f60045260245ffd5b61005e565b5f80fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152608490fd5b634e487b7160e01b5f52604160045260245ffd5b62461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e63746960448201526137b760f11b6064820152608490fdfe60806040526004361015610015575b36610ab357005b5f3560e01c8063105a88e3146101105780632f9182cc1461010b57806331f7d964146101065780633d18b2af1461010157806342a6f7a5146100fc578063476b6acf146100f75780634bfc5014146100f2578063715018a6146100ed5780637f4c4847146100ca5780638da5cb5b146100e8578063b139012d146100e3578063cd867985146100de578063ceb68c23146100d9578063de1eb9a3146100d4578063f2fde38b146100cf5763fd7070460361000e575b6106e1565b610a2e565b610940565b6108c1565b6107b2565b610727565b610700565b61068a565b61064d565b610610565b6104de565b61049f565b610471565b6103ea565b610235565b60405162461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e63746960448201526137b760f11b6064820152608490fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152608490fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a20696e76616c6964207475706c65206f666673604482015261195d60f21b6064820152608490fd5b600435906001600160a01b038216820361021b57565b5f80fd5b602435906001600160a01b038216820361021b57565b34610277576020366003190112610272576001600160a01b03610256610205565b165f5260016020526020600160405f2054161515604051908152f35b610165565b610115565b60405162461bcd60e51b815260206004820152602b60248201525f5160206114965f395f51905f5260448201526a1c9c985e481bd9999cd95d60aa1b6064820152608490fd5b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff8211176102f857604052565b6102c2565b6040519061030c6080836102d6565b565b67ffffffffffffffff81116102f857601f01601f191660200190565b9291926103368261030e565b9161034460405193846102d6565b829481845281830111610360578281602093845f960137010152565b60405162461bcd60e51b815260206004820152602760248201527f414249206465636f64696e673a20696e76616c69642062797465206172726179604482015266040d8cadccee8d60cb1b6064820152608490fd5b602435906001600160e01b03198216820361021b57565b60643590811515820361021b57565b60843590811515820361021b57565b346102775760a036600319011261027257610403610205565b60243567ffffffffffffffff811161046c57366023820112156104675761043490369060248160040135910161032a565b60443591906001600160e01b03198316830361021b57610465926104566103cc565b9161045f6103db565b93610b0a565b005b61027c565b6101b5565b34610277575f36600319011261027257602060405173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8152f35b34610277576020366003190112610272576001600160a01b036104c0610205565b165f526001602052602064ffffffffff60405f205416604051908152f35b34610277576040366003190112610272576104f7610205565b6104ff6103b5565b610507611061565b6001600160a01b0382165f8181526001602052604090205490919061053e9061053a9064ffffffffff165b600116151590565b1590565b610601576001600160e01b031981169283156105f2576105b561059a6105cc9361058661057b8560018060a01b03165f52600160205260405f2090565b5464ffffffffff1690565b60ff1660d89190911c64ffffffff00161790565b6001600160a01b039092165f90815260016020526040902090565b9064ffffffffff1664ffffffffff19825416179055565b7fd2f6827debfb2832d419a5f1fcc2bf414c1e1df8fdd7a232336079a86d3da1815f80a3005b6342868c9b60e01b5f5260045ffd5b63775a7b0960e11b5f5260045ffd5b34610277576020366003190112610272576001600160a01b03610631610205565b165f5260016020526020600260405f2054161515604051908152f35b34610277576020366003190112610272576001600160a01b0361066e610205565b165f5260016020526020600460405f2054161515604051908152f35b34610277575f366003190112610272576106a2611061565b5f80546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610277575f3660031901126102725760206040516321524110198152f35b34610277575f366003190112610272575f546040516001600160a01b039091168152602090f35b34610277576020366003190112610272576001600160a01b03610748610205565b165f9081526001602090815260409091205460d81b6001600160e01b0319166040516001600160e01b03199091168152f35b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b9060206107af92818152019061077a565b90565b34610277576080366003190112610272576107cb610205565b6107d361021f565b60443567ffffffffffffffff811161046c573660238201121561046757806004013567ffffffffffffffff811161087b5736602482840101116108355761083193610825936024606435940191610c1b565b6040519182918261079e565b0390f35b60405162461bcd60e51b815260206004820152602b60248201525f5160206114965f395f51905f5260448201526a727261792073747269646560a81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602b60248201525f5160206114965f395f51905f5260448201526a0e4e4c2f240d8cadccee8d60ab1b6064820152608490fd5b34610277576020366003190112610272576108da610205565b6108e2611061565b6001600160a01b03165f81815260016020819052604090912054161561060157805f52600160205260405f2064ffffffffff1981541690557fe71f3a50e5ad81964f352c411f1d45e35438ecd1acecef59ac81d9fbbf6cbc0a5f80a2005b3461027757602036600319011261027257610959610205565b61096161102c565b506001600160a01b03165f90815260016020526040902054610831906109ed6109dc6109cc6109c364ffffffff0061099761102c565b600187161515815260028716151560208201526004871615156040820152951660081c63ffffffff1690565b63ffffffff1690565b60e01b6001600160e01b03191690565b6001600160e01b0319166060830152565b60405191829182919091606060808201938051151583526020810151151560208401526040810151151560408401528163ffffffff60e01b91015116910152565b3461027757602036600319011261027257610a47610205565b610a4f611061565b6001600160a01b03168015610aa0575f80546001600160a01b03198116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b631e4fbdf760e01b5f525f60045260245ffd5b60405162461bcd60e51b815260206004820152602960248201527f556e6b6e6f776e207369676e617475726520616e64206e6f2066616c6c6261636044820152681ac81919599a5b995960ba1b6064820152608490fd5b939291610b15611061565b6001600160a01b038516948515610bec57825115610bdd576001600160e01b03198216156105f2576001600160a01b0381165f908152600160205260409020610b61906105329061057b565b610bce576105b561059a7f55e854e53b29a09bfbe28c9e867d99a35dbcc693f17da80c10b4e4607d747a3a96610bb5610bba956109dc610b9f6102fd565b60018152938a1515602086015215156040850152565b611087565b610bc960405192839283610bfb565b0390a2565b6324ec133760e11b5f5260045ffd5b630364bbe960e61b5f5260045ffd5b630681d31960e51b5f5260045ffd5b90610c1360209194939460408452604084019061077a565b931515910152565b929093916002805414610efa57600280556001600160a01b0385165f908152600160205260409020610c4c9061057b565b936001851615610eeb576001600160a01b03169373eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8514908115610d875760041615610d785747938415610d69578410610d5a57610cb85f9392849386915b610cb3610cad36848461032a565b8b6111b0565b611297565b908214610d415760208151910184875af192610cd2610fe6565b935b15610d2257837f76511bb8950b82fe2ee5f747e5a7929769055ce5ade161da73b869147b1f5e3f91610d1460405192839260018060a01b03169583611015565b0390a39061030c6001600255565b60405163f8e68f2360e01b815280610d3d866004830161079e565b0390fd5b60208151910182875af192610d54610fe6565b93610cd4565b633b38932f60e11b5f5260045ffd5b63565dfaef60e11b5f5260045ffd5b637ca2885760e01b5f5260045ffd5b91859391933b15610ea8576040516370a0823160e01b81523360048201526020816024818a5afa908115610ea3575f91610ebc575b5080958110610ead57610dd18130338a6110d4565b610ddc81898961112b565b610de98194600216151590565b610dfe575b505f9391928493610cb892610c9f565b939192863b15610ea85760405163313ce56760e01b8152936020856004818b5afa928315610ea3575f9660ff610cb89589988991610e74575b501660128110610e4f575b5050925092945092610dee565b610e6c929450610e61610e6691610fa3565b610fc5565b90610fd3565b915f80610e42565b610e96915060203d602011610e9c575b610e8e81836102d6565b810190610f76565b5f610e37565b503d610e84565b610f6b565b610f09565b631762402160e11b5f5260045ffd5b610ede915060203d602011610ee4575b610ed681836102d6565b810190610f5c565b5f610dbc565b503d610ecc565b63077b4faf60e01b5f5260045ffd5b633ee5aeb560e01b5f5260045ffd5b60405162461bcd60e51b815260206004820152602560248201527f54617267657420636f6e747261637420646f6573206e6f7420636f6e7461696e60448201526420636f646560d81b6064820152608490fd5b90816020910312610272575190565b6040513d5f823e3d90fd5b90816020910312610272575160ff8116810361021b5790565b634e487b7160e01b5f52601160045260245ffd5b6012039060128211610fb157565b610f8f565b601f19810191908211610fb157565b604d8111610fb157600a0a90565b81810292918115918404141715610fb157565b3d15611010573d90610ff78261030e565b9161100560405193846102d6565b82523d5f602084013e565b606090565b6040906107af93928152816020820152019061077a565b604051906080820182811067ffffffffffffffff8211176102f8576040525f6060838281528260208201528260408201520152565b5f546001600160a01b0316330361107457565b63118cdaa760e01b5f523360045260245ffd5b5f9080516110cb575b60208101516110c1575b60408101516110b6575b6060015160d81c64ffffffff00161790565b6004909117906110a4565b906002179061109a565b60019150611090565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815261030c916111186084836102d6565b61136d565b9060208201809211610fb157565b916001600160a01b0383169190823b15610ea857604051636eb1769f60e11b81523060048201526001600160a01b038316602482015292602090849060449082905afa928315610ea3575f9361118f575b508201809211610fb15761030c926113c5565b6111a991935060203d602011610ee457610ed681836102d6565b915f61117c565b9060048151106112405760200151906112046111f764ffffffffff6111e58460018060a01b03165f52600160205260405f2090565b541660d81b6001600160e01b03191690565b6001600160e01b03191690565b6001600160e01b0319831603611218575050565b6375e81e2960e11b5f526001600160a01b03166004526001600160e01b03191660245260445ffd5b6040516316a434ff60e21b815260206004820152602860248201527f43616c6c6461746120746f6f2073686f727420666f722066756e6374696f6e2060448201526739b2b632b1ba37b960c11b6064820152608490fd5b6112a291369161032a565b60248151106112f357906004915b6112ba8151610fb6565b83116112ed57602083820101926321524110198451146112e7576112e09192935061111d565b91906112b0565b50915290565b91505090565b6040516316a434ff60e21b815260206004820152604560248201527f43616c6c206461746120697320746f6f2073686f727420746f20696e636c756460448201527f652073656c6563746f7220616e64206174206c65617374206f6e65207061726160648201526436b2ba32b960d91b608482015260a490fd5b905f602091828151910182855af115610f6b575f513d6113bc57506001600160a01b0381163b155b61139c5750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b60011415611395565b60405163095ea7b360e01b60208281019182526001600160a01b0385166024840152604480840196909652948252929390925f906114046064866102d6565b84519082855af15f51903d81611469575b501590505b61142357505050565b60405163095ea7b360e01b60208201526001600160a01b039390931660248401525f604480850191909152835261030c92611118906114636064826102d6565b8261136d565b15159050611489575061141a6001600160a01b0382163b15155b5f611415565b600161141a911461148356fe414249206465636f64696e673a20696e76616c69642063616c6c646174612061a26469706673582212201deaf67163941c3c8393bead2e891218660cca7b8cfb0b48852facf7142467fa64736f6c634300081b00330000000000000000000000007779ffb11d50fceae8e533b611b5cb5a1c1db3d4
Deployed Bytecode
0x60806040526004361015610015575b36610ab357005b5f3560e01c8063105a88e3146101105780632f9182cc1461010b57806331f7d964146101065780633d18b2af1461010157806342a6f7a5146100fc578063476b6acf146100f75780634bfc5014146100f2578063715018a6146100ed5780637f4c4847146100ca5780638da5cb5b146100e8578063b139012d146100e3578063cd867985146100de578063ceb68c23146100d9578063de1eb9a3146100d4578063f2fde38b146100cf5763fd7070460361000e575b6106e1565b610a2e565b610940565b6108c1565b6107b2565b610727565b610700565b61068a565b61064d565b610610565b6104de565b61049f565b610471565b6103ea565b610235565b60405162461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e63746960448201526137b760f11b6064820152608490fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152608490fd5b60405162461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a20696e76616c6964207475706c65206f666673604482015261195d60f21b6064820152608490fd5b600435906001600160a01b038216820361021b57565b5f80fd5b602435906001600160a01b038216820361021b57565b34610277576020366003190112610272576001600160a01b03610256610205565b165f5260016020526020600160405f2054161515604051908152f35b610165565b610115565b60405162461bcd60e51b815260206004820152602b60248201525f5160206114965f395f51905f5260448201526a1c9c985e481bd9999cd95d60aa1b6064820152608490fd5b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff8211176102f857604052565b6102c2565b6040519061030c6080836102d6565b565b67ffffffffffffffff81116102f857601f01601f191660200190565b9291926103368261030e565b9161034460405193846102d6565b829481845281830111610360578281602093845f960137010152565b60405162461bcd60e51b815260206004820152602760248201527f414249206465636f64696e673a20696e76616c69642062797465206172726179604482015266040d8cadccee8d60cb1b6064820152608490fd5b602435906001600160e01b03198216820361021b57565b60643590811515820361021b57565b60843590811515820361021b57565b346102775760a036600319011261027257610403610205565b60243567ffffffffffffffff811161046c57366023820112156104675761043490369060248160040135910161032a565b60443591906001600160e01b03198316830361021b57610465926104566103cc565b9161045f6103db565b93610b0a565b005b61027c565b6101b5565b34610277575f36600319011261027257602060405173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8152f35b34610277576020366003190112610272576001600160a01b036104c0610205565b165f526001602052602064ffffffffff60405f205416604051908152f35b34610277576040366003190112610272576104f7610205565b6104ff6103b5565b610507611061565b6001600160a01b0382165f8181526001602052604090205490919061053e9061053a9064ffffffffff165b600116151590565b1590565b610601576001600160e01b031981169283156105f2576105b561059a6105cc9361058661057b8560018060a01b03165f52600160205260405f2090565b5464ffffffffff1690565b60ff1660d89190911c64ffffffff00161790565b6001600160a01b039092165f90815260016020526040902090565b9064ffffffffff1664ffffffffff19825416179055565b7fd2f6827debfb2832d419a5f1fcc2bf414c1e1df8fdd7a232336079a86d3da1815f80a3005b6342868c9b60e01b5f5260045ffd5b63775a7b0960e11b5f5260045ffd5b34610277576020366003190112610272576001600160a01b03610631610205565b165f5260016020526020600260405f2054161515604051908152f35b34610277576020366003190112610272576001600160a01b0361066e610205565b165f5260016020526020600460405f2054161515604051908152f35b34610277575f366003190112610272576106a2611061565b5f80546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610277575f3660031901126102725760206040516321524110198152f35b34610277575f366003190112610272575f546040516001600160a01b039091168152602090f35b34610277576020366003190112610272576001600160a01b03610748610205565b165f9081526001602090815260409091205460d81b6001600160e01b0319166040516001600160e01b03199091168152f35b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b9060206107af92818152019061077a565b90565b34610277576080366003190112610272576107cb610205565b6107d361021f565b60443567ffffffffffffffff811161046c573660238201121561046757806004013567ffffffffffffffff811161087b5736602482840101116108355761083193610825936024606435940191610c1b565b6040519182918261079e565b0390f35b60405162461bcd60e51b815260206004820152602b60248201525f5160206114965f395f51905f5260448201526a727261792073747269646560a81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602b60248201525f5160206114965f395f51905f5260448201526a0e4e4c2f240d8cadccee8d60ab1b6064820152608490fd5b34610277576020366003190112610272576108da610205565b6108e2611061565b6001600160a01b03165f81815260016020819052604090912054161561060157805f52600160205260405f2064ffffffffff1981541690557fe71f3a50e5ad81964f352c411f1d45e35438ecd1acecef59ac81d9fbbf6cbc0a5f80a2005b3461027757602036600319011261027257610959610205565b61096161102c565b506001600160a01b03165f90815260016020526040902054610831906109ed6109dc6109cc6109c364ffffffff0061099761102c565b600187161515815260028716151560208201526004871615156040820152951660081c63ffffffff1690565b63ffffffff1690565b60e01b6001600160e01b03191690565b6001600160e01b0319166060830152565b60405191829182919091606060808201938051151583526020810151151560208401526040810151151560408401528163ffffffff60e01b91015116910152565b3461027757602036600319011261027257610a47610205565b610a4f611061565b6001600160a01b03168015610aa0575f80546001600160a01b03198116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b631e4fbdf760e01b5f525f60045260245ffd5b60405162461bcd60e51b815260206004820152602960248201527f556e6b6e6f776e207369676e617475726520616e64206e6f2066616c6c6261636044820152681ac81919599a5b995960ba1b6064820152608490fd5b939291610b15611061565b6001600160a01b038516948515610bec57825115610bdd576001600160e01b03198216156105f2576001600160a01b0381165f908152600160205260409020610b61906105329061057b565b610bce576105b561059a7f55e854e53b29a09bfbe28c9e867d99a35dbcc693f17da80c10b4e4607d747a3a96610bb5610bba956109dc610b9f6102fd565b60018152938a1515602086015215156040850152565b611087565b610bc960405192839283610bfb565b0390a2565b6324ec133760e11b5f5260045ffd5b630364bbe960e61b5f5260045ffd5b630681d31960e51b5f5260045ffd5b90610c1360209194939460408452604084019061077a565b931515910152565b929093916002805414610efa57600280556001600160a01b0385165f908152600160205260409020610c4c9061057b565b936001851615610eeb576001600160a01b03169373eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8514908115610d875760041615610d785747938415610d69578410610d5a57610cb85f9392849386915b610cb3610cad36848461032a565b8b6111b0565b611297565b908214610d415760208151910184875af192610cd2610fe6565b935b15610d2257837f76511bb8950b82fe2ee5f747e5a7929769055ce5ade161da73b869147b1f5e3f91610d1460405192839260018060a01b03169583611015565b0390a39061030c6001600255565b60405163f8e68f2360e01b815280610d3d866004830161079e565b0390fd5b60208151910182875af192610d54610fe6565b93610cd4565b633b38932f60e11b5f5260045ffd5b63565dfaef60e11b5f5260045ffd5b637ca2885760e01b5f5260045ffd5b91859391933b15610ea8576040516370a0823160e01b81523360048201526020816024818a5afa908115610ea3575f91610ebc575b5080958110610ead57610dd18130338a6110d4565b610ddc81898961112b565b610de98194600216151590565b610dfe575b505f9391928493610cb892610c9f565b939192863b15610ea85760405163313ce56760e01b8152936020856004818b5afa928315610ea3575f9660ff610cb89589988991610e74575b501660128110610e4f575b5050925092945092610dee565b610e6c929450610e61610e6691610fa3565b610fc5565b90610fd3565b915f80610e42565b610e96915060203d602011610e9c575b610e8e81836102d6565b810190610f76565b5f610e37565b503d610e84565b610f6b565b610f09565b631762402160e11b5f5260045ffd5b610ede915060203d602011610ee4575b610ed681836102d6565b810190610f5c565b5f610dbc565b503d610ecc565b63077b4faf60e01b5f5260045ffd5b633ee5aeb560e01b5f5260045ffd5b60405162461bcd60e51b815260206004820152602560248201527f54617267657420636f6e747261637420646f6573206e6f7420636f6e7461696e60448201526420636f646560d81b6064820152608490fd5b90816020910312610272575190565b6040513d5f823e3d90fd5b90816020910312610272575160ff8116810361021b5790565b634e487b7160e01b5f52601160045260245ffd5b6012039060128211610fb157565b610f8f565b601f19810191908211610fb157565b604d8111610fb157600a0a90565b81810292918115918404141715610fb157565b3d15611010573d90610ff78261030e565b9161100560405193846102d6565b82523d5f602084013e565b606090565b6040906107af93928152816020820152019061077a565b604051906080820182811067ffffffffffffffff8211176102f8576040525f6060838281528260208201528260408201520152565b5f546001600160a01b0316330361107457565b63118cdaa760e01b5f523360045260245ffd5b5f9080516110cb575b60208101516110c1575b60408101516110b6575b6060015160d81c64ffffffff00161790565b6004909117906110a4565b906002179061109a565b60019150611090565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815261030c916111186084836102d6565b61136d565b9060208201809211610fb157565b916001600160a01b0383169190823b15610ea857604051636eb1769f60e11b81523060048201526001600160a01b038316602482015292602090849060449082905afa928315610ea3575f9361118f575b508201809211610fb15761030c926113c5565b6111a991935060203d602011610ee457610ed681836102d6565b915f61117c565b9060048151106112405760200151906112046111f764ffffffffff6111e58460018060a01b03165f52600160205260405f2090565b541660d81b6001600160e01b03191690565b6001600160e01b03191690565b6001600160e01b0319831603611218575050565b6375e81e2960e11b5f526001600160a01b03166004526001600160e01b03191660245260445ffd5b6040516316a434ff60e21b815260206004820152602860248201527f43616c6c6461746120746f6f2073686f727420666f722066756e6374696f6e2060448201526739b2b632b1ba37b960c11b6064820152608490fd5b6112a291369161032a565b60248151106112f357906004915b6112ba8151610fb6565b83116112ed57602083820101926321524110198451146112e7576112e09192935061111d565b91906112b0565b50915290565b91505090565b6040516316a434ff60e21b815260206004820152604560248201527f43616c6c206461746120697320746f6f2073686f727420746f20696e636c756460448201527f652073656c6563746f7220616e64206174206c65617374206f6e65207061726160648201526436b2ba32b960d91b608482015260a490fd5b905f602091828151910182855af115610f6b575f513d6113bc57506001600160a01b0381163b155b61139c5750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b60011415611395565b60405163095ea7b360e01b60208281019182526001600160a01b0385166024840152604480840196909652948252929390925f906114046064866102d6565b84519082855af15f51903d81611469575b501590505b61142357505050565b60405163095ea7b360e01b60208201526001600160a01b039390931660248401525f604480850191909152835261030c92611118906114636064826102d6565b8261136d565b15159050611489575061141a6001600160a01b0382163b15155b5f611415565b600161141a911461148356fe414249206465636f64696e673a20696e76616c69642063616c6c646174612061a26469706673582212201deaf67163941c3c8393bead2e891218660cca7b8cfb0b48852facf7142467fa64736f6c634300081b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007779ffb11d50fceae8e533b611b5cb5a1c1db3d4
-----Decoded View---------------
Arg [0] : initialOwner (address): 0x7779FFB11d50fcEae8E533b611b5CB5A1C1db3d4
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007779ffb11d50fceae8e533b611b5cb5a1c1db3d4
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.