Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Minimal Proxy Contract for 0x0000000b3a0a6426d7184801ad89b4fd8969f7d9
Contract Name:
TradingVaultImplementation
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 500 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { BaseTransfersNativeInitiable } from "../../../base/BaseTransfersNative/v1/BaseTransfersNativeInitiable.sol";import { BaseSimpleSwapInitiable } from "../../../base/BaseSimpleSwapInitiable.sol";import { CoreAccessControlConfig } from "../../../base/BaseAccessControlInitiable.sol";import { BaseRecoverSignerInitiable } from "../../../base/BaseRecoverSignerInitiable.sol";import { CoreMulticall } from "../../../core/CoreMulticall/v1/CoreMulticall.sol";import {WETH9NativeWrapperInitiable,BaseNativeWrapperConfig} from "../../../modules/native-asset-wrappers/WETH9NativeWrapperInitiable.sol";import { ITradingVaultImplementation } from "./ITradingVaultImplementation.sol";contract TradingVaultImplementation isITradingVaultImplementation,WETH9NativeWrapperInitiable,BaseTransfersNativeInitiable,BaseSimpleSwapInitiable,CoreMulticall,BaseRecoverSignerInitiable{/// @notice Constructor on the implementation contract should call _disableInitializers()/// @dev https://forum.openzeppelin.com/t/what-does-disableinitializers-function-mean/28730/// @custom:oz-upgrades-unsafe-allow constructorconstructor() {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)pragma solidity ^0.8.20;/*** @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.** The initialization functions use a version number. Once a version number is used, it is consumed and cannot be* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in* case an upgrade adds a module that needs to be initialized.** For example:** [.hljs-theme-light.nopadding]* ```solidity* contract MyToken is ERC20Upgradeable {* function initialize() initializer public {* __ERC20_init("MyToken", "MTK");* }* }** contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)pragma solidity ^0.8.20;import {Initializable} from "../proxy/utils/Initializable.sol";/*** @dev Contract module that helps prevent reentrant calls to a function.** Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier* available, which can be applied to functions to make sure there are no nested* (reentrant) calls to them.** Note that because there is a single `nonReentrant` guard, functions marked as* `nonReentrant` may not call one another. This can be worked around by making* those functions `private`, and then adding `external` `nonReentrant` entry* points to them.** TIP: If you would like to learn more about reentrancy and alternative ways* to protect against it, check out our blog post* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].*/abstract contract ReentrancyGuardUpgradeable is Initializable {// 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
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)pragma solidity ^0.8.20;import {IAccessControl} from "./IAccessControl.sol";import {Context} from "../utils/Context.sol";import {ERC165} from "../utils/introspection/ERC165.sol";/*** @dev Contract module that allows children to implement role-based access* control mechanisms. This is a lightweight version that doesn't allow enumerating role* members except through off-chain means by accessing the contract event logs. Some* applications may benefit from on-chain enumerability, for those cases see* {AccessControlEnumerable}.** Roles are referred to by their `bytes32` identifier. These should be exposed* in the external API and be unique. The best way to achieve this is by* using `public constant` hash digests:** ```solidity* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");* ```** Roles can be used to represent a set of permissions. To restrict access to a* function call, use {hasRole}:
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)pragma solidity ^0.8.20;/*** @dev External interface of AccessControl declared to support ERC165 detection.*/interface IAccessControl {/*** @dev The `account` is missing a role.*/error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);/*** @dev The caller of a function is not the expected one.** NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.*/error AccessControlBadConfirmation();/*** @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.
1234567891011121314151617// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol)pragma solidity ^0.8.20;/*** @dev Interface of the ERC1271 standard signature validation method for* contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].*/interface IERC1271 {/*** @dev Should return whether the signature provided is valid for the provided data* @param hash Hash of the data to be signed* @param signature Signature byte array associated with _data*/function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)pragma solidity ^0.8.20;/*** @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].** Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't* need to send a transaction, and thus is not required to hold Ether at all.** ==== Security Considerations** There are two important considerations concerning the use of `permit`. The first is that a valid permit signature* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be* considered as an intention to spend the allowance in any specific way. The second is that because permits have* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be* generally recommended is:** ```solidity* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}* doThing(..., value);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)pragma solidity ^0.8.20;/*** @dev Interface of the ERC20 standard as defined in the EIP.*/interface IERC20 {/*** @dev Emitted when `value` tokens are moved from one account (`from`) to* another (`to`).** Note that `value` may be zero.*/event Transfer(address indexed from, address indexed to, uint256 value);/*** @dev Emitted when the allowance of a `spender` for an `owner` is set by* a call to {approve}. `value` is the new allowance.*/event Approval(address indexed owner, address indexed spender, uint256 value);/*** @dev Returns the value of tokens in existence.*/
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)pragma solidity ^0.8.20;import {IERC20} from "../IERC20.sol";import {IERC20Permit} from "../extensions/IERC20Permit.sol";import {Address} from "../../../utils/Address.sol";/*** @title SafeERC20* @dev Wrappers around ERC20 operations that throw on failure (when the token* contract returns false). Tokens that return no value (and instead revert or* throw on failure) are also supported, non-reverting calls are assumed to be* successful.* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.*/library SafeERC20 {using Address for address;/*** @dev An operation with an ERC20 token failed.*/error SafeERC20FailedOperation(address token);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)pragma solidity ^0.8.20;/*** @dev Collection of functions related to the address type*/library Address {/*** @dev The ETH balance of the account is not enough to perform the operation.*/error AddressInsufficientBalance(address account);/*** @dev There's no code at `target` (it is not a contract).*/error AddressEmptyCode(address target);/*** @dev A call to an address target failed. The target may have reverted.*/error FailedInnerCall();/*** @dev Replacement for Solidity's `transfer`: sends `amount` wei to
1234567891011121314151617181920212223242526// 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;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)pragma solidity ^0.8.20;/*** @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.** These functions can be used to verify that a message was signed by the holder* of the private keys of a given address.*/library ECDSA {enum RecoverError {NoError,InvalidSignature,InvalidSignatureLength,InvalidSignatureS}/*** @dev The signature derives the `address(0)`.*/error ECDSAInvalidSignature();/*** @dev The signature has an invalid length.
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)pragma solidity ^0.8.20;import {IERC165} from "./IERC165.sol";/*** @dev Implementation of the {IERC165} interface.** Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check* for the additional interface id that will be supported. For example:** ```solidity* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);* }* ```*/abstract contract ERC165 is IERC165 {/*** @dev See {IERC165-supportsInterface}.*/function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {return interfaceId == type(IERC165).interfaceId;}
12345678910111213141516171819202122232425// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)pragma solidity ^0.8.20;/*** @dev Interface of the ERC165 standard, as defined in the* https://eips.ethereum.org/EIPS/eip-165[EIP].** Implementers can declare support of contract interfaces, which can then be* queried by others ({ERC165Checker}).** For an implementation, see {ERC165}.*/interface IERC165 {/*** @dev Returns true if this contract implements the interface defined by* `interfaceId`. See the corresponding* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]* to learn more about how these ids are created.** This function call must use less than 30 000 gas.*/function supportsInterface(bytes4 interfaceId) external view returns (bool);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import {CoreAccessControlInitiable,CoreAccessControlConfig} from "../core/CoreAccessControl/v1/CoreAccessControlInitiable.sol";import { CoreStopGuardian } from "../core/CoreStopGuardian/v1/CoreStopGuardian.sol";import { CoreStopGuardianTrading } from "../core/CoreStopGuardianTrading/v1/CoreStopGuardianTrading.sol";import { DefinitiveConstants } from "../core/libraries/DefinitiveConstants.sol";import { ICoreSimpleSwapV1 } from "../core/CoreSimpleSwap/v1/ICoreSimpleSwapV1.sol";import { InvalidMethod } from "../core/libraries/DefinitiveErrors.sol";import { SignatureCheckerLib } from "../tools/SoladySnippets/SignatureCheckerLib.sol";abstract contract BaseAccessControlInitiable is CoreAccessControlInitiable, CoreStopGuardian, CoreStopGuardianTrading {/*** @dev* Modifiers inherited from CoreAccessControl:* onlyDefinitive* onlyWhitelisted* onlyClientAdmin* onlyDefinitiveAdmin** Modifiers inherited from CoreStopGuardian:* stopGuarded
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { BaseAccessControlInitiable } from "./BaseAccessControlInitiable.sol";import { DefinitiveAssets, IERC20 } from "../core/libraries/DefinitiveAssets.sol";import { DefinitiveConstants } from "../core/libraries/DefinitiveConstants.sol";import { InvalidFeePercent } from "../core/libraries/DefinitiveErrors.sol";import { IGlobalGuardian } from "../tools/GlobalGuardian/IGlobalGuardian.sol";struct CoreFeesConfig {address payable feeAccount;}abstract contract BaseFeesInitiable is BaseAccessControlInitiable {using DefinitiveAssets for IERC20;function _handleFeesOnAmount(address token, uint256 amount, uint256 feePct) internal returns (uint256 feeAmount) {uint256 mMaxFeePCT = DefinitiveConstants.MAX_FEE_PCT;if (feePct > mMaxFeePCT) {revert InvalidFeePercent();}feeAmount = (amount * feePct) / mMaxFeePCT;if (feeAmount == 0) {return feeAmount;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { BaseAccessControlInitiable } from "../../BaseAccessControlInitiable.sol";import { IBaseNativeWrapperV1 } from "./IBaseNativeWrapperV1.sol";import { DefinitiveAssets, IERC20 } from "../../../core/libraries/DefinitiveAssets.sol";struct BaseNativeWrapperConfig {address payable wrappedNativeAssetAddress;}abstract contract BaseNativeWrapperInitiable is IBaseNativeWrapperV1, BaseAccessControlInitiable {using DefinitiveAssets for IERC20;/// @custom:storage-location erc7201:definitive.storage.BaseNativeWrapperstruct BaseNativeWrapperStorage {address payable wrappedNativeAssetAddress;}// keccak256(abi.encode(uint256(keccak256("definitive.storage.BaseNativeWrapper")) - 1)) & ~bytes32(uint256(0xff))bytes32 private constant BaseNativeWrapperStorageLocation =0x57fbe06c102296dbdfaa9e064bb0d9f51d09253320913950d5de84e9a7e6e100;function _getBaseNativeWrapperStorage()privatepure
1234567891011121314// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;interface IBaseNativeWrapperV1 {event NativeAssetWrap(address actor, uint256 amount, bool indexed wrappingToNative);function WRAPPED_NATIVE_ASSET_ADDRESS() external view returns (address payable);function wrap(uint256 amount) external;function unwrap(uint256 amount) external;function unwrapAll() external;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { IERC1271 } from "@openzeppelin/contracts/interfaces/IERC1271.sol";import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";import { BaseAccessControlInitiable } from "./BaseAccessControlInitiable.sol";import { AccountNotAdmin, InvalidSignature } from "../core/libraries/DefinitiveErrors.sol";/*** @title BaseRecoverSignerInitiable* @author WardenJakx* @notice `isValidSignature` ensures the signer is a valid client*/abstract contract BaseRecoverSignerInitiable is BaseAccessControlInitiable, IERC1271 {// bytes4(keccak256("isValidSignature(bytes32,bytes)")bytes4 internal constant EIP_1271_RETURN_VALUE = 0x1626ba7e;/*** @notice Verifies that the signer is the owner of the signing contract.*/function isValidSignature(bytes32 _hash, bytes calldata _encodedSignature) external view override returns (bytes4) {(address clientAdminAddress, bytes memory signature) = abi.decode(_encodedSignature, (address, bytes));if (!hasRole(DEFAULT_ADMIN_ROLE, clientAdminAddress)) {revert AccountNotAdmin(clientAdminAddress);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { BaseFeesInitiable } from "./BaseFeesInitiable.sol";import { CoreSimpleSwapInitiable, SwapPayload } from "../core/CoreSimpleSwap/v1/CoreSimpleSwapInitiable.sol";import { DefinitiveConstants } from "../core/libraries/DefinitiveConstants.sol";import { InvalidFeePercent, SlippageExceeded } from "../core/libraries/DefinitiveErrors.sol";import { ICoreSwapHandlerV1 } from "../core/CoreSwapHandler/ICoreSwapHandlerV1.sol";abstract contract BaseSimpleSwapInitiable is BaseFeesInitiable, CoreSimpleSwapInitiable {function swap(SwapPayload[] memory payloads,address outputToken,uint256 amountOutMin,uint256 feePct) external payable override onlyDefinitive nonReentrant stopGuarded tradingEnabled returns (uint256) {if (feePct > DefinitiveConstants.MAX_FEE_PCT) {revert InvalidFeePercent();}(uint256[] memory inputAmounts, uint256 outputAmount) = _swap(payloads, outputToken);if (outputAmount < amountOutMin) {revert SlippageExceeded(outputAmount, amountOutMin);}address[] memory swapTokens = new address[](payloads.length);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { CoreDeposit } from "../../../core/CoreDeposit/v1/CoreDeposit.sol";import { CoreWithdraw } from "../../../core/CoreWithdraw/v1/CoreWithdraw.sol";import { BaseAccessControlInitiable } from "../../BaseAccessControlInitiable.sol";abstract contract BaseTransfersInitiable is CoreDeposit, CoreWithdraw, BaseAccessControlInitiable {function deposit(uint256[] calldata amounts,address[] calldata erc20Tokens) external payable virtual override onlyClientAdmin nonReentrant stopGuarded {return _deposit(amounts, erc20Tokens);}function withdraw(uint256 amount,address erc20Token) public virtual override onlyClientAdmin nonReentrant stopGuarded withdrawalsEnabled returns (bool) {return _withdraw(amount, erc20Token);}function withdrawTo(uint256 amount,address erc20Token,address to
1234567891011121314151617181920// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { IBaseNativeWrapperV1 } from "../../BaseNativeWrapper/v1/IBaseNativeWrapperV1.sol";import { BaseTransfersInitiable } from "../../BaseTransfers/v1/BaseTransfersInitiable.sol";import { CoreTransfersNative } from "../../../core/CoreTransfersNative/v1/CoreTransfersNative.sol";abstract contract BaseTransfersNativeInitiable is IBaseNativeWrapperV1, CoreTransfersNative, BaseTransfersInitiable {function deposit(uint256[] calldata amounts,address[] calldata assetAddresses) external payable override onlyClientAdmin nonReentrant stopGuarded {_depositNativeAndERC20(amounts, assetAddresses);emit Deposit(_msgSender(), assetAddresses, amounts);}function supportsNativeAssets() public pure virtual override returns (bool) {return true;}}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { AccessControl as OZAccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";import { ICoreAccessControlV1, CoreAccessControlConfig } from "./ICoreAccessControlV1.sol";import { AccountNotAdmin, AccountNotWhitelisted, AccountMissingRole } from "../../libraries/DefinitiveErrors.sol";import { IGlobalGuardian } from "../../../tools/GlobalGuardian/IGlobalGuardian.sol";import { CoreGlobalGuardian } from "../../CoreGlobalGuardian/CoreGlobalGuardian.sol";import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";import { CoreAccountAbstraction, Unauthorized } from "../../CoreAccountAbstraction/CoreAccountAbstraction.sol";abstract contract CoreAccessControlInitiable isICoreAccessControlV1,OZAccessControl,Initializable,CoreGlobalGuardian,ReentrancyGuardUpgradeable,CoreAccountAbstraction{/// @custom:storage-location erc7201:definitive.storage.CoreAccessControlstruct CoreAccessControlStorage {mapping(bytes32 => RoleDataPasskeys) roles;}struct RoleDataPasskeys {
123456789101112131415161718192021// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { IAccessControl } from "@openzeppelin/contracts/access/IAccessControl.sol";struct CoreAccessControlConfig {address admin;address[] client;address[] traders;// admin = clientsbytes[] passkeyClients;bytes[] passkeyTraders;}interface ICoreAccessControlV1 is IAccessControl {function ROLE_CLIENT() external returns (bytes32);function ROLE_DEFINITIVE() external returns (bytes32);function ROLE_DEFINITIVE_ADMIN() external returns (bytes32);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.8.4;// import { SignatureCheckerLib } from "../../tools/SoladySnippets/SignatureCheckerLib.sol";import { DefinitiveConstants } from "../libraries/DefinitiveConstants.sol";error Unauthorized();abstract contract CoreAccountAbstraction {/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*//* STRUCTS *//*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*//// @dev The packed ERC4337 user operation (userOp) struct.struct PackedUserOperation {address sender;uint256 nonce;bytes initCode; // Factory address and `factoryData` (or empty).bytes callData;bytes32 accountGasLimits; // `verificationGas` (16 bytes) and `callGas` (16 bytes).uint256 preVerificationGas;bytes32 gasFees; // `maxPriorityFee` (16 bytes) and `maxFeePerGas` (16 bytes).bytes paymasterAndData; // Paymaster fields (or empty).bytes signature;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { ICoreDepositV1 } from "./ICoreDepositV1.sol";import { Context } from "@openzeppelin/contracts/utils/Context.sol";import { DefinitiveAssets, IERC20 } from "../../libraries/DefinitiveAssets.sol";import { InvalidInputs } from "../../libraries/DefinitiveErrors.sol";abstract contract CoreDeposit is ICoreDepositV1, Context {using DefinitiveAssets for IERC20;function deposit(uint256[] calldata amounts, address[] calldata assetAddresses) external payable virtual;function _deposit(uint256[] calldata amounts, address[] calldata erc20Tokens) internal virtual {_depositERC20(amounts, erc20Tokens);emit Deposit(_msgSender(), erc20Tokens, amounts);}function _depositERC20(uint256[] calldata amounts, address[] calldata erc20Tokens) internal {uint256 amountsLength = amounts.length;if (amountsLength != erc20Tokens.length) {revert InvalidInputs();}
12345678// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;interface ICoreDepositV1 {event Deposit(address indexed actor, address[] assetAddresses, uint256[] amounts);function deposit(uint256[] calldata amounts, address[] calldata assetAddresses) external payable;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;abstract contract CoreGlobalGuardian {event GlobalTradeGuardianUpdate(address indexed globalTradeGuardian);/// @custom:storage-location erc7201:definitive.storage.CoreGlobalGuardianstruct CoreGlobalGuardianStorage {address GLOBAL_TRADE_GUARDIAN;}/// keccak256(abi.encode(uint256(keccak256("definitive.storage.CoreGlobalGuardian"))- 1)) & ~bytes32(uint256(0xff))bytes32 private constant CoreGlobalGuardianStorageLocation =0x96888095fca464b4a45fa21ec2cd73681252b1aee41fb5e30dbff9a53008bb00;function _getCoreGlobalGuardianStorage() private pure returns (CoreGlobalGuardianStorage storage $) {assembly {$.slot := CoreGlobalGuardianStorageLocation}}function GLOBAL_TRADE_GUARDIAN() public view returns (address) {CoreGlobalGuardianStorage storage $ = _getCoreGlobalGuardianStorage();return $.GLOBAL_TRADE_GUARDIAN;}
12345678910111213141516171819202122232425// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { ICoreMulticallV1 } from "./ICoreMulticallV1.sol";import { Address } from "@openzeppelin/contracts/utils/Address.sol";import { DefinitiveAssets } from "../../libraries/DefinitiveAssets.sol";/* solhint-disable max-line-length *//*** @notice Implements openzeppelin/contracts/utils/Multicall.sol* Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/5b027e517e6aee69f4b4b2f5e78274ac8ee53513/contracts/utils/Multicall.sol solhint-disable max-line-length*//* solhint-enable max-line-length */abstract contract CoreMulticall is ICoreMulticallV1 {/*** @dev Receives and executes a batch of function calls on this contract.*/function multicall(bytes[] calldata data) external returns (bytes[] memory results) {uint256 dataLength = data.length;results = new bytes[](dataLength);for (uint256 i; i < dataLength; ) {results[i] = Address.functionDelegateCall(address(this), data[i]);unchecked {++i;}
12345678// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;interface ICoreMulticallV1 {function multicall(bytes[] calldata data) external returns (bytes[] memory results);function getBalance(address assetAddress) external view returns (uint256);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { ICoreSimpleSwapV1 } from "./ICoreSimpleSwapV1.sol";import { DefinitiveAssets, IERC20 } from "../../libraries/DefinitiveAssets.sol";import { Context } from "@openzeppelin/contracts/utils/Context.sol";import { CallUtils } from "../../../tools/BubbleReverts/BubbleReverts.sol";import { DefinitiveConstants } from "../../libraries/DefinitiveConstants.sol";import {InvalidSwapHandler,InsufficientSwapTokenBalance,SwapTokenIsOutputToken,InvalidOutputToken,InvalidReportedOutputAmount,InvalidExecutedOutputAmount} from "../../libraries/DefinitiveErrors.sol";import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";import { SwapPayload } from "./ICoreSimpleSwapV1.sol";import { CoreGlobalGuardian } from "../../CoreGlobalGuardian/CoreGlobalGuardian.sol";import { IGlobalGuardian } from "../../../tools/GlobalGuardian/IGlobalGuardian.sol";struct CoreSimpleSwapConfig {address[] swapHandlers;}abstract contract CoreSimpleSwapInitiable is ICoreSimpleSwapV1, Context, Initializable, CoreGlobalGuardian {
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;struct SwapPayload {address handler;uint256 amount; // set 0 for maximum available balanceaddress swapToken;uint256 amountOutMin;bool isDelegate;bytes handlerCalldata;bytes signature;}interface ICoreSimpleSwapV1 {event SwapHandlerUpdate(address actor, address swapHandler, bool isEnabled);event SwapHandled(address[] swapTokens,uint256[] swapAmounts,address outputToken,uint256 outputAmount,uint256 feeAmount);function swap(SwapPayload[] memory payloads,address outputToken,
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { ICoreStopGuardianV1 } from "./ICoreStopGuardianV1.sol";import { Context } from "@openzeppelin/contracts/utils/Context.sol";import { StopGuardianEnabled } from "../../libraries/DefinitiveErrors.sol";abstract contract CoreStopGuardian is ICoreStopGuardianV1, Context {/// @custom:storage-location erc7201:definitive.storage.CoreStopGuardianstruct CoreStopGuardianStorage {bool stopGuardianEnabled;}// keccak256(abi.encode(uint256(keccak256("definitive.storage.CoreStopGuardian")) - 1)) & ~bytes32(uint256(0xff))bytes32 private constant CoreStopGuardianStorageLocation =0x6e256963d8788aaa49f4ac4e7631ab95aeec255e6d6477beec524cf8dfccec00;function _getCoreStopGuardianStorage() private pure returns (CoreStopGuardianStorage storage $) {assembly {$.slot := CoreStopGuardianStorageLocation}}// recommended for every public/external functionmodifier stopGuarded() {
123456789101112// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;interface ICoreStopGuardianV1 {event StopGuardianUpdate(address indexed actor, bool indexed isEnabled);function STOP_GUARDIAN_ENABLED() external view returns (bool);function enableStopGuardian() external;function disableStopGuardian() external;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { ICoreStopGuardianTradingV1 } from "./ICoreStopGuardianTradingV1.sol";import { Context } from "@openzeppelin/contracts/utils/Context.sol";import { WithdrawalsDisabled, TradingDisabled, GlobalStopGuardianEnabled } from "../../libraries/DefinitiveErrors.sol";import { IGlobalGuardian } from "../../../tools/GlobalGuardian/IGlobalGuardian.sol";import { CoreGlobalGuardian } from "../../CoreGlobalGuardian/CoreGlobalGuardian.sol";abstract contract CoreStopGuardianTrading is ICoreStopGuardianTradingV1, Context, CoreGlobalGuardian {/// @custom:storage-location erc7201:definitive.storage.CoreStopGuardianTradingstruct CoreStopGuardianTradingStorage {bool TRADING_GUARDIAN_TRADING_DISABLED;bool TRADING_GUARDIAN_WITHDRAWALS_DISABLED;}/* solhint-disable max-line-length */// keccak256(abi.encode(uint256(keccak256("definitive.storage.CoreStopGuardianTrading")) - 1)) & ~bytes32(uint256(0xff))bytes32 private constant CoreStopGuardianTradingStorageLocation =0x16cbd83eaf0105ad9cb99491311ec69c270710363d0a5092df3b41a81f4a9400;/* solhint-enable max-line-length */function _getCoreStopGuardianTradingStorage() private pure returns (CoreStopGuardianTradingStorage storage $) {assembly {
1234567// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;interface ICoreStopGuardianTradingV1 {event TradingDisabledUpdate(address indexed actor, bool indexed isEnabled);event WithdrawalsDisabledUpdate(address indexed actor, bool indexed isEnabled);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;interface ICoreSwapHandlerV1 {event Swap(address indexed actor,address indexed inputToken,uint256 inputAmount,address indexed outputToken,uint256 outputAmount);struct SwapParams {address inputAssetAddress;uint256 inputAmount;address outputAssetAddress;uint256 minOutputAmount;bytes data;bytes signature;}function swapCall(SwapParams calldata params) external payable returns (uint256 amountOut, address outputAsset);function swapDelegate(SwapParams calldata params) external payable returns (uint256 amountOut, address outputAsset);function swapUsingValidatedPathCall(
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { Context } from "@openzeppelin/contracts/utils/Context.sol";import { ICoreTransfersNativeV1 } from "./ICoreTransfersNativeV1.sol";import { DefinitiveAssets, IERC20 } from "../../libraries/DefinitiveAssets.sol";import { DefinitiveConstants } from "../../libraries/DefinitiveConstants.sol";import { InvalidInputs, InvalidMsgValue, InvalidAddress } from "../../libraries/DefinitiveErrors.sol";abstract contract CoreTransfersNative is ICoreTransfersNativeV1, Context {using DefinitiveAssets for IERC20;/*** @notice Allows contract to receive native assets*/receive() external payable virtual {emit NativeTransfer(_msgSender(), msg.value);}function _depositNativeAndERC20(uint256[] calldata amounts, address[] calldata assetAddresses) internal virtual {uint256 assetAddressesLength = assetAddresses.length;if (amounts.length != assetAddressesLength) {revert InvalidInputs();}
1234567891011// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;interface ICoreTransfersNativeV1 {/*** @dev Emitted when `value` native asset is received by the contract*/event NativeTransfer(address indexed from, uint256 value);receive() external payable;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { ICoreWithdrawV1 } from "./ICoreWithdrawV1.sol";import { DefinitiveAssets, IERC20 } from "../../libraries/DefinitiveAssets.sol";import { Context } from "@openzeppelin/contracts/utils/Context.sol";import { DefinitiveConstants } from "../../libraries/DefinitiveConstants.sol";abstract contract CoreWithdraw is ICoreWithdrawV1, Context {using DefinitiveAssets for IERC20;function supportsNativeAssets() public pure virtual returns (bool);function withdraw(uint256 amount, address erc20Token) public virtual returns (bool);function withdrawTo(uint256 amount, address erc20Token, address to) public virtual returns (bool);function _withdraw(uint256 amount, address erc20Token) internal returns (bool) {return _withdrawTo(amount, erc20Token, _msgSender());}function _withdrawTo(uint256 amount, address erc20Token, address to) internal returns (bool success) {if (erc20Token == DefinitiveConstants.NATIVE_ASSET_ADDRESS) {DefinitiveAssets.safeTransferETH(payable(to), amount);} else {IERC20(erc20Token).safeTransfer(to, amount);
1234567891011121314// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;interface ICoreWithdrawV1 {event Withdrawal(address indexed erc20Token, uint256 amount, address indexed recipient);function withdrawAll(address[] calldata tokens) external returns (bool);function withdrawAllTo(address[] calldata tokens, address to) external returns (bool);function supportsNativeAssets() external pure returns (bool);function withdraw(uint256 amount, address erc20Token) external returns (bool);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { IERC20, SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";import { SafeTransferLib } from "solmate/src/utils/SafeTransferLib.sol";import { DefinitiveConstants } from "./DefinitiveConstants.sol";import { InsufficientBalance, InvalidAmount, InvalidAmounts, InvalidERC20Address } from "./DefinitiveErrors.sol";/*** @notice Contains methods used throughout the Definitive contracts* @dev This file should only be used as an internal library.*/library DefinitiveAssets {/*** @dev Checks if an address is a valid ERC20 token*/modifier onlyValidERC20(address erc20Token) {if (address(erc20Token) == DefinitiveConstants.NATIVE_ASSET_ADDRESS) {revert InvalidERC20Address();}_;}////////////////////////////////////////////////////////////////////////////////////////////////////
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;/*** @notice Contains constants used throughout the Definitive contracts* @dev This file should only be used as an internal library.*/library DefinitiveConstants {/*** @notice Maximum fee percentage*/uint256 internal constant MAX_FEE_PCT = 10000;/*** @notice Address to signify native assets*/address internal constant NATIVE_ASSET_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;/*** @notice Maximum number of swaps allowed per block*/uint8 internal constant MAX_SWAPS_PER_BLOCK = 25;struct Assets {uint256[] amounts;address[] addresses;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;/*** @notice Contains all errors used throughout the Definitive contracts* @dev This file should only be used as an internal library.* @dev When adding a new error, add alphabetically*/error AccountMissingRole(address _account, bytes32 _role);error AccountNotAdmin(address);error AccountNotWhitelisted(address);error AddLiquidityFailed();error AlreadyDeployed();error AlreadyInitialized();error BytecodeEmpty();error DeadlineExceeded();error DeployInitFailed();error DeployFailed();error BorrowFailed(uint256 errorCode);error DecollateralizeFailed(uint256 errorCode);error DepositMoreThanMax();error EmptyBytecode();error EnterAllFailed();error EnforcedSafeLTV(uint256 invalidLTV);error ExceededMaxDelta();
1234567891011121314151617181920212223// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import {BaseNativeWrapperInitiable,BaseNativeWrapperConfig} from "../../base/BaseNativeWrapper/v1/BaseNativeWrapperInitiable.sol";import { IWETH9 } from "../../vendor/interfaces/IWETH9.sol";abstract contract WETH9NativeWrapperInitiable is BaseNativeWrapperInitiable {function __WETH9NativeWrapperInitiable__init(BaseNativeWrapperConfig calldata config) internal onlyInitializing {__BaseNativeWrapperInitiable__init(config);}function _wrap(uint256 amount) internal override {// slither-disable-next-line arbitrary-send-ethIWETH9(WRAPPED_NATIVE_ASSET_ADDRESS()).deposit{ value: amount }();}function _unwrap(uint256 amount) internal override {IWETH9(WRAPPED_NATIVE_ASSET_ADDRESS()).withdraw(amount);}}
12345678910111213// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;import { CoreAccessControlConfig } from "../../../base/BaseAccessControlInitiable.sol";import { BaseNativeWrapperConfig } from "../../../modules/native-asset-wrappers/WETH9NativeWrapperInitiable.sol";interface ITradingVaultImplementation {function initialize(BaseNativeWrapperConfig calldata baseNativeWrapperConfig,CoreAccessControlConfig calldata coreAccessControlConfig,address _globalTradeGuardianOverride) external;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: AGPLv3pragma solidity >=0.8.20;import { InvalidCalldata } from "../../core/libraries/DefinitiveErrors.sol";/*** @title Call utilities library that is absent from the OpenZeppelin* @author Superfluid* Forked from* https://github.com/superfluid-finance/protocol-monorepo/blob* /d473b4876a689efb3bbb05552040bafde364a8b2/packages/ethereum-contracts/contracts/libs/CallUtils.sol* (Separated by 2 lines to prevent going over 120 character per line limit)*/library CallUtils {/// @dev Bubble up the revert from the returnedData (supports Panic, Error & Custom Errors)/// @notice This is needed in order to provide some human-readable revert message from a call/// @param returnedData Response of the callfunction revertFromReturnedData(bytes memory returnedData) internal pure {if (returnedData.length < 4) {// case 1: catch allrevert("CallUtils: target revert()"); // solhint-disable-line custom-errors} else {bytes4 errorSelector;// solhint-disable-next-line no-inline-assemblyassembly {errorSelector := mload(add(returnedData, 0x20))
123456789101112131415161718192021222324// SPDX-License-Identifier: UNLICENSEDpragma solidity >=0.8.20;interface IGlobalGuardian {function disable(bytes32 keyHash) external;function enable(bytes32 keyHash) external;function functionalityIsDisabled(bytes32 keyHash) external view returns (bool);function accountIsPerformer(address _account) external view returns (bool);function accountIsSwapHandler(address _account) external view returns (bool);function isDefinitiveAdmin() external view returns (bool);function isHandlerManager() external view returns (bool);function feeAccount() external view returns (address payable);function accountIsDefinitiveAdmin(address _account) external view returns (bool);function accountIsHandlerManager(address _account) external view returns (bool);}
12345678910111213141516171819202122232425// SPDX-License-Identifier: MITpragma solidity ^0.8.4;/* solhint-disable no-inline-assembly *//// @notice Signature verification helper that supports both ECDSA signatures from EOAs/// and ERC1271 signatures from smart contract wallets like Argent and Gnosis safe./// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SignatureCheckerLib.sol)/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/SignatureChecker.sol)////// @dev Note:/// - The signature checking functions use the ecrecover precompile (0x1)./// - The `bytes memory signature` variants use the identity precompile (0x4)/// to copy memory internally./// - Unlike ECDSA signatures, contract signatures are revocable./// - As of Solady version 0.0.134, all `bytes signature` variants accept both/// regular 65-byte `(r, s, v)` and EIP-2098 `(r, vs)` short form signatures./// See: https://eips.ethereum.org/EIPS/eip-2098/// This is for calldata efficiency on smart accounts prevalent on L2s.////// WARNING! Do NOT use signatures as unique identifiers:/// - Use a nonce in the digest to prevent replay attacks on the same contract./// - Use EIP-712 for the digest to prevent replay attacks across different chains and contracts./// EIP-712 also enables readable signing of typed data for better user safety./// This implementation does NOT check if a signature is non-malleable.
12345678910// SPDX-License-Identifier: MITpragma solidity >=0.8.20;interface IWETH9 {function balanceOf(address) external view returns (uint256);function deposit() external payable;function withdraw(uint256 wad) external;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: AGPL-3.0-onlypragma solidity >=0.8.0;/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation./// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.abstract contract ERC20 {/*//////////////////////////////////////////////////////////////EVENTS//////////////////////////////////////////////////////////////*/event Transfer(address indexed from, address indexed to, uint256 amount);event Approval(address indexed owner, address indexed spender, uint256 amount);/*//////////////////////////////////////////////////////////////METADATA STORAGE//////////////////////////////////////////////////////////////*/string public name;string public symbol;uint8 public immutable decimals;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: AGPL-3.0-onlypragma solidity >=0.8.0;import {ERC20} from "../tokens/ERC20.sol";/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values./// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer./// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.library SafeTransferLib {/*//////////////////////////////////////////////////////////////ETH OPERATIONS//////////////////////////////////////////////////////////////*/function safeTransferETH(address to, uint256 amount) internal {bool success;/// @solidity memory-safe-assemblyassembly {// Transfer the ETH and store if it succeeded or not.success := call(gas(), to, amount, 0, 0, 0, 0)}require(success, "ETH_TRANSFER_FAILED");}
123456789101112131415161718192021222324{"evmVersion": "paris","metadata": {"bytecodeHash": "none"},"optimizer": {"enabled": true,"runs": 500},"viaIR": false,"outputSelection": {"*": {"*": ["evm.bytecode","evm.deployedBytecode","devdoc","userdoc","metadata","abi"]}},"libraries": {}}
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bytes32","name":"_role","type":"bytes32"}],"name":"AccountMissingRole","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"AccountNotAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"AccountNotWhitelisted","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"FnSelectorNotRecognized","type":"error"},{"inputs":[],"name":"GlobalStopGuardianEnabled","type":"error"},{"inputs":[],"name":"InsufficientSwapTokenBalance","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidERC20Address","type":"error"},{"inputs":[],"name":"InvalidExecutedOutputAmount","type":"error"},{"inputs":[],"name":"InvalidFeePercent","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidInputs","type":"error"},{"inputs":[{"internalType":"bytes4","name":"methodSig","type":"bytes4"}],"name":"InvalidMethod","type":"error"},{"inputs":[],"name":"InvalidMsgValue","type":"error"},{"inputs":[],"name":"InvalidOutputToken","type":"error"},{"inputs":[],"name":"InvalidReportedOutputAmount","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidSwapHandler","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"uint256","name":"_outputAmount","type":"uint256"},{"internalType":"uint256","name":"_outputAmountMin","type":"uint256"}],"name":"SlippageExceeded","type":"error"},{"inputs":[],"name":"StopGuardianEnabled","type":"error"},{"inputs":[],"name":"SwapTokenIsOutputToken","type":"error"},{"inputs":[],"name":"TradingDisabled","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"WithdrawalsDisabled","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"actor","type":"address"},{"indexed":false,"internalType":"address[]","name":"assetAddresses","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"globalTradeGuardian","type":"address"}],"name":"GlobalTradeGuardianUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"actor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"bool","name":"wrappingToNative","type":"bool"}],"name":"NativeAssetWrap","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"NativeTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"actor","type":"address"},{"indexed":true,"internalType":"bool","name":"isEnabled","type":"bool"}],"name":"StopGuardianUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"swapTokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"swapAmounts","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"outputAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"SwapHandled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"actor","type":"address"},{"indexed":false,"internalType":"address","name":"swapHandler","type":"address"},{"indexed":false,"internalType":"bool","name":"isEnabled","type":"bool"}],"name":"SwapHandlerUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"actor","type":"address"},{"indexed":true,"internalType":"bool","name":"isEnabled","type":"bool"}],"name":"TradingDisabledUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc20Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"Withdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"actor","type":"address"},{"indexed":true,"internalType":"bool","name":"isEnabled","type":"bool"}],"name":"WithdrawalsDisabledUpdate","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_ACCOUNT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GLOBAL_TRADE_GUARDIAN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_CLIENT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_DEFINITIVE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_DEFINITIVE_ADMIN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_TRADER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STOP_GUARDIAN_ENABLED","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRADING_GUARDIAN_TRADING_DISABLED","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WRAPPED_NATIVE_ASSET_ADDRESS","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address[]","name":"assetAddresses","type":"address[]"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"disableStopGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableWithdrawals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableStopGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableWithdrawals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"entryPoint","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"execute","outputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CoreAccountAbstraction.Call[]","name":"calls","type":"tuple[]"}],"name":"executeBatch","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"assetAddress","type":"address"}],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"account","type":"bytes"}],"name":"grantPasskeyClientRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"account","type":"bytes"}],"name":"grantPasskeyTraderRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address payable","name":"wrappedNativeAssetAddress","type":"address"}],"internalType":"struct BaseNativeWrapperConfig","name":"baseNativeWrapperConfig","type":"tuple"},{"components":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"address[]","name":"client","type":"address[]"},{"internalType":"address[]","name":"traders","type":"address[]"},{"internalType":"bytes[]","name":"passkeyClients","type":"bytes[]"},{"internalType":"bytes[]","name":"passkeyTraders","type":"bytes[]"}],"internalType":"struct CoreAccessControlConfig","name":"coreAccessControlConfig","type":"tuple"},{"internalType":"address","name":"_globalTradeGuardianOverride","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"account","type":"bytes"}],"name":"isPasskeyClient","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"account","type":"bytes"}],"name":"isPasskeyTrader","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"},{"internalType":"bytes","name":"_encodedSignature","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"account","type":"bytes"}],"name":"revokePasskeyClientRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"account","type":"bytes"}],"name":"revokePasskeyTraderRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supportsNativeAssets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"handler","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"swapToken","type":"address"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"bool","name":"isDelegate","type":"bool"},{"internalType":"bytes","name":"handlerCalldata","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct SwapPayload[]","name":"payloads","type":"tuple[]"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"uint256","name":"feePct","type":"uint256"}],"name":"swap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unwrapAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_globalTradeGuardian","type":"address"}],"name":"updateGlobalTradeGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"bytes32","name":"accountGasLimits","type":"bytes32"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"bytes32","name":"gasFees","type":"bytes32"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct CoreAccountAbstraction.PackedUserOperation","name":"userOp","type":"tuple"},{"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"internalType":"uint256","name":"missingAccountFunds","type":"uint256"}],"name":"validateUserOp","outputs":[{"internalType":"uint256","name":"validationData","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"erc20Token","type":"address"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"withdrawAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawAllTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"wrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.