S Price: $0.475511 (+5.42%)

Contract

0x67fe5F916A0CC5bB457fEFF86dDa68649db92F6B

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Admin131822402025-03-12 4:51:1230 hrs ago1741755072IN
0x67fe5F91...49db92F6B
0 S0.0015435255
Approve B Token131822362025-03-12 4:51:0930 hrs ago1741755069IN
0x67fe5F91...49db92F6B
0 S0.0038711255
Set Executor131822322025-03-12 4:51:0630 hrs ago1741755066IN
0x67fe5F91...49db92F6B
0 S0.002808955
Set Implementati...131821112025-03-12 4:50:0130 hrs ago1741755001IN
0x67fe5F91...49db92F6B
0 S0.0025933655

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Orderbook

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 3 : Orderbook.sol
// 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())
            }
        }
    }
}

File 2 of 3 : OrderbookStorage.sol
// 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;

}

File 3 of 3 : Admin.sol
// 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);
    }

}

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

Contract Security Audit

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"}]

608060405234801561001057600080fd5b50600080546001600160a01b031916339081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c9060200160405180910390a1610424806100686000396000f3fe60806040526004361061007f5760003560e01c8063793b8c6d1161004e578063793b8c6d14610188578063c34c08e51461022d578063d784d4261461024d578063f851a4401461026d57610086565b80630a5cfdf1146100b85780635b8d9775146101035780635c60da1b14610130578063704b6c021461016857610086565b3661008657005b6001546001600160a01b03163660008037600080366000845af43d6000803e8080156100b1573d6000f35b3d6000fd5b005b3480156100c457600080fd5b506100f06100d33660046103a2565b600460209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561010f57600080fd5b506100f061011e3660046103cc565b60056020526000908152604090205481565b34801561013c57600080fd5b50600154610150906001600160a01b031681565b6040516001600160a01b0390911681526020016100fa565b34801561017457600080fd5b506100b66101833660046103cc565b61028d565b34801561019457600080fd5b506101f16101a33660046103a2565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460049093015460ff8316946001600160a01b0361010090940484169492939092169086565b6040805196151587526001600160a01b0395861660208801528601939093526060850191909152909116608083015260a082015260c0016100fa565b34801561023957600080fd5b50600254610150906001600160a01b031681565b34801561025957600080fd5b506100b66102683660046103cc565b61030d565b34801561027957600080fd5b50600054610150906001600160a01b031681565b6000546001600160a01b031633146102b857604051634755657960e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c906020015b60405180910390a150565b6000546001600160a01b0316331461033857604051634755657960e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f6b70829fcbe4891157f7a7496f9870927de3c8237adbe9cd39bae09b7382c40990602001610302565b80356001600160a01b038116811461039d57600080fd5b919050565b600080604083850312156103b557600080fd5b6103be83610386565b946020939093013593505050565b6000602082840312156103de57600080fd5b6103e782610386565b939250505056fea264697066735822122029e90d1b056c10db831ed7a27d3aa58c82356da07b89420fe76ce1cd80930f7464736f6c63430008140033

Deployed Bytecode

0x60806040526004361061007f5760003560e01c8063793b8c6d1161004e578063793b8c6d14610188578063c34c08e51461022d578063d784d4261461024d578063f851a4401461026d57610086565b80630a5cfdf1146100b85780635b8d9775146101035780635c60da1b14610130578063704b6c021461016857610086565b3661008657005b6001546001600160a01b03163660008037600080366000845af43d6000803e8080156100b1573d6000f35b3d6000fd5b005b3480156100c457600080fd5b506100f06100d33660046103a2565b600460209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561010f57600080fd5b506100f061011e3660046103cc565b60056020526000908152604090205481565b34801561013c57600080fd5b50600154610150906001600160a01b031681565b6040516001600160a01b0390911681526020016100fa565b34801561017457600080fd5b506100b66101833660046103cc565b61028d565b34801561019457600080fd5b506101f16101a33660046103a2565b600360208181526000938452604080852090915291835291208054600182015460028301549383015460049093015460ff8316946001600160a01b0361010090940484169492939092169086565b6040805196151587526001600160a01b0395861660208801528601939093526060850191909152909116608083015260a082015260c0016100fa565b34801561023957600080fd5b50600254610150906001600160a01b031681565b34801561025957600080fd5b506100b66102683660046103cc565b61030d565b34801561027957600080fd5b50600054610150906001600160a01b031681565b6000546001600160a01b031633146102b857604051634755657960e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c906020015b60405180910390a150565b6000546001600160a01b0316331461033857604051634755657960e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f6b70829fcbe4891157f7a7496f9870927de3c8237adbe9cd39bae09b7382c40990602001610302565b80356001600160a01b038116811461039d57600080fd5b919050565b600080604083850312156103b557600080fd5b6103be83610386565b946020939093013593505050565b6000602082840312156103de57600080fd5b6103e782610386565b939250505056fea264697066735822122029e90d1b056c10db831ed7a27d3aa58c82356da07b89420fe76ce1cd80930f7464736f6c63430008140033

Block Transaction Gas Used Reward
view all blocks ##produced##

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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.