More Info
Private Name Tags
ContractCreator
Loading...
Loading
This contract contains unverified libraries: Trade
Minimal Proxy Contract for 0x41e0cd8fd276d4d940e9972e50e1895172723e89
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x79C97A37...D9Be65A3a The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Account
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; import {Errors} from "src/libraries/Errors.sol"; import {IAccount} from "src/q/interfaces/IAccount.sol"; import {IOperator} from "src/storage/interfaces/IOperator.sol"; /// @title Account /// @notice Contract which is cloned and deployed for every `trader` interacting with STFX or OZO contract Account is IAccount { /*////////////////////////////////////////////////////////////// STATE VARIABLES //////////////////////////////////////////////////////////////*/ address private immutable OPERATOR; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(address _operator) { OPERATOR = _operator; } receive() external payable {} /*////////////////////////////////////////////////////////////// EXTERNAL FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @notice function to execute trades logic /// @dev can only be called by a plugin /// @param adapter address of the contract to execute logic /// @param data calldata of the function to execute logic function execute(address adapter, bytes calldata data, uint256 ethToSend) external payable returns (bytes memory) { bool isPlugin = IOperator(OPERATOR).getPlugin(msg.sender); if (!isPlugin) revert Errors.NoAccess(); (bool success, bytes memory returnData) = adapter.call{value: ethToSend}(data); if (!success) revert Errors.CallFailed(returnData); return returnData; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; library Errors { // Zero Errors error ZeroAmount(); error ZeroAddress(); error ZeroTotalRaised(); error ZeroClaimableAmount(); // Modifier Errors error NotOwner(); error NotAdmin(); error CallerNotVault(); error CallerNotTrade(); error CallerNotVaultOwner(); error CallerNotGenerate(); error NoAccess(); error NotPlugin(); // State Errors error BelowMinFundraisingPeriod(); error AboveMaxFundraisingPeriod(); error BelowMinLeverage(); error AboveMaxLeverage(); error BelowMinEndTime(); error TradeTokenNotApplicable(); // STV errors error StvDoesNotExist(); error AlreadyOpened(); error MoreThanTotalRaised(); error MoreThanTotalReceived(); error StvNotOpen(); error StvNotClose(); error ClaimNotApplicable(); error StvStatusMismatch(); // General Errors error BalanceLessThanAmount(); error FundraisingPeriodEnded(); error TotalRaisedMoreThanCapacity(); error StillFundraising(); error CommandMisMatch(); error TradeCommandMisMatch(); error NotInitialised(); error Initialised(); error LengthMismatch(); error TransferFailed(); error DelegateCallFailed(); error CallFailed(bytes); error AccountAlreadyExists(); error SwapFailed(); error ExchangeDataMismatch(); error AccountNotExists(); error InputMismatch(); error AboveMaxDistributeIndex(); error BelowMinStvDepositAmount(); // Protocol specific errors error GmxFeesMisMatch(); error UpdateOrderRequestMisMatch(); error CancelOrderRequestMisMatch(); // Subscriptions error NotASubscriber(); error AlreadySubscribed(); error MoreThanLimit(); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; interface IAccount { function execute(address adapter, bytes calldata data, uint256 ethToSend) external payable returns (bytes memory returnData); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; interface IOperator { function getMaxDistributeIndex() external view returns (uint256); function getAddress(string calldata adapter) external view returns (address); function getAddresses(string[] calldata adapters) external view returns (address[] memory); function getTraderAccount(address trader) external view returns (address); function getPlugin(address plugin) external view returns (bool); function getPlugins(address[] calldata plugins) external view returns (bool[] memory); function setAddress(string calldata adapter, address addr) external; function setAddresses(string[] calldata adapters, address[] calldata addresses) external; function setPlugin(address plugin, bool isPlugin) external; function setPlugins(address[] calldata plugins, bool[] calldata isPlugin) external; function setTraderAccount(address trader, address account) external; function getAllSubscribers(address manager) external view returns (address[] memory); function getIsSubscriber(address manager, address subscriber) external view returns (bool); function getSubscriptionAmount(address manager, address subscriber) external view returns (uint96); function getTotalSubscribedAmountPerManager(address manager) external view returns (uint96); function setSubscribe(address manager, address subscriber, uint96 maxLimit) external; function setUnsubscribe(address manager, address subscriber) external; }
{ "remappings": [ "forge-std/=lib/forge-std/src/", "@synthetix/=src/interfaces/synthetix/", "@openzeppelin/=lib/openzeppelin-contracts/", "@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "solmate/=lib/solmate/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": { "src/Generate.sol": { "Generate": "0x74e0ca6e1ecfb462a80f3b7ab6840013ee32c1c5" }, "src/SpotTrade/SpotTrade.sol": { "SpotTrade": "0x019dfb87e218a07091c83cec604cb2d48fbdf194" }, "src/Trade.sol": { "Trade": "0x16766913fae839da226a669c76f04b2b5e2380a0" }, "src/libraries/BytesCheck.sol": { "BytesCheck": "0x3f3a5da6dbb99dc879a8ed2ec26c831da962231f" } } }
[{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"CallFailed","type":"error"},{"inputs":[],"name":"NoAccess","type":"error"},{"inputs":[{"internalType":"address","name":"adapter","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"ethToSend","type":"uint256"}],"name":"execute","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
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.