Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Orderbook
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "./OrderbookStorage.sol"; contract Orderbook is OrderbookStorage { event NewImplementation(address newImplementation); function setImplementation(address newImplementation) external _onlyAdmin_ { implementation = newImplementation; emit NewImplementation(newImplementation); } receive() external payable {} fallback() external payable { address imp = implementation; assembly { calldatacopy(0, 0, calldatasize()) let result := delegatecall(gas(), imp, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) switch result case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "./utils/Admin.sol"; abstract contract OrderbookStorage is Admin { address public implementation; bool internal _mutex; modifier _reentryLock_() { require(!_mutex, "Router: reentry"); _mutex = true; _; _mutex = false; } address public executor; struct Order { bool isLite; address account; uint256 pTokenId; bytes32 symbolId; address bToken; int256 bAmount; int256[] orderParams; // 0:trigerPrice, 1:isAboveTrigerPrice, 2: isIndexPrice int256[] tradeParams; // 0:volume, 1: priceLimit } // account -> index -> Order mapping (address => mapping(uint256 => Order)) public orders; // account -> index -> executionFee mapping (address => mapping(uint256 => uint256)) public executionFees; mapping (address => uint256) public ordersIndex; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; abstract contract Admin { error OnlyAdmin(); event NewAdmin(address newAdmin); address public admin; modifier _onlyAdmin_() { if (msg.sender != admin) { revert OnlyAdmin(); } _; } constructor () { admin = msg.sender; emit NewAdmin(admin); } /** * @notice Set a new admin for the contract. * @dev This function allows the current admin to assign a new admin address without performing any explicit verification. * It's the current admin's responsibility to ensure that the 'newAdmin' address is correct and secure. * @param newAdmin The address of the new admin. */ function setAdmin(address newAdmin) external _onlyAdmin_ { admin = newAdmin; emit NewAdmin(newAdmin); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"OnlyAdmin","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newImplementation","type":"address"}],"name":"NewImplementation","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"executionFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"executor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"orders","outputs":[{"internalType":"bool","name":"isLite","type":"bool"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"pTokenId","type":"uint256"},{"internalType":"bytes32","name":"symbolId","type":"bytes32"},{"internalType":"address","name":"bToken","type":"address"},{"internalType":"int256","name":"bAmount","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"ordersIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"setImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b50600080546001600160a01b031916339081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c9060200160405180910390a1610424806100686000396000f3fe60806040526004361061007f5760003560e01c8063793b8c6d1161004e578063793b8c6d14610188578063c34c08e51461022d578063d784d4261461024d578063f851a4401461026d57610086565b80630a5cfdf1146100b85780635b8d9775146101035780635c60da1b14610130578063704b6c021461016857610086565b3661008657005b6001546001600160a01b03163660008037600080366000845af43d6000803e8080156100b1573d6000f35b3d6000fd5b005b3480156100c457600080fd5b506100f06100d33660046103a2565b600460209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561010f57600080fd5b506100f061011e3660046103cc565b60056020526000908152604090205481565b34801561013c57600080fd5b50600154610150906001600160a01b031681565b6040516001600160a01b0390911681526020016100fa565b34801561017457600080fd5b506100b66101833660046103cc565b61028d565b34801561019457600080fd5b506101f16101a33660046103a2565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460049093015460ff8316946001600160a01b0361010090940484169492939092169086565b6040805196151587526001600160a01b0395861660208801528601939093526060850191909152909116608083015260a082015260c0016100fa565b34801561023957600080fd5b50600254610150906001600160a01b031681565b34801561025957600080fd5b506100b66102683660046103cc565b61030d565b34801561027957600080fd5b50600054610150906001600160a01b031681565b6000546001600160a01b031633146102b857604051634755657960e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c906020015b60405180910390a150565b6000546001600160a01b0316331461033857604051634755657960e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f6b70829fcbe4891157f7a7496f9870927de3c8237adbe9cd39bae09b7382c40990602001610302565b80356001600160a01b038116811461039d57600080fd5b919050565b600080604083850312156103b557600080fd5b6103be83610386565b946020939093013593505050565b6000602082840312156103de57600080fd5b6103e782610386565b939250505056fea264697066735822122029e90d1b056c10db831ed7a27d3aa58c82356da07b89420fe76ce1cd80930f7464736f6c63430008140033
Deployed Bytecode
0x60806040526004361061007f5760003560e01c8063793b8c6d1161004e578063793b8c6d14610188578063c34c08e51461022d578063d784d4261461024d578063f851a4401461026d57610086565b80630a5cfdf1146100b85780635b8d9775146101035780635c60da1b14610130578063704b6c021461016857610086565b3661008657005b6001546001600160a01b03163660008037600080366000845af43d6000803e8080156100b1573d6000f35b3d6000fd5b005b3480156100c457600080fd5b506100f06100d33660046103a2565b600460209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561010f57600080fd5b506100f061011e3660046103cc565b60056020526000908152604090205481565b34801561013c57600080fd5b50600154610150906001600160a01b031681565b6040516001600160a01b0390911681526020016100fa565b34801561017457600080fd5b506100b66101833660046103cc565b61028d565b34801561019457600080fd5b506101f16101a33660046103a2565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460049093015460ff8316946001600160a01b0361010090940484169492939092169086565b6040805196151587526001600160a01b0395861660208801528601939093526060850191909152909116608083015260a082015260c0016100fa565b34801561023957600080fd5b50600254610150906001600160a01b031681565b34801561025957600080fd5b506100b66102683660046103cc565b61030d565b34801561027957600080fd5b50600054610150906001600160a01b031681565b6000546001600160a01b031633146102b857604051634755657960e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c906020015b60405180910390a150565b6000546001600160a01b0316331461033857604051634755657960e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f6b70829fcbe4891157f7a7496f9870927de3c8237adbe9cd39bae09b7382c40990602001610302565b80356001600160a01b038116811461039d57600080fd5b919050565b600080604083850312156103b557600080fd5b6103be83610386565b946020939093013593505050565b6000602082840312156103de57600080fd5b6103e782610386565b939250505056fea264697066735822122029e90d1b056c10db831ed7a27d3aa58c82356da07b89420fe76ce1cd80930f7464736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.