Contract 0xc808acb06077174333b31ae123c33c6559730035 1

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x90cf9c85b1f9b5c7478f14e4825dbf60d4d0971a0b6365ed7f008f7154bc1509Update Fees1521097562023-11-19 23:24:50100 days 18 hrs ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  0xc808acb06077174333b31ae123c33c65597300350 ETH0.000057520.1
0xc4ecca2e66c36bf8c18d5420b25eef8a06856d72682eff19e72b15385c81156aUpdate Fees1521095032023-11-19 23:23:37100 days 18 hrs ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  0xc808acb06077174333b31ae123c33c65597300350 ETH0.000057520.1
0x8c069c50e4eedd54c525b57005c507da98fe6400f6efdc9ba8ec23d3b594ba5bUpdate Fees1521093122023-11-19 23:22:49100 days 18 hrs ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  0xc808acb06077174333b31ae123c33c65597300350 ETH0.000052190.1
0xa6bf47fc2e09404bd891a639deda35d7bfa1cb5e35bcec210a8b668f3aea0cbfUpdate Fees1514724862023-11-17 23:51:00102 days 18 hrs ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  0xc808acb06077174333b31ae123c33c65597300350 ETH0.000054490.1
0x54e85f253bd50b3e0556abcd1b69def1996bd4de83bcb0703bf4c6b2dbaf42ddUpdate Fees1514723932023-11-17 23:50:31102 days 18 hrs ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  0xc808acb06077174333b31ae123c33c65597300350 ETH0.000054490.1
0xd619c3d7daa32bad00a2b883e3b30e5431e516c2335ddc47be94c3b0b2e4ec48Update Fees1514723212023-11-17 23:50:11102 days 18 hrs ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  0xc808acb06077174333b31ae123c33c65597300350 ETH0.000054490.1
0x48aa3ae98dee80e72f453ba8fc77a649ea1ba4589511c7ec0d3b4783a9df03aaRegister Option ...1497518042023-11-12 17:34:08108 days 39 mins ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  0xc808acb06077174333b31ae123c33c65597300350 ETH0.000085980.1
0x78cf621e1da3b1971706fd55d2ed88bf49b9526b8dd1b788f31c5099845d7ac3Register Option ...1497516622023-11-12 17:33:29108 days 40 mins ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  0xc808acb06077174333b31ae123c33c65597300350 ETH0.000085980.1
0xc1cdcaed49cc4a419404e52ba1e39f5dc7abc73b1e8564c6ded993309b1f7c1aRegister Option ...1497515572023-11-12 17:33:00108 days 40 mins ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  0xc808acb06077174333b31ae123c33c65597300350 ETH0.000085980.1
0x8e6ccd497ed5a0beefffcd51eadcbfb5669415d97f09f26bea43098b6311d34e0x608060401495050122023-11-11 23:23:12108 days 18 hrs ago0xee82496d3ed1f5afbeb9b29f3f59289fd899d9d0 IN  Create: DopexV2ClammFeeStrategy0 ETH0.00044510.1
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DopexV2ClammFeeStrategy

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 0 runs

Other Settings:
london EvmVersion
File 1 of 6 : DopexV2ClammFeeStrategy.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

// Interfaces
import {IERC20Metadata} from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {IDopexV2ClammFeeStrategy} from "./IDopexV2ClammFeeStrategy.sol";

// Contracts
import {Ownable} from "openzeppelin-contracts/contracts/access/Ownable.sol";

/// @title DopexV2ClammFeeStrategy
/// @author witherblock
/// @notice Computes the fee for an option purchase on Dopex V2 CLAMM
contract DopexV2ClammFeeStrategy is IDopexV2ClammFeeStrategy, Ownable {
    /// @dev Option Market address => bool (is registered or not)
    mapping(address => bool) public registeredOptionMarkets;

    /// @dev Option Market address => Fee Percentage (fee percentage on premium)
    mapping(address => uint256) public feePercentages;

    /// @dev The precision in which fee percent is set (fee percent should always be divided by 1e6 to get the correct vaue)
    uint256 public constant FEE_PERCENT_PRECISION = 1e4;

    /// @notice Registers an option market with the fee strategy
    /// @dev Can only be called by owner.
    /// @param _optionMarket Address of the option market
    /// @param _feePercentage Fee percentage
    function registerOptionMarket(
        address _optionMarket,
        uint256 _feePercentage
    ) external onlyOwner {
        registeredOptionMarkets[_optionMarket] = true;

        updateFees(_optionMarket, _feePercentage);

        emit OptionMarketRegistered(_optionMarket);
    }

    /// @notice Updates the fee struct of an option market
    /// @dev Can only be called by owner.
    /// @param _optionMarket Address of the option market
    /// @param _feePercentage Fee percentage
    function updateFees(
        address _optionMarket,
        uint256 _feePercentage
    ) public onlyOwner {
        require(
            _feePercentage < FEE_PERCENT_PRECISION * 100,
            "Fee percentage cannot be 100% or more"
        );

        feePercentages[_optionMarket] = _feePercentage;

        emit FeeUpdate(_optionMarket, _feePercentage);
    }

    /// @inheritdoc	IDopexV2ClammFeeStrategy
    function onFeeReqReceive(
        address _optionMarket,
        uint256,
        uint256,
        uint256 _premium
    ) external view returns (uint256 fee) {
        uint256 feePercentage = feePercentages[_optionMarket];

        if (!registeredOptionMarkets[_optionMarket]) {
            revert OptionMarketNotRegistered(_optionMarket);
        }

        fee = (feePercentage * _premium) / (FEE_PERCENT_PRECISION * 100);
    }

    error OptionMarketNotRegistered(address optionMarket);

    event OptionMarketRegistered(address optionMarket);

    event FeeUpdate(address optionMarket, uint256 feePercentages);
}

File 2 of 6 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 3 of 6 : IDopexV2ClammFeeStrategy.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IDopexV2ClammFeeStrategy {
    /// @notice Computes the fee for an option purchase on Dopex V2 CLAMM
    /// @param _optionMarket Address of the option market
    /// @param _amount Notional Amount
    /// @param _iv Implied Volatility
    /// @param _premium Total premium being charged for the option purchase
    /// @return fee the computed fee
    function onFeeReqReceive(
        address _optionMarket,
        uint256 _amount,
        uint256 _iv,
        uint256 _premium
    ) external view returns (uint256 fee);
}

File 4 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @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() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 6 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 6 of 6 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^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 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;
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "v3-core/=lib/v3-core/",
    "v3-periphery/=lib/v3-periphery/contracts/",
    "@uniswap/v3-core/=lib/v3-core/",
    "base64-sol/=lib/openzeppelin-contracts/contracts/utils/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 0
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"optionMarket","type":"address"}],"name":"OptionMarketNotRegistered","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"optionMarket","type":"address"},{"indexed":false,"internalType":"uint256","name":"feePercentages","type":"uint256"}],"name":"FeeUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"optionMarket","type":"address"}],"name":"OptionMarketRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"FEE_PERCENT_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feePercentages","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_optionMarket","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"_premium","type":"uint256"}],"name":"onFeeReqReceive","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_optionMarket","type":"address"},{"internalType":"uint256","name":"_feePercentage","type":"uint256"}],"name":"registerOptionMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"registeredOptionMarkets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_optionMarket","type":"address"},{"internalType":"uint256","name":"_feePercentage","type":"uint256"}],"name":"updateFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6105928061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100835760003560e01c80630b964988146100885780634328ea43146100bb57806356c2d309146100ee578063715018a6146101035780638da5cb5b1461010b57806395958ab514610120578063a7fa088b14610133578063b09c4c061461013c578063f2fde38b1461014f575b600080fd5b6100a8610096366004610474565b60026020526000908152604090205481565b6040519081526020015b60405180910390f35b6100de6100c9366004610474565b60016020526000908152604090205460ff1681565b60405190151581526020016100b2565b6101016100fc366004610496565b610162565b005b6101016101d5565b6101136101e9565b6040516100b291906104c0565b61010161012e366004610496565b6101f8565b6100a861271081565b6100a861014a3660046104d4565b6102bf565b61010161015d366004610474565b610330565b61016a6103a9565b6001600160a01b0382166000908152600160208190526040909120805460ff1916909117905561019a82826101f8565b7f969cf6acb76f10dc15d6ac6a3d7e9ef65e8680dcfe5f4fb9b73624067dc49543826040516101c991906104c0565b60405180910390a15050565b6101dd6103a9565b6101e76000610408565b565b6000546001600160a01b031690565b6102006103a9565b61020d612710606461050d565b811061026e5760405162461bcd60e51b815260206004820152602560248201527f4665652070657263656e746167652063616e6e6f742062652031303025206f72604482015264206d6f726560d81b60648201526084015b60405180910390fd5b6001600160a01b038216600081815260026020908152604091829020849055815192835282018390527fa12973bd1c09e4ec46288dc2a7ccb9b337e197c7ffad7a179ecae62a90830afd91016101c9565b6001600160a01b038416600090815260026020908152604080832054600190925282205460ff16610305578560405163010e87b960e51b815260040161026591906104c0565b610312612710606461050d565b61031c848361050d565b610326919061053a565b9695505050505050565b6103386103a9565b6001600160a01b03811661039d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610265565b6103a681610408565b50565b336103b26101e9565b6001600160a01b0316146101e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610265565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461046f57600080fd5b919050565b60006020828403121561048657600080fd5b61048f82610458565b9392505050565b600080604083850312156104a957600080fd5b6104b283610458565b946020939093013593505050565b6001600160a01b0391909116815260200190565b600080600080608085870312156104ea57600080fd5b6104f385610458565b966020860135965060408601359560600135945092505050565b600081600019048311821515161561053557634e487b7160e01b600052601160045260246000fd5b500290565b60008261055757634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220a0feceadd3119532395825738adcf7aedc367143ddaf60b2ac0777df64d77d2164736f6c634300080f0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100835760003560e01c80630b964988146100885780634328ea43146100bb57806356c2d309146100ee578063715018a6146101035780638da5cb5b1461010b57806395958ab514610120578063a7fa088b14610133578063b09c4c061461013c578063f2fde38b1461014f575b600080fd5b6100a8610096366004610474565b60026020526000908152604090205481565b6040519081526020015b60405180910390f35b6100de6100c9366004610474565b60016020526000908152604090205460ff1681565b60405190151581526020016100b2565b6101016100fc366004610496565b610162565b005b6101016101d5565b6101136101e9565b6040516100b291906104c0565b61010161012e366004610496565b6101f8565b6100a861271081565b6100a861014a3660046104d4565b6102bf565b61010161015d366004610474565b610330565b61016a6103a9565b6001600160a01b0382166000908152600160208190526040909120805460ff1916909117905561019a82826101f8565b7f969cf6acb76f10dc15d6ac6a3d7e9ef65e8680dcfe5f4fb9b73624067dc49543826040516101c991906104c0565b60405180910390a15050565b6101dd6103a9565b6101e76000610408565b565b6000546001600160a01b031690565b6102006103a9565b61020d612710606461050d565b811061026e5760405162461bcd60e51b815260206004820152602560248201527f4665652070657263656e746167652063616e6e6f742062652031303025206f72604482015264206d6f726560d81b60648201526084015b60405180910390fd5b6001600160a01b038216600081815260026020908152604091829020849055815192835282018390527fa12973bd1c09e4ec46288dc2a7ccb9b337e197c7ffad7a179ecae62a90830afd91016101c9565b6001600160a01b038416600090815260026020908152604080832054600190925282205460ff16610305578560405163010e87b960e51b815260040161026591906104c0565b610312612710606461050d565b61031c848361050d565b610326919061053a565b9695505050505050565b6103386103a9565b6001600160a01b03811661039d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610265565b6103a681610408565b50565b336103b26101e9565b6001600160a01b0316146101e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610265565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461046f57600080fd5b919050565b60006020828403121561048657600080fd5b61048f82610458565b9392505050565b600080604083850312156104a957600080fd5b6104b283610458565b946020939093013593505050565b6001600160a01b0391909116815260200190565b600080600080608085870312156104ea57600080fd5b6104f385610458565b966020860135965060408601359560600135945092505050565b600081600019048311821515161561053557634e487b7160e01b600052601160045260246000fd5b500290565b60008261055757634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220a0feceadd3119532395825738adcf7aedc367143ddaf60b2ac0777df64d77d2164736f6c634300080f0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.