ETH Price: $3,717.47 (+4.36%)

Contract

0x788A34AB9502A44ab4bD254eB0d9f6C713fcCb2b
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

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

Contract Source Code Verified (Exact Match)

Contract Name:
SwapDirector

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license
/**
 *Submitted for verification at Etherscan.io on 2022-06-17
*/

// File: @sheepdex/core/contracts/interfaces/IOperContract.sol
//SPDX-License-Identifier: Unlicensed

pragma solidity =0.7.6;

interface IOperContract {
    function operator() external view returns (address);

    function owner() external view returns (address);
}

// File: @sheepdex/core/contracts/interfaces/ISwapDirector.sol

pragma solidity =0.7.6;


interface ISwapDirector is IOperContract {
    function feeAmountTickSpacing(uint24 fee) external view returns (int24);
}

// File: @openzeppelin/contracts/utils/Context.sol



pragma solidity >=0.6.0 <0.8.0;

/*
 * @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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// File: @openzeppelin/contracts/access/Ownable.sol



pragma solidity ^0.7.0;

/**
 * @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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// File: @sheepdex/core/contracts/lib/Operatable.sol


pragma solidity =0.7.6;


// seperate owner and operator, operator is for daily devops, only owner can update operator
contract Operatable is Ownable {
    address public operator;

    event SetOperator(address indexed oldOperator, address indexed newOperator);

    constructor(){
        operator = msg.sender;
        emit SetOperator(address(0), operator);
    }

    modifier onlyOperator() {
        require(msg.sender == operator, 'not operator');
        _;
    }

    function setOperator(address newOperator) public onlyOwner {
        require(newOperator != address(0), 'bad new operator');
        address oldOperator = operator;
        operator = newOperator;
        emit SetOperator(oldOperator, newOperator);
    }
}

// File: @sheepdex/core/contracts/lib/CheckOper.sol


pragma solidity =0.7.6;



// seperate owner and operator, operator is for daily devops, only owner can update operator
contract CheckOper is IOperContract {
    Operatable public operatable;

    event SetOperatorContract(address indexed oldOperator, address indexed newOperator);

    constructor(address _oper){
        operatable = Operatable(_oper);
        emit SetOperatorContract(address(0), _oper);
    }

    modifier onlyOperator() {
        require(operatable.operator() == msg.sender, 'not operator');
        _;
    }

    modifier onlyOwner() {
        require(operatable.owner() == msg.sender, 'Ownable: caller is not the owner');
        _;
    }

    function operator() public view override returns (address) {
        return operatable.operator();
    }

    function owner() public view override returns (address) {
        return operatable.owner();
    }

    function setOperContract(address _oper) public onlyOwner {
        require(_oper != address(0), 'bad new operator');
        address oldOperator = _oper;
        operatable = Operatable(_oper);
        emit SetOperatorContract(oldOperator, _oper);
    }
}

// File: @sheepdex/core/contracts/SwapDirector.sol

pragma solidity =0.7.6;



contract SwapDirector is ISwapDirector, CheckOper {
    mapping(uint24 => int24) private _feeAmountTickSpacing;

    constructor(address _operatorMsg) CheckOper(_operatorMsg) {
        _feeAmountTickSpacing[500] = 10;
        _feeAmountTickSpacing[1000] = 20;
        _feeAmountTickSpacing[1500] = 30;
        _feeAmountTickSpacing[2000] = 40;
        _feeAmountTickSpacing[3000] = 60;
        _feeAmountTickSpacing[4000] = 80;
        _feeAmountTickSpacing[5000] = 100;
        _feeAmountTickSpacing[10000] = 200;
    }

    function feeAmountTickSpacing(uint24 fee) public view override returns (int24) {
        return _feeAmountTickSpacing[fee];
    }

    function enableFeeAmount(uint24 fee, int24 tickSpacing) public onlyOperator {
        require(fee < 1000000);
        require(tickSpacing > 0 && tickSpacing < 16384);
        require(_feeAmountTickSpacing[fee] == 0);
        _feeAmountTickSpacing[fee] = tickSpacing;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_operatorMsg","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOperator","type":"address"},{"indexed":true,"internalType":"address","name":"newOperator","type":"address"}],"name":"SetOperatorContract","type":"event"},{"inputs":[{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"}],"name":"enableFeeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"feeAmountTickSpacing","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatable","outputs":[{"internalType":"contract Operatable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oper","type":"address"}],"name":"setOperContract","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516106ea3803806106ea8339818101604052602081101561003357600080fd5b5051600080546001600160a01b0319166001600160a01b03831690811782556040518392907f3ccbb406b985dd76fe05e172b432487a2ff9fe4257642d3acc350f167cb1d577908290a3505060016020527f344a86d038cc67650617710ee5afca4f5d1ed60d199ecd86852cac7a55b2d3e5805462ffffff19908116600a179091557f0790f8f5f10ef420d1a97e2b257888a110d70632898b2fc5c5bea6575f303f8a8054821660141790557fdf8fbcd2e8050ff10755b1defc84e6a72827884928f329fe5f5d4c92e9ca46de80548216601e1790557f3879647cc4456ad7dd168b81456ef0da4226248e569453dd34f3f46bc5b806408054821660281790557f8bf1273959200f3b11670b7338c174c40286607d4b851c000be7fc007987b27580548216603c1790557fe6a882c28b874688802772f83f20d1b67e8d3d6f9ca53cf840007d1c000256618054821660501790557fc266c69354f8e54e67839ecd05d37f80bdb764bef2f09415cc79edcda055b14d8054821660641790556127106000527f1ca239af1d44623dfaa87ee0cbbbe4bbeb2112df36e66deedafd694350d045cd805490911660c81790556104f9806101f16000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630f589d631461006757806322afcccb1461008f57806348ee26a3146100c8578063570ca735146100ec5780638a7c195f146100f45780638da5cb5b1461011f575b600080fd5b61008d6004803603602081101561007d57600080fd5b50356001600160a01b0316610127565b005b6100b1600480360360208110156100a557600080fd5b503562ffffff1661028c565b6040805160029290920b8252519081900360200190f35b6100d06102a6565b604080516001600160a01b039092168252519081900360200190f35b6100d06102b5565b61008d6004803603604081101561010a57600080fd5b5062ffffff813516906020013560020b610335565b6100d0610474565b60005460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b15801561016b57600080fd5b505afa15801561017f573d6000803e3d6000fd5b505050506040513d602081101561019557600080fd5b50516001600160a01b0316146101f2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610240576040805162461bcd60e51b815260206004820152601060248201526f3130b2103732bb9037b832b930ba37b960811b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051839282917f3ccbb406b985dd76fe05e172b432487a2ff9fe4257642d3acc350f167cb1d5779190a35050565b62ffffff1660009081526001602052604090205460020b90565b6000546001600160a01b031681565b60008060009054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b815260040160206040518083038186803b15801561030457600080fd5b505afa158015610318573d6000803e3d6000fd5b505050506040513d602081101561032e57600080fd5b5051905090565b6000546040805163570ca73560e01b8152905133926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561037957600080fd5b505afa15801561038d573d6000803e3d6000fd5b505050506040513d60208110156103a357600080fd5b50516001600160a01b0316146103ef576040805162461bcd60e51b815260206004820152600c60248201526b3737ba1037b832b930ba37b960a11b604482015290519081900360640190fd5b620f42408262ffffff161061040357600080fd5b60008160020b13801561041a57506140008160020b125b61042357600080fd5b62ffffff8216600090815260016020526040902054600290810b900b1561044957600080fd5b62ffffff9182166000908152600160205260409020805462ffffff191660029290920b909216179055565b60008060009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561030457600080fdfea26469706673582212203feef8e3b0639ea59f6e6ca79727526cc35d5514c3d7a52e1bfaee8eb648f43d64736f6c6343000706003300000000000000000000000038e5fcd4b81f645d8f0a294efc88685f88880a9b

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c80630f589d631461006757806322afcccb1461008f57806348ee26a3146100c8578063570ca735146100ec5780638a7c195f146100f45780638da5cb5b1461011f575b600080fd5b61008d6004803603602081101561007d57600080fd5b50356001600160a01b0316610127565b005b6100b1600480360360208110156100a557600080fd5b503562ffffff1661028c565b6040805160029290920b8252519081900360200190f35b6100d06102a6565b604080516001600160a01b039092168252519081900360200190f35b6100d06102b5565b61008d6004803603604081101561010a57600080fd5b5062ffffff813516906020013560020b610335565b6100d0610474565b60005460408051638da5cb5b60e01b8152905133926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b15801561016b57600080fd5b505afa15801561017f573d6000803e3d6000fd5b505050506040513d602081101561019557600080fd5b50516001600160a01b0316146101f2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610240576040805162461bcd60e51b815260206004820152601060248201526f3130b2103732bb9037b832b930ba37b960811b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051839282917f3ccbb406b985dd76fe05e172b432487a2ff9fe4257642d3acc350f167cb1d5779190a35050565b62ffffff1660009081526001602052604090205460020b90565b6000546001600160a01b031681565b60008060009054906101000a90046001600160a01b03166001600160a01b031663570ca7356040518163ffffffff1660e01b815260040160206040518083038186803b15801561030457600080fd5b505afa158015610318573d6000803e3d6000fd5b505050506040513d602081101561032e57600080fd5b5051905090565b6000546040805163570ca73560e01b8152905133926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561037957600080fd5b505afa15801561038d573d6000803e3d6000fd5b505050506040513d60208110156103a357600080fd5b50516001600160a01b0316146103ef576040805162461bcd60e51b815260206004820152600c60248201526b3737ba1037b832b930ba37b960a11b604482015290519081900360640190fd5b620f42408262ffffff161061040357600080fd5b60008160020b13801561041a57506140008160020b125b61042357600080fd5b62ffffff8216600090815260016020526040902054600290810b900b1561044957600080fd5b62ffffff9182166000908152600160205260409020805462ffffff191660029290920b909216179055565b60008060009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561030457600080fdfea26469706673582212203feef8e3b0639ea59f6e6ca79727526cc35d5514c3d7a52e1bfaee8eb648f43d64736f6c63430007060033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000038e5fcd4b81f645d8f0a294efc88685f88880a9b

-----Decoded View---------------
Arg [0] : _operatorMsg (address): 0x38E5Fcd4B81F645D8F0A294eFC88685f88880a9B

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000038e5fcd4b81f645d8f0a294efc88685f88880a9b


Deployed Bytecode Sourcemap

5934:959:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5584:258;;;;;;;;;;;;;;;;-1:-1:-1;5584:258:0;-1:-1:-1;;;;;5584:258:0;;:::i;:::-;;6474:131;;;;;;;;;;;;;;;;-1:-1:-1;6474:131:0;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;4836:28;;;:::i;:::-;;;;-1:-1:-1;;;;;4836:28:0;;;;;;;;;;;;;;5362:106;;;:::i;6613:277::-;;;;;;;;;;;;;;;;-1:-1:-1;6613:277:0;;;;;;;;;;;:::i;5476:100::-;;;:::i;5584:258::-;5265:10;;:18;;;-1:-1:-1;;;5265:18:0;;;;5287:10;;-1:-1:-1;;;;;5265:10:0;;:16;;:18;;;;;;;;;;;;;;:10;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5265:18:0;-1:-1:-1;;;;;5265:32:0;;5257:77;;;;;-1:-1:-1;;;5257:77:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5660:19:0;::::1;5652:48;;;::::0;;-1:-1:-1;;;5652:48:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;5652:48:0;;;;;;;;;;;;;::::1;;5711:19;5749:30:::0;;-1:-1:-1;;;;;;5749:30:0::1;-1:-1:-1::0;;;;;5749:30:0;::::1;::::0;;::::1;::::0;;5795:39:::1;::::0;5749:30;;;;5795:39:::1;::::0;5711:19;5795:39:::1;5345:1;5584:258:::0;:::o;6474:131::-;6571:26;;6546:5;6571:26;;;:21;:26;;;;;;;;;6474:131::o;4836:28::-;;;-1:-1:-1;;;;;4836:28:0;;:::o;5362:106::-;5412:7;5439:10;;;;;;;;;-1:-1:-1;;;;;5439:10:0;-1:-1:-1;;;;;5439:19:0;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5439:21:0;;-1:-1:-1;5362:106:0;:::o;6613:277::-;5145:10;;:21;;;-1:-1:-1;;;5145:21:0;;;;5170:10;;-1:-1:-1;;;;;5145:10:0;;:19;;:21;;;;;;;;;;;;;;:10;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5145:21:0;-1:-1:-1;;;;;5145:35:0;;5137:60;;;;;-1:-1:-1;;;5137:60:0;;;;;;;;;;;;-1:-1:-1;;;5137:60:0;;;;;;;;;;;;;;;6714:7:::1;6708:3;:13;;;6700:22;;;::::0;::::1;;6755:1;6741:11;:15;;;:38;;;;;6774:5;6760:11;:19;;;6741:38;6733:47;;;::::0;::::1;;6799:26;::::0;::::1;;::::0;;;:21:::1;:26;::::0;;;;;::::1;::::0;;::::1;:31:::0;::::1;::::0;6791:40:::1;;;::::0;::::1;;6842:26;::::0;;::::1;;::::0;;;:21:::1;:26;::::0;;;;:40;;-1:-1:-1;;6842:40:0::1;;::::0;;;::::1;::::0;;::::1;;::::0;;6613:277::o;5476:100::-;5523:7;5550:10;;;;;;;;;-1:-1:-1;;;;;5550:10:0;-1:-1:-1;;;;;5550:16:0;;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Swarm Source

ipfs://3feef8e3b0639ea59f6e6ca79727526cc35d5514c3d7a52e1bfaee8eb648f43d

Block Transaction Difficulty 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
Loading...
Loading

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.